absolutepay (Node SDK) - v0.7.1
    Preparing search index...

    Convert between stablecoins/crypto assets (scope: convert:write).

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Execute a conversion against a quote you already obtained from Conversions.quote.

      Parameters

      • params: { buy: Money; quoteId: string; sell: Money }

        Execution inputs.

        • buy: Money

          The exact buy Money from the quote (buyAmount + buyCurrency).

        • quoteId: string

          The quoteId from the quote. Required, and must not have expired.

        • sell: Money

          The exact sell Money from the quote (sellAmount + sellCurrency).

      • opts: IdempotencyOptions = {}

        Optional { idempotencyKey } — retrying with the same key + body replays the original.

      Returns Promise<ConvertOrder>

      The resulting ConvertOrder.

      On failure (e.g. 409/422 expired or mismatched quote, 401/403 auth).

      const q = await client.conversions.quote({ sellCurrency: "USDT", buyCurrency: "USDC", sellAmount: "100.00" });
      const order = await client.conversions.execute(
      { quoteId: q.quoteId, sell: { amount: q.sellAmount, currency: q.sellCurrency }, buy: { amount: q.buyAmount, currency: q.buyCurrency } },
      { idempotencyKey: crypto.randomUUID() },
      );