@tonconnect/ui 2.3.0-beta.1 → 2.3.0-beta.3

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/lib/index.d.ts CHANGED
@@ -1,19 +1,19 @@
1
- import { WalletInfoInjectable, WalletInfoRemote, RequiredFeatures, VersionEvent, ConnectionEvent, ConnectionRestoringEvent, DisconnectionEvent, TransactionSigningEvent, DataSigningEvent, ITonConnect, EventDispatcher, SdkActionEvent, Wallet, FeatureName, WalletInfo, Account, ConnectAdditionalRequest, TonConnectError, SendTransactionRequest, SendTransactionResponse, SignDataPayload, SignDataResponse } from '@tonconnect/sdk';
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';
2
2
  export * from '@tonconnect/sdk';
3
3
  import { Property } from 'csstype';
4
4
 
5
- declare type Locales = 'en' | 'ru';
5
+ type Locales = 'en' | 'ru';
6
6
 
7
7
  declare enum THEME {
8
8
  DARK = "DARK",
9
9
  LIGHT = "LIGHT"
10
10
  }
11
- declare type Theme = THEME | 'SYSTEM';
11
+ type Theme = THEME | 'SYSTEM';
12
12
 
13
- declare type BorderRadius = 'm' | 's' | 'none';
13
+ type BorderRadius = 'm' | 's' | 'none';
14
14
 
