Constructors
constructor
- new MetrixRPC(account, url, username, password): MetrixRPC
Parameters
- account: null | string
- url: string
- username: string
- password: string
Properties
Protected
authHeader
authHeader: string = ''
Protected
url
url: string = ''
Methods
backupWallet
- backupWallet(target, callback): void
Parameters
- target: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
callContract
- callContract(contrtactAddress, data, senderAddress, gasLimit, fromBlock, callback): void
Parameters
- contrtactAddress: string
- data: string
- senderAddress: string
- gasLimit: undefined | string
- fromBlock: undefined | number
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
Protected
Abstract
callDaemon
- callDaemon(method, paramsArray, callback): void
Parameters
- method: string
- paramsArray: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
createContract
- createContract(bytecode, gasLimit?, gasPrice?, senderAddress, broadcast?, changeToSender?, callback): void
Parameters
- bytecode: string
- gasLimit: undefined | string | number = 2500000
- gasPrice: undefined | string | number = 0.00005
- senderAddress: string
- broadcast: boolean = true
- changeToSender: boolean = true
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
createRawTransaction
- createRawTransaction(rawTxObj, callback): void
Parameters
- rawTxObj: MetrixRawTx
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
decodeRawTransaction
- decodeRawTransaction(transaction, callback): void
Parameters
- transaction: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
encryptWallet
- encryptWallet(passphrase, callback): void
Parameters
- passphrase: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
estimateFee
- estimateFee(blockcount, callback): void
Parameters
- blockcount: number
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
estimateSmartFee
- estimateSmartFee(conf_target, estimate_mode, callback): void
Parameters
- conf_target: number
- estimate_mode: undefined | string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
fromHexAddress
- fromHexAddress(hexAddress, callback): void
Parameters
- hexAddress: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getAccountInfo
- getAccountInfo(address, callback): void
Parameters
- address: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getAddressInfo
- getAddressInfo(address, callback): void
Parameters
- address: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getAddressesByAccount
- getAddressesByAccount(paramOptionalAccount, callback): void
Parameters
- paramOptionalAccount: null | string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getAddressesByLabel
- getAddressesByLabel(paramOptionalAccount, callback): void
Parameters
- paramOptionalAccount: null | string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getBalance
- getBalance(paramOptionalAccount, callback): void
Parameters
- paramOptionalAccount: null | string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getBestBlockHash
- getBestBlockHash(callback): void
Parameters
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getBlock
- getBlock(hash, verbose, callback): void
Parameters
- hash: string
- verbose: 0 | 1 | 2
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getBlockCount
- getBlockCount(callback): void
Parameters
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getBlockHash
- getBlockHash(height, callback): void
Parameters
- height: number
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getBlockchainInfo
- getBlockchainInfo(callback): void
Parameters
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getChainTips
- getChainTips(callback): void
Parameters
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getDifficulty
- getDifficulty(callback): void
Parameters
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getHexAddress
- getHexAddress(metrixAddress, callback): void
Parameters
- metrixAddress: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getInvalid
- getInvalid(callback): void
Parameters
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getMiningInfo
- getMiningInfo(callback): void
Parameters
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getNetworkInfo
- getNetworkInfo(callback): void
Parameters
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getNewAddress
- getNewAddress(paramOptionalAccount, callback): void
Parameters
- paramOptionalAccount: null | string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getPoolInfo
- getPoolInfo(callback): void
Parameters
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getRawTransaction
- getRawTransaction(txid, format, callback): void
Parameters
- txid: string
- format: null | boolean
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getStakeSplitThreshold
- getStakeSplitThreshold(callback): void
Parameters
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getStakingStatus
- getStakingStatus(callback): void
Parameters
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getTransaction
- getTransaction(txid, callback): void
Parameters
- txid: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getTransactionReceipt
- getTransactionReceipt(txid, callback): void
Parameters
- txid: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getTxOut
- getTxOut(txid, vout, callback): void
Parameters
- txid: string
- vout: number
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getUnconfirmedBalance
- getUnconfirmedBalance(callback): void
Parameters
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
getWalletInfo
- getWalletInfo(callback): void
Parameters
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
listContracts
- listContracts(start?, maxDisplay?, callback): void
Parameters
- start: undefined | string | number = 1
- maxDisplay: undefined | string | number = 20
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
listUnspent
- listUnspent(minConf, maxConf, addressesArray, callback): void
Parameters
- minConf: number
- maxConf: number
- addressesArray: string[]
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
promiseBackupWallet
- promiseBackupWallet(target): Promise<any>
Returns Promise<any>
promiseCallContract
- promiseCallContract(contrtactAddress, data, senderAddress, gasLimit?, fromBlock?): Promise<any>
Parameters
- contrtactAddress: string
- data: string
- senderAddress: string
Optional
gasLimit: stringOptional
fromBlock: number
Returns Promise<any>
promiseCreateContract
- promiseCreateContract(bytecode, gasLimit, gasPrice, senderAddress, broadcast?, changeToSender?): Promise<any>
Parameters
- bytecode: string
- gasLimit: undefined | string | number
- gasPrice: undefined | string | number
- senderAddress: string
Optional
broadcast: booleanOptional
changeToSender: boolean
Returns Promise<any>
promiseCreateRawTransaction
- promiseCreateRawTransaction(rawTxObj): Promise<any>
Returns Promise<any>
promiseDecodeRawTransaction
- promiseDecodeRawTransaction(transaction): Promise<any>
Returns Promise<any>
promiseEncryptWallet
- promiseEncryptWallet(passphrase): Promise<any>
Returns Promise<any>
promiseEstimateFee
- promiseEstimateFee(blockcount): Promise<any>
Returns Promise<any>
promiseEstimateSmartFee
- promiseEstimateSmartFee(conf_target, estimate_mode): Promise<any>
Parameters
- conf_target: number
- estimate_mode: undefined | string
Returns Promise<any>
promiseFromHexAddress
- promiseFromHexAddress(hexAddress): Promise<any>
Returns Promise<any>
promiseGetAccountInfo
- promiseGetAccountInfo(address): Promise<any>
Returns Promise<any>
promiseGetAddressInfo
- promiseGetAddressInfo(address): Promise<any>
Returns Promise<any>
promiseGetAddressesByAccount
- promiseGetAddressesByAccount(paramOptionalAccount): Promise<any>
Parameters
- paramOptionalAccount: null | string
Returns Promise<any>
promiseGetAddressesByLabel
- promiseGetAddressesByLabel(paramOptionalAccount): Promise<any>
Parameters
- paramOptionalAccount: null | string
Returns Promise<any>
promiseGetBalance
- promiseGetBalance(paramOptionalAccount): Promise<any>
Parameters
- paramOptionalAccount: null | string
Returns Promise<any>
promiseGetBestBlockHash
- promiseGetBestBlockHash(): Promise<any>
Returns Promise<any>
promiseGetBlock
- promiseGetBlock(hash, verbose): Promise<any>
Parameters
- hash: string
- verbose: 0 | 1 | 2
Returns Promise<any>
promiseGetBlockCount
- promiseGetBlockCount(): Promise<any>
Returns Promise<any>
promiseGetBlockHash
- promiseGetBlockHash(height): Promise<any>
Returns Promise<any>
promiseGetBlockchainInfo
- promiseGetBlockchainInfo(): Promise<any>
Returns Promise<any>
promiseGetChainTips
- promiseGetChainTips(): Promise<any>
Returns Promise<any>
promiseGetDifficulty
- promiseGetDifficulty(): Promise<any>
Returns Promise<any>
promiseGetHexAddress
- promiseGetHexAddress(metrixAddress): Promise<any>
Returns Promise<any>
promiseGetInvalid
- promiseGetInvalid(): Promise<any>
Returns Promise<any>
promiseGetMiningInfo
- promiseGetMiningInfo(): Promise<any>
Returns Promise<any>
promiseGetNetworkInfo
- promiseGetNetworkInfo(): Promise<any>
Returns Promise<any>
promiseGetNewAddress
- promiseGetNewAddress(paramOptionalAccount): Promise<any>
Parameters
- paramOptionalAccount: null | string
Returns Promise<any>
promiseGetPoolInfo
- promiseGetPoolInfo(): Promise<any>
Returns Promise<any>
promiseGetRawTransaction
- promiseGetRawTransaction(txid, format): Promise<any>
Parameters
- txid: string
- format: null | boolean
Returns Promise<any>
promiseGetStakeSplitThreshold
- promiseGetStakeSplitThreshold(): Promise<any>
Returns Promise<any>
promiseGetStakingStatus
- promiseGetStakingStatus(): Promise<any>
Returns Promise<any>
promiseGetTransaction
- promiseGetTransaction(txid): Promise<any>
Returns Promise<any>
promiseGetTransactionReceipt
- promiseGetTransactionReceipt(txid): Promise<any>
Returns Promise<any>
promiseGetTxOut
- promiseGetTxOut(txid, vout): Promise<any>
Returns Promise<any>
promiseGetUnconfirmedBalance
- promiseGetUnconfirmedBalance(): Promise<any>
Returns Promise<any>
promiseGetWalletInfo
- promiseGetWalletInfo(): Promise<any>
Returns Promise<any>
promiseListContracts
- promiseListContracts(start?, maxDisplay?): Promise<any>
Parameters
Optional
start: string | numberOptional
maxDisplay: string | number
Returns Promise<any>
promiseListUnspent
- promiseListUnspent(minConf, maxConf, addressesArray): Promise<any>
Parameters
- minConf: number
- maxConf: number
- addressesArray: string[]
Returns Promise<any>
promiseSearchLogs
- promiseSearchLogs(fromBlock, toBlock?, addresses, topics?, minconf?): Promise<any>
Parameters
- fromBlock: number
- toBlock: undefined | number = -1
- addresses: undefined | string[]
- topics: undefined | (null | string)[] = []
- minconf: undefined | number = 0
Returns Promise<any>
promiseSendMany
- promiseSendMany(addressesAmmountsObj, confirmations, comment, feeAddressesArray): Promise<any>
Parameters
- addressesAmmountsObj: any
- confirmations: number
- comment: string
- feeAddressesArray: null | string | string[]
Returns Promise<any>
promiseSendRawTransaction
- promiseSendRawTransaction(transaction): Promise<any>
Returns Promise<any>
promiseSendToAddress
- promiseSendToAddress(address, ammount, comment): Promise<any>
Parameters
- address: string
- ammount: string
- comment: string
Returns Promise<any>
promiseSendToContract
- promiseSendToContract(contractAddress, datahex, amount, gasLimit, gasPrice, senderAddress, broadcast?, changeToSender?): Promise<any>
Parameters
- contractAddress: string
- datahex: string
- amount: string | number
- gasLimit: string | number
- gasPrice: string | number
- senderAddress: string
Optional
broadcast: booleanOptional
changeToSender: boolean
Returns Promise<any>
promiseSetAccount
- promiseSetAccount(address, account): Promise<any>
Parameters
- address: string
- account: string
Returns Promise<any>
promiseSetTxFee
- promiseSetTxFee(fee): Promise<any>
Returns Promise<any>
promiseSignMessage
- promiseSignMessage(address, message): Promise<any>
Parameters
- address: string
- message: string
Returns Promise<any>
promiseSignRawTransaction
- promiseSignRawTransaction(signRawTxObj): Promise<any>
Returns Promise<any>
promiseStop
- promiseStop(): Promise<any>
Returns Promise<any>
promiseValidateAddress
- promiseValidateAddress(address): Promise<any>
Returns Promise<any>
promiseVerifyMessage
- promiseVerifyMessage(address, signature, message): Promise<any>
Parameters
- address: string
- signature: string
- message: string
Returns Promise<any>
promiseWalletLock
- promiseWalletLock(): Promise<any>
Returns Promise<any>
promiseWalletPassphrase
- promiseWalletPassphrase(passphrase, timeoutSeconds): Promise<any>
Parameters
- passphrase: string
- timeoutSeconds: number
Returns Promise<any>
promiseWalletPassphraseChange
- promiseWalletPassphraseChange(oldPassphrase, newPassphrase): Promise<any>
Parameters
- oldPassphrase: string
- newPassphrase: string
Returns Promise<any>
searchLogs
- searchLogs(fromBlock, toBlock, addresses?, topics?, minconf?, callback): void
Parameters
- fromBlock: number
- toBlock: number
- addresses: undefined | string[] = []
- topics: undefined | (null | string)[] = []
- minconf: undefined | number = 0
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
sendMany
- sendMany(addressesAmmountsObj, confirmations, comment, feeAddressesArray, callback): void
Parameters
- addressesAmmountsObj: any
- confirmations: number
- comment: string
- feeAddressesArray: null | string | string[]
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
sendRawTransaction
- sendRawTransaction(transaction, callback): void
Parameters
- transaction: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
sendToAddress
- sendToAddress(address, ammount, comment, callback): void
Parameters
- address: string
- ammount: string
- comment: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
sendToContract
- sendToContract(contractAddress, datahex, amount?, gasLimit?, gasPrice?, senderAddress, broadcast?, changeToSender?, callback): void
Parameters
- contractAddress: string
- datahex: string
- amount: undefined | string | number = 0
- gasLimit: undefined | string | number = 250000
- gasPrice: undefined | string | number = 0.00005
- senderAddress: string
- broadcast: undefined | boolean = true
- changeToSender: undefined | boolean = true
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
setAccount
- setAccount(address, account, callback): void
Parameters
- address: string
- account: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
setTxFee
- setTxFee(fee, callback): void
Parameters
- fee: number
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
signMessage
- signMessage(address, message, callback): void
Parameters
- address: string
- message: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
signRawTransaction
- signRawTransaction(signRawTxObj, callback): void
Parameters
- signRawTxObj: MetrixSignRawTx
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
stop
- stop(callback): void
Parameters
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
validateAddress
- validateAddress(address, callback): void
Parameters
- address: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
verifyMessage
- verifyMessage(address, signature, message, callback): void
Parameters
- address: string
- signature: string
- message: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
walletLock
- walletLock(callback): void
Parameters
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
walletPassphrase
- walletPassphrase(passphrase, timeoutSeconds, callback): void
Parameters
- passphrase: string
- timeoutSeconds: number
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
walletPassphraseChange
- walletPassphraseChange(oldPassphrase, newPassphrase, callback): void
Parameters
- oldPassphrase: string
- newPassphrase: string
- callback: ((e: null | Error, result: any) => void)
- (e, result): void
Parameters
- e: null | Error
- result: any
Returns void
Returns void
Protected
Static
isEmpty
- isEmpty(x): boolean
Returns boolean
Protected
Static
isString
- isString(x): boolean
Returns boolean