@arkade-os/sdk Documentation - v0.5.0-rc.11
    Preparing search index...

    Class Ramps

    Ramps is a class wrapping settle method to provide a more convenient interface for onboarding and offboarding operations.

    • IWallet.settle
    • onboard
    • offboard
    const ramps = new Ramps(wallet);
    const feeInfo = { intentFee: {}, txFeeRate: '1' };
    await ramps.onboard(feeInfo); // onboard all boarding inputs
    await ramps.offboard('bc1q...', feeInfo); // collaboratively exit all virtual outputs to an onchain address
    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    wallet: IWallet

    Wallet used to query funds and execute settlement transactions

    Methods

    • Offboard virtual outputs, or collaboratively exit them to an onchain address.

      Parameters

      • destinationAddress: string

        The destination address to offboard to.

      • feeInfo: FeeInfo

        The fee info to deduct from the offboard amount.

      • Optionalamount: bigint

        The amount to offboard. If not provided, the total amount of virtual outputs will be offboarded.

      • OptionaleventCallback: (event: SettlementEvent) => void

        Optional callback that receives settlement events

      • Optionalvtxos: NormalizedExtendedVirtualCoin[]

        Specific virtual outputs to spend, mirroring onboard's boardingUtxos. Omitted, every spendable one is spent — merging the whole off-chain balance into a single change output. Taken as given like settle({ inputs }): an amount these cannot cover is an error, not a top-up.

      Returns Promise<string>

      The Arkade transaction id created by settlement

      Error if no virtual outputs remain after fee deduction or the destination address cannot be decoded

      • IWallet.getSpendableVtxos
      • IWallet.settle
      const feeInfo = { intentFee: {}, txFeeRate: '1' };
      const ramps = new Ramps(wallet);
      await ramps.offboard('bc1q...', feeInfo);
    • Collaboratively exit with the DESTINATION paid exactly amount, pricing the fee on that output rather than on a grossed-up figure. offboard keeps the other anchor, which needs g - fee(g) = amount solved — impossible for a program charging the whole output.

      Parameters

      Returns Promise<string>

    • Onboard boarding inputs.

      Parameters

      • feeInfo: FeeInfo

        The fee info to deduct from the onboard amount.

      • OptionalboardingUtxos: ExtendedCoin[]

        Specific boarding inputs to onboard. If not provided, all boarding inputs will be used.

      • Optionalamount: bigint

        Amount to onboard. If not provided, the total amount of boarding inputs will be onboarded.

      • OptionaleventCallback: (event: SettlementEvent) => void

        Optional callback that receives settlement events

      Returns Promise<string>

      The Arkade transaction id created by settlement

      Error if no boarding inputs remain after fee deduction or if amount exceeds available value

      • IWallet.getBoardingUtxos
      • IWallet.settle
      const feeInfo = { intentFee: {}, txFeeRate: '1' };
      const ramps = new Ramps(wallet);
      await ramps.onboard(feeInfo);