@getpara/core-sdk 2.0.0-alpha.6 → 2.0.0-alpha.60

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.
Files changed (75) hide show
  1. package/dist/cjs/ParaCore.js +1038 -248
  2. package/dist/cjs/constants.js +13 -1
  3. package/dist/cjs/index.js +31 -3
  4. package/dist/cjs/shares/enclave.js +266 -0
  5. package/dist/cjs/shares/shareDistribution.js +16 -1
  6. package/dist/cjs/types/{theme.js → assets.js} +2 -2
  7. package/dist/cjs/types/{onRamps.js → auth.js} +12 -12
  8. package/dist/cjs/types/coreApi.js +20 -3
  9. package/dist/cjs/types/events.js +2 -0
  10. package/dist/cjs/types/index.js +2 -21
  11. package/dist/cjs/utils/config.js +108 -0
  12. package/dist/cjs/utils/formatting.js +46 -0
  13. package/dist/cjs/utils/index.js +2 -0
  14. package/dist/cjs/utils/onRamps.js +2 -3
  15. package/dist/cjs/utils/wallet.js +3 -0
  16. package/dist/esm/ParaCore.js +1045 -254
  17. package/dist/esm/{chunk-7B52C2XE.js → chunk-W5CT3TVS.js} +2 -0
  18. package/dist/esm/constants.js +10 -2
  19. package/dist/esm/cryptography/utils.js +1 -1
  20. package/dist/esm/errors.js +1 -1
  21. package/dist/esm/external/mpcComputationClient.js +1 -1
  22. package/dist/esm/external/userManagementClient.js +1 -1
  23. package/dist/esm/index.js +31 -6
  24. package/dist/esm/shares/KeyContainer.js +1 -1
  25. package/dist/esm/shares/enclave.js +226 -0
  26. package/dist/esm/shares/recovery.js +1 -1
  27. package/dist/esm/shares/shareDistribution.js +17 -2
  28. package/dist/esm/transmission/transmissionUtils.js +1 -1
  29. package/dist/esm/types/auth.js +11 -0
  30. package/dist/esm/types/config.js +1 -1
  31. package/dist/esm/types/coreApi.js +19 -3
  32. package/dist/esm/types/events.js +3 -1
  33. package/dist/esm/types/index.js +1 -16
  34. package/dist/esm/types/popup.js +1 -1
  35. package/dist/esm/types/wallet.js +1 -1
  36. package/dist/esm/utils/autobind.js +1 -1
  37. package/dist/esm/utils/config.js +86 -0
  38. package/dist/esm/utils/events.js +1 -1
  39. package/dist/esm/utils/formatting.js +44 -1
  40. package/dist/esm/utils/index.js +1 -0
  41. package/dist/esm/utils/json.js +1 -1
  42. package/dist/esm/utils/listeners.js +1 -1
  43. package/dist/esm/utils/onRamps.js +3 -4
  44. package/dist/esm/utils/phone.js +1 -1
  45. package/dist/esm/utils/polling.js +1 -1
  46. package/dist/esm/utils/types.js +1 -1
  47. package/dist/esm/utils/url.js +1 -1
  48. package/dist/esm/utils/wallet.js +4 -1
  49. package/dist/types/ParaCore.d.ts +115 -52
  50. package/dist/types/PlatformUtils.d.ts +2 -3
  51. package/dist/types/constants.d.ts +18 -14
  52. package/dist/types/index.d.ts +6 -4
  53. package/dist/types/shares/KeyContainer.d.ts +0 -2
  54. package/dist/types/shares/enclave.d.ts +81 -0
  55. package/dist/types/shares/shareDistribution.d.ts +4 -2
  56. package/dist/types/types/assets.d.ts +14 -0
  57. package/dist/types/types/auth.d.ts +16 -0
  58. package/dist/types/types/config.d.ts +11 -2
  59. package/dist/types/types/coreApi.d.ts +101 -36
  60. package/dist/types/types/events.d.ts +7 -2
  61. package/dist/types/types/index.d.ts +1 -4
  62. package/dist/types/types/methods.d.ts +85 -13
  63. package/dist/types/types/wallet.d.ts +7 -4
  64. package/dist/types/utils/config.d.ts +7 -0
  65. package/dist/types/utils/formatting.d.ts +12 -1
  66. package/dist/types/utils/index.d.ts +1 -0
  67. package/dist/types/utils/onRamps.d.ts +9 -10
  68. package/package.json +23 -23
  69. package/dist/cjs/types/recovery.js +0 -34
  70. package/dist/esm/types/onRamps.js +0 -11
  71. package/dist/esm/types/recovery.js +0 -12
  72. package/dist/types/types/onRamps.d.ts +0 -10
  73. package/dist/types/types/recovery.d.ts +0 -7
  74. package/dist/types/types/theme.d.ts +0 -12
  75. /package/dist/esm/types/{theme.js → assets.js} +0 -0
