@getpara/core-sdk 2.15.0 → 2.16.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/dist/cjs/ParaCore.js
CHANGED
|
@@ -2132,7 +2132,7 @@ const _ParaCore = class _ParaCore {
|
|
|
2132
2132
|
* @param {Object} opts the options object.
|
|
2133
2133
|
* @param {string} opts.walletId the id of the wallet to sign with.
|
|
2134
2134
|
* @param {string} opts.messageBase64 the base64 encoding of exact message that should be signed
|
|
2135
|
-
* @param {number} [opts.timeout] optional timeout in milliseconds. If not present, defaults to 30 seconds.
|
|
2135
|
+
* @param {number} [opts.timeout] optional timeout in milliseconds. If not present, defaults to 30 seconds. Extended to a minimum of 5 minutes when the transaction requires approval.
|
|
2136
2136
|
* @param {string} [opts.cosmosSignDocBase64] the Cosmos `SignDoc` in base64, if applicable
|
|
2137
2137
|
**/
|
|
2138
2138
|
signMessage(_0) {
|
|
@@ -2154,9 +2154,10 @@ const _ParaCore = class _ParaCore {
|
|
|
2154
2154
|
}
|
|
2155
2155
|
let signRes = yield this.signMessageInner({ wallet, signerId, messageBase64, cosmosSignDocBase64 });
|
|
2156
2156
|
let timeStart = Date.now();
|
|
2157
|
+
const effectiveTimeoutMs = Math.max(timeoutMs, constants.TRANSACTION_REVIEW_TIMEOUT_MS);
|
|
2157
2158
|
if (signRes.pendingTransactionId) {
|
|
2158
2159
|
yield this.platformUtils.openPopup(
|
|
2159
|
-
yield this.getTransactionReviewUrl(signRes.pendingTransactionId,
|
|
2160
|
+
yield this.getTransactionReviewUrl(signRes.pendingTransactionId, effectiveTimeoutMs),
|
|
2160
2161
|
{ type: cosmosSignDocBase64 ? import_types.PopupType.SIGN_TRANSACTION_REVIEW : import_types.PopupType.SIGN_MESSAGE_REVIEW }
|
|
2161
2162
|
);
|
|
2162
2163
|
} else {
|
|
@@ -2164,7 +2165,7 @@ const _ParaCore = class _ParaCore {
|
|
|
2164
2165
|
return signRes;
|
|
2165
2166
|
}
|
|
2166
2167
|
while (true) {
|
|
2167
|
-
if (isCanceled() || Date.now() - timeStart >
|
|
2168
|
+
if (isCanceled() || Date.now() - timeStart > effectiveTimeoutMs) {
|
|
2168
2169
|
onCancel == null ? void 0 : onCancel();
|
|
2169
2170
|
break;
|
|
2170
2171
|
}
|
|
@@ -2238,7 +2239,7 @@ const _ParaCore = class _ParaCore {
|
|
|
2238
2239
|
* @param {string} opts.walletId the id of the wallet to sign with.
|
|
2239
2240
|
* @param {string} opts.rlpEncodedTxBase64 the transaction to sign, in RLP base64 encoding
|
|
2240
2241
|
* @param {string} [opts.chainId] the EVM chain id of the chain the transaction is being sent on, if applicable
|
|
2241
|
-
* @param {number} [opts.timeoutMs] the amount of time to wait for the user to sign the transaction, in milliseconds
|
|
2242
|
+
* @param {number} [opts.timeoutMs] the amount of time to wait for the user to sign the transaction, in milliseconds. Extended to a minimum of 5 minutes when the transaction requires approval.
|
|
2242
2243
|
**/
|
|
2243
2244
|
signTransaction(_0) {
|
|
2244
2245
|
return __async(this, arguments, function* ({
|
|
@@ -2268,9 +2269,10 @@ const _ParaCore = class _ParaCore {
|
|
|
2268
2269
|
wallet.scheme === "DKLS"
|
|
2269
2270
|
);
|
|
2270
2271
|
let timeStart = Date.now();
|
|
2272
|
+
const effectiveTimeoutMs = Math.max(timeoutMs, constants.TRANSACTION_REVIEW_TIMEOUT_MS);
|
|
2271
2273
|
if (signRes.pendingTransactionId) {
|
|
2272
2274
|
yield this.platformUtils.openPopup(
|
|
2273
|
-
yield this.getTransactionReviewUrl(signRes.pendingTransactionId,
|
|
2275
|
+
yield this.getTransactionReviewUrl(signRes.pendingTransactionId, effectiveTimeoutMs),
|
|
2274
2276
|
{ type: import_types.PopupType.SIGN_TRANSACTION_REVIEW }
|
|
2275
2277
|
);
|
|
2276
2278
|
} else {
|
|
@@ -2278,7 +2280,7 @@ const _ParaCore = class _ParaCore {
|
|
|
2278
2280
|
return signRes;
|
|
2279
2281
|
}
|
|
2280
2282
|
while (true) {
|
|
2281
|
-
if (isCanceled() || Date.now() - timeStart >
|
|
2283
|
+
if (isCanceled() || Date.now() - timeStart > effectiveTimeoutMs) {
|
|
2282
2284
|
onCancel == null ? void 0 : onCancel();
|
|
2283
2285
|
break;
|
|
2284
2286
|
}
|
package/dist/cjs/constants.js
CHANGED
|
@@ -42,10 +42,11 @@ __export(constants_exports, {
|
|
|
42
42
|
POLLING_TIMEOUT_MS: () => POLLING_TIMEOUT_MS,
|
|
43
43
|
PREFIX: () => PREFIX,
|
|
44
44
|
SESSION_STORAGE_LOGIN_ENCRYPTION_KEY_PAIR: () => SESSION_STORAGE_LOGIN_ENCRYPTION_KEY_PAIR,
|
|
45
|
-
SHORT_POLLING_INTERVAL_MS: () => SHORT_POLLING_INTERVAL_MS
|
|
45
|
+
SHORT_POLLING_INTERVAL_MS: () => SHORT_POLLING_INTERVAL_MS,
|
|
46
|
+
TRANSACTION_REVIEW_TIMEOUT_MS: () => TRANSACTION_REVIEW_TIMEOUT_MS
|
|
46
47
|
});
|
|
47
48
|
module.exports = __toCommonJS(constants_exports);
|
|
48
|
-
const PARA_CORE_VERSION = "2.
|
|
49
|
+
const PARA_CORE_VERSION = "2.16.0";
|
|
49
50
|
const PREFIX = "@CAPSULE/";
|
|
50
51
|
const PARA_PREFIX = "@PARA/";
|
|
51
52
|
const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
|
|
@@ -69,6 +70,7 @@ const LOCAL_STORAGE_IS_IMPORTED_SESSION = `${PREFIX}isImportedSession`;
|
|
|
69
70
|
const POLLING_INTERVAL_MS = 1e3;
|
|
70
71
|
const SHORT_POLLING_INTERVAL_MS = 750;
|
|
71
72
|
const POLLING_TIMEOUT_MS = 3e5;
|
|
73
|
+
const TRANSACTION_REVIEW_TIMEOUT_MS = 3e5;
|
|
72
74
|
const EXTERNAL_WALLET_CONNECTION_ONLY_USER_ID = "EXTERNAL_WALLET_CONNECTION_ONLY";
|
|
73
75
|
const ACCOUNT_LINK_CONFLICT = "Account already linked";
|
|
74
76
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -98,5 +100,6 @@ const ACCOUNT_LINK_CONFLICT = "Account already linked";
|
|
|
98
100
|
POLLING_TIMEOUT_MS,
|
|
99
101
|
PREFIX,
|
|
100
102
|
SESSION_STORAGE_LOGIN_ENCRYPTION_KEY_PAIR,
|
|
101
|
-
SHORT_POLLING_INTERVAL_MS
|
|
103
|
+
SHORT_POLLING_INTERVAL_MS,
|
|
104
|
+
TRANSACTION_REVIEW_TIMEOUT_MS
|
|
102
105
|
});
|
package/dist/esm/ParaCore.js
CHANGED
|
@@ -2074,7 +2074,7 @@ const _ParaCore = class _ParaCore {
|
|
|
2074
2074
|
* @param {Object} opts the options object.
|
|
2075
2075
|
* @param {string} opts.walletId the id of the wallet to sign with.
|
|
2076
2076
|
* @param {string} opts.messageBase64 the base64 encoding of exact message that should be signed
|
|
2077
|
-
* @param {number} [opts.timeout] optional timeout in milliseconds. If not present, defaults to 30 seconds.
|
|
2077
|
+
* @param {number} [opts.timeout] optional timeout in milliseconds. If not present, defaults to 30 seconds. Extended to a minimum of 5 minutes when the transaction requires approval.
|
|
2078
2078
|
* @param {string} [opts.cosmosSignDocBase64] the Cosmos `SignDoc` in base64, if applicable
|
|
2079
2079
|
**/
|
|
2080
2080
|
signMessage(_0) {
|
|
@@ -2096,9 +2096,10 @@ const _ParaCore = class _ParaCore {
|
|
|
2096
2096
|
}
|
|
2097
2097
|
let signRes = yield this.signMessageInner({ wallet, signerId, messageBase64, cosmosSignDocBase64 });
|
|
2098
2098
|
let timeStart = Date.now();
|
|
2099
|
+
const effectiveTimeoutMs = Math.max(timeoutMs, constants.TRANSACTION_REVIEW_TIMEOUT_MS);
|
|
2099
2100
|
if (signRes.pendingTransactionId) {
|
|
2100
2101
|
yield this.platformUtils.openPopup(
|
|
2101
|
-
yield this.getTransactionReviewUrl(signRes.pendingTransactionId,
|
|
2102
|
+
yield this.getTransactionReviewUrl(signRes.pendingTransactionId, effectiveTimeoutMs),
|
|
2102
2103
|
{ type: cosmosSignDocBase64 ? PopupType.SIGN_TRANSACTION_REVIEW : PopupType.SIGN_MESSAGE_REVIEW }
|
|
2103
2104
|
);
|
|
2104
2105
|
} else {
|
|
@@ -2106,7 +2107,7 @@ const _ParaCore = class _ParaCore {
|
|
|
2106
2107
|
return signRes;
|
|
2107
2108
|
}
|
|
2108
2109
|
while (true) {
|
|
2109
|
-
if (isCanceled() || Date.now() - timeStart >
|
|
2110
|
+
if (isCanceled() || Date.now() - timeStart > effectiveTimeoutMs) {
|
|
2110
2111
|
onCancel == null ? void 0 : onCancel();
|
|
2111
2112
|
break;
|
|
2112
2113
|
}
|
|
@@ -2180,7 +2181,7 @@ const _ParaCore = class _ParaCore {
|
|
|
2180
2181
|
* @param {string} opts.walletId the id of the wallet to sign with.
|
|
2181
2182
|
* @param {string} opts.rlpEncodedTxBase64 the transaction to sign, in RLP base64 encoding
|
|
2182
2183
|
* @param {string} [opts.chainId] the EVM chain id of the chain the transaction is being sent on, if applicable
|
|
2183
|
-
* @param {number} [opts.timeoutMs] the amount of time to wait for the user to sign the transaction, in milliseconds
|
|
2184
|
+
* @param {number} [opts.timeoutMs] the amount of time to wait for the user to sign the transaction, in milliseconds. Extended to a minimum of 5 minutes when the transaction requires approval.
|
|
2184
2185
|
**/
|
|
2185
2186
|
signTransaction(_0) {
|
|
2186
2187
|
return __async(this, arguments, function* ({
|
|
@@ -2210,9 +2211,10 @@ const _ParaCore = class _ParaCore {
|
|
|
2210
2211
|
wallet.scheme === "DKLS"
|
|
2211
2212
|
);
|
|
2212
2213
|
let timeStart = Date.now();
|
|
2214
|
+
const effectiveTimeoutMs = Math.max(timeoutMs, constants.TRANSACTION_REVIEW_TIMEOUT_MS);
|
|
2213
2215
|
if (signRes.pendingTransactionId) {
|
|
2214
2216
|
yield this.platformUtils.openPopup(
|
|
2215
|
-
yield this.getTransactionReviewUrl(signRes.pendingTransactionId,
|
|
2217
|
+
yield this.getTransactionReviewUrl(signRes.pendingTransactionId, effectiveTimeoutMs),
|
|
2216
2218
|
{ type: PopupType.SIGN_TRANSACTION_REVIEW }
|
|
2217
2219
|
);
|
|
2218
2220
|
} else {
|
|
@@ -2220,7 +2222,7 @@ const _ParaCore = class _ParaCore {
|
|
|
2220
2222
|
return signRes;
|
|
2221
2223
|
}
|
|
2222
2224
|
while (true) {
|
|
2223
|
-
if (isCanceled() || Date.now() - timeStart >
|
|
2225
|
+
if (isCanceled() || Date.now() - timeStart > effectiveTimeoutMs) {
|
|
2224
2226
|
onCancel == null ? void 0 : onCancel();
|
|
2225
2227
|
break;
|
|
2226
2228
|
}
|
package/dist/esm/constants.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./chunk-7B52C2XE.js";
|
|
2
|
-
const PARA_CORE_VERSION = "2.
|
|
2
|
+
const PARA_CORE_VERSION = "2.16.0";
|
|
3
3
|
const PREFIX = "@CAPSULE/";
|
|
4
4
|
const PARA_PREFIX = "@PARA/";
|
|
5
5
|
const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
|
|
@@ -23,6 +23,7 @@ const LOCAL_STORAGE_IS_IMPORTED_SESSION = `${PREFIX}isImportedSession`;
|
|
|
23
23
|
const POLLING_INTERVAL_MS = 1e3;
|
|
24
24
|
const SHORT_POLLING_INTERVAL_MS = 750;
|
|
25
25
|
const POLLING_TIMEOUT_MS = 3e5;
|
|
26
|
+
const TRANSACTION_REVIEW_TIMEOUT_MS = 3e5;
|
|
26
27
|
const EXTERNAL_WALLET_CONNECTION_ONLY_USER_ID = "EXTERNAL_WALLET_CONNECTION_ONLY";
|
|
27
28
|
const ACCOUNT_LINK_CONFLICT = "Account already linked";
|
|
28
29
|
export {
|
|
@@ -51,5 +52,6 @@ export {
|
|
|
51
52
|
POLLING_TIMEOUT_MS,
|
|
52
53
|
PREFIX,
|
|
53
54
|
SESSION_STORAGE_LOGIN_ENCRYPTION_KEY_PAIR,
|
|
54
|
-
SHORT_POLLING_INTERVAL_MS
|
|
55
|
+
SHORT_POLLING_INTERVAL_MS,
|
|
56
|
+
TRANSACTION_REVIEW_TIMEOUT_MS
|
|
55
57
|
};
|
package/dist/types/ParaCore.d.ts
CHANGED
|
@@ -732,7 +732,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
732
732
|
* @param {Object} opts the options object.
|
|
733
733
|
* @param {string} opts.walletId the id of the wallet to sign with.
|
|
734
734
|
* @param {string} opts.messageBase64 the base64 encoding of exact message that should be signed
|
|
735
|
-
* @param {number} [opts.timeout] optional timeout in milliseconds. If not present, defaults to 30 seconds.
|
|
735
|
+
* @param {number} [opts.timeout] optional timeout in milliseconds. If not present, defaults to 30 seconds. Extended to a minimum of 5 minutes when the transaction requires approval.
|
|
736
736
|
* @param {string} [opts.cosmosSignDocBase64] the Cosmos `SignDoc` in base64, if applicable
|
|
737
737
|
**/
|
|
738
738
|
signMessage({ walletId, messageBase64, timeoutMs, cosmosSignDocBase64, isCanceled, onCancel, onPoll, }: CoreMethodParams<'signMessage'>): CoreMethodResponse<'signMessage'>;
|
|
@@ -743,7 +743,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
743
743
|
* @param {string} opts.walletId the id of the wallet to sign with.
|
|
744
744
|
* @param {string} opts.rlpEncodedTxBase64 the transaction to sign, in RLP base64 encoding
|
|
745
745
|
* @param {string} [opts.chainId] the EVM chain id of the chain the transaction is being sent on, if applicable
|
|
746
|
-
* @param {number} [opts.timeoutMs] the amount of time to wait for the user to sign the transaction, in milliseconds
|
|
746
|
+
* @param {number} [opts.timeoutMs] the amount of time to wait for the user to sign the transaction, in milliseconds. Extended to a minimum of 5 minutes when the transaction requires approval.
|
|
747
747
|
**/
|
|
748
748
|
signTransaction({ walletId, rlpEncodedTxBase64, chainId, timeoutMs, isCanceled, onCancel, onPoll, }: CoreMethodParams<'signTransaction'>): CoreMethodResponse<'signTransaction'>;
|
|
749
749
|
protected isProviderModalDisabled(): boolean;
|
|
@@ -22,5 +22,6 @@ export declare const LOCAL_STORAGE_IS_IMPORTED_SESSION = "@CAPSULE/isImportedSes
|
|
|
22
22
|
export declare const POLLING_INTERVAL_MS = 1000;
|
|
23
23
|
export declare const SHORT_POLLING_INTERVAL_MS = 750;
|
|
24
24
|
export declare const POLLING_TIMEOUT_MS = 300000;
|
|
25
|
+
export declare const TRANSACTION_REVIEW_TIMEOUT_MS = 300000;
|
|
25
26
|
export declare const EXTERNAL_WALLET_CONNECTION_ONLY_USER_ID = "EXTERNAL_WALLET_CONNECTION_ONLY";
|
|
26
27
|
export declare const ACCOUNT_LINK_CONFLICT = "Account already linked";
|
|
@@ -57,6 +57,7 @@ export type SignMessageParams = PollingCallbacks & {
|
|
|
57
57
|
messageBase64: string;
|
|
58
58
|
/**
|
|
59
59
|
* The duration in milliseconds to wait before the signing operation times out.
|
|
60
|
+
* Extended to a minimum of 5 minutes when the transaction requires approval.
|
|
60
61
|
*/
|
|
61
62
|
timeoutMs?: number;
|
|
62
63
|
/**
|
|
@@ -83,6 +84,7 @@ export type SignTransactionParams = PollingCallbacks & {
|
|
|
83
84
|
chainId: string;
|
|
84
85
|
/**
|
|
85
86
|
* The duration in milliseconds to wait before the signing operation times out.
|
|
87
|
+
* Extended to a minimum of 5 minutes when the transaction requires approval.
|
|
86
88
|
*/
|
|
87
89
|
timeoutMs?: number;
|
|
88
90
|
/**
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/core-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@celo/utils": "^8.0.2",
|
|
6
6
|
"@cosmjs/encoding": "^0.32.4",
|
|
7
7
|
"@ethereumjs/util": "^9.1.0",
|
|
8
|
-
"@getpara/user-management-client": "2.
|
|
8
|
+
"@getpara/user-management-client": "2.16.0",
|
|
9
9
|
"@noble/hashes": "^1.5.0",
|
|
10
10
|
"base64url": "^3.0.1",
|
|
11
11
|
"libphonenumber-js": "^1.11.7",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dist",
|
|
29
29
|
"package.json"
|
|
30
30
|
],
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "fbe96a062b308d04105213378c12c38ee973c798",
|
|
32
32
|
"main": "dist/cjs/index.js",
|
|
33
33
|
"module": "dist/esm/index.js",
|
|
34
34
|
"scripts": {
|