@relayprotocol/relay-ton-wallet-adapter 2.0.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_cjs/src/adapter.js.map +1 -1
- package/_cjs/src/index.js.map +1 -1
- package/_cjs/src/types.js.map +1 -1
- package/_cjs/tsconfig.build.tsbuildinfo +1 -1
- package/_esm/src/adapter.js.map +1 -1
- package/_esm/src/index.js.map +1 -1
- package/_esm/src/types.js.map +1 -1
- package/_esm/tsconfig.build.tsbuildinfo +1 -1
- package/_types/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
package/_cjs/src/adapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/adapter.ts"],"names":[],"mappings":";;;AAAA,wDAIiC;AACjC,kCAAoC;AACpC,oCAOkB;AAOlB,MAAM,iBAAiB,GAAG,MAAM,CAAA;AAGhC,MAAM,YAAY,GAAG,SAAS,CAAA;AAE9B,MAAM,yBAAyB,GAAG,GAAG,CAAA;AACrC,MAAM,eAAe,GAAG,IAAI,CAAA;AAC5B,MAAM,kBAAkB,GAAG,OAAO,CAAA;AAClC,MAAM,mBAAmB,GAAG,EAAE,CAAA;AAavB,MAAM,cAAc,GAAG,CAC5B,aAAqB,EACrB,eAAmC,EACpB,EAAE;IACjB,IAAI,OAAO,eAAe,KAAK,UAAU,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAA;IACvE,CAAC;IAED,MAAM,aAAa,GAAG,cAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;IAElD,OAAO;QACL,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,YAAY;QACpC,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,aAAa;QAClC,qBAAqB,EAAE,KAAK,IAAI,EAAE;YAEhC,MAAM,IAAI,KAAK,C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AI,QAAQ,CAAA;AAC9B,CAAC,CAAA","sourcesContent":["import {\n type AdaptedWallet,\n LogLevel,\n getClient\n} from '@relayprotocol/relay-sdk'\nimport { TonClient } from '@ton/ton'\nimport {\n Address,\n Cell,\n beginCell,\n loadMessage,\n storeMessage,\n type Message\n} from '@ton/core'\nimport type {\n TonConnectTransactionRequest,\n TonSendTransaction\n} from './types.js'\n\n// TON Connect CHAIN identifier for mainnet (Relay only supports TON mainnet).\nconst TON_MAINNET_CHAIN = '-239'\n// Relay's numeric chainId for TON mainnet. TON is single-chain for Relay, so\n// the adapter owns this rather than taking it as a parameter.\nconst TON_CHAIN_ID = 224235520\n\nconst DEFAULT_VALID_FOR_SECONDS = 300\nconst CONFIRM_POLL_MS = 2000\nconst CONFIRM_TIMEOUT_MS = 120_000\nconst CONFIRM_TX_LOOKBACK = 32\n\n/**\n * Adapts a TON wallet for use with the Relay SDK.\n *\n * The user's key lives in their wallet (e.g. Dynamic / TON Connect), so this\n * adapter never signs. It maps the Relay quote step into a TON Connect request,\n * hands it to the wallet-provided `sendTransaction` callback (which signs +\n * broadcasts), and then confirms the origin transaction landed successfully.\n *\n * @param walletAddress - The connected wallet's address.\n * @param sendTransaction - Wallet callback that signs + broadcasts a request.\n */\nexport const adaptTonWallet = (\n walletAddress: string,\n sendTransaction: TonSendTransaction\n): AdaptedWallet => {\n if (typeof sendTransaction !== 'function') {\n throw new Error('adaptTonWallet requires a sendTransaction function')\n }\n // Parse (and validate) the wallet address once, then reuse it for confirmation.\n const walletAccount = Address.parse(walletAddress)\n\n return {\n vmType: 'tonvm',\n getChainId: async () => TON_CHAIN_ID,\n address: async () => walletAddress,\n handleSignMessageStep: async () => {\n // Not used by deposit/bridge flows; mirrors the other VM adapters.\n throw new Error('Message signing not implemented for TON')\n },\n handleSendTransactionStep: async (_chainId, stepItem) => {\n const client = getClient()\n\n const messages = stepItem.data.messages\n if (!messages || messages.length === 0) {\n throw new Error('TON transaction step is missing messages')\n }\n\n // Relay returns internal-message fields (to/value/body); map them to the\n // TON Connect request shape the wallet expects (address/amount/payload).\n // TON Connect has no per-message bounce flag — the wallet derives it from\n // the address form — so honor the step's `bounce` field by re-encoding the\n // address (e.g. bounce:false -> non-bounceable `UQ…`). Sending a deposit\n // to the bounceable form makes the depository bounce the funds back.\n const request: TonConnectTransactionRequest = {\n validUntil: Math.floor(Date.now() / 1000) + DEFAULT_VALID_FOR_SECONDS,\n network: TON_MAINNET_CHAIN,\n messages: messages.map((message) => ({\n address: encodeAddress(message.to, message.bounce),\n amount: message.value.toString(),\n ...(message.body ? { payload: message.body } : {}),\n ...(message.stateInit ? { stateInit: message.stateInit } : {})\n }))\n }\n\n client.log(['Sending TON transaction', request], LogLevel.Verbose)\n\n const result = await sendTransaction(request)\n // The wallet returns the signed external-message BOC (base64). Reduce it\n // to the external-message hash so callers get a clean identifier (the raw\n // BOC mangles explorer URLs) that also matches the on-chain transaction.\n const boc = result.boc ?? result.transactionHash\n if (!boc) {\n throw new Error('No result returned from the TON wallet')\n }\n const messageHash = toMessageHash(boc, walletAccount)\n\n client.log(['TON transaction submitted', messageHash], LogLevel.Verbose)\n return messageHash\n },\n handleConfirmTransactionStep: async (externalMessageHash, chainId) => {\n const client = getClient()\n\n // Read the TON RPC from the Relay client's chain config so integrators can\n // override it by configuring the chain — no adapter-level endpoint option.\n const rpcUrl = client.chains.find((chain) => chain.id === chainId)\n ?.httpRpcUrl\n if (!rpcUrl) {\n throw new Error(\n `No TON httpRpcUrl configured for chainId ${chainId} in the Relay client`\n )\n }\n const tonClient = new TonClient({ endpoint: rpcUrl })\n\n // `handleSendTransactionStep` returns the external-message hash, which\n // equals the inbound message hash of the transaction it produces. Poll the\n // wallet's recent transactions for that one and confirm the origin\n // (deposit) executed successfully. This confirms the wallet's external-in\n // transaction; it does not independently verify each emitted internal\n // message against the Relay step.\n const start = Date.now()\n\n const maxAttempts = Math.ceil(CONFIRM_TIMEOUT_MS / CONFIRM_POLL_MS) + 1\n\n for (let attempt = 0; attempt < maxAttempts; attempt++) {\n let match:\n | { hash: string; lt: string; description: unknown }\n | undefined\n try {\n const transactions = await tonClient.getTransactions(walletAccount, {\n limit: CONFIRM_TX_LOOKBACK\n })\n for (const tx of transactions) {\n if (!tx.inMessage) {\n continue\n }\n if (hashMessage(tx.inMessage) === externalMessageHash) {\n match = {\n hash: tx.hash().toString('hex'),\n lt: tx.lt.toString(),\n description: tx.description\n }\n break\n }\n }\n } catch (error) {\n client.log(\n ['Error polling for TON transaction', error],\n LogLevel.Verbose\n )\n }\n\n if (match) {\n if (!isTransactionSuccessful(match.description)) {\n client.log(\n ['TON transaction failed', match.description],\n LogLevel.Verbose\n )\n throw new Error('TON transaction failed')\n }\n return { hash: match.hash, lt: match.lt }\n }\n if (Date.now() - start > CONFIRM_TIMEOUT_MS) {\n break\n }\n await new Promise((resolve) => setTimeout(resolve, CONFIRM_POLL_MS))\n }\n\n throw new Error('TON transaction confirmation timed out')\n },\n switchChain: () => Promise.resolve()\n }\n}\n\n/** Canonical message hash, used identically for the BOC and on-chain messages. */\nconst hashMessage = (message: Message): string => {\n return beginCell()\n .store(storeMessage(message))\n .endCell()\n .hash()\n .toString('hex')\n}\n\n/**\n * Reduce the wallet's result to the external-message hash. The wallet returns\n * the signed external-message BOC; we parse it as a message and hash it via the\n * same `hashMessage` used on-chain (so both sides use identical serialization).\n * Validates it's an external-in message addressed to the expected wallet. Falls\n * back only when the input is already a 64-char hex hash.\n */\nconst toMessageHash = (bocOrHash: string, expectedWallet?: Address): string => {\n try {\n const message = loadMessage(Cell.fromBase64(bocOrHash).beginParse())\n if (message.info.type !== 'external-in') {\n throw new Error(\n `Expected an external-in message, got ${message.info.type}`\n )\n }\n if (expectedWallet && !message.info.dest.equals(expectedWallet)) {\n throw new Error('TON wallet returned a BOC for an unexpected account')\n }\n return hashMessage(message)\n } catch (error) {\n const normalized = bocOrHash.trim().replace(/^0x/, '').toLowerCase()\n if (/^[0-9a-f]{64}$/.test(normalized)) {\n return normalized\n }\n throw error\n }\n}\n\n/**\n * TON Connect derives a message's bounceability from the address form, so\n * re-encode the destination to match the Relay step's `bounce` flag\n * (`bounce: false` -> non-bounceable `UQ…`). When `bounce` is undefined the\n * address is left as-is; a malformed address with an explicit flag is a bad\n * step and fails loudly.\n */\nconst encodeAddress = (to: string, bounce?: boolean): string => {\n if (bounce === undefined) {\n return to\n }\n return Address.parse(to).toString({ bounceable: bounce, urlSafe: true })\n}\n\n/**\n * Origin success: the external message executed and the wallet emitted its\n * action. Deliberately lenient — only an explicit failure (aborted, or a phase\n * reporting `success: false`) is treated as failed, to avoid false negatives on\n * a deposit that actually landed (the SDK's route polling catches real route\n * failures separately).\n */\nconst isTransactionSuccessful = (description: unknown): boolean => {\n const desc = description as {\n type?: string\n aborted?: boolean\n computePhase?: { type?: string; success?: boolean }\n actionPhase?: { success?: boolean } | null\n }\n if (desc?.type !== 'generic') {\n return true\n }\n if (desc.aborted === true) {\n return false\n }\n const computeOk =\n desc.computePhase?.type === 'vm'\n ? desc.computePhase.success !== false\n : true\n const actionOk = desc.actionPhase ? desc.actionPhase.success !== false : true\n return computeOk && actionOk\n}\n"]}
|
package/_cjs/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,qDAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,qDAA0B","sourcesContent":["export * from './adapter.js'\nexport * from './types.js'\n"]}
|
package/_cjs/src/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["// TonConnect-compatible transaction request shapes.\n//\n// These mirror the TON Connect `SendTransactionRequest` spec and the request\n// shape accepted by wallet providers such as Dynamic's `sendTransaction`:\n// https://www.dynamic.xyz/docs/javascript/reference/ton/send-transaction\n\nexport interface TonConnectMessage {\n // Destination address (raw \"0:...\" or user-friendly \"EQ.../UQ...\" formats).\n address: string\n // Amount to send, in nanotons, as a decimal string (1 TON = 1e9 nanotons).\n amount: string\n // Optional contract payload as a base64-encoded BOC (Bag of Cells).\n payload?: string\n // Optional state init for contract deployment as a base64-encoded BOC.\n stateInit?: string\n // Optional extra currencies keyed by currency id.\n extraCurrency?: { [id: number]: string }\n}\n\nexport interface TonConnectTransactionRequest {\n // Unix timestamp (in seconds) after which the wallet should reject the tx.\n validUntil: number\n // TON Connect CHAIN id. Relay supports TON mainnet only ('-239'). Optional —\n // when omitted the wallet uses its currently selected network.\n network?: string\n // Optional sender address.\n from?: string\n // Messages to send. TonConnect allows between 1 and 4 messages per request.\n messages: TonConnectMessage[]\n}\n\nexport interface TonSendTransactionResponse {\n // Hash of the submitted transaction / external message. Dynamic returns this.\n transactionHash?: string\n // Some wallets / TonConnect return the signed external message BOC instead.\n boc?: string\n}\n\n// Callback the integrator supplies to actually sign + broadcast the request via\n// their connected wallet (e.g. Dynamic's `sendTransaction`, or TonConnect UI's\n// `tonConnectUI.sendTransaction`). The user's key lives in the wallet, so the\n// adapter never signs — it only hands over the request and reads the result.\nexport type TonSendTransaction = (\n request: TonConnectTransactionRequest\n) => Promise<TonSendTransactionResponse>\n"]}
|