@portal-hq/provider 2.0.10 → 2.0.12

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,12 @@ const signerMethods = [
28
28
  'personal_sign',
29
29
  ];
30
30
  class Provider {
31
+ get address() {
32
+ return this.keychain.getAddress(this.isSimulator);
33
+ }
34
+ get gatewayUrl() {
35
+ return this.getGatewayUrl();
36
+ }
31
37
  constructor({
32
38
  // Required
33
39
  apiKey, chainId, keychain, gatewayConfig,
@@ -71,12 +77,6 @@ class Provider {
71
77
  featureFlags,
72
78
  });
73
79
  }
74
- get address() {
75
- return this.keychain.getAddress(this.isSimulator);
76
- }
77
- get gatewayUrl() {
78
- return this.getGatewayUrl();
79
- }
80
80
  /**
81
81
  * Invokes all registered event handlers with the data provided
82
82
  * - If any `once` handlers exist, they are removed after all handlers are invoked
@@ -12,6 +12,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const react_native_1 = require("react-native");
13
13
  const utils_1 = require("@portal-hq/utils");
14
14
  class MpcSigner {
15
+ get address() {
16
+ return this.keychain.getAddress(this.isSimulator);
17
+ }
18
+ get signingShare() {
19
+ return this.keychain.getDkgResult(this.isSimulator);
20
+ }
15
21
  constructor({ keychain, isSimulator = false, mpcHost = 'mpc.portalhq.io', version = 'v5', featureFlags = { optimized: false }, }) {
16
22
  this.version = 'v5';
17
23
  this.buildParams = (method, txParams) => {
@@ -42,12 +48,6 @@ class MpcSigner {
42
48
  throw new Error(`[Portal.Provider.MpcSigner] The MPC module could not be found by the signer. This is usually an issue with React Native linking. Please verify that the 'PortalReactNative' module is properly linked to this project.`);
43
49
  }
44
50
  }
45
- get address() {
46
- return this.keychain.getAddress(this.isSimulator);
47
- }
48
- get signingShare() {
49
- return this.keychain.getDkgResult(this.isSimulator);
50
- }
51
51
  sign(message, provider) {
52
52
  return __awaiter(this, void 0, void 0, function* () {
53
53
  const address = yield this.address;
@@ -26,6 +26,12 @@ const signerMethods = [
26
26
  'personal_sign',
27
27
  ];
28
28
  class Provider {
29
+ get address() {
30
+ return this.keychain.getAddress(this.isSimulator);
31
+ }
32
+ get gatewayUrl() {
33
+ return this.getGatewayUrl();
34
+ }
29
35
  constructor({
30
36
  // Required
31
37
  apiKey, chainId, keychain, gatewayConfig,
@@ -69,12 +75,6 @@ class Provider {
69
75
  featureFlags,
70
76
  });
71
77
  }
72
- get address() {
73
- return this.keychain.getAddress(this.isSimulator);
74
- }
75
- get gatewayUrl() {
76
- return this.getGatewayUrl();
77
- }
78
78
  /**
79
79
  * Invokes all registered event handlers with the data provided
80
80
  * - If any `once` handlers exist, they are removed after all handlers are invoked
@@ -10,6 +10,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { NativeModules } from 'react-native';
11
11
  import { PortalMpcError, } from '@portal-hq/utils';
12
12
  class MpcSigner {
13
+ get address() {
14
+ return this.keychain.getAddress(this.isSimulator);
15
+ }
16
+ get signingShare() {
17
+ return this.keychain.getDkgResult(this.isSimulator);
18
+ }
13
19
  constructor({ keychain, isSimulator = false, mpcHost = 'mpc.portalhq.io', version = 'v5', featureFlags = { optimized: false }, }) {
14
20
  this.version = 'v5';
15
21
  this.buildParams = (method, txParams) => {
@@ -40,12 +46,6 @@ class MpcSigner {
40
46
  throw new Error(`[Portal.Provider.MpcSigner] The MPC module could not be found by the signer. This is usually an issue with React Native linking. Please verify that the 'PortalReactNative' module is properly linked to this project.`);
41
47
  }
42
48
  }
43
- get address() {
44
- return this.keychain.getAddress(this.isSimulator);
45
- }
46
- get signingShare() {
47
- return this.keychain.getDkgResult(this.isSimulator);
48
- }
49
49
  sign(message, provider) {
50
50
  return __awaiter(this, void 0, void 0, function* () {
51
51
  const address = yield this.address;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portal-hq/provider",
3
- "version": "2.0.10",
3
+ "version": "2.0.12",
4
4
  "license": "MIT",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/esm/index",
@@ -19,8 +19,8 @@
19
19
  "test": "jest"
20
20
  },
21
21
  "dependencies": {
22
- "@portal-hq/connect": "^2.0.10",
23
- "@portal-hq/utils": "^2.0.10"
22
+ "@portal-hq/connect": "^2.0.12",
23
+ "@portal-hq/utils": "^2.0.12"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@babel/preset-typescript": "^7.18.6",
@@ -30,5 +30,5 @@
30
30
  "ts-jest": "^29.0.3",
31
31
  "typescript": "^4.8.4"
32
32
  },
33
- "gitHead": "9614b8afc13c4cb0a7a6dba7df276de6a690bba9"
33
+ "gitHead": "f1ae525cc42e9d95de9a989187c72cd895f82785"
34
34
  }