@portal-hq/provider 0.3.7 → 1.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.
|
@@ -32,7 +32,7 @@ class Provider {
|
|
|
32
32
|
// Required options
|
|
33
33
|
apiKey, chainId, keychain,
|
|
34
34
|
// Optional options
|
|
35
|
-
apiUrl = 'api.portalhq.io', autoApprove = false, mpcUrl = 'mpc.portalhq.io', mpcVersion = '
|
|
35
|
+
apiUrl = 'api.portalhq.io', autoApprove = false, mpcUrl = 'mpc.portalhq.io', mpcVersion = 'v4', gatewayConfig = {}, }) {
|
|
36
36
|
// Handle required fields
|
|
37
37
|
if (!apiKey || apiKey.length === 0) {
|
|
38
38
|
throw new utils_1.InvalidApiKeyError();
|
|
@@ -12,8 +12,8 @@ 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
|
-
constructor({ keychain, mpcUrl, mpcVersion = '
|
|
16
|
-
this.mpcVersion = '
|
|
15
|
+
constructor({ keychain, mpcUrl, mpcVersion = 'v4' }) {
|
|
16
|
+
this.mpcVersion = 'v4';
|
|
17
17
|
this.buildParams = (method, txParams) => {
|
|
18
18
|
let params = txParams;
|
|
19
19
|
switch (method) {
|
|
@@ -30,7 +30,7 @@ class Provider {
|
|
|
30
30
|
// Required options
|
|
31
31
|
apiKey, chainId, keychain,
|
|
32
32
|
// Optional options
|
|
33
|
-
apiUrl = 'api.portalhq.io', autoApprove = false, mpcUrl = 'mpc.portalhq.io', mpcVersion = '
|
|
33
|
+
apiUrl = 'api.portalhq.io', autoApprove = false, mpcUrl = 'mpc.portalhq.io', mpcVersion = 'v4', gatewayConfig = {}, }) {
|
|
34
34
|
// Handle required fields
|
|
35
35
|
if (!apiKey || apiKey.length === 0) {
|
|
36
36
|
throw new InvalidApiKeyError();
|
package/lib/esm/signers/mpc.js
CHANGED
|
@@ -10,8 +10,8 @@ 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
|
-
constructor({ keychain, mpcUrl, mpcVersion = '
|
|
14
|
-
this.mpcVersion = '
|
|
13
|
+
constructor({ keychain, mpcUrl, mpcVersion = 'v4' }) {
|
|
14
|
+
this.mpcVersion = 'v4';
|
|
15
15
|
this.buildParams = (method, txParams) => {
|
|
16
16
|
let params = txParams;
|
|
17
17
|
switch (method) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portal-hq/provider",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/esm/index",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"test": "jest"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@portal-hq/utils": "^0.
|
|
22
|
+
"@portal-hq/utils": "^1.0.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@babel/preset-typescript": "^7.18.6",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"ts-jest": "^29.0.3",
|
|
30
30
|
"typescript": "^4.8.4"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "eb157f00d5567c5fe28c4f935ea0d1099b7103e5"
|
|
33
33
|
}
|
package/src/providers/index.ts
CHANGED
package/src/signers/mpc.ts
CHANGED
|
@@ -20,9 +20,9 @@ class MpcSigner implements Signer {
|
|
|
20
20
|
public address?: string
|
|
21
21
|
public keychain: KeychainAdapter
|
|
22
22
|
public mpcUrl: string // should we add a default here mpc.portalhq.io
|
|
23
|
-
public mpcVersion: string = '
|
|
23
|
+
public mpcVersion: string = 'v4'
|
|
24
24
|
|
|
25
|
-
constructor({ keychain, mpcUrl, mpcVersion = '
|
|
25
|
+
constructor({ keychain, mpcUrl, mpcVersion = 'v4' }: MpcSignerOptions) {
|
|
26
26
|
this.keychain = keychain
|
|
27
27
|
this.mpc = NativeModules.PortalMobileMpc
|
|
28
28
|
this.mpcUrl = mpcUrl
|