@taquito/wallet-connect 24.2.0 → 24.3.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.
@@ -3,38 +3,6 @@ import { WalletConnectModal } from '@walletconnect/modal';
3
3
  import { createTransferOperation, createTransferTicketOperation, createOriginationOperation, createSetDelegateOperation, createIncreasePaidStorageOperation, createRegisterGlobalConstantOperation } from '@taquito/taquito';
4
4
  import { getSdkError } from '@walletconnect/utils';
5
5
 
6
- /******************************************************************************
7
- Copyright (c) Microsoft Corporation.
8
-
9
- Permission to use, copy, modify, and/or distribute this software for any
10
- purpose with or without fee is hereby granted.
11
-
12
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
13
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
15
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
17
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18
- PERFORMANCE OF THIS SOFTWARE.
19
- ***************************************************************************** */
20
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
21
-
22
-
23
- function __awaiter(thisArg, _arguments, P, generator) {
24
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
25
- return new (P || (P = Promise))(function (resolve, reject) {
26
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
27
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
28
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
29
- step((generator = generator.apply(thisArg, _arguments || [])).next());
30
- });
31
- }
32
-
33
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
34
- var e = new Error(message);
35
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
36
- };
37
-
38
6
  var NetworkType;
39
7
  (function (NetworkType) {
40
8
  NetworkType["MAINNET"] = "mainnet";
@@ -65,7 +33,7 @@ var SigningType;
65
33
 
66
34
  /**
67
35
  * @category Error
68
- * @description Error that indicates missing required permission scopes
36
+ * Error that indicates missing required permission scopes
69
37
  */
70
38
  class MissingRequiredScope extends Error {
71
39
  constructor(requiredScopes) {
@@ -76,7 +44,7 @@ class MissingRequiredScope extends Error {
76
44
  }
77
45
  /**
78
46
  * @category Error
79
- * @description Error that indicates the wallet returned an invalid namespace
47
+ * Error that indicates the wallet returned an invalid namespace
80
48
  */
81
49
  class InvalidReceivedSessionNamespace extends Error {
82
50
  constructor(messageWc, codeWc, type, data) {
@@ -95,7 +63,7 @@ class InvalidReceivedSessionNamespace extends Error {
95
63
  }
96
64
  /**
97
65
  * @category Error
98
- * @description Error that indicates an invalid session key being passed
66
+ * Error that indicates an invalid session key being passed
99
67
  */
100
68
  class InvalidSessionKey extends Error {
101
69
  constructor(key) {
@@ -106,7 +74,7 @@ class InvalidSessionKey extends Error {
106
74
  }
107
75
  /**
108
76
  * @category Error
109
- * @description Error that indicates the pkh is not part of the active accounts in the session
77
+ * Error that indicates the pkh is not part of the active accounts in the session
110
78
  */
111
79
  class InvalidAccount extends Error {
112
80
  constructor(pkh) {
@@ -117,7 +85,7 @@ class InvalidAccount extends Error {
117
85
  }
118
86
  /**
119
87
  * @category Error
120
- * @description Error that indicates the network is not part of the active networks in the session
88
+ * Error that indicates the network is not part of the active networks in the session
121
89
  */
122
90
  class InvalidNetwork extends Error {
123
91
  constructor(network) {
@@ -128,7 +96,7 @@ class InvalidNetwork extends Error {
128
96
  }
129
97
  /**
130
98
  * @category Error
131
- * @description Error that indicates the combinaison pkh-network is not part of the active session
99
+ * Error that indicates the combinaison pkh-network is not part of the active session
132
100
  */
133
101
  class InvalidNetworkOrAccount extends Error {
134
102
  constructor(network, pkh) {
@@ -140,7 +108,7 @@ class InvalidNetworkOrAccount extends Error {
140
108
  }
141
109
  /**
142
110
  * @category Error
143
- * @description Error that indicates the connection could not be established
111
+ * Error that indicates the connection could not be established
144
112
  */
145
113
  class ConnectionFailed extends Error {
146
114
  constructor(originalError) {
@@ -151,7 +119,7 @@ class ConnectionFailed extends Error {
151
119
  }
152
120
  /**
153
121
  * @category Error
154
- * @description Error that indicates there is no active session
122
+ * Error that indicates there is no active session
155
123
  */
156
124
  class NotConnected extends Error {
157
125
  constructor() {
@@ -161,7 +129,7 @@ class NotConnected extends Error {
161
129
  }
162
130
  /**
163
131
  * @category Error
164
- * @description Error that indicates the active account is not specified
132
+ * Error that indicates the active account is not specified
165
133
  */
166
134
  class ActiveAccountUnspecified extends Error {
167
135
  constructor() {
@@ -171,7 +139,7 @@ class ActiveAccountUnspecified extends Error {
171
139
  }
172
140
  /**
173
141
  * @category Error
174
- * @description Error that indicates the active network is not specified
142
+ * Error that indicates the active network is not specified
175
143
  */
176
144
  class ActiveNetworkUnspecified extends Error {
177
145
  constructor() {
@@ -181,7 +149,7 @@ class ActiveNetworkUnspecified extends Error {
181
149
  }
182
150
  /**
183
151
  * @category Error
184
- * @description Error that indicates the session is invalid
152
+ * Error that indicates the session is invalid
185
153
  */
186
154
  class InvalidSession extends Error {
187
155
  constructor(message) {
@@ -202,9 +170,9 @@ class PublicKeyRetrievalError extends Error {
202
170
  */
203
171
  const TEZOS_PLACEHOLDER = 'tezos';
204
172
  /**
205
- * @description The `WalletConnect` class implements the `WalletProvider` interface, providing an alternative to `BeaconWallet`.
173
+ * The `WalletConnect` class implements the `WalletProvider` interface, providing an alternative to `BeaconWallet`.
206
174
  * This package enables dapps built with Taquito to connect to wallets via the WalletConnect/Reown protocol.
207
- * @note Currently, a QR code is displayed to establish a connection with a wallet. As more Tezos wallets integrate with WalletConnect,
175
+ \* @remarks Currently, a QR code is displayed to establish a connection with a wallet. As more Tezos wallets integrate with WalletConnect,
208
176
  * we plan showing a list of available wallets alongside the QR code.
209
177
  */
210
178
  class WalletConnect {
@@ -212,20 +180,17 @@ class WalletConnect {
212
180
  this.signClient = signClient;
213
181
  this.walletConnectModal = WalletConnectModal;
214
182
  this.signClient.on('session_delete', ({ topic }) => {
215
- var _a;
216
- if (((_a = this.session) === null || _a === void 0 ? void 0 : _a.topic) === topic) {
183
+ if (this.session?.topic === topic) {
217
184
  this.session = undefined;
218
185
  }
219
186
  });
220
187
  this.signClient.on('session_expire', ({ topic }) => {
221
- var _a;
222
- if (((_a = this.session) === null || _a === void 0 ? void 0 : _a.topic) === topic) {
188
+ if (this.session?.topic === topic) {
223
189
  this.session = undefined;
224
190
  }
225
191
  });
226
192
  this.signClient.on('session_update', ({ params, topic }) => {
227
- var _a;
228
- if (((_a = this.session) === null || _a === void 0 ? void 0 : _a.topic) === topic) {
193
+ if (this.session?.topic === topic) {
229
194
  this.session.namespaces = params.namespaces;
230
195
  // TODO determine if we need validation on the namespace here
231
196
  }
@@ -235,7 +200,7 @@ class WalletConnect {
235
200
  });
236
201
  }
237
202
  /**
238
- * @description Initialize a WalletConnect provider
203
+ * Initialize a WalletConnect provider
239
204
  * (Initialize a WalletConnect client with persisted storage and a network connection)
240
205
  *
241
206
  * @example
@@ -251,77 +216,72 @@ class WalletConnect {
251
216
  * });
252
217
  * ```
253
218
  */
254
- static init(initParams) {
255
- return __awaiter(this, void 0, void 0, function* () {
256
- if (!initParams.projectId) {
257
- throw new Error('projectId is required');
258
- }
259
- const client = yield Client.init(initParams);
260
- const walletConnectModal = new WalletConnectModal({
261
- projectId: initParams.projectId,
262
- });
263
- return new WalletConnect(client, walletConnectModal);
219
+ static async init(initParams) {
220
+ if (!initParams.projectId) {
221
+ throw new Error('projectId is required');
222
+ }
223
+ const client = await Client.init(initParams);
224
+ const walletConnectModal = new WalletConnectModal({
225
+ projectId: initParams.projectId,
264
226
  });
227
+ return new WalletConnect(client, walletConnectModal);
265
228
  }
266
229
  /**
267
- * @description Request permission for a new session and establish a connection.
230
+ * Request permission for a new session and establish a connection.
268
231
  *
269
232
  * @param connectParams.permissionScope The networks, methods, and events that will be granted permission
270
233
  * @param connectParams.pairingTopic Option to connect to an existing active pairing. If pairingTopic is defined, a prompt will appear in the corresponding wallet to accept or decline the session proposal. If no pairingTopic, a QR code modal will open in the dapp, allowing to connect to a wallet.
271
234
  * @param connectParams.registryUrl Optional registry of wallet deep links to show in the Modal
272
- * @error ConnectionFailed is thrown if no connection can be established with a wallet
235
+ \* @throws ConnectionFailed is thrown if no connection can be established with a wallet
273
236
  */
274
- requestPermissions(connectParams) {
275
- return __awaiter(this, void 0, void 0, function* () {
276
- var _a;
277
- // TODO when Tezos wallets will officially support wallet connect, we need to provide a default value for registryUrl
278
- try {
279
- const chains = connectParams.permissionScope.networks.map((network) => `${TEZOS_PLACEHOLDER}:${network}`);
280
- const { uri, approval } = yield this.signClient.connect({
281
- requiredNamespaces: {
282
- [TEZOS_PLACEHOLDER]: {
283
- chains,
284
- methods: connectParams.permissionScope.methods,
285
- events: (_a = connectParams.permissionScope.events) !== null && _a !== void 0 ? _a : [],
286
- },
237
+ async requestPermissions(connectParams) {
238
+ // TODO when Tezos wallets will officially support wallet connect, we need to provide a default value for registryUrl
239
+ try {
240
+ const chains = connectParams.permissionScope.networks.map((network) => `${TEZOS_PLACEHOLDER}:${network}`);
241
+ const { uri, approval } = await this.signClient.connect({
242
+ requiredNamespaces: {
243
+ [TEZOS_PLACEHOLDER]: {
244
+ chains,
245
+ methods: connectParams.permissionScope.methods,
246
+ events: connectParams.permissionScope.events ?? [],
287
247
  },
288
- pairingTopic: connectParams.pairingTopic,
248
+ },
249
+ pairingTopic: connectParams.pairingTopic,
250
+ });
251
+ if (uri) {
252
+ this.walletConnectModal.openModal({
253
+ uri,
254
+ chains,
289
255
  });
290
- if (uri) {
291
- this.walletConnectModal.openModal({
292
- uri,
293
- chains,
294
- });
295
- }
296
- this.session = yield approval();
297
- }
298
- catch (error) {
299
- throw new ConnectionFailed(error);
300
- }
301
- finally {
302
- this.walletConnectModal.closeModal();
303
256
  }
304
- this.validateReceivedNamespace(connectParams.permissionScope, this.session.namespaces);
305
- this.setDefaultAccountAndNetwork();
306
- });
257
+ this.session = await approval();
258
+ }
259
+ catch (error) {
260
+ throw new ConnectionFailed(error);
261
+ }
262
+ finally {
263
+ this.walletConnectModal.closeModal();
264
+ }
265
+ this.validateReceivedNamespace(connectParams.permissionScope, this.session.namespaces);
266
+ this.setDefaultAccountAndNetwork();
307
267
  }
308
268
  /**
309
- * @description Access all existing active pairings
269
+ * Access all existing active pairings
310
270
  */
311
271
  getAvailablePairing() {
312
272
  return this.signClient.pairing.getAll({ active: true });
313
273
  }
314
274
  /**
315
- * @description Access all existing sessions
275
+ * Access all existing sessions
316
276
  * @return an array of strings which represent the session keys
317
277
  */
318
278
  getAllExistingSessionKeys() {
319
279
  return this.signClient.session.keys;
320
280
  }
321
281
  /**
322
- * @description Configure the Client with an existing session.
282
+ * Configure the Client with an existing session.
323
283
  * The session is immediately restored without a prompt on the wallet to accept/decline it.
324
- * @error InvalidSessionKey is thrown if the provided session key doesn't exist
284
+ \* @throws InvalidSessionKey is thrown if the provided session key doesn't exist
325
285
  */
326
286
  configureWithExistingSessionKey(key) {
327
287
  const sessions = this.getAllExistingSessionKeys();
@@ -331,91 +291,85 @@ class WalletConnect {
331
291
  this.session = this.signClient.session.get(key);
332
292
  this.setDefaultAccountAndNetwork();
333
293
  }
334
- disconnect() {
335
- return __awaiter(this, void 0, void 0, function* () {
336
- if (this.session) {
337
- yield this.signClient.disconnect({
338
- topic: this.session.topic,
339
- reason: getSdkError('USER_DISCONNECTED'),
340
- });
341
- this.clearState();
342
- }
343
- });
294
+ async disconnect() {
295
+ if (this.session) {
296
+ await this.signClient.disconnect({
297
+ topic: this.session.topic,
298
+ reason: getSdkError('USER_DISCONNECTED'),
299
+ });
300
+ this.clearState();
301
+ }
344
302
  }
345
303
  getPeerMetadata() {
346
304
  return this.getSession().peer.metadata;
347
305
  }
348
306
  /**
349
- * @description Once the session is establish, send Tezos operations to be approved, signed and inject by the wallet.
350
- * @error MissingRequiredScope is thrown if permission to send operation was not granted
307
+ * Once the session is establish, send Tezos operations to be approved, signed and inject by the wallet.
308
+ \* @throws MissingRequiredScope is thrown if permission to send operation was not granted
351
309
  */
352
- sendOperations(params) {
353
- return __awaiter(this, void 0, void 0, function* () {
354
- const session = this.getSession();
355
- if (!this.getPermittedMethods().includes(PermissionScopeMethods.TEZOS_SEND)) {
356
- throw new MissingRequiredScope(PermissionScopeMethods.TEZOS_SEND);
357
- }
358
- const network = this.getActiveNetwork();
359
- const account = yield this.getPKH();
360
- this.validateNetworkAndAccount(network, account);
361
- const { operationHash } = yield this.signClient.request({
362
- topic: session.topic,
363
- chainId: `${TEZOS_PLACEHOLDER}:${network}`,
364
- request: {
365
- method: PermissionScopeMethods.TEZOS_SEND,
366
- params: {
367
- account,
368
- operations: params,
369
- },
310
+ async sendOperations(params) {
311
+ const session = this.getSession();
312
+ if (!this.getPermittedMethods().includes(PermissionScopeMethods.TEZOS_SEND)) {
313
+ throw new MissingRequiredScope(PermissionScopeMethods.TEZOS_SEND);
314
+ }
315
+ const network = this.getActiveNetwork();
316
+ const account = await this.getPKH();
317
+ this.validateNetworkAndAccount(network, account);
318
+ const { operationHash } = await this.signClient.request({
319
+ topic: session.topic,
320
+ chainId: `${TEZOS_PLACEHOLDER}:${network}`,
321
+ request: {
322
+ method: PermissionScopeMethods.TEZOS_SEND,
323
+ params: {
324
+ account,
325
+ operations: params,
370
326
  },
371
- });
372
- return operationHash;
327
+ },
373
328
  });
329
+ return operationHash;
374
330
  }
375
331
  /**
376
- * @description Once the session is establish, send payload to be signed by the wallet.
377
- * @error MissingRequiredScope is thrown if permission to sign payload was not granted
332
+ * Once the session is establish, send payload to be signed by the wallet.
333
+ \* @throws MissingRequiredScope is thrown if permission to sign payload was not granted
378
334
  */
379
- sign(bytes, watermark) {
380
- return __awaiter(this, void 0, void 0, function* () {
381
- const session = this.getSession();
382
- if (!this.getPermittedMethods().includes(PermissionScopeMethods.TEZOS_SIGN)) {
383
- throw new MissingRequiredScope(PermissionScopeMethods.TEZOS_SIGN);
384
- }
385
- const network = this.getActiveNetwork();
386
- const account = yield this.getPKH();
387
- this.validateNetworkAndAccount(network, account);
388
- let expression = bytes;
389
- if (watermark) {
390
- expression =
391
- Array.from(watermark, (byte) => byte.toString(16).padStart(2, '0')).join('') + expression;
392
- }
393
- const { signature } = yield this.signClient.request({
394
- topic: session.topic,
395
- chainId: `${TEZOS_PLACEHOLDER}:${network}`,
396
- request: {
397
- method: PermissionScopeMethods.TEZOS_SIGN,
398
- params: {
399
- account: yield this.getPKH(),
400
- payload: expression,
401
- },
335
+ async sign(bytes, watermark) {
336
+ const session = this.getSession();
337
+ if (!this.getPermittedMethods().includes(PermissionScopeMethods.TEZOS_SIGN)) {
338
+ throw new MissingRequiredScope(PermissionScopeMethods.TEZOS_SIGN);
339
+ }
340
+ const network = this.getActiveNetwork();
341
+ const account = await this.getPKH();
342
+ this.validateNetworkAndAccount(network, account);
343
+ let expression = bytes;
344
+ if (watermark) {
345
+ expression =
346
+ Array.from(watermark, (byte) => byte.toString(16).padStart(2, '0')).join('') + expression;
347
+ }
348
+ const { signature } = await this.signClient.request({
349
+ topic: session.topic,
350
+ chainId: `${TEZOS_PLACEHOLDER}:${network}`,
351
+ request: {
352
+ method: PermissionScopeMethods.TEZOS_SIGN,
353
+ params: {
354
+ account: await this.getPKH(),
355
+ payload: expression,
402
356
  },
403
- });
404
- return signature;
357
+ },
405
358
  });
359
+ return signature;
406
360
  }
407
361
  /**
408
- * @description Return all connected accounts from the active session
409
- * @error NotConnected if no active session
362
+ * Return all connected accounts from the active session
363
+ \* @throws NotConnected if no active session
410
364
  */
411
365
  getAccounts() {
412
366
  return this.getTezosNamespace().accounts.map((account) => account.split(':')[2]);
413
367
  }
414
368
  /**
415
- * @description Set the active account.
369
+ * Set the active account.
416
370
  * Must be called if there are multiple accounts in the session and every time the active account is switched
417
371
  * @param pkh public key hash of the selected account
418
- * @error InvalidAccount thrown if the pkh is not part of the active accounts in the session
372
+ \* @throws InvalidAccount thrown if the pkh is not part of the active accounts in the session
419
373
  */
420
374
  setActiveAccount(pkh) {
421
375
  if (!this.getAccounts().includes(pkh)) {
@@ -424,59 +378,55 @@ class WalletConnect {
424
378
  this.activeAccount = pkh;
425
379
  }
426
380
  /**
427
- * @description Access the public key hash of the active account
428
- * @error ActiveAccountUnspecified thrown when there are multiple Tezos account in the session and none is set as the active one
381
+ * Access the public key hash of the active account
382
+ \* @throws ActiveAccountUnspecified thrown when there are multiple Tezos account in the session and none is set as the active one
429
383
  */
430
- getPKH() {
431
- return __awaiter(this, void 0, void 0, function* () {
432
- if (!this.activeAccount) {
433
- this.getSession();
434
- throw new ActiveAccountUnspecified();
435
- }
436
- return this.activeAccount;
437
- });
384
+ async getPKH() {
385
+ if (!this.activeAccount) {
386
+ this.getSession();
387
+ throw new ActiveAccountUnspecified();
388
+ }
389
+ return this.activeAccount;
438
390
  }
439
391
  /**
440
- * @description Access the public key of the active account
441
- * @error ActiveAccountUnspecified thrown when there are multiple Tezos account in the session and none is set as the active one
442
- * @error MissingRequiredScope is thrown if permission to get accounts was not granted
443
- * @error PublicKeyRetrievalError is thrown if the public key is not found
392
+ * Access the public key of the active account
393
+ \* @throws ActiveAccountUnspecified thrown when there are multiple Tezos account in the session and none is set as the active one
394
+ \* @throws MissingRequiredScope is thrown if permission to get accounts was not granted
395
+ \* @throws PublicKeyRetrievalError is thrown if the public key is not found
444
396
  */
445
- getPK() {
446
- return __awaiter(this, void 0, void 0, function* () {
447
- const session = this.getSession();
448
- if (!this.getPermittedMethods().includes(PermissionScopeMethods.TEZOS_GET_ACCOUNTS)) {
449
- throw new MissingRequiredScope(PermissionScopeMethods.TEZOS_GET_ACCOUNTS);
450
- }
451
- const network = this.getActiveNetwork();
452
- const account = yield this.getPKH();
453
- const accounts = yield this.signClient.request({
454
- topic: session.topic,
455
- chainId: `${TEZOS_PLACEHOLDER}:${network}`,
456
- request: {
457
- method: PermissionScopeMethods.TEZOS_GET_ACCOUNTS,
458
- params: {},
459
- },
460
- });
461
- const selectedAccount = accounts.find((acc) => acc.address === account);
462
- if (!selectedAccount) {
463
- throw new PublicKeyRetrievalError();
464
- }
465
- return selectedAccount.pubkey;
397
+ async getPK() {
398
+ const session = this.getSession();
399
+ if (!this.getPermittedMethods().includes(PermissionScopeMethods.TEZOS_GET_ACCOUNTS)) {
400
+ throw new MissingRequiredScope(PermissionScopeMethods.TEZOS_GET_ACCOUNTS);
401
+ }
402
+ const network = this.getActiveNetwork();
403
+ const account = await this.getPKH();
404
+ const accounts = await this.signClient.request({
405
+ topic: session.topic,
406
+ chainId: `${TEZOS_PLACEHOLDER}:${network}`,
407
+ request: {
408
+ method: PermissionScopeMethods.TEZOS_GET_ACCOUNTS,
409
+ params: {},
410
+ },
466
411
  });
412
+ const selectedAccount = accounts.find((acc) => acc.address === account);
413
+ if (!selectedAccount) {
414
+ throw new PublicKeyRetrievalError();
415
+ }
416
+ return selectedAccount.pubkey;
467
417
  }
468
418
  /**
469
- * @description Return all networks from the namespace of the active session
470
- * @error NotConnected if no active session
419
+ * Return all networks from the namespace of the active session
420
+ \* @throws NotConnected if no active session
471
421
  */
472
422
  getNetworks() {
473
423
  return this.getPermittedNetwork();
474
424
  }
475
425
  /**
476
- * @description Set the active network.
426
+ * Set the active network.
477
427
  * Must be called if there are multiple network in the session and every time the active network is switched
478
428
  * @param network selected network
479
- * @error InvalidNetwork thrown if the network is not part of the active networks in the session
429
+ \* @throws InvalidNetwork thrown if the network is not part of the active networks in the session
480
430
  */
481
431
  setActiveNetwork(network) {
482
432
  if (!this.getNetworks().includes(network)) {
@@ -485,8 +435,8 @@ class WalletConnect {
485
435
  this.activeNetwork = network;
486
436
  }
487
437
  /**
488
- * @description Access the active network
489
- * @error ActiveNetworkUnspecified thorwn when there are multiple Tezos netwroks in the session and none is set as the active one
438
+ * Access the active network
439
+ \* @throws ActiveNetworkUnspecified thorwn when there are multiple Tezos netwroks in the session and none is set as the active one
490
440
  */
491
441
  getActiveNetwork() {
492
442
  if (!this.activeNetwork) {
@@ -653,59 +603,41 @@ class WalletConnect {
653
603
  }
654
604
  return operatedParams;
655
605
  }
656
- mapTransferParamsToWalletParams(params) {
657
- return __awaiter(this, void 0, void 0, function* () {
658
- const walletParams = yield params();
659
- return this.removeDefaultLimits(walletParams, yield createTransferOperation(this.formatParameters(walletParams)));
660
- });
606
+ async mapTransferParamsToWalletParams(params) {
607
+ const walletParams = await params();
608
+ return this.removeDefaultLimits(walletParams, await createTransferOperation(this.formatParameters(walletParams)));
661
609
  }
662
- mapTransferTicketParamsToWalletParams(params) {
663
- return __awaiter(this, void 0, void 0, function* () {
664
- const walletParams = yield params();
665
- return this.removeDefaultLimits(walletParams, yield createTransferTicketOperation(this.formatParameters(walletParams)));
666
- });
610
+ async mapTransferTicketParamsToWalletParams(params) {
611
+ const walletParams = await params();
612
+ return this.removeDefaultLimits(walletParams, await createTransferTicketOperation(this.formatParameters(walletParams)));
667
613
  }
668
- mapStakeParamsToWalletParams(params) {
669
- return __awaiter(this, void 0, void 0, function* () {
670
- const walletParams = yield params();
671
- return this.removeDefaultLimits(walletParams, yield createTransferOperation(this.formatParameters(walletParams)));
672
- });
614
+ async mapStakeParamsToWalletParams(params) {
615
+ const walletParams = await params();
616
+ return this.removeDefaultLimits(walletParams, await createTransferOperation(this.formatParameters(walletParams)));
673
617
  }
674
- mapUnstakeParamsToWalletParams(params) {
675
- return __awaiter(this, void 0, void 0, function* () {
676
- const walletParams = yield params();
677
- return this.removeDefaultLimits(walletParams, yield createTransferOperation(this.formatParameters(walletParams)));
678
- });
618
+ async mapUnstakeParamsToWalletParams(params) {
619
+ const walletParams = await params();
620
+ return this.removeDefaultLimits(walletParams, await createTransferOperation(this.formatParameters(walletParams)));
679
621
  }
680
- mapFinalizeUnstakeParamsToWalletParams(params) {
681
- return __awaiter(this, void 0, void 0, function* () {
682
- const walletParams = yield params();
683
- return this.removeDefaultLimits(walletParams, yield createTransferOperation(this.formatParameters(walletParams)));
684
- });
622
+ async mapFinalizeUnstakeParamsToWalletParams(params) {
623
+ const walletParams = await params();
624
+ return this.removeDefaultLimits(walletParams, await createTransferOperation(this.formatParameters(walletParams)));
685
625
  }
686
- mapOriginateParamsToWalletParams(params) {
687
- return __awaiter(this, void 0, void 0, function* () {
688
- const walletParams = yield params();
689
- return this.removeDefaultLimits(walletParams, yield createOriginationOperation(this.formatParameters(walletParams)));
690
- });
626
+ async mapOriginateParamsToWalletParams(params) {
627
+ const walletParams = await params();
628
+ return this.removeDefaultLimits(walletParams, await createOriginationOperation(this.formatParameters(walletParams)));
691
629
  }
692
- mapDelegateParamsToWalletParams(params) {
693
- return __awaiter(this, void 0, void 0, function* () {
694
- const walletParams = yield params();
695
- return this.removeDefaultLimits(walletParams, yield createSetDelegateOperation(this.formatParameters(walletParams)));
696
- });
630
+ async mapDelegateParamsToWalletParams(params) {
631
+ const walletParams = await params();
632
+ return this.removeDefaultLimits(walletParams, await createSetDelegateOperation(this.formatParameters(walletParams)));
697
633
  }
698
- mapIncreasePaidStorageWalletParams(params) {
699
- return __awaiter(this, void 0, void 0, function* () {
700
- const walletParams = yield params();
701
- return this.removeDefaultLimits(walletParams, yield createIncreasePaidStorageOperation(this.formatParameters(walletParams)));
702
- });
634
+ async mapIncreasePaidStorageWalletParams(params) {
635
+ const walletParams = await params();
636
+ return this.removeDefaultLimits(walletParams, await createIncreasePaidStorageOperation(this.formatParameters(walletParams)));
703
637
  }
704
- mapRegisterGlobalConstantParamsToWalletParams(params) {
705
- return __awaiter(this, void 0, void 0, function* () {
706
- const walletParams = yield params();
707
- return this.removeDefaultLimits(walletParams, yield createRegisterGlobalConstantOperation(this.formatParameters(walletParams)));
708
- });
638
+ async mapRegisterGlobalConstantParamsToWalletParams(params) {
639
+ const walletParams = await params();
640
+ return this.removeDefaultLimits(walletParams, await createRegisterGlobalConstantOperation(this.formatParameters(walletParams)));
709
641
  }
710
642
  }
711
643
 
@@ -1 +1 @@
1
- {"version":3,"file":"taquito-wallet-connect.es6.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"taquito-wallet-connect.es6.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}