Skip to content

v0.4.1

Latest

Choose a tag to compare

@dillu24 dillu24 released this 27 Nov 14:23

Overview

Stellar deposit memo fix:

  • depositMemo on InstaswapSwapLiteSnapshot (provider.details.instaswapSwapLite)
  • instructions and the EVM execution.memo are now documented as display text, never an on-chain memo

Pegaroute v0.9.4 fixes the memo for Instaswap swaps from any non-EVM chain. Before v0.9.4, execution.memo carried Instaswap's human-readable instructions instead of Instaswap's depositMemo. Where the deposit address needs a memo (today, Stellar), those deposits arrive without it and are never credited.

npm install @pegaroute/sdk@0.4.1

0.4.1 is additive over 0.4.0. Existing calls remain valid.

Deposits with a memo

Some deposit routes send to a shared address and identify your deposit only by its memo or tag. A deposit without it is not credited, and the funds have to be recovered manually through support.

On any deposit-transfer execution, a non-null execution.memo is required. Attach it in the field the chain uses:

Chain Where execution.memo goes
Stellar Memo, as an ID memo (MEMO_ID); see below
XRP For SwapSpace routes, execution.memo is a destination tag: set DestinationTag. For THORChain routes, put it in Memos as text. A dedicated destinationTag field will remove this ambiguity in a future release.
TON Transfer comment (text)
Cosmos (cosmos family) Transaction memo

Never send a deposit-transfer without the memo when it is non-null, and never substitute display text for it.

Handling Stellar swaps

Switch on execution.family and execution.mode:

  • other / deposit-transfer with chain: "STELLAR" (Instaswap, SwapSpace): send execution.amount to execution.to and attach execution.memo as a Stellar ID memo (MEMO_ID). Every memo these routes return today is numeric. If a memo is not a valid unsigned 64-bit integer, stop and contact us rather than sending it as text.
  • stellar / transaction-json (Squid): use the memo and memoType inside execution.transactionJson.
  • stellar / serialized-tx (Squid): sign and submit the XDR envelope unchanged. The memo is already inside it.
import { Memo } from "@stellar/stellar-sdk";

const { execution } = await pr.swaps.create(params);

if (execution.mode === "deposit-transfer" && execution.family === "other" && execution.chain === "STELLAR") {
  // Required whenever it is non-null: the deposit is not credited without it.
  const memo = execution.memo === null ? Memo.none() : Memo.id(execution.memo);
  // Build a payment of execution.amount to execution.to with this memo.
}

For manual deposit screens on any chain, show the memo directly next to the deposit address:

  • Instaswap repeats it in provider.details.instaswapSwapLite.depositMemo.
  • Never show instaswapSwapLite.instructions as the memo. It is display text only.

SDK 0.4.1 pairs with Pegaroute v0.9.4 and later. v0.9.4 signs the deposit memo; v0.9.5 adds the Stellar and XRP memo guidance to the integrator docs.

Full changelog: v0.4.0...v0.4.1