@tezos-x/octez.connect-dapp 5.0.0-beta.6 → 5.0.0-beta.7

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.
@@ -2,10 +2,10 @@ import { AccountInfo, TransportType, BeaconMessageType, RequestPermissionInput,
2
2
  import { Client, Transport } from '@tezos-x/octez.connect-core';
3
3
  import { BlockExplorer } from '../utils/block-explorer';
4
4
  import { BeaconEvent, BeaconEventHandlerFunction, BeaconEventType, BeaconEventHandler } from '../events';
5
- import { DAppClientOptions } from './DAppClientOptions';
6
5
  import { DappPostMessageTransport } from '../transports/DappPostMessageTransport';
7
6
  import { DappP2PTransport } from '../transports/DappP2PTransport';
8
7
  import { DappWalletConnectTransport } from '../transports/DappWalletConnectTransport';
8
+ import { DAppClientOptions } from './DAppClientOptions';
9
9
  /**
10
10
  * @publicapi
11
11
  *
@@ -26,7 +26,7 @@ export declare class DAppClient extends Client {
26
26
  /**
27
27
  * Automatically switch between apps on Mobile Devices (Enabled by Default)
28
28
  */
29
- private enableAppSwitching;
29
+ private readonly enableAppSwitching;
30
30
  /**
31
31
  * Enable metrics tracking (Disabled by Default)
32
32
  */
@@ -39,6 +39,12 @@ export declare class DAppClient extends Client {
39
39
  protected walletConnectTransport: DappWalletConnectTransport | undefined;
40
40
  protected wcProjectId?: string;
41
41
  protected wcRelayUrl?: string;
42
+ /**
43
+ * WalletConnect is opt-in: only enabled when `walletConnectOptions` is provided
44
+ * and `disableWalletConnect` is not set. When false, no WC transport is built,
45
+ * listened to, or offered for pairing, and no default projectId is applied.
46
+ */
47
+ protected isWalletConnectEnabled: boolean;
42
48
  private isGetActiveAccountHandled;
43
49
  private readonly openRequestsOtherTabs;
44
50
  /**
@@ -57,16 +63,23 @@ export declare class DAppClient extends Client {
57
63
  private _initPromise;
58
64
  private _initPromiseReject;
59
65
  private isInitPending;
66
+ /**
67
+ * Networks mapped for the next WalletConnect session proposal when
68
+ * `requestPermissions` runs before the WalletConnect transport exists (it
69
+ * is created lazily in `init`). Applied and cleared right after creation.
70
+ */
71
+ private pendingWcProposalNetworks;
60
72
  private readonly activeAccountLoaded;
61
73
  private readonly appMetadataManager;
62
74
  private readonly termsAndConditionsUrl?;
63
75
  private readonly privacyPolicyUrl?;
64
76
  private readonly errorMessages;
65
77
  private readonly featuredWallets;
78
+ readonly requiredMinimumVersion: string;
66
79
  private readonly storageValidator;
67
80
  private readonly beaconIDB;
68
81
  private debounceSetActiveAccount;
69
- private multiTabChannel;
82
+ private readonly multiTabChannel;
70
83
  constructor(config: DAppClientOptions);
71
84
  private checkIfBCLeaderExists;
72
85
  private onElectedLeaderhandler;
@@ -156,8 +169,8 @@ export declare class DAppClient extends Client {
156
169
  checkPermissions(type: BeaconMessageType): Promise<boolean>;
157
170
  sendNotification(title: string, message: string, payload: string, protocolIdentifier: string): Promise<string>;
158
171
  addBlockchain(chain: Blockchain): void;
159
- permissionRequest(input: PermissionRequestV3<string>): Promise<PermissionResponseV3<string>>;
160
- request(input: BlockchainRequestV3<string>): Promise<BlockchainResponseV3<string>>;
172
+ permissionRequest(input: PermissionRequestV3): Promise<PermissionResponseV3>;
173
+ request(input: BlockchainRequestV3): Promise<BlockchainResponseV3>;
161
174
  /**
162
175
  * Send a permission request to the DApp. This should be done as the first step. The wallet will respond
163
176
  * with an publicKey and permissions that were given. The account returned will be set as the "activeAccount"
@@ -249,6 +262,9 @@ export declare class DAppClient extends Client {
249
262
  private getWalletInfoFromStorage;
250
263
  private updateStorageWallet;
251
264
  private getWalletInfo;
265
+ private assertWalletVersionMeetsMinimum;
266
+ private getSessionChainIds;
267
+ private resolveOperationNetwork;
252
268
  private getPeer;
253
269
  /**
254
270
  * This method handles sending of requests to the DApp. It makes sure that the DAppClient is initialized and connected
@@ -259,6 +275,11 @@ export declare class DAppClient extends Client {
259
275
  * @param account The account that the message will be sent to
260
276
  * @param skipResponse If true, the function return as soon as the message is sent
261
277
  */
278
+ private static readonly FLAT_REQUEST_PAYLOAD_TYPES;
279
+ private static readonly TEZOS_PAYLOAD_TO_FLAT_TYPE;
280
+ private static readonly TEZOS_IDENTIFIERS;
281
+ private wrapTezosRequest;
282
+ private normalizeWrappedTezosMessage;
262
283
  private makeRequest;
263
284
  /**
264
285
  * This method handles sending of requests to the DApp. It makes sure that the DAppClient is initialized and connected
@@ -279,5 +300,6 @@ export declare class DAppClient extends Client {
279
300
  */
280
301
  private addOpenRequest;
281
302
  private sendNotificationWithAccessToken;
303
+ private buildAccountInfosFromV4Fanout;
282
304
  private onNewAccount;
283
305
  }