@taquito/wallet-connect 22.0.0-beta.0 → 22.0.0

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.
@@ -29,7 +29,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.WalletConnect = void 0;
31
31
  const sign_client_1 = require("@walletconnect/sign-client");
32
- const legacy_modal_1 = require("@walletconnect/legacy-modal");
32
+ const modal_1 = require("@walletconnect/modal");
33
33
  const taquito_1 = require("@taquito/taquito");
34
34
  const utils_1 = require("@walletconnect/utils");
35
35
  const types_1 = require("./types");
@@ -44,8 +44,9 @@ const TEZOS_PLACEHOLDER = 'tezos';
44
44
  * we plan showing a list of available wallets alongside the QR code.
45
45
  */
46
46
  class WalletConnect {
47
- constructor(signClient) {
47
+ constructor(signClient, WalletConnectModal) {
48
48
  this.signClient = signClient;
49
+ this.walletConnectModal = WalletConnectModal;
49
50
  this.signClient.on('session_delete', ({ topic }) => {
50
51
  var _a;
51
52
  if (((_a = this.session) === null || _a === void 0 ? void 0 : _a.topic) === topic) {
@@ -88,8 +89,14 @@ class WalletConnect {
88
89
  */
89
90
  static init(initParams) {
90
91
  return __awaiter(this, void 0, void 0, function* () {
92
+ if (!initParams.projectId) {
93
+ throw new Error('projectId is required');
94
+ }
91
95
  const client = yield sign_client_1.default.init(initParams);
92
- return new WalletConnect(client);
96
+ const walletConnectModal = new modal_1.WalletConnectModal({
97
+ projectId: initParams.projectId,
98
+ });
99
+ return new WalletConnect(client, walletConnectModal);
93
100
  });
94
101
  }
95
102
  /**
@@ -105,10 +112,11 @@ class WalletConnect {
105
112
  var _a;
106
113
  // TODO when Tezos wallets will officially support wallet connect, we need to provide a default value for registryUrl
107
114
  try {
115
+ const chains = connectParams.permissionScope.networks.map((network) => `${TEZOS_PLACEHOLDER}:${network}`);
108
116
  const { uri, approval } = yield this.signClient.connect({
109
117
  requiredNamespaces: {
110
118
  [TEZOS_PLACEHOLDER]: {
111
- chains: connectParams.permissionScope.networks.map((network) => `${TEZOS_PLACEHOLDER}:${network}`),
119
+ chains,
112
120
  methods: connectParams.permissionScope.methods,
113
121
  events: (_a = connectParams.permissionScope.events) !== null && _a !== void 0 ? _a : [],
114
122
  },
@@ -116,7 +124,10 @@ class WalletConnect {
116
124
  pairingTopic: connectParams.pairingTopic,
117
125
  });
118
126
  if (uri) {
119
- legacy_modal_1.default.open(uri, () => { }, { registryUrl: connectParams.registryUrl });
127
+ this.walletConnectModal.openModal({
128
+ uri,
129
+ chains,
130
+ });
120
131
  }
121
132
  this.session = yield approval();
122
133
  }
@@ -124,7 +135,7 @@ class WalletConnect {
124
135
  throw new errors_1.ConnectionFailed(error);
125
136
  }
126
137
  finally {
127
- legacy_modal_1.default.close();
138
+ this.walletConnectModal.closeModal();
128
139
  }
129
140
  this.validateReceivedNamespace(connectParams.permissionScope, this.session.namespaces);
130
141
  this.setDefaultAccountAndNetwork();
package/dist/lib/types.js CHANGED
@@ -9,6 +9,7 @@ var NetworkType;
9
9
  NetworkType["OXFORDNET"] = "oxfordnet";
10
10
  NetworkType["PARISNET"] = "parisnet";
11
11
  NetworkType["QUEBECNET"] = "quebecnet";
12
+ NetworkType["RIONET"] = "rionet";
12
13
  })(NetworkType || (exports.NetworkType = NetworkType = {}));
13
14
  var PermissionScopeMethods;
14
15
  (function (PermissionScopeMethods) {
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
5
5
  exports.VERSION = {
6
- "commitHash": "f0eb755ed1e0de4d1cd86623df4496f76efd0caf",
7
- "version": "22.0.0-beta.0"
6
+ "commitHash": "6a2c52b9e48b299dfc856149c1fa3388e77180ad",
7
+ "version": "22.0.0"
8
8
  };
@@ -1,5 +1,5 @@
1
1
  import Client from '@walletconnect/sign-client';
2
- import QRCodeModal from '@walletconnect/legacy-modal';
2
+ import { WalletConnectModal } from '@walletconnect/modal';
3
3
  import { createTransferOperation, createTransferTicketOperation, createOriginationOperation, createSetDelegateOperation, createIncreasePaidStorageOperation } from '@taquito/taquito';
4
4
  import { getSdkError } from '@walletconnect/utils';
5
5
 
@@ -43,6 +43,7 @@ var NetworkType;
43
43
  NetworkType["OXFORDNET"] = "oxfordnet";
44
44
  NetworkType["PARISNET"] = "parisnet";
45
45
  NetworkType["QUEBECNET"] = "quebecnet";
46
+ NetworkType["RIONET"] = "rionet";
46
47
  })(NetworkType || (NetworkType = {}));
47
48
  var PermissionScopeMethods;
48
49
  (function (PermissionScopeMethods) {
@@ -207,8 +208,9 @@ const TEZOS_PLACEHOLDER = 'tezos';
207
208
  * we plan showing a list of available wallets alongside the QR code.
208
209
  */
209
210
  class WalletConnect {
210
- constructor(signClient) {
211
+ constructor(signClient, WalletConnectModal) {
211
212
  this.signClient = signClient;
213
+ this.walletConnectModal = WalletConnectModal;
212
214
  this.signClient.on('session_delete', ({ topic }) => {
213
215
  var _a;
214
216
  if (((_a = this.session) === null || _a === void 0 ? void 0 : _a.topic) === topic) {
@@ -251,8 +253,14 @@ class WalletConnect {
251
253
  */
252
254
  static init(initParams) {
253
255
  return __awaiter(this, void 0, void 0, function* () {
256
+ if (!initParams.projectId) {
257
+ throw new Error('projectId is required');
258
+ }
254
259
  const client = yield Client.init(initParams);
255
- return new WalletConnect(client);
260
+ const walletConnectModal = new WalletConnectModal({
261
+ projectId: initParams.projectId,
262
+ });
263
+ return new WalletConnect(client, walletConnectModal);
256
264
  });
257
265
  }
258
266
  /**
@@ -268,10 +276,11 @@ class WalletConnect {
268
276
  var _a;
269
277
  // TODO when Tezos wallets will officially support wallet connect, we need to provide a default value for registryUrl
270
278
  try {
279
+ const chains = connectParams.permissionScope.networks.map((network) => `${TEZOS_PLACEHOLDER}:${network}`);
271
280
  const { uri, approval } = yield this.signClient.connect({
272
281
  requiredNamespaces: {
273
282
  [TEZOS_PLACEHOLDER]: {
274
- chains: connectParams.permissionScope.networks.map((network) => `${TEZOS_PLACEHOLDER}:${network}`),
283
+ chains,
275
284
  methods: connectParams.permissionScope.methods,
276
285
  events: (_a = connectParams.permissionScope.events) !== null && _a !== void 0 ? _a : [],
277
286
  },
@@ -279,7 +288,10 @@ class WalletConnect {
279
288
  pairingTopic: connectParams.pairingTopic,
280
289
  });
281
290
  if (uri) {
282
- QRCodeModal.open(uri, () => { }, { registryUrl: connectParams.registryUrl });
291
+ this.walletConnectModal.openModal({
292
+ uri,
293
+ chains,
294
+ });
283
295
  }
284
296
  this.session = yield approval();
285
297
  }
@@ -287,7 +299,7 @@ class WalletConnect {
287
299
  throw new ConnectionFailed(error);
288
300
  }
289
301
  finally {
290
- QRCodeModal.close();
302
+ this.walletConnectModal.closeModal();
291
303
  }
292
304
  this.validateReceivedNamespace(connectParams.permissionScope, this.session.namespaces);
293
305
  this.setDefaultAccountAndNetwork();
@@ -1 +1 @@
1
- {"version":3,"file":"taquito-wallet-connect.es6.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@walletconnect/sign-client'), require('@walletconnect/legacy-modal'), require('@taquito/taquito'), require('@walletconnect/utils')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@walletconnect/sign-client', '@walletconnect/legacy-modal', '@taquito/taquito', '@walletconnect/utils'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.taquitoWalletConnect = {}, global.Client, global.QRCodeModal, global.taquito, global.utils));
5
- })(this, (function (exports, Client, QRCodeModal, taquito, utils) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@walletconnect/sign-client'), require('@walletconnect/modal'), require('@taquito/taquito'), require('@walletconnect/utils')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@walletconnect/sign-client', '@walletconnect/modal', '@taquito/taquito', '@walletconnect/utils'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.taquitoWalletConnect = {}, global.Client, global.modal, global.taquito, global.utils));
5
+ })(this, (function (exports, Client, modal, taquito, utils) { 'use strict';
6
6
 
7
7
  /******************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -44,6 +44,7 @@
44
44
  NetworkType["OXFORDNET"] = "oxfordnet";
45
45
  NetworkType["PARISNET"] = "parisnet";
46
46
  NetworkType["QUEBECNET"] = "quebecnet";
47
+ NetworkType["RIONET"] = "rionet";
47
48
  })(exports.NetworkType || (exports.NetworkType = {}));
48
49
  exports.PermissionScopeMethods = void 0;
49
50
  (function (PermissionScopeMethods) {
@@ -208,8 +209,9 @@
208
209
  * we plan showing a list of available wallets alongside the QR code.
209
210
  */
210
211
  class WalletConnect {
211
- constructor(signClient) {
212
+ constructor(signClient, WalletConnectModal) {
212
213
  this.signClient = signClient;
214
+ this.walletConnectModal = WalletConnectModal;
213
215
  this.signClient.on('session_delete', ({ topic }) => {
214
216
  var _a;
215
217
  if (((_a = this.session) === null || _a === void 0 ? void 0 : _a.topic) === topic) {
@@ -252,8 +254,14 @@
252
254
  */
253
255
  static init(initParams) {
254
256
  return __awaiter(this, void 0, void 0, function* () {
257
+ if (!initParams.projectId) {
258
+ throw new Error('projectId is required');
259
+ }
255
260
  const client = yield Client.init(initParams);
256
- return new WalletConnect(client);
261
+ const walletConnectModal = new modal.WalletConnectModal({
262
+ projectId: initParams.projectId,
263
+ });
264
+ return new WalletConnect(client, walletConnectModal);
257
265
  });
258
266
  }
259
267
  /**
@@ -269,10 +277,11 @@
269
277
  var _a;
270
278
  // TODO when Tezos wallets will officially support wallet connect, we need to provide a default value for registryUrl
271
279
  try {
280
+ const chains = connectParams.permissionScope.networks.map((network) => `${TEZOS_PLACEHOLDER}:${network}`);
272
281
  const { uri, approval } = yield this.signClient.connect({
273
282
  requiredNamespaces: {
274
283
  [TEZOS_PLACEHOLDER]: {
275
- chains: connectParams.permissionScope.networks.map((network) => `${TEZOS_PLACEHOLDER}:${network}`),
284
+ chains,
276
285
  methods: connectParams.permissionScope.methods,
277
286
  events: (_a = connectParams.permissionScope.events) !== null && _a !== void 0 ? _a : [],
278
287
  },
@@ -280,7 +289,10 @@
280
289
  pairingTopic: connectParams.pairingTopic,
281
290
  });
282
291
  if (uri) {
283
- QRCodeModal.open(uri, () => { }, { registryUrl: connectParams.registryUrl });
292
+ this.walletConnectModal.openModal({
293
+ uri,
294
+ chains,
295
+ });
284
296
  }
285
297
  this.session = yield approval();
286
298
  }
@@ -288,7 +300,7 @@
288
300
  throw new ConnectionFailed(error);
289
301
  }
290
302
  finally {
291
- QRCodeModal.close();
303
+ this.walletConnectModal.closeModal();
292
304
  }
293
305
  this.validateReceivedNamespace(connectParams.permissionScope, this.session.namespaces);
294
306
  this.setDefaultAccountAndNetwork();
@@ -1 +1 @@
1
- {"version":3,"file":"taquito-wallet-connect.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import Client from '@walletconnect/sign-client';
6
6
  import { SignClientTypes, SessionTypes, PairingTypes } from '@walletconnect/types';
7
+ import { WalletConnectModal } from '@walletconnect/modal';
7
8
  import { RPCDelegateOperation, RPCOriginationOperation, RPCTransferOperation, RPCTransferTicketOperation, RPCIncreasePaidStorageOperation, WalletDelegateParams, WalletOriginateParams, WalletProvider, WalletTransferParams, WalletTransferTicketParams, WalletStakeParams, WalletUnstakeParams, WalletFinalizeUnstakeParams, WalletIncreasePaidStorageParams } from '@taquito/taquito';
8
9
  import { NetworkType, OperationParams, PermissionScopeParam } from './types';
9
10
  export { SignClientTypes, PairingTypes };
@@ -20,7 +21,8 @@ export declare class WalletConnect implements WalletProvider {
20
21
  private session;
21
22
  private activeAccount;
22
23
  private activeNetwork;
23
- constructor(signClient: Client);
24
+ private walletConnectModal;
25
+ constructor(signClient: Client, WalletConnectModal: WalletConnectModal);
24
26
  /**
25
27
  * @description Initialize a WalletConnect provider
26
28
  * (Initialize a WalletConnect client with persisted storage and a network connection)
@@ -5,7 +5,8 @@ export declare enum NetworkType {
5
5
  WEEKLYNET = "weeklynet",
6
6
  OXFORDNET = "oxfordnet",
7
7
  PARISNET = "parisnet",
8
- QUEBECNET = "quebecnet"
8
+ QUEBECNET = "quebecnet",
9
+ RIONET = "rionet"
9
10
  }
10
11
  export interface PermissionScopeParam {
11
12
  networks: NetworkType[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taquito/wallet-connect",
3
- "version": "22.0.0-beta.0",
3
+ "version": "22.0.0",
4
4
  "description": "Walletconnect provider",
5
5
  "keywords": [
6
6
  "tezos",
@@ -66,8 +66,8 @@
66
66
  ]
67
67
  },
68
68
  "dependencies": {
69
- "@taquito/taquito": "^22.0.0-beta.0",
70
- "@walletconnect/legacy-modal": "^2.0.0",
69
+ "@taquito/taquito": "^22.0.0",
70
+ "@walletconnect/modal": "^2.7.0",
71
71
  "@walletconnect/sign-client": "^2.16.2",
72
72
  "@walletconnect/types": "^2.16.2",
73
73
  "@walletconnect/utils": "^2.16.2"
@@ -102,5 +102,5 @@
102
102
  "ts-toolbelt": "^9.6.0",
103
103
  "typescript": "~5.5.4"
104
104
  },
105
- "gitHead": "239ae96ca142f3f63ecfc7e51731c115c3fe322f"
105
+ "gitHead": "134ec228acbee03b4f40b80c89d78c718557569b"
106
106
  }