Skip to content

DashApi

martiliones edited this page Jun 12, 2023 · 1 revision

BTC: DashApi

dashApi.multiplier

Bitcoin base multiplier

  • Type

    interface DashApi {
      multiplier: 100000000;
    }

dashApi.createTransaction()

Creates base bitcoin transaction

  • Type

    interface DashApi {
      createTransaction(
        address: string,
        amount: number,
        fee: number
      ): Promise<SignedJsonTx>;
    }
  • References

    SignedJsonTx

dashApi.getBalance()

Gets the account's balance

  • Type

    interface DashApi {
      getBalance(): Promise<number>;
    }

dashApi.getFee()

Gets fee

  • Type

    interface DashApi {
      getFee(): number;
    }

dashApi.getTransaction()

Gets transaction by the specified id

  • Type

    interface DashApi {
      getTransaction(transactionId: string): DashTransaction;
    }
    
    type DashTransaction = {
      vin: { addr: string; value: number }[];
    } & BitcoinBaseTransaction;
  • References

    BitcoinBaseTransaction

dashApi.getTransactions()

Gets list of transactions by specified filters

  • Type

    interface DashApi {
      getTransactions(options?: {
        excludes: string[];
      }): { hasMore: boolean; items: DashTransaction[] };
    }
    
    type DashTransaction = {
      vin: { addr: string; value: number }[];
    } & BitcoinBaseTransaction;
  • References

    BitcoinBaseTransaction

dashApi.getUnspents()

Gets unspents

  • Type

    interface DashApi {
      getUnspents(address: string): Promise<DashUnspents>;
    }
    
    interface DashUnspents {
      amount: number;
      txid: string;
      vout: { address: string; value: number }[];
    }

dashApi.sendTransaction()

Sends a signed transaction

  • Type

    interface DashApi {
      sendTransaction(signedTx: any): Promise<any>;
    }
Clone this wiki locally