registerModel(contract, sender, currency)

Feature

Returns raw operation that creates a new 'Credential model'. Note : The contract address must be deployed on the Mitum network. Handler of contract also can execute the function.

Parameters

string contract address, string sender, string currency ID

Return Value

object register model operation

example

const contractAddress = "0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca";
const sender = "0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca";
const currencyID = "MCC";

const operation = mitum.credential.registerModel(contractAddress,sender,currencyID);
console.log(operation);

// output
Operation {
  id: 'mitum',
  fact: ReigsterModelFact {
    hint: Hint { s: 'mitum-credential-reigster-model-operation-fact' },
    token: Token { s: '2023-10-12 02:12:32.462 +0000 UTC' },
    _hash: <Buffer 8b 17 d4 d6 23 17 e6 a5 83 4a 38 70 d0 c2 be ad 82 52 e2 96 a6 4d c7 4b dc 1d 97 8e a7 4a 59 93>,
    sender: Address {
      s: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
      type: 'mitum'
    },
    contract: Address {
      s: '0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca',
      type: 'mitum'
    },
    currency: CurrencyID { s: 'MCC' }
  },
  hint: Hint { s: 'mitum-credential-register-model-operation' },
  _factSigns: [],
  _hash: <Buffer >
}

Last updated