@@ -1,19 +1,18 @@
1
- import { Network, OnRampAsset, OnRampProvider, OnRampPurchaseType, TWalletType } from '@getpara/user-management-client';
2
- import { OnRampAssetInfoRow, OnRampAssetInfo } from '../types/index.js';
1
+ import { TNetwork, TOnRampAsset, OnRampProvider, OnRampPurchaseType, OnRampAssetInfoRow, OnRampAssetInfo, TWalletType } from '@getpara/user-management-client';
3
2
  export declare function toAssetInfoArray(data: OnRampAssetInfo): OnRampAssetInfoRow[];
4
3
  export declare function getOnRampNetworks(data: OnRampAssetInfo, { walletType, allowed, assets, providers, action, }?: {
5
4
  walletType?: TWalletType;
6
- allowed?: Network[];
7
- assets?: OnRampAsset[];
5
+ allowed?: TNetwork[];
6
+ assets?: TOnRampAsset[];
8
7
  providers?: OnRampProvider[];
9
8
  action?: OnRampPurchaseType;
10
- }): Network[];
9
+ }): TNetwork[];
11
10
  export declare function getOnRampAssets(data: OnRampAssetInfo, { walletType, network, allowed, providers, action, }?: {
12
11
  walletType?: TWalletType;
13
- network?: Network;
14
- allowed?: OnRampAsset[];
12
+ network?: TNetwork;
13
+ allowed?: TOnRampAsset[];
15
14
  providers?: OnRampProvider[];
16
15
  action?: OnRampPurchaseType;
17
- }): OnRampAsset[];
18
- export declare const NETWORK_PREFIXES: Partial<Record<Network, string>>;
19
- export declare function getNetworkPrefix(network: Network): string | undefined;
16
+ }): TOnRampAsset[];
17
+ export declare const NETWORK_PREFIXES: Partial<Record<TNetwork, string>>;
18
+ export declare function getNetworkPrefix(network: TNetwork): string | undefined;
package/package.json CHANGED
@@ -1,39 +1,21 @@
1
1
  {
2
2
  "name": "@getpara/core-sdk",
3
- "version": "2.0.0-alpha.6",
4
- "main": "dist/cjs/index.js",
5
- "module": "dist/esm/index.js",
6
- "types": "dist/types/index.d.ts",
7
- "typings": "dist/types/index.d.ts",
8
- "sideEffects": false,
3
+ "version": "2.0.0-alpha.60",
9
4
  "dependencies": {
10
5
  "@celo/utils": "^8.0.2",
11
6
  "@cosmjs/encoding": "^0.32.4",
12
7
  "@ethereumjs/util": "^9.1.0",
13
- "@getpara/user-management-client": "2.0.0-alpha.6",
8
+ "@getpara/user-management-client": "2.0.0-alpha.60",
14
9
  "@noble/hashes": "^1.5.0",
15
10
  "base64url": "^3.0.1",
16
- "libphonenumber-js": "1.11.2",
11
+ "libphonenumber-js": "^1.11.7",
17
12
  "node-forge": "^1.3.1",
18
13
  "uuid": "^11.1.0"
19
14
  },
20
- "scripts": {
21
- "build": "rm -rf dist && node ./scripts/build.mjs && yarn build:types",
22
- "old-build": "yarn build:cjs && yarn build:esm && yarn build:types; yarn post-build",
23
- "post-build": "./scripts/set-version.sh",
24
- "build:cjs": "rm -rf dist/cjs && tsc --module commonjs --outDir dist/cjs && printf '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
25
- "build:esm": "rm -rf dist/esm && tsc --module es6 --outDir dist/esm && printf '{\"type\":\"module\",\"sideEffects\":false}' > dist/esm/package.json",
26
- "build:types": "rm -rf dist/types && tsc --module es6 --declarationDir dist/types --emitDeclarationOnly --declaration",
27
- "test": "vitest run --coverage"
28
- },
29
15
  "devDependencies": {
30
16
  "@faker-js/faker": "^9.5.1",
31
- "typescript": "5.1.6"
17
+ "typescript": "^5.8.3"
32
18
  },
33
- "files": [
34
- "dist",
35
- "package.json"
36
- ],
37
19
  "exports": {
38
20
  ".": {
39
21
  "types": "./dist/types/index.d.ts",
@@ -41,5 +23,23 @@
41
23
  "require": "./dist/cjs/index.js"
42
24
  }
43
25
  },
44
- "gitHead": "d3b01a8fb475c2af9bf255800bc10d05e011b2eb"
26
+ "files": [
27
+ "dist",
28
+ "package.json"
29
+ ],
30
+ "gitHead": "b445d9dcf909a9bfa72d4f21b825fcf7c643be0c",
31
+ "main": "dist/cjs/index.js",
32
+ "module": "dist/esm/index.js",
33
+ "scripts": {
34
+ "build": "rm -rf dist && node ./scripts/build.mjs && yarn build:types",
35
+ "build:cjs": "rm -rf dist/cjs && tsc --module commonjs --outDir dist/cjs && printf '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
36
+ "build:esm": "rm -rf dist/esm && tsc --module es6 --outDir dist/esm && printf '{\"type\":\"module\",\"sideEffects\":false}' > dist/esm/package.json",
37
+ "build:types": "rm -rf dist/types && tsc --module es6 --declarationDir dist/types --emitDeclarationOnly --declaration",
38
+ "old-build": "yarn build:cjs && yarn build:esm && yarn build:types; yarn post-build",
39
+ "post-build": "./scripts/set-version.sh",
40
+ "test": "vitest run --coverage"
41
+ },
42
+ "sideEffects": false,
43
+ "types": "dist/types/index.d.ts",
44
+ "typings": "dist/types/index.d.ts"
45
45
  }
