@portal-hq/provider 0.3.4 → 0.3.5

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.
@@ -31,7 +31,7 @@ class Provider {
31
31
  // Required options
32
32
  apiKey, chainId, keychain,
33
33
  // Optional options
34
- apiUrl = 'api.portalhq.io', autoApprove = false, mpcUrl = 'mpc.portalhq.io', mpcVersion = 'v1', gatewayConfig = {}, }) {
34
+ apiUrl = 'api.portalhq.io', autoApprove = false, mpcUrl = 'mpc.portalhq.io', mpcVersion = 'v2', gatewayConfig = {}, }) {
35
35
  // Handle required fields
36
36
  if (!apiKey || apiKey.length === 0) {
37
37
  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 = 'v1' }) {
16
- this.mpcVersion = 'v1';
15
+ constructor({ keychain, mpcUrl, mpcVersion = 'v2' }) {
16
+ this.mpcVersion = 'v2';
17
17
  this.buildParams = (method, txParams) => {
18
18
  let params = txParams;
19
19
  switch (method) {
@@ -29,7 +29,7 @@ class Provider {
29
29
  // Required options
30
30
  apiKey, chainId, keychain,
31
31
  // Optional options
32
- apiUrl = 'api.portalhq.io', autoApprove = false, mpcUrl = 'mpc.portalhq.io', mpcVersion = 'v1', gatewayConfig = {}, }) {
32
+ apiUrl = 'api.portalhq.io', autoApprove = false, mpcUrl = 'mpc.portalhq.io', mpcVersion = 'v2', gatewayConfig = {}, }) {
33
33
  // Handle required fields
34
34
  if (!apiKey || apiKey.length === 0) {
35
35
  throw new InvalidApiKeyError();
@@ -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 = 'v1' }) {
14
- this.mpcVersion = 'v1';
13
+ constructor({ keychain, mpcUrl, mpcVersion = 'v2' }) {
14
+ this.mpcVersion = 'v2';
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.4",
3
+ "version": "0.3.5",
4
4
  "license": "MIT",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/esm/index",
@@ -66,7 +66,7 @@ class Provider {
66
66
  apiUrl = 'api.portalhq.io',
67
67
  autoApprove = false,
68
68
  mpcUrl = 'mpc.portalhq.io',
69
- mpcVersion = 'v1',
69
+ mpcVersion = 'v2',
70
70
  gatewayConfig = {},
71
71
  }: ProviderOptions) {
72
72
  // Handle required fields
@@ -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 = 'v1'
23
+ public mpcVersion: string = 'v2'
24
24
 
25
- constructor({ keychain, mpcUrl, mpcVersion = 'v1' }: MpcSignerOptions) {
25
+ constructor({ keychain, mpcUrl, mpcVersion = 'v2' }: MpcSignerOptions) {
26
26
  this.keychain = keychain
27
27
  this.mpc = NativeModules.PortalMobileMpc
28
28
  this.mpcUrl = mpcUrl