@taquito/wallet-connect 22.0.0-beta.0 → 23.0.0-beta.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/types.js +2 -0
- package/dist/lib/version.js +2 -2
- package/dist/taquito-wallet-connect.es6.js +19 -6
- package/dist/taquito-wallet-connect.es6.js.map +1 -1
- package/dist/taquito-wallet-connect.umd.js +22 -9
- package/dist/taquito-wallet-connect.umd.js.map +1 -1
- package/dist/types/taquito-wallet-connect.d.ts +3 -1
- package/dist/types/types.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/types.js
CHANGED
|
@@ -9,6 +9,8 @@ var NetworkType;
|
|
|
9
9
|
NetworkType["OXFORDNET"] = "oxfordnet";
|
|
10
10
|
NetworkType["PARISNET"] = "parisnet";
|
|
11
11
|
NetworkType["QUEBECNET"] = "quebecnet";
|
|
12
|
+
NetworkType["RIONET"] = "rionet";
|
|
13
|
+
NetworkType["SEOULNET"] = "seoulnet";
|
|
12
14
|
})(NetworkType || (exports.NetworkType = NetworkType = {}));
|
|
13
15
|
var PermissionScopeMethods;
|
|
14
16
|
(function (PermissionScopeMethods) {
|
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": "7af2138a9e5c5b230c4b4c726f35c2f2e67b721c",
|
|
7
|
+
"version": "23.0.0-beta.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
|
|
|
@@ -43,6 +43,8 @@ var NetworkType;
|
|
|
43
43
|
NetworkType["OXFORDNET"] = "oxfordnet";
|
|
44
44
|
NetworkType["PARISNET"] = "parisnet";
|
|
45
45
|
NetworkType["QUEBECNET"] = "quebecnet";
|
|
46
|
+
NetworkType["RIONET"] = "rionet";
|
|
47
|
+
NetworkType["SEOULNET"] = "seoulnet";
|
|
46
48
|
})(NetworkType || (NetworkType = {}));
|
|
47
49
|
var PermissionScopeMethods;
|
|
48
50
|
(function (PermissionScopeMethods) {
|
|
@@ -207,8 +209,9 @@ const TEZOS_PLACEHOLDER = 'tezos';
|
|
|
207
209
|
* we plan showing a list of available wallets alongside the QR code.
|
|
208
210
|
*/
|
|
209
211
|
class WalletConnect {
|
|
210
|
-
constructor(signClient) {
|
|
212
|
+
constructor(signClient, WalletConnectModal) {
|
|
211
213
|
this.signClient = signClient;
|
|
214
|
+
this.walletConnectModal = WalletConnectModal;
|
|
212
215
|
this.signClient.on('session_delete', ({ topic }) => {
|
|
213
216
|
var _a;
|
|
214
217
|
if (((_a = this.session) === null || _a === void 0 ? void 0 : _a.topic) === topic) {
|
|
@@ -251,8 +254,14 @@ class WalletConnect {
|
|
|
251
254
|
*/
|
|
252
255
|
static init(initParams) {
|
|
253
256
|
return __awaiter(this, void 0, void 0, function* () {
|
|
257
|
+
if (!initParams.projectId) {
|
|
258
|
+
throw new Error('projectId is required');
|
|
259
|
+
}
|
|
254
260
|
const client = yield Client.init(initParams);
|
|
255
|
-
|
|
261
|
+
const walletConnectModal = new WalletConnectModal({
|
|
262
|
+
projectId: initParams.projectId,
|
|
263
|
+
});
|
|
264
|
+
return new WalletConnect(client, walletConnectModal);
|
|
256
265
|
});
|
|
257
266
|
}
|
|
258
267
|
/**
|
|
@@ -268,10 +277,11 @@ class WalletConnect {
|
|
|
268
277
|
var _a;
|
|
269
278
|
// TODO when Tezos wallets will officially support wallet connect, we need to provide a default value for registryUrl
|
|
270
279
|
try {
|
|
280
|
+
const chains = connectParams.permissionScope.networks.map((network) => `${TEZOS_PLACEHOLDER}:${network}`);
|
|
271
281
|
const { uri, approval } = yield this.signClient.connect({
|
|
272
282
|
requiredNamespaces: {
|
|
273
283
|
[TEZOS_PLACEHOLDER]: {
|
|
274
|
-
chains
|
|
284
|
+
chains,
|
|
275
285
|
methods: connectParams.permissionScope.methods,
|
|
276
286
|
events: (_a = connectParams.permissionScope.events) !== null && _a !== void 0 ? _a : [],
|
|
277
287
|
},
|
|
@@ -279,7 +289,10 @@ class WalletConnect {
|
|
|
279
289
|
pairingTopic: connectParams.pairingTopic,
|
|
280
290
|
});
|
|
281
291
|
if (uri) {
|
|
282
|
-
|
|
292
|
+
this.walletConnectModal.openModal({
|
|
293
|
+
uri,
|
|
294
|
+
chains,
|
|
295
|
+
});
|
|
283
296
|
}
|
|
284
297
|
this.session = yield approval();
|
|
285
298
|
}
|
|
@@ -287,7 +300,7 @@ class WalletConnect {
|
|
|
287
300
|
throw new ConnectionFailed(error);
|
|
288
301
|
}
|
|
289
302
|
finally {
|
|
290
|
-
|
|
303
|
+
this.walletConnectModal.closeModal();
|
|
291
304
|
}
|
|
292
305
|
this.validateReceivedNamespace(connectParams.permissionScope, this.session.namespaces);
|
|
293
306
|
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.
|
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
NetworkType["OXFORDNET"] = "oxfordnet";
|
|
45
45
|
NetworkType["PARISNET"] = "parisnet";
|
|
46
46
|
NetworkType["QUEBECNET"] = "quebecnet";
|
|
47
|
+
NetworkType["RIONET"] = "rionet";
|
|
48
|
+
NetworkType["SEOULNET"] = "seoulnet";
|
|
47
49
|
})(exports.NetworkType || (exports.NetworkType = {}));
|
|
48
50
|
exports.PermissionScopeMethods = void 0;
|
|
49
51
|
(function (PermissionScopeMethods) {
|
|
@@ -208,8 +210,9 @@
|
|
|
208
210
|
* we plan showing a list of available wallets alongside the QR code.
|
|
209
211
|
*/
|
|
210
212
|
class WalletConnect {
|
|
211
|
-
constructor(signClient) {
|
|
213
|
+
constructor(signClient, WalletConnectModal) {
|
|
212
214
|
this.signClient = signClient;
|
|
215
|
+
this.walletConnectModal = WalletConnectModal;
|
|
213
216
|
this.signClient.on('session_delete', ({ topic }) => {
|
|
214
217
|
var _a;
|
|
215
218
|
if (((_a = this.session) === null || _a === void 0 ? void 0 : _a.topic) === topic) {
|
|
@@ -252,8 +255,14 @@
|
|
|
252
255
|
*/
|
|
253
256
|
static init(initParams) {
|
|
254
257
|
return __awaiter(this, void 0, void 0, function* () {
|
|
258
|
+
if (!initParams.projectId) {
|
|
259
|
+
throw new Error('projectId is required');
|
|
260
|
+
}
|
|
255
261
|
const client = yield Client.init(initParams);
|
|
256
|
-
|
|
262
|
+
const walletConnectModal = new modal.WalletConnectModal({
|
|
263
|
+
projectId: initParams.projectId,
|
|
264
|
+
});
|
|
265
|
+
return new WalletConnect(client, walletConnectModal);
|
|
257
266
|
});
|
|
258
267
|
}
|
|
259
268
|
/**
|
|
@@ -269,10 +278,11 @@
|
|
|
269
278
|
var _a;
|
|
270
279
|
// TODO when Tezos wallets will officially support wallet connect, we need to provide a default value for registryUrl
|
|
271
280
|
try {
|
|
281
|
+
const chains = connectParams.permissionScope.networks.map((network) => `${TEZOS_PLACEHOLDER}:${network}`);
|
|
272
282
|
const { uri, approval } = yield this.signClient.connect({
|
|
273
283
|
requiredNamespaces: {
|
|
274
284
|
[TEZOS_PLACEHOLDER]: {
|
|
275
|
-
chains
|
|
285
|
+
chains,
|
|
276
286
|
methods: connectParams.permissionScope.methods,
|
|
277
287
|
events: (_a = connectParams.permissionScope.events) !== null && _a !== void 0 ? _a : [],
|
|
278
288
|
},
|
|
@@ -280,7 +290,10 @@
|
|
|
280
290
|
pairingTopic: connectParams.pairingTopic,
|
|
281
291
|
});
|
|
282
292
|
if (uri) {
|
|
283
|
-
|
|
293
|
+
this.walletConnectModal.openModal({
|
|
294
|
+
uri,
|
|
295
|
+
chains,
|
|
296
|
+
});
|
|
284
297
|
}
|
|
285
298
|
this.session = yield approval();
|
|
286
299
|
}
|
|
@@ -288,7 +301,7 @@
|
|
|
288
301
|
throw new ConnectionFailed(error);
|
|
289
302
|
}
|
|
290
303
|
finally {
|
|
291
|
-
|
|
304
|
+
this.walletConnectModal.closeModal();
|
|
292
305
|
}
|
|
293
306
|
this.validateReceivedNamespace(connectParams.permissionScope, this.session.namespaces);
|
|
294
307
|
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/dist/types/types.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ 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",
|
|
10
|
+
SEOULNET = "seoulnet"
|
|
9
11
|
}
|
|
10
12
|
export interface PermissionScopeParam {
|
|
11
13
|
networks: NetworkType[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taquito/wallet-connect",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.0.0-beta.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": "^23.0.0-beta.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": "37cc766d60407d7909fbd2d841d9dd946243d04a"
|
|
106
106
|
}
|