@getpara/core-sdk 2.31.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.
@@ -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");
@@ -2022,8 +2021,6 @@ const _ParaCore = class _ParaCore {
2022
2021
  });
2023
2022
  }
2024
2023
  /**
2025
- * @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
2026
- *
2027
2024
  * Creates a new pregenerated wallet.
2028
2025
  *
2029
2026
  * @param {Object} opts the options object.
@@ -2034,13 +2031,10 @@ const _ParaCore = class _ParaCore {
2034
2031
  **/
2035
2032
  createPregenWallet(params) {
2036
2033
  return __async(this, null, function* () {
2037
- (0, import_deprecation.warnPregenDeprecation)("createPregenWallet");
2038
2034
  return yield __privateGet(this, _pregenWalletService).createPregenWallet(params);
2039
2035
  });
2040
2036
  }
2041
2037
  /**
2042
- * @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
2043
- *
2044
2038
  * Creates new pregenerated wallets for each desired type.
2045
2039
  * If no types are provided, this method will create one for each of the non-optional types
2046
2040
  * specified in the instance's `supportedWalletTypes` array that are not already present.
@@ -2052,13 +2046,10 @@ const _ParaCore = class _ParaCore {
2052
2046
  **/
2053
2047
  createPregenWalletPerType(params) {
2054
2048
  return __async(this, null, function* () {
2055
- (0, import_deprecation.warnPregenDeprecation)("createPregenWalletPerType");
2056
2049
  return yield __privateGet(this, _pregenWalletService).createPregenWalletPerType(params);
2057
2050
  });
2058
2051
  }
2059
2052
  /**
2060
- * @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
2061
- *
2062
2053
  * Claims a pregenerated wallet.
2063
2054
  * @param {Object} opts the options object.
2064
2055
  * @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
@@ -2067,13 +2058,10 @@ const _ParaCore = class _ParaCore {
2067
2058
  **/
2068
2059
  claimPregenWallets() {
2069
2060
  return __async(this, arguments, function* (params = {}) {
2070
- (0, import_deprecation.warnPregenDeprecation)("claimPregenWallets");
2071
2061
  return yield __privateGet(this, _pregenWalletService).claimPregenWallets(params);
2072
2062
  });
2073
2063
  }
2074
2064
  /**
2075
- * @deprecated Use the REST API (`PATCH /v1/wallets/:id`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
2076
- *
2077
2065
  * Updates the identifier for a pregen wallet.
2078
2066
  * @param {Object} opts the options object.
2079
2067
  * @param {string} opts.walletId the pregen wallet ID
@@ -2082,13 +2070,10 @@ const _ParaCore = class _ParaCore {
2082
2070
  **/
2083
2071
  updatePregenWalletIdentifier(params) {
2084
2072
  return __async(this, null, function* () {
2085
- (0, import_deprecation.warnPregenDeprecation)("updatePregenWalletIdentifier");
2086
2073
  return yield __privateGet(this, _pregenWalletService).updatePregenWalletIdentifier(params);
2087
2074
  });
2088
2075
  }
2089
2076
  /**
2090
- * @deprecated Use the REST API (`GET /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
2091
- *
2092
2077
  * Checks if a pregen Wallet exists for the given identifier with the current partner.
2093
2078
  * @param {Object} opts the options object.
2094
2079
  * @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
@@ -2097,13 +2082,10 @@ const _ParaCore = class _ParaCore {
2097
2082
  **/
2098
2083
  hasPregenWallet(params) {
2099
2084
  return __async(this, null, function* () {
2100
- (0, import_deprecation.warnPregenDeprecation)("hasPregenWallet");
2101
2085
  return yield __privateGet(this, _pregenWalletService).hasPregenWallet(params);
2102
2086
  });
2103
2087
  }
2104
2088
  /**
2105
- * @deprecated Use the REST API (`GET /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
2106
- *
2107
2089
  * Get pregen wallets for the given identifier.
2108
2090
  * @param {Object} opts the options object.
2109
2091
  * @param {string} opts.pregenIdentifier - the identifier of the user claiming the wallet
@@ -2112,7 +2094,6 @@ const _ParaCore = class _ParaCore {
2112
2094
  **/
2113
2095
  getPregenWallets() {
2114
2096
  return __async(this, arguments, function* (params = {}) {
2115
- (0, import_deprecation.warnPregenDeprecation)("getPregenWallets");
2116
2097
  return yield __privateGet(this, _pregenWalletService).getPregenWallets(params);
2117
2098
  });
2118
2099
  }
