Skip to content

Latest commit

 

History

History
132 lines (99 loc) · 5.83 KB

Issuance1.md

File metadata and controls

132 lines (99 loc) · 5.83 KB

Issuance1

Build & Model A FAT-0 Issuance

Kind: global class
Access: public

new Issuance(builder)

Param Type Description
builder IssuanceBuilder | Object The IssuanceBuilder or object to construct the issuance from

issuance1.getChainId() ⇒ string

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

issuance1.getTokenId() ⇒ string

Get the token ID string for this token issuance

Kind: instance method of Issuance1
Returns: string - - The token ID string chosen by the issuer

issuance1.getIssuerChainId() ⇒ string

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

issuance1.getEntryhash() ⇒ string

Get the entryhash of this issuance object. Only populated for entries parsed from fatd

Kind: instance method of Issuance1
Returns: string - - The Factom Entryhash

issuance1.getTimestamp() ⇒ number

Get the timestamp in unix seconds of when this issuance object was signed

Kind: instance method of Issuance1
Returns: number - - The signing timestamp

issuance1.getType() ⇒ string

Get the type string constant of which type of FAT token this issuance represent

Kind: instance method of Issuance1
Returns: string - - Returns "FAT-1"

issuance1.getSymbol() ⇒ string

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

issuance1.getSupply() ⇒ BigNumber

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

issuance1.getMetadata() ⇒ *

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)

issuance1.getChain() ⇒ Chain

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

issuance1.getEntry() ⇒ Entry

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