15
- declare type Color$1 = Property.Color;
16
- declare type ColorsSet = {
15
+ type Color$1 = Property.Color;
16
+ type ColorsSet = {
17
17
  constant: {
18
18
  black: Color$1;
19
19
  white: Color$1;
@@ -43,7 +43,7 @@ declare type ColorsSet = {
43
43
  secondary: Color$1;
44
44
  };
45
45
  };
46
- declare type PartialColorsSet = {
46
+ type PartialColorsSet = {
47
47
  constant?: {
48
48
  black?: Color$1;
49
49
  white?: Color$1;
@@ -91,12 +91,12 @@ interface UIPreferences {
91
91
  colorsSet?: Partial<Record<THEME, PartialColorsSet>>;
92
92
  }
93
93
 
94
- declare type UIWallet = Omit<WalletInfoInjectable, 'injected' | 'embedded'> | WalletInfoRemote;
94
+ type UIWallet = Omit<WalletInfoInjectable, 'injected' | 'embedded'> | WalletInfoRemote;
95
95
 
96
96
  /**
97
97
  * Add corrections to the default wallets list in the modal: add custom wallets and change wallets order.
98
98
  */
99
- declare type WalletsListConfiguration = {
99
+ type WalletsListConfiguration = {
100
100
  /**
101
101
  * Allows to include extra wallets to the wallets list in the modal.
102
102
  */
@@ -107,7 +107,7 @@ declare type WalletsListConfiguration = {
107
107
  * Specifies return strategy for the deeplink when user signs/declines the request.
108
108
  * [See details]{@link https://github.com/ton-connect/docs/blob/main/bridge.md#universal-link}.
109
109
  */
110
- declare type ReturnStrategy = 'back' | 'none' | `${string}://${string}`;
110
+ type ReturnStrategy = 'back' | 'none' | `${string}://${string}`;
111
111
 
112
112
  interface ActionConfiguration {
113
113
  /**
@@ -179,9 +179,9 @@ interface TonConnectUiOptions {
179
179
  /**
180
180
  * User action events.
181
181
  */
182
- declare type UserActionEvent = VersionEvent | ConnectionEvent | ConnectionRestoringEvent | DisconnectionEvent | TransactionSigningEvent | DataSigningEvent;
182
+ type UserActionEvent = VersionEvent | ConnectionEvent | ConnectionRestoringEvent | DisconnectionEvent | TransactionSigningEvent | DataSigningEvent;
183
183
 
184
- declare type TonConnectUiCreateOptions = TonConnectUiOptionsWithConnector | TonConnectUiOptionsWithManifest;
184
+ type TonConnectUiCreateOptions = TonConnectUiOptionsWithConnector | TonConnectUiOptionsWithManifest;
185
185
  interface TonConnectUiOptionsWithManifest extends TonConnectUiCreateOptionsBase {
186
186
  /**
187
187
  * Url to the [manifest]{@link https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest} with the Dapp metadata that will be displayed in the user's wallet.
@@ -213,18 +213,18 @@ interface TonConnectUiCreateOptionsBase extends TonConnectUiOptions {
213
213
  eventDispatcher?: EventDispatcher<UserActionEvent | SdkActionEvent>;
214
214
  }
215
215
 
216
- declare type WalletOpenMethod = 'qrcode' | 'universal-link' | 'custom-deeplink';
217
- declare type WalletInfoWithOpenMethod = WalletInfoInjectable | WalletInfoRemoteWithOpenMethod | (WalletInfoInjectable & WalletInfoRemoteWithOpenMethod);
218
- declare type WalletInfoRemoteWithOpenMethod = WalletInfoRemote & {
216
+ type WalletOpenMethod = 'qrcode' | 'universal-link' | 'custom-deeplink';
217
+ type WalletInfoWithOpenMethod = WalletInfoInjectable | WalletInfoRemoteWithOpenMethod | (WalletInfoInjectable & WalletInfoRemoteWithOpenMethod);
218
+ type WalletInfoRemoteWithOpenMethod = WalletInfoRemote & {
219
219
  openMethod?: WalletOpenMethod;
220
220
  };
221
- declare type ConnectedWallet = Wallet & WalletInfoWithOpenMethod;
221
+ type ConnectedWallet = Wallet & WalletInfoWithOpenMethod;
222
222
 
223
- declare type Loadable<T> = LoadableLoading | LoadableReady<T>;
224
- declare type LoadableLoading = {
223
+ type Loadable<T> = LoadableLoading | LoadableReady<T>;
224
+ type LoadableLoading = {
225
225
  state: 'loading';
226
226
  };
227
- declare type LoadableReady<T> = {
227
+ type LoadableReady<T> = {
228
228
  state: 'ready';
229
229
  value: T;
230
230
  };
@@ -251,7 +251,7 @@ interface WalletsModal {
251
251
  /**
252
252
  * Opened modal window state.
253
253
  */
254
- declare type WalletModalOpened = {
254
+ type WalletModalOpened = {
255
255
  /**
256
256
  * Modal window status.
257
257
  */
@@ -264,7 +264,7 @@ declare type WalletModalOpened = {
264
264
  /**
265
265
  * Closed modal window state.
266
266
  */
267
- declare type WalletModalClosed = {
267
+ type WalletModalClosed = {
268
268
  /**
269
269
  * Modal window status.
270
270
  */
@@ -274,7 +274,7 @@ declare type WalletModalClosed = {
274
274
  */
275
275
  closeReason: WalletsModalCloseReason | null;
276
276
  };
277
- declare type ChooseSupportedFeatureWalletsModal = {
277
+ type ChooseSupportedFeatureWalletsModal = {
278
278
  /**
279
279
  * Modal window status.
280
280
  */
@@ -292,16 +292,16 @@ declare type ChooseSupportedFeatureWalletsModal = {
292
292
  /**
293
293
  * Modal window state.
294
294
  */
295
- declare type WalletsModalState = WalletModalOpened | WalletModalClosed | ChooseSupportedFeatureWalletsModal;
295
+ type WalletsModalState = WalletModalOpened | WalletModalClosed | ChooseSupportedFeatureWalletsModal;
296
296
  /**
297
297
  * Modal window close reason.
298
298
  */
299
- declare type WalletsModalCloseReason = 'action-cancelled' | 'wallet-selected';
299
+ type WalletsModalCloseReason = 'action-cancelled' | 'wallet-selected';
300
300
 
301
301
  /**
302
302
  * Opened modal window state.
303
303
  */
304
- declare type SingleWalletModalOpened = {
304
+ type SingleWalletModalOpened = {
305
305
  /**
306
306
  * Modal window status.
307
307
  */
@@ -318,7 +318,7 @@ declare type SingleWalletModalOpened = {
318
318
  /**
319
319
  * Closed modal window state.
320
320
  */
321
- declare type SingleWalletModalClosed = {
321
+ type SingleWalletModalClosed = {
322
322
  /**
323
323
  * Modal window status.
324
324
  */
@@ -331,11 +331,11 @@ declare type SingleWalletModalClosed = {
331
331
  /**
332
332
  * Modal window state.
333
333
  */
334
- declare type SingleWalletModalState = SingleWalletModalOpened | SingleWalletModalClosed;
334
+ type SingleWalletModalState = SingleWalletModalOpened | SingleWalletModalClosed;
335
335
  /**
336
336
  * Modal window close reason.
337
337
  */
338
- declare type SingleWalletModalCloseReason = 'action-cancelled' | 'wallet-selected';
338
+ type SingleWalletModalCloseReason = 'action-cancelled' | 'wallet-selected';
339
339
 
340
340
  declare class TonConnectUI {
341
341
  static getWallets(): Promise<WalletInfo[]>;
@@ -475,6 +475,11 @@ declare class TonConnectUI {
475
475
  signData(data: SignDataPayload, options?: {
476
476
  onRequestSent?: (redirectToWallet: () => void) => void;
477
477
  }): Promise<SignDataResponse>;
478
+ /**
479
+ * Gets the current session ID if available.
480
+ * @returns session ID string or null if not available.
481
+ */
482
+ private getSessionId;
478
483
  private redirectAfterRequestSent;
479
484
  /**
480
485
  * TODO: remove in the next major version.
@@ -538,10 +543,11 @@ declare class TonConnectUI {
538
543
  private getModalsAndNotificationsConfiguration;
539
544
  }
540
545
 
541
- declare type Color = Property.Color;
546
+ type Color = Property.Color;
542
547
 
543
548
  declare class TonConnectUIError extends TonConnectError {
544
549
  constructor(...args: ConstructorParameters<typeof Error>);
545
550
  }
546
551
 
547
- export { ActionConfiguration, BorderRadius, Color, ColorsSet, ConnectedWallet, Loadable, LoadableLoading, LoadableReady, Locales, PartialColorsSet, ReturnStrategy, THEME, Theme, TonConnectUI, TonConnectUIError, TonConnectUiCreateOptions, TonConnectUiCreateOptionsBase, TonConnectUiOptions, TonConnectUiOptionsWithConnector, TonConnectUiOptionsWithManifest, UIPreferences, UIWallet, UserActionEvent, WalletInfoRemoteWithOpenMethod, WalletInfoWithOpenMethod, WalletModalClosed, WalletModalOpened, WalletOpenMethod, WalletsListConfiguration, WalletsModal, WalletsModalCloseReason, WalletsModalState };
552
+ export { THEME, TonConnectUI, TonConnectUIError };
553
+ export type { ActionConfiguration, BorderRadius, Color, ColorsSet, ConnectedWallet, Loadable, LoadableLoading, LoadableReady, Locales, PartialColorsSet, ReturnStrategy, Theme, TonConnectUiCreateOptions, TonConnectUiCreateOptionsBase, TonConnectUiOptions, TonConnectUiOptionsWithConnector, TonConnectUiOptionsWithManifest, UIPreferences, UIWallet, UserActionEvent, WalletInfoRemoteWithOpenMethod, WalletInfoWithOpenMethod, WalletModalClosed, WalletModalOpened, WalletOpenMethod, WalletsListConfiguration, WalletsModal, WalletsModalCloseReason, WalletsModalState };