Client

Extends xchain_client_1.UTXOClient

Custom Dogecoin client

Parameters

  • params DogecoinClientParams
    • params.network (optional, default xchain_client_1.Network.Testnet)
    • params.feeBounds (optional, default {lower:const_1.LOWER_FEE_BOUND,upper:const_1.UPPER_FEE_BOUND})
    • params.sochainUrl (optional, default 'https://sochain.com/api/v2')
    • params.blockcypherUrl (optional, default 'https://api.blockcypher.com/v1')
    • params.phrase
    • params.rootDerivationPaths (optional, default {[xchain_client_1.Network.Mainnet]:`m/44'/3'/0'/0/`,[xchain_client_1.Network.Stagenet]:`m/44'/3'/0'/0/`,[xchain_client_1.Network.Testnet]:`m/44'/1'/0'/0/`})

setSochainUrl

Set/Update the sochain url.

Parameters

  • url string The new sochain url.

Returns void

setBlockcypherUrl

Set/Update the blockcypher url.

Parameters

  • url string The new blockcypher url.

Returns void

getExplorerUrl

Get the explorer url.

Returns string The explorer url based on the network.

getExplorerAddressUrl

Get the explorer url for the given address.

Parameters

  • address Address

Returns string The explorer url for the given address based on the network.

getExplorerTxUrl

Get the explorer url for the given transaction id.

Parameters

  • txID string The transaction id

Returns string The explorer url for the given transaction id based on the network.

getAddress

Get the current address.

Generates a network-specific key-pair by first converting the buffer to a Wallet-Import-Format (WIF) The address is then decoded into type P2WPKH and returned.

Parameters

  • index (optional, default 0)

  • Throws "Phrase must be provided" Thrown if phrase has not been set before.
  • Throws "Address not defined" Thrown if failed creating account from phrase.

Returns Address The current address.

validateAddress

Validate the given address.

Parameters

  • address Address

Returns boolean true or false

getBalance

Get the Doge balance of a given address.

Parameters

  • address Address By default, it will return the balance of the current wallet. (optional)

Returns Array<Balance> The Doge balance of the address.

getTransactions

Get transaction history of a given address with pagination options. By default it will return the transaction history of the current wallet.

Parameters

  • params TxHistoryParams The options to get transaction history. (optional)

Returns TxsPage The transaction history.

getTransactionData

Get the transaction details of a given transaction id.

Parameters

  • txId string The transaction id.

Returns Tx The transaction details of the given transaction id.

transfer

Transfer Doge.

Parameters

  • params TxParams&FeeRate The transfer options.

Returns TxHash The transaction hash.