@getpara/core-sdk 2.30.0 → 2.32.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 +42 -31
- package/dist/cjs/constants.js +1 -1
- package/dist/esm/ParaCore.js +42 -31
- package/dist/esm/constants.js +1 -1
- package/dist/types/ParaCore.d.ts +10 -12
- package/dist/types/types/coreApi.d.ts +0 -6
- package/package.json +3 -3
- package/dist/cjs/utils/deprecation.js +0 -38
- package/dist/esm/utils/deprecation.js +0 -16
- package/dist/types/utils/deprecation.d.ts +0 -1
package/dist/cjs/ParaCore.js
CHANGED
|
@@ -96,7 +96,6 @@ var mpcComputationClient = __toESM(require("./external/mpcComputationClient.js")
|
|
|
96
96
|
var import_types = require("./types/index.js");
|
|
97
97
|
var import_utils2 = require("./utils/index.js");
|
|
98
98
|
var import_stateListener = require("./utils/stateListener.js");
|
|
99
|
-
var import_deprecation = require("./utils/deprecation.js");
|
|
100
99
|
var import_errors = require("./errors.js");
|
|
101
100
|
var constants = __toESM(require("./constants.js"));
|
|
102
101
|
var import_enclave = require("./shares/enclave.js");
|
|
@@ -1478,6 +1477,19 @@ const _ParaCore = class _ParaCore {
|
|
|
1478
1477
|
return yield __privateGet(this, _authService).signExternalWalletVerification(params);
|
|
1479
1478
|
});
|
|
1480
1479
|
}
|
|
1480
|
+
// Direct-to-wallet sign for an external-wallet user who's already authenticated.
|
|
1481
|
+
// The signExternalWalletVerification() path above dispatches a state-machine event
|
|
1482
|
+
// that's only handled from the `awaiting_wallet_signature` state — after login
|
|
1483
|
+
// the machine has moved past that, so the event is silently dropped and the
|
|
1484
|
+
// wallet never gets prompted. The re-auth flow (popup-driven SIWE for export-key
|
|
1485
|
+
// / transaction-review) needs the signature regardless of machine state, so it
|
|
1486
|
+
// routes here and reads the signature back synchronously.
|
|
1487
|
+
signExternalWalletMessageForReauth(params) {
|
|
1488
|
+
return __async(this, null, function* () {
|
|
1489
|
+
const _a = yield __privateGet(this, _externalWalletService).signMessage(params), { signature } = _a, rest = __objRest(_a, ["signature"]);
|
|
1490
|
+
return __spreadValues({ externalWallet: params.externalWallet, signedMessage: signature }, rest);
|
|
1491
|
+
});
|
|
1492
|
+
}
|
|
1481
1493
|
verifyExternalWalletLink(opts) {
|
|
1482
1494
|
return __async(this, null, function* () {
|
|
1483
1495
|
const accountLinkInProgress = __privateMethod(this, _ParaCore_instances, assertIsLinkingAccount_fn).call(this, ["EXTERNAL_WALLET"]);
|
|
@@ -2009,8 +2021,6 @@ const _ParaCore = class _ParaCore {
|
|
|
2009
2021
|
});
|
|
2010
2022
|
}
|
|
2011
2023
|
/**
|
|
2012
|
-
* @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2013
|
-
*
|
|
2014
2024
|
* Creates a new pregenerated wallet.
|
|
2015
2025
|
*
|
|
2016
2026
|
* @param {Object} opts the options object.
|
|
@@ -2021,13 +2031,10 @@ const _ParaCore = class _ParaCore {
|
|
|
2021
2031
|
**/
|
|
2022
2032
|
createPregenWallet(params) {
|
|
2023
2033
|
return __async(this, null, function* () {
|
|
2024
|
-
(0, import_deprecation.warnPregenDeprecation)("createPregenWallet");
|
|
2025
2034
|
return yield __privateGet(this, _pregenWalletService).createPregenWallet(params);
|
|
2026
2035
|
});
|
|
2027
2036
|
}
|
|
2028
2037
|
/**
|
|
2029
|
-
* @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2030
|
-
*
|
|
2031
2038
|
* Creates new pregenerated wallets for each desired type.
|
|
2032
2039
|
* If no types are provided, this method will create one for each of the non-optional types
|
|
2033
2040
|
* specified in the instance's `supportedWalletTypes` array that are not already present.
|
|
@@ -2039,13 +2046,10 @@ const _ParaCore = class _ParaCore {
|
|
|
2039
2046
|
**/
|
|
2040
2047
|
createPregenWalletPerType(params) {
|
|
2041
2048
|
return __async(this, null, function* () {
|
|
2042
|
-
(0, import_deprecation.warnPregenDeprecation)("createPregenWalletPerType");
|
|
2043
2049
|
return yield __privateGet(this, _pregenWalletService).createPregenWalletPerType(params);
|
|
2044
2050
|
});
|
|
2045
2051
|
}
|
|
2046
2052
|
/**
|
|
2047
|
-
* @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2048
|
-
*
|
|
2049
2053
|
* Claims a pregenerated wallet.
|
|
2050
2054
|
* @param {Object} opts the options object.
|
|
2051
2055
|
* @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
|
|
@@ -2054,13 +2058,10 @@ const _ParaCore = class _ParaCore {
|
|
|
2054
2058
|
**/
|
|
2055
2059
|
claimPregenWallets() {
|
|
2056
2060
|
return __async(this, arguments, function* (params = {}) {
|
|
2057
|
-
(0, import_deprecation.warnPregenDeprecation)("claimPregenWallets");
|
|
2058
2061
|
return yield __privateGet(this, _pregenWalletService).claimPregenWallets(params);
|
|
2059
2062
|
});
|
|
2060
2063
|
}
|
|
2061
2064
|
/**
|
|
2062
|
-
* @deprecated Use the REST API (`PATCH /v1/wallets/:id`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2063
|
-
*
|
|
2064
2065
|
* Updates the identifier for a pregen wallet.
|
|
2065
2066
|
* @param {Object} opts the options object.
|
|
2066
2067
|
* @param {string} opts.walletId the pregen wallet ID
|
|
@@ -2069,13 +2070,10 @@ const _ParaCore = class _ParaCore {
|
|
|
2069
2070
|
**/
|
|
2070
2071
|
updatePregenWalletIdentifier(params) {
|
|
2071
2072
|
return __async(this, null, function* () {
|
|
2072
|
-
(0, import_deprecation.warnPregenDeprecation)("updatePregenWalletIdentifier");
|
|
2073
2073
|
return yield __privateGet(this, _pregenWalletService).updatePregenWalletIdentifier(params);
|
|
2074
2074
|
});
|
|
2075
2075
|
}
|
|
2076
2076
|
/**
|
|
2077
|
-
* @deprecated Use the REST API (`GET /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2078
|
-
*
|
|
2079
2077
|
* Checks if a pregen Wallet exists for the given identifier with the current partner.
|
|
2080
2078
|
* @param {Object} opts the options object.
|
|
2081
2079
|
* @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
|
|
@@ -2084,13 +2082,10 @@ const _ParaCore = class _ParaCore {
|
|
|
2084
2082
|
**/
|
|
2085
2083
|
hasPregenWallet(params) {
|
|
2086
2084
|
return __async(this, null, function* () {
|
|
2087
|
-
(0, import_deprecation.warnPregenDeprecation)("hasPregenWallet");
|
|
2088
2085
|
return yield __privateGet(this, _pregenWalletService).hasPregenWallet(params);
|
|
2089
2086
|
});
|
|
2090
2087
|
}
|
|
2091
2088
|
/**
|
|
2092
|
-
* @deprecated Use the REST API (`GET /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2093
|
-
*
|
|
2094
2089
|
* Get pregen wallets for the given identifier.
|
|
2095
2090
|
* @param {Object} opts the options object.
|
|
2096
2091
|
* @param {string} opts.pregenIdentifier - the identifier of the user claiming the wallet
|
|
@@ -2099,7 +2094,6 @@ const _ParaCore = class _ParaCore {
|
|
|
2099
2094
|
**/
|
|
2100
2095
|
getPregenWallets() {
|
|
2101
2096
|
return __async(this, arguments, function* (params = {}) {
|
|
2102
|
-
(0, import_deprecation.warnPregenDeprecation)("getPregenWallets");
|
|
2103
2097
|
return yield __privateGet(this, _pregenWalletService).getPregenWallets(params);
|
|
2104
2098
|
});
|
|
2105
2099
|
}
|
|
@@ -2144,6 +2138,9 @@ const _ParaCore = class _ParaCore {
|
|
|
2144
2138
|
}
|
|
2145
2139
|
getTransactionReviewUrl(transactionId, timeoutMs) {
|
|
2146
2140
|
return __async(this, null, function* () {
|
|
2141
|
+
if (this.isExternalWalletAuth) {
|
|
2142
|
+
yield this.ctx.client.sessionAddPortalVerification();
|
|
2143
|
+
}
|
|
2147
2144
|
const authMethods = yield this.supportedUserAuthMethods();
|
|
2148
2145
|
return this.constructPortalUrl("txReview", {
|
|
2149
2146
|
pathId: transactionId,
|
|
@@ -2833,6 +2830,7 @@ const _ParaCore = class _ParaCore {
|
|
|
2833
2830
|
}
|
|
2834
2831
|
exportPrivateKey() {
|
|
2835
2832
|
return __async(this, arguments, function* (args = {}) {
|
|
2833
|
+
var _a;
|
|
2836
2834
|
let walletId = args == null ? void 0 : args.walletId;
|
|
2837
2835
|
if (!(args == null ? void 0 : args.walletId)) {
|
|
2838
2836
|
walletId = this.findWalletId(void 0, { forbidPregen: true, scheme: ["DKLS", "ED25519"] });
|
|
@@ -2850,18 +2848,31 @@ const _ParaCore = class _ParaCore {
|
|
|
2850
2848
|
if (args.shouldOpenPopup) {
|
|
2851
2849
|
this.popupWindow = yield this.platformUtils.openPopup("about:blank", { type: import_types.PopupType.EXPORT_PRIVATE_KEY });
|
|
2852
2850
|
}
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2851
|
+
try {
|
|
2852
|
+
if (this.isExternalWalletAuth) {
|
|
2853
|
+
yield this.ctx.client.sessionAddPortalVerification();
|
|
2854
|
+
}
|
|
2855
|
+
const authMethods = yield this.supportedUserAuthMethods();
|
|
2856
|
+
const exportPrivateKeyUrl = yield this.constructPortalUrl("exportPrivateKey", {
|
|
2857
|
+
pathId: walletId,
|
|
2858
|
+
useLegacyUrl: authMethods.has(import_user_management_client.AuthMethod.PASSKEY)
|
|
2859
|
+
});
|
|
2860
|
+
if (args.shouldOpenPopup) {
|
|
2861
|
+
this.popupWindow.location.href = exportPrivateKeyUrl;
|
|
2862
|
+
}
|
|
2863
|
+
return {
|
|
2864
|
+
url: exportPrivateKeyUrl,
|
|
2865
|
+
popupWindow: this.popupWindow
|
|
2866
|
+
};
|
|
2867
|
+
} catch (err) {
|
|
2868
|
+
if (args.shouldOpenPopup) {
|
|
2869
|
+
try {
|
|
2870
|
+
(_a = this.popupWindow) == null ? void 0 : _a.close();
|
|
2871
|
+
} catch (e) {
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
throw err;
|
|
2860
2875
|
}
|
|
2861
|
-
return {
|
|
2862
|
-
url: exportPrivateKeyUrl,
|
|
2863
|
-
popupWindow: this.popupWindow
|
|
2864
|
-
};
|
|
2865
2876
|
});
|
|
2866
2877
|
}
|
|
2867
2878
|
};
|
|
@@ -3072,7 +3083,7 @@ waitForLoginProcess_fn = function() {
|
|
|
3072
3083
|
yield this.setupAfterLogin({ temporaryShares: tempSharesRes.data.temporaryShares, skipSessionRefresh });
|
|
3073
3084
|
this.devLog("[waitForLoginProcess] Setup after login complete");
|
|
3074
3085
|
this.devLog("[waitForLoginProcess] Claiming pregen wallets");
|
|
3075
|
-
yield
|
|
3086
|
+
yield this.claimPregenWallets();
|
|
3076
3087
|
this.devLog("[waitForLoginProcess] Pregen wallets claimed");
|
|
3077
3088
|
const resp = {
|
|
3078
3089
|
needsWallet: needsWallet || Object.values(this.wallets).length === 0,
|
package/dist/cjs/constants.js
CHANGED
|
@@ -46,7 +46,7 @@ __export(constants_exports, {
|
|
|
46
46
|
TRANSACTION_REVIEW_TIMEOUT_MS: () => TRANSACTION_REVIEW_TIMEOUT_MS
|
|
47
47
|
});
|
|
48
48
|
module.exports = __toCommonJS(constants_exports);
|
|
49
|
-
const PARA_CORE_VERSION = "2.
|
|
49
|
+
const PARA_CORE_VERSION = "2.32.0";
|
|
50
50
|
const PREFIX = "@CAPSULE/";
|
|
51
51
|
const PARA_PREFIX = "@PARA/";
|
|
52
52
|
const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
|
package/dist/esm/ParaCore.js
CHANGED
|
@@ -49,7 +49,6 @@ import {
|
|
|
49
49
|
isPortal
|
|
50
50
|
} from "./utils/index.js";
|
|
51
51
|
import { waitForAuthStateChange } from "./utils/stateListener.js";
|
|
52
|
-
import { warnPregenDeprecation } from "./utils/deprecation.js";
|
|
53
52
|
import { TransactionReviewDenied, TransactionReviewTimeout } from "./errors.js";
|
|
54
53
|
import * as constants from "./constants.js";
|
|
55
54
|
import { EnclaveClient } from "./shares/enclave.js";
|
|
@@ -1420,6 +1419,19 @@ const _ParaCore = class _ParaCore {
|
|
|
1420
1419
|
return yield __privateGet(this, _authService).signExternalWalletVerification(params);
|
|
1421
1420
|
});
|
|
1422
1421
|
}
|
|
1422
|
+
// Direct-to-wallet sign for an external-wallet user who's already authenticated.
|
|
1423
|
+
// The signExternalWalletVerification() path above dispatches a state-machine event
|
|
1424
|
+
// that's only handled from the `awaiting_wallet_signature` state — after login
|
|
1425
|
+
// the machine has moved past that, so the event is silently dropped and the
|
|
1426
|
+
// wallet never gets prompted. The re-auth flow (popup-driven SIWE for export-key
|
|
1427
|
+
// / transaction-review) needs the signature regardless of machine state, so it
|
|
1428
|
+
// routes here and reads the signature back synchronously.
|
|
1429
|
+
signExternalWalletMessageForReauth(params) {
|
|
1430
|
+
return __async(this, null, function* () {
|
|
1431
|
+
const _a = yield __privateGet(this, _externalWalletService).signMessage(params), { signature } = _a, rest = __objRest(_a, ["signature"]);
|
|
1432
|
+
return __spreadValues({ externalWallet: params.externalWallet, signedMessage: signature }, rest);
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1423
1435
|
verifyExternalWalletLink(opts) {
|
|
1424
1436
|
return __async(this, null, function* () {
|
|
1425
1437
|
const accountLinkInProgress = __privateMethod(this, _ParaCore_instances, assertIsLinkingAccount_fn).call(this, ["EXTERNAL_WALLET"]);
|
|
@@ -1951,8 +1963,6 @@ const _ParaCore = class _ParaCore {
|
|
|
1951
1963
|
});
|
|
1952
1964
|
}
|
|
1953
1965
|
/**
|
|
1954
|
-
* @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
1955
|
-
*
|
|
1956
1966
|
* Creates a new pregenerated wallet.
|
|
1957
1967
|
*
|
|
1958
1968
|
* @param {Object} opts the options object.
|
|
@@ -1963,13 +1973,10 @@ const _ParaCore = class _ParaCore {
|
|
|
1963
1973
|
**/
|
|
1964
1974
|
createPregenWallet(params) {
|
|
1965
1975
|
return __async(this, null, function* () {
|
|
1966
|
-
warnPregenDeprecation("createPregenWallet");
|
|
1967
1976
|
return yield __privateGet(this, _pregenWalletService).createPregenWallet(params);
|
|
1968
1977
|
});
|
|
1969
1978
|
}
|
|
1970
1979
|
/**
|
|
1971
|
-
* @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
1972
|
-
*
|
|
1973
1980
|
* Creates new pregenerated wallets for each desired type.
|
|
1974
1981
|
* If no types are provided, this method will create one for each of the non-optional types
|
|
1975
1982
|
* specified in the instance's `supportedWalletTypes` array that are not already present.
|
|
@@ -1981,13 +1988,10 @@ const _ParaCore = class _ParaCore {
|
|
|
1981
1988
|
**/
|
|
1982
1989
|
createPregenWalletPerType(params) {
|
|
1983
1990
|
return __async(this, null, function* () {
|
|
1984
|
-
warnPregenDeprecation("createPregenWalletPerType");
|
|
1985
1991
|
return yield __privateGet(this, _pregenWalletService).createPregenWalletPerType(params);
|
|
1986
1992
|
});
|
|
1987
1993
|
}
|
|
1988
1994
|
/**
|
|
1989
|
-
* @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
1990
|
-
*
|
|
1991
1995
|
* Claims a pregenerated wallet.
|
|
1992
1996
|
* @param {Object} opts the options object.
|
|
1993
1997
|
* @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
|
|
@@ -1996,13 +2000,10 @@ const _ParaCore = class _ParaCore {
|
|
|
1996
2000
|
**/
|
|
1997
2001
|
claimPregenWallets() {
|
|
1998
2002
|
return __async(this, arguments, function* (params = {}) {
|
|
1999
|
-
warnPregenDeprecation("claimPregenWallets");
|
|
2000
2003
|
return yield __privateGet(this, _pregenWalletService).claimPregenWallets(params);
|
|
2001
2004
|
});
|
|
2002
2005
|
}
|
|
2003
2006
|
/**
|
|
2004
|
-
* @deprecated Use the REST API (`PATCH /v1/wallets/:id`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2005
|
-
*
|
|
2006
2007
|
* Updates the identifier for a pregen wallet.
|
|
2007
2008
|
* @param {Object} opts the options object.
|
|
2008
2009
|
* @param {string} opts.walletId the pregen wallet ID
|
|
@@ -2011,13 +2012,10 @@ const _ParaCore = class _ParaCore {
|
|
|
2011
2012
|
**/
|
|
2012
2013
|
updatePregenWalletIdentifier(params) {
|
|
2013
2014
|
return __async(this, null, function* () {
|
|
2014
|
-
warnPregenDeprecation("updatePregenWalletIdentifier");
|
|
2015
2015
|
return yield __privateGet(this, _pregenWalletService).updatePregenWalletIdentifier(params);
|
|
2016
2016
|
});
|
|
2017
2017
|
}
|
|
2018
2018
|
/**
|
|
2019
|
-
* @deprecated Use the REST API (`GET /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2020
|
-
*
|
|
2021
2019
|
* Checks if a pregen Wallet exists for the given identifier with the current partner.
|
|
2022
2020
|
* @param {Object} opts the options object.
|
|
2023
2021
|
* @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
|
|
@@ -2026,13 +2024,10 @@ const _ParaCore = class _ParaCore {
|
|
|
2026
2024
|
**/
|
|
2027
2025
|
hasPregenWallet(params) {
|
|
2028
2026
|
return __async(this, null, function* () {
|
|
2029
|
-
warnPregenDeprecation("hasPregenWallet");
|
|
2030
2027
|
return yield __privateGet(this, _pregenWalletService).hasPregenWallet(params);
|
|
2031
2028
|
});
|
|
2032
2029
|
}
|
|
2033
2030
|
/**
|
|
2034
|
-
* @deprecated Use the REST API (`GET /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2035
|
-
*
|
|
2036
2031
|
* Get pregen wallets for the given identifier.
|
|
2037
2032
|
* @param {Object} opts the options object.
|
|
2038
2033
|
* @param {string} opts.pregenIdentifier - the identifier of the user claiming the wallet
|
|
@@ -2041,7 +2036,6 @@ const _ParaCore = class _ParaCore {
|
|
|
2041
2036
|
**/
|
|
2042
2037
|
getPregenWallets() {
|
|
2043
2038
|
return __async(this, arguments, function* (params = {}) {
|
|
2044
|
-
warnPregenDeprecation("getPregenWallets");
|
|
2045
2039
|
return yield __privateGet(this, _pregenWalletService).getPregenWallets(params);
|
|
2046
2040
|
});
|
|
2047
2041
|
}
|
|
@@ -2086,6 +2080,9 @@ const _ParaCore = class _ParaCore {
|
|
|
2086
2080
|
}
|
|
2087
2081
|
getTransactionReviewUrl(transactionId, timeoutMs) {
|
|
2088
2082
|
return __async(this, null, function* () {
|
|
2083
|
+
if (this.isExternalWalletAuth) {
|
|
2084
|
+
yield this.ctx.client.sessionAddPortalVerification();
|
|
2085
|
+
}
|
|
2089
2086
|
const authMethods = yield this.supportedUserAuthMethods();
|
|
2090
2087
|
return this.constructPortalUrl("txReview", {
|
|
2091
2088
|
pathId: transactionId,
|
|
@@ -2775,6 +2772,7 @@ const _ParaCore = class _ParaCore {
|
|
|
2775
2772
|
}
|
|
2776
2773
|
exportPrivateKey() {
|
|
2777
2774
|
return __async(this, arguments, function* (args = {}) {
|
|
2775
|
+
var _a;
|
|
2778
2776
|
let walletId = args == null ? void 0 : args.walletId;
|
|
2779
2777
|
if (!(args == null ? void 0 : args.walletId)) {
|
|
2780
2778
|
walletId = this.findWalletId(void 0, { forbidPregen: true, scheme: ["DKLS", "ED25519"] });
|
|
@@ -2792,18 +2790,31 @@ const _ParaCore = class _ParaCore {
|
|
|
2792
2790
|
if (args.shouldOpenPopup) {
|
|
2793
2791
|
this.popupWindow = yield this.platformUtils.openPopup("about:blank", { type: PopupType.EXPORT_PRIVATE_KEY });
|
|
2794
2792
|
}
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2793
|
+
try {
|
|
2794
|
+
if (this.isExternalWalletAuth) {
|
|
2795
|
+
yield this.ctx.client.sessionAddPortalVerification();
|
|
2796
|
+
}
|
|
2797
|
+
const authMethods = yield this.supportedUserAuthMethods();
|
|
2798
|
+
const exportPrivateKeyUrl = yield this.constructPortalUrl("exportPrivateKey", {
|
|
2799
|
+
pathId: walletId,
|
|
2800
|
+
useLegacyUrl: authMethods.has(AuthMethod.PASSKEY)
|
|
2801
|
+
});
|
|
2802
|
+
if (args.shouldOpenPopup) {
|
|
2803
|
+
this.popupWindow.location.href = exportPrivateKeyUrl;
|
|
2804
|
+
}
|
|
2805
|
+
return {
|
|
2806
|
+
url: exportPrivateKeyUrl,
|
|
2807
|
+
popupWindow: this.popupWindow
|
|
2808
|
+
};
|
|
2809
|
+
} catch (err) {
|
|
2810
|
+
if (args.shouldOpenPopup) {
|
|
2811
|
+
try {
|
|
2812
|
+
(_a = this.popupWindow) == null ? void 0 : _a.close();
|
|
2813
|
+
} catch (e) {
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
throw err;
|
|
2802
2817
|
}
|
|
2803
|
-
return {
|
|
2804
|
-
url: exportPrivateKeyUrl,
|
|
2805
|
-
popupWindow: this.popupWindow
|
|
2806
|
-
};
|
|
2807
2818
|
});
|
|
2808
2819
|
}
|
|
2809
2820
|
};
|
|
@@ -3014,7 +3025,7 @@ waitForLoginProcess_fn = function() {
|
|
|
3014
3025
|
yield this.setupAfterLogin({ temporaryShares: tempSharesRes.data.temporaryShares, skipSessionRefresh });
|
|
3015
3026
|
this.devLog("[waitForLoginProcess] Setup after login complete");
|
|
3016
3027
|
this.devLog("[waitForLoginProcess] Claiming pregen wallets");
|
|
3017
|
-
yield
|
|
3028
|
+
yield this.claimPregenWallets();
|
|
3018
3029
|
this.devLog("[waitForLoginProcess] Pregen wallets claimed");
|
|
3019
3030
|
const resp = {
|
|
3020
3031
|
needsWallet: needsWallet || Object.values(this.wallets).length === 0,
|
package/dist/esm/constants.js
CHANGED
package/dist/types/ParaCore.d.ts
CHANGED
|
@@ -458,6 +458,16 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
458
458
|
verifyExternalWallet(params: VerifyExternalWalletParams): Promise<import("./services/types").VerifyExternalWalletResponse>;
|
|
459
459
|
retryVerifyExternalWallet(): Promise<import("./services/types").VerifyExternalWalletResponse>;
|
|
460
460
|
signExternalWalletVerification(params: ExternalSignMessageParams): Promise<import("./services/types").BaseVerifyExternalWalletParams>;
|
|
461
|
+
signExternalWalletMessageForReauth(params: ExternalSignMessageParams & {
|
|
462
|
+
externalWallet: ExternalWalletInfo;
|
|
463
|
+
}): Promise<{
|
|
464
|
+
address: string;
|
|
465
|
+
cosmosPublicKeyHex?: string;
|
|
466
|
+
cosmosSigner?: string;
|
|
467
|
+
addressBech32?: string;
|
|
468
|
+
externalWallet: ExternalWalletInfo;
|
|
469
|
+
signedMessage: string;
|
|
470
|
+
}>;
|
|
461
471
|
protected verifyExternalWalletLink(opts: InternalMethodParams<'verifyExternalWalletLink'>): InternalMethodResponse<'verifyExternalWalletLink'>;
|
|
462
472
|
protected verifyTelegramProcess(opts: VerifyTelegramParams & {
|
|
463
473
|
isLinkAccount: false;
|
|
@@ -658,8 +668,6 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
658
668
|
**/
|
|
659
669
|
createWallet(params?: CreateWalletParams): Promise<import("./services/types").CreateWalletResponse>;
|
|
660
670
|
/**
|
|
661
|
-
* @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
662
|
-
*
|
|
663
671
|
* Creates a new pregenerated wallet.
|
|
664
672
|
*
|
|
665
673
|
* @param {Object} opts the options object.
|
|
@@ -670,8 +678,6 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
670
678
|
**/
|
|
671
679
|
createPregenWallet(params: CreatePregenWalletParams): Promise<Wallet>;
|
|
672
680
|
/**
|
|
673
|
-
* @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
674
|
-
*
|
|
675
681
|
* Creates new pregenerated wallets for each desired type.
|
|
676
682
|
* If no types are provided, this method will create one for each of the non-optional types
|
|
677
683
|
* specified in the instance's `supportedWalletTypes` array that are not already present.
|
|
@@ -683,8 +689,6 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
683
689
|
**/
|
|
684
690
|
createPregenWalletPerType(params: CreatePregenWalletPerTypeParams): Promise<import("./services/types").CreatePregenWalletPerTypeResponse>;
|
|
685
691
|
/**
|
|
686
|
-
* @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
687
|
-
*
|
|
688
692
|
* Claims a pregenerated wallet.
|
|
689
693
|
* @param {Object} opts the options object.
|
|
690
694
|
* @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
|
|
@@ -693,8 +697,6 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
693
697
|
**/
|
|
694
698
|
claimPregenWallets(params?: ClaimPregenWalletsParams): Promise<string>;
|
|
695
699
|
/**
|
|
696
|
-
* @deprecated Use the REST API (`PATCH /v1/wallets/:id`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
697
|
-
*
|
|
698
700
|
* Updates the identifier for a pregen wallet.
|
|
699
701
|
* @param {Object} opts the options object.
|
|
700
702
|
* @param {string} opts.walletId the pregen wallet ID
|
|
@@ -703,8 +705,6 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
703
705
|
**/
|
|
704
706
|
updatePregenWalletIdentifier(params: UpdatePregenWalletIdentifierParams): Promise<void>;
|
|
705
707
|
/**
|
|
706
|
-
* @deprecated Use the REST API (`GET /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
707
|
-
*
|
|
708
708
|
* Checks if a pregen Wallet exists for the given identifier with the current partner.
|
|
709
709
|
* @param {Object} opts the options object.
|
|
710
710
|
* @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
|
|
@@ -713,8 +713,6 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
713
713
|
**/
|
|
714
714
|
hasPregenWallet(params: HasPregenWalletParams): Promise<boolean>;
|
|
715
715
|
/**
|
|
716
|
-
* @deprecated Use the REST API (`GET /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
717
|
-
*
|
|
718
716
|
* Get pregen wallets for the given identifier.
|
|
719
717
|
* @param {Object} opts the options object.
|
|
720
718
|
* @param {string} opts.pregenIdentifier - the identifier of the user claiming the wallet
|
|
@@ -278,32 +278,26 @@ export type CoreMethods = Record<CoreMethodName, {
|
|
|
278
278
|
params: CreateWalletPerTypeParams;
|
|
279
279
|
response: CreateWalletPerTypeResponse;
|
|
280
280
|
};
|
|
281
|
-
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
282
281
|
getPregenWallets: {
|
|
283
282
|
params: GetPregenWalletsParams;
|
|
284
283
|
response: GetPregenWalletsResponse;
|
|
285
284
|
};
|
|
286
|
-
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
287
285
|
updatePregenWalletIdentifier: {
|
|
288
286
|
params: UpdatePregenWalletIdentifierParams;
|
|
289
287
|
response: void;
|
|
290
288
|
};
|
|
291
|
-
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
292
289
|
hasPregenWallet: {
|
|
293
290
|
params: HasPregenWalletParams;
|
|
294
291
|
response: boolean;
|
|
295
292
|
};
|
|
296
|
-
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
297
293
|
createPregenWallet: {
|
|
298
294
|
params: CreatePregenWalletParams;
|
|
299
295
|
response: CreatePregenWalletResponse;
|
|
300
296
|
};
|
|
301
|
-
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
302
297
|
createPregenWalletPerType: {
|
|
303
298
|
params: CreatePregenWalletPerTypeParams;
|
|
304
299
|
response: CreatePregenWalletPerTypeResponse;
|
|
305
300
|
};
|
|
306
|
-
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
307
301
|
claimPregenWallets: {
|
|
308
302
|
params: ClaimPregenWalletsParams;
|
|
309
303
|
response: ClaimPregenWalletsResponse;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/core-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.32.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.32.0",
|
|
9
9
|
"@noble/hashes": "^1.5.0",
|
|
10
10
|
"axios": "^1.8.4",
|
|
11
11
|
"base64url": "^3.0.1",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dist",
|
|
31
31
|
"package.json"
|
|
32
32
|
],
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "35634005629d40f7c4423127799c63d3f73b825c",
|
|
34
34
|
"main": "dist/cjs/index.js",
|
|
35
35
|
"module": "dist/esm/index.js",
|
|
36
36
|
"scripts": {
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var deprecation_exports = {};
|
|
19
|
-
__export(deprecation_exports, {
|
|
20
|
-
warnPregenDeprecation: () => warnPregenDeprecation
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(deprecation_exports);
|
|
23
|
-
const MIGRATION_GUIDE_URL = "https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen";
|
|
24
|
-
const warned = /* @__PURE__ */ new Set();
|
|
25
|
-
function warnPregenDeprecation(methodName) {
|
|
26
|
-
if (warned.has(methodName)) return;
|
|
27
|
-
warned.add(methodName);
|
|
28
|
-
console.warn(
|
|
29
|
-
`[Para] ${methodName}() is deprecated and will be removed in a future release.
|
|
30
|
-
\u2192 New integrations: use the REST API instead
|
|
31
|
-
\u2192 Existing wallets: use para.migrateWalletShare() to migrate
|
|
32
|
-
\u2192 Guide: ${MIGRATION_GUIDE_URL}`
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
-
0 && (module.exports = {
|
|
37
|
-
warnPregenDeprecation
|
|
38
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import "../chunk-7B52C2XE.js";
|
|
2
|
-
const MIGRATION_GUIDE_URL = "https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen";
|
|
3
|
-
const warned = /* @__PURE__ */ new Set();
|
|
4
|
-
function warnPregenDeprecation(methodName) {
|
|
5
|
-
if (warned.has(methodName)) return;
|
|
6
|
-
warned.add(methodName);
|
|
7
|
-
console.warn(
|
|
8
|
-
`[Para] ${methodName}() is deprecated and will be removed in a future release.
|
|
9
|
-
\u2192 New integrations: use the REST API instead
|
|
10
|
-
\u2192 Existing wallets: use para.migrateWalletShare() to migrate
|
|
11
|
-
\u2192 Guide: ${MIGRATION_GUIDE_URL}`
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
warnPregenDeprecation
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function warnPregenDeprecation(methodName: string): void;
|