@@ -3102,7 +3083,7 @@ waitForLoginProcess_fn = function() {
3102
3083
  yield this.setupAfterLogin({ temporaryShares: tempSharesRes.data.temporaryShares, skipSessionRefresh });
3103
3084
  this.devLog("[waitForLoginProcess] Setup after login complete");
3104
3085
  this.devLog("[waitForLoginProcess] Claiming pregen wallets");
3105
- yield __privateGet(this, _pregenWalletService).claimPregenWallets();
3086
+ yield this.claimPregenWallets();
3106
3087
  this.devLog("[waitForLoginProcess] Pregen wallets claimed");
3107
3088
  const resp = {
3108
3089
  needsWallet: needsWallet || Object.values(this.wallets).length === 0,
@@ -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.31.0";
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`;
@@ -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";
@@ -1964,8 +1963,6 @@ const _ParaCore = class _ParaCore {
1964
1963
  });
1965
1964
  }
1966
1965
  /**
1967
- * @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
1968
- *
1969
1966
  * Creates a new pregenerated wallet.
1970
1967
  *
1971
1968
  * @param {Object} opts the options object.
@@ -1976,13 +1973,10 @@ const _ParaCore = class _ParaCore {
1976
1973
  **/
1977
1974
  createPregenWallet(params) {
1978
1975
  return __async(this, null, function* () {
1979
- warnPregenDeprecation("createPregenWallet");
1980
1976
  return yield __privateGet(this, _pregenWalletService).createPregenWallet(params);
1981
1977
  });
1982
1978
  }
1983
1979
  /**
1984
- * @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
1985
- *
1986
1980
  * Creates new pregenerated wallets for each desired type.
1987
1981
  * If no types are provided, this method will create one for each of the non-optional types
1988
1982
  * specified in the instance's `supportedWalletTypes` array that are not already present.
@@ -1994,13 +1988,10 @@ const _ParaCore = class _ParaCore {
1994
1988
  **/
1995
1989
  createPregenWalletPerType(params) {
1996
1990
  return __async(this, null, function* () {
1997
- warnPregenDeprecation("createPregenWalletPerType");
1998
1991
  return yield __privateGet(this, _pregenWalletService).createPregenWalletPerType(params);
1999
1992
  });
2000
1993
  }
2001
1994
  /**
2002
- * @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
2003
- *
2004
1995
  * Claims a pregenerated wallet.
2005
1996
  * @param {Object} opts the options object.
2006
1997
  * @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
@@ -2009,13 +2000,10 @@ const _ParaCore = class _ParaCore {
2009
2000
  **/
2010
2001
  claimPregenWallets() {
2011
2002
  return __async(this, arguments, function* (params = {}) {
2012
- warnPregenDeprecation("claimPregenWallets");
2013
2003
  return yield __privateGet(this, _pregenWalletService).claimPregenWallets(params);
2014
2004
  });
2015
2005
  }
2016
2006
  /**
2017
- * @deprecated Use the REST API (`PATCH /v1/wallets/:id`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
2018
- *
2019
2007
  * Updates the identifier for a pregen wallet.
2020
2008
  * @param {Object} opts the options object.
2021
2009
  * @param {string} opts.walletId the pregen wallet ID
@@ -2024,13 +2012,10 @@ const _ParaCore = class _ParaCore {
2024
2012
  **/
2025
2013
  updatePregenWalletIdentifier(params) {
2026
2014
  return __async(this, null, function* () {
2027
- warnPregenDeprecation("updatePregenWalletIdentifier");
2028
2015
  return yield __privateGet(this, _pregenWalletService).updatePregenWalletIdentifier(params);
2029
2016
  });
2030
2017
  }
2031
2018
  /**
2032
- * @deprecated Use the REST API (`GET /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
2033
- *
2034
2019
  * Checks if a pregen Wallet exists for the given identifier with the current partner.
2035
2020
  * @param {Object} opts the options object.
2036
2021
  * @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
@@ -2039,13 +2024,10 @@ const _ParaCore = class _ParaCore {
2039
2024
  **/
2040
2025
  hasPregenWallet(params) {
2041
2026
  return __async(this, null, function* () {
2042
- warnPregenDeprecation("hasPregenWallet");
2043
2027
  return yield __privateGet(this, _pregenWalletService).hasPregenWallet(params);
2044
2028
  });
2045
2029
  }
2046
2030
  /**
2047
- * @deprecated Use the REST API (`GET /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
2048
- *
2049
2031
  * Get pregen wallets for the given identifier.
2050
2032
  * @param {Object} opts the options object.
2051
2033
  * @param {string} opts.pregenIdentifier - the identifier of the user claiming the wallet
@@ -2054,7 +2036,6 @@ const _ParaCore = class _ParaCore {
2054
2036
  **/
2055
2037
  getPregenWallets() {
2056
2038
  return __async(this, arguments, function* (params = {}) {
2057
- warnPregenDeprecation("getPregenWallets");
2058
2039
  return yield __privateGet(this, _pregenWalletService).getPregenWallets(params);
2059
2040
  });
2060
2041
  }
@@ -3044,7 +3025,7 @@ waitForLoginProcess_fn = function() {
3044
3025
  yield this.setupAfterLogin({ temporaryShares: tempSharesRes.data.temporaryShares, skipSessionRefresh });
3045
3026
  this.devLog("[waitForLoginProcess] Setup after login complete");
3046
3027
  this.devLog("[waitForLoginProcess] Claiming pregen wallets");
3047
- yield __privateGet(this, _pregenWalletService).claimPregenWallets();
3028
+ yield this.claimPregenWallets();
3048
3029
  this.devLog("[waitForLoginProcess] Pregen wallets claimed");
3049
3030
  const resp = {
3050
3031
  needsWallet: needsWallet || Object.values(this.wallets).length === 0,
@@ -1,5 +1,5 @@
1
1
  import "./chunk-7B52C2XE.js";
2
- const PARA_CORE_VERSION = "2.31.0";
2
+ const PARA_CORE_VERSION = "2.32.0";
3
3
  const PREFIX = "@CAPSULE/";
4
4
  const PARA_PREFIX = "@PARA/";
5
5
  const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
@@ -668,8 +668,6 @@ export declare abstract class ParaCore implements CoreInterface {
668
668
  **/
669
669
  createWallet(params?: CreateWalletParams): Promise<import("./services/types").CreateWalletResponse>;
670
670
  /**
671
- * @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
672
- *
673
671
  * Creates a new pregenerated wallet.
674
672
  *
675
673
  * @param {Object} opts the options object.
@@ -680,8 +678,6 @@ export declare abstract class ParaCore implements CoreInterface {
680
678
  **/
681
679
  createPregenWallet(params: CreatePregenWalletParams): Promise<Wallet>;
682
680
  /**
683
- * @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
684
- *
685
681
  * Creates new pregenerated wallets for each desired type.
686
682
  * If no types are provided, this method will create one for each of the non-optional types
687
683
  * specified in the instance's `supportedWalletTypes` array that are not already present.
@@ -693,8 +689,6 @@ export declare abstract class ParaCore implements CoreInterface {
693
689
  **/
694
690
  createPregenWalletPerType(params: CreatePregenWalletPerTypeParams): Promise<import("./services/types").CreatePregenWalletPerTypeResponse>;
695
691
  /**
696
- * @deprecated Use the REST API (`POST /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
697
- *
698
692
  * Claims a pregenerated wallet.
699
693
  * @param {Object} opts the options object.
700
694
  * @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
@@ -703,8 +697,6 @@ export declare abstract class ParaCore implements CoreInterface {
703
697
  **/
704
698
  claimPregenWallets(params?: ClaimPregenWalletsParams): Promise<string>;
705
699
  /**
706
- * @deprecated Use the REST API (`PATCH /v1/wallets/:id`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
707
- *
708
700
  * Updates the identifier for a pregen wallet.
709
701
  * @param {Object} opts the options object.
710
702
  * @param {string} opts.walletId the pregen wallet ID
@@ -713,8 +705,6 @@ export declare abstract class ParaCore implements CoreInterface {
713
705
  **/
714
706
  updatePregenWalletIdentifier(params: UpdatePregenWalletIdentifierParams): Promise<void>;
715
707
  /**
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
708
  * Checks if a pregen Wallet exists for the given identifier with the current partner.
719
709
  * @param {Object} opts the options object.
720
710
  * @param {string} opts.pregenIdentifier string the identifier of the user claiming the wallet
@@ -723,8 +713,6 @@ export declare abstract class ParaCore implements CoreInterface {
723
713
  **/
724
714
  hasPregenWallet(params: HasPregenWalletParams): Promise<boolean>;
725
715
  /**
726
- * @deprecated Use the REST API (`GET /v1/wallets`) instead. See {@link https://docs.getpara.com/v2/rest/migrate-from-sdk-pregen | migration guide}.
727
- *
728
716
  * Get pregen wallets for the given identifier.
729
717
  * @param {Object} opts the options object.
730
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.31.0",
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.31.0",
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": "174819efc3091ef104a4b54c887066587b07e4b8",
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;