@dynamic-labs/wallet-book 0.19.0-alpha.8 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +321 -0
- package/README.md +34 -0
- package/package.json +3 -3
- package/src/build/index.d.ts +50 -41
- package/src/build/sources/firstParty/index.d.ts +2 -2
- package/src/build/sources/index.d.ts +4 -4
- package/src/build/sources/walletConnect/index.d.ts +100 -91
- package/src/build/sources/walletConnect/preprocessors.d.ts +13 -13
- package/src/build/sources/walletConnectOverrides/index.d.ts +249 -249
- package/src/build/sources/walletGroups/index.d.ts +2 -2
- package/src/components/WalletBookContext.cjs +3 -3
- package/src/components/WalletBookContext.d.ts +9 -9
- package/src/components/WalletBookContext.js +3 -3
- package/src/components/WalletIcon.cjs +19 -19
- package/src/components/WalletIcon.d.ts +8 -8
- package/src/components/WalletIcon.js +19 -19
- package/src/components/index.d.ts +2 -2
- package/src/helpers/findWalletBookWallet.cjs +9 -9
- package/src/helpers/findWalletBookWallet.d.ts +44 -35
- package/src/helpers/findWalletBookWallet.js +9 -9
- package/src/helpers/findWalletGroup.cjs +8 -8
- package/src/helpers/findWalletGroup.d.ts +11 -11
- package/src/helpers/findWalletGroup.js +8 -8
- package/src/helpers/getWalletBookCdnUrl.cjs +8 -8
- package/src/helpers/getWalletBookCdnUrl.d.ts +1 -1
- package/src/helpers/getWalletBookCdnUrl.js +8 -8
- package/src/helpers/getWalletBookWallet.cjs +6 -6
- package/src/helpers/getWalletBookWallet.d.ts +2 -2
- package/src/helpers/getWalletBookWallet.js +6 -6
- package/src/helpers/getWalletGroup.cjs +5 -5
- package/src/helpers/getWalletGroup.d.ts +3 -3
- package/src/helpers/getWalletGroup.js +5 -5
- package/src/helpers/getWalletIconUrl.cjs +23 -23
- package/src/helpers/getWalletIconUrl.d.ts +3 -3
- package/src/helpers/getWalletIconUrl.js +23 -23
- package/src/helpers/getWalletLinks.cjs +26 -26
- package/src/helpers/getWalletLinks.d.ts +10 -10
- package/src/helpers/getWalletLinks.js +26 -26
- package/src/helpers/getWalletPrimaryColor.cjs +3 -3
- package/src/helpers/getWalletPrimaryColor.d.ts +2 -2
- package/src/helpers/getWalletPrimaryColor.js +3 -3
- package/src/helpers/index.d.ts +11 -11
- package/src/helpers/logger.d.ts +2 -2
- package/src/helpers/normalizeWalletName.d.ts +1 -1
- package/src/helpers/renderTemplate.cjs +13 -13
- package/src/helpers/renderTemplate.d.ts +12 -12
- package/src/helpers/renderTemplate.js +13 -13
- package/src/hooks/index.d.ts +2 -2
- package/src/hooks/useWalletBookCdn.cjs +27 -27
- package/src/hooks/useWalletBookCdn.d.ts +55 -46
- package/src/hooks/useWalletBookCdn.js +27 -27
- package/src/hooks/useWalletBookContext.cjs +6 -6
- package/src/hooks/useWalletBookContext.d.ts +1 -1
- package/src/hooks/useWalletBookContext.js +6 -6
- package/src/index.d.ts +18 -18
- package/src/schemas/index.d.ts +3 -3
- package/src/schemas/utils/filterEmptyObject.cjs +5 -5
- package/src/schemas/utils/filterEmptyObject.d.ts +6 -6
- package/src/schemas/utils/filterEmptyObject.js +5 -5
- package/src/schemas/utils/nonEmptyString.cjs +3 -3
- package/src/schemas/utils/nonEmptyString.d.ts +5 -5
- package/src/schemas/utils/nonEmptyString.js +3 -3
- package/src/schemas/utils/nonEmptyStringArray.cjs +3 -3
- package/src/schemas/utils/nonEmptyStringArray.d.ts +5 -5
- package/src/schemas/utils/nonEmptyStringArray.js +3 -3
- package/src/schemas/utils/processWalletConnectNativeUrl.d.ts +1 -1
- package/src/schemas/utils/sortKeys.d.ts +5 -5
- package/src/schemas/utils/transformAndroidId.cjs +16 -16
- package/src/schemas/utils/transformAndroidId.d.ts +1 -1
- package/src/schemas/utils/transformAndroidId.js +16 -16
- package/src/schemas/utils/transformChromeExtensionId.cjs +13 -13
- package/src/schemas/utils/transformChromeExtensionId.d.ts +1 -1
- package/src/schemas/utils/transformChromeExtensionId.js +13 -13
- package/src/schemas/utils/transformEdgeExtensionId.cjs +13 -13
- package/src/schemas/utils/transformEdgeExtensionId.d.ts +1 -1
- package/src/schemas/utils/transformEdgeExtensionId.js +13 -13
- package/src/schemas/utils/transformFirefoxExtensionId.cjs +13 -13
- package/src/schemas/utils/transformFirefoxExtensionId.d.ts +1 -1
- package/src/schemas/utils/transformFirefoxExtensionId.js +13 -13
- package/src/schemas/utils/transformIosId.cjs +20 -20
- package/src/schemas/utils/transformIosId.d.ts +1 -1
- package/src/schemas/utils/transformIosId.js +20 -20
- package/src/schemas/walletBookSchema.cjs +5 -5
- package/src/schemas/walletBookSchema.d.ts +862 -714
- package/src/schemas/walletBookSchema.js +5 -5
- package/src/schemas/walletConnectSourceSchema.cjs +64 -64
- package/src/schemas/walletConnectSourceSchema.d.ts +504 -504
- package/src/schemas/walletConnectSourceSchema.js +64 -64
- package/src/schemas/walletGroup.cjs +22 -22
- package/src/schemas/walletGroup.d.ts +50 -50
- package/src/schemas/walletGroup.js +22 -22
- package/src/schemas/walletSchema.cjs +88 -66
- package/src/schemas/walletSchema.d.ts +351 -256
- package/src/schemas/walletSchema.js +88 -66
- package/wallet-book-fallbacks.cjs +82 -1
- package/wallet-book-fallbacks.js +82 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
const transformAndroidId = (url) => {
|
|
2
|
-
if (!url?.match(/^https?:\/\//))
|
|
3
|
-
return url;
|
|
4
|
-
if (!url)
|
|
5
|
-
return;
|
|
6
|
-
try {
|
|
7
|
-
const urlObject = new URL(url);
|
|
8
|
-
const id = urlObject.searchParams.get('id');
|
|
9
|
-
if (id) {
|
|
10
|
-
return id;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
catch {
|
|
14
|
-
// ignore
|
|
15
|
-
}
|
|
16
|
-
return;
|
|
1
|
+
const transformAndroidId = (url) => {
|
|
2
|
+
if (!url?.match(/^https?:\/\//))
|
|
3
|
+
return url;
|
|
4
|
+
if (!url)
|
|
5
|
+
return;
|
|
6
|
+
try {
|
|
7
|
+
const urlObject = new URL(url);
|
|
8
|
+
const id = urlObject.searchParams.get('id');
|
|
9
|
+
if (id) {
|
|
10
|
+
return id;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
// ignore
|
|
15
|
+
}
|
|
16
|
+
return;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export { transformAndroidId };
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const transformChromeExtensionId = (url) => {
|
|
6
|
-
if (url?.match(/^[a-z]{32}$/))
|
|
7
|
-
return url;
|
|
8
|
-
if (url?.includes('chrome.google.com/webstore/detail/')) {
|
|
9
|
-
try {
|
|
10
|
-
const urlObject = new URL(url);
|
|
11
|
-
return urlObject.pathname.split('/').at(-1);
|
|
12
|
-
}
|
|
13
|
-
catch {
|
|
14
|
-
// ignore
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return;
|
|
5
|
+
const transformChromeExtensionId = (url) => {
|
|
6
|
+
if (url?.match(/^[a-z]{32}$/))
|
|
7
|
+
return url;
|
|
8
|
+
if (url?.includes('chrome.google.com/webstore/detail/')) {
|
|
9
|
+
try {
|
|
10
|
+
const urlObject = new URL(url);
|
|
11
|
+
return urlObject.pathname.split('/').at(-1);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
// ignore
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
exports.transformChromeExtensionId = transformChromeExtensionId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const transformChromeExtensionId: (url: string | undefined) => string | undefined;
|
|
1
|
+
export declare const transformChromeExtensionId: (url: string | undefined) => string | undefined;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const transformChromeExtensionId = (url) => {
|
|
2
|
-
if (url?.match(/^[a-z]{32}$/))
|
|
3
|
-
return url;
|
|
4
|
-
if (url?.includes('chrome.google.com/webstore/detail/')) {
|
|
5
|
-
try {
|
|
6
|
-
const urlObject = new URL(url);
|
|
7
|
-
return urlObject.pathname.split('/').at(-1);
|
|
8
|
-
}
|
|
9
|
-
catch {
|
|
10
|
-
// ignore
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return;
|
|
1
|
+
const transformChromeExtensionId = (url) => {
|
|
2
|
+
if (url?.match(/^[a-z]{32}$/))
|
|
3
|
+
return url;
|
|
4
|
+
if (url?.includes('chrome.google.com/webstore/detail/')) {
|
|
5
|
+
try {
|
|
6
|
+
const urlObject = new URL(url);
|
|
7
|
+
return urlObject.pathname.split('/').at(-1);
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
// ignore
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export { transformChromeExtensionId };
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const transformEdgeExtensionId = (url) => {
|
|
6
|
-
if (url?.match(/^[a-z]{32}$/))
|
|
7
|
-
return url;
|
|
8
|
-
if (url?.includes('microsoftedge.microsoft.com/addons/detail/')) {
|
|
9
|
-
try {
|
|
10
|
-
const urlObject = new URL(url);
|
|
11
|
-
return urlObject.pathname.split('/').at(-1);
|
|
12
|
-
}
|
|
13
|
-
catch {
|
|
14
|
-
// ignore
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return;
|
|
5
|
+
const transformEdgeExtensionId = (url) => {
|
|
6
|
+
if (url?.match(/^[a-z]{32}$/))
|
|
7
|
+
return url;
|
|
8
|
+
if (url?.includes('microsoftedge.microsoft.com/addons/detail/')) {
|
|
9
|
+
try {
|
|
10
|
+
const urlObject = new URL(url);
|
|
11
|
+
return urlObject.pathname.split('/').at(-1);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
// ignore
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
exports.transformEdgeExtensionId = transformEdgeExtensionId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const transformEdgeExtensionId: (url: string | undefined) => string | undefined;
|
|
1
|
+
export declare const transformEdgeExtensionId: (url: string | undefined) => string | undefined;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const transformEdgeExtensionId = (url) => {
|
|
2
|
-
if (url?.match(/^[a-z]{32}$/))
|
|
3
|
-
return url;
|
|
4
|
-
if (url?.includes('microsoftedge.microsoft.com/addons/detail/')) {
|
|
5
|
-
try {
|
|
6
|
-
const urlObject = new URL(url);
|
|
7
|
-
return urlObject.pathname.split('/').at(-1);
|
|
8
|
-
}
|
|
9
|
-
catch {
|
|
10
|
-
// ignore
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return;
|
|
1
|
+
const transformEdgeExtensionId = (url) => {
|
|
2
|
+
if (url?.match(/^[a-z]{32}$/))
|
|
3
|
+
return url;
|
|
4
|
+
if (url?.includes('microsoftedge.microsoft.com/addons/detail/')) {
|
|
5
|
+
try {
|
|
6
|
+
const urlObject = new URL(url);
|
|
7
|
+
return urlObject.pathname.split('/').at(-1);
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
// ignore
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export { transformEdgeExtensionId };
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const transformFirefoxExtensionId = (url) => {
|
|
6
|
-
if (!url?.match(/^https?:\/\//))
|
|
7
|
-
return url;
|
|
8
|
-
if (url?.includes('addons.mozilla.org')) {
|
|
9
|
-
try {
|
|
10
|
-
const urlObject = new URL(url);
|
|
11
|
-
return urlObject.pathname.replace(/\/$/, '').split('/').at(-1);
|
|
12
|
-
}
|
|
13
|
-
catch {
|
|
14
|
-
// ignore
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return;
|
|
5
|
+
const transformFirefoxExtensionId = (url) => {
|
|
6
|
+
if (!url?.match(/^https?:\/\//))
|
|
7
|
+
return url;
|
|
8
|
+
if (url?.includes('addons.mozilla.org')) {
|
|
9
|
+
try {
|
|
10
|
+
const urlObject = new URL(url);
|
|
11
|
+
return urlObject.pathname.replace(/\/$/, '').split('/').at(-1);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
// ignore
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
exports.transformFirefoxExtensionId = transformFirefoxExtensionId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const transformFirefoxExtensionId: (url: string | undefined) => string | undefined;
|
|
1
|
+
export declare const transformFirefoxExtensionId: (url: string | undefined) => string | undefined;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const transformFirefoxExtensionId = (url) => {
|
|
2
|
-
if (!url?.match(/^https?:\/\//))
|
|
3
|
-
return url;
|
|
4
|
-
if (url?.includes('addons.mozilla.org')) {
|
|
5
|
-
try {
|
|
6
|
-
const urlObject = new URL(url);
|
|
7
|
-
return urlObject.pathname.replace(/\/$/, '').split('/').at(-1);
|
|
8
|
-
}
|
|
9
|
-
catch {
|
|
10
|
-
// ignore
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return;
|
|
1
|
+
const transformFirefoxExtensionId = (url) => {
|
|
2
|
+
if (!url?.match(/^https?:\/\//))
|
|
3
|
+
return url;
|
|
4
|
+
if (url?.includes('addons.mozilla.org')) {
|
|
5
|
+
try {
|
|
6
|
+
const urlObject = new URL(url);
|
|
7
|
+
return urlObject.pathname.replace(/\/$/, '').split('/').at(-1);
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
// ignore
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export { transformFirefoxExtensionId };
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const idRegex = /^id[0-9]{1,36}$/;
|
|
6
|
-
const transformIosId = (url) => {
|
|
7
|
-
if (url?.match(idRegex))
|
|
8
|
-
return url;
|
|
9
|
-
if (url?.match(/^https:\/\/[a-zA-Z0-9-]+\.apple\.com/)) {
|
|
10
|
-
try {
|
|
11
|
-
const urlObject = new URL(url);
|
|
12
|
-
const expectedId = urlObject.pathname
|
|
13
|
-
.replace(/\/$/, '')
|
|
14
|
-
.split('/')
|
|
15
|
-
.at(-1);
|
|
16
|
-
if (expectedId?.match(idRegex)) {
|
|
17
|
-
return expectedId;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
// ignore
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return;
|
|
5
|
+
const idRegex = /^id[0-9]{1,36}$/;
|
|
6
|
+
const transformIosId = (url) => {
|
|
7
|
+
if (url?.match(idRegex))
|
|
8
|
+
return url;
|
|
9
|
+
if (url?.match(/^https:\/\/[a-zA-Z0-9-]+\.apple\.com/)) {
|
|
10
|
+
try {
|
|
11
|
+
const urlObject = new URL(url);
|
|
12
|
+
const expectedId = urlObject.pathname
|
|
13
|
+
.replace(/\/$/, '')
|
|
14
|
+
.split('/')
|
|
15
|
+
.at(-1);
|
|
16
|
+
if (expectedId?.match(idRegex)) {
|
|
17
|
+
return expectedId;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// ignore
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
exports.transformIosId = transformIosId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const transformIosId: (url: string | undefined) => string | undefined;
|
|
1
|
+
export declare const transformIosId: (url: string | undefined) => string | undefined;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
const idRegex = /^id[0-9]{1,36}$/;
|
|
2
|
-
const transformIosId = (url) => {
|
|
3
|
-
if (url?.match(idRegex))
|
|
4
|
-
return url;
|
|
5
|
-
if (url?.match(/^https:\/\/[a-zA-Z0-9-]+\.apple\.com/)) {
|
|
6
|
-
try {
|
|
7
|
-
const urlObject = new URL(url);
|
|
8
|
-
const expectedId = urlObject.pathname
|
|
9
|
-
.replace(/\/$/, '')
|
|
10
|
-
.split('/')
|
|
11
|
-
.at(-1);
|
|
12
|
-
if (expectedId?.match(idRegex)) {
|
|
13
|
-
return expectedId;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
catch {
|
|
17
|
-
// ignore
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return;
|
|
1
|
+
const idRegex = /^id[0-9]{1,36}$/;
|
|
2
|
+
const transformIosId = (url) => {
|
|
3
|
+
if (url?.match(idRegex))
|
|
4
|
+
return url;
|
|
5
|
+
if (url?.match(/^https:\/\/[a-zA-Z0-9-]+\.apple\.com/)) {
|
|
6
|
+
try {
|
|
7
|
+
const urlObject = new URL(url);
|
|
8
|
+
const expectedId = urlObject.pathname
|
|
9
|
+
.replace(/\/$/, '')
|
|
10
|
+
.split('/')
|
|
11
|
+
.at(-1);
|
|
12
|
+
if (expectedId?.match(idRegex)) {
|
|
13
|
+
return expectedId;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
// ignore
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export { transformIosId };
|
|
@@ -6,11 +6,11 @@ var zod = require('zod');
|
|
|
6
6
|
var walletSchema = require('./walletSchema.cjs');
|
|
7
7
|
var walletGroup = require('./walletGroup.cjs');
|
|
8
8
|
|
|
9
|
-
zod.z.record(zod.z.string(), walletSchema.walletSchema);
|
|
10
|
-
const walletBookSchema = zod.z.preprocess((val) => val, zod.z.object({
|
|
11
|
-
groups: zod.z.record(zod.z.string(), walletGroup.walletGroupSchema),
|
|
12
|
-
wallets: zod.z.record(zod.z.string(), walletSchema.walletSchema),
|
|
13
|
-
}));
|
|
9
|
+
zod.z.record(zod.z.string(), walletSchema.walletSchema);
|
|
10
|
+
const walletBookSchema = zod.z.preprocess((val) => val, zod.z.object({
|
|
11
|
+
groups: zod.z.record(zod.z.string(), walletGroup.walletGroupSchema),
|
|
12
|
+
wallets: zod.z.record(zod.z.string(), walletSchema.walletSchema),
|
|
13
|
+
}));
|
|
14
14
|
zod.z.record(zod.z.string(), walletGroup.walletGroupSchema);
|
|
15
15
|
|
|
16
16
|
exports.walletBookSchema = walletBookSchema;
|