@getpara/user-management-client 1.8.0 → 2.0.0-alpha.3
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/index.js +1289 -10
- package/dist/cjs/index.js.br +0 -0
- package/dist/cjs/index.js.gz +0 -0
- package/dist/esm/index.js +1248 -7
- package/dist/esm/index.js.br +0 -0
- package/dist/esm/index.js.gz +0 -0
- package/dist/types/client.d.ts +38 -57
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types/auth.d.ts +123 -15
- package/dist/types/types/partner.d.ts +7 -0
- package/dist/types/types/wallet.d.ts +7 -4
- package/dist/types/utils.d.ts +39 -9
- package/package.json +3 -3
- package/dist/cjs/client.js +0 -927
- package/dist/cjs/consts.js +0 -36
- package/dist/cjs/error.js +0 -41
- package/dist/cjs/package.json +0 -3
- package/dist/cjs/types/auth.js +0 -80
- package/dist/cjs/types/email.js +0 -31
- package/dist/cjs/types/index.js +0 -29
- package/dist/cjs/types/onRamp.js +0 -62
- package/dist/cjs/types/partner.js +0 -15
- package/dist/cjs/types/wallet.js +0 -77
- package/dist/cjs/utils.js +0 -120
- package/dist/esm/chunk-BBZEL7EG.js +0 -58
- package/dist/esm/client.js +0 -850
- package/dist/esm/consts.js +0 -11
- package/dist/esm/error.js +0 -19
- package/dist/esm/package.json +0 -4
- package/dist/esm/types/auth.js +0 -52
- package/dist/esm/types/email.js +0 -9
- package/dist/esm/types/index.js +0 -5
- package/dist/esm/types/onRamp.js +0 -37
- package/dist/esm/types/partner.js +0 -0
- package/dist/esm/types/wallet.js +0 -50
- package/dist/esm/utils.js +0 -89
package/dist/cjs/consts.js
DELETED
|
@@ -1,36 +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 consts_exports = {};
|
|
19
|
-
__export(consts_exports, {
|
|
20
|
-
API_KEY_HEADER_NAME: () => API_KEY_HEADER_NAME,
|
|
21
|
-
PARTNER_ID_HEADER_NAME: () => PARTNER_ID_HEADER_NAME,
|
|
22
|
-
SESSION_COOKIE_HEADER_NAME: () => SESSION_COOKIE_HEADER_NAME,
|
|
23
|
-
VERSION_HEADER_NAME: () => VERSION_HEADER_NAME
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(consts_exports);
|
|
26
|
-
const SESSION_COOKIE_HEADER_NAME = "x-capsule-sid";
|
|
27
|
-
const VERSION_HEADER_NAME = "x-para-version";
|
|
28
|
-
const PARTNER_ID_HEADER_NAME = "x-partner-id";
|
|
29
|
-
const API_KEY_HEADER_NAME = "X-External-API-Key";
|
|
30
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
-
0 && (module.exports = {
|
|
32
|
-
API_KEY_HEADER_NAME,
|
|
33
|
-
PARTNER_ID_HEADER_NAME,
|
|
34
|
-
SESSION_COOKIE_HEADER_NAME,
|
|
35
|
-
VERSION_HEADER_NAME
|
|
36
|
-
});
|
package/dist/cjs/error.js
DELETED
|
@@ -1,41 +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 error_exports = {};
|
|
19
|
-
__export(error_exports, {
|
|
20
|
-
ParaApiError: () => ParaApiError
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(error_exports);
|
|
23
|
-
function ParaApiError(message, code, status, responseURL) {
|
|
24
|
-
Error.call(this);
|
|
25
|
-
if (Error.captureStackTrace) {
|
|
26
|
-
Error.captureStackTrace(this, this.constructor);
|
|
27
|
-
} else {
|
|
28
|
-
this.stack = new Error().stack;
|
|
29
|
-
}
|
|
30
|
-
this.message = message;
|
|
31
|
-
this.name = "ParaApiError";
|
|
32
|
-
code && (this.code = code);
|
|
33
|
-
status && (this.status = status);
|
|
34
|
-
responseURL && (this.responseURL = responseURL);
|
|
35
|
-
}
|
|
36
|
-
const prototype = ParaApiError.prototype;
|
|
37
|
-
Object.defineProperty(prototype, "isParaApiError", { value: true });
|
|
38
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
-
0 && (module.exports = {
|
|
40
|
-
ParaApiError
|
|
41
|
-
});
|
package/dist/cjs/package.json
DELETED
package/dist/cjs/types/auth.js
DELETED
|
@@ -1,80 +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 auth_exports = {};
|
|
19
|
-
__export(auth_exports, {
|
|
20
|
-
AuthMethod: () => AuthMethod,
|
|
21
|
-
EncryptorType: () => EncryptorType,
|
|
22
|
-
KeyShareType: () => KeyShareType,
|
|
23
|
-
OAuthMethod: () => OAuthMethod,
|
|
24
|
-
PasswordStatus: () => PasswordStatus,
|
|
25
|
-
PublicKeyStatus: () => PublicKeyStatus,
|
|
26
|
-
PublicKeyType: () => PublicKeyType
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(auth_exports);
|
|
29
|
-
var EncryptorType = /* @__PURE__ */ ((EncryptorType2) => {
|
|
30
|
-
EncryptorType2["USER"] = "USER";
|
|
31
|
-
EncryptorType2["RECOVERY"] = "RECOVERY";
|
|
32
|
-
EncryptorType2["BIOMETRICS"] = "BIOMETRICS";
|
|
33
|
-
EncryptorType2["PASSWORD"] = "PASSWORD";
|
|
34
|
-
return EncryptorType2;
|
|
35
|
-
})(EncryptorType || {});
|
|
36
|
-
var KeyShareType = /* @__PURE__ */ ((KeyShareType2) => {
|
|
37
|
-
KeyShareType2["USER"] = "USER";
|
|
38
|
-
KeyShareType2["RECOVERY"] = "RECOVERY";
|
|
39
|
-
return KeyShareType2;
|
|
40
|
-
})(KeyShareType || {});
|
|
41
|
-
var PasswordStatus = /* @__PURE__ */ ((PasswordStatus2) => {
|
|
42
|
-
PasswordStatus2["PENDING"] = "PENDING";
|
|
43
|
-
PasswordStatus2["COMPLETE"] = "COMPLETE";
|
|
44
|
-
return PasswordStatus2;
|
|
45
|
-
})(PasswordStatus || {});
|
|
46
|
-
var PublicKeyStatus = /* @__PURE__ */ ((PublicKeyStatus2) => {
|
|
47
|
-
PublicKeyStatus2["PENDING"] = "PENDING";
|
|
48
|
-
PublicKeyStatus2["COMPLETE"] = "COMPLETE";
|
|
49
|
-
return PublicKeyStatus2;
|
|
50
|
-
})(PublicKeyStatus || {});
|
|
51
|
-
var PublicKeyType = /* @__PURE__ */ ((PublicKeyType2) => {
|
|
52
|
-
PublicKeyType2["MOBILE"] = "MOBILE";
|
|
53
|
-
PublicKeyType2["WEB"] = "WEB";
|
|
54
|
-
return PublicKeyType2;
|
|
55
|
-
})(PublicKeyType || {});
|
|
56
|
-
var OAuthMethod = /* @__PURE__ */ ((OAuthMethod2) => {
|
|
57
|
-
OAuthMethod2["GOOGLE"] = "GOOGLE";
|
|
58
|
-
OAuthMethod2["TWITTER"] = "TWITTER";
|
|
59
|
-
OAuthMethod2["APPLE"] = "APPLE";
|
|
60
|
-
OAuthMethod2["DISCORD"] = "DISCORD";
|
|
61
|
-
OAuthMethod2["FACEBOOK"] = "FACEBOOK";
|
|
62
|
-
OAuthMethod2["FARCASTER"] = "FARCASTER";
|
|
63
|
-
OAuthMethod2["TELEGRAM"] = "TELEGRAM";
|
|
64
|
-
return OAuthMethod2;
|
|
65
|
-
})(OAuthMethod || {});
|
|
66
|
-
var AuthMethod = /* @__PURE__ */ ((AuthMethod2) => {
|
|
67
|
-
AuthMethod2["PASSWORD"] = "PASSWORD";
|
|
68
|
-
AuthMethod2["PASSKEY"] = "PASSKEY";
|
|
69
|
-
return AuthMethod2;
|
|
70
|
-
})(AuthMethod || {});
|
|
71
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
-
0 && (module.exports = {
|
|
73
|
-
AuthMethod,
|
|
74
|
-
EncryptorType,
|
|
75
|
-
KeyShareType,
|
|
76
|
-
OAuthMethod,
|
|
77
|
-
PasswordStatus,
|
|
78
|
-
PublicKeyStatus,
|
|
79
|
-
PublicKeyType
|
|
80
|
-
});
|
package/dist/cjs/types/email.js
DELETED
|
@@ -1,31 +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 email_exports = {};
|
|
19
|
-
__export(email_exports, {
|
|
20
|
-
EmailTheme: () => EmailTheme
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(email_exports);
|
|
23
|
-
var EmailTheme = /* @__PURE__ */ ((EmailTheme2) => {
|
|
24
|
-
EmailTheme2["LIGHT"] = "light";
|
|
25
|
-
EmailTheme2["DARK"] = "dark";
|
|
26
|
-
return EmailTheme2;
|
|
27
|
-
})(EmailTheme || {});
|
|
28
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
-
0 && (module.exports = {
|
|
30
|
-
EmailTheme
|
|
31
|
-
});
|
package/dist/cjs/types/index.js
DELETED
|
@@ -1,29 +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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var types_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(types_exports);
|
|
17
|
-
__reExport(types_exports, require("./auth.js"), module.exports);
|
|
18
|
-
__reExport(types_exports, require("./email.js"), module.exports);
|
|
19
|
-
__reExport(types_exports, require("./onRamp.js"), module.exports);
|
|
20
|
-
__reExport(types_exports, require("./partner.js"), module.exports);
|
|
21
|
-
__reExport(types_exports, require("./wallet.js"), module.exports);
|
|
22
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
-
0 && (module.exports = {
|
|
24
|
-
...require("./auth.js"),
|
|
25
|
-
...require("./email.js"),
|
|
26
|
-
...require("./onRamp.js"),
|
|
27
|
-
...require("./partner.js"),
|
|
28
|
-
...require("./wallet.js")
|
|
29
|
-
});
|
package/dist/cjs/types/onRamp.js
DELETED
|
@@ -1,62 +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 onRamp_exports = {};
|
|
19
|
-
__export(onRamp_exports, {
|
|
20
|
-
OnRampAsset: () => OnRampAsset,
|
|
21
|
-
OnRampProvider: () => OnRampProvider,
|
|
22
|
-
OnRampPurchaseStatus: () => OnRampPurchaseStatus,
|
|
23
|
-
OnRampPurchaseType: () => OnRampPurchaseType
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(onRamp_exports);
|
|
26
|
-
var OnRampProvider = /* @__PURE__ */ ((OnRampProvider2) => {
|
|
27
|
-
OnRampProvider2["RAMP"] = "RAMP";
|
|
28
|
-
OnRampProvider2["STRIPE"] = "STRIPE";
|
|
29
|
-
OnRampProvider2["MOONPAY"] = "MOONPAY";
|
|
30
|
-
return OnRampProvider2;
|
|
31
|
-
})(OnRampProvider || {});
|
|
32
|
-
var OnRampAsset = /* @__PURE__ */ ((OnRampAsset2) => {
|
|
33
|
-
OnRampAsset2["ETHEREUM"] = "ETHEREUM";
|
|
34
|
-
OnRampAsset2["USDC"] = "USDC";
|
|
35
|
-
OnRampAsset2["TETHER"] = "TETHER";
|
|
36
|
-
OnRampAsset2["POLYGON"] = "POLYGON";
|
|
37
|
-
OnRampAsset2["SOLANA"] = "SOLANA";
|
|
38
|
-
OnRampAsset2["ATOM"] = "ATOM";
|
|
39
|
-
OnRampAsset2["CELO"] = "CELO";
|
|
40
|
-
OnRampAsset2["CUSD"] = "CUSD";
|
|
41
|
-
OnRampAsset2["CEUR"] = "CEUR";
|
|
42
|
-
OnRampAsset2["CREAL"] = "CREAL";
|
|
43
|
-
return OnRampAsset2;
|
|
44
|
-
})(OnRampAsset || {});
|
|
45
|
-
var OnRampPurchaseStatus = /* @__PURE__ */ ((OnRampPurchaseStatus2) => {
|
|
46
|
-
OnRampPurchaseStatus2["INITIATED"] = "INITIATED";
|
|
47
|
-
OnRampPurchaseStatus2["FINISHED"] = "FINISHED";
|
|
48
|
-
OnRampPurchaseStatus2["CANCELLED"] = "CANCELLED";
|
|
49
|
-
return OnRampPurchaseStatus2;
|
|
50
|
-
})(OnRampPurchaseStatus || {});
|
|
51
|
-
var OnRampPurchaseType = /* @__PURE__ */ ((OnRampPurchaseType2) => {
|
|
52
|
-
OnRampPurchaseType2["BUY"] = "BUY";
|
|
53
|
-
OnRampPurchaseType2["SELL"] = "SELL";
|
|
54
|
-
return OnRampPurchaseType2;
|
|
55
|
-
})(OnRampPurchaseType || {});
|
|
56
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
-
0 && (module.exports = {
|
|
58
|
-
OnRampAsset,
|
|
59
|
-
OnRampProvider,
|
|
60
|
-
OnRampPurchaseStatus,
|
|
61
|
-
OnRampPurchaseType
|
|
62
|
-
});
|
|
@@ -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 partner_exports = {};
|
|
15
|
-
module.exports = __toCommonJS(partner_exports);
|
package/dist/cjs/types/wallet.js
DELETED
|
@@ -1,77 +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 wallet_exports = {};
|
|
19
|
-
__export(wallet_exports, {
|
|
20
|
-
Chain: () => Chain,
|
|
21
|
-
NON_ED25519: () => NON_ED25519,
|
|
22
|
-
Network: () => Network,
|
|
23
|
-
PREGEN_IDENTIFIER_TYPES: () => PREGEN_IDENTIFIER_TYPES,
|
|
24
|
-
WalletScheme: () => WalletScheme,
|
|
25
|
-
WalletType: () => WalletType
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(wallet_exports);
|
|
28
|
-
var import_auth = require("./auth.js");
|
|
29
|
-
var WalletScheme = /* @__PURE__ */ ((WalletScheme2) => {
|
|
30
|
-
WalletScheme2["DKLS"] = "DKLS";
|
|
31
|
-
WalletScheme2["CGGMP"] = "CGGMP";
|
|
32
|
-
WalletScheme2["ED25519"] = "ED25519";
|
|
33
|
-
return WalletScheme2;
|
|
34
|
-
})(WalletScheme || {});
|
|
35
|
-
var WalletType = /* @__PURE__ */ ((WalletType2) => {
|
|
36
|
-
WalletType2["EVM"] = "EVM";
|
|
37
|
-
WalletType2["SOLANA"] = "SOLANA";
|
|
38
|
-
WalletType2["COSMOS"] = "COSMOS";
|
|
39
|
-
return WalletType2;
|
|
40
|
-
})(WalletType || {});
|
|
41
|
-
var Chain = /* @__PURE__ */ ((Chain2) => {
|
|
42
|
-
Chain2["ETH"] = "ETH";
|
|
43
|
-
Chain2["CELO"] = "CELO";
|
|
44
|
-
Chain2["MATIC"] = "MATIC";
|
|
45
|
-
return Chain2;
|
|
46
|
-
})(Chain || {});
|
|
47
|
-
var Network = /* @__PURE__ */ ((Network2) => {
|
|
48
|
-
Network2["ETHEREUM"] = "ETHEREUM";
|
|
49
|
-
Network2["SEPOLIA"] = "SEPOLIA";
|
|
50
|
-
Network2["ARBITRUM"] = "ARBITRUM";
|
|
51
|
-
Network2["BASE"] = "BASE";
|
|
52
|
-
Network2["OPTIMISM"] = "OPTIMISM";
|
|
53
|
-
Network2["POLYGON"] = "POLYGON";
|
|
54
|
-
Network2["SOLANA"] = "SOLANA";
|
|
55
|
-
Network2["COSMOS"] = "COSMOS";
|
|
56
|
-
Network2["CELO"] = "CELO";
|
|
57
|
-
Network2["NOBLE"] = "NOBLE";
|
|
58
|
-
return Network2;
|
|
59
|
-
})(Network || {});
|
|
60
|
-
const PREGEN_IDENTIFIER_TYPES = [
|
|
61
|
-
"EMAIL",
|
|
62
|
-
"PHONE",
|
|
63
|
-
"CUSTOM_ID",
|
|
64
|
-
import_auth.OAuthMethod.DISCORD,
|
|
65
|
-
import_auth.OAuthMethod.TWITTER,
|
|
66
|
-
import_auth.OAuthMethod.TELEGRAM
|
|
67
|
-
];
|
|
68
|
-
const NON_ED25519 = ["DKLS" /* DKLS */, "CGGMP" /* CGGMP */];
|
|
69
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
-
0 && (module.exports = {
|
|
71
|
-
Chain,
|
|
72
|
-
NON_ED25519,
|
|
73
|
-
Network,
|
|
74
|
-
PREGEN_IDENTIFIER_TYPES,
|
|
75
|
-
WalletScheme,
|
|
76
|
-
WalletType
|
|
77
|
-
});
|
package/dist/cjs/utils.js
DELETED
|
@@ -1,120 +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 utils_exports = {};
|
|
19
|
-
__export(utils_exports, {
|
|
20
|
-
extractAuthInfo: () => extractAuthInfo,
|
|
21
|
-
extractWalletRef: () => extractWalletRef,
|
|
22
|
-
isEmail: () => isEmail,
|
|
23
|
-
isExternalWallet: () => isExternalWallet,
|
|
24
|
-
isExternalWalletAddress: () => isExternalWalletAddress,
|
|
25
|
-
isFarcaster: () => isFarcaster,
|
|
26
|
-
isPhone: () => isPhone,
|
|
27
|
-
isTelegram: () => isTelegram,
|
|
28
|
-
isUserId: () => isUserId,
|
|
29
|
-
isWalletId: () => isWalletId
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(utils_exports);
|
|
32
|
-
function isWalletId(params) {
|
|
33
|
-
return !!params.walletId && !params.externalWalletAddress;
|
|
34
|
-
}
|
|
35
|
-
function isExternalWalletAddress(params) {
|
|
36
|
-
return !!params.externalWalletAddress && !params.walletId;
|
|
37
|
-
}
|
|
38
|
-
function extractWalletRef(params) {
|
|
39
|
-
if (isWalletId(params)) {
|
|
40
|
-
return ["walletId", params.walletId];
|
|
41
|
-
} else if (isExternalWalletAddress(params)) {
|
|
42
|
-
return ["externalWalletAddress", params.externalWalletAddress];
|
|
43
|
-
}
|
|
44
|
-
throw new Error("invalid wallet params");
|
|
45
|
-
}
|
|
46
|
-
function isValid(s) {
|
|
47
|
-
return !!s && s !== "null" && s !== "undefined" && s !== "";
|
|
48
|
-
}
|
|
49
|
-
function isEmail(params) {
|
|
50
|
-
return isValid(params.email) && !isValid(params.phone) && !isValid(params.countryCode) && !isValid(params.farcasterUsername) && !isValid(params.telegramUserId) && !isValid(params.externalWalletUserId);
|
|
51
|
-
}
|
|
52
|
-
function isPhone(params) {
|
|
53
|
-
return isValid(params.phone) && isValid(params.countryCode) && !isValid(params.email) && !isValid(params.farcasterUsername) && !isValid(params.telegramUserId) && !isValid(params.externalWalletUserId);
|
|
54
|
-
}
|
|
55
|
-
function isFarcaster(params) {
|
|
56
|
-
return isValid(params.farcasterUsername) && !isValid(params.email) && !isValid(params.phone) && !isValid(params.countryCode) && !isValid(params.telegramUserId) && !isValid(params.externalWalletUserId);
|
|
57
|
-
}
|
|
58
|
-
function isTelegram(params) {
|
|
59
|
-
return isValid(params.telegramUserId) && !isValid(params.email) && !isValid(params.phone) && !isValid(params.countryCode) && !isValid(params.farcasterUsername) && !isValid(params.externalWalletUserId);
|
|
60
|
-
}
|
|
61
|
-
function isUserId(params) {
|
|
62
|
-
return isValid(params.userId) && !isValid(params.email) && !isValid(params.phone) && !isValid(params.countryCode) && !isValid(params.farcasterUsername) && !isValid(params.telegramUserId) && !isValid(params.externalWalletUserId);
|
|
63
|
-
}
|
|
64
|
-
function isExternalWallet(params) {
|
|
65
|
-
return isValid(params.externalWalletAddress) && !isValid(params.email) && !isValid(params.phone) && !isValid(params.countryCode) && !isValid(params.farcasterUsername) && !isValid(params.telegramUserId);
|
|
66
|
-
}
|
|
67
|
-
function extractAuthInfo(obj, { allowUserId = false, isRequired = false } = {}) {
|
|
68
|
-
switch (true) {
|
|
69
|
-
case isEmail(obj):
|
|
70
|
-
return { auth: { email: obj.email }, authType: "email", identifier: obj.email, publicKeyIdentifier: obj.email };
|
|
71
|
-
case isPhone(obj):
|
|
72
|
-
return {
|
|
73
|
-
auth: { phone: obj.phone, countryCode: obj.countryCode },
|
|
74
|
-
authType: "phone",
|
|
75
|
-
identifier: `${obj.countryCode}${obj.phone}`,
|
|
76
|
-
publicKeyIdentifier: `${obj.countryCode}${obj.phone}`
|
|
77
|
-
};
|
|
78
|
-
case isFarcaster(obj):
|
|
79
|
-
return {
|
|
80
|
-
auth: { farcasterUsername: obj.farcasterUsername },
|
|
81
|
-
authType: "farcaster",
|
|
82
|
-
identifier: obj.farcasterUsername,
|
|
83
|
-
publicKeyIdentifier: `${obj.farcasterUsername}-farcaster`
|
|
84
|
-
};
|
|
85
|
-
case isTelegram(obj):
|
|
86
|
-
return {
|
|
87
|
-
auth: { telegramUserId: obj.telegramUserId },
|
|
88
|
-
authType: "telegram",
|
|
89
|
-
identifier: obj.telegramUserId,
|
|
90
|
-
publicKeyIdentifier: `${obj.telegramUserId}-telegram`
|
|
91
|
-
};
|
|
92
|
-
case isExternalWallet(obj):
|
|
93
|
-
return {
|
|
94
|
-
auth: { externalWalletAddress: obj.externalWalletAddress },
|
|
95
|
-
authType: "externalWallet",
|
|
96
|
-
identifier: obj.externalWalletAddress,
|
|
97
|
-
publicKeyIdentifier: `${obj.externalWalletAddress}-external-wallet`
|
|
98
|
-
};
|
|
99
|
-
case (isUserId(obj) && allowUserId):
|
|
100
|
-
return { auth: { userId: obj.userId }, authType: "userId", identifier: obj.userId, publicKeyIdentifier: obj.userId };
|
|
101
|
-
default:
|
|
102
|
-
if (isRequired) {
|
|
103
|
-
throw new Error("invalid auth object");
|
|
104
|
-
}
|
|
105
|
-
return void 0;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
109
|
-
0 && (module.exports = {
|
|
110
|
-
extractAuthInfo,
|
|
111
|
-
extractWalletRef,
|
|
112
|
-
isEmail,
|
|
113
|
-
isExternalWallet,
|
|
114
|
-
isExternalWalletAddress,
|
|
115
|
-
isFarcaster,
|
|
116
|
-
isPhone,
|
|
117
|
-
isTelegram,
|
|
118
|
-
isUserId,
|
|
119
|
-
isWalletId
|
|
120
|
-
});
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
var __async = (__this, __arguments, generator) => {
|
|
33
|
-
return new Promise((resolve, reject) => {
|
|
34
|
-
var fulfilled = (value) => {
|
|
35
|
-
try {
|
|
36
|
-
step(generator.next(value));
|
|
37
|
-
} catch (e) {
|
|
38
|
-
reject(e);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var rejected = (value) => {
|
|
42
|
-
try {
|
|
43
|
-
step(generator.throw(value));
|
|
44
|
-
} catch (e) {
|
|
45
|
-
reject(e);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
49
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export {
|
|
54
|
-
__spreadValues,
|
|
55
|
-
__spreadProps,
|
|
56
|
-
__objRest,
|
|
57
|
-
__async
|
|
58
|
-
};
|