Client for ORDAO system.

Hierarchy

  • ORClientReader
    • ORClient

Constructors

Properties

_cfg: Config
_clientToNode: ClientToNodeTransformer
_ctx: ORContext
_nodeToClient: NodeToClientTransformer
_vetoLength: undefined | number
_voteLength: undefined | number

Accessors

  • get context(): ORContext
  • Context for ORDAO. From it you can get components of ORDAO:

    • Smart contracts;
    • Contract runner;
    • Used endpoints (for ORNode and Ethereum RPC API)

    Returns ORContext

Methods

  • Return new instance that authors OREC transactions as signer.

    Parameters

    • signer: Signer

      ethers.Signer implementation that should be used to sign transactions

    Returns ORClient

    • new instance of ORClient.
  • Execute a passed proposal. Will fail if proposal is not passed yet.

    Parameters

    • propId: string

      id of proposal to execute.

    Returns Promise<ExecRes>

    await c.execute("0x2f5e1602a2e1ccc9cf707bc57361ae6587cd87e8ae27105cae38c0db12f4fab1")
    
  • Get metadata of specific Respect award NTT. Throws if token is not found or is burned.

    Parameters

    • tokenId: string

      id of a token.

    Returns Promise<{
        description?: string;
        image?: string;
        name: string;
        properties: {
            burn?: null | {
                burnReason?: string;
                burnTxHash?: string;
            };
            denomination: number;
            groupNum?: number;
            level?: number;
            mintProposalId?: string;
            mintTs?: number;
            mintTxHash?: string;
            mintType: number;
            periodNumber: number;
            reason?: string;
            recipient: string;
            title?: string;
            tokenId: string;
        };
    }>

    Throws if token is not found or is burned.

  • Get metadata of Respect award NTTs, sorted from latest to oldest.

    Parameters

    • Optionalspec: {
          before?: Date;
          burned?: boolean;
          limit?: number;
          recipient?: string;
          tokenIdFilter?: string[];
      } | {
          burned?: boolean;
          limit?: number;
          recipient?: string;
          skip?: number;
          tokenIdFilter?: string[];
      } | {
          burned?: boolean;
          limit?: number;
          recipient?: string;
          tokenIdFilter?: string[];
      }

      specification for a query

      • before - newest mint date for a token. If specified, only tokens which were created up to this date will be returned;
      • limit - maximum number of tokens to return. If not specified, it's up to ornode implementation.
      • recipient - recipient of the awards. If specified only awards which belong to this account are returned.
      • burned - whether to return burned tokens or not. Default: false.

    Returns Promise<{
        description?: string;
        image?: string;
        name: string;
        properties: {
            burn?: null | {
                burnReason?: string;
                burnTxHash?: string;
            };
            denomination: number;
            groupNum?: number;
            level?: number;
            mintProposalId?: string;
            mintTs?: number;
            mintTxHash?: string;
            mintType: number;
            periodNumber: number;
            reason?: string;
            recipient: string;
            title?: string;
            tokenId: string;
        };
    }[]>

    list of token metadata objects sorted by mint datetime from latest to oldest.

    • By default this function does not return burned awards. Set burned in the spec to true to change this behaviour.
    await c.getAwards() // Return latest awards unfiltered
    await c.getAwards({ before: new Date("2024-08-30T11:42:59.000Z"), limit: 50 }) // Return up to 50 awards that happened before the specified date
    await c.getAwards({ recipient: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" }) // Get latest awards belonging to specified accounts
  • Get last meeting number (which is equal to current period number).

    Returns Promise<number>

  • Get next meeting number (which is current period number + 1).

    Returns Promise<number>

  • Get amount of old (parent) Respect an account has.

    Parameters

    • account: string

    Returns Promise<string>

  • Get a proposal by id or by OffchainPropId.

    Behavior:

    • If id is a PropId (bytes32), this returns the earliest-created instance for that id to preserve legacy links that referenced only the on-chain id.
    • If id is an OffchainPropId ({ id, createTxHash }), this returns the exact instance created by the given transaction.

    Parameters

    • id: string | {
          createTxHash: string;
          id: string;
      }

      PropId or { id, createTxHash }

    Returns Promise<{
        addr?: string;
        cancelTxHash?: string;
        cdata?: any;
        createTime: Date;
        createTxHash?: string;
        decoded?:
            | {
                groupNum: number;
                meetingNum: number;
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                mintData: string;
                propType: "respectBreakout";
                rankings: string[];
            }
            | {
                groupNum: number;
                meetingNum: number;
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                mintData: string;
                propType: "respectBreakoutX2";
                rankings: string[];
            }
            | {
                account: string;
                groupNum?: number;
                meetingNum: number;
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                mintType: number;
                propType: "respectAccount";
                reason: string;
                title: string;
                tokenId: string;
                value: bigint;
            }
            | {
                awards: {
                    account: string;
                    groupNum?: number;
                    meetingNum: number;
                    mintType: number;
                    reason: string;
                    title: string;
                    tokenId: string;
                    value: bigint;
                }[];
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                propType: "respectAccountBatch";
            }
            | {
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                propType: "burnRespect";
                reason: string;
                tokenId: string;
            }
            | {
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                propType: "burnRespectBatch";
                reason: string;
                tokenIds: string[];
            }
            | {
                data: string;
                link?: string;
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                propType: "customSignal";
                signalType: number;
            }
            | {
                data?: string;
                link?: string;
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                propType: "tick";
            }
            | {
                address: string;
                cdata: string;
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                propType: "customCall";
            }
            | {
                canceledId: string;
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                propType: "cancelProposal";
            }
            | {
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                newVetoLen: bigint;
                newVoteLen: bigint;
                propType: "setPeriods";
            }
            | {
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                newMinWeight: string;
                propType: "setMinWeight";
            }
            | {
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                newMaxLiveYesVotes: number;
                propType: "setMaxLiveYesVotes";
            };
        execError?: {
            args: any[];
            data: null | string;
            name: null | string;
            reason: null | string;
            selector: null | string;
            signature: null | string;
            type: ErrorType;
        };
        executeTxHash?: string;
        id: string;
        memo?: any;
        noWeight?: string;
        stage:
            | "Voting"
            | "Veto"
            | "Execution"
            | "Expired";
        status:
            | "NotExecuted"
            | "Executed"
            | "ExecutionFailed"
            | "Canceled";
        vetoTimeLeftMs: ((...args: unknown[]) => number);
        voteStatus:
            | "Passing"
            | "Failing"
            | "Passed"
            | "Failed";
        voteTimeLeftMs: ((...args: unknown[]) => number);
        yesWeight?: string;
    }>

    // Legacy: first instance with this on-chain id
    await c.getProposal("0x2f5e1602a2e1ccc9cf707bc57361ae6587cd87e8ae27105cae38c0db12f4fab1")
    // Specific instance by offchain identifier
    await c.getProposal({ id: "0x...", createTxHash: "0x..." })
  • Get proposals ordered from latest to oldest.

    Parameters

    • Optionalspec: {
          before?: number;
          execStatFilter?: (
              | "NotExecuted"
              | "Executed"
              | "ExecutionFailed"
              | "Canceled")[];
          idFilter?: string;
          limit?: number;
          stageFilter?: (
              | "Voting"
              | "Veto"
              | "Execution"
              | "Expired")[];
          voteStatFilter?: (
              | "Passing"
              | "Failing"
              | "Passed"
              | "Failed")[];
      } | {
          execStatFilter?: (
              | "NotExecuted"
              | "Executed"
              | "ExecutionFailed"
              | "Canceled")[];
          idFilter?: string;
          limit?: number;
          skip?: number;
          stageFilter?: (
              | "Voting"
              | "Veto"
              | "Execution"
              | "Expired")[];
          voteStatFilter?: (
              | "Passing"
              | "Failing"
              | "Passed"
              | "Failed")[];
      } | {
          execStatFilter?: (
              | "NotExecuted"
              | "Executed"
              | "ExecutionFailed"
              | "Canceled")[];
          idFilter?: string;
          limit?: number;
          stageFilter?: (
              | "Voting"
              | "Veto"
              | "Execution"
              | "Expired")[];
          voteStatFilter?: (
              | "Passing"
              | "Failing"
              | "Passed"
              | "Failed")[];
      }

      Query specification:

      • before - newest allowed creation timestamp; only proposals created up to this time are returned.
      • limit - maximum number of proposals to return.
      • execStatFilter - filter by execution status (includes "Canceled"). If undefined, no exec-status filtering.
      • voteStatFilter - filter by vote status. If undefined, no vote-status filtering.
      • stageFilter - filter by stage. If undefined, no stage filtering.
      • idFilter - filter by a specific PropId when supported by the server.

    Returns Promise<{
        addr?: string;
        cancelTxHash?: string;
        cdata?: any;
        createTime: Date;
        createTxHash?: string;
        decoded?:
            | {
                groupNum: number;
                meetingNum: number;
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                mintData: string;
                propType: "respectBreakout";
                rankings: string[];
            }
            | {
                groupNum: number;
                meetingNum: number;
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                mintData: string;
                propType: "respectBreakoutX2";
                rankings: string[];
            }
            | {
                account: string;
                groupNum?: number;
                meetingNum: number;
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                mintType: number;
                propType: "respectAccount";
                reason: string;
                title: string;
                tokenId: string;
                value: bigint;
            }
            | {
                awards: {
                    account: string;
                    groupNum?: number;
                    meetingNum: number;
                    mintType: number;
                    reason: string;
                    title: string;
                    tokenId: string;
                    value: bigint;
                }[];
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                propType: "respectAccountBatch";
            }
            | {
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                propType: "burnRespect";
                reason: string;
                tokenId: string;
            }
            | {
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                propType: "burnRespectBatch";
                reason: string;
                tokenIds: string[];
            }
            | {
                data: string;
                link?: string;
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                propType: "customSignal";
                signalType: number;
            }
            | {
                data?: string;
                link?: string;
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                propType: "tick";
            }
            | {
                address: string;
                cdata: string;
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                propType: "customCall";
            }
            | {
                canceledId: string;
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                propType: "cancelProposal";
            }
            | {
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                newVetoLen: bigint;
                newVoteLen: bigint;
                propType: "setPeriods";
            }
            | {
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                newMinWeight: string;
                propType: "setMinWeight";
            }
            | {
                metadata: {
                    propDescription?: string;
                    propTitle?: string;
                };
                newMaxLiveYesVotes: number;
                propType: "setMaxLiveYesVotes";
            };
        execError?: {
            args: any[];
            data: null | string;
            name: null | string;
            reason: null | string;
            selector: null | string;
            signature: null | string;
            type: ErrorType;
        };
        executeTxHash?: string;
        id: string;
        memo?: any;
        noWeight?: string;
        stage:
            | "Voting"
            | "Veto"
            | "Execution"
            | "Expired";
        status:
            | "NotExecuted"
            | "Executed"
            | "ExecutionFailed"
            | "Canceled";
        vetoTimeLeftMs: ((...args: unknown[]) => number);
        voteStatus:
            | "Passing"
            | "Failing"
            | "Passed"
            | "Failed";
        voteTimeLeftMs: ((...args: unknown[]) => number);
        yesWeight?: string;
    }[]>

    Proposals sorted from latest to oldest.

    await c.getProposals()
    
  • Get metadata of fungible non-transferrable Respect token.

    Returns Promise<{
        decimals: 0;
        description?: string;
        image?: string;
        name?: string;
        properties?: {};
    }>

  • Get amount of Respect an account has.

    Parameters

    • account: string

    Returns Promise<bigint>

  • Get metadata of specific token. The token can be fungible Respect token or Respect award token (NTT).

    Parameters

    • tokenId: string

      id of a token.

    Returns Promise<{
        decimals?: number;
        description?: string;
        image?: string;
        name?: string;
        properties?: {};
    }>

    Throws if token is not found or is burned.

  • Get vote time remaining for a proposal (in milliseconds)

    Returns Promise<number>

  • Get information on votes submitted on proposals. Votes returned are sorted from newest to oldest.

    Parameters

    • Optionalspec: {
          before?: Date;
          limit?: number;
          minWeight?: string;
          propFilter?: string[];
          voterFilter?: string[];
          voteType?: "Yes" | "No";
      }

      specification for a query

      • before - newest possible date of a vote. If specified, only votes made up to this date will be returned.
      • limit - maximum number of objects to return. If not specified it is up to implementation of ornode.
      • propFilter - list of proposal ids. If specified, then only votes on proposals in this list are returned.
      • voterFilter - list of ethereum addresses. If specified, only votes from this list of accounts are returned.
      • minWeight - minimum vote weight. If specified, only votes which have equal or greater weight are returned.
      • voteType - Yes / No. If specified only votes of specified type are returned.
      • Optionalbefore?: Date
      • Optionallimit?: number
      • OptionalminWeight?: string
      • OptionalpropFilter?: string[]
      • OptionalvoterFilter?: string[]
      • OptionalvoteType?: "Yes" | "No"

    Returns Promise<{
        date?: Date;
        memo?: string;
        proposalId: string;
        txHash?: string;
        vote: "None" | "Yes" | "No";
        voter: string;
        weight: string;
    }[]>

    await c.getVotes({ 
    voterFilter: [ "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", "0xcd3B766CCDd6AE721141F452C550Ca635964ce71" ],
    propFilter: [ "0xcc55ee4f4b5d61a9b90b5a5d915d8e7edede19e26b1a68be043d837654313760" ],
    limit: 10,
    minWeight: 1
    })
  • Parameters

    • propType:
          | "respectBreakout"
          | "respectBreakoutX2"
          | "respectAccount"
          | "respectAccountBatch"
          | "burnRespect"
          | "burnRespectBatch"
          | "customSignal"
          | "tick"
          | "customCall"
          | "setPeriods"
          | "setMinWeight"
          | "setMaxLiveYesVotes"
          | "cancelProposal"
    • req:
          | {
              address: string;
              cdata: string;
              metadata: {
                  propDescription?: string;
                  propTitle?: string;
              };
          }
          | {
              data?: string;
              link?: string;
              metadata?: {
                  propDescription?: string;
                  propTitle?: string;
              };
          }
          | {
              data: string;
              link?: string;
              metadata?: {
                  propDescription?: string;
                  propTitle?: string;
              };
              signalType: number;
          }
          | {
              metadata?: {
                  propDescription?: string;
                  propTitle?: string;
              };
              reason: string;
              tokenId: string;
          }
          | {
              metadata?: {
                  propDescription?: string;
                  propTitle?: string;
              };
              reason: string;
              tokenIds: string[];
          }
          | {
              awards: {
                  account: string;
                  groupNum?: number;
                  meetingNum?: number;
                  mintType?: number;
                  reason: string;
                  title: string;
                  value: bigint;
              }[];
              metadata?: {
                  propDescription?: string;
                  propTitle?: string;
              };
          }
          | {
              account: string;
              groupNum?: number;
              meetingNum?: number;
              metadata?: {
                  propDescription?: string;
                  propTitle?: string;
              };
              mintType?: number;
              reason: string;
              title: string;
              value: bigint;
          }
          | {
              groupNum: number;
              meetingNum?: number;
              metadata?: {
                  propDescription?: string;
                  propTitle?: string;
              };
              rankings: string[];
          }
          | {
              groupNum: number;
              meetingNum?: number;
              metadata?: {
                  propDescription?: string;
                  propTitle?: string;
              };
              rankings: string[];
          }
          | {
              metadata?: {
                  propDescription?: string;
                  propTitle?: string;
              };
              newVetoLen: bigint;
              newVoteLen: bigint;
          }
          | {
              metadata?: {
                  propDescription?: string;
                  propTitle?: string;
              };
              newMinWeight: number;
          }
          | {
              metadata?: {
                  propDescription?: string;
                  propTitle?: string;
              };
              newMaxLiveYesVotes: number;
          }
          | {
              canceledId: string;
              metadata?: {
                  propDescription?: string;
                  propTitle?: string;
              };
          }
    • vote: {
          memo?: string;
          vote?: "None" | "Yes" | "No";
      } = ...
      • Optionalmemo?: string
      • Optionalvote?: "None" | "Yes" | "No"

    Returns Promise<ProposeRes>

  • Create a proposal to award respect game participants of a single breakout room, based on results of that breakout room.

    Parameters

    • request: {
          groupNum: number;
          meetingNum?: number;
          metadata?: {
              propDescription?: string;
              propTitle?: string;
          };
          rankings: string[];
      }

      breakout room results, plus optional metadata.

      • groupNum: number
      • OptionalmeetingNum?: number
      • Optionalmetadata?: {
            propDescription?: string;
            propTitle?: string;
        }
        • OptionalpropDescription?: string
        • OptionalpropTitle?: string
      • rankings: string[]
    • vote: {
          memo?: string;
          vote?: "None" | "Yes" | "No";
      } = ...

      vote to submit with the result. Default: { vote: "Yes" }.

      • Optionalmemo?: string
      • Optionalvote?: "None" | "Yes" | "No"

    Returns Promise<ProposeRes>

    resulting proposal and its status.

    The respect amounts to award are calculated automatically based on rankings:

    • Level 6 - 55
    • Level 5 - 34
    • Level 4 - 21
    • Level 3 - 13
    • Level 2 - 8
    • Level 1 - 5

    The actual onchain proposal is just for minting Respect according to distribution above.

    If vote parameter is not specified "Yes" vote is submitted. If you want to make this proposal but don't want to vote for it, specify { vote: "None" }.

    await c.proposeBreakoutResult(
    {
    meetingNum: 1,
    groupNum: 1,
    rankings: [
    "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
    "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
    "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
    "0x90F79bf6EB2c4f870365E785982E1f101E93b906"
    ]
    },
    {
    memo: "Some memo",
    vote: "Yes"
    }
    )
  • Create a proposal to award respect game participants of a single breakout room, based on results of that breakout room. Double respect distribution from the standard one.

    Parameters

    • request: {
          groupNum: number;
          meetingNum?: number;
          metadata?: {
              propDescription?: string;
              propTitle?: string;
          };
          rankings: string[];
      }

      breakout room results, plus optional metadata.

      • groupNum: number
      • OptionalmeetingNum?: number
      • Optionalmetadata?: {
            propDescription?: string;
            propTitle?: string;
        }
        • OptionalpropDescription?: string
        • OptionalpropTitle?: string
      • rankings: string[]
    • vote: {
          memo?: string;
          vote?: "None" | "Yes" | "No";
      } = ...

      vote to submit with the result. Default: { vote: "Yes" }.

      • Optionalmemo?: string
      • Optionalvote?: "None" | "Yes" | "No"

    Returns Promise<ProposeRes>

    resulting proposal and its status.

    The respect amounts to award are calculated automatically based on rankings:

    • Level 6 - 110
    • Level 5 - 68
    • Level 4 - 42
    • Level 3 - 26
    • Level 2 - 16
    • Level 1 - 10

    The actual onchain proposal is just for minting Respect according to distribution above.

    If vote parameter is not specified "Yes" vote is submitted. If you want to make this proposal but don't want to vote for it, specify { vote: "None" }.

  • Create a proposal to burn a single Respect award.

    Parameters

    • req: {
          metadata?: {
              propDescription?: string;
              propTitle?: string;
          };
          reason: string;
          tokenId: string;
      }

      specification for the award to burn, plus optional metadata.

      • Optionalmetadata?: {
            propDescription?: string;
            propTitle?: string;
        }
        • OptionalpropDescription?: string
        • OptionalpropTitle?: string
      • reason: string
      • tokenId: string
    • vote: {
          memo?: string;
          vote?: "None" | "Yes" | "No";
      } = ...

      vote to submit with the result. Default: { vote: "Yes" }.

      • Optionalmemo?: string
      • Optionalvote?: "None" | "Yes" | "No"

    Returns Promise<ProposeRes>

    resulting proposal and its status.

    If vote parameter is not specified "Yes" vote is submitted. If you want to make this proposal but don't want to vote for it, specify { vote: "None" }.

    await c.proposeBurnRespect(
    {
    tokenId: "0x000000010000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266",
    reason: "some optional reason"
    },
    {
    memo: "Some memo",
    vote: "Yes"
    }
    );
  • Create a proposal to burn multiple Respect awards at once.

    Parameters

    • req: {
          metadata?: {
              propDescription?: string;
              propTitle?: string;
          };
          reason: string;
          tokenIds: string[];
      }

      specification with a list of tokenIds to burn plus optional metadata and reason.

      • Optionalmetadata?: {
            propDescription?: string;
            propTitle?: string;
        }
        • OptionalpropDescription?: string
        • OptionalpropTitle?: string
      • reason: string
      • tokenIds: string[]
    • vote: {
          memo?: string;
          vote?: "None" | "Yes" | "No";
      } = ...

      vote to submit with the result. Default: { vote: "Yes" }.

      • Optionalmemo?: string
      • Optionalvote?: "None" | "Yes" | "No"

    Returns Promise<ProposeRes>

    resulting proposal and its status.

    If vote parameter is not specified "Yes" vote is submitted. If you want to make this proposal but don't want to vote for it, specify { vote: "None" }.

    await c.proposeBurnRespectBatch({
    tokenIds: [
    "0x000000010000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266",
    "0x00000001000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c8"
    ],
    reason: "cleanup"
    })
  • Create a proposal to cancel a live proposal on OREC by its id.

    Parameters

    • req: {
          canceledId: string;
          metadata?: {
              propDescription?: string;
              propTitle?: string;
          };
      }
      • canceledId: string
      • Optionalmetadata?: {
            propDescription?: string;
            propTitle?: string;
        }
        • OptionalpropDescription?: string
        • OptionalpropTitle?: string
    • vote: {
          memo?: string;
          vote?: "None" | "Yes" | "No";
      } = ...
      • Optionalmemo?: string
      • Optionalvote?: "None" | "Yes" | "No"

    Returns Promise<ProposeRes>

  • Create a proposal to an EVM call to some contract.

    Parameters

    • req: {
          address: string;
          cdata: string;
          metadata: {
              propDescription?: string;
              propTitle?: string;
          };
      }

      specification for the EVM message to send.

      • address: string
      • cdata: string
      • metadata: {
            propDescription?: string;
            propTitle?: string;
        }
        • OptionalpropDescription?: string
        • OptionalpropTitle?: string
    • vote: {
          memo?: string;
          vote?: "None" | "Yes" | "No";
      } = ...

      vote to submit with the result. Default: { vote: "Yes" }.

      • Optionalmemo?: string
      • Optionalvote?: "None" | "Yes" | "No"

    Returns Promise<ProposeRes>

    resulting proposal and its status.

    If vote parameter is not specified "Yes" vote is submitted. If you want to make this proposal but don't want to vote for it, specify { vote: "None" }.

  • Create a proposal to issue a custom signal event from OREC contract.

    Parameters

    • req: {
          data: string;
          link?: string;
          metadata?: {
              propDescription?: string;
              propTitle?: string;
          };
          signalType: number;
      }
      • data: string
      • Optionallink?: string
      • Optionalmetadata?: {
            propDescription?: string;
            propTitle?: string;
        }
        • OptionalpropDescription?: string
        • OptionalpropTitle?: string
      • signalType: number
    • vote: {
          memo?: string;
          vote?: "None" | "Yes" | "No";
      } = ...
      • Optionalmemo?: string
      • Optionalvote?: "None" | "Yes" | "No"

    Returns Promise<ProposeRes>

  • Propose to mint multiple Respect awards at once.

    Parameters

    • req: {
          awards: {
              account: string;
              groupNum?: number;
              meetingNum?: number;
              mintType?: number;
              reason: string;
              title: string;
              value: bigint;
          }[];
          metadata?: {
              propDescription?: string;
              propTitle?: string;
          };
      }
      • awards: {
            account: string;
            groupNum?: number;
            meetingNum?: number;
            mintType?: number;
            reason: string;
            title: string;
            value: bigint;
        }[]
      • Optionalmetadata?: {
            propDescription?: string;
            propTitle?: string;
        }
        • OptionalpropDescription?: string
        • OptionalpropTitle?: string
    • vote: {
          memo?: string;
          vote?: "None" | "Yes" | "No";
      } = ...
      • Optionalmemo?: string
      • Optionalvote?: "None" | "Yes" | "No"

    Returns Promise<ProposeRes>

  • Propose to mint a single Respect award to a single account.

    Parameters

    • req: {
          account: string;
          groupNum?: number;
          meetingNum?: number;
          metadata?: {
              propDescription?: string;
              propTitle?: string;
          };
          mintType?: number;
          reason: string;
          title: string;
          value: bigint;
      }

      specification for the Respect award, plus optional metadata.

      • account: string
      • OptionalgroupNum?: number
      • OptionalmeetingNum?: number
      • Optionalmetadata?: {
            propDescription?: string;
            propTitle?: string;
        }
        • OptionalpropDescription?: string
        • OptionalpropTitle?: string
      • OptionalmintType?: number
      • reason: string
      • title: string
      • value: bigint
    • vote: {
          memo?: string;
          vote?: "None" | "Yes" | "No";
      } = ...

      vote to submit with the result. Default: { vote: "Yes" }.

      • Optionalmemo?: string
      • Optionalvote?: "None" | "Yes" | "No"

    Returns Promise<ProposeRes>

    resulting proposal and its status.

    If vote parameter is not specified "Yes" vote is submitted. If you want to make this proposal but don't want to vote for it, specify { vote: "None" }.

    await c.proposeRespectTo({
    meetingNum: 1,
    mintType: 1,
    account: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
    value: 10n,
    title: "Reward Title",
    reason: "Reward reason"
    })
  • Propose to set the maximum number of simultaneous live "Yes" votes a voter can have.

    Parameters

    • req: {
          metadata?: {
              propDescription?: string;
              propTitle?: string;
          };
          newMaxLiveYesVotes: number;
      }

      new max live yes votes (0-255)

      • Optionalmetadata?: {
            propDescription?: string;
            propTitle?: string;
        }
        • OptionalpropDescription?: string
        • OptionalpropTitle?: string
      • newMaxLiveYesVotes: number
    • vote: {
          memo?: string;
          vote?: "None" | "Yes" | "No";
      } = ...

      vote to submit with the result. Default: { vote: "Yes" }.

      • Optionalmemo?: string
      • Optionalvote?: "None" | "Yes" | "No"

    Returns Promise<ProposeRes>

  • Propose to set new minimum passing weight (minWeight) on OREC.

    Parameters

    • req: {
          metadata?: {
              propDescription?: string;
              propTitle?: string;
          };
          newMinWeight: number;
      }

      new minimum weight

      • Optionalmetadata?: {
            propDescription?: string;
            propTitle?: string;
        }
        • OptionalpropDescription?: string
        • OptionalpropTitle?: string
      • newMinWeight: number
    • vote: {
          memo?: string;
          vote?: "None" | "Yes" | "No";
      } = ...

      vote to submit with the result. Default: { vote: "Yes" }.

      • Optionalmemo?: string
      • Optionalvote?: "None" | "Yes" | "No"

    Returns Promise<ProposeRes>

    resulting proposal and its status.

    If vote parameter is not specified "Yes" vote is submitted. If you want to make this proposal but don't want to vote for it, specify { vote: "None" }.

  • Propose to set new vote and veto period lengths.

    Parameters

    • req: {
          metadata?: {
              propDescription?: string;
              propTitle?: string;
          };
          newVetoLen: bigint;
          newVoteLen: bigint;
      }

      new period lengths

      • Optionalmetadata?: {
            propDescription?: string;
            propTitle?: string;
        }
        • OptionalpropDescription?: string
        • OptionalpropTitle?: string
      • newVetoLen: bigint
      • newVoteLen: bigint
    • vote: {
          memo?: string;
          vote?: "None" | "Yes" | "No";
      } = ...

      vote to submit with the result. Default: { vote: "Yes" }.

      • Optionalmemo?: string
      • Optionalvote?: "None" | "Yes" | "No"

    Returns Promise<ProposeRes>

    resulting proposal and its status.

    If vote parameter is not specified "Yes" vote is submitted. If you want to make this proposal but don't want to vote for it, specify { vote: "None" }.

  • Create a proposal to issue a tick signal. Tick signals increment the period / meeting number returned by orclient (see ORClient#getPeriodNum).

    Parameters

    • req: {
          data?: string;
          link?: string;
          metadata?: {
              propDescription?: string;
              propTitle?: string;
          };
      } = {}

      optional metadata to submit with a tick signal

      • Optionaldata?: string
      • Optionallink?: string
      • Optionalmetadata?: {
            propDescription?: string;
            propTitle?: string;
        }
        • OptionalpropDescription?: string
        • OptionalpropTitle?: string
    • vote: {
          memo?: string;
          vote?: "None" | "Yes" | "No";
      } = ...

      vote to submit with the result. Default: { vote: "Yes" }.

      • Optionalmemo?: string
      • Optionalvote?: "None" | "Yes" | "No"

    Returns Promise<ProposeRes>

    resulting proposal and its status.

    If vote parameter is not specified "Yes" vote is submitted. If you want to make this proposal but don't want to vote for it, specify { vote: "None" }.

    await c.proposeTick();
    
  • Vote on a proposal.

    Parameters

    • propId: string

      id of a proposal to vote on.

    • vote: "None" | "Yes" | "No"

      what to vote for.

      • 'Yes' - vote for proposals;
      • 'No' - vote against;
    • Optionalmemo: string

      memo text string to submit with proposal.

    Returns Promise<OnchainActionRes>

    Note that memo string with go with calldata of transaction, so longer string will cost more.

    await c.vote("0x2f5e1602a2e1ccc9cf707bc57361ae6587cd87e8ae27105cae38c0db12f4fab1", "Yes")
    
  • Vote on a proposal.

    Parameters

    • request: {
          memo?: string;
          propId: string;
          vote: "None" | "Yes" | "No";
      }

      parameters for a vote as an object. See ORClient#vote.

      • Optionalmemo?: string
      • propId: string
      • vote: "None" | "Yes" | "No"

    Returns Promise<OnchainActionRes>

    hash of submitted transaction

    Note that memo string with go with calldata of transaction, so longer string will cost more.

    await c.vote({
    propId: "0x2f5e1602a2e1ccc9cf707bc57361ae6587cd87e8ae27105cae38c0db12f4fab1",
    vote: "Yes",
    memo: "Optional memo"
    })