register(contract, sender, proposalID, currency, approved?)

Feature

Returns an operation to register to vote. If the parameter approved is given, the voting power is delegated to the account. Can use it only within the ‘registration period’.

Parameters

string contract address, string sender, string proposal ID, string currency ID, string (Optional) approved

Return Value

object register operation

example

const contractAddress = "0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca";
const sender = "0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca";
const proposalID = "test_proposal";
const currencyID = "MCC";
const approved = "0x07469989b2562afF5E5C3B116CD3AA5Ef814e5a1fca"
const registOperation = mitum.dao.register(contractAddress, sender, proposalID, currencyID, approved);

console.log(registOperation);

// output
Operation {
  id: 'mitum',
  fact: RegisterFact {
    hint: Hint { s: 'mitum-dao-register-operation-fact' },
    token: Token { s: '2023-10-18 05:29:26.71 +0000 UTC' },
    _hash: <Buffer >,
    sender: Address {
      s: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
      type: 'mitum'
    },
    contract: Address {
      s: '0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca',
      type: 'mitum'
    },
    currency: CurrencyID { s: 'MCC' },
    proposalID: 'test_proposal',
    approved: Address {
      s: '0x07469989b2562afF5E5C3B116CD3AA5Ef814e5a1fca',
      type: 'mitum'
    }
  },
  hint: Hint { s: 'mitum-dao-register-operation' },
  _factSigns: [],
  _hash: <Buffer >
}

Last updated