@taquito/wallet-connect 21.0.4 → 22.0.0-RC.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.
- package/dist/lib/taquito-wallet-connect.js +17 -6
- package/dist/lib/version.js +2 -2
- package/dist/taquito-wallet-connect.es6.js +17 -6
- package/dist/taquito-wallet-connect.es6.js.map +1 -1
- package/dist/taquito-wallet-connect.umd.js +20 -9
- package/dist/taquito-wallet-connect.umd.js.map +1 -1
- package/dist/types/taquito-wallet-connect.d.ts +3 -1
- package/package.json +4 -4
|
@@ -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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
138
|
+
this.walletConnectModal.closeModal();
|
|
128
139
|
}
|
|
129
140
|
this.validateReceivedNamespace(connectParams.permissionScope, this.session.namespaces);
|
|
130
141
|
this.setDefaultAccountAndNetwork();
|
package/dist/lib/version.js
CHANGED
|
@@ -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": "
|
|
7
|
-
"version": "
|
|
6
|
+
"commitHash": "6936d6bc71e6a805f6d5568b60b1a0f6595a375d",
|
|
7
|
+
"version": "22.0.0-RC.0"
|
|
8
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Client from '@walletconnect/sign-client';
|
|
2
|
-
import
|
|
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
|
|
|
@@ -207,8 +207,9 @@ const TEZOS_PLACEHOLDER = 'tezos';
|
|
|
207
207
|
* we plan showing a list of available wallets alongside the QR code.
|
|
208
208
|
*/
|
|
209
209
|
class WalletConnect {
|
|
210
|
-
constructor(signClient) {
|
|
210
|
+
constructor(signClient, WalletConnectModal) {
|
|
211
211
|
this.signClient = signClient;
|
|
212
|
+
this.walletConnectModal = WalletConnectModal;
|
|
212
213
|
this.signClient.on('session_delete', ({ topic }) => {
|
|
213
214
|
var _a;
|
|
214
215
|
if (((_a = this.session) === null || _a === void 0 ? void 0 : _a.topic) === topic) {
|
|
@@ -251,8 +252,14 @@ class WalletConnect {
|
|
|
251
252
|
*/
|
|
252
253
|
static init(initParams) {
|
|
253
254
|
return __awaiter(this, void 0, void 0, function* () {
|
|
255
|
+
if (!initParams.projectId) {
|
|
256
|
+
throw new Error('projectId is required');
|
|
257
|
+
}
|
|
254
258
|
const client = yield Client.init(initParams);
|
|
255
|
-
|
|
259
|
+
const walletConnectModal = new WalletConnectModal({
|
|
260
|
+
projectId: initParams.projectId,
|
|
261
|
+
});
|
|
262
|
+
return new WalletConnect(client, walletConnectModal);
|
|
256
263
|
});
|
|
257
264
|
}
|
|
258
265
|
/**
|
|
@@ -268,10 +275,11 @@ class WalletConnect {
|
|
|
268
275
|
var _a;
|
|
269
276
|
// TODO when Tezos wallets will officially support wallet connect, we need to provide a default value for registryUrl
|
|
270
277
|
try {
|
|
278
|
+
const chains = connectParams.permissionScope.networks.map((network) => `${TEZOS_PLACEHOLDER}:${network}`);
|
|
271
279
|
const { uri, approval } = yield this.signClient.connect({
|
|
272
280
|
requiredNamespaces: {
|
|
273
281
|
[TEZOS_PLACEHOLDER]: {
|
|
274
|
-
chains
|
|
282
|
+
chains,
|
|
275
283
|
methods: connectParams.permissionScope.methods,
|
|
276
284
|
events: (_a = connectParams.permissionScope.events) !== null && _a !== void 0 ? _a : [],
|
|
277
285
|
},
|
|
@@ -279,7 +287,10 @@ class WalletConnect {
|
|
|
279
287
|
pairingTopic: connectParams.pairingTopic,
|
|
280
288
|
});
|
|
281
289
|
if (uri) {
|
|
282
|
-
|
|
290
|
+
this.walletConnectModal.openModal({
|
|
291
|
+
uri,
|
|
292
|
+
chains,
|
|
293
|
+
});
|
|
283
294
|
}
|
|
284
295
|
this.session = yield approval();
|
|
285
296
|
}
|
|
@@ -287,7 +298,7 @@ class WalletConnect {
|
|
|
287
298
|
throw new ConnectionFailed(error);
|
|
288
299
|
}
|
|
289
300
|
finally {
|
|
290
|
-
|
|
301
|
+
this.walletConnectModal.closeModal();
|
|
291
302
|
}
|
|
292
303
|
this.validateReceivedNamespace(connectParams.permissionScope, this.session.namespaces);
|
|
293
304
|
this.setDefaultAccountAndNetwork();
|
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@walletconnect/sign-client'), require('@walletconnect/
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@walletconnect/sign-client', '@walletconnect/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.taquitoWalletConnect = {}, global.Client, global.
|
|
5
|
-
})(this, (function (exports, Client,
|
|
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.
|
|
@@ -208,8 +208,9 @@
|
|
|
208
208
|
* we plan showing a list of available wallets alongside the QR code.
|
|
209
209
|
*/
|
|
210
210
|
class WalletConnect {
|
|
211
|
-
constructor(signClient) {
|
|
211
|
+
constructor(signClient, WalletConnectModal) {
|
|
212
212
|
this.signClient = signClient;
|
|
213
|
+
this.walletConnectModal = WalletConnectModal;
|
|
213
214
|
this.signClient.on('session_delete', ({ topic }) => {
|
|
214
215
|
var _a;
|
|
215
216
|
if (((_a = this.session) === null || _a === void 0 ? void 0 : _a.topic) === topic) {
|
|
@@ -252,8 +253,14 @@
|
|
|
252
253
|
*/
|
|
253
254
|
static init(initParams) {
|
|
254
255
|
return __awaiter(this, void 0, void 0, function* () {
|
|
256
|
+
if (!initParams.projectId) {
|
|
257
|
+
throw new Error('projectId is required');
|
|
258
|
+
}
|
|
255
259
|
const client = yield Client.init(initParams);
|
|
256
|
-
|
|
260
|
+
const walletConnectModal = new modal.WalletConnectModal({
|
|
261
|
+
projectId: initParams.projectId,
|
|
262
|
+
});
|
|
263
|
+
return new WalletConnect(client, walletConnectModal);
|
|
257
264
|
});
|
|
258
265
|
}
|
|
259
266
|
/**
|
|
@@ -269,10 +276,11 @@
|
|
|
269
276
|
var _a;
|
|
270
277
|
// TODO when Tezos wallets will officially support wallet connect, we need to provide a default value for registryUrl
|
|
271
278
|
try {
|
|
279
|
+
const chains = connectParams.permissionScope.networks.map((network) => `${TEZOS_PLACEHOLDER}:${network}`);
|
|
272
280
|
const { uri, approval } = yield this.signClient.connect({
|
|
273
281
|
requiredNamespaces: {
|
|
274
282
|
[TEZOS_PLACEHOLDER]: {
|
|
275
|
-
chains
|
|
283
|
+
chains,
|
|
276
284
|
methods: connectParams.permissionScope.methods,
|
|
277
285
|
events: (_a = connectParams.permissionScope.events) !== null && _a !== void 0 ? _a : [],
|
|
278
286
|
},
|
|
@@ -280,7 +288,10 @@
|
|
|
280
288
|
pairingTopic: connectParams.pairingTopic,
|
|
281
289
|
});
|
|
282
290
|
if (uri) {
|
|
283
|
-
|
|
291
|
+
this.walletConnectModal.openModal({
|
|
292
|
+
uri,
|
|
293
|
+
chains,
|
|
294
|
+
});
|
|
284
295
|
}
|
|
285
296
|
this.session = yield approval();
|
|
286
297
|
}
|
|
@@ -288,7 +299,7 @@
|
|
|
288
299
|
throw new ConnectionFailed(error);
|
|
289
300
|
}
|
|
290
301
|
finally {
|
|
291
|
-
|
|
302
|
+
this.walletConnectModal.closeModal();
|
|
292
303
|
}
|
|
293
304
|
this.validateReceivedNamespace(connectParams.permissionScope, this.session.namespaces);
|
|
294
305
|
this.setDefaultAccountAndNetwork();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taquito-wallet-connect.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"taquito-wallet-connect.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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
|
-
|
|
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)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taquito/wallet-connect",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0-RC.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": "^
|
|
70
|
-
"@walletconnect/
|
|
69
|
+
"@taquito/taquito": "^22.0.0-RC.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": "
|
|
105
|
+
"gitHead": "a5501829190e16f53bb3ce8f8b8143d8c0f01834"
|
|
106
106
|
}
|