registerModel(contract, sender, currency, name, symbol, decimal?, initialSupply?)
Feature
Returns raw operation that register a new token model. Note: Handler of contract also can execute the function.
Parameters
string
contract address,
string
sender,
string
currency ID,
string
name,
string
symbol, //must consist of uppercase letters.
string
| int
(Optional) decimal,
string
| int
(Optional) initialSupply
Return Value
object
register model operation
example
const contractAddress = "0xeD6aAe65BEB871870916fD6659238Db35E2F97c5fca";
const sender = "0xB8dE7113DE470Ab89304A954939126FA97a812dcfca";
const currencyID = "MIT";
const name = "CBA_TOKEN";
const symbol = "CBA";
const decimal = 9;
const initialSupply = 10000000;
const op = mitum.token.registerModel(contractAddress, sender, currencyID, name, symbol, decimal, initialSupply);
console.log(op);
Operation {
id: 'mitum',
fact: RegisterModelFact {
hint: Hint { s: 'mitum-token-register-model-operation-fact' },
token: Token { s: '2024-06-25 05:31:51.12 +0000 UTC' },
_hash: <Buffer 50 26 ad b4 e2 3e 54 52 2c f4 90 12 23 b2 0c ec f2 d1 45 86 34 0d 6c f7 1c d5 10 ee 46 1b 5a 5c>,
sender: Address {
s: '0xB8dE7113DE470Ab89304A954939126FA97a812dcfca',
type: 'mitum'
},
contract: Address {
s: '0xeD6aAe65BEB871870916fD6659238Db35E2F97c5fca',
type: 'mitum'
},
currency: CurrencyID { s: 'MIT' },
symbol: CurrencyID { s: 'CBA' },
name: LongString { s: 'CBA_TOKEN' },
decimal: Big { big: 9n },
initialSupply: Big { big: 10000000n }
},
hint: Hint { s: 'mitum-token-register-model-operation' },
_factSigns: [],
_hash: <Buffer >
}
Last updated