@getpara/core-sdk 2.0.0-alpha.51 → 2.0.0-alpha.53
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 +67 -9
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/index.js +6 -2
- package/dist/cjs/types/index.js +0 -21
- package/dist/cjs/utils/onRamps.js +2 -3
- package/dist/cjs/utils/wallet.js +3 -0
- package/dist/esm/ParaCore.js +68 -11
- package/dist/esm/constants.js +1 -1
- package/dist/esm/index.js +6 -2
- package/dist/esm/types/index.js +0 -16
- package/dist/esm/utils/onRamps.js +2 -3
- package/dist/esm/utils/wallet.js +3 -0
- package/dist/types/ParaCore.d.ts +13 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/types/config.d.ts +1 -2
- package/dist/types/types/index.d.ts +0 -4
- package/dist/types/types/methods.d.ts +1 -3
- package/dist/types/types/wallet.d.ts +3 -3
- package/dist/types/utils/onRamps.d.ts +9 -10
- package/package.json +3 -3
- package/dist/cjs/types/onRamps.js +0 -33
- package/dist/cjs/types/recovery.js +0 -34
- package/dist/cjs/types/theme.js +0 -15
- package/dist/esm/types/onRamps.js +0 -11
- package/dist/esm/types/recovery.js +0 -12
- package/dist/esm/types/theme.js +0 -0
- 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/cjs/ParaCore.js
CHANGED
|
@@ -426,6 +426,9 @@ const _ParaCore = class _ParaCore {
|
|
|
426
426
|
]);
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
+
setModalError(_error) {
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
429
432
|
get authInfo() {
|
|
430
433
|
return __privateGet(this, _authInfo);
|
|
431
434
|
}
|
|
@@ -838,16 +841,25 @@ const _ParaCore = class _ParaCore {
|
|
|
838
841
|
}
|
|
839
842
|
touchSession(regenerate = false) {
|
|
840
843
|
return __async(this, null, function* () {
|
|
841
|
-
var _a, _b, _c, _d;
|
|
844
|
+
var _a, _b, _c, _d, _e;
|
|
842
845
|
if (!this.isWorkerInitialized) {
|
|
843
846
|
this.initializeWorker();
|
|
844
847
|
}
|
|
845
848
|
if (!this.isReady) {
|
|
846
849
|
yield this.ready();
|
|
847
850
|
}
|
|
848
|
-
|
|
851
|
+
let session;
|
|
852
|
+
try {
|
|
853
|
+
session = yield this.ctx.client.touchSession(regenerate);
|
|
854
|
+
} catch (error) {
|
|
855
|
+
this.handleTouchSessionError(error);
|
|
856
|
+
throw error;
|
|
857
|
+
}
|
|
849
858
|
if (!this.partner || ((_a = this.partner) == null ? void 0 : _a.id) !== session.partnerId || !(0, import_utils2.supportedWalletTypesEq)(((_b = this.partner) == null ? void 0 : _b.supportedWalletTypes) || [], session.supportedWalletTypes) || (((_c = this.partner) == null ? void 0 : _c.cosmosPrefix) || "cosmos") !== session.cosmosPrefix) {
|
|
850
859
|
if (!session.partnerId) {
|
|
860
|
+
this.displayModalError(
|
|
861
|
+
`Invalid API Key. Please ensure you have a valid API key for the current environment: ${(_d = this.ctx.env) == null ? void 0 : _d.toUpperCase()}.`
|
|
862
|
+
);
|
|
851
863
|
console.error(`
|
|
852
864
|
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
853
865
|
\u{1F6A8} PARA SDK CONFIGURATION ERROR \u{1F6A8}
|
|
@@ -865,11 +877,12 @@ SOLUTION:
|
|
|
865
877
|
\u2022 If your API key doesn't contain an environment prefix, ensure your API key is the correct key for your target environment
|
|
866
878
|
|
|
867
879
|
Current Environment: ${this.ctx.env}
|
|
868
|
-
API Key Prefix: ${((
|
|
880
|
+
API Key Prefix: ${((_e = this.ctx.apiKey) == null ? void 0 : _e.split("_")[0].toUpperCase()) || "None"}
|
|
869
881
|
|
|
870
882
|
Need help? Visit: https://docs.getpara.com or contact support
|
|
871
883
|
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
872
884
|
`);
|
|
885
|
+
throw new Error("Invalid API Key.");
|
|
873
886
|
} else {
|
|
874
887
|
yield __privateMethod(this, _ParaCore_instances, getPartner_fn).call(this, session.partnerId);
|
|
875
888
|
}
|
|
@@ -971,6 +984,33 @@ Need help? Visit: https://docs.getpara.com or contact support
|
|
|
971
984
|
return __privateGet(this, _authInfo);
|
|
972
985
|
});
|
|
973
986
|
}
|
|
987
|
+
/**
|
|
988
|
+
* Display an error message in the modal (if available)
|
|
989
|
+
* @internal
|
|
990
|
+
*/
|
|
991
|
+
displayModalError(error) {
|
|
992
|
+
if (this.ctx.env !== import_types.Environment.PROD) {
|
|
993
|
+
this.setModalError(error);
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
/**
|
|
997
|
+
* Handle specific touchSession errors with user-friendly messages
|
|
998
|
+
* @private
|
|
999
|
+
*/
|
|
1000
|
+
handleTouchSessionError(error) {
|
|
1001
|
+
const errorStr = String(error);
|
|
1002
|
+
const errorMessage = error instanceof Error ? error.message : "";
|
|
1003
|
+
if (errorStr.includes("blocked by CORS policy") && errorStr.includes("Access-Control-Allow-Origin")) {
|
|
1004
|
+
this.displayModalError("Request rate limit reached. Please wait a couple of minutes and try again.");
|
|
1005
|
+
return;
|
|
1006
|
+
}
|
|
1007
|
+
if (error.status === 403 && errorMessage.includes("origin not authorized")) {
|
|
1008
|
+
this.displayModalError(
|
|
1009
|
+
"The current origin is not allowed. Update your allowed origins in the Para developer portal to allow the current origin."
|
|
1010
|
+
);
|
|
1011
|
+
return;
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
974
1014
|
assertUserId({ allowGuestMode = false } = {}) {
|
|
975
1015
|
if (!this.userId || !allowGuestMode && this.isGuestMode) {
|
|
976
1016
|
throw new Error("no userId is set");
|
|
@@ -2923,8 +2963,16 @@ Need help? Visit: https://docs.getpara.com or contact support
|
|
|
2923
2963
|
}
|
|
2924
2964
|
issueJwt() {
|
|
2925
2965
|
return __async(this, arguments, function* ({ keyIndex = 0 } = {}) {
|
|
2926
|
-
|
|
2927
|
-
|
|
2966
|
+
try {
|
|
2967
|
+
return yield this.ctx.client.issueJwt({ keyIndex });
|
|
2968
|
+
} catch (error) {
|
|
2969
|
+
if (error.status === 403 || error.status === 401) {
|
|
2970
|
+
const errorMessage = "The user needs to be logged in to issue a JWT. Please log in and try again.";
|
|
2971
|
+
this.displayModalError(errorMessage);
|
|
2972
|
+
console.warn(errorMessage);
|
|
2973
|
+
}
|
|
2974
|
+
throw error;
|
|
2975
|
+
}
|
|
2928
2976
|
});
|
|
2929
2977
|
}
|
|
2930
2978
|
/**
|
|
@@ -3032,7 +3080,7 @@ Need help? Visit: https://docs.getpara.com or contact support
|
|
|
3032
3080
|
({
|
|
3033
3081
|
data: { id: credentialId }
|
|
3034
3082
|
} = yield this.ctx.client.addSessionPublicKey(this.userId, {
|
|
3035
|
-
status: import_user_management_client.
|
|
3083
|
+
status: import_user_management_client.AuthMethodStatus.PENDING,
|
|
3036
3084
|
type: import_user_management_client.PublicKeyType.WEB
|
|
3037
3085
|
}));
|
|
3038
3086
|
urlType = "createAuth";
|
|
@@ -3041,7 +3089,7 @@ Need help? Visit: https://docs.getpara.com or contact support
|
|
|
3041
3089
|
({
|
|
3042
3090
|
data: { id: credentialId }
|
|
3043
3091
|
} = yield this.ctx.client.addSessionPasswordPublicKey(this.userId, {
|
|
3044
|
-
status: import_user_management_client.
|
|
3092
|
+
status: import_user_management_client.AuthMethodStatus.PENDING
|
|
3045
3093
|
}));
|
|
3046
3094
|
urlType = "createPassword";
|
|
3047
3095
|
break;
|
|
@@ -3049,7 +3097,7 @@ Need help? Visit: https://docs.getpara.com or contact support
|
|
|
3049
3097
|
({
|
|
3050
3098
|
data: { id: credentialId }
|
|
3051
3099
|
} = yield this.ctx.client.addSessionPasswordPublicKey(this.userId, {
|
|
3052
|
-
status: import_user_management_client.
|
|
3100
|
+
status: import_user_management_client.AuthMethodStatus.PENDING
|
|
3053
3101
|
}));
|
|
3054
3102
|
urlType = "createPIN";
|
|
3055
3103
|
break;
|
|
@@ -3116,7 +3164,17 @@ Need help? Visit: https://docs.getpara.com or contact support
|
|
|
3116
3164
|
signUpOrLogIn(_k) {
|
|
3117
3165
|
return __async(this, null, function* () {
|
|
3118
3166
|
var _l = _k, { auth } = _l, urlOptions = __objRest(_l, ["auth"]);
|
|
3119
|
-
|
|
3167
|
+
let serverAuthState;
|
|
3168
|
+
try {
|
|
3169
|
+
serverAuthState = yield this.ctx.client.signUpOrLogIn(__spreadValues(__spreadValues({}, auth), this.getVerificationEmailProps()));
|
|
3170
|
+
} catch (error) {
|
|
3171
|
+
if (error.message.includes("max beta users reached")) {
|
|
3172
|
+
this.displayModalError(
|
|
3173
|
+
`50 user limit reached. [Go to Production.](https://docs.getpara.com/v2/general/checklist#go-live-checklist)`
|
|
3174
|
+
);
|
|
3175
|
+
}
|
|
3176
|
+
throw error;
|
|
3177
|
+
}
|
|
3120
3178
|
const authInfo = serverAuthState.auth;
|
|
3121
3179
|
if (this.fetchPregenWalletsOverride && (0, import_user_management_client.isPregenAuth)(authInfo)) {
|
|
3122
3180
|
const { userShare } = yield this.fetchPregenWalletsOverride({ pregenId: authInfo });
|
package/dist/cjs/constants.js
CHANGED
|
@@ -41,7 +41,7 @@ __export(constants_exports, {
|
|
|
41
41
|
SHORT_POLLING_INTERVAL_MS: () => SHORT_POLLING_INTERVAL_MS
|
|
42
42
|
});
|
|
43
43
|
module.exports = __toCommonJS(constants_exports);
|
|
44
|
-
const PARA_CORE_VERSION = "2.0.0-alpha.
|
|
44
|
+
const PARA_CORE_VERSION = "2.0.0-alpha.53";
|
|
45
45
|
const PREFIX = "@CAPSULE/";
|
|
46
46
|
const PARA_PREFIX = "@PARA/";
|
|
47
47
|
const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
|
package/dist/cjs/index.js
CHANGED
|
@@ -30,6 +30,7 @@ var src_exports = {};
|
|
|
30
30
|
__export(src_exports, {
|
|
31
31
|
AccountLinkError: () => import_types.AccountLinkError,
|
|
32
32
|
AuthMethod: () => import_user_management_client.AuthMethod,
|
|
33
|
+
AuthMethodStatus: () => import_user_management_client.AuthMethodStatus,
|
|
33
34
|
COSMOS_WALLETS: () => import_user_management_client.COSMOS_WALLETS,
|
|
34
35
|
EVM_WALLETS: () => import_user_management_client.EVM_WALLETS,
|
|
35
36
|
EXTERNAL_WALLET_TYPES: () => import_user_management_client.EXTERNAL_WALLET_TYPES,
|
|
@@ -41,7 +42,7 @@ __export(src_exports, {
|
|
|
41
42
|
OAUTH_METHODS: () => import_user_management_client.OAUTH_METHODS,
|
|
42
43
|
OAuthMethod: () => import_user_management_client.OAuthMethod,
|
|
43
44
|
OnRampAsset: () => import_user_management_client.OnRampAsset,
|
|
44
|
-
OnRampMethod: () =>
|
|
45
|
+
OnRampMethod: () => import_user_management_client.OnRampMethod,
|
|
45
46
|
OnRampProvider: () => import_user_management_client.OnRampProvider,
|
|
46
47
|
OnRampPurchaseStatus: () => import_user_management_client.OnRampPurchaseStatus,
|
|
47
48
|
OnRampPurchaseType: () => import_user_management_client.OnRampPurchaseType,
|
|
@@ -49,9 +50,10 @@ __export(src_exports, {
|
|
|
49
50
|
PREGEN_IDENTIFIER_TYPES: () => import_user_management_client.PREGEN_IDENTIFIER_TYPES,
|
|
50
51
|
PopupType: () => import_types.PopupType,
|
|
51
52
|
PregenIdentifierType: () => import_types.PregenIdentifierType,
|
|
52
|
-
RecoveryStatus: () =>
|
|
53
|
+
RecoveryStatus: () => import_user_management_client.RecoveryStatus,
|
|
53
54
|
SOLANA_WALLETS: () => import_user_management_client.SOLANA_WALLETS,
|
|
54
55
|
STORAGE_PREFIX: () => import_constants.PREFIX,
|
|
56
|
+
ThemeMode: () => import_user_management_client.ThemeMode,
|
|
55
57
|
WALLET_SCHEMES: () => import_user_management_client.WALLET_SCHEMES,
|
|
56
58
|
WALLET_TYPES: () => import_user_management_client.WALLET_TYPES,
|
|
57
59
|
WalletScheme: () => import_user_management_client.WalletScheme,
|
|
@@ -119,6 +121,7 @@ var src_default = import_ParaCore.ParaCore;
|
|
|
119
121
|
0 && (module.exports = {
|
|
120
122
|
AccountLinkError,
|
|
121
123
|
AuthMethod,
|
|
124
|
+
AuthMethodStatus,
|
|
122
125
|
COSMOS_WALLETS,
|
|
123
126
|
EVM_WALLETS,
|
|
124
127
|
EXTERNAL_WALLET_TYPES,
|
|
@@ -141,6 +144,7 @@ var src_default = import_ParaCore.ParaCore;
|
|
|
141
144
|
RecoveryStatus,
|
|
142
145
|
SOLANA_WALLETS,
|
|
143
146
|
STORAGE_PREFIX,
|
|
147
|
+
ThemeMode,
|
|
144
148
|
WALLET_SCHEMES,
|
|
145
149
|
WALLET_TYPES,
|
|
146
150
|
WalletScheme,
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -2,10 +2,6 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
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
5
|
var __copyProps = (to, from, except, desc) => {
|
|
10
6
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
7
|
for (let key of __getOwnPropNames(from))
|
|
@@ -17,38 +13,21 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
13
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
14
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
15
|
var types_exports = {};
|
|
20
|
-
__export(types_exports, {
|
|
21
|
-
Network: () => import_user_management_client.Network,
|
|
22
|
-
OnRampAsset: () => import_user_management_client.OnRampAsset,
|
|
23
|
-
OnRampProvider: () => import_user_management_client.OnRampProvider,
|
|
24
|
-
OnRampPurchaseStatus: () => import_user_management_client.OnRampPurchaseStatus
|
|
25
|
-
});
|
|
26
16
|
module.exports = __toCommonJS(types_exports);
|
|
27
17
|
__reExport(types_exports, require("./auth.js"), module.exports);
|
|
28
18
|
__reExport(types_exports, require("./config.js"), module.exports);
|
|
29
19
|
__reExport(types_exports, require("./coreApi.js"), module.exports);
|
|
30
20
|
__reExport(types_exports, require("./wallet.js"), module.exports);
|
|
31
21
|
__reExport(types_exports, require("./methods.js"), module.exports);
|
|
32
|
-
__reExport(types_exports, require("./theme.js"), module.exports);
|
|
33
|
-
__reExport(types_exports, require("./onRamps.js"), module.exports);
|
|
34
22
|
__reExport(types_exports, require("./popup.js"), module.exports);
|
|
35
|
-
__reExport(types_exports, require("./recovery.js"), module.exports);
|
|
36
23
|
__reExport(types_exports, require("./events.js"), module.exports);
|
|
37
|
-
var import_user_management_client = require("@getpara/user-management-client");
|
|
38
24
|
// Annotate the CommonJS export names for ESM import in node:
|
|
39
25
|
0 && (module.exports = {
|
|
40
|
-
Network,
|
|
41
|
-
OnRampAsset,
|
|
42
|
-
OnRampProvider,
|
|
43
|
-
OnRampPurchaseStatus,
|
|
44
26
|
...require("./auth.js"),
|
|
45
27
|
...require("./config.js"),
|
|
46
28
|
...require("./coreApi.js"),
|
|
47
29
|
...require("./wallet.js"),
|
|
48
30
|
...require("./methods.js"),
|
|
49
|
-
...require("./theme.js"),
|
|
50
|
-
...require("./onRamps.js"),
|
|
51
31
|
...require("./popup.js"),
|
|
52
|
-
...require("./recovery.js"),
|
|
53
32
|
...require("./events.js")
|
|
54
33
|
});
|
|
@@ -24,7 +24,6 @@ __export(onRamps_exports, {
|
|
|
24
24
|
toAssetInfoArray: () => toAssetInfoArray
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(onRamps_exports);
|
|
27
|
-
var import_user_management_client = require("@getpara/user-management-client");
|
|
28
27
|
function toAssetInfoArray(data) {
|
|
29
28
|
const result = [];
|
|
30
29
|
Object.keys(data).forEach((walletType) => {
|
|
@@ -76,8 +75,8 @@ function getOnRampAssets(data, {
|
|
|
76
75
|
];
|
|
77
76
|
}
|
|
78
77
|
const NETWORK_PREFIXES = {
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
COSMOS: "cosmos",
|
|
79
|
+
NOBLE: "noble"
|
|
81
80
|
};
|
|
82
81
|
function getNetworkPrefix(network) {
|
|
83
82
|
return NETWORK_PREFIXES[network];
|
package/dist/cjs/utils/wallet.js
CHANGED
|
@@ -114,7 +114,10 @@ function getEquivalentTypes(types) {
|
|
|
114
114
|
return getWalletTypes(getSchemes(Array.isArray(types) ? types : [types]));
|
|
115
115
|
}
|
|
116
116
|
function entityToWallet(w) {
|
|
117
|
+
var _a;
|
|
117
118
|
return __spreadProps(__spreadValues({}, w), {
|
|
119
|
+
createdAt: typeof w.createdAt === "string" ? w.createdAt : w.createdAt.toISOString(),
|
|
120
|
+
lastUsedAt: typeof w.lastUsedAt === "string" ? w.lastUsedAt : (_a = w.lastUsedAt) == null ? void 0 : _a.toISOString(),
|
|
118
121
|
scheme: w.scheme,
|
|
119
122
|
type: w.type,
|
|
120
123
|
pregenIdentifierType: w.pregenIdentifierType
|
package/dist/esm/ParaCore.js
CHANGED
|
@@ -21,9 +21,8 @@ if (typeof global !== "undefined") {
|
|
|
21
21
|
}
|
|
22
22
|
import {
|
|
23
23
|
AuthMethod,
|
|
24
|
-
|
|
24
|
+
AuthMethodStatus,
|
|
25
25
|
PublicKeyType,
|
|
26
|
-
PasswordStatus,
|
|
27
26
|
extractAuthInfo,
|
|
28
27
|
isEmail,
|
|
29
28
|
isPhone,
|
|
@@ -391,6 +390,9 @@ const _ParaCore = class _ParaCore {
|
|
|
391
390
|
]);
|
|
392
391
|
}
|
|
393
392
|
}
|
|
393
|
+
setModalError(_error) {
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
394
396
|
get authInfo() {
|
|
395
397
|
return __privateGet(this, _authInfo);
|
|
396
398
|
}
|
|
@@ -803,16 +805,25 @@ const _ParaCore = class _ParaCore {
|
|
|
803
805
|
}
|
|
804
806
|
touchSession(regenerate = false) {
|
|
805
807
|
return __async(this, null, function* () {
|
|
806
|
-
var _a, _b, _c, _d;
|
|
808
|
+
var _a, _b, _c, _d, _e;
|
|
807
809
|
if (!this.isWorkerInitialized) {
|
|
808
810
|
this.initializeWorker();
|
|
809
811
|
}
|
|
810
812
|
if (!this.isReady) {
|
|
811
813
|
yield this.ready();
|
|
812
814
|
}
|
|
813
|
-
|
|
815
|
+
let session;
|
|
816
|
+
try {
|
|
817
|
+
session = yield this.ctx.client.touchSession(regenerate);
|
|
818
|
+
} catch (error) {
|
|
819
|
+
this.handleTouchSessionError(error);
|
|
820
|
+
throw error;
|
|
821
|
+
}
|
|
814
822
|
if (!this.partner || ((_a = this.partner) == null ? void 0 : _a.id) !== session.partnerId || !supportedWalletTypesEq(((_b = this.partner) == null ? void 0 : _b.supportedWalletTypes) || [], session.supportedWalletTypes) || (((_c = this.partner) == null ? void 0 : _c.cosmosPrefix) || "cosmos") !== session.cosmosPrefix) {
|
|
815
823
|
if (!session.partnerId) {
|
|
824
|
+
this.displayModalError(
|
|
825
|
+
`Invalid API Key. Please ensure you have a valid API key for the current environment: ${(_d = this.ctx.env) == null ? void 0 : _d.toUpperCase()}.`
|
|
826
|
+
);
|
|
816
827
|
console.error(`
|
|
817
828
|
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
818
829
|
\u{1F6A8} PARA SDK CONFIGURATION ERROR \u{1F6A8}
|
|
@@ -830,11 +841,12 @@ SOLUTION:
|
|
|
830
841
|
\u2022 If your API key doesn't contain an environment prefix, ensure your API key is the correct key for your target environment
|
|
831
842
|
|
|
832
843
|
Current Environment: ${this.ctx.env}
|
|
833
|
-
API Key Prefix: ${((
|
|
844
|
+
API Key Prefix: ${((_e = this.ctx.apiKey) == null ? void 0 : _e.split("_")[0].toUpperCase()) || "None"}
|
|
834
845
|
|
|
835
846
|
Need help? Visit: https://docs.getpara.com or contact support
|
|
836
847
|
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
837
848
|
`);
|
|
849
|
+
throw new Error("Invalid API Key.");
|
|
838
850
|
} else {
|
|
839
851
|
yield __privateMethod(this, _ParaCore_instances, getPartner_fn).call(this, session.partnerId);
|
|
840
852
|
}
|
|
@@ -936,6 +948,33 @@ Need help? Visit: https://docs.getpara.com or contact support
|
|
|
936
948
|
return __privateGet(this, _authInfo);
|
|
937
949
|
});
|
|
938
950
|
}
|
|
951
|
+
/**
|
|
952
|
+
* Display an error message in the modal (if available)
|
|
953
|
+
* @internal
|
|
954
|
+
*/
|
|
955
|
+
displayModalError(error) {
|
|
956
|
+
if (this.ctx.env !== Environment.PROD) {
|
|
957
|
+
this.setModalError(error);
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
/**
|
|
961
|
+
* Handle specific touchSession errors with user-friendly messages
|
|
962
|
+
* @private
|
|
963
|
+
*/
|
|
964
|
+
handleTouchSessionError(error) {
|
|
965
|
+
const errorStr = String(error);
|
|
966
|
+
const errorMessage = error instanceof Error ? error.message : "";
|
|
967
|
+
if (errorStr.includes("blocked by CORS policy") && errorStr.includes("Access-Control-Allow-Origin")) {
|
|
968
|
+
this.displayModalError("Request rate limit reached. Please wait a couple of minutes and try again.");
|
|
969
|
+
return;
|
|
970
|
+
}
|
|
971
|
+
if (error.status === 403 && errorMessage.includes("origin not authorized")) {
|
|
972
|
+
this.displayModalError(
|
|
973
|
+
"The current origin is not allowed. Update your allowed origins in the Para developer portal to allow the current origin."
|
|
974
|
+
);
|
|
975
|
+
return;
|
|
976
|
+
}
|
|
977
|
+
}
|
|
939
978
|
assertUserId({ allowGuestMode = false } = {}) {
|
|
940
979
|
if (!this.userId || !allowGuestMode && this.isGuestMode) {
|
|
941
980
|
throw new Error("no userId is set");
|
|
@@ -2888,8 +2927,16 @@ Need help? Visit: https://docs.getpara.com or contact support
|
|
|
2888
2927
|
}
|
|
2889
2928
|
issueJwt() {
|
|
2890
2929
|
return __async(this, arguments, function* ({ keyIndex = 0 } = {}) {
|
|
2891
|
-
|
|
2892
|
-
|
|
2930
|
+
try {
|
|
2931
|
+
return yield this.ctx.client.issueJwt({ keyIndex });
|
|
2932
|
+
} catch (error) {
|
|
2933
|
+
if (error.status === 403 || error.status === 401) {
|
|
2934
|
+
const errorMessage = "The user needs to be logged in to issue a JWT. Please log in and try again.";
|
|
2935
|
+
this.displayModalError(errorMessage);
|
|
2936
|
+
console.warn(errorMessage);
|
|
2937
|
+
}
|
|
2938
|
+
throw error;
|
|
2939
|
+
}
|
|
2893
2940
|
});
|
|
2894
2941
|
}
|
|
2895
2942
|
/**
|
|
@@ -2997,7 +3044,7 @@ Need help? Visit: https://docs.getpara.com or contact support
|
|
|
2997
3044
|
({
|
|
2998
3045
|
data: { id: credentialId }
|
|
2999
3046
|
} = yield this.ctx.client.addSessionPublicKey(this.userId, {
|
|
3000
|
-
status:
|
|
3047
|
+
status: AuthMethodStatus.PENDING,
|
|
3001
3048
|
type: PublicKeyType.WEB
|
|
3002
3049
|
}));
|
|
3003
3050
|
urlType = "createAuth";
|
|
@@ -3006,7 +3053,7 @@ Need help? Visit: https://docs.getpara.com or contact support
|
|
|
3006
3053
|
({
|
|
3007
3054
|
data: { id: credentialId }
|
|
3008
3055
|
} = yield this.ctx.client.addSessionPasswordPublicKey(this.userId, {
|
|
3009
|
-
status:
|
|
3056
|
+
status: AuthMethodStatus.PENDING
|
|
3010
3057
|
}));
|
|
3011
3058
|
urlType = "createPassword";
|
|
3012
3059
|
break;
|
|
@@ -3014,7 +3061,7 @@ Need help? Visit: https://docs.getpara.com or contact support
|
|
|
3014
3061
|
({
|
|
3015
3062
|
data: { id: credentialId }
|
|
3016
3063
|
} = yield this.ctx.client.addSessionPasswordPublicKey(this.userId, {
|
|
3017
|
-
status:
|
|
3064
|
+
status: AuthMethodStatus.PENDING
|
|
3018
3065
|
}));
|
|
3019
3066
|
urlType = "createPIN";
|
|
3020
3067
|
break;
|
|
@@ -3081,7 +3128,17 @@ Need help? Visit: https://docs.getpara.com or contact support
|
|
|
3081
3128
|
signUpOrLogIn(_k) {
|
|
3082
3129
|
return __async(this, null, function* () {
|
|
3083
3130
|
var _l = _k, { auth } = _l, urlOptions = __objRest(_l, ["auth"]);
|
|
3084
|
-
|
|
3131
|
+
let serverAuthState;
|
|
3132
|
+
try {
|
|
3133
|
+
serverAuthState = yield this.ctx.client.signUpOrLogIn(__spreadValues(__spreadValues({}, auth), this.getVerificationEmailProps()));
|
|
3134
|
+
} catch (error) {
|
|
3135
|
+
if (error.message.includes("max beta users reached")) {
|
|
3136
|
+
this.displayModalError(
|
|
3137
|
+
`50 user limit reached. [Go to Production.](https://docs.getpara.com/v2/general/checklist#go-live-checklist)`
|
|
3138
|
+
);
|
|
3139
|
+
}
|
|
3140
|
+
throw error;
|
|
3141
|
+
}
|
|
3085
3142
|
const authInfo = serverAuthState.auth;
|
|
3086
3143
|
if (this.fetchPregenWalletsOverride && isPregenAuth(authInfo)) {
|
|
3087
3144
|
const { userShare } = yield this.fetchPregenWalletsOverride({ pregenId: authInfo });
|
package/dist/esm/constants.js
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import "./chunk-7B52C2XE.js";
|
|
|
2
2
|
import { ParaCore } from "./ParaCore.js";
|
|
3
3
|
import {
|
|
4
4
|
AuthMethod,
|
|
5
|
+
AuthMethodStatus,
|
|
5
6
|
EmailTheme,
|
|
6
7
|
Network,
|
|
7
8
|
WalletType,
|
|
@@ -10,7 +11,10 @@ import {
|
|
|
10
11
|
OnRampPurchaseType,
|
|
11
12
|
OnRampProvider,
|
|
12
13
|
OnRampPurchaseStatus,
|
|
14
|
+
OnRampMethod,
|
|
13
15
|
OAuthMethod,
|
|
16
|
+
RecoveryStatus,
|
|
17
|
+
ThemeMode,
|
|
14
18
|
NON_ED25519,
|
|
15
19
|
PREGEN_IDENTIFIER_TYPES,
|
|
16
20
|
WALLET_TYPES,
|
|
@@ -23,10 +27,8 @@ import {
|
|
|
23
27
|
COSMOS_WALLETS
|
|
24
28
|
} from "@getpara/user-management-client";
|
|
25
29
|
import {
|
|
26
|
-
OnRampMethod,
|
|
27
30
|
PopupType,
|
|
28
31
|
PregenIdentifierType,
|
|
29
|
-
RecoveryStatus,
|
|
30
32
|
AccountLinkError
|
|
31
33
|
} from "./types/index.js";
|
|
32
34
|
export * from "./types/coreApi.js";
|
|
@@ -70,6 +72,7 @@ var src_default = ParaCore;
|
|
|
70
72
|
export {
|
|
71
73
|
AccountLinkError,
|
|
72
74
|
AuthMethod,
|
|
75
|
+
AuthMethodStatus,
|
|
73
76
|
COSMOS_WALLETS,
|
|
74
77
|
EVM_WALLETS,
|
|
75
78
|
EXTERNAL_WALLET_TYPES,
|
|
@@ -92,6 +95,7 @@ export {
|
|
|
92
95
|
RecoveryStatus,
|
|
93
96
|
SOLANA_WALLETS,
|
|
94
97
|
PREFIX as STORAGE_PREFIX,
|
|
98
|
+
ThemeMode,
|
|
95
99
|
WALLET_SCHEMES,
|
|
96
100
|
WALLET_TYPES,
|
|
97
101
|
WalletScheme,
|
package/dist/esm/types/index.js
CHANGED
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
import "../chunk-7B52C2XE.js";
|
|
2
1
|
export * from "./auth.js";
|
|
3
2
|
export * from "./config.js";
|
|
4
3
|
export * from "./coreApi.js";
|
|
5
4
|
export * from "./wallet.js";
|
|
6
5
|
export * from "./methods.js";
|
|
7
|
-
export * from "./theme.js";
|
|
8
|
-
export * from "./onRamps.js";
|
|
9
6
|
export * from "./popup.js";
|
|
10
|
-
export * from "./recovery.js";
|
|
11
7
|
export * from "./events.js";
|
|
12
|
-
import {
|
|
13
|
-
Network,
|
|
14
|
-
OnRampAsset,
|
|
15
|
-
OnRampProvider,
|
|
16
|
-
OnRampPurchaseStatus
|
|
17
|
-
} from "@getpara/user-management-client";
|
|
18
|
-
export {
|
|
19
|
-
Network,
|
|
20
|
-
OnRampAsset,
|
|
21
|
-
OnRampProvider,
|
|
22
|
-
OnRampPurchaseStatus
|
|
23
|
-
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import "../chunk-7B52C2XE.js";
|
|
2
|
-
import { Network } from "@getpara/user-management-client";
|
|
3
2
|
function toAssetInfoArray(data) {
|
|
4
3
|
const result = [];
|
|
5
4
|
Object.keys(data).forEach((walletType) => {
|
|
@@ -51,8 +50,8 @@ function getOnRampAssets(data, {
|
|
|
51
50
|
];
|
|
52
51
|
}
|
|
53
52
|
const NETWORK_PREFIXES = {
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
COSMOS: "cosmos",
|
|
54
|
+
NOBLE: "noble"
|
|
56
55
|
};
|
|
57
56
|
function getNetworkPrefix(network) {
|
|
58
57
|
return NETWORK_PREFIXES[network];
|
package/dist/esm/utils/wallet.js
CHANGED
|
@@ -59,7 +59,10 @@ function getEquivalentTypes(types) {
|
|
|
59
59
|
return getWalletTypes(getSchemes(Array.isArray(types) ? types : [types]));
|
|
60
60
|
}
|
|
61
61
|
function entityToWallet(w) {
|
|
62
|
+
var _a;
|
|
62
63
|
return __spreadProps(__spreadValues({}, w), {
|
|
64
|
+
createdAt: typeof w.createdAt === "string" ? w.createdAt : w.createdAt.toISOString(),
|
|
65
|
+
lastUsedAt: typeof w.lastUsedAt === "string" ? w.lastUsedAt : (_a = w.lastUsedAt) == null ? void 0 : _a.toISOString(),
|
|
63
66
|
scheme: w.scheme,
|
|
64
67
|
type: w.type,
|
|
65
68
|
pregenIdentifierType: w.pregenIdentifierType
|
package/dist/types/ParaCore.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AuthMethod, AuthExtras, CurrentWalletIds, EmailTheme, PartnerEntity, TWalletType, PregenIds, BiometricLocationHint, Auth, SupportedWalletTypes, AuthIdentifier, AuthType, ExternalWalletInfo, PrimaryAuthInfo, SessionInfo, PrimaryAuth, PrimaryAuthType, AccountMetadata, LinkedAccounts, VerifyLinkParams, VerifyExternalWalletParams, SupportedAccountLinks, OnRampPurchase } from '@getpara/user-management-client';
|
|
1
|
+
import { AuthMethod, AuthExtras, CurrentWalletIds, EmailTheme, PartnerEntity, TWalletType, PregenIds, BiometricLocationHint, Auth, SupportedWalletTypes, AuthIdentifier, AuthType, ExternalWalletInfo, PrimaryAuthInfo, SessionInfo, PrimaryAuth, PrimaryAuthType, AccountMetadata, LinkedAccounts, VerifyLinkParams, VerifyExternalWalletParams, SupportedAccountLinks, OnRampPurchase, Theme } from '@getpara/user-management-client';
|
|
2
2
|
import type { pki as pkiType } from 'node-forge';
|
|
3
|
-
import { Ctx, Environment,
|
|
3
|
+
import { Ctx, Environment, WalletFilters, Wallet, PortalUrlOptions, ConstructorOpts, CoreAuthInfo, PortalUrlType, CoreMethodParams, CoreMethodResponse, NewCredentialUrlParams, LoginUrlParams, CoreInterface, ExternalWalletConnectionType, AccountLinkInProgress, InternalMethodParams, InternalMethodResponse } from './types/index.js';
|
|
4
4
|
import { PlatformUtils } from './PlatformUtils.js';
|
|
5
5
|
export declare abstract class ParaCore implements CoreInterface {
|
|
6
6
|
#private;
|
|
@@ -8,6 +8,7 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
8
8
|
ctx: Ctx;
|
|
9
9
|
protected isNativePasskey: boolean;
|
|
10
10
|
protected isPartnerOptional?: boolean;
|
|
11
|
+
protected setModalError(_error?: string): void;
|
|
11
12
|
isReady: boolean;
|
|
12
13
|
get authInfo(): CoreAuthInfo | undefined;
|
|
13
14
|
get email(): AuthIdentifier<'email'> | undefined;
|
|
@@ -227,6 +228,16 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
227
228
|
extras?: AuthExtras;
|
|
228
229
|
userId?: string;
|
|
229
230
|
}): Promise<typeof this.authInfo>;
|
|
231
|
+
/**
|
|
232
|
+
* Display an error message in the modal (if available)
|
|
233
|
+
* @internal
|
|
234
|
+
*/
|
|
235
|
+
protected displayModalError(error?: string): void;
|
|
236
|
+
/**
|
|
237
|
+
* Handle specific touchSession errors with user-friendly messages
|
|
238
|
+
* @private
|
|
239
|
+
*/
|
|
240
|
+
private handleTouchSessionError;
|
|
230
241
|
protected assertUserId({ allowGuestMode }?: {
|
|
231
242
|
allowGuestMode?: boolean;
|
|
232
243
|
}): string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ParaCore } from './ParaCore.js';
|
|
2
|
-
export { type Auth, type AuthInfo, type PrimaryAuthInfo, type VerifiedAuthInfo, type VerifiedAuth, AuthMethod, type AuthExtras, type CurrentWalletIds, EmailTheme, type PartnerEntity, type WalletEntity, Network, WalletType, type TWalletType, WalletScheme, type TWalletScheme, OnRampAsset, OnRampPurchaseType, OnRampProvider, OnRampPurchaseStatus, type OnRampConfig, type
|
|
3
|
-
export {
|
|
2
|
+
export { type Auth, type AuthInfo, type PrimaryAuthInfo, type VerifiedAuthInfo, type VerifiedAuth, AuthMethod, 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, 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, } 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 GetWalletBalanceParams, type AccountLinkInProgress, AccountLinkError, type InternalInterface, } from './types/index.js';
|
|
4
4
|
export * from './types/coreApi.js';
|
|
5
5
|
export * from './types/events.js';
|
|
6
6
|
export * from './types/config.js';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import Client, { EmailTheme, Network, OnRampAsset, OnRampProvider, PregenAuth, TWalletScheme, TWalletType } from '@getpara/user-management-client';
|
|
3
|
-
import { Theme } from './theme.js';
|
|
2
|
+
import Client, { EmailTheme, Network, OnRampAsset, OnRampProvider, PregenAuth, TWalletScheme, TWalletType, Theme } from '@getpara/user-management-client';
|
|
4
3
|
export declare enum Environment {
|
|
5
4
|
DEV = "DEV",
|
|
6
5
|
SANDBOX = "SANDBOX",
|
|
@@ -3,9 +3,5 @@ export * from './config.js';
|
|
|
3
3
|
export * from './coreApi.js';
|
|
4
4
|
export * from './wallet.js';
|
|
5
5
|
export * from './methods.js';
|
|
6
|
-
export * from './theme.js';
|
|
7
|
-
export * from './onRamps.js';
|
|
8
6
|
export * from './popup.js';
|
|
9
|
-
export * from './recovery.js';
|
|
10
7
|
export * from './events.js';
|
|
11
|
-
export { Network, OnRampAsset, OnRampProvider, OnRampPurchaseStatus, type OnRampPurchase, } from '@getpara/user-management-client';
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { PrimaryAuthInfo, ServerAuthStateLogin, ServerAuthStateSignup, AuthMethod, ServerAuthStateVerify, VerifiedAuth, AuthExtras, TOAuthMethod, TWalletType, TelegramAuthResponse } from '@getpara/user-management-client';
|
|
2
|
-
import { Theme } from './theme.js';
|
|
3
|
-
import { RecoveryStatus } from './recovery.js';
|
|
1
|
+
import { PrimaryAuthInfo, ServerAuthStateLogin, ServerAuthStateSignup, AuthMethod, ServerAuthStateVerify, VerifiedAuth, AuthExtras, RecoveryStatus, Theme, TOAuthMethod, TWalletType, TelegramAuthResponse } from '@getpara/user-management-client';
|
|
4
2
|
import { Wallet } from './wallet.js';
|
|
5
3
|
type Device = {
|
|
6
4
|
sessionId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface Wallet {
|
|
1
|
+
import { IWalletEntity, PartnerEntity, TPregenIdentifierType, TWalletScheme, TWalletType } from '@getpara/user-management-client';
|
|
2
|
+
export interface Wallet extends Omit<IWalletEntity, 'createdAt' | 'updatedAt' | 'lastUsedAt' | 'scheme' | 'type' | 'userId' | 'keyGenComplete'> {
|
|
3
3
|
createdAt?: string;
|
|
4
4
|
id: string;
|
|
5
5
|
name?: string;
|
|
@@ -8,7 +8,7 @@ export interface Wallet {
|
|
|
8
8
|
addressSecondary?: string;
|
|
9
9
|
publicKey?: string;
|
|
10
10
|
scheme?: TWalletScheme;
|
|
11
|
-
type?:
|
|
11
|
+
type?: TWalletType;
|
|
12
12
|
isPregen?: boolean;
|
|
13
13
|
pregenIdentifier?: string;
|
|
14
14
|
pregenIdentifierType?: TPregenIdentifierType;
|
|
@@ -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,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/core-sdk",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.53",
|
|
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.0.0-alpha.
|
|
8
|
+
"@getpara/user-management-client": "2.0.0-alpha.53",
|
|
9
9
|
"@noble/hashes": "^1.5.0",
|
|
10
10
|
"base64url": "^3.0.1",
|
|
11
11
|
"libphonenumber-js": "^1.11.7",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dist",
|
|
28
28
|
"package.json"
|
|
29
29
|
],
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "ad18fa268a41b0e4c080fa8349553fb546983513",
|
|
31
31
|
"main": "dist/cjs/index.js",
|
|
32
32
|
"module": "dist/esm/index.js",
|
|
33
33
|
"scripts": {
|
|
@@ -1,33 +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 onRamps_exports = {};
|
|
19
|
-
__export(onRamps_exports, {
|
|
20
|
-
OnRampMethod: () => OnRampMethod
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(onRamps_exports);
|
|
23
|
-
var OnRampMethod = /* @__PURE__ */ ((OnRampMethod2) => {
|
|
24
|
-
OnRampMethod2["ACH"] = "ACH";
|
|
25
|
-
OnRampMethod2["DEBIT"] = "Debit";
|
|
26
|
-
OnRampMethod2["CREDIT"] = "Credit";
|
|
27
|
-
OnRampMethod2["APPLE_PAY"] = "Apple Pay";
|
|
28
|
-
return OnRampMethod2;
|
|
29
|
-
})(OnRampMethod || {});
|
|
30
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
-
0 && (module.exports = {
|
|
32
|
-
OnRampMethod
|
|
33
|
-
});
|
|
@@ -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
|
-
});
|
package/dist/cjs/types/theme.js
DELETED
|
@@ -1,15 +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 __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 theme_exports = {};
|
|
15
|
-
module.exports = __toCommonJS(theme_exports);
|
|
@@ -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
|
-
};
|
package/dist/esm/types/theme.js
DELETED
|
File without changes
|
|
@@ -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';
|