@@ -1,34 +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 recovery_exports = {};
19
- __export(recovery_exports, {
20
- RecoveryStatus: () => RecoveryStatus
21
- });
22
- module.exports = __toCommonJS(recovery_exports);
23
- var RecoveryStatus = /* @__PURE__ */ ((RecoveryStatus2) => {
24
- RecoveryStatus2["INITIATED"] = "INITIATED";
25
- RecoveryStatus2["READY"] = "READY";
26
- RecoveryStatus2["EXPIRED"] = "EXPIRED";
27
- RecoveryStatus2["FINISHED"] = "FINISHED";
28
- RecoveryStatus2["CANCELLED"] = "CANCELLED";
29
- return RecoveryStatus2;
30
- })(RecoveryStatus || {});
31
- // Annotate the CommonJS export names for ESM import in node:
32
- 0 && (module.exports = {
33
- RecoveryStatus
34
- });
@@ -1,11 +0,0 @@
1
- import "../chunk-7B52C2XE.js";
2
- var OnRampMethod = /* @__PURE__ */ ((OnRampMethod2) => {
3
- OnRampMethod2["ACH"] = "ACH";
4
- OnRampMethod2["DEBIT"] = "Debit";
5
- OnRampMethod2["CREDIT"] = "Credit";
6
- OnRampMethod2["APPLE_PAY"] = "Apple Pay";
7
- return OnRampMethod2;
8
- })(OnRampMethod || {});
9
- export {
10
- OnRampMethod
11
- };
@@ -1,12 +0,0 @@
1
- import "../chunk-7B52C2XE.js";
2
- var RecoveryStatus = /* @__PURE__ */ ((RecoveryStatus2) => {
3
- RecoveryStatus2["INITIATED"] = "INITIATED";
4
- RecoveryStatus2["READY"] = "READY";
5
- RecoveryStatus2["EXPIRED"] = "EXPIRED";
6
- RecoveryStatus2["FINISHED"] = "FINISHED";
7
- RecoveryStatus2["CANCELLED"] = "CANCELLED";
8
- return RecoveryStatus2;
9
- })(RecoveryStatus || {});
10
- export {
11
- RecoveryStatus
12
- };
@@ -1,10 +0,0 @@
1
- import { Network, OnRampAsset, OnRampProvider, OnRampPurchaseType, TWalletType } from '@getpara/user-management-client';
2
- export type ProviderAssetInfo = [string, Partial<Record<OnRampPurchaseType, boolean>>];
3
- export type OnRampAssetInfo = Record<TWalletType, Partial<Record<Network, Partial<Record<OnRampAsset, Partial<Record<OnRampProvider, ProviderAssetInfo>>>>>>>;
4
- export type OnRampAssetInfoRow = [TWalletType, Network, OnRampAsset, Partial<Record<OnRampProvider, ProviderAssetInfo>>];
5
- export declare enum OnRampMethod {
6
- ACH = "ACH",
7
- DEBIT = "Debit",
8
- CREDIT = "Credit",
9
- APPLE_PAY = "Apple Pay"
10
- }
@@ -1,7 +0,0 @@
1
- export declare enum RecoveryStatus {
2
- INITIATED = "INITIATED",
3
- READY = "READY",
4
- EXPIRED = "EXPIRED",
5
- FINISHED = "FINISHED",
6
- CANCELLED = "CANCELLED"
7
- }
@@ -1,12 +0,0 @@
1
- export type Theme = {
2
- foregroundColor?: string;
3
- backgroundColor?: string;
4
- accentColor?: string;
5
- darkForegroundColor?: string;
6
- darkBackgroundColor?: string;
7
- darkAccentColor?: string;
8
- mode?: 'light' | 'dark';
9
- borderRadius?: BorderRadius;
10
- font?: string;
11
- };
12
- export type BorderRadius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
File without changes