@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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type AdaptedWallet } from '@relayprotocol/relay-sdk';
|
|
2
|
+
import type { TonSendTransaction } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Adapts a TON wallet for use with the Relay SDK.
|
|
5
|
+
*
|
|
6
|
+
* The user's key lives in their wallet (e.g. Dynamic / TON Connect), so this
|
|
7
|
+
* adapter never signs. It maps the Relay quote step into a TON Connect request,
|
|
8
|
+
* hands it to the wallet-provided `sendTransaction` callback (which signs +
|
|
9
|
+
* broadcasts), and then confirms the origin transaction landed successfully.
|
|
10
|
+
*
|
|
11
|
+
* @param walletAddress - The connected wallet's address.
|
|
12
|
+
* @param sendTransaction - Wallet callback that signs + broadcasts a request.
|
|
13
|
+
*/
|
|
14
|
+
export declare const adaptTonWallet: (walletAddress: string, sendTransaction: TonSendTransaction) => AdaptedWallet;
|
|
15
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,0BAA0B,CAAA;AAUjC,OAAO,KAAK,EAEV,kBAAkB,EACnB,MAAM,YAAY,CAAA;AAanB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,kBACV,MAAM,mBACJ,kBAAkB,KAClC,aA+HF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface TonConnectMessage {
|
|
2
|
+
address: string;
|
|
3
|
+
amount: string;
|
|
4
|
+
payload?: string;
|
|
5
|
+
stateInit?: string;
|
|
6
|
+
extraCurrency?: {
|
|
7
|
+
[id: number]: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface TonConnectTransactionRequest {
|
|
11
|
+
validUntil: number;
|
|
12
|
+
network?: string;
|
|
13
|
+
from?: string;
|
|
14
|
+
messages: TonConnectMessage[];
|
|
15
|
+
}
|
|
16
|
+
export interface TonSendTransactionResponse {
|
|
17
|
+
transactionHash?: string;
|
|
18
|
+
boc?: string;
|
|
19
|
+
}
|
|
20
|
+
export type TonSendTransaction = (request: TonConnectTransactionRequest) => Promise<TonSendTransactionResponse>;
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,iBAAiB;IAEhC,OAAO,EAAE,MAAM,CAAA;IAEf,MAAM,EAAE,MAAM,CAAA;IAEd,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,aAAa,CAAC,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACzC;AAED,MAAM,WAAW,4BAA4B;IAE3C,UAAU,EAAE,MAAM,CAAA;IAGlB,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,QAAQ,EAAE,iBAAiB,EAAE,CAAA;CAC9B;AAED,MAAM,WAAW,0BAA0B;IAEzC,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAMD,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,4BAA4B,KAClC,OAAO,CAAC,0BAA0B,CAAC,CAAA"}
|