Build & Model A FAT-0 Issuance
Kind: global class
Access: public
- Issuance1
- new Issuance(builder)
- .getChainId() ⇒
string
- .getTokenId() ⇒
string
- .getIssuerChainId() ⇒
string
- .getEntryhash() ⇒
string
- .getTimestamp() ⇒
number
- .getType() ⇒
string
- .getSymbol() ⇒
string
- .getSupply() ⇒
BigNumber
- .getMetadata() ⇒
*
- .getChain() ⇒
Chain
- .getEntry() ⇒
Entry
Param | Type | Description |
---|---|---|
builder | IssuanceBuilder | Object |
The IssuanceBuilder or object to construct the issuance from |
Get the Factom Chain ID for this token issuance
Kind: instance method of Issuance1
Returns: string
- - The Factom Chain ID calculated from rootChainID and tokenId
Get the token ID string for this token issuance
Kind: instance method of Issuance1
Returns: string
- - The token ID string chosen by the issuer
Get identity's Factom Chain ID string for this token
Kind: instance method of Issuance1
Returns: string
- - The token ID string chosen by the issuer
Get the entryhash of this issuance object. Only populated for entries parsed from fatd
Kind: instance method of Issuance1
Returns: string
- - The Factom Entryhash
Get the timestamp in unix seconds of when this issuance object was signed
Kind: instance method of Issuance1
Returns: number
- - The signing timestamp
Get the type string constant of which type of FAT token this issuance represent
Kind: instance method of Issuance1
Returns: string
- - Returns "FAT-1"
Get the symbol string of this FAT token represent. E.x. MYT
Kind: instance method of Issuance1
Returns: string
- - The symbol string chosen by the issuer
Get the maximum circulating supply for this FAT token issuance
Kind: instance method of Issuance1
Returns: BigNumber
- [supply=-1] - The maximum number of circulating tokens allowed
Get the metadata included with the FAT token issuance, if present
Kind: instance method of Issuance1
Returns: *
- - The issuances's metadata (if present, undefined if not)
Get the Chain object representing the the token chain, including the first entry (chain establishment entry) Can be submitted directly to Factom using factom-js. After the chain is established the signed issuance entry may be placed on the new chain to issue the token (via getEntry())
Kind: instance method of Issuance1
Returns: Chain
- - The Chain object for the issuance
See: https://github.com/PaulBernier/factomjs/blob/master/src/chain.js
Get the Entry object representing the initialization entry (token establishment entry) Can be submitted directly to Factom
Kind: instance method of Issuance1
Returns: Entry
- - The complete entry establishing the token's issuance
See: https://github.com/PaulBernier/factomjs/blob/master/src/entry.js
Example
const {FactomCli, Entry, Chain} = require('factom');
const cli = new FactomCli(); // Default factomd connection to localhost:8088 and walletd connection to localhost:8089
const tokenChainId = '013de826902b7d075f00101649ca4fa7b49b5157cba736b2ca90f67e2ad6e8ec';
const issuance = new IssuanceBuilder("mytoken", "888888d027c59579fc47a6fc6c4a5c0409c7c39bc38a86cb5fc0069978493762", "sk11pz4AG9XgB1eNVkbppYAWsgyg7sftDXqBASsagKJqvVRKYodCU")
.symbol('TTK')
.supply(1000000)
.metadata({'abc': 123})
.build();
//"cast" the chain and entry objects to prevent compatibility issues
const chain = new Chain(Entry.builder(issuance.getChain().firstEntry).build());
const entry = Entry.builder(issuance.getEntry()).build();
await cli.add(chain, "Es32PjobTxPTd73dohEFRegMFRLv3X5WZ4FXEwNN8kE2pMDfeMym"); //create the token chain on Factom
await cli.add(entry, "Es32PjobTxPTd73dohEFRegMFRLv3X5WZ4FXEwNN8kE2pMDfeMym"); //commit the signed issuance entry to the token chain