registerModel(contract, sender, currency, name, symbol, decimal?, initialSupply?)

Feature

Return raw operation for creating new storage model. Note: Contract account must be deployed on the mitum network. Handler of contract also can execute the function.

Parameters

string contract address, string sender, string project name, (max length is 10) string currency ID,

Return Value

object register-model operation

example

const contract = "0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca";
const sender = "0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca";
const project = "my project"
const currencyId = "MCC";

const reigsterStorageOperation = mitum.storage.registerModel(contract, sender, project, currencyId);
console.log(reigsterStorageOperation);

// output
Operation {
  id: 'mitum',
  fact: RegisterModelFact {
    hint: Hint { s: 'mitum-storage-register-model-operation-fact' },
    token: Token { s: '2024-08-22 05:41:11.405 +0000 UTC' },
    _hash: <Buffer ef 90 37 0a f4 a3 22 2f d0 9a ec cc 2d 50 4c 0c 3b c0 ad 96 ef ff 06 e5 ce fc be b0 4f e5 d9 53>,
    sender: Address {
      s: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
      type: 'mitum'
    },
    contract: Address {
      s: '0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca',
      type: 'mitum'
    },
    currency: CurrencyID { s: 'MCC' },
    project: LongString { s: 'my project' }
  },
  hint: Hint { s: 'mitum-storage-register-model-operation' },
  _factSigns: [],
  _hash: <Buffer >
}

Last updated