@taquito/beacon-wallet 21.0.0-beta.0 → 21.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.
- package/dist/lib/errors.js +1 -1
- package/dist/lib/taquito-beacon-wallet.js +9 -10
- package/dist/lib/version.js +2 -2
- package/dist/taquito-beacon-wallet.es6.js +13 -14
- package/dist/taquito-beacon-wallet.es6.js.map +1 -1
- package/dist/taquito-beacon-wallet.umd.js +12 -13
- package/dist/taquito-beacon-wallet.umd.js.map +1 -1
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/taquito-beacon-wallet.d.ts +1 -2
- package/package.json +9 -8
package/dist/lib/errors.js
CHANGED
|
@@ -17,7 +17,7 @@ class BeaconWalletNotInitialized extends core_1.PermissionDeniedError {
|
|
|
17
17
|
exports.BeaconWalletNotInitialized = BeaconWalletNotInitialized;
|
|
18
18
|
/**
|
|
19
19
|
* @category Error
|
|
20
|
-
* @description Error that indicates missing required
|
|
20
|
+
* @description Error that indicates missing required permission scopes
|
|
21
21
|
*/
|
|
22
22
|
class MissingRequiredScopes extends core_1.PermissionDeniedError {
|
|
23
23
|
constructor(requiredScopes) {
|
|
@@ -28,10 +28,6 @@ Object.defineProperty(exports, "MissingRequiredScopes", { enumerable: true, get:
|
|
|
28
28
|
class BeaconWallet {
|
|
29
29
|
constructor(options) {
|
|
30
30
|
this.client = (0, beacon_dapp_1.getDAppClientInstance)(options);
|
|
31
|
-
// Subscribe to the active account set event, this will update when there are account changes happening in the dApp
|
|
32
|
-
this.client.subscribeToEvent(beacon_dapp_1.BeaconEvent.ACTIVE_ACCOUNT_SET, (data) => __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
this.account = data;
|
|
34
|
-
}));
|
|
35
31
|
}
|
|
36
32
|
validateRequiredScopesOrFail(permissionScopes, requiredScopes) {
|
|
37
33
|
const mandatoryScope = new Set(requiredScopes);
|
|
@@ -51,19 +47,21 @@ class BeaconWallet {
|
|
|
51
47
|
}
|
|
52
48
|
getPKH() {
|
|
53
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
|
|
50
|
+
const account = yield this.client.getActiveAccount();
|
|
51
|
+
if (!account) {
|
|
55
52
|
throw new errors_1.BeaconWalletNotInitialized();
|
|
56
53
|
}
|
|
57
|
-
return
|
|
54
|
+
return account.address;
|
|
58
55
|
});
|
|
59
56
|
}
|
|
60
57
|
getPK() {
|
|
61
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
62
59
|
var _a;
|
|
63
|
-
|
|
60
|
+
const account = yield this.client.getActiveAccount();
|
|
61
|
+
if (!account) {
|
|
64
62
|
throw new errors_1.BeaconWalletNotInitialized();
|
|
65
63
|
}
|
|
66
|
-
return (_a =
|
|
64
|
+
return (_a = account.publicKey) !== null && _a !== void 0 ? _a : '';
|
|
67
65
|
});
|
|
68
66
|
}
|
|
69
67
|
mapTransferParamsToWalletParams(params) {
|
|
@@ -207,10 +205,11 @@ class BeaconWallet {
|
|
|
207
205
|
}
|
|
208
206
|
sendOperations(params) {
|
|
209
207
|
return __awaiter(this, void 0, void 0, function* () {
|
|
210
|
-
|
|
208
|
+
const account = yield this.client.getActiveAccount();
|
|
209
|
+
if (!account) {
|
|
211
210
|
throw new errors_1.BeaconWalletNotInitialized();
|
|
212
211
|
}
|
|
213
|
-
const permissions =
|
|
212
|
+
const permissions = account.scopes;
|
|
214
213
|
this.validateRequiredScopesOrFail(permissions, [beacon_dapp_1.PermissionScope.OPERATION_REQUEST]);
|
|
215
214
|
const { transactionHash } = yield this.client.requestOperation({ operationDetails: params });
|
|
216
215
|
return transactionHash;
|
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": "21.0.0
|
|
6
|
+
"commitHash": "8f78637e9787ae942916332501f41b35d6b98f2d",
|
|
7
|
+
"version": "21.0.0"
|
|
8
8
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getDAppClientInstance,
|
|
1
|
+
import { getDAppClientInstance, SigningType, PermissionScope } from '@airgap/beacon-dapp';
|
|
2
2
|
import { PermissionDeniedError, UnsupportedActionError } from '@taquito/core';
|
|
3
3
|
import toBuffer from 'typedarray-to-buffer';
|
|
4
4
|
import { createTransferOperation, createTransferTicketOperation, createIncreasePaidStorageOperation, createOriginationOperation, createSetDelegateOperation } from '@taquito/taquito';
|
|
@@ -50,7 +50,7 @@ class BeaconWalletNotInitialized extends PermissionDeniedError {
|
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* @category Error
|
|
53
|
-
* @description Error that indicates missing required
|
|
53
|
+
* @description Error that indicates missing required permission scopes
|
|
54
54
|
*/
|
|
55
55
|
class MissingRequiredScopes extends PermissionDeniedError {
|
|
56
56
|
constructor(requiredScopes) {
|
|
@@ -63,8 +63,8 @@ class MissingRequiredScopes extends PermissionDeniedError {
|
|
|
63
63
|
|
|
64
64
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
|
|
65
65
|
const VERSION = {
|
|
66
|
-
"commitHash": "
|
|
67
|
-
"version": "21.0.0
|
|
66
|
+
"commitHash": "8f78637e9787ae942916332501f41b35d6b98f2d",
|
|
67
|
+
"version": "21.0.0"
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
/**
|
|
@@ -74,10 +74,6 @@ const VERSION = {
|
|
|
74
74
|
class BeaconWallet {
|
|
75
75
|
constructor(options) {
|
|
76
76
|
this.client = getDAppClientInstance(options);
|
|
77
|
-
// Subscribe to the active account set event, this will update when there are account changes happening in the dApp
|
|
78
|
-
this.client.subscribeToEvent(BeaconEvent.ACTIVE_ACCOUNT_SET, (data) => __awaiter(this, void 0, void 0, function* () {
|
|
79
|
-
this.account = data;
|
|
80
|
-
}));
|
|
81
77
|
}
|
|
82
78
|
validateRequiredScopesOrFail(permissionScopes, requiredScopes) {
|
|
83
79
|
const mandatoryScope = new Set(requiredScopes);
|
|
@@ -97,19 +93,21 @@ class BeaconWallet {
|
|
|
97
93
|
}
|
|
98
94
|
getPKH() {
|
|
99
95
|
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
|
|
96
|
+
const account = yield this.client.getActiveAccount();
|
|
97
|
+
if (!account) {
|
|
101
98
|
throw new BeaconWalletNotInitialized();
|
|
102
99
|
}
|
|
103
|
-
return
|
|
100
|
+
return account.address;
|
|
104
101
|
});
|
|
105
102
|
}
|
|
106
103
|
getPK() {
|
|
107
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
108
105
|
var _a;
|
|
109
|
-
|
|
106
|
+
const account = yield this.client.getActiveAccount();
|
|
107
|
+
if (!account) {
|
|
110
108
|
throw new BeaconWalletNotInitialized();
|
|
111
109
|
}
|
|
112
|
-
return (_a =
|
|
110
|
+
return (_a = account.publicKey) !== null && _a !== void 0 ? _a : '';
|
|
113
111
|
});
|
|
114
112
|
}
|
|
115
113
|
mapTransferParamsToWalletParams(params) {
|
|
@@ -253,10 +251,11 @@ class BeaconWallet {
|
|
|
253
251
|
}
|
|
254
252
|
sendOperations(params) {
|
|
255
253
|
return __awaiter(this, void 0, void 0, function* () {
|
|
256
|
-
|
|
254
|
+
const account = yield this.client.getActiveAccount();
|
|
255
|
+
if (!account) {
|
|
257
256
|
throw new BeaconWalletNotInitialized();
|
|
258
257
|
}
|
|
259
|
-
const permissions =
|
|
258
|
+
const permissions = account.scopes;
|
|
260
259
|
this.validateRequiredScopesOrFail(permissions, [PermissionScope.OPERATION_REQUEST]);
|
|
261
260
|
const { transactionHash } = yield this.client.requestOperation({ operationDetails: params });
|
|
262
261
|
return transactionHash;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taquito-beacon-wallet.es6.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"taquito-beacon-wallet.es6.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* @category Error
|
|
53
|
-
* @description Error that indicates missing required
|
|
53
|
+
* @description Error that indicates missing required permission scopes
|
|
54
54
|
*/
|
|
55
55
|
class MissingRequiredScopes extends core.PermissionDeniedError {
|
|
56
56
|
constructor(requiredScopes) {
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
|
|
64
64
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
|
|
65
65
|
const VERSION = {
|
|
66
|
-
"commitHash": "
|
|
67
|
-
"version": "21.0.0
|
|
66
|
+
"commitHash": "8f78637e9787ae942916332501f41b35d6b98f2d",
|
|
67
|
+
"version": "21.0.0"
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
/**
|
|
@@ -74,10 +74,6 @@
|
|
|
74
74
|
class BeaconWallet {
|
|
75
75
|
constructor(options) {
|
|
76
76
|
this.client = beaconDapp.getDAppClientInstance(options);
|
|
77
|
-
// Subscribe to the active account set event, this will update when there are account changes happening in the dApp
|
|
78
|
-
this.client.subscribeToEvent(beaconDapp.BeaconEvent.ACTIVE_ACCOUNT_SET, (data) => __awaiter(this, void 0, void 0, function* () {
|
|
79
|
-
this.account = data;
|
|
80
|
-
}));
|
|
81
77
|
}
|
|
82
78
|
validateRequiredScopesOrFail(permissionScopes, requiredScopes) {
|
|
83
79
|
const mandatoryScope = new Set(requiredScopes);
|
|
@@ -97,19 +93,21 @@
|
|
|
97
93
|
}
|
|
98
94
|
getPKH() {
|
|
99
95
|
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
|
|
96
|
+
const account = yield this.client.getActiveAccount();
|
|
97
|
+
if (!account) {
|
|
101
98
|
throw new BeaconWalletNotInitialized();
|
|
102
99
|
}
|
|
103
|
-
return
|
|
100
|
+
return account.address;
|
|
104
101
|
});
|
|
105
102
|
}
|
|
106
103
|
getPK() {
|
|
107
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
108
105
|
var _a;
|
|
109
|
-
|
|
106
|
+
const account = yield this.client.getActiveAccount();
|
|
107
|
+
if (!account) {
|
|
110
108
|
throw new BeaconWalletNotInitialized();
|
|
111
109
|
}
|
|
112
|
-
return (_a =
|
|
110
|
+
return (_a = account.publicKey) !== null && _a !== void 0 ? _a : '';
|
|
113
111
|
});
|
|
114
112
|
}
|
|
115
113
|
mapTransferParamsToWalletParams(params) {
|
|
@@ -253,10 +251,11 @@
|
|
|
253
251
|
}
|
|
254
252
|
sendOperations(params) {
|
|
255
253
|
return __awaiter(this, void 0, void 0, function* () {
|
|
256
|
-
|
|
254
|
+
const account = yield this.client.getActiveAccount();
|
|
255
|
+
if (!account) {
|
|
257
256
|
throw new BeaconWalletNotInitialized();
|
|
258
257
|
}
|
|
259
|
-
const permissions =
|
|
258
|
+
const permissions = account.scopes;
|
|
260
259
|
this.validateRequiredScopesOrFail(permissions, [beaconDapp.PermissionScope.OPERATION_REQUEST]);
|
|
261
260
|
const { transactionHash } = yield this.client.requestOperation({ operationDetails: params });
|
|
262
261
|
return transactionHash;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taquito-beacon-wallet.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"taquito-beacon-wallet.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare class BeaconWalletNotInitialized extends PermissionDeniedError {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* @category Error
|
|
12
|
-
* @description Error that indicates missing required
|
|
12
|
+
* @description Error that indicates missing required permission scopes
|
|
13
13
|
*/
|
|
14
14
|
export declare class MissingRequiredScopes extends PermissionDeniedError {
|
|
15
15
|
readonly requiredScopes: PermissionScope[];
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
* @packageDocumentation
|
|
3
3
|
* @module @taquito/beacon-wallet
|
|
4
4
|
*/
|
|
5
|
-
import { DAppClient, DAppClientOptions, RequestPermissionInput
|
|
5
|
+
import { DAppClient, DAppClientOptions, RequestPermissionInput } from '@airgap/beacon-dapp';
|
|
6
6
|
import { WalletDelegateParams, WalletIncreasePaidStorageParams, WalletOriginateParams, WalletProvider, WalletTransferParams, WalletStakeParams, WalletUnstakeParams, WalletFinalizeUnstakeParams, WalletTransferTicketParams } from '@taquito/taquito';
|
|
7
7
|
export { VERSION } from './version';
|
|
8
8
|
export { BeaconWalletNotInitialized, MissingRequiredScopes } from './errors';
|
|
9
9
|
export declare class BeaconWallet implements WalletProvider {
|
|
10
10
|
client: DAppClient;
|
|
11
|
-
account: AccountInfo | undefined;
|
|
12
11
|
constructor(options: DAppClientOptions);
|
|
13
12
|
private validateRequiredScopesOrFail;
|
|
14
13
|
requestPermissions(request?: RequestPermissionInput): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taquito/beacon-wallet",
|
|
3
|
-
"version": "21.0.0
|
|
3
|
+
"version": "21.0.0",
|
|
4
4
|
"description": "Beacon wallet provider",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tezos",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"engines": {
|
|
27
|
-
"node": ">=
|
|
27
|
+
"node": ">=18"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"test": "jest --coverage",
|
|
@@ -67,15 +67,16 @@
|
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@airgap/beacon-dapp": "^4.2.
|
|
71
|
-
"@taquito/core": "^21.0.0
|
|
72
|
-
"@taquito/taquito": "^21.0.0
|
|
70
|
+
"@airgap/beacon-dapp": "^4.3.2-beta.0",
|
|
71
|
+
"@taquito/core": "^21.0.0",
|
|
72
|
+
"@taquito/taquito": "^21.0.0",
|
|
73
|
+
"@testing-library/react": "^16.0.1"
|
|
73
74
|
},
|
|
74
75
|
"devDependencies": {
|
|
75
76
|
"@types/bluebird": "^3.5.42",
|
|
76
77
|
"@types/chrome": "0.0.269",
|
|
77
78
|
"@types/jest": "^29.5.12",
|
|
78
|
-
"@types/node": "^
|
|
79
|
+
"@types/node": "^18",
|
|
79
80
|
"@types/ws": "^8.5.12",
|
|
80
81
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
81
82
|
"@typescript-eslint/parser": "^6.21.0",
|
|
@@ -92,7 +93,7 @@
|
|
|
92
93
|
"prompt": "^1.3.0",
|
|
93
94
|
"replace-in-file": "^8.1.0",
|
|
94
95
|
"rimraf": "^6.0.1",
|
|
95
|
-
"rollup": "^4.
|
|
96
|
+
"rollup": "^4.22.4",
|
|
96
97
|
"rollup-plugin-json": "^4.0.0",
|
|
97
98
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
98
99
|
"shelljs": "^0.8.5",
|
|
@@ -103,5 +104,5 @@
|
|
|
103
104
|
"webpack": "^5.94.0",
|
|
104
105
|
"webpack-cli": "^5.1.4"
|
|
105
106
|
},
|
|
106
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "655216b13995860187b1a1baf3c87e90b4fd69cb"
|
|
107
108
|
}
|