@tonconnect/ui 2.3.1 → 2.4.0-beta.1
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 +39 -0
- package/dist/tonconnect-ui.min.js +239 -239
- package/dist/tonconnect-ui.min.js.map +1 -1
- package/lib/index.cjs +400 -85
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +17 -11
- package/lib/index.mjs +401 -86
- package/lib/index.mjs.map +1 -1
- package/package.json +6 -3
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WalletInfoInjectable, WalletInfoRemote, RequiredFeatures, VersionEvent, ConnectionEvent, ConnectionRestoringEvent, DisconnectionEvent, TransactionSigningEvent, DataSigningEvent, EventDispatcher, SdkActionEvent, ITonConnect, Wallet, FeatureName, WalletInfo, Account, ConnectAdditionalRequest, TonConnectError, SendTransactionRequest, SendTransactionResponse, SignDataPayload, SignDataResponse } from '@tonconnect/sdk';
|
|
1
|
+
import { WalletInfoInjectable, WalletInfoRemote, RequiredFeatures, VersionEvent, ConnectionEvent, ConnectionRestoringEvent, DisconnectionEvent, TransactionSigningEvent, DataSigningEvent, WalletModalOpenedEvent, SelectedWalletEvent, EventDispatcher, SdkActionEvent, ITonConnect, Wallet, OptionalTraceable, FeatureName, WalletInfo, Account, ConnectAdditionalRequest, ChainId, TonConnectError, SendTransactionRequest, SendTransactionResponse, SignDataPayload, SignDataResponse } from '@tonconnect/sdk';
|
|
2
2
|
export * from '@tonconnect/sdk';
|
|
3
3
|
import { Property } from 'csstype';
|
|
4
4
|
|
|
@@ -179,7 +179,7 @@ interface TonConnectUiOptions {
|
|
|
179
179
|
/**
|
|
180
180
|
* User action events.
|
|
181
181
|
*/
|
|
182
|
-
type UserActionEvent = VersionEvent | ConnectionEvent | ConnectionRestoringEvent | DisconnectionEvent | TransactionSigningEvent | DataSigningEvent;
|
|
182
|
+
type UserActionEvent = VersionEvent | ConnectionEvent | ConnectionRestoringEvent | DisconnectionEvent | TransactionSigningEvent | DataSigningEvent | WalletModalOpenedEvent | SelectedWalletEvent;
|
|
183
183
|
|
|
184
184
|
type TonConnectUiCreateOptions = TonConnectUiOptionsWithConnector | TonConnectUiOptionsWithManifest;
|
|
185
185
|
interface TonConnectUiOptionsWithManifest extends TonConnectUiCreateOptionsBase {
|
|
@@ -233,7 +233,7 @@ interface WalletsModal {
|
|
|
233
233
|
/**
|
|
234
234
|
* Open the modal.
|
|
235
235
|
*/
|
|
236
|
-
open: () => void;
|
|
236
|
+
open: (options?: OptionalTraceable) => void;
|
|
237
237
|
/**
|
|
238
238
|
* Close the modal.
|
|
239
239
|
* @default 'action-cancelled'
|
|
@@ -292,7 +292,7 @@ type ChooseSupportedFeatureWalletsModal = {
|
|
|
292
292
|
/**
|
|
293
293
|
* Modal window state.
|
|
294
294
|
*/
|
|
295
|
-
type WalletsModalState = WalletModalOpened | WalletModalClosed | ChooseSupportedFeatureWalletsModal
|
|
295
|
+
type WalletsModalState = OptionalTraceable<WalletModalOpened | WalletModalClosed | ChooseSupportedFeatureWalletsModal>;
|
|
296
296
|
/**
|
|
297
297
|
* Modal window close reason.
|
|
298
298
|
*/
|
|
@@ -404,6 +404,12 @@ declare class TonConnectUI {
|
|
|
404
404
|
* If `connectRequestParameters.state` was changed to 'ready' or it's value has been changed, QR will be re-rendered.
|
|
405
405
|
*/
|
|
406
406
|
setConnectRequestParameters(connectRequestParameters: Loadable<ConnectAdditionalRequest> | undefined | null): void;
|
|
407
|
+
/**
|
|
408
|
+
* Set desired network for the connection. Can only be set before connecting.
|
|
409
|
+
* If wallet connects with a different chain, the SDK will throw an error and abort connection.
|
|
410
|
+
* @param network desired network id (e.g., '-239', '-3', or custom). Pass undefined to allow any network.
|
|
411
|
+
*/
|
|
412
|
+
setConnectionNetwork(network?: ChainId): void;
|
|
407
413
|
/**
|
|
408
414
|
* Returns available wallets list.
|
|
409
415
|
*/
|
|
@@ -416,7 +422,7 @@ declare class TonConnectUI {
|
|
|
416
422
|
/**
|
|
417
423
|
* Opens the modal window, returns a promise that resolves after the modal window is opened.
|
|
418
424
|
*/
|
|
419
|
-
openModal(): Promise<void>;
|
|
425
|
+
openModal(options?: OptionalTraceable): Promise<void>;
|
|
420
426
|
/**
|
|
421
427
|
* Closes the modal window.
|
|
422
428
|
*/
|
|
@@ -455,26 +461,26 @@ declare class TonConnectUI {
|
|
|
455
461
|
* @return Connected wallet.
|
|
456
462
|
* @throws TonConnectUIError if connection was aborted.
|
|
457
463
|
*/
|
|
458
|
-
connectWallet(): Promise<ConnectedWallet>;
|
|
464
|
+
connectWallet(options?: OptionalTraceable): Promise<ConnectedWallet>;
|
|
459
465
|
/**
|
|
460
466
|
* Disconnect wallet and clean localstorage.
|
|
461
467
|
*/
|
|
462
|
-
disconnect(): Promise<void>;
|
|
468
|
+
disconnect(options?: OptionalTraceable): Promise<void>;
|
|
463
469
|
/**
|
|
464
470
|
* Opens the modal window and handles the transaction sending.
|
|
465
471
|
* @param tx transaction to send.
|
|
466
472
|
* @param options modal and notifications behaviour settings. Default is show only 'before' modal and all notifications.
|
|
467
473
|
*/
|
|
468
|
-
sendTransaction(tx: SendTransactionRequest, options?: ActionConfiguration & {
|
|
474
|
+
sendTransaction(tx: SendTransactionRequest, options?: ActionConfiguration & OptionalTraceable<{
|
|
469
475
|
onRequestSent?: (redirectToWallet: () => void) => void;
|
|
470
|
-
}): Promise<SendTransactionResponse
|
|
476
|
+
}>): Promise<OptionalTraceable<SendTransactionResponse>>;
|
|
471
477
|
/**
|
|
472
478
|
* Signs the data and returns the signature.
|
|
473
479
|
* @param data data to sign.
|
|
474
480
|
*/
|
|
475
|
-
signData(data: SignDataPayload, options?: {
|
|
481
|
+
signData(data: SignDataPayload, options?: OptionalTraceable<{
|
|
476
482
|
onRequestSent?: (redirectToWallet: () => void) => void;
|
|
477
|
-
}): Promise<SignDataResponse>;
|
|
483
|
+
}>): Promise<SignDataResponse>;
|
|
478
484
|
/**
|
|
479
485
|
* Gets the current session ID if available.
|
|
480
486
|
* @returns session ID string or null if not available.
|