Skip to content

Latest commit

 

History

History
108 lines (77 loc) · 3.98 KB

CLI.md

File metadata and controls

108 lines (77 loc) · 3.98 KB

CLI

Base CLI object. Provides an interfaces to access fatd daemon calls & get token CLI objects

Kind: global class
Access: protected

new CLI(builder)

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();

clI.call(method, params) ⇒ Promise

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

clI.getTokenCLI(tokenChainId, [type]) ⇒ Promise

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"

clI.getTrackedTokens() ⇒ Promise

Get all the tokens that are currently tracked by the FAT daemon

Kind: instance method of CLI

clI.getDaemonProperties() ⇒ Promise

Get the properties of the FAT daemon

Kind: instance method of CLI

clI.getSyncStatus() ⇒ Promise

Get the Factom sync status of the FAT daemon

Kind: instance method of CLI

clI.getBalances(address) ⇒ Promise

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

clI.getCompatibility() ⇒ Object

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