@rango-dev/provider-tonconnect 0.1.1-next.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.
@@ -0,0 +1,163 @@
1
+ import type { TonConnectUI } from '@tonconnect/ui';
2
+ export declare function getTonConnectUIModule(): Promise<{
3
+ default: typeof import("@tonconnect/ui");
4
+ THEME: typeof import("@tonconnect/ui").THEME;
5
+ TonConnectUI: typeof TonConnectUI;
6
+ TonConnectUIError: typeof import("@tonconnect/ui").TonConnectUIError;
7
+ createConnectionCompletedEvent(version: import("@tonconnect/sdk").Version, wallet: import("@tonconnect/sdk").Wallet | null): import("@tonconnect/sdk").ConnectionCompletedEvent;
8
+ createConnectionErrorEvent(version: import("@tonconnect/sdk").Version, error_message: string, errorCode: void | import("@tonconnect/sdk").CONNECT_EVENT_ERROR_CODES): import("@tonconnect/sdk").ConnectionErrorEvent;
9
+ createConnectionRestoringCompletedEvent(version: import("@tonconnect/sdk").Version, wallet: import("@tonconnect/sdk").Wallet | null): import("@tonconnect/sdk").ConnectionRestoringCompletedEvent;
10
+ createConnectionRestoringErrorEvent(version: import("@tonconnect/sdk").Version, errorMessage: string): import("@tonconnect/sdk").ConnectionRestoringErrorEvent;
11
+ createConnectionRestoringStartedEvent(version: import("@tonconnect/sdk").Version): import("@tonconnect/sdk").ConnectionRestoringStartedEvent;
12
+ createConnectionStartedEvent(version: import("@tonconnect/sdk").Version): import("@tonconnect/sdk").ConnectionStartedEvent;
13
+ createDisconnectionEvent(version: import("@tonconnect/sdk").Version, wallet: import("@tonconnect/sdk").Wallet | null, scope: "dapp" | "wallet"): import("@tonconnect/sdk").DisconnectionEvent;
14
+ createRequestVersionEvent(): import("@tonconnect/sdk").RequestVersionEvent;
15
+ createResponseVersionEvent(version: string): import("@tonconnect/sdk").ResponseVersionEvent;
16
+ createTransactionSentForSignatureEvent(version: import("@tonconnect/sdk").Version, wallet: import("@tonconnect/sdk").Wallet | null, transaction: import("@tonconnect/sdk").SendTransactionRequest): import("@tonconnect/sdk").TransactionSentForSignatureEvent;
17
+ createTransactionSignedEvent(version: import("@tonconnect/sdk").Version, wallet: import("@tonconnect/sdk").Wallet | null, transaction: import("@tonconnect/sdk").SendTransactionRequest, signedTransaction: import("@tonconnect/sdk").SendTransactionResponse): import("@tonconnect/sdk").TransactionSignedEvent;
18
+ createTransactionSigningFailedEvent(version: import("@tonconnect/sdk").Version, wallet: import("@tonconnect/sdk").Wallet | null, transaction: import("@tonconnect/sdk").SendTransactionRequest, errorMessage: string, errorCode: void | import("@tonconnect/sdk").SEND_TRANSACTION_ERROR_CODES): import("@tonconnect/sdk").TransactionSigningFailedEvent;
19
+ createVersionInfo(version: import("@tonconnect/sdk").Version): import("@tonconnect/sdk").Version;
20
+ encodeTelegramUrlParameters(parameters: string): string;
21
+ isTelegramUrl(link: string | undefined): link is string;
22
+ isWalletInfoCurrentlyEmbedded(value: import("@tonconnect/sdk").WalletInfo): value is import("@tonconnect/sdk").WalletInfoCurrentlyEmbedded;
23
+ isWalletInfoCurrentlyInjected(value: import("@tonconnect/sdk").WalletInfo): value is import("@tonconnect/sdk").WalletInfoCurrentlyInjected;
24
+ isWalletInfoInjectable(value: import("@tonconnect/sdk").WalletInfo): value is import("@tonconnect/sdk").WalletInfoInjectable;
25
+ isWalletInfoInjected(value: import("@tonconnect/sdk").WalletInfo): value is import("@tonconnect/sdk").WalletInfoInjected;
26
+ isWalletInfoRemote(value: import("@tonconnect/sdk").WalletInfo): value is import("@tonconnect/sdk").WalletInfoRemote;
27
+ toUserFriendlyAddress(hexAddress: string, testOnly?: boolean | undefined): string;
28
+ BadRequestError: typeof import("@tonconnect/sdk").BadRequestError;
29
+ BrowserEventDispatcher: typeof import("@tonconnect/sdk").BrowserEventDispatcher;
30
+ CHAIN: typeof import("@tonconnect/sdk").CHAIN;
31
+ CONNECT_EVENT_ERROR_CODES: typeof import("@tonconnect/sdk").CONNECT_EVENT_ERROR_CODES;
32
+ CONNECT_ITEM_ERROR_CODES: typeof import("@tonconnect/sdk").CONNECT_ITEM_ERROR_CODES;
33
+ FetchWalletsError: typeof import("@tonconnect/sdk").FetchWalletsError;
34
+ LocalstorageNotFoundError: typeof import("@tonconnect/sdk").LocalstorageNotFoundError;
35
+ ParseHexError: typeof import("@tonconnect/sdk").ParseHexError;
36
+ SEND_TRANSACTION_ERROR_CODES: typeof import("@tonconnect/sdk").SEND_TRANSACTION_ERROR_CODES;
37
+ TonConnect: typeof import("@tonconnect/sdk").TonConnect;
38
+ TonConnectError: typeof import("@tonconnect/sdk").TonConnectError;
39
+ UnknownAppError: typeof import("@tonconnect/sdk").UnknownAppError;
40
+ UnknownError: typeof import("@tonconnect/sdk").UnknownError;
41
+ UserRejectsError: typeof import("@tonconnect/sdk").UserRejectsError;
42
+ WalletAlreadyConnectedError: typeof import("@tonconnect/sdk").WalletAlreadyConnectedError;
43
+ WalletNotConnectedError: typeof import("@tonconnect/sdk").WalletNotConnectedError;
44
+ WalletNotInjectedError: typeof import("@tonconnect/sdk").WalletNotInjectedError;
45
+ WalletsListManager: typeof import("@tonconnect/sdk").WalletsListManager;
46
+ WrongAddressError: typeof import("@tonconnect/sdk").WrongAddressError;
47
+ }>;
48
+ export declare function getTonCoreModule(): Promise<{
49
+ default: typeof import("@ton/core");
50
+ Address: typeof import("@ton/core").Address;
51
+ address: typeof import("@ton/core").address;
52
+ ExternalAddress: typeof import("@ton/core").ExternalAddress;
53
+ ADNLAddress: typeof import("@ton/core").ADNLAddress;
54
+ contractAddress: typeof import("@ton/core").contractAddress;
55
+ BitString: typeof import("@ton/core").BitString;
56
+ BitReader: typeof import("@ton/core").BitReader;
57
+ BitBuilder: typeof import("@ton/core").BitBuilder;
58
+ Builder: typeof import("@ton/core").Builder;
59
+ beginCell: typeof import("@ton/core").beginCell;
60
+ Slice: typeof import("@ton/core").Slice;
61
+ CellType: typeof import("@ton/core").CellType;
62
+ Cell: typeof import("@ton/core").Cell;
63
+ Dictionary: typeof import("@ton/core").Dictionary;
64
+ exoticMerkleProof: typeof import("@ton/core").exoticMerkleProof;
65
+ convertToMerkleProof: typeof import("@ton/core").convertToMerkleProof;
66
+ exoticMerkleUpdate: typeof import("@ton/core").exoticMerkleUpdate;
67
+ exoticPruned: typeof import("@ton/core").exoticPruned;
68
+ generateMerkleProof: typeof import("@ton/core").generateMerkleProof;
69
+ generateMerkleProofDirect: typeof import("@ton/core").generateMerkleProofDirect;
70
+ generateMerkleUpdate: typeof import("@ton/core").generateMerkleUpdate;
71
+ parseTuple: typeof import("@ton/core").parseTuple;
72
+ serializeTuple: typeof import("@ton/core").serializeTuple;
73
+ TupleReader: typeof import("@ton/core").TupleReader;
74
+ TupleBuilder: typeof import("@ton/core").TupleBuilder;
75
+ openContract: typeof import("@ton/core").openContract;
76
+ ComputeError: typeof import("@ton/core").ComputeError;
77
+ toNano: typeof import("@ton/core").toNano;
78
+ fromNano: typeof import("@ton/core").fromNano;
79
+ crc16: typeof import("@ton/core").crc16;
80
+ crc32c: typeof import("@ton/core").crc32c;
81
+ base32Decode: typeof import("@ton/core").base32Decode;
82
+ base32Encode: typeof import("@ton/core").base32Encode;
83
+ getMethodId: typeof import("@ton/core").getMethodId;
84
+ safeSign: typeof import("@ton/core").safeSign;
85
+ safeSignVerify: typeof import("@ton/core").safeSignVerify;
86
+ internal: typeof import("@ton/core").internal;
87
+ external: typeof import("@ton/core").external;
88
+ comment: typeof import("@ton/core").comment;
89
+ loadAccount: typeof import("@ton/core").loadAccount;
90
+ storeAccount: typeof import("@ton/core").storeAccount;
91
+ loadAccountState: typeof import("@ton/core").loadAccountState;
92
+ storeAccountState: typeof import("@ton/core").storeAccountState;
93
+ loadAccountStatus: typeof import("@ton/core").loadAccountStatus;
94
+ storeAccountStatus: typeof import("@ton/core").storeAccountStatus;
95
+ loadAccountStatusChange: typeof import("@ton/core").loadAccountStatusChange;
96
+ storeAccountStatusChange: typeof import("@ton/core").storeAccountStatusChange;
97
+ loadAccountStorage: typeof import("@ton/core").loadAccountStorage;
98
+ storeAccountStorage: typeof import("@ton/core").storeAccountStorage;
99
+ loadOutAction: typeof import("@ton/core").loadOutAction;
100
+ storeOutAction: typeof import("@ton/core").storeOutAction;
101
+ loadOutList: typeof import("@ton/core").loadOutList;
102
+ storeOutList: typeof import("@ton/core").storeOutList;
103
+ loadCommonMessageInfo: typeof import("@ton/core").loadCommonMessageInfo;
104
+ storeCommonMessageInfo: typeof import("@ton/core").storeCommonMessageInfo;
105
+ loadCommonMessageInfoRelaxed: typeof import("@ton/core").loadCommonMessageInfoRelaxed;
106
+ storeCommonMessageInfoRelaxed: typeof import("@ton/core").storeCommonMessageInfoRelaxed;
107
+ loadComputeSkipReason: typeof import("@ton/core").loadComputeSkipReason;
108
+ storeComputeSkipReason: typeof import("@ton/core").storeComputeSkipReason;
109
+ loadCurrencyCollection: typeof import("@ton/core").loadCurrencyCollection;
110
+ storeCurrencyCollection: typeof import("@ton/core").storeCurrencyCollection;
111
+ loadDepthBalanceInfo: typeof import("@ton/core").loadDepthBalanceInfo;
112
+ storeDepthBalanceInfo: typeof import("@ton/core").storeDepthBalanceInfo;
113
+ loadHashUpdate: typeof import("@ton/core").loadHashUpdate;
114
+ storeHashUpdate: typeof import("@ton/core").storeHashUpdate;
115
+ loadMasterchainStateExtra: typeof import("@ton/core").loadMasterchainStateExtra;
116
+ loadMessage: typeof import("@ton/core").loadMessage;
117
+ storeMessage: typeof import("@ton/core").storeMessage;
118
+ loadMessageRelaxed: typeof import("@ton/core").loadMessageRelaxed;
119
+ storeMessageRelaxed: typeof import("@ton/core").storeMessageRelaxed;
120
+ SendMode: typeof import("@ton/core").SendMode;
121
+ ReserveMode: typeof import("@ton/core").ReserveMode;
122
+ loadShardAccount: typeof import("@ton/core").loadShardAccount;
123
+ storeShardAccount: typeof import("@ton/core").storeShardAccount;
124
+ ShardAccountRefValue: import("@ton/core").DictionaryValue<import("@ton/core").ShardAccountRef>;
125
+ loadShardAccounts: typeof import("@ton/core").loadShardAccounts;
126
+ storeShardAccounts: typeof import("@ton/core").storeShardAccounts;
127
+ loadShardIdent: typeof import("@ton/core").loadShardIdent;
128
+ storeShardIdent: typeof import("@ton/core").storeShardIdent;
129
+ loadShardStateUnsplit: typeof import("@ton/core").loadShardStateUnsplit;
130
+ loadSimpleLibrary: typeof import("@ton/core").loadSimpleLibrary;
131
+ storeSimpleLibrary: typeof import("@ton/core").storeSimpleLibrary;
132
+ loadLibRef: typeof import("@ton/core").loadLibRef;
133
+ storeLibRef: typeof import("@ton/core").storeLibRef;
134
+ loadSplitMergeInfo: typeof import("@ton/core").loadSplitMergeInfo;
135
+ storeSplitMergeInfo: typeof import("@ton/core").storeSplitMergeInfo;
136
+ loadStateInit: typeof import("@ton/core").loadStateInit;
137
+ storeStateInit: typeof import("@ton/core").storeStateInit;
138
+ loadStorageInfo: typeof import("@ton/core").loadStorageInfo;
139
+ storeStorageInfo: typeof import("@ton/core").storeStorageInfo;
140
+ loadStorageUsed: typeof import("@ton/core").loadStorageUsed;
141
+ storeStorageUsed: typeof import("@ton/core").storeStorageUsed;
142
+ loadStorageUsedShort: typeof import("@ton/core").loadStorageUsedShort;
143
+ storeStorageUsedShort: typeof import("@ton/core").storeStorageUsedShort;
144
+ loadTickTock: typeof import("@ton/core").loadTickTock;
145
+ storeTickTock: typeof import("@ton/core").storeTickTock;
146
+ loadTransaction: typeof import("@ton/core").loadTransaction;
147
+ storeTransaction: typeof import("@ton/core").storeTransaction;
148
+ loadTransactionActionPhase: typeof import("@ton/core").loadTransactionActionPhase;
149
+ storeTransactionActionPhase: typeof import("@ton/core").storeTransactionActionPhase;
150
+ loadTransactionBouncePhase: typeof import("@ton/core").loadTransactionBouncePhase;
151
+ storeTransactionBouncePhase: typeof import("@ton/core").storeTransactionBouncePhase;
152
+ loadTransactionComputePhase: typeof import("@ton/core").loadTransactionComputePhase;
153
+ storeTransactionComputePhase: typeof import("@ton/core").storeTransactionComputePhase;
154
+ loadTransactionCreditPhase: typeof import("@ton/core").loadTransactionCreditPhase;
155
+ storeTransactionCreditPhase: typeof import("@ton/core").storeTransactionCreditPhase;
156
+ loadTransactionDescription: typeof import("@ton/core").loadTransactionDescription;
157
+ storeTransactionDescription: typeof import("@ton/core").storeTransactionDescription;
158
+ loadTransactionStoragePhase: typeof import("@ton/core").loadTransactionStoragePhase;
159
+ storeTransactionsStoragePhase: typeof import("@ton/core").storeTransactionsStoragePhase;
160
+ }>;
161
+ export declare function waitForConnection(tonConnectUI: TonConnectUI): Promise<string>;
162
+ export declare function parseAddress(rawAddress: string): Promise<string>;
163
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,wBAAsB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAG1C;AAED,wBAAsB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAGrC;AAED,wBAAsB,iBAAiB,CACrC,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,MAAM,CAAC,CA2BjB;AAED,wBAAsB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGtE"}
@@ -0,0 +1,20 @@
1
+ import type { Environments } from './types.js';
2
+ import type { CanEagerConnect, CanSwitchNetwork, Connect, Disconnect, GetInstance, WalletInfo } from '@rango-dev/wallets-shared';
3
+ import type { TonConnectUI } from '@tonconnect/ui';
4
+ import type { BlockchainMeta, SignerFactory } from 'rango-types';
5
+ import { WalletTypes } from '@rango-dev/wallets-shared';
6
+ export declare const config: {
7
+ type: WalletTypes;
8
+ isAsyncInstance: boolean;
9
+ checkInstallation: boolean;
10
+ };
11
+ export type { Environments };
12
+ export declare const init: (environments: Environments) => void;
13
+ export declare const getInstance: GetInstance;
14
+ export declare const connect: Connect;
15
+ export declare const canEagerConnect: CanEagerConnect;
16
+ export declare const canSwitchNetworkTo: CanSwitchNetwork;
17
+ export declare const getSigners: (provider: TonConnectUI) => Promise<SignerFactory>;
18
+ export declare const getWalletInfo: (allBlockChains: BlockchainMeta[]) => WalletInfo;
19
+ export declare const disconnect: Disconnect;
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjE,OAAO,EAAY,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAgBlE,eAAO,MAAM,MAAM;;;;CAIlB,CAAC;AAEF,YAAY,EAAE,YAAY,EAAE,CAAC;AAE7B,eAAO,MAAM,IAAI,iBAAkB,YAAY,SAE9C,CAAC;AAIF,eAAO,MAAM,WAAW,EAAE,WAMzB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,OAiBrB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,eAI7B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,gBAA8B,CAAC;AAEhE,eAAO,MAAM,UAAU,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,OAAO,CAAC,aAAa,CAClE,CAAC;AAET,eAAO,MAAM,aAAa,EAAE,CAAC,cAAc,EAAE,cAAc,EAAE,KAAK,UAWjE,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAGxB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ var l=Object.defineProperty;var o=(n,t)=>l(n,"name",{value:t,configurable:!0});var w=(n,t)=>()=>(n&&(t=n(n=0)),t);var h=(n,t)=>{for(var e in t)l(n,e,{get:t[e],enumerable:!0})};var g={};h(g,{CustomTonSigner:()=>i});import{Cell as U}from"@ton/core";import{CHAIN as S}from"@tonconnect/ui";import{SignerError as x}from"rango-types";var i,u=w(()=>{"use strict";i=class{static{o(this,"CustomTonSigner")}provider;constructor(t){this.provider=t}async signMessage(){throw x.UnimplementedError("signMessage")}async signAndSendTx(t){let{blockChain:e,type:c,...s}=t,r=await this.provider.sendTransaction({...s,network:S.MAINNET});return{hash:U.fromBase64(r.boc).hash().toString("hex")}}}});import{Networks as f,WalletTypes as E}from"@rango-dev/wallets-shared";import{tonBlockchain as k}from"rango-types";async function m(){return await import("@tonconnect/ui")}o(m,"getTonConnectUIModule");async function I(){return await import("@ton/core")}o(I,"getTonCoreModule");async function C(n){return new Promise((t,e)=>{let c=n.onStatusChange(r=>{!!r?.account.address&&(c(),t(r.account.address))},r=>{c(),e(r)}),s=n.onModalStateChange(r=>{r.closeReason==="action-cancelled"&&(c(),s(),e(new Error("The action was canceled by the user")))})})}o(C,"waitForConnection");async function a(n){return(await I()).Address.parse(n).toString({bounceable:!1})}o(a,"parseAddress");import{DefaultSignerFactory as b,TransactionType as N}from"rango-types";async function p(n){let t=new b,{CustomTonSigner:e}=await Promise.resolve().then(()=>(u(),g));return t.registerSigner(N.TON,new e(n)),t}o(p,"getSigners");var T={manifestUrl:""},v=E.TON_CONNECT,q={type:v,isAsyncInstance:!0,checkInstallation:!1},z=o(n=>{T=n},"init"),d=null,J=o(async()=>{if(!d){let{TonConnectUI:n}=await m();d=new n(T)}return d},"getInstance"),K=o(async({instance:n})=>{let t=n;if(await t.connectionRestored&&t.account?.address)return{accounts:[await a(t.account.address)],chainId:f.TON};await t.openModal();let c=await C(t);return{accounts:[await a(c)],chainId:f.TON}},"connect"),Q=o(async({instance:n})=>await n.connectionRestored,"canEagerConnect"),V=o(()=>!1,"canSwitchNetworkTo"),X=p,Y=o(n=>({name:"TON Connect",img:"https://raw.githubusercontent.com/rango-exchange/assets/7fb19ed5d5019b4d6a41ce91b39cde64f86af4c6/wallets/tonconnect/icon.svg",installLink:"",color:"#fff",supportedChains:k(n)}),"getWalletInfo"),Z=o(async({instance:n})=>{await n.disconnect()},"disconnect");export{Q as canEagerConnect,V as canSwitchNetworkTo,q as config,K as connect,Z as disconnect,J as getInstance,X as getSigners,Y as getWalletInfo,z as init};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/ton-signer.ts", "../src/index.ts", "../src/helpers.ts", "../src/signer.ts"],
4
+ "sourcesContent": ["import type { TonConnectUI } from '@tonconnect/ui';\nimport type { GenericSigner, TonTransaction } from 'rango-types';\n\nimport { Cell } from '@ton/core';\nimport { CHAIN } from '@tonconnect/ui';\nimport { SignerError } from 'rango-types';\n\nexport class CustomTonSigner implements GenericSigner<TonTransaction> {\n private provider: TonConnectUI;\n\n constructor(provider: TonConnectUI) {\n this.provider = provider;\n }\n\n async signMessage(): Promise<string> {\n throw SignerError.UnimplementedError('signMessage');\n }\n\n async signAndSendTx(tx: TonTransaction): Promise<{ hash: string }> {\n const { blockChain, type, ...txObjectForSign } = tx;\n const result = await this.provider.sendTransaction({\n ...txObjectForSign,\n network: CHAIN.MAINNET,\n });\n\n const hash = Cell.fromBase64(result.boc).hash().toString('hex');\n return { hash };\n }\n}\n", "import type { Environments } from './types.js';\nimport type {\n CanEagerConnect,\n CanSwitchNetwork,\n Connect,\n Disconnect,\n GetInstance,\n WalletInfo,\n} from '@rango-dev/wallets-shared';\nimport type { TonConnectUI } from '@tonconnect/ui';\nimport type { BlockchainMeta, SignerFactory } from 'rango-types';\n\nimport { Networks, WalletTypes } from '@rango-dev/wallets-shared';\nimport { tonBlockchain } from 'rango-types';\n\nimport {\n getTonConnectUIModule,\n parseAddress,\n waitForConnection,\n} from './helpers.js';\nimport signer from './signer.js';\n\nlet envs: Environments = {\n manifestUrl: '',\n};\n\nconst WALLET = WalletTypes.TON_CONNECT;\n\nexport const config = {\n type: WALLET,\n isAsyncInstance: true,\n checkInstallation: false,\n};\n\nexport type { Environments };\n\nexport const init = (environments: Environments) => {\n envs = environments;\n};\n\nlet instance: TonConnectUI | null = null;\n\nexport const getInstance: GetInstance = async () => {\n if (!instance) {\n const { TonConnectUI } = await getTonConnectUIModule();\n instance = new TonConnectUI(envs);\n }\n return instance;\n};\n\nexport const connect: Connect = async ({ instance }) => {\n const tonConnectUI: TonConnectUI = instance;\n const connectionRestored = await tonConnectUI.connectionRestored;\n\n if (connectionRestored && tonConnectUI.account?.address) {\n const parsedAddress = await parseAddress(tonConnectUI.account.address);\n return { accounts: [parsedAddress], chainId: Networks.TON };\n }\n\n await tonConnectUI.openModal();\n const result = await waitForConnection(tonConnectUI);\n const parsedAddress = await parseAddress(result);\n\n return {\n accounts: [parsedAddress],\n chainId: Networks.TON,\n };\n};\n\nexport const canEagerConnect: CanEagerConnect = async ({ instance }) => {\n const tonConnectUI = instance as TonConnectUI;\n const connectionRestored = await tonConnectUI.connectionRestored;\n return connectionRestored;\n};\n\nexport const canSwitchNetworkTo: CanSwitchNetwork = () => false;\n\nexport const getSigners: (provider: TonConnectUI) => Promise<SignerFactory> =\n signer;\n\nexport const getWalletInfo: (allBlockChains: BlockchainMeta[]) => WalletInfo = (\n allBlockChains\n) => {\n const ton = tonBlockchain(allBlockChains);\n return {\n name: 'TON Connect',\n img: 'https://raw.githubusercontent.com/rango-exchange/assets/7fb19ed5d5019b4d6a41ce91b39cde64f86af4c6/wallets/tonconnect/icon.svg',\n installLink: '',\n color: '#fff',\n supportedChains: ton,\n };\n};\n\nexport const disconnect: Disconnect = async ({ instance }) => {\n const tonConnectUI = instance as TonConnectUI;\n await tonConnectUI.disconnect();\n};\n", "import type { TonConnectUI } from '@tonconnect/ui';\n\nexport async function getTonConnectUIModule() {\n const tonConnectUI = await import('@tonconnect/ui');\n return tonConnectUI;\n}\n\nexport async function getTonCoreModule() {\n const tonCore = await import('@ton/core');\n return tonCore;\n}\n\nexport async function waitForConnection(\n tonConnectUI: TonConnectUI\n): Promise<string> {\n return new Promise((resolve, reject) => {\n const unsubscribeStatusChange = tonConnectUI.onStatusChange(\n (state) => {\n const walletConnected = !!state?.account.address;\n\n if (walletConnected) {\n unsubscribeStatusChange();\n resolve(state.account.address);\n }\n },\n (error) => {\n unsubscribeStatusChange();\n reject(error);\n }\n );\n\n const unsubscribeModalStateChange = tonConnectUI.onModalStateChange(\n (modalState) => {\n if (modalState.closeReason === 'action-cancelled') {\n unsubscribeStatusChange();\n unsubscribeModalStateChange();\n reject(new Error('The action was canceled by the user'));\n }\n }\n );\n });\n}\n\nexport async function parseAddress(rawAddress: string): Promise<string> {\n const tonCore = await getTonCoreModule();\n return tonCore.Address.parse(rawAddress).toString({ bounceable: false });\n}\n", "import type { TonConnectUI } from '@tonconnect/ui';\nimport type { SignerFactory } from 'rango-types';\n\nimport { DefaultSignerFactory, TransactionType as TxType } from 'rango-types';\n\nexport default async function getSigners(\n provider: TonConnectUI\n): Promise<SignerFactory> {\n const signers = new DefaultSignerFactory();\n const { CustomTonSigner } = await import('./ton-signer.js');\n signers.registerSigner(TxType.TON, new CustomTonSigner(provider));\n return signers;\n}\n"],
5
+ "mappings": "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",
6
+ "names": ["ton_signer_exports", "__export", "CustomTonSigner", "Cell", "CHAIN", "SignerError", "init_ton_signer", "__esmMin", "__name", "provider", "tx", "blockChain", "type", "txObjectForSign", "result", "Networks", "WalletTypes", "tonBlockchain", "getTonConnectUIModule", "__name", "getTonCoreModule", "waitForConnection", "tonConnectUI", "resolve", "reject", "unsubscribeStatusChange", "state", "error", "unsubscribeModalStateChange", "modalState", "parseAddress", "rawAddress", "DefaultSignerFactory", "TxType", "getSigners", "provider", "signers", "DefaultSignerFactory", "CustomTonSigner", "TxType", "__name", "envs", "WALLET", "WalletTypes", "config", "init", "__name", "environments", "instance", "getInstance", "TonConnectUI", "getTonConnectUIModule", "connect", "tonConnectUI", "parseAddress", "Networks", "result", "waitForConnection", "canEagerConnect", "canSwitchNetworkTo", "getSigners", "getWalletInfo", "allBlockChains", "tonBlockchain", "disconnect"]
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"src/helpers.ts":{"bytes":1325,"imports":[{"path":"@tonconnect/ui","kind":"dynamic-import","external":true},{"path":"@ton/core","kind":"dynamic-import","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/ton-signer.ts":{"bytes":868,"imports":[{"path":"@ton/core","kind":"import-statement","external":true},{"path":"@tonconnect/ui","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/signer.ts":{"bytes":476,"imports":[{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/ton-signer.ts","kind":"dynamic-import","original":"./ton-signer.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":2624,"imports":[{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/helpers.ts","kind":"import-statement","original":"./helpers.js"},{"path":"src/signer.ts","kind":"import-statement","original":"./signer.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":8980},"dist/index.js":{"imports":[{"path":"@ton/core","kind":"import-statement","external":true},{"path":"@tonconnect/ui","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"@tonconnect/ui","kind":"dynamic-import","external":true},{"path":"@ton/core","kind":"dynamic-import","external":true},{"path":"rango-types","kind":"import-statement","external":true}],"exports":["canEagerConnect","canSwitchNetworkTo","config","connect","disconnect","getInstance","getSigners","getWalletInfo","init"],"entryPoint":"src/index.ts","inputs":{"src/ton-signer.ts":{"bytesInOutput":502},"src/index.ts":{"bytesInOutput":953},"src/helpers.ts":{"bytesInOutput":556},"src/signer.ts":{"bytesInOutput":226}},"bytes":2604}}}
@@ -0,0 +1,4 @@
1
+ import type { TonConnectUI } from '@tonconnect/ui';
2
+ import type { SignerFactory } from 'rango-types';
3
+ export default function getSigners(provider: TonConnectUI): Promise<SignerFactory>;
4
+ //# sourceMappingURL=signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../src/signer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,wBAA8B,UAAU,CACtC,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,aAAa,CAAC,CAKxB"}
@@ -0,0 +1,11 @@
1
+ import type { TonConnectUI } from '@tonconnect/ui';
2
+ import type { GenericSigner, TonTransaction } from 'rango-types';
3
+ export declare class CustomTonSigner implements GenericSigner<TonTransaction> {
4
+ private provider;
5
+ constructor(provider: TonConnectUI);
6
+ signMessage(): Promise<string>;
7
+ signAndSendTx(tx: TonTransaction): Promise<{
8
+ hash: string;
9
+ }>;
10
+ }
11
+ //# sourceMappingURL=ton-signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ton-signer.d.ts","sourceRoot":"","sources":["../src/ton-signer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAMjE,qBAAa,eAAgB,YAAW,aAAa,CAAC,cAAc,CAAC;IACnE,OAAO,CAAC,QAAQ,CAAe;gBAEnB,QAAQ,EAAE,YAAY;IAI5B,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAI9B,aAAa,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAUnE"}
@@ -0,0 +1,4 @@
1
+ export interface Environments extends Record<string, string | undefined> {
2
+ manifestUrl: string;
3
+ }
4
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAa,SAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACtE,WAAW,EAAE,MAAM,CAAC;CACrB"}
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@rango-dev/provider-tonconnect",
3
+ "version": "0.1.1-next.0",
4
+ "license": "MIT",
5
+ "type": "module",
6
+ "source": "./src/index.ts",
7
+ "main": "./dist/index.js",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "typings": "dist/index.d.ts",
15
+ "files": [
16
+ "dist",
17
+ "src"
18
+ ],
19
+ "scripts": {
20
+ "build": "node ../../scripts/build/command.mjs --path wallets/provider-tonconnect",
21
+ "ts-check": "tsc --declaration --emitDeclarationOnly -p ./tsconfig.json",
22
+ "clean": "rimraf dist",
23
+ "format": "prettier --write '{.,src}/**/*.{ts,tsx}'",
24
+ "lint": "eslint \"**/*.{ts,tsx}\" --ignore-path ../../.eslintignore"
25
+ },
26
+ "dependencies": {
27
+ "@rango-dev/wallets-shared": "^0.39.1-next.0",
28
+ "@ton/core": "^0.59.0",
29
+ "@ton/crypto": "^3.3.0",
30
+ "@tonconnect/ui": "^2.0.9",
31
+ "rango-types": "^0.1.75"
32
+ },
33
+ "publishConfig": {
34
+ "access": "public"
35
+ }
36
+ }
package/readme.md ADDED
@@ -0,0 +1,3 @@
1
+ # @rango-dev/provider-tonconnect
2
+
3
+ TonConnect
package/src/helpers.ts ADDED
@@ -0,0 +1,47 @@
1
+ import type { TonConnectUI } from '@tonconnect/ui';
2
+
3
+ export async function getTonConnectUIModule() {
4
+ const tonConnectUI = await import('@tonconnect/ui');
5
+ return tonConnectUI;
6
+ }
7
+
8
+ export async function getTonCoreModule() {
9
+ const tonCore = await import('@ton/core');
10
+ return tonCore;
11
+ }
12
+
13
+ export async function waitForConnection(
14
+ tonConnectUI: TonConnectUI
15
+ ): Promise<string> {
16
+ return new Promise((resolve, reject) => {
17
+ const unsubscribeStatusChange = tonConnectUI.onStatusChange(
18
+ (state) => {
19
+ const walletConnected = !!state?.account.address;
20
+
21
+ if (walletConnected) {
22
+ unsubscribeStatusChange();
23
+ resolve(state.account.address);
24
+ }
25
+ },
26
+ (error) => {
27
+ unsubscribeStatusChange();
28
+ reject(error);
29
+ }
30
+ );
31
+
32
+ const unsubscribeModalStateChange = tonConnectUI.onModalStateChange(
33
+ (modalState) => {
34
+ if (modalState.closeReason === 'action-cancelled') {
35
+ unsubscribeStatusChange();
36
+ unsubscribeModalStateChange();
37
+ reject(new Error('The action was canceled by the user'));
38
+ }
39
+ }
40
+ );
41
+ });
42
+ }
43
+
44
+ export async function parseAddress(rawAddress: string): Promise<string> {
45
+ const tonCore = await getTonCoreModule();
46
+ return tonCore.Address.parse(rawAddress).toString({ bounceable: false });
47
+ }
package/src/index.ts ADDED
@@ -0,0 +1,97 @@
1
+ import type { Environments } from './types.js';
2
+ import type {
3
+ CanEagerConnect,
4
+ CanSwitchNetwork,
5
+ Connect,
6
+ Disconnect,
7
+ GetInstance,
8
+ WalletInfo,
9
+ } from '@rango-dev/wallets-shared';
10
+ import type { TonConnectUI } from '@tonconnect/ui';
11
+ import type { BlockchainMeta, SignerFactory } from 'rango-types';
12
+
13
+ import { Networks, WalletTypes } from '@rango-dev/wallets-shared';
14
+ import { tonBlockchain } from 'rango-types';
15
+
16
+ import {
17
+ getTonConnectUIModule,
18
+ parseAddress,
19
+ waitForConnection,
20
+ } from './helpers.js';
21
+ import signer from './signer.js';
22
+
23
+ let envs: Environments = {
24
+ manifestUrl: '',
25
+ };
26
+
27
+ const WALLET = WalletTypes.TON_CONNECT;
28
+
29
+ export const config = {
30
+ type: WALLET,
31
+ isAsyncInstance: true,
32
+ checkInstallation: false,
33
+ };
34
+
35
+ export type { Environments };
36
+
37
+ export const init = (environments: Environments) => {
38
+ envs = environments;
39
+ };
40
+
41
+ let instance: TonConnectUI | null = null;
42
+
43
+ export const getInstance: GetInstance = async () => {
44
+ if (!instance) {
45
+ const { TonConnectUI } = await getTonConnectUIModule();
46
+ instance = new TonConnectUI(envs);
47
+ }
48
+ return instance;
49
+ };
50
+
51
+ export const connect: Connect = async ({ instance }) => {
52
+ const tonConnectUI: TonConnectUI = instance;
53
+ const connectionRestored = await tonConnectUI.connectionRestored;
54
+
55
+ if (connectionRestored && tonConnectUI.account?.address) {
56
+ const parsedAddress = await parseAddress(tonConnectUI.account.address);
57
+ return { accounts: [parsedAddress], chainId: Networks.TON };
58
+ }
59
+
60
+ await tonConnectUI.openModal();
61
+ const result = await waitForConnection(tonConnectUI);
62
+ const parsedAddress = await parseAddress(result);
63
+
64
+ return {
65
+ accounts: [parsedAddress],
66
+ chainId: Networks.TON,
67
+ };
68
+ };
69
+
70
+ export const canEagerConnect: CanEagerConnect = async ({ instance }) => {
71
+ const tonConnectUI = instance as TonConnectUI;
72
+ const connectionRestored = await tonConnectUI.connectionRestored;
73
+ return connectionRestored;
74
+ };
75
+
76
+ export const canSwitchNetworkTo: CanSwitchNetwork = () => false;
77
+
78
+ export const getSigners: (provider: TonConnectUI) => Promise<SignerFactory> =
79
+ signer;
80
+
81
+ export const getWalletInfo: (allBlockChains: BlockchainMeta[]) => WalletInfo = (
82
+ allBlockChains
83
+ ) => {
84
+ const ton = tonBlockchain(allBlockChains);
85
+ return {
86
+ name: 'TON Connect',
87
+ img: 'https://raw.githubusercontent.com/rango-exchange/assets/7fb19ed5d5019b4d6a41ce91b39cde64f86af4c6/wallets/tonconnect/icon.svg',
88
+ installLink: '',
89
+ color: '#fff',
90
+ supportedChains: ton,
91
+ };
92
+ };
93
+
94
+ export const disconnect: Disconnect = async ({ instance }) => {
95
+ const tonConnectUI = instance as TonConnectUI;
96
+ await tonConnectUI.disconnect();
97
+ };
package/src/signer.ts ADDED
@@ -0,0 +1,13 @@
1
+ import type { TonConnectUI } from '@tonconnect/ui';
2
+ import type { SignerFactory } from 'rango-types';
3
+
4
+ import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types';
5
+
6
+ export default async function getSigners(
7
+ provider: TonConnectUI
8
+ ): Promise<SignerFactory> {
9
+ const signers = new DefaultSignerFactory();
10
+ const { CustomTonSigner } = await import('./ton-signer.js');
11
+ signers.registerSigner(TxType.TON, new CustomTonSigner(provider));
12
+ return signers;
13
+ }
@@ -0,0 +1,29 @@
1
+ import type { TonConnectUI } from '@tonconnect/ui';
2
+ import type { GenericSigner, TonTransaction } from 'rango-types';
3
+
4
+ import { Cell } from '@ton/core';
5
+ import { CHAIN } from '@tonconnect/ui';
6
+ import { SignerError } from 'rango-types';
7
+
8
+ export class CustomTonSigner implements GenericSigner<TonTransaction> {
9
+ private provider: TonConnectUI;
10
+
11
+ constructor(provider: TonConnectUI) {
12
+ this.provider = provider;
13
+ }
14
+
15
+ async signMessage(): Promise<string> {
16
+ throw SignerError.UnimplementedError('signMessage');
17
+ }
18
+
19
+ async signAndSendTx(tx: TonTransaction): Promise<{ hash: string }> {
20
+ const { blockChain, type, ...txObjectForSign } = tx;
21
+ const result = await this.provider.sendTransaction({
22
+ ...txObjectForSign,
23
+ network: CHAIN.MAINNET,
24
+ });
25
+
26
+ const hash = Cell.fromBase64(result.boc).hash().toString('hex');
27
+ return { hash };
28
+ }
29
+ }
package/src/types.ts ADDED
@@ -0,0 +1,3 @@
1
+ export interface Environments extends Record<string, string | undefined> {
2
+ manifestUrl: string;
3
+ }