@tonconnect/ui 2.0.0-beta.9 → 2.0.1-beta.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/README.md +34 -0
- package/dist/tonconnect-ui.min.js +190 -190
- package/dist/tonconnect-ui.min.js.map +1 -1
- package/lib/index.cjs +532 -244
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +65 -1
- package/lib/index.mjs +533 -245
- package/lib/index.mjs.map +1 -1
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -195,7 +195,7 @@ interface TonConnectUiCreateOptionsBase extends TonConnectUiOptions {
|
|
|
195
195
|
widgetRootId?: string;
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
declare type WalletOpenMethod = 'qrcode' | 'universal-link';
|
|
198
|
+
declare type WalletOpenMethod = 'qrcode' | 'universal-link' | 'custom-deeplink';
|
|
199
199
|
declare type WalletInfoWithOpenMethod = WalletInfoInjectable | WalletInfoRemoteWithOpenMethod | (WalletInfoInjectable & WalletInfoRemoteWithOpenMethod);
|
|
200
200
|
declare type WalletInfoRemoteWithOpenMethod = WalletInfoRemote & {
|
|
201
201
|
openMethod?: WalletOpenMethod;
|
|
@@ -264,6 +264,45 @@ declare type WalletsModalState = WalletModalOpened | WalletModalClosed;
|
|
|
264
264
|
*/
|
|
265
265
|
declare type WalletsModalCloseReason = 'action-cancelled' | 'wallet-selected';
|
|
266
266
|
|
|
267
|
+
/**
|
|
268
|
+
* Opened modal window state.
|
|
269
|
+
*/
|
|
270
|
+
declare type SingleWalletModalOpened = {
|
|
271
|
+
/**
|
|
272
|
+
* Modal window status.
|
|
273
|
+
*/
|
|
274
|
+
status: 'opened';
|
|
275
|
+
/**
|
|
276
|
+
* Wallet info.
|
|
277
|
+
*/
|
|
278
|
+
walletInfo: WalletInfoRemote;
|
|
279
|
+
/**
|
|
280
|
+
* Always `null` for opened modal window.
|
|
281
|
+
*/
|
|
282
|
+
closeReason: null;
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* Closed modal window state.
|
|
286
|
+
*/
|
|
287
|
+
declare type SingleWalletModalClosed = {
|
|
288
|
+
/**
|
|
289
|
+
* Modal window status.
|
|
290
|
+
*/
|
|
291
|
+
status: 'closed';
|
|
292
|
+
/**
|
|
293
|
+
* Close reason, if the modal window was closed.
|
|
294
|
+
*/
|
|
295
|
+
closeReason: SingleWalletModalCloseReason | null;
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* Modal window state.
|
|
299
|
+
*/
|
|
300
|
+
declare type SingleWalletModalState = SingleWalletModalOpened | SingleWalletModalClosed;
|
|
301
|
+
/**
|
|
302
|
+
* Modal window close reason.
|
|
303
|
+
*/
|
|
304
|
+
declare type SingleWalletModalCloseReason = 'action-cancelled' | 'wallet-selected';
|
|
305
|
+
|
|
267
306
|
declare class TonConnectUI {
|
|
268
307
|
static getWallets(): Promise<WalletInfo[]>;
|
|
269
308
|
private readonly walletInfoStorage;
|
|
@@ -281,6 +320,11 @@ declare class TonConnectUI {
|
|
|
281
320
|
* Manages the modal window state.
|
|
282
321
|
*/
|
|
283
322
|
readonly modal: WalletsModal;
|
|
323
|
+
/**
|
|
324
|
+
* Manages the single wallet modal window state.
|
|
325
|
+
* TODO: make it public when interface will be ready for external usage.
|
|
326
|
+
*/
|
|
327
|
+
private readonly singleWalletModal;
|
|
284
328
|
/**
|
|
285
329
|
* Manages the transaction modal window state.
|
|
286
330
|
* TODO: make it public when interface will be ready for external usage.
|
|
@@ -341,6 +385,26 @@ declare class TonConnectUI {
|
|
|
341
385
|
* Returns current modal window state.
|
|
342
386
|
*/
|
|
343
387
|
get modalState(): WalletsModalState;
|
|
388
|
+
/**
|
|
389
|
+
* Opens the single wallet modal window, returns a promise that resolves after the modal window is opened.
|
|
390
|
+
* @experimental
|
|
391
|
+
*/
|
|
392
|
+
openSingleWalletModal(wallet: string): Promise<void>;
|
|
393
|
+
/**
|
|
394
|
+
* Close the single wallet modal window.
|
|
395
|
+
* @experimental
|
|
396
|
+
*/
|
|
397
|
+
closeSingleWalletModal(): void;
|
|
398
|
+
/**
|
|
399
|
+
* Subscribe to the single wallet modal window state changes, returns a function which has to be called to unsubscribe.
|
|
400
|
+
* @experimental
|
|
401
|
+
*/
|
|
402
|
+
onSingleWalletModalStateChange(onChange: (state: SingleWalletModalState) => void): () => void;
|
|
403
|
+
/**
|
|
404
|
+
* Returns current single wallet modal window state.
|
|
405
|
+
* @experimental
|
|
406
|
+
*/
|
|
407
|
+
get singleWalletModalState(): SingleWalletModalState;
|
|
344
408
|
/**
|
|
345
409
|
* @deprecated Use `tonConnectUI.openModal()` instead. Will be removed in the next major version.
|
|
346
410
|
* Opens the modal window and handles a wallet connection.
|