@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.
- package/dist/cjs/ParaCore.js +1038 -248
- package/dist/cjs/constants.js +13 -1
- package/dist/cjs/index.js +31 -3
- package/dist/cjs/shares/enclave.js +266 -0
- package/dist/cjs/shares/shareDistribution.js +16 -1
- package/dist/cjs/types/{theme.js → assets.js} +2 -2
- package/dist/cjs/types/{onRamps.js → auth.js} +12 -12
- package/dist/cjs/types/coreApi.js +20 -3
- package/dist/cjs/types/events.js +2 -0
- package/dist/cjs/types/index.js +2 -21
- package/dist/cjs/utils/config.js +108 -0
- package/dist/cjs/utils/formatting.js +46 -0
- package/dist/cjs/utils/index.js +2 -0
- package/dist/cjs/utils/onRamps.js +2 -3
- package/dist/cjs/utils/wallet.js +3 -0
- package/dist/esm/ParaCore.js +1045 -254
- package/dist/esm/{chunk-7B52C2XE.js → chunk-W5CT3TVS.js} +2 -0
- package/dist/esm/constants.js +10 -2
- package/dist/esm/cryptography/utils.js +1 -1
- package/dist/esm/errors.js +1 -1
- package/dist/esm/external/mpcComputationClient.js +1 -1
- package/dist/esm/external/userManagementClient.js +1 -1
- package/dist/esm/index.js +31 -6
- package/dist/esm/shares/KeyContainer.js +1 -1
- package/dist/esm/shares/enclave.js +226 -0
- package/dist/esm/shares/recovery.js +1 -1
- package/dist/esm/shares/shareDistribution.js +17 -2
- package/dist/esm/transmission/transmissionUtils.js +1 -1
- package/dist/esm/types/auth.js +11 -0
- package/dist/esm/types/config.js +1 -1
- package/dist/esm/types/coreApi.js +19 -3
- package/dist/esm/types/events.js +3 -1
- package/dist/esm/types/index.js +1 -16
- package/dist/esm/types/popup.js +1 -1
- package/dist/esm/types/wallet.js +1 -1
- package/dist/esm/utils/autobind.js +1 -1
- package/dist/esm/utils/config.js +86 -0
- package/dist/esm/utils/events.js +1 -1
- package/dist/esm/utils/formatting.js +44 -1
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/json.js +1 -1
- package/dist/esm/utils/listeners.js +1 -1
- package/dist/esm/utils/onRamps.js +3 -4
- package/dist/esm/utils/phone.js +1 -1
- package/dist/esm/utils/polling.js +1 -1
- package/dist/esm/utils/types.js +1 -1
- package/dist/esm/utils/url.js +1 -1
- package/dist/esm/utils/wallet.js +4 -1
- package/dist/types/ParaCore.d.ts +115 -52
- package/dist/types/PlatformUtils.d.ts +2 -3
- package/dist/types/constants.d.ts +18 -14
- package/dist/types/index.d.ts +6 -4
- package/dist/types/shares/KeyContainer.d.ts +0 -2
- package/dist/types/shares/enclave.d.ts +81 -0
- package/dist/types/shares/shareDistribution.d.ts +4 -2
- package/dist/types/types/assets.d.ts +14 -0
- package/dist/types/types/auth.d.ts +16 -0
- package/dist/types/types/config.d.ts +11 -2
- package/dist/types/types/coreApi.d.ts +101 -36
- package/dist/types/types/events.d.ts +7 -2
- package/dist/types/types/index.d.ts +1 -4
- package/dist/types/types/methods.d.ts +85 -13
- package/dist/types/types/wallet.d.ts +7 -4
- package/dist/types/utils/config.d.ts +7 -0
- package/dist/types/utils/formatting.d.ts +12 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/onRamps.d.ts +9 -10
- package/package.json +23 -23
- package/dist/cjs/types/recovery.js +0 -34
- package/dist/esm/types/onRamps.js +0 -11
- package/dist/esm/types/recovery.js +0 -12
- package/dist/types/types/onRamps.d.ts +0 -10
- package/dist/types/types/recovery.d.ts +0 -7
- package/dist/types/types/theme.d.ts +0 -12
- /package/dist/esm/types/{theme.js → assets.js} +0 -0
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import {
|
|
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?:
|
|
7
|
-
assets?:
|
|
5
|
+
allowed?: TNetwork[];
|
|
6
|
+
assets?: TOnRampAsset[];
|
|
8
7
|
providers?: OnRampProvider[];
|
|
9
8
|
action?: OnRampPurchaseType;
|
|
10
|
-
}):
|
|
9
|
+
}): TNetwork[];
|
|
11
10
|
export declare function getOnRampAssets(data: OnRampAssetInfo, { walletType, network, allowed, providers, action, }?: {
|
|
12
11
|
walletType?: TWalletType;
|
|
13
|
-
network?:
|
|
14
|
-
allowed?:
|
|
12
|
+
network?: TNetwork;
|
|
13
|
+
allowed?: TOnRampAsset[];
|
|
15
14
|
providers?: OnRampProvider[];
|
|
16
15
|
action?: OnRampPurchaseType;
|
|
17
|
-
}):
|
|
18
|
-
export declare const NETWORK_PREFIXES: Partial<Record<
|
|
19
|
-
export declare function getNetworkPrefix(network:
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
"
|
|
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,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
|