# Table of contents - [Api](#api) - [Classes](#classes) - [Functions](#functions) - [Typedefs](#typedefs) ### Api This library provides api blockchain methods. To fetch objects you can use `Api`: ```javascript import echo from 'echojs-lib'; try { await echo.connect('ws://127.0.0.1:9000'); const result = await echo.api.getAssets(['1.3.0']); console.log(result); } catch (e) { console.error(e); } ``` ## Classes
API instance
## Functions
getObjects(objectIds, force) ⇒ Promise.<Array.<Object>>
getObject(objectId, force) ⇒ Promise.<Object>
checkERC20Token(contractId) ⇒ Promise.<boolean>
getBlockHeader(blockNum) ⇒ Promise.<BlockHeader>
getBlock(blockNum) ⇒ Promise.<Block>
getTransaction(blockNum, transactionIndex) ⇒ Promise.<Transaction>
getChainProperties(force) ⇒ Promise.<ChainProperties>
getGlobalProperties() ⇒ Promise.<GlobalProperties>
getConfig(force) ⇒ Promise.<Config>
getChainId(force) ⇒ Promise.<String>
getDynamicGlobalProperties() ⇒ Promise.<DynamicGlobalProperties>
getKeyReferences(keys, force) ⇒ Promise.<Array.<*>>
getAccounts(accountIds, force) ⇒ Promise.<Array.<Account>>
getFullAccounts(accountNamesOrIds, subscribe, force) ⇒ Promise.<Array.<FullAccount>>
getAccountByName(accountName, force) ⇒ Promise.<Account>
getAccountReferences(accountId, force) ⇒ Promise.<Object>
lookupAccountNames(accountNames, force) ⇒ Promise.<Array.<Account>>
lookupAccounts(lowerBoundName, limit) ⇒ Promise.<Array.<AccountName, AccountId>>
getAccountCount() ⇒ Promise.<Number>
getAccountBalances(accountId, assetIds, force) ⇒ Promise.<Object>
getNamedAccountBalances(accountName, assetIds, force) ⇒ Promise.<Object>
getVestedBalances(balanceIds) ⇒ Promise.<*>
getVestingBalances(accountId) ⇒ Promise.<*>
getAssets(assetIds, force) ⇒ Promise.<Array.<Asset>>
listAssets(lowerBoundSymbol, limit) ⇒ Promise.<Array.<Asset>>
lookupAssetSymbols(symbolsOrIds, force) ⇒ Promise.<Array.<Asset>>
getMarginPositions(accountId) ⇒ Promise.<*>
getTicker(baseAssetName, quoteAssetName) ⇒ Promise.<*>
get24Volume(baseAssetName, quoteAssetName) ⇒ Promise.<*>
getTradeHistory(baseAssetName, quoteAssetName, start, stop, limit) ⇒ Promise.<*>
getCommitteeMembers(committeeMemberIds, force) ⇒ Promise.<Array.<Committee>>
getCommitteeMemberByAccount(accountId, force) ⇒ Promise.<Committee>
lookupCommitteeMemberAccounts(lowerBoundName, limit) ⇒ Promise.<*>
getTransactionHex(transaction) ⇒ Promise.<*>
getRequiredSignatures(transaction, availableKeys) ⇒ Promise.<*>
getPotentialSignatures(transaction) ⇒ Promise.<*>
verifyAuthority(transaction) ⇒ Promise.<*>
verifyAccountAuthority(accountNameOrId, signers) ⇒ Promise.<*>
validateTransaction(transaction) ⇒ Promise.<*>
getRequiredFees(operations, assetId) ⇒ Promise.<Array.<{asset_id:String, amount:Number}>>
getProposedTransactions(accountNameOrId) ⇒ Promise.<*>
getContractLogs(opts: { contracts, topics, fromBlock, toBlock }) ⇒ Promise.<Array.<ContractLogs>>
getContractResult(resultContractId, force) ⇒ Promise.<ContractResult>
getContract(contractId, force) ⇒ Promise.<[0, { code:String, storage:Array.}] | [1, { code:String }]>
callContractNoChangingState(contractId, caller, asset, code) ⇒ Promise.<String>
getContracts(contractIds, force) ⇒ Promise.<Array.<{id:String, statistics:String, suicided:Boolean}>>
getContractBalances(contractId, force) ⇒ Promise.<Object>
getTransactionById(transactionId) ⇒ Promise.<*>
getBtcStakeAddress(accountNameOrId) ⇒ Promise.<*>
getFeePool(assetId) ⇒ Promise.<BigNumber>
broadcastTransactionWithCallback(signedTransactionObject, wasBroadcastedCallback) ⇒ Promise.<*>
1
registerAccount(name, activeKey, echoRandKey, wasBroadcastedCallback) ⇒ Promise.<[{ block_num: number, tx_id: string }]>
getAccountHistory Get operations relevant to the specified account.(accountId, stop, limit, start) ⇒ Promise.<Array.<AccountHistory>>
getRelativeAccountHistory Get operations relevant to the specified account referenced by an event numbering specific to the account.(accountId, stop, limit, start) ⇒ Promise.<Array.<AccountHistory>>
getAccountHistoryOperations Get only asked operations relevant to the specified account.(accountId, operationId, start, stop, limit) ⇒ Promise.<Array.<AccountHistory>>
getContractHistory Get operations relevant to the specified account.(contractId, stop, limit, start) ⇒ Promise.<Array.<ContractHistory>>
getFullContract Get full contract info.(contractId, force) ⇒ Promise.<Object>
broadcastTransaction Broadcast a transaction to the network.(tr) ⇒ Promise.<*>
broadcastBlock Broadcast a block to the network.(block) ⇒ Promise.<*>
getAssetHolders Retrieve the information about the holders of the specified asset.(assetId, start, limit) ⇒ Promise.<Array.<{name: String, account_id:String, amount: String}>>
getAssetHoldersCount Retrieve the number of holders of the provided asset.(assetId) ⇒ Promise.<Number>
getAllAssetHolders Array of all asset IDs with the number of holders.() ⇒ Promise.<Array.<{asset_id: String, count: Number}>>
getBalanceObjects(keys) ⇒ Promise.<*>
getBlockVirtualOperations(blockNum) ⇒ Promise.<*>
getFrozenBalances(AccountId) ⇒ Promise.<*>
getBtcAddresses(AccountId) ⇒ Promise.<*>
getBtcDepositScript(AccountId) ⇒ Promise.<*>
requestRegistrationTask() ⇒ Promise.<*>
getCommitteeFrozenBalance() ⇒ Promise.<*>
getRegistrar() ⇒ Promise.<*>
getDidObject(id) ⇒ Promise.<*>
getKey(idString) ⇒ Promise.<*>
getKeys(idString) ⇒ Promise.<*>
## Typedefs
BlockHeader : Object
Block : Object
Transaction : Object
ChainProperties : Object
GlobalProperties : Object
Config : Object
DynamicGlobalProperties : Object
Committee : Object
Account : Object
AccountHistory : Object
FullAccount : Object
Asset : Object
Vote : Object
ContractLogs : Object
ContractResult : Object
AccountName : String
AccountId : String
SidechainTransfer : Object
ContractHistory : Object
## API instance **Kind**: global class ### new API(cache, wsApi) | Param | Type | | --- | --- | | cache | Cache | | wsApi | WSAPI | ## getObjects(objectIds, force) ⇒ Promise.<Array.<Object>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | objectIds | Array.<String> | [Id of the objects to retrieve] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## getObject(objectId, force) ⇒ Promise.<Object> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | objectId | String | [Id of the object to retrieve] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## checkERC20Token(contractId) ⇒ Promise.<Boolean> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | contractId | String | [Id of the contract to checking] | ## getBlockHeader(blockNum) ⇒ [Promise.<BlockHeader>](#BlockHeader) **Kind**: global function | Param | Type | Description | | --- | --- | --- | | blockNum | Number | [Number of the block to retrieve header (non negative integer)] | ## getBlock(blockNum) ⇒ [Promise.<Block>](#Block) **Kind**: global function | Param | Type | Description | | --- | --- | --- | | blockNum | Number | [Number of the block to retrieve (non negative integer)] | ## getTransaction(blockNum, transactionIndex) ⇒ [Promise.<Transaction>](#Transaction) **Kind**: global function | Param | Type | Description | | --- | --- | --- | | blockNum | Number | [Number of the block to retrieve (non negative integer)] | | transactionIndex | Number | [Index of the transaction to retrieve (non negative integer)] | ## getChainProperties(force) ⇒ [Promise.<ChainProperties>](#ChainProperties) **Kind**: global function | Param | Type | Description | | --- | --- | --- | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## getGlobalProperties() ⇒ [Promise.<GlobalProperties>](#GlobalProperties) **Kind**: global function ## getConfig(force) ⇒ [Promise.<Config>](#Config) **Kind**: global function | Param | Type | Description | | --- | --- | --- | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## getChainId(force) ⇒ Promise.<String> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## getDynamicGlobalProperties() ⇒ [Promise.<DynamicGlobalProperties>](#DynamicGlobalProperties) **Kind**: global function ## getKeyReferences(keys, force) ⇒ Promise.<Array.<\*>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | keys | List.<String> | [public keys (string in bs58 with prefix "ECHO")] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## getAccounts(accountIds, force) ⇒ Promise.<Array.<Account>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountIds | Array.<String> | [Id of the accounts to retrieve] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## getFullAccounts(accountNamesOrIds, subscribe, force) ⇒ Promise.<Array.<FullAccount>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountNamesOrIds | Array.<String> | [Id or names of the accounts to retrieve] | | subscribe | Boolean | [Subscribe to change this account or not] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## getAccountByName(accountName, force) ⇒ [Promise.<Account>](#Account) **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountName | String | [Name of the account to retrieve. Min length - 1, max - 63] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## getAccountReferences(accountId, force) ⇒ Promise.<Object> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountId | String | [Id of the account to retrieve his references] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## lookupAccountNames(accountNames, force) ⇒ Promise.<Array.<Account>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountNames | Array.<String> | [Names of the accounts to retrieve accounts. Min length of name - 1, max - 63] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## lookupAccounts(lowerBoundName, limit) ⇒ Promise.<Array.<AccountName, AccountId>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | lowerBoundName | String | [Name of the earliest account to retrieve] | | limit | Number | [count operations (max 1000)] | ## getAccountCount() ⇒ Promise.<Number> **Kind**: global function ## getAccountBalances(accountId, assetIds, force) ⇒ Promise.<Object> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountId | String | [Id of the account to retrieve balances] | | assetIds | Array.<String> | [Ids of the asset to retrieve balances] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## getNamedAccountBalances(accountName, assetIds, force) ⇒ Promise.<Object> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountName | String | [Name of the account to retrieve balances. Min length - 1, max - 63] | | assetIds | Array.<String> | [Ids of the asset to retrieve balances] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## getVestedBalances(balanceIds) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | balanceIds | Array.<String> | [Ids of the balance to retrieve vested balances] | ## getVestingBalances(accountId) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountId | String | [Id of the account to retrieve vesting balance] | ## getAssets(assetIds, force) ⇒ Promise.<Array.<Asset>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | assetIds | Array.<String> | [Ids of the assets to retrieve] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## listAssets(lowerBoundSymbol, limit) ⇒ Promise.<Array.<Asset>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | lowerBoundSymbol | String | [Symbol of the earliest asset to retrieve] | | limit | Number | [count operations (max 100)] | ## lookupAssetSymbols(symbolsOrIds, force) ⇒ Promise.<Array.<Asset>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | symbolsOrIds | Array.<String> | [Symbols or Ids of the assets to retrieve] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## getMarginPositions(accountId) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountId | String | [Id of the account to retrieve] | ## getTicker(baseAssetName, quoteAssetName) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | baseAssetName | String | [Name of the base asset] | | quoteAssetName | String | [Name of the quote asset] | ## get24Volume(baseAssetName, quoteAssetName) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | baseAssetName | String | [Name of the base asset] | | quoteAssetName | String | [Name of the quote asset] | ## getTradeHistory(baseAssetName, quoteAssetName, start, stop, limit) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | baseAssetName | String | [Name of the base asset] | | quoteAssetName | String | [Name of the quote asset] | | start | Number | [Id of the earliest operation to retrieve] | | stop | Number | [Id of the most recent operation to retrieve] | | limit | Number | [count operations (max 100)] | ## getCommitteeMembers(committeeMemberIds, force) ⇒ Promise.<Array.<Committee>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | committeeMemberIds | Array.<String> | [Ids of the committee members to retrieve] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## getCommitteeMemberByAccount(accountId, force) ⇒ [Promise.<Committee>](#Committee) **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountId | String | [Id of the account to retrieve] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## lookupCommitteeMemberAccounts(lowerBoundName, limit) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | lowerBoundName | String | [Name of the earliest committee member to retrieve] | | limit | Number | [count operations (max 1000)] | ## getTransactionHex(transaction) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | transaction | Object | [Transaction to retrieve] | ## getRequiredSignatures(transaction, availableKeys) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | transaction | Object | [Transaction to retrieve] | | availableKeys | Array.<String> | [public keys (string in bs58 with prefix "ECHO")] | ## getPotentialSignatures(transaction) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | transaction | Object | [Transaction to retrieve] | ## verifyAuthority(transaction) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | transaction | Object | [Transaction to retrieve] | ## verifyAccountAuthority(accountNameOrId, signers) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountNameOrId | String | [Id or name of the account to verify] | | signers | Array.<String> | [public keys (string in bs58 with prefix "ECHO")] | ## validateTransaction(transaction) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | transaction | Object | [Transaction to retrieve] | ## getRequiredFees(operations, assetId) ⇒ Promise.<Array.<{asset\_id:String, amount:Number}>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | operations | Array.<Object> | [Operations to retrieve] | | assetId | String | [Id of the asset to retrieve] | ## getProposedTransactions(accountNameOrId) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountNameOrId | String | [Id or name of the account to retrieve transactions] | ## getContractLogs(opts: { contracts, topics, fromBlock, toBlock }) ⇒ Promise.<Array.<ContractLogs>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | contracts | Array.<String> | [Ids of the contracts to retrieve] | | topics | Array.<String> | [Array of topics] | | fromBlock | Number | [Block number from which to retrieve (non negative integer)] | | toBlock | Number | [Block number to which retrieve (non negative integer)] | ## getContractResult(resultContractId, force) ⇒ [Promise.<ContractResult>](#ContractResult) **Kind**: global function | Param | Type | Description | | --- | --- | --- | | resultContractId | String | [Id of the contract result to retrieve] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## getContract(contractId, force) ⇒ Promise.<[0, { code:String, storage:Array.}] | [1, { code:String }]> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | contractId | String | [Id of the contract to retrieve] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## callContractNoChangingState(contractId, caller, asset, code) ⇒ Promise.<String> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | contractId | String | [Id of the contract to call] | | caller | String | [Id of the account or contract for which the call will being simulated] | | asset | { asset_id: string, amount: number | string | BigNumber } | [Asset with which the call will being simulated] | | code | String | [The code of the method to call] | ## getContracts(contractIds, force) ⇒ Promise.<Array.<{id:String, statistics:String, suicided:Boolean}>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | contractIds | Array.<String> | [Ids of the contracts to retrieve] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## getContractBalances(contractId, force) ⇒ Promise.<Object> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | contractId | String | [Id of the contract to retrieve] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## getTransactionById(transactionId) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | transactionId | String | [Id of the transaction to retrieve] | ## getBtcStakeAddress(accountNameOrId) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountNameOrId | String | [Id or name of account] | ## getFeePool(assetId) ⇒ Promise.<BigNumber> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | assetId | String | [Id of the asset to retrieve] | ## broadcastTransactionWithCallback(signedTransactionObject, wasBroadcastedCallback) ⇒ Promise.<*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | signedTransactionObject | Object | [Signed transaction] | | wasBroadcastedCallback | Function | [The callback method that will be called when the transaction is included into a block. The callback method includes the transaction id, block number, and transaction number in the block] | ## registerAccount(name, activeKey, echoRandKey, wasBroadcastedCallback) ⇒ Promise<[{ block_num: number, tx_id: string }]> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | name | String | [The name of the account, must be unique. Shorter names are more expensive to register] | | activeKey | String | [string in bs58 with prefix "ECHO"] | | echoRandKey | String | [string in bs58 with prefix "ECHO"] | | wasBroadcastedCallback | Function | [The callback method that will be called when the transaction is included into a block. The callback method includes the transaction id, block number, and transaction number in the block] | ## getAccountHistory(accountId, stop, limit, start) ⇒ Promise.<Array.<AccountHistory>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountId | String | [Id of the account to retrieve] | | stop | String | [Id of the earliest operation to retrieve] | | limit | Number | [count operations (max 100)] | | start | String | [Id of the most recent operation to retrieve] | ## getRelativeAccountHistory(accountId, stop, limit, start) ⇒ Promise.<Array.<AccountHistory>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountId | String | [Id of the account to retrieve] | | stop | Number | [Sequence number of earliest operation] | | limit | Number | [count operations (max 100)] | | start | Number | [Sequence number of the most recent operation to retrieve] | ## getAccountHistoryOperations(accountId, operationId, start, stop, limit) ⇒ Promise.<Array.<AccountHistory>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountId | String | [Id of the account to retrieve] | | operationId | String | [Id of the operation to retrieve] | | start | Number | [Id of the most recent operation to retrieve] | | stop | Number | [Id of the earliest operation to retrieve] | | limit | Number | [count operations (max 100)] | ## getContractHistory(contractId, stop, limit, start) ⇒ Promise.<Array.<ContractHistory>> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | contractId | String | [Id of the contract to retrieve] | | stop | String | [Id of the earliest operation to retrieve] | | limit | Number | [count operations (max 100)] | | start | String | [Id of the most recent operation to retrieve] | ## getFullContract(contractId, force) ⇒ Promise.<Object> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | contractId | String | [Id of the contract to retrieve] | | force | Boolean | [If force equal to true then he will first see if you have this object in the cache] | ## broadcastTransaction(tr) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | tr | Object | [Transaction to broadcast] | | tr.ref_block_num | Number | [block number] | | tr.ref_block_prefix | Number | [block prefix] | | tr.operations | Array | [Includes fields: fee, from (accountId), to (accountId), amount, extensions] | | tr.signatures | Array | [eddsa signature] | ## broadcastBlock(block) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | block | Object | | | block.previous | Number | [previous block id] | | block.timestamp | Number | [block timestamp] | | block.transaction_merkle_root | String | [merkle root] | | block.state_root_hash | String | [hash] | | block.result_root_hash | String | [result hash] | | block.ed_signature | String | [eddsa signature] | | block.round | Number | [round id] | | block.rand | Number | [rand] | | block.cert | String | [certificate] | | block.transactions | Array | | ## getAssetHolders> **Kind**: global function **Returns**: Promise.<Array.<{name: String, account\_id:String, amount: String}>> - [ { name: 'init0', account_id: '1.2.6', amount: '100000039900000' } ] | Param | Type | Description | | --- | --- | --- | | assetId | String | [Id of the asset to retrieve] | | start | Number | [account id to start retrieving from] | | limit | Number | [count accounts (max 100)] | ## getAssetHoldersCount(assetId) ⇒ Promise.<Number> **Kind**: global function **Returns**: Promise.<Number> - result - 8 | Param | Type | Description | | --- | --- | --- | | assetId | String | [Id of the asset to retrieve] | ## getAllAssetHolders() ⇒ Promise.<Array.<{asset\_id: String, count: Number}>> **Kind**: global function **Returns**: Promise.<Array.<{asset\_id: String, count: Number}>> - [ { asset_id: '1.3.0', count: 8 } ] ## getBalanceObjects(keys) ⇒ Promise.<*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | keys | Array.<String> | [public keys (string in bs58 with prefix "ECHO")] | ## getBlockVirtualOperations(blockNum) ⇒ Promise.<*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | keys | Number | [Number of the block to retrieve (non negative integer)] | ## getBtcAddresses(accountId) ⇒ Promise.<*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | accountId | String | [Id of the account to retrieve] | ## getBtcDepositScript(btcDepositId) ⇒ Promise.<*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | btcDepositId | String | [Id of the btc deposit] | ## requestRegistrationTask() ⇒ Promise.<Object.<{block\_id: String, rand\_num: String, difficulty: Number}>> **Kind**: global function **Returns**: Promise.<Object.<{block\_id: String, rand\_num: String, difficulty: Number}>> - { block_id: '00047a74744e20bd587a341820daa699b82e2e00', rand_num: '1409327409238134346', difficulty: 20 } ## getCommitteeFrozenBalance(committeeMemberId) ⇒ Promise.<*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | committeeMemberId | String | [Id of the committee member] | ## getRegistrar() ⇒ Promise.<String.<'1.2.10'>> **Kind**: global function **Returns**: Promise.<String.<getRegistrar>> - '1.2.10' ## lookupCommitteeMemberAccounts(lowerBoundName, limit) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | lowerBoundName | String | [Name of the earliest committee member to retrieve] | | limit | Number | [count operations (max 1000)] | ## getDidObject(id) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | id | String | [Identifier for did object] | ## getKey(idString) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | idString | String | [Key identifier] | ## getKeys(idString) ⇒ Promise.<\*> **Kind**: global function | Param | Type | Description | | --- | --- | --- | | idString | String | [Did identifier] | ## BlockHeader : Object ```javascript { previous:String, timestamp:String, account:String, transaction_merkle_root:String, state_root_hash:String, result_root_hash:String, extensions:Array } ``` ## Block : Object ```javascript { previous:String, timestamp:String, account:String, transaction_merkle_root:String, state_root_hash:String, result_root_hash:String, extensions:Array, ed_signature:String, round:Number, rand:String, cert:{ _rand:String, _block_hash:String, _producer:Number, _signatures:Array.<{ _step:Number, _value:Number, _producer:Number, _bba_sign:String }> }, transactions:Array.<{ ref_block_num:Number, ref_block_prefix:Number, fees_collected:Number, expiration:String, operations:Array, extensions:Array, signatures:Array., operation_results:Array. }> } ``` ## Transaction : Object ```javascript { ref_block_num:Number, ref_block_prefix:Number, fees_collected:Number, expiration:String, operations:Array.<*>, extensions:Array, signatures:Array., operation_results:Array.> } ``` ## ChainProperties : Object ```javascript { id:String, chain_id:String, } ``` ## GlobalProperties : Object ```javascript { id:String, parameters:{ current_fees:{ parameters:Array.<*>, scale:Number }, maintenance_interval:Number, maintenance_skip_slots:Number, committee_proposal_review_period:Number, maximum_transaction_size:Number, maximum_block_size:Number, maximum_time_until_expiration:Number, maximum_proposal_lifetime:Number, maximum_asset_whitelist_authorities:Number, maximum_asset_feed_publishers:Number, maximum_committee_count:Number, maximum_authority_membership:Number, reserve_percent_of_fee:Number, network_percent_of_fee:Number, cashback_vesting_period_seconds:Number, max_predicate_opcode:Number, accounts_per_fee_scale:Number, account_fee_scale_bitshifts:Number, max_authority_depth:Number, frozen_balances_multipliers:Array, echorand_config:{ _time_net_1mb:Number, _time_net_256b:Number, _creator_count:Number, _verifier_count:Number, _ok_threshold:Number, _max_bba_steps:Number, _gc1_delay:Number }, sidechain_config:{ eth_contract_address:String, eth_committee_update_method:{method:String,gas:Number}, eth_gen_address_method:{method:String,gas:Number}, eth_withdraw_method:{method:String,gas:Number}, eth_update_addr_method:{method:String,gas:Number}, eth_update_contract_address:{method:String,gas:Number}, eth_withdraw_token_method:{method:String,gas:Number}, eth_collect_tokens_method:{method:String,gas:Number}, eth_committee_updated_topic:String, eth_gen_address_topic:String, eth_deposit_topic:String, eth_withdraw_topic:String, erc20_deposit_topic:String, erc20_withdraw_topic:String, ETH_asset_id:String, BTC_asset_id:String, fines:{generate_eth_address:Number|String}, gas_price:Number|String, satoshis_per_byte:Number, coefficient_waiting_blocks:Number, btc_deposit_withdrawal_min:Number|String, btc_deposit_withdrawal_fee:Number|String, }, gas_price:{ price:Number|String, gas_amount:Number|String, }, extensions:Array }, active_committee_members:Array.>, } ``` ## Config : Object ```javascript { ECHO_SYMBOL:String, ECHO_ADDRESS_PREFIX:String, ECHO_ED_PREFIX:String, ECHO_MIN_ACCOUNT_NAME_LENGTH:Number, ECHO_MAX_ACCOUNT_NAME_LENGTH:Number, ECHO_MIN_ASSET_SYMBOL_LENGTH:Number, ECHO_MAX_ASSET_SYMBOL_LENGTH:Number, ECHO_MAX_SHARE_SUPPLY:String, ECHO_MAX_PAY_RATE:Number, ECHO_MAX_SIG_CHECK_DEPTH:Number, ECHO_MIN_TRANSACTION_SIZE_LIMIT:Number, ECHO_MIN_BLOCK_INTERVAL:Number, ECHO_MAX_BLOCK_INTERVAL:Number, ECHO_DEFAULT_BLOCK_INTERVAL:Number, ECHO_DEFAULT_MAX_TRANSACTION_SIZE:Number, ECHO_DEFAULT_MAX_BLOCK_SIZE:Number, ECHO_DEFAULT_MAX_TIME_UNTIL_EXPIRATION:Number, ECHO_DEFAULT_MAINTENANCE_INTERVAL:Number, ECHO_DEFAULT_MAINTENANCE_SKIP_SLOTS:Number, ECHO_MIN_UNDO_HISTORY:Number, ECHO_MAX_UNDO_HISTORY:Number, ECHO_MIN_BLOCK_SIZE_LIMIT:Number, ECHO_MIN_TRANSACTION_EXPIRATION_LIMIT:Number, ECHO_BLOCKCHAIN_PRECISION:Number, ECHO_BLOCKCHAIN_PRECISION_DIGITS:Number, ECHO_DEFAULT_TRANSFER_FEE:Number, ECHO_MAX_INSTANCE_ID:String, ECHO_100_PERCENT:Number, ECHO_1_PERCENT:Number, ECHO_MAX_MARKET_FEE_PERCENT:Number, ECHO_DEFAULT_FORCE_SETTLEMENT_DELAY:Number, ECHO_DEFAULT_FORCE_SETTLEMENT_OFFSET:Number, ECHO_DEFAULT_FORCE_SETTLEMENT_MAX_VOLUME:Number, ECHO_DEFAULT_PRICE_FEED_LIFETIME:Number, ECHO_MAX_FEED_PRODUCERS:Number, ECHO_DEFAULT_MAX_AUTHORITY_MEMBERSHIP:Number, ECHO_DEFAULT_MAX_ASSET_WHITELIST_AUTHORITIES:Number, ECHO_DEFAULT_MAX_ASSET_FEED_PUBLISHERS:Number, ECHO_COLLATERAL_RATIO_DENOM:Number, ECHO_MIN_COLLATERAL_RATIO:Number, ECHO_MAX_COLLATERAL_RATIO:Number, ECHO_DEFAULT_MAINTENANCE_COLLATERAL_RATIO:Number, ECHO_DEFAULT_MAX_SHORT_SQUEEZE_RATIO:Number, ECHO_DEFAULT_MARGIN_PERIOD_SEC:Number, ECHO_DEFAULT_MAX_COMMITTEE:Number, ECHO_DEFAULT_MAX_PROPOSAL_LIFETIME_SEC:Number, ECHO_DEFAULT_COMMITTEE_PROPOSAL_REVIEW_PERIOD_SEC:Number, ECHO_DEFAULT_NETWORK_PERCENT_OF_FEE:Number, ECHO_DEFAULT_MAX_BULK_DISCOUNT_PERCENT:Number, ECHO_DEFAULT_BULK_DISCOUNT_THRESHOLD_MIN:Number, ECHO_DEFAULT_BULK_DISCOUNT_THRESHOLD_MAX:String, ECHO_DEFAULT_CASHBACK_VESTING_PERIOD_SEC:Number, ECHO_DEFAULT_BURN_PERCENT_OF_FEE:Number, ECHO_DEFAULT_MAX_ASSERT_OPCODE:Number, ECHO_DEFAULT_ACCOUNTS_PER_FEE_SCALE:Number, ECHO_DEFAULT_ACCOUNT_FEE_SCALE_BITSHIFTS:Number, ECHO_MAX_URL_LENGTH:Number, ECHO_NEAR_SCHEDULE_CTR_IV:String, ECHO_FAR_SCHEDULE_CTR_IV:String, ECHO_CORE_ASSET_CYCLE_RATE:Number, ECHO_CORE_ASSET_CYCLE_RATE_BITS:Number, ECHO_MAX_INTEREST_APR:Number, ECHO_COMMITTEE_ACCOUNT:String, ECHO_RELAXED_COMMITTEE_ACCOUNT:String, ECHO_NULL_ACCOUNT:String, ECHO_TEMP_ACCOUNT:String } ``` ## DynamicGlobalProperties : Object ```javascript { id:String, head_block_number:Number, head_block_id:String, time:String, next_maintenance_time:String, last_maintenance_time:String, accounts_registered_this_interval:Number, recently_missed_count:Number, current_aslot:Number, recent_slots_filled:String, last_irreversible_block_num:Number, } ``` ## Committee : Object ```javascript { id:String, committee_member_account:String, url:String, eth_address:String, btc_public_key:String } ``` ## Account : Object ```javascript { id:String, membership_expiration_date:String, registrar:String, referrer:String, lifetime_referrer:String, network_fee_percentage:Number, lifetime_referrer_fee_percentage:Number, referrer_rewards_percentage:Number, active_delegate_share: Number, name:String, owner:{ weight_threshold:Number, account_auths:Array, key_auths:Array, }, active:{ weight_threshold:Number, account_auths:Array, key_auths:Array, }, ed_key:String, options:{ delegating_account:String, extensions:Array }, statistics:String, whitelisting_accounts:Array, blacklisting_accounts:Array, whitelisted_accounts:Array, blacklisted_accounts:Array, owner_special_authority:Array, active_special_authority:Array, top_n_control_flags:NumberT } ``` ## AccountHistory : Object ```javascript { id:String, op:Array, result:Array, block_num:Number, trx_in_block:Number, op_in_block:Number, virtual_op:Number, proposal_hist_id: Number|undefined, } ``` ## FullAccount : Object ```javascript { id:String, membership_expiration_date:String, registrar:String, referrer:String, lifetime_referrer:String, network_fee_percentage:Number, lifetime_referrer_fee_percentage:Number, referrer_rewards_percentage:Number, name:String, owner:{ weight_threshold:Number, account_auths:Array, key_auths:Array, }, active:{ weight_threshold:Number, account_auths:Array, key_auths:Array, }, ed_key:String, options:{ delegating_account:String, extensions:Array }, statistics:String, whitelisting_accounts:Array, blacklisting_accounts:Array, whitelisted_accounts:Array, blacklisted_accounts:Array, owner_special_authority:Array, active_special_authority:Array, top_n_control_flags:Number, history:Array., balances:Object, limit_orders:Object, call_orders:Object, proposals:Object } ``` ## Asset : Object ```javascript { id:String, symbol:String, precision:Number, issuer:String, options:{ max_supply:String, market_fee_percent:Number, max_market_fee:String, issuer_permissions:Number, flags:Number, core_exchange_rate:Object, whitelist_authorities:Array, blacklist_authorities:Array, whitelist_markets:Array, blacklist_markets:Array, description:String, extensions:Array }, dynamic_asset_data_id:String, dynamic:Object, bitasset:(Object|undefined) } ``` ## Vote : Object ```javascript { id:String, committee_member_account:(String|undefined), vote_id:String, total_votes:Number, url:String, last_avoting_accountslot:(Number|undefined), signing_key:(String|undefined), pay_vb:(String|undefined), total_missed:(Number|undefined), last_confirmed_block_num:(Number|undefined), ed_signing_key:(String|undefined) } ``` ## ContractLogs : Object ```javascript { address:String, log:Array., data:String, trx_num:Number, op_num:Number } ``` ## ContractResult : Object ```javascript [0, { exec_res:{ excepted:String, new_address:String, output:String, code_deposit:String, deposit_size:Number, gas_for_deposit:String }, tr_receipt:{ status_code:String, gas_used:String, bloom:String, log:Array } } ] ``` or ```javascript [1, { output: String }] ``` ## SidechainTransfer : Object ```javascript { transfer_id: Number, receiver: String, amount: Number, signatures: String, withdraw_code: String } ``` ## CommitteeFrozenBalance : Object ```javascript { owner: String, balance: Number } ``` ## ContractHistory : Object ```javascript { block_num:Number, id:String, op:[ Number, { amount:{ amount: Number, asset_id: String }, extensions: [], fee:{ amount:Number, asset_id:String }, from:String, to:String } ], op_in_trx:Number, result: [0, {}], trx_in_block:Number, virtual_op:Number, proposal_hist_id: Number } ``` ## AccountName : String ```javascript String ``` ## AccountId : String ```javascript String ```