Base CLI object. Provides an interfaces to access fatd daemon calls & get token CLI objects
Kind: global class
Access: protected
- CLI
- new CLI(builder)
- .call(method, params) ⇒
Promise
- .getTokenCLI(tokenChainId, [type]) ⇒
Promise
- .getTokenCLISync(tokenChainId, type) ⇒
BaseTokenCLI
- .getTrackedTokens() ⇒
Promise
- .getDaemonProperties() ⇒
Promise
- .getSyncStatus() ⇒
Promise
- .getBalances(address) ⇒
Promise
- .getCompatibility() ⇒
Object
Param | Type | Description |
---|---|---|
builder | CLIBuilder |
A CLIBuilder object |
Example
const CLIBuilder = require('fat-js').CLIBuilder
let cli = new CLIBuilder()
.host('fatnode.mysite.com')
.port(8078)
.timeout(3500) //optional, timeout ms
.build();
Provide a method to do a raw call to the fatd RPC endpoint, allow arbitrary RPC method name and params object
Kind: instance method of CLI
Param | Type | Description |
---|---|---|
method | string |
The method name string to call |
params | object |
The params object to submit |
Generate a CLI object that allows calls about token specific data. Will automatically determine token type async if not specified
Kind: instance method of CLI
Param | Type | Description |
---|---|---|
tokenChainId | string |
The Factom chain ID of the token to get the CLI for |
[type] | string |
Optional type string of the token to get the CLI for. Must be Either "FAT-0" or "FAT-1". If specified overrides auto-detection |
clI.getTokenCLISync(tokenChainId, type) ⇒ BaseTokenCLI
Generate a CLI object that allows calls about token specific data synchronously
Kind: instance method of CLI
Param | Type | Description |
---|---|---|
tokenChainId | string |
The Factom chain ID of the token to get the CLI for |
type | string |
The type string of the object to submit. Must be Either "FAT-0" or "FAT-1" |
Get all the tokens that are currently tracked by the FAT daemon
Kind: instance method of CLI
Get the properties of the FAT daemon
Kind: instance method of CLI
Get the Factom sync status of the FAT daemon
Kind: instance method of CLI
Get the numeric token balance counts for all tracked tokens for a public Factoid address
Kind: instance method of CLI
Param | Type | Description |
---|---|---|
address | string |
The public Factoid address to get all token balances for |
Get an array of compatibility warnings for the connected fatd node. Zero elements returned means full compatibility
Kind: instance method of CLI
Returns: Object
- [] - The array of compatibility error objects