@portal-hq/provider 4.5.1 → 4.6.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.
- package/lib/commonjs/signers/enclave.js +2 -0
- package/lib/esm/providers/index.js +2 -2
- package/lib/esm/signers/enclave.js +3 -1
- package/lib/esm/signers/mpc.js +1 -1
- package/package.json +4 -4
- package/src/providers/index.ts +5 -4
- package/src/signers/enclave.ts +6 -4
- package/src/signers/mpc.ts +3 -3
- package/types.d.ts +2 -2
|
@@ -166,6 +166,7 @@ class EnclaveSigner {
|
|
|
166
166
|
requestBody = {
|
|
167
167
|
params: formattedParams,
|
|
168
168
|
share: JSON.stringify(signingShare),
|
|
169
|
+
metadataStr: JSON.stringify(metadata),
|
|
169
170
|
};
|
|
170
171
|
}
|
|
171
172
|
else {
|
|
@@ -444,6 +445,7 @@ class EnclaveSigner {
|
|
|
444
445
|
requestBody = {
|
|
445
446
|
params,
|
|
446
447
|
share: JSON.stringify(signingShare),
|
|
448
|
+
metadataStr: JSON.stringify(metadata),
|
|
447
449
|
presignature: presignatureData,
|
|
448
450
|
};
|
|
449
451
|
metrics.operation = 'raw_signWithPresignature';
|
|
@@ -8,8 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { PortalCurve } from '@portal-hq/core';
|
|
11
|
-
import { Events, HttpRequester, InvalidApiKeyError, InvalidGatewayConfigError, PortalRequests, ProviderRpcError, RpcErrorCodes,
|
|
12
|
-
import {
|
|
11
|
+
import { CHAIN_NAMESPACES, DEFAULT_CHAIN_ID_CAIP2, DEFAULT_HOSTS, Events, HttpRequester, InvalidApiKeyError, InvalidGatewayConfigError, PortalRequests, ProviderRpcError, RpcErrorCodes, generateTraceId, sdkLogger, } from '@portal-hq/utils';
|
|
12
|
+
import { EnclaveSigner, MpcSigner } from '../signers';
|
|
13
13
|
const passiveSignerMethods = [
|
|
14
14
|
'eth_accounts',
|
|
15
15
|
'eth_chainId',
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { PortalCurve } from '@portal-hq/core';
|
|
11
|
-
import { HttpRequester, PortalErrorCodes, PortalMpcError,
|
|
11
|
+
import { DEFAULT_HOSTS, HttpRequester, PortalErrorCodes, PortalMpcError, generateTraceId, getClientPlatformVersion, sdkLogger, } from '@portal-hq/utils';
|
|
12
12
|
var Operation;
|
|
13
13
|
(function (Operation) {
|
|
14
14
|
Operation["SIGN"] = "sign";
|
|
@@ -164,6 +164,7 @@ class EnclaveSigner {
|
|
|
164
164
|
requestBody = {
|
|
165
165
|
params: formattedParams,
|
|
166
166
|
share: JSON.stringify(signingShare),
|
|
167
|
+
metadataStr: JSON.stringify(metadata),
|
|
167
168
|
};
|
|
168
169
|
}
|
|
169
170
|
else {
|
|
@@ -442,6 +443,7 @@ class EnclaveSigner {
|
|
|
442
443
|
requestBody = {
|
|
443
444
|
params,
|
|
444
445
|
share: JSON.stringify(signingShare),
|
|
446
|
+
metadataStr: JSON.stringify(metadata),
|
|
445
447
|
presignature: presignatureData,
|
|
446
448
|
};
|
|
447
449
|
metrics.operation = 'raw_signWithPresignature';
|
package/lib/esm/signers/mpc.js
CHANGED
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { PortalCurve } from '@portal-hq/core';
|
|
11
|
-
import {
|
|
11
|
+
import { DEFAULT_HOSTS, PortalMpcError, generateTraceId, getClientPlatformVersion, sdkLogger, } from '@portal-hq/utils';
|
|
12
12
|
import { NativeModules } from 'react-native';
|
|
13
13
|
var Operation;
|
|
14
14
|
(function (Operation) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portal-hq/provider",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
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": "^4.
|
|
23
|
-
"@portal-hq/utils": "^4.
|
|
22
|
+
"@portal-hq/connect": "^4.6.0",
|
|
23
|
+
"@portal-hq/utils": "^4.6.0",
|
|
24
24
|
"@types/react-native-uuid": "^2.0.0",
|
|
25
25
|
"react-native-uuid": "^2.0.3"
|
|
26
26
|
},
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"ts-jest": "^29.0.3",
|
|
33
33
|
"typescript": "^4.8.4"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "81e3ade6164a87aa8fc8942af4c770d04f73bc55"
|
|
36
36
|
}
|
package/src/providers/index.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import PortalConnect from '@portal-hq/connect'
|
|
2
2
|
import { PortalCurve } from '@portal-hq/core'
|
|
3
3
|
import {
|
|
4
|
+
CHAIN_NAMESPACES,
|
|
5
|
+
DEFAULT_CHAIN_ID_CAIP2,
|
|
6
|
+
DEFAULT_HOSTS,
|
|
4
7
|
Events,
|
|
5
8
|
HttpRequester,
|
|
6
9
|
IPortalProvider,
|
|
@@ -11,9 +14,6 @@ import {
|
|
|
11
14
|
ProviderRpcError,
|
|
12
15
|
type RequestArguments,
|
|
13
16
|
RpcErrorCodes,
|
|
14
|
-
DEFAULT_CHAIN_ID_CAIP2,
|
|
15
|
-
CHAIN_NAMESPACES,
|
|
16
|
-
DEFAULT_HOSTS,
|
|
17
17
|
generateTraceId,
|
|
18
18
|
sdkLogger,
|
|
19
19
|
} from '@portal-hq/utils'
|
|
@@ -26,7 +26,8 @@ import {
|
|
|
26
26
|
type RegisteredEventHandler,
|
|
27
27
|
SwitchEthereumChainParameter,
|
|
28
28
|
} from '../../types'
|
|
29
|
-
import { MpcSigner, Signer
|
|
29
|
+
import { EnclaveSigner, MpcSigner, Signer } from '../signers'
|
|
30
|
+
|
|
30
31
|
const passiveSignerMethods = [
|
|
31
32
|
'eth_accounts',
|
|
32
33
|
'eth_chainId',
|
package/src/signers/enclave.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { PortalCurve } from '@portal-hq/core'
|
|
2
2
|
import { FeatureFlags } from '@portal-hq/core/types'
|
|
3
3
|
import {
|
|
4
|
+
DEFAULT_HOSTS,
|
|
4
5
|
HttpRequester,
|
|
5
6
|
IPortalProvider,
|
|
6
7
|
KeychainAdapter,
|
|
7
8
|
PortalErrorCodes,
|
|
8
9
|
PortalMpcError,
|
|
9
10
|
type SigningRequestArguments,
|
|
10
|
-
getClientPlatformVersion,
|
|
11
|
-
DEFAULT_HOSTS,
|
|
12
11
|
generateTraceId,
|
|
12
|
+
getClientPlatformVersion,
|
|
13
13
|
sdkLogger,
|
|
14
14
|
} from '@portal-hq/utils'
|
|
15
15
|
|
|
16
16
|
import {
|
|
17
|
+
type EnclaveSignResponse,
|
|
17
18
|
type MpcSignerOptions,
|
|
18
|
-
type PresignatureSource,
|
|
19
19
|
PortalMobileMpcMetadata,
|
|
20
|
-
type
|
|
20
|
+
type PresignatureSource,
|
|
21
21
|
} from '../../types'
|
|
22
22
|
import Signer from './abstract'
|
|
23
23
|
|
|
@@ -207,6 +207,7 @@ class EnclaveSigner implements Signer {
|
|
|
207
207
|
requestBody = {
|
|
208
208
|
params: formattedParams,
|
|
209
209
|
share: JSON.stringify(signingShare),
|
|
210
|
+
metadataStr: JSON.stringify(metadata),
|
|
210
211
|
}
|
|
211
212
|
} else {
|
|
212
213
|
// Standard sign endpoint and body
|
|
@@ -575,6 +576,7 @@ class EnclaveSigner implements Signer {
|
|
|
575
576
|
requestBody = {
|
|
576
577
|
params,
|
|
577
578
|
share: JSON.stringify(signingShare),
|
|
579
|
+
metadataStr: JSON.stringify(metadata),
|
|
578
580
|
presignature: presignatureData,
|
|
579
581
|
}
|
|
580
582
|
metrics.operation = 'raw_signWithPresignature'
|
package/src/signers/mpc.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { PortalCurve } from '@portal-hq/core'
|
|
2
2
|
import { FeatureFlags } from '@portal-hq/core/types'
|
|
3
3
|
import {
|
|
4
|
+
DEFAULT_HOSTS,
|
|
4
5
|
HttpRequester,
|
|
5
6
|
IPortalProvider,
|
|
6
7
|
KeychainAdapter,
|
|
7
8
|
PortalMpcError,
|
|
8
9
|
type SigningRequestArguments,
|
|
9
|
-
getClientPlatformVersion,
|
|
10
|
-
DEFAULT_HOSTS,
|
|
11
10
|
generateTraceId,
|
|
11
|
+
getClientPlatformVersion,
|
|
12
12
|
sdkLogger,
|
|
13
13
|
} from '@portal-hq/utils'
|
|
14
14
|
import { NativeModules } from 'react-native'
|
|
@@ -16,8 +16,8 @@ import { NativeModules } from 'react-native'
|
|
|
16
16
|
import {
|
|
17
17
|
type MpcSignerOptions,
|
|
18
18
|
type PortalMobileMpc,
|
|
19
|
-
type PresignatureSource,
|
|
20
19
|
PortalMobileMpcMetadata,
|
|
20
|
+
type PresignatureSource,
|
|
21
21
|
type SigningResponse,
|
|
22
22
|
} from '../../types'
|
|
23
23
|
import Signer from './abstract'
|
package/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Types
|
|
2
2
|
import PortalConnect from '@portal-hq/connect'
|
|
3
|
+
import type { PortalCurve } from '@portal-hq/core'
|
|
3
4
|
import {
|
|
5
|
+
HttpRequester,
|
|
4
6
|
KeychainAdapter,
|
|
5
7
|
type PortalError,
|
|
6
|
-
HttpRequester,
|
|
7
8
|
} from '@portal-hq/utils'
|
|
8
|
-
import type { PortalCurve } from '@portal-hq/core'
|
|
9
9
|
|
|
10
10
|
export type EventHandler = (data: any) => void
|
|
11
11
|
|