@getpara/core-sdk 2.21.0 → 2.22.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 +21 -2
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/types/signer.js +15 -0
- package/dist/cjs/utils/deprecation.js +38 -0
- package/dist/esm/ParaCore.js +21 -2
- package/dist/esm/constants.js +1 -1
- package/dist/esm/types/signer.js +0 -0
- package/dist/esm/utils/deprecation.js +16 -0
- package/dist/types/ParaCore.d.ts +13 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types/coreApi.d.ts +6 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/signer.d.ts +13 -0
- package/dist/types/utils/deprecation.d.ts +1 -0
- package/package.json +3 -3
package/dist/cjs/ParaCore.js
CHANGED
|
@@ -96,6 +96,7 @@ 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");
|
|
99
100
|
var import_errors = require("./errors.js");
|
|
100
101
|
var constants = __toESM(require("./constants.js"));
|
|
101
102
|
var import_enclave = require("./shares/enclave.js");
|
|
@@ -1999,6 +2000,8 @@ const _ParaCore = class _ParaCore {
|
|
|
1999
2000
|
});
|
|
2000
2001
|
}
|
|
2001
2002
|
/**
|
|
2003
|
+
* @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2004
|
+
*
|
|
2002
2005
|
* Creates a new pregenerated wallet.
|
|
2003
2006
|
*
|
|
2004
2007
|
* @param {Object} opts the options object.
|
|
@@ -2009,10 +2012,13 @@ const _ParaCore = class _ParaCore {
|
|
|
2009
2012
|
**/
|
|
2010
2013
|
createPregenWallet(params) {
|
|
2011
2014
|
return __async(this, null, function* () {
|
|
2015
|
+
(0, import_deprecation.warnPregenDeprecation)("createPregenWallet");
|
|
2012
2016
|
return yield __privateGet(this, _pregenWalletService).createPregenWallet(params);
|
|
2013
2017
|
});
|
|
2014
2018
|
}
|
|
2015
2019
|
/**
|
|
2020
|
+
* @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2021
|
+
*
|
|
2016
2022
|
* Creates new pregenerated wallets for each desired type.
|
|
2017
2023
|
* If no types are provided, this method will create one for each of the non-optional types
|
|
2018
2024
|
* specified in the instance's `supportedWalletTypes` array that are not already present.
|
|
@@ -2024,10 +2030,13 @@ const _ParaCore = class _ParaCore {
|
|
|
2024
2030
|
**/
|
|
2025
2031
|
createPregenWalletPerType(params) {
|
|
2026
2032
|
return __async(this, null, function* () {
|
|
2033
|
+
(0, import_deprecation.warnPregenDeprecation)("createPregenWalletPerType");
|
|
2027
2034
|
return yield __privateGet(this, _pregenWalletService).createPregenWalletPerType(params);
|
|
2028
2035
|
});
|
|
2029
2036
|
}
|
|
2030
2037
|
/**
|
|
2038
|
+
* @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2039
|
+
*
|
|
2031
2040
|
* Claims a pregenerated wallet.
|
|
2032
2041
|
* @param {Object} opts the options object.
|
|
2033
2042
|
* @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
|
|
@@ -2036,10 +2045,13 @@ const _ParaCore = class _ParaCore {
|
|
|
2036
2045
|
**/
|
|
2037
2046
|
claimPregenWallets() {
|
|
2038
2047
|
return __async(this, arguments, function* (params = {}) {
|
|
2048
|
+
(0, import_deprecation.warnPregenDeprecation)("claimPregenWallets");
|
|
2039
2049
|
return yield __privateGet(this, _pregenWalletService).claimPregenWallets(params);
|
|
2040
2050
|
});
|
|
2041
2051
|
}
|
|
2042
2052
|
/**
|
|
2053
|
+
* @deprecated Use the REST API (`PATCH /v1/wallets/:id`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2054
|
+
*
|
|
2043
2055
|
* Updates the identifier for a pregen wallet.
|
|
2044
2056
|
* @param {Object} opts the options object.
|
|
2045
2057
|
* @param {string} opts.walletId the pregen wallet ID
|
|
@@ -2048,10 +2060,13 @@ const _ParaCore = class _ParaCore {
|
|
|
2048
2060
|
**/
|
|
2049
2061
|
updatePregenWalletIdentifier(params) {
|
|
2050
2062
|
return __async(this, null, function* () {
|
|
2063
|
+
(0, import_deprecation.warnPregenDeprecation)("updatePregenWalletIdentifier");
|
|
2051
2064
|
return yield __privateGet(this, _pregenWalletService).updatePregenWalletIdentifier(params);
|
|
2052
2065
|
});
|
|
2053
2066
|
}
|
|
2054
2067
|
/**
|
|
2068
|
+
* @deprecated Use the REST API (`GET /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2069
|
+
*
|
|
2055
2070
|
* Checks if a pregen Wallet exists for the given identifier with the current partner.
|
|
2056
2071
|
* @param {Object} opts the options object.
|
|
2057
2072
|
* @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
|
|
@@ -2060,10 +2075,13 @@ const _ParaCore = class _ParaCore {
|
|
|
2060
2075
|
**/
|
|
2061
2076
|
hasPregenWallet(params) {
|
|
2062
2077
|
return __async(this, null, function* () {
|
|
2078
|
+
(0, import_deprecation.warnPregenDeprecation)("hasPregenWallet");
|
|
2063
2079
|
return yield __privateGet(this, _pregenWalletService).hasPregenWallet(params);
|
|
2064
2080
|
});
|
|
2065
2081
|
}
|
|
2066
2082
|
/**
|
|
2083
|
+
* @deprecated Use the REST API (`GET /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2084
|
+
*
|
|
2067
2085
|
* Get pregen wallets for the given identifier.
|
|
2068
2086
|
* @param {Object} opts the options object.
|
|
2069
2087
|
* @param {string} opts.pregenIdentifier - the identifier of the user claiming the wallet
|
|
@@ -2072,6 +2090,7 @@ const _ParaCore = class _ParaCore {
|
|
|
2072
2090
|
**/
|
|
2073
2091
|
getPregenWallets() {
|
|
2074
2092
|
return __async(this, arguments, function* (params = {}) {
|
|
2093
|
+
(0, import_deprecation.warnPregenDeprecation)("getPregenWallets");
|
|
2075
2094
|
return yield __privateGet(this, _pregenWalletService).getPregenWallets(params);
|
|
2076
2095
|
});
|
|
2077
2096
|
}
|
|
@@ -2778,7 +2797,7 @@ const _ParaCore = class _ParaCore {
|
|
|
2778
2797
|
return __async(this, arguments, function* ({ config, refetch = false } = {}) {
|
|
2779
2798
|
const { balance } = yield this.ctx.client.getProfileBalance({
|
|
2780
2799
|
config,
|
|
2781
|
-
wallets: this.availableWallets.filter(({ type }) => type !== "COSMOS").map(({ type, address }) => ({ type, address })),
|
|
2800
|
+
wallets: this.availableWallets.filter(({ type }) => type !== "COSMOS" && type !== "STELLAR").map(({ type, address }) => ({ type, address })),
|
|
2782
2801
|
refetch
|
|
2783
2802
|
});
|
|
2784
2803
|
return balance;
|
|
@@ -3034,7 +3053,7 @@ waitForLoginProcess_fn = function() {
|
|
|
3034
3053
|
yield this.setupAfterLogin({ temporaryShares: tempSharesRes.data.temporaryShares, skipSessionRefresh });
|
|
3035
3054
|
this.devLog("[waitForLoginProcess] Setup after login complete");
|
|
3036
3055
|
this.devLog("[waitForLoginProcess] Claiming pregen wallets");
|
|
3037
|
-
yield this.claimPregenWallets();
|
|
3056
|
+
yield __privateGet(this, _pregenWalletService).claimPregenWallets();
|
|
3038
3057
|
this.devLog("[waitForLoginProcess] Pregen wallets claimed");
|
|
3039
3058
|
const resp = {
|
|
3040
3059
|
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.22.0";
|
|
50
50
|
const PREFIX = "@CAPSULE/";
|
|
51
51
|
const PARA_PREFIX = "@PARA/";
|
|
52
52
|
const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var signer_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(signer_exports);
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
});
|
package/dist/esm/ParaCore.js
CHANGED
|
@@ -49,6 +49,7 @@ 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";
|
|
52
53
|
import { TransactionReviewDenied, TransactionReviewTimeout } from "./errors.js";
|
|
53
54
|
import * as constants from "./constants.js";
|
|
54
55
|
import { EnclaveClient } from "./shares/enclave.js";
|
|
@@ -1941,6 +1942,8 @@ const _ParaCore = class _ParaCore {
|
|
|
1941
1942
|
});
|
|
1942
1943
|
}
|
|
1943
1944
|
/**
|
|
1945
|
+
* @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
1946
|
+
*
|
|
1944
1947
|
* Creates a new pregenerated wallet.
|
|
1945
1948
|
*
|
|
1946
1949
|
* @param {Object} opts the options object.
|
|
@@ -1951,10 +1954,13 @@ const _ParaCore = class _ParaCore {
|
|
|
1951
1954
|
**/
|
|
1952
1955
|
createPregenWallet(params) {
|
|
1953
1956
|
return __async(this, null, function* () {
|
|
1957
|
+
warnPregenDeprecation("createPregenWallet");
|
|
1954
1958
|
return yield __privateGet(this, _pregenWalletService).createPregenWallet(params);
|
|
1955
1959
|
});
|
|
1956
1960
|
}
|
|
1957
1961
|
/**
|
|
1962
|
+
* @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
1963
|
+
*
|
|
1958
1964
|
* Creates new pregenerated wallets for each desired type.
|
|
1959
1965
|
* If no types are provided, this method will create one for each of the non-optional types
|
|
1960
1966
|
* specified in the instance's `supportedWalletTypes` array that are not already present.
|
|
@@ -1966,10 +1972,13 @@ const _ParaCore = class _ParaCore {
|
|
|
1966
1972
|
**/
|
|
1967
1973
|
createPregenWalletPerType(params) {
|
|
1968
1974
|
return __async(this, null, function* () {
|
|
1975
|
+
warnPregenDeprecation("createPregenWalletPerType");
|
|
1969
1976
|
return yield __privateGet(this, _pregenWalletService).createPregenWalletPerType(params);
|
|
1970
1977
|
});
|
|
1971
1978
|
}
|
|
1972
1979
|
/**
|
|
1980
|
+
* @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
1981
|
+
*
|
|
1973
1982
|
* Claims a pregenerated wallet.
|
|
1974
1983
|
* @param {Object} opts the options object.
|
|
1975
1984
|
* @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
|
|
@@ -1978,10 +1987,13 @@ const _ParaCore = class _ParaCore {
|
|
|
1978
1987
|
**/
|
|
1979
1988
|
claimPregenWallets() {
|
|
1980
1989
|
return __async(this, arguments, function* (params = {}) {
|
|
1990
|
+
warnPregenDeprecation("claimPregenWallets");
|
|
1981
1991
|
return yield __privateGet(this, _pregenWalletService).claimPregenWallets(params);
|
|
1982
1992
|
});
|
|
1983
1993
|
}
|
|
1984
1994
|
/**
|
|
1995
|
+
* @deprecated Use the REST API (`PATCH /v1/wallets/:id`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
1996
|
+
*
|
|
1985
1997
|
* Updates the identifier for a pregen wallet.
|
|
1986
1998
|
* @param {Object} opts the options object.
|
|
1987
1999
|
* @param {string} opts.walletId the pregen wallet ID
|
|
@@ -1990,10 +2002,13 @@ const _ParaCore = class _ParaCore {
|
|
|
1990
2002
|
**/
|
|
1991
2003
|
updatePregenWalletIdentifier(params) {
|
|
1992
2004
|
return __async(this, null, function* () {
|
|
2005
|
+
warnPregenDeprecation("updatePregenWalletIdentifier");
|
|
1993
2006
|
return yield __privateGet(this, _pregenWalletService).updatePregenWalletIdentifier(params);
|
|
1994
2007
|
});
|
|
1995
2008
|
}
|
|
1996
2009
|
/**
|
|
2010
|
+
* @deprecated Use the REST API (`GET /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2011
|
+
*
|
|
1997
2012
|
* Checks if a pregen Wallet exists for the given identifier with the current partner.
|
|
1998
2013
|
* @param {Object} opts the options object.
|
|
1999
2014
|
* @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
|
|
@@ -2002,10 +2017,13 @@ const _ParaCore = class _ParaCore {
|
|
|
2002
2017
|
**/
|
|
2003
2018
|
hasPregenWallet(params) {
|
|
2004
2019
|
return __async(this, null, function* () {
|
|
2020
|
+
warnPregenDeprecation("hasPregenWallet");
|
|
2005
2021
|
return yield __privateGet(this, _pregenWalletService).hasPregenWallet(params);
|
|
2006
2022
|
});
|
|
2007
2023
|
}
|
|
2008
2024
|
/**
|
|
2025
|
+
* @deprecated Use the REST API (`GET /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
|
|
2026
|
+
*
|
|
2009
2027
|
* Get pregen wallets for the given identifier.
|
|
2010
2028
|
* @param {Object} opts the options object.
|
|
2011
2029
|
* @param {string} opts.pregenIdentifier - the identifier of the user claiming the wallet
|
|
@@ -2014,6 +2032,7 @@ const _ParaCore = class _ParaCore {
|
|
|
2014
2032
|
**/
|
|
2015
2033
|
getPregenWallets() {
|
|
2016
2034
|
return __async(this, arguments, function* (params = {}) {
|
|
2035
|
+
warnPregenDeprecation("getPregenWallets");
|
|
2017
2036
|
return yield __privateGet(this, _pregenWalletService).getPregenWallets(params);
|
|
2018
2037
|
});
|
|
2019
2038
|
}
|
|
@@ -2720,7 +2739,7 @@ const _ParaCore = class _ParaCore {
|
|
|
2720
2739
|
return __async(this, arguments, function* ({ config, refetch = false } = {}) {
|
|
2721
2740
|
const { balance } = yield this.ctx.client.getProfileBalance({
|
|
2722
2741
|
config,
|
|
2723
|
-
wallets: this.availableWallets.filter(({ type }) => type !== "COSMOS").map(({ type, address }) => ({ type, address })),
|
|
2742
|
+
wallets: this.availableWallets.filter(({ type }) => type !== "COSMOS" && type !== "STELLAR").map(({ type, address }) => ({ type, address })),
|
|
2724
2743
|
refetch
|
|
2725
2744
|
});
|
|
2726
2745
|
return balance;
|
|
@@ -2976,7 +2995,7 @@ waitForLoginProcess_fn = function() {
|
|
|
2976
2995
|
yield this.setupAfterLogin({ temporaryShares: tempSharesRes.data.temporaryShares, skipSessionRefresh });
|
|
2977
2996
|
this.devLog("[waitForLoginProcess] Setup after login complete");
|
|
2978
2997
|
this.devLog("[waitForLoginProcess] Claiming pregen wallets");
|
|
2979
|
-
yield this.claimPregenWallets();
|
|
2998
|
+
yield __privateGet(this, _pregenWalletService).claimPregenWallets();
|
|
2980
2999
|
this.devLog("[waitForLoginProcess] Pregen wallets claimed");
|
|
2981
3000
|
const resp = {
|
|
2982
3001
|
needsWallet: needsWallet || Object.values(this.wallets).length === 0,
|
package/dist/esm/constants.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
};
|
package/dist/types/ParaCore.d.ts
CHANGED
|
@@ -291,7 +291,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
291
291
|
private updateSessionCookieFromStorage;
|
|
292
292
|
private updateLoginEncryptionKeyPairFromStorage;
|
|
293
293
|
private updateExternalWalletsFromStorage;
|
|
294
|
-
|
|
294
|
+
initializeWorker: () => Promise<void>;
|
|
295
295
|
touchSession(regenerate?: boolean): Promise<SessionInfo>;
|
|
296
296
|
private getVerificationEmailProps;
|
|
297
297
|
private getBackupKitEmailProps;
|
|
@@ -658,6 +658,8 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
658
658
|
**/
|
|
659
659
|
createWallet(params?: CreateWalletParams): Promise<import("./services/types").CreateWalletResponse>;
|
|
660
660
|
/**
|
|
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
|
+
*
|
|
661
663
|
* Creates a new pregenerated wallet.
|
|
662
664
|
*
|
|
663
665
|
* @param {Object} opts the options object.
|
|
@@ -668,6 +670,8 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
668
670
|
**/
|
|
669
671
|
createPregenWallet(params: CreatePregenWalletParams): Promise<Wallet>;
|
|
670
672
|
/**
|
|
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
|
+
*
|
|
671
675
|
* Creates new pregenerated wallets for each desired type.
|
|
672
676
|
* If no types are provided, this method will create one for each of the non-optional types
|
|
673
677
|
* specified in the instance's `supportedWalletTypes` array that are not already present.
|
|
@@ -679,6 +683,8 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
679
683
|
**/
|
|
680
684
|
createPregenWalletPerType(params: CreatePregenWalletPerTypeParams): Promise<import("./services/types").CreatePregenWalletPerTypeResponse>;
|
|
681
685
|
/**
|
|
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
|
+
*
|
|
682
688
|
* Claims a pregenerated wallet.
|
|
683
689
|
* @param {Object} opts the options object.
|
|
684
690
|
* @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
|
|
@@ -687,6 +693,8 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
687
693
|
**/
|
|
688
694
|
claimPregenWallets(params?: ClaimPregenWalletsParams): Promise<string>;
|
|
689
695
|
/**
|
|
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
|
+
*
|
|
690
698
|
* Updates the identifier for a pregen wallet.
|
|
691
699
|
* @param {Object} opts the options object.
|
|
692
700
|
* @param {string} opts.walletId the pregen wallet ID
|
|
@@ -695,6 +703,8 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
695
703
|
**/
|
|
696
704
|
updatePregenWalletIdentifier(params: UpdatePregenWalletIdentifierParams): Promise<void>;
|
|
697
705
|
/**
|
|
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
|
+
*
|
|
698
708
|
* Checks if a pregen Wallet exists for the given identifier with the current partner.
|
|
699
709
|
* @param {Object} opts the options object.
|
|
700
710
|
* @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
|
|
@@ -703,6 +713,8 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
703
713
|
**/
|
|
704
714
|
hasPregenWallet(params: HasPregenWalletParams): Promise<boolean>;
|
|
705
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
|
+
*
|
|
706
718
|
* Get pregen wallets for the given identifier.
|
|
707
719
|
* @param {Object} opts the options object.
|
|
708
720
|
* @param {string} opts.pregenIdentifier - the identifier of the user claiming the wallet
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ParaCore } from './ParaCore.js';
|
|
2
2
|
export { type Auth, type AuthInfo, type PrimaryAuthInfo, type VerifiedAuthInfo, type VerifiedAuth, AuthMethod, type TAuthMethod, AuthMethodStatus, type AuthExtras, type CurrentWalletIds, EmailTheme, type PartnerEntity, type WalletEntity, Network, type TNetwork, WalletType, type TWalletType, WalletScheme, type TWalletScheme, OnRampAsset, type TOnRampAsset, OnRampPurchaseType, OnRampProvider, OnRampPurchaseStatus, type OnRampConfig, type OnRampAssets, type OnRampPurchase, type OnRampAssetInfo, type ProviderAssetInfo, OnRampMethod, type Theme, OAuthMethod, type TOAuthMethod, type TLinkedAccountType, type SupportedAccountLinks, type SupportedWalletTypes, type TPregenIdentifierType, type PregenIds, type LinkedAccount, type LinkedAccounts, type TExternalWallet, type ExternalWalletInfo, type PregenAuth, type Setup2faResponse, type TelegramAuthResponse, type VerifyExternalWalletParams, type AssetMetadata, type AssetMetadataIndexed, type AssetValue, type BalancesConfig, type WalletBalance, type ProfileBalance, type OfframpDepositRequest, type WalletWithMetadata, RecoveryStatus, ThemeMode, NON_ED25519, PREGEN_IDENTIFIER_TYPES, WALLET_TYPES, WALLET_SCHEMES, OAUTH_METHODS, LINKED_ACCOUNT_TYPES, EXTERNAL_WALLET_TYPES, EVM_WALLETS, SOLANA_WALLETS, COSMOS_WALLETS, formatAssetQuantity, formatCurrency, type EstimateTransactionOpts, type EstimateTransactionResult, type BroadcastTransactionOpts, type BroadcastTransactionResult, type PendingTransactionEntity, type SerializedDecodedTx, type SerializedTxData, type GetPendingTransactionResponse, } from '@getpara/user-management-client';
|
|
3
|
-
export { PopupType, PregenIdentifierType, type AuthStateSignup, type AuthStateVerify, type AuthStateLogin, type AuthState, type OAuthResponse, type CoreAuthInfo, type SignatureRes, type FullSignatureRes, type SuccessfulSignatureRes, type DeniedSignatureRes, type DeniedSignatureResWithUrl, type Wallet, type AvailableWallet, type AccountLinkInProgress, AccountLinkError, type InternalInterface, type Verify2faParams, type Verify2faResponse, type StorageType, type TelegramParams, } from './types/index.js';
|
|
3
|
+
export { PopupType, PregenIdentifierType, type AuthStateSignup, type AuthStateVerify, type AuthStateLogin, type AuthState, type OAuthResponse, type CoreAuthInfo, type SignatureRes, type FullSignatureRes, type SuccessfulSignatureRes, type DeniedSignatureRes, type DeniedSignatureResWithUrl, type Wallet, type AvailableWallet, type AccountLinkInProgress, AccountLinkError, type InternalInterface, type Verify2faParams, type Verify2faResponse, type StorageType, type TelegramParams, type CreateParaSignerBaseOptions, } from './types/index.js';
|
|
4
4
|
export * from './types/smartAccounts.js';
|
|
5
5
|
export * from './types/coreApi.js';
|
|
6
6
|
export * from './types/events.js';
|
|
@@ -278,26 +278,32 @@ 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 */
|
|
281
282
|
getPregenWallets: {
|
|
282
283
|
params: GetPregenWalletsParams;
|
|
283
284
|
response: GetPregenWalletsResponse;
|
|
284
285
|
};
|
|
286
|
+
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
285
287
|
updatePregenWalletIdentifier: {
|
|
286
288
|
params: UpdatePregenWalletIdentifierParams;
|
|
287
289
|
response: void;
|
|
288
290
|
};
|
|
291
|
+
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
289
292
|
hasPregenWallet: {
|
|
290
293
|
params: HasPregenWalletParams;
|
|
291
294
|
response: boolean;
|
|
292
295
|
};
|
|
296
|
+
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
293
297
|
createPregenWallet: {
|
|
294
298
|
params: CreatePregenWalletParams;
|
|
295
299
|
response: CreatePregenWalletResponse;
|
|
296
300
|
};
|
|
301
|
+
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
297
302
|
createPregenWalletPerType: {
|
|
298
303
|
params: CreatePregenWalletPerTypeParams;
|
|
299
304
|
response: CreatePregenWalletPerTypeResponse;
|
|
300
305
|
};
|
|
306
|
+
/** @deprecated Use the REST API instead. See https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen */
|
|
301
307
|
claimPregenWallets: {
|
|
302
308
|
params: ClaimPregenWalletsParams;
|
|
303
309
|
response: ClaimPregenWalletsResponse;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ParaCore } from '../ParaCore.js';
|
|
2
|
+
/**
|
|
3
|
+
* Base options shared by all integration package signer factories.
|
|
4
|
+
* Every `createParaXxxSigner` function extends this interface.
|
|
5
|
+
*/
|
|
6
|
+
export interface CreateParaSignerBaseOptions {
|
|
7
|
+
/** The Para client instance. */
|
|
8
|
+
para: ParaCore;
|
|
9
|
+
/** Wallet address to use. If provided, the signer targets this specific wallet. */
|
|
10
|
+
address?: string;
|
|
11
|
+
/** Wallet ID to use. If provided, takes priority over auto-selection. */
|
|
12
|
+
walletId?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function warnPregenDeprecation(methodName: string): void;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/core-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.22.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.22.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": "7191b8c823ec592eb1da16c9a085f8e69c6bf377",
|
|
34
34
|
"main": "dist/cjs/index.js",
|
|
35
35
|
"module": "dist/esm/index.js",
|
|
36
36
|
"scripts": {
|