@taquito/beacon-wallet 20.0.2-beta.2 → 21.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.
@@ -28,6 +28,10 @@ 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
+ }));
31
35
  }
32
36
  validateRequiredScopesOrFail(permissionScopes, requiredScopes) {
33
37
  const mandatoryScope = new Set(requiredScopes);
@@ -47,21 +51,19 @@ class BeaconWallet {
47
51
  }
48
52
  getPKH() {
49
53
  return __awaiter(this, void 0, void 0, function* () {
50
- const account = yield this.client.getActiveAccount();
51
- if (!account) {
54
+ if (!this.account) {
52
55
  throw new errors_1.BeaconWalletNotInitialized();
53
56
  }
54
- return account.address;
57
+ return this.account.address;
55
58
  });
56
59
  }
57
60
  getPK() {
58
61
  return __awaiter(this, void 0, void 0, function* () {
59
62
  var _a;
60
- const account = yield this.client.getActiveAccount();
61
- if (!account) {
63
+ if (!this.account) {
62
64
  throw new errors_1.BeaconWalletNotInitialized();
63
65
  }
64
- return (_a = account.publicKey) !== null && _a !== void 0 ? _a : '';
66
+ return (_a = this.account.publicKey) !== null && _a !== void 0 ? _a : '';
65
67
  });
66
68
  }
67
69
  mapTransferParamsToWalletParams(params) {
@@ -205,11 +207,10 @@ class BeaconWallet {
205
207
  }
206
208
  sendOperations(params) {
207
209
  return __awaiter(this, void 0, void 0, function* () {
208
- const account = yield this.client.getActiveAccount();
209
- if (!account) {
210
+ if (!this.account) {
210
211
  throw new errors_1.BeaconWalletNotInitialized();
211
212
  }
212
- const permissions = account.scopes;
213
+ const permissions = this.account.scopes;
213
214
  this.validateRequiredScopesOrFail(permissions, [beacon_dapp_1.PermissionScope.OPERATION_REQUEST]);
214
215
  const { transactionHash } = yield this.client.requestOperation({ operationDetails: params });
215
216
  return transactionHash;
@@ -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": "943d5fd11790da35f4a3e6ecfcaae3c4f0399a97",
7
- "version": "20.0.2-beta.2"
6
+ "commitHash": "bbfe9f5a28ecf81757bf3895aaba6d2aeaa656cb",
7
+ "version": "21.0.0-beta.0"
8
8
  };
@@ -1,4 +1,4 @@
1
- import { getDAppClientInstance, SigningType, PermissionScope } from '@airgap/beacon-dapp';
1
+ import { getDAppClientInstance, BeaconEvent, 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';
@@ -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": "943d5fd11790da35f4a3e6ecfcaae3c4f0399a97",
67
- "version": "20.0.2-beta.2"
66
+ "commitHash": "bbfe9f5a28ecf81757bf3895aaba6d2aeaa656cb",
67
+ "version": "21.0.0-beta.0"
68
68
  };
69
69
 
70
70
  /**
@@ -74,6 +74,10 @@ 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
+ }));
77
81
  }
78
82
  validateRequiredScopesOrFail(permissionScopes, requiredScopes) {
79
83
  const mandatoryScope = new Set(requiredScopes);
@@ -93,21 +97,19 @@ class BeaconWallet {
93
97
  }
94
98
  getPKH() {
95
99
  return __awaiter(this, void 0, void 0, function* () {
96
- const account = yield this.client.getActiveAccount();
97
- if (!account) {
100
+ if (!this.account) {
98
101
  throw new BeaconWalletNotInitialized();
99
102
  }
100
- return account.address;
103
+ return this.account.address;
101
104
  });
102
105
  }
103
106
  getPK() {
104
107
  return __awaiter(this, void 0, void 0, function* () {
105
108
  var _a;
106
- const account = yield this.client.getActiveAccount();
107
- if (!account) {
109
+ if (!this.account) {
108
110
  throw new BeaconWalletNotInitialized();
109
111
  }
110
- return (_a = account.publicKey) !== null && _a !== void 0 ? _a : '';
112
+ return (_a = this.account.publicKey) !== null && _a !== void 0 ? _a : '';
111
113
  });
112
114
  }
113
115
  mapTransferParamsToWalletParams(params) {
@@ -251,11 +253,10 @@ class BeaconWallet {
251
253
  }
252
254
  sendOperations(params) {
253
255
  return __awaiter(this, void 0, void 0, function* () {
254
- const account = yield this.client.getActiveAccount();
255
- if (!account) {
256
+ if (!this.account) {
256
257
  throw new BeaconWalletNotInitialized();
257
258
  }
258
- const permissions = account.scopes;
259
+ const permissions = this.account.scopes;
259
260
  this.validateRequiredScopesOrFail(permissions, [PermissionScope.OPERATION_REQUEST]);
260
261
  const { transactionHash } = yield this.client.requestOperation({ operationDetails: params });
261
262
  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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -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": "943d5fd11790da35f4a3e6ecfcaae3c4f0399a97",
67
- "version": "20.0.2-beta.2"
66
+ "commitHash": "bbfe9f5a28ecf81757bf3895aaba6d2aeaa656cb",
67
+ "version": "21.0.0-beta.0"
68
68
  };
69
69
 
70
70
  /**
@@ -74,6 +74,10 @@
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
+ }));
77
81
  }
78
82
  validateRequiredScopesOrFail(permissionScopes, requiredScopes) {
79
83
  const mandatoryScope = new Set(requiredScopes);
@@ -93,21 +97,19 @@
93
97
  }
94
98
  getPKH() {
95
99
  return __awaiter(this, void 0, void 0, function* () {
96
- const account = yield this.client.getActiveAccount();
97
- if (!account) {
100
+ if (!this.account) {
98
101
  throw new BeaconWalletNotInitialized();
99
102
  }
100
- return account.address;
103
+ return this.account.address;
101
104
  });
102
105
  }
103
106
  getPK() {
104
107
  return __awaiter(this, void 0, void 0, function* () {
105
108
  var _a;
106
- const account = yield this.client.getActiveAccount();
107
- if (!account) {
109
+ if (!this.account) {
108
110
  throw new BeaconWalletNotInitialized();
109
111
  }
110
- return (_a = account.publicKey) !== null && _a !== void 0 ? _a : '';
112
+ return (_a = this.account.publicKey) !== null && _a !== void 0 ? _a : '';
111
113
  });
112
114
  }
113
115
  mapTransferParamsToWalletParams(params) {
@@ -251,11 +253,10 @@
251
253
  }
252
254
  sendOperations(params) {
253
255
  return __awaiter(this, void 0, void 0, function* () {
254
- const account = yield this.client.getActiveAccount();
255
- if (!account) {
256
+ if (!this.account) {
256
257
  throw new BeaconWalletNotInitialized();
257
258
  }
258
- const permissions = account.scopes;
259
+ const permissions = this.account.scopes;
259
260
  this.validateRequiredScopesOrFail(permissions, [beaconDapp.PermissionScope.OPERATION_REQUEST]);
260
261
  const { transactionHash } = yield this.client.requestOperation({ operationDetails: params });
261
262
  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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,12 +2,13 @@
2
2
  * @packageDocumentation
3
3
  * @module @taquito/beacon-wallet
4
4
  */
5
- import { DAppClient, DAppClientOptions, RequestPermissionInput } from '@airgap/beacon-dapp';
5
+ import { DAppClient, DAppClientOptions, RequestPermissionInput, AccountInfo } 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;
11
12
  constructor(options: DAppClientOptions);
12
13
  private validateRequiredScopesOrFail;
13
14
  requestPermissions(request?: RequestPermissionInput): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taquito/beacon-wallet",
3
- "version": "20.0.2-beta.2",
3
+ "version": "21.0.0-beta.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": ">=18"
27
+ "node": ">=20"
28
28
  },
29
29
  "scripts": {
30
30
  "test": "jest --coverage",
@@ -67,9 +67,9 @@
67
67
  ]
68
68
  },
69
69
  "dependencies": {
70
- "@airgap/beacon-dapp": "^4.3.0-beta.1",
71
- "@taquito/core": "^20.0.2-beta.2",
72
- "@taquito/taquito": "^20.0.2-beta.2"
70
+ "@airgap/beacon-dapp": "^4.2.2",
71
+ "@taquito/core": "^21.0.0-beta.0",
72
+ "@taquito/taquito": "^21.0.0-beta.0"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@types/bluebird": "^3.5.42",
@@ -100,8 +100,8 @@
100
100
  "ts-node": "^10.9.2",
101
101
  "ts-toolbelt": "^9.6.0",
102
102
  "typescript": "5.5.4",
103
- "webpack": "^5.93.0",
103
+ "webpack": "^5.94.0",
104
104
  "webpack-cli": "^5.1.4"
105
105
  },
106
- "gitHead": "f0f9e4d22a374c72913abbb1991b0e5b34f4c978"
106
+ "gitHead": "44bfadbebbff97b8bf6beaef091b0aae72e2e8a6"
107
107
  }