@taquito/beacon-wallet 20.0.2-beta.1 → 20.0.2-beta.2

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.
@@ -1,4 +1,8 @@
1
1
  "use strict";
2
+ /**
3
+ * @packageDocumentation
4
+ * @module @taquito/beacon-wallet
5
+ */
2
6
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
7
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
8
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -10,10 +14,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
14
  };
11
15
  Object.defineProperty(exports, "__esModule", { value: true });
12
16
  exports.BeaconWallet = exports.MissingRequiredScopes = exports.BeaconWalletNotInitialized = exports.VERSION = void 0;
13
- /**
14
- * @packageDocumentation
15
- * @module @taquito/beacon-wallet
16
- */
17
17
  const beacon_dapp_1 = require("@airgap/beacon-dapp");
18
18
  const errors_1 = require("./errors");
19
19
  const typedarray_to_buffer_1 = require("typedarray-to-buffer");
@@ -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
- if (!this.account) {
50
+ const account = yield this.client.getActiveAccount();
51
+ if (!account) {
55
52
  throw new errors_1.BeaconWalletNotInitialized();
56
53
  }
57
- return this.account.address;
54
+ return account.address;
58
55
  });
59
56
  }
60
57
  getPK() {
61
- var _a;
62
58
  return __awaiter(this, void 0, void 0, function* () {
63
- if (!this.account) {
59
+ var _a;
60
+ const account = yield this.client.getActiveAccount();
61
+ if (!account) {
64
62
  throw new errors_1.BeaconWalletNotInitialized();
65
63
  }
66
- return (_a = this.account.publicKey) !== null && _a !== void 0 ? _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
- if (!this.account) {
208
+ const account = yield this.client.getActiveAccount();
209
+ if (!account) {
211
210
  throw new errors_1.BeaconWalletNotInitialized();
212
211
  }
213
- const permissions = this.account.scopes;
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;
@@ -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": "a9cdc31ccbc6e2ed58dedaf3c8c4f0c62bc3ae02",
7
- "version": "20.0.2-beta.1"
6
+ "commitHash": "943d5fd11790da35f4a3e6ecfcaae3c4f0399a97",
7
+ "version": "20.0.2-beta.2"
8
8
  };
@@ -1,4 +1,4 @@
1
- import { getDAppClientInstance, BeaconEvent, SigningType, PermissionScope } from '@airgap/beacon-dapp';
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';
@@ -63,17 +63,17 @@ 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": "a9cdc31ccbc6e2ed58dedaf3c8c4f0c62bc3ae02",
67
- "version": "20.0.2-beta.1"
66
+ "commitHash": "943d5fd11790da35f4a3e6ecfcaae3c4f0399a97",
67
+ "version": "20.0.2-beta.2"
68
68
  };
69
69
 
70
+ /**
71
+ * @packageDocumentation
72
+ * @module @taquito/beacon-wallet
73
+ */
70
74
  class BeaconWallet {
71
75
  constructor(options) {
72
76
  this.client = getDAppClientInstance(options);
73
- // Subscribe to the active account set event, this will update when there are account changes happening in the dApp
74
- this.client.subscribeToEvent(BeaconEvent.ACTIVE_ACCOUNT_SET, (data) => __awaiter(this, void 0, void 0, function* () {
75
- this.account = data;
76
- }));
77
77
  }
78
78
  validateRequiredScopesOrFail(permissionScopes, requiredScopes) {
79
79
  const mandatoryScope = new Set(requiredScopes);
@@ -93,19 +93,21 @@ class BeaconWallet {
93
93
  }
94
94
  getPKH() {
95
95
  return __awaiter(this, void 0, void 0, function* () {
96
- if (!this.account) {
96
+ const account = yield this.client.getActiveAccount();
97
+ if (!account) {
97
98
  throw new BeaconWalletNotInitialized();
98
99
  }
99
- return this.account.address;
100
+ return account.address;
100
101
  });
101
102
  }
102
103
  getPK() {
103
- var _a;
104
104
  return __awaiter(this, void 0, void 0, function* () {
105
- if (!this.account) {
105
+ var _a;
106
+ const account = yield this.client.getActiveAccount();
107
+ if (!account) {
106
108
  throw new BeaconWalletNotInitialized();
107
109
  }
108
- return (_a = this.account.publicKey) !== null && _a !== void 0 ? _a : '';
110
+ return (_a = account.publicKey) !== null && _a !== void 0 ? _a : '';
109
111
  });
110
112
  }
111
113
  mapTransferParamsToWalletParams(params) {
@@ -249,10 +251,11 @@ class BeaconWallet {
249
251
  }
250
252
  sendOperations(params) {
251
253
  return __awaiter(this, void 0, void 0, function* () {
252
- if (!this.account) {
254
+ const account = yield this.client.getActiveAccount();
255
+ if (!account) {
253
256
  throw new BeaconWalletNotInitialized();
254
257
  }
255
- const permissions = this.account.scopes;
258
+ const permissions = account.scopes;
256
259
  this.validateRequiredScopesOrFail(permissions, [PermissionScope.OPERATION_REQUEST]);
257
260
  const { transactionHash } = yield this.client.requestOperation({ operationDetails: params });
258
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -63,17 +63,17 @@
63
63
 
64
64
  // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
65
65
  const VERSION = {
66
- "commitHash": "a9cdc31ccbc6e2ed58dedaf3c8c4f0c62bc3ae02",
67
- "version": "20.0.2-beta.1"
66
+ "commitHash": "943d5fd11790da35f4a3e6ecfcaae3c4f0399a97",
67
+ "version": "20.0.2-beta.2"
68
68
  };
69
69
 
70
+ /**
71
+ * @packageDocumentation
72
+ * @module @taquito/beacon-wallet
73
+ */
70
74
  class BeaconWallet {
71
75
  constructor(options) {
72
76
  this.client = beaconDapp.getDAppClientInstance(options);
73
- // Subscribe to the active account set event, this will update when there are account changes happening in the dApp
74
- this.client.subscribeToEvent(beaconDapp.BeaconEvent.ACTIVE_ACCOUNT_SET, (data) => __awaiter(this, void 0, void 0, function* () {
75
- this.account = data;
76
- }));
77
77
  }
78
78
  validateRequiredScopesOrFail(permissionScopes, requiredScopes) {
79
79
  const mandatoryScope = new Set(requiredScopes);
@@ -93,19 +93,21 @@
93
93
  }
94
94
  getPKH() {
95
95
  return __awaiter(this, void 0, void 0, function* () {
96
- if (!this.account) {
96
+ const account = yield this.client.getActiveAccount();
97
+ if (!account) {
97
98
  throw new BeaconWalletNotInitialized();
98
99
  }
99
- return this.account.address;
100
+ return account.address;
100
101
  });
101
102
  }
102
103
  getPK() {
103
- var _a;
104
104
  return __awaiter(this, void 0, void 0, function* () {
105
- if (!this.account) {
105
+ var _a;
106
+ const account = yield this.client.getActiveAccount();
107
+ if (!account) {
106
108
  throw new BeaconWalletNotInitialized();
107
109
  }
108
- return (_a = this.account.publicKey) !== null && _a !== void 0 ? _a : '';
110
+ return (_a = account.publicKey) !== null && _a !== void 0 ? _a : '';
109
111
  });
110
112
  }
111
113
  mapTransferParamsToWalletParams(params) {
@@ -249,10 +251,11 @@
249
251
  }
250
252
  sendOperations(params) {
251
253
  return __awaiter(this, void 0, void 0, function* () {
252
- if (!this.account) {
254
+ const account = yield this.client.getActiveAccount();
255
+ if (!account) {
253
256
  throw new BeaconWalletNotInitialized();
254
257
  }
255
- const permissions = this.account.scopes;
258
+ const permissions = account.scopes;
256
259
  this.validateRequiredScopesOrFail(permissions, [beaconDapp.PermissionScope.OPERATION_REQUEST]);
257
260
  const { transactionHash } = yield this.client.requestOperation({ operationDetails: params });
258
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,13 +2,12 @@
2
2
  * @packageDocumentation
3
3
  * @module @taquito/beacon-wallet
4
4
  */
5
- import { DAppClient, DAppClientOptions, RequestPermissionInput, AccountInfo } from '@airgap/beacon-dapp';
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": "20.0.2-beta.1",
3
+ "version": "20.0.2-beta.2",
4
4
  "description": "Beacon wallet provider",
5
5
  "keywords": [
6
6
  "tezos",
@@ -68,40 +68,40 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@airgap/beacon-dapp": "^4.3.0-beta.1",
71
- "@taquito/core": "^20.0.2-beta.1",
72
- "@taquito/taquito": "^20.0.2-beta.1"
71
+ "@taquito/core": "^20.0.2-beta.2",
72
+ "@taquito/taquito": "^20.0.2-beta.2"
73
73
  },
74
74
  "devDependencies": {
75
- "@types/bluebird": "^3.5.40",
76
- "@types/chrome": "0.0.246",
77
- "@types/jest": "^29.5.5",
78
- "@types/node": "^20",
79
- "@types/ws": "^8.5.7",
80
- "@typescript-eslint/eslint-plugin": "^6.8.0",
81
- "@typescript-eslint/parser": "^6.8.0",
75
+ "@types/bluebird": "^3.5.42",
76
+ "@types/chrome": "0.0.269",
77
+ "@types/jest": "^29.5.12",
78
+ "@types/node": "^22",
79
+ "@types/ws": "^8.5.12",
80
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
81
+ "@typescript-eslint/parser": "^6.21.0",
82
82
  "colors": "^1.4.0",
83
83
  "coveralls": "^3.1.1",
84
84
  "cross-env": "^7.0.3",
85
- "eslint": "^8.51.0",
86
- "fake-indexeddb": "^5.0.2",
85
+ "eslint": "^8.57.0",
86
+ "fake-indexeddb": "^6.0.0",
87
87
  "jest": "^29.7.0",
88
88
  "jest-config": "^29.7.0",
89
- "lint-staged": "^14.0.1",
89
+ "lint-staged": "^15.2.7",
90
90
  "lodash.camelcase": "^4.3.0",
91
- "prettier": "^3.0.3",
91
+ "prettier": "^3.3.3",
92
92
  "prompt": "^1.3.0",
93
- "replace-in-file": "^7.0.1",
94
- "rimraf": "^5.0.5",
95
- "rollup": "^4.1.4",
93
+ "replace-in-file": "^8.1.0",
94
+ "rimraf": "^6.0.1",
95
+ "rollup": "^4.19.1",
96
96
  "rollup-plugin-json": "^4.0.0",
97
97
  "rollup-plugin-typescript2": "^0.36.0",
98
98
  "shelljs": "^0.8.5",
99
- "ts-jest": "^29.1.1",
100
- "ts-node": "^10.9.1",
99
+ "ts-jest": "^29.2.3",
100
+ "ts-node": "^10.9.2",
101
101
  "ts-toolbelt": "^9.6.0",
102
- "typescript": "5.2.2",
103
- "webpack": "^5.89.0",
102
+ "typescript": "5.5.4",
103
+ "webpack": "^5.93.0",
104
104
  "webpack-cli": "^5.1.4"
105
105
  },
106
- "gitHead": "6d1e4d129ac57c1bdeb5464601e40c50f413e43f"
106
+ "gitHead": "f0f9e4d22a374c72913abbb1991b0e5b34f4c978"
107
107
  }