@tonconnect/ui 0.0.3 → 0.0.5

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,4 +1,4 @@
1
- import { WalletConnectionSource, ITonConnect, Account, Wallet, WalletInfo, SendTransactionRequest, SendTransactionResponse, TonConnectError } from '@tonconnect/sdk';
1
+ import { WalletConnectionSource, ITonConnect, Account, Wallet, WalletInfo, TonConnectError, SendTransactionRequest, SendTransactionResponse } from '@tonconnect/sdk';
2
2
  import { Property } from 'csstype';
3
3
 
4
4
  declare enum THEME {
@@ -98,11 +98,11 @@ declare class TonConnectUi {
98
98
  * Subscribe to connection status change
99
99
  * @return function which has to be called to unsubscribe
100
100
  */
101
- onStatusChange(...parameters: Parameters<ITonConnect['onStatusChange']>): ReturnType<ITonConnect['onStatusChange']>;
101
+ onStatusChange(callback: (wallet: (Wallet & WalletInfo) | null) => void, errorsHandler?: (err: TonConnectError) => void): ReturnType<ITonConnect['onStatusChange']>;
102
102
  /**
103
103
  * Opens the modal window and handles a wallet connection.
104
104
  */
105
- connectWallet(): Promise<Wallet>;
105
+ connectWallet(): Promise<Wallet & WalletInfo>;
106
106
  /**
107
107
  * Disconnect wallet and clean localstorage.
108
108
  */
@@ -113,9 +113,8 @@ declare class TonConnectUi {
113
113
  * @param options
114
114
  */
115
115
  sendTransaction(tx: SendTransactionRequest, options?: {
116
- showModalBefore: boolean;
117
- showSuccessModalAfter: boolean;
118
- showErrorModalAfter: boolean;
116
+ modals: ('before' | 'success' | 'error')[];
117
+ notifications: ('before' | 'success' | 'error')[];
119
118
  }): Promise<SendTransactionResponse>;
120
119
  private subscribeToWalletChange;
121
120
  private updateWalletInfo;