@relayprotocol/relay-ton-wallet-adapter 2.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/LICENSE +21 -0
- package/README.md +47 -0
- package/_cjs/package.json +1 -0
- package/_cjs/src/adapter.js +148 -0
- package/_cjs/src/adapter.js.map +1 -0
- package/_cjs/src/index.js +6 -0
- package/_cjs/src/index.js.map +1 -0
- package/_cjs/src/types.js +3 -0
- package/_cjs/src/types.js.map +1 -0
- package/_cjs/tsconfig.build.tsbuildinfo +1 -0
- package/_esm/package.json +1 -0
- package/_esm/src/adapter.js +199 -0
- package/_esm/src/adapter.js.map +1 -0
- package/_esm/src/index.js +3 -0
- package/_esm/src/index.js.map +1 -0
- package/_esm/src/types.js +7 -0
- package/_esm/src/types.js.map +1 -0
- package/_esm/tsconfig.build.tsbuildinfo +1 -0
- package/_types/src/adapter.d.ts +15 -0
- package/_types/src/adapter.d.ts.map +1 -0
- package/_types/src/index.d.ts +3 -0
- package/_types/src/index.d.ts.map +1 -0
- package/_types/src/types.d.ts +21 -0
- package/_types/src/types.d.ts.map +1 -0
- package/_types/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +66 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Reservoir
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<h3 align="center">Relay TON Wallet Adapter</h3>
|
|
2
|
+
|
|
3
|
+
### Installation
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
yarn add @relayprotocol/relay-ton-wallet-adapter @relayprotocol/relay-sdk
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Also make sure to install the peer dependencies required by the adapter if your application doesn't already include them:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
yarn add viem @relayprotocol/relay-sdk @ton/core @ton/ton
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Usage
|
|
16
|
+
|
|
17
|
+
`adaptTonWallet` turns a connected TON wallet into an `AdaptedWallet` the Relay
|
|
18
|
+
SDK can execute against. The user's key lives in their wallet, so the adapter
|
|
19
|
+
never signs — you pass a `sendTransaction` callback that signs + broadcasts the
|
|
20
|
+
request via your wallet provider (e.g. Dynamic or TonConnect UI), and the
|
|
21
|
+
adapter handles request building and on-chain confirmation.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { adaptTonWallet } from '@relayprotocol/relay-ton-wallet-adapter'
|
|
25
|
+
|
|
26
|
+
const adaptedWallet = adaptTonWallet(walletAddress, async (request) => {
|
|
27
|
+
// `request` is a TonConnect-style { validUntil, messages, network? }.
|
|
28
|
+
// Forward it to your wallet provider's send method (e.g. Dynamic's TON
|
|
29
|
+
// connector, or `tonConnectUI.sendTransaction`) and return the result. The
|
|
30
|
+
// adapter accepts { boc } (the signed external-message BOC most TonConnect
|
|
31
|
+
// wallets return) or { transactionHash }.
|
|
32
|
+
const boc = await wallet.sendTransaction(request)
|
|
33
|
+
return { boc }
|
|
34
|
+
})
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
#### Confirmation endpoint
|
|
38
|
+
|
|
39
|
+
`handleConfirmTransactionStep` polls a read-only [`@ton/ton`](https://github.com/ton-org/ton)
|
|
40
|
+
`TonClient` to confirm the origin transaction. The RPC endpoint comes from the
|
|
41
|
+
TON chain's `httpRpcUrl` in the Relay client's chain configuration, so to use a
|
|
42
|
+
custom endpoint (e.g. a keyed provider for production), override the TON chain's
|
|
43
|
+
`httpRpcUrl` when configuring the SDK client rather than passing it to the
|
|
44
|
+
adapter.
|
|
45
|
+
|
|
46
|
+
> Note: message signing (`handleSignMessageStep`) is not implemented, as it is
|
|
47
|
+
> not used by deposit/bridge flows.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.adaptTonWallet = void 0;
|
|
4
|
+
const relay_sdk_1 = require("@relayprotocol/relay-sdk");
|
|
5
|
+
const ton_1 = require("@ton/ton");
|
|
6
|
+
const core_1 = require("@ton/core");
|
|
7
|
+
const TON_MAINNET_CHAIN = '-239';
|
|
8
|
+
const TON_CHAIN_ID = 224235520;
|
|
9
|
+
const DEFAULT_VALID_FOR_SECONDS = 300;
|
|
10
|
+
const CONFIRM_POLL_MS = 2000;
|
|
11
|
+
const CONFIRM_TIMEOUT_MS = 120_000;
|
|
12
|
+
const CONFIRM_TX_LOOKBACK = 32;
|
|
13
|
+
const adaptTonWallet = (walletAddress, sendTransaction) => {
|
|
14
|
+
if (typeof sendTransaction !== 'function') {
|
|
15
|
+
throw new Error('adaptTonWallet requires a sendTransaction function');
|
|
16
|
+
}
|
|
17
|
+
const walletAccount = core_1.Address.parse(walletAddress);
|
|
18
|
+
return {
|
|
19
|
+
vmType: 'tonvm',
|
|
20
|
+
getChainId: async () => TON_CHAIN_ID,
|
|
21
|
+
address: async () => walletAddress,
|
|
22
|
+
handleSignMessageStep: async () => {
|
|
23
|
+
throw new Error('Message signing not implemented for TON');
|
|
24
|
+
},
|
|
25
|
+
handleSendTransactionStep: async (_chainId, stepItem) => {
|
|
26
|
+
const client = (0, relay_sdk_1.getClient)();
|
|
27
|
+
const messages = stepItem.data.messages;
|
|
28
|
+
if (!messages || messages.length === 0) {
|
|
29
|
+
throw new Error('TON transaction step is missing messages');
|
|
30
|
+
}
|
|
31
|
+
const request = {
|
|
32
|
+
validUntil: Math.floor(Date.now() / 1000) + DEFAULT_VALID_FOR_SECONDS,
|
|
33
|
+
network: TON_MAINNET_CHAIN,
|
|
34
|
+
messages: messages.map((message) => ({
|
|
35
|
+
address: encodeAddress(message.to, message.bounce),
|
|
36
|
+
amount: message.value.toString(),
|
|
37
|
+
...(message.body ? { payload: message.body } : {}),
|
|
38
|
+
...(message.stateInit ? { stateInit: message.stateInit } : {})
|
|
39
|
+
}))
|
|
40
|
+
};
|
|
41
|
+
client.log(['Sending TON transaction', request], relay_sdk_1.LogLevel.Verbose);
|
|
42
|
+
const result = await sendTransaction(request);
|
|
43
|
+
const boc = result.boc ?? result.transactionHash;
|
|
44
|
+
if (!boc) {
|
|
45
|
+
throw new Error('No result returned from the TON wallet');
|
|
46
|
+
}
|
|
47
|
+
const messageHash = toMessageHash(boc, walletAccount);
|
|
48
|
+
client.log(['TON transaction submitted', messageHash], relay_sdk_1.LogLevel.Verbose);
|
|
49
|
+
return messageHash;
|
|
50
|
+
},
|
|
51
|
+
handleConfirmTransactionStep: async (externalMessageHash, chainId) => {
|
|
52
|
+
const client = (0, relay_sdk_1.getClient)();
|
|
53
|
+
const rpcUrl = client.chains.find((chain) => chain.id === chainId)
|
|
54
|
+
?.httpRpcUrl;
|
|
55
|
+
if (!rpcUrl) {
|
|
56
|
+
throw new Error(`No TON httpRpcUrl configured for chainId ${chainId} in the Relay client`);
|
|
57
|
+
}
|
|
58
|
+
const tonClient = new ton_1.TonClient({ endpoint: rpcUrl });
|
|
59
|
+
const start = Date.now();
|
|
60
|
+
const maxAttempts = Math.ceil(CONFIRM_TIMEOUT_MS / CONFIRM_POLL_MS) + 1;
|
|
61
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
62
|
+
let match;
|
|
63
|
+
try {
|
|
64
|
+
const transactions = await tonClient.getTransactions(walletAccount, {
|
|
65
|
+
limit: CONFIRM_TX_LOOKBACK
|
|
66
|
+
});
|
|
67
|
+
for (const tx of transactions) {
|
|
68
|
+
if (!tx.inMessage) {
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (hashMessage(tx.inMessage) === externalMessageHash) {
|
|
72
|
+
match = {
|
|
73
|
+
hash: tx.hash().toString('hex'),
|
|
74
|
+
lt: tx.lt.toString(),
|
|
75
|
+
description: tx.description
|
|
76
|
+
};
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
client.log(['Error polling for TON transaction', error], relay_sdk_1.LogLevel.Verbose);
|
|
83
|
+
}
|
|
84
|
+
if (match) {
|
|
85
|
+
if (!isTransactionSuccessful(match.description)) {
|
|
86
|
+
client.log(['TON transaction failed', match.description], relay_sdk_1.LogLevel.Verbose);
|
|
87
|
+
throw new Error('TON transaction failed');
|
|
88
|
+
}
|
|
89
|
+
return { hash: match.hash, lt: match.lt };
|
|
90
|
+
}
|
|
91
|
+
if (Date.now() - start > CONFIRM_TIMEOUT_MS) {
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
await new Promise((resolve) => setTimeout(resolve, CONFIRM_POLL_MS));
|
|
95
|
+
}
|
|
96
|
+
throw new Error('TON transaction confirmation timed out');
|
|
97
|
+
},
|
|
98
|
+
switchChain: () => Promise.resolve()
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
exports.adaptTonWallet = adaptTonWallet;
|
|
102
|
+
const hashMessage = (message) => {
|
|
103
|
+
return (0, core_1.beginCell)()
|
|
104
|
+
.store((0, core_1.storeMessage)(message))
|
|
105
|
+
.endCell()
|
|
106
|
+
.hash()
|
|
107
|
+
.toString('hex');
|
|
108
|
+
};
|
|
109
|
+
const toMessageHash = (bocOrHash, expectedWallet) => {
|
|
110
|
+
try {
|
|
111
|
+
const message = (0, core_1.loadMessage)(core_1.Cell.fromBase64(bocOrHash).beginParse());
|
|
112
|
+
if (message.info.type !== 'external-in') {
|
|
113
|
+
throw new Error(`Expected an external-in message, got ${message.info.type}`);
|
|
114
|
+
}
|
|
115
|
+
if (expectedWallet && !message.info.dest.equals(expectedWallet)) {
|
|
116
|
+
throw new Error('TON wallet returned a BOC for an unexpected account');
|
|
117
|
+
}
|
|
118
|
+
return hashMessage(message);
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
const normalized = bocOrHash.trim().replace(/^0x/, '').toLowerCase();
|
|
122
|
+
if (/^[0-9a-f]{64}$/.test(normalized)) {
|
|
123
|
+
return normalized;
|
|
124
|
+
}
|
|
125
|
+
throw error;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const encodeAddress = (to, bounce) => {
|
|
129
|
+
if (bounce === undefined) {
|
|
130
|
+
return to;
|
|
131
|
+
}
|
|
132
|
+
return core_1.Address.parse(to).toString({ bounceable: bounce, urlSafe: true });
|
|
133
|
+
};
|
|
134
|
+
const isTransactionSuccessful = (description) => {
|
|
135
|
+
const desc = description;
|
|
136
|
+
if (desc?.type !== 'generic') {
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
if (desc.aborted === true) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
const computeOk = desc.computePhase?.type === 'vm'
|
|
143
|
+
? desc.computePhase.success !== false
|
|
144
|
+
: true;
|
|
145
|
+
const actionOk = desc.actionPhase ? desc.actionPhase.success !== false : true;
|
|
146
|
+
return computeOk && actionOk;
|
|
147
|
+
};
|
|
148
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +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,CAAC,yCAAyC,CAAC,CAAA;QAC5D,CAAC;QACD,yBAAyB,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE;YACtD,MAAM,MAAM,GAAG,IAAA,qBAAS,GAAE,CAAA;YAE1B,MAAM,QAAQ,GAAG,QAAQ,CAAC,I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O,EAAE,IAAI,EAAE,CAAC,CAAA;AAC1E,CAAC,CAAA;AASD,MAAM,uBAAuB,GAAG,CAAC,WAAoB,EAAW,EAAE;IAChE,MAAM,IAAI,GAAG,WAKZ,CAAA;IACD,IAAI,IAAI,EAAE,IAAI,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,SAAS,GACb,IAAI,CAAC,YAAY,EAAE,IAAI,KAAK,IAAI;QAC9B,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,KAAK,KAAK;QACrC,CAAC,CAAC,IAAI,CAAA;IACV,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;IAC7E,OAAO,SAAS,IAAI,QAAQ,CAAA;AAC9B,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,qDAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|