Custom Dogecoin client extending UTXOClient. Implements methods for Dogecoin-specific functionality.

Hierarchy

  • Client
    • Client

Constructors

  • Constructor for initializing the Dogecoin client. Initializes the client with the provided parameters.

    Parameters

    • params: UtxoClientParams = defaultDogeParams

      Parameters for initializing the Dogecoin client.

    Returns Client

Properties

chain: string
dataProviders: UtxoOnlineDataProviders[]
explorerProviders: ExplorerProviders
feeBounds: FeeBounds
network: Network
phrase: string
rootDerivationPaths: undefined | RootDerivationPaths

Methods

  • Broadcast a transaction.

    Parameters

    • txHex: string

      The transaction hex string.

    Returns Promise<string>

    The transaction hash.

  • Builds a Dogecoin transaction (PSBT).

    Builds a Partially Signed Bitcoin Transaction (PSBT) with the specified parameters.

    Parameters

    • params: TxParams & {
          feeRate: number;
          sender: string;
      }

      The transaction build options including sender, recipient, amount, memo, and fee rate.

    Returns Promise<{
        psbt: Psbt;
        utxos: UTXO[];
    }>

    A promise that resolves to the built PSBT and the unspent transaction outputs (UTXOs) used in the transaction.

    Deprecated

    This method is deprecated. Use the transfer method instead.

  • Compiles the memo into a buffer for inclusion in a Dogecoin transaction.

    Parameters

    • memo: string

      The memo to be compiled.

    Returns Buffer

    The compiled memo as a buffer.

  • Asynchronously creates transaction information for ledger sign.

    Builds a transaction (PSBT) and prepares necessary information for ledger signing.

    Parameters

    Returns Promise<LedgerTxInfo>

    A promise that resolves to the transaction information used for ledger sign.

  • Get the Dogecoin address.

    Generates a Dogecoin address using the provided phrase and index.

    Parameters

    • index: number = 0

      The index of the address to retrieve. Default is 0.

    Returns string

    The Dogecoin address.

    Throws

    Thrown if the index is less than zero.

    Throws

    Thrown if the phrase is not provided.

    Throws

    Thrown if failed to create the address from the phrase.

  • Get the current address. Asynchronous version of getAddress method. 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: number = 0

    Returns Promise<string>

    The current address.

    Throws

    Thrown if phrase has not been set before.

    Throws

    Thrown if failed creating account from phrase.

  • Get Dogecoin asset information.

    Returns AssetInfo

    Dogecoin asset information.

  • Gets balance of a given address.

    Parameters

    • address: string

      The address to get balances from

    • Optional _assets: Asset[]
    • Optional confirmedOnly: boolean

    Returns Promise<Balance[]>

    BTC balances

  • Private

    Get private key.

    Private function to get keyPair from the this.phrase

    Parameters

    • phrase: string

      The phrase to be used for generating privkey

    • index: number = 0

    Returns ECPairInterface

    The privkey generated from the given phrase

    Throws

    Throws an error if failed creating Doge keys from the given phrase

  • Get the explorer URL for a given address based on the network.

    Parameters

    • address: string

      The address to query.

    Returns string

    The explorer URL for the address.

  • Get the explorer URL for a given transaction ID based on the network.

    Parameters

    • txID: string

      The transaction ID.

    Returns string

    The explorer URL for the transaction.

  • Get the explorer URL based on the network.

    Returns string

    The explorer URL.

  • Calculates the transaction fee based on the provided UTXOs, fee rate, and optional data.

    Parameters

    • inputs: UTXO[]

      The unspent transaction outputs (UTXOs) used as inputs.

    • feeRate: number

      The fee rate for the transaction.

    • data: null | Buffer = null

      The compiled memo (optional).

    Returns number

    The calculated transaction fee.

  • Get the fee rate from the Thorchain API.

    Returns Promise<number>

    The fee rate

  • Get fee rates

    Parameters

    • Optional protocol: THORCHAIN

      Protocol to interact with. If there's no protocol provided, fee rates are retrieved from chain data providers

    Returns Promise<FeeRates>

    The fee rates (average, fast, fastest) in Satoshis/byte

  • Get estimated fees.

    Parameters

    • Optional options: FeeEstimateOptions

      Options for fee estimation.

    Returns Promise<Fees>

    Estimated fees.

  • Get estimated fees with fee rates.

    Parameters

    • Optional options: FeeEstimateOptions

      Options for fee estimation.

    Returns Promise<FeesWithRates>

    Estimated fees along with fee rates.

  • Get the full derivation path based on the wallet index.

    Parameters

    • walletIndex: number

      The HD wallet index

    Returns string

    The full derivation path

  • Get the current network.

    Returns Network

    The current network

  • Get the transaction details of a given transaction ID.

    Parameters

    • txId: string

      The transaction ID.

    Returns Promise<Tx>

    The transaction details.

  • Get the transaction history of a given address with pagination options.

    Parameters

    • Optional params: TxHistoryParams

      The options to get transaction history.

    Returns Promise<TxsPage>

    The transaction history.

  • Asynchronously prepares a transaction for transfer.

    Builds a transaction (PSBT) with the specified transfer options.

    Parameters

    • params: TxParams & {
          feeRate: number;
          sender: string;
          spendPendingUTXO?: boolean;
      }

      The transfer options including sender address, fee rate, and optional flag for spending pending UTXOs.

    Returns Promise<PreparedTx>

    A promise that resolves to the raw unsigned transaction (PSBT).

  • Purge the client by clearing the mnemonic phrase.

    Returns void

  • Broadcasts a transaction hex using a round-robin approach across multiple data providers.

    Parameters

    • txHex: string

      The transaction hex to broadcast.

    Returns Promise<string>

    The hash of the broadcasted transaction.

    Throws

    Throws an error if no provider is able to broadcast the transaction.

  • Round-robin method to get balance from data providers. Throws error if no provider can get balance.

    Parameters

    • address: string

      The address to get balance for.

    Returns Promise<Balance[]>

    The balances.

    Throws

    Error If no provider is able to get balance.

  • Retrieves fee rates using a round-robin approach across multiple data providers.

    Returns Promise<FeeRates>

    The fee rates (average, fast, fastest) in Satoshis/byte.

    Throws

    Throws an error if no provider is able to retrieve fee rates.

  • Round-robin method to get transaction data from data providers. Throws error if no provider can get transaction data.

    Parameters

    • txid: string

      The transaction ID to get data for.

    Returns Promise<Tx>

    The transaction data.

    Throws

    Error If no provider is able to get transaction data.

  • Round-robin method to get transactions from data providers. Throws error if no provider can get transactions.

    Parameters

    • params: TxHistoryParams

      The parameters for fetching transactions.

    Returns Promise<TxsPage>

    The transaction history.

    Throws

    Error If no provider is able to get transactions.

  • Round-robin method to get unspent transactions from data providers. Throws error if no provider can get unspent transactions.

    Parameters

    • address: string

      The address to get unspent transactions for.

    • confirmed: boolean

      Flag to indicate whether to get confirmed transactions only.

    Returns Promise<UTXO[]>

    The unspent transactions.

    Throws

    Error If no provider is able to get unspent transactions.

  • Scan UTXOs for a given address.

    Parameters

    • address: string

      The address to scan.

    • Optional confirmedOnly: boolean

      Flag to scan only confirmed UTXOs.

    Returns Promise<UTXO[]>

    The UTXOs found.

  • Set or update the current network.

    Parameters

    • network: Network

      The network to set

    Returns void

    Throws

    Thrown if no network is provided

  • Set or update the mnemonic phrase.

    Parameters

    • phrase: string

      The new mnemonic phrase

    • Optional walletIndex: number

      (Optional) The HD wallet index

    Returns string

    The address derived from the provided phrase

    Throws

    Thrown if an invalid mnemonic phrase is provided

  • Make a GET request to the Thorchain API.

    Parameters

    • endpoint: string

      The API endpoint

    Returns Promise<unknown>

    The response data

  • Asynchronously transfers Dogecoin.

    Builds, signs, and broadcasts a Dogecoin transaction with the specified parameters.

    Parameters

    • params: TxParams & {
          feeRate?: number;
      }

      The transfer parameters including transaction details and optional fee rate.

    Returns Promise<string>

    A promise that resolves to the transaction hash once the transfer is completed.

  • Validate the given address.

    Parameters

    • address: string

      The Dogecoin address to validate.

    Returns boolean

    true if the address is valid, otherwise false.

Generated using TypeDoc