@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,249 +1,249 @@
|
|
|
1
|
-
export declare const WALLET_CONNECT_ENTRIES_TO_REMOVE: string[];
|
|
2
|
-
export declare const applyOverrides: (sourceData: any, overrides?: {
|
|
3
|
-
cryptocom: {
|
|
4
|
-
mobile: {
|
|
5
|
-
action: string;
|
|
6
|
-
value: null;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
dawn: {
|
|
10
|
-
brand: {
|
|
11
|
-
imageId: {
|
|
12
|
-
action: string;
|
|
13
|
-
value: null;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
exodus: {
|
|
18
|
-
group: {
|
|
19
|
-
action: string;
|
|
20
|
-
value: string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
ledger: {
|
|
24
|
-
switchNetworkOnlyFromWallet: {
|
|
25
|
-
action: string;
|
|
26
|
-
value: boolean;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
lilico: {
|
|
30
|
-
brand: {
|
|
31
|
-
imageId: {
|
|
32
|
-
action: string;
|
|
33
|
-
value: null;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
metamask: {
|
|
38
|
-
brand: {
|
|
39
|
-
imageId: {
|
|
40
|
-
action: string;
|
|
41
|
-
value: null;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
walletConnect: {
|
|
45
|
-
sdks: {
|
|
46
|
-
action: string;
|
|
47
|
-
value: string[];
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
okxwallet: {
|
|
52
|
-
desktop: {
|
|
53
|
-
action: string;
|
|
54
|
-
value: {
|
|
55
|
-
chromeId: string;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
walletConnect: {
|
|
59
|
-
sdks: {
|
|
60
|
-
action: string;
|
|
61
|
-
value: string[];
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
rainbow: {
|
|
66
|
-
brand: {
|
|
67
|
-
imageId: {
|
|
68
|
-
action: string;
|
|
69
|
-
value: null;
|
|
70
|
-
};
|
|
71
|
-
spriteId: {
|
|
72
|
-
action: string;
|
|
73
|
-
value: string;
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
safe: {
|
|
78
|
-
mobile: {
|
|
79
|
-
native: {
|
|
80
|
-
action: string;
|
|
81
|
-
value: null;
|
|
82
|
-
};
|
|
83
|
-
universal: {
|
|
84
|
-
action: string;
|
|
85
|
-
value: null;
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
safepal: {
|
|
90
|
-
switchNetworkOnlyFromWallet: {
|
|
91
|
-
action: string;
|
|
92
|
-
value: boolean;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
trust: {
|
|
96
|
-
chains: {
|
|
97
|
-
action: string;
|
|
98
|
-
value: string[];
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
zengo: {
|
|
102
|
-
brand: {
|
|
103
|
-
imageId: {
|
|
104
|
-
action: string;
|
|
105
|
-
value: null;
|
|
106
|
-
};
|
|
107
|
-
primaryColor: {
|
|
108
|
-
action: string;
|
|
109
|
-
value: string;
|
|
110
|
-
};
|
|
111
|
-
spriteId: {
|
|
112
|
-
action: string;
|
|
113
|
-
value: string;
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
zerion: {
|
|
118
|
-
brand: {
|
|
119
|
-
primaryColor: {
|
|
120
|
-
action: string;
|
|
121
|
-
value: string;
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
}) => void;
|
|
126
|
-
export declare const walletConnectOverrides: {
|
|
127
|
-
cryptocom: {
|
|
128
|
-
mobile: {
|
|
129
|
-
action: string;
|
|
130
|
-
value: null;
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
dawn: {
|
|
134
|
-
brand: {
|
|
135
|
-
imageId: {
|
|
136
|
-
action: string;
|
|
137
|
-
value: null;
|
|
138
|
-
};
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
exodus: {
|
|
142
|
-
group: {
|
|
143
|
-
action: string;
|
|
144
|
-
value: string;
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
ledger: {
|
|
148
|
-
switchNetworkOnlyFromWallet: {
|
|
149
|
-
action: string;
|
|
150
|
-
value: boolean;
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
lilico: {
|
|
154
|
-
brand: {
|
|
155
|
-
imageId: {
|
|
156
|
-
action: string;
|
|
157
|
-
value: null;
|
|
158
|
-
};
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
metamask: {
|
|
162
|
-
brand: {
|
|
163
|
-
imageId: {
|
|
164
|
-
action: string;
|
|
165
|
-
value: null;
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
walletConnect: {
|
|
169
|
-
sdks: {
|
|
170
|
-
action: string;
|
|
171
|
-
value: string[];
|
|
172
|
-
};
|
|
173
|
-
};
|
|
174
|
-
};
|
|
175
|
-
okxwallet: {
|
|
176
|
-
desktop: {
|
|
177
|
-
action: string;
|
|
178
|
-
value: {
|
|
179
|
-
chromeId: string;
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
walletConnect: {
|
|
183
|
-
sdks: {
|
|
184
|
-
action: string;
|
|
185
|
-
value: string[];
|
|
186
|
-
};
|
|
187
|
-
};
|
|
188
|
-
};
|
|
189
|
-
rainbow: {
|
|
190
|
-
brand: {
|
|
191
|
-
imageId: {
|
|
192
|
-
action: string;
|
|
193
|
-
value: null;
|
|
194
|
-
};
|
|
195
|
-
spriteId: {
|
|
196
|
-
action: string;
|
|
197
|
-
value: string;
|
|
198
|
-
};
|
|
199
|
-
};
|
|
200
|
-
};
|
|
201
|
-
safe: {
|
|
202
|
-
mobile: {
|
|
203
|
-
native: {
|
|
204
|
-
action: string;
|
|
205
|
-
value: null;
|
|
206
|
-
};
|
|
207
|
-
universal: {
|
|
208
|
-
action: string;
|
|
209
|
-
value: null;
|
|
210
|
-
};
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
safepal: {
|
|
214
|
-
switchNetworkOnlyFromWallet: {
|
|
215
|
-
action: string;
|
|
216
|
-
value: boolean;
|
|
217
|
-
};
|
|
218
|
-
};
|
|
219
|
-
trust: {
|
|
220
|
-
chains: {
|
|
221
|
-
action: string;
|
|
222
|
-
value: string[];
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
zengo: {
|
|
226
|
-
brand: {
|
|
227
|
-
imageId: {
|
|
228
|
-
action: string;
|
|
229
|
-
value: null;
|
|
230
|
-
};
|
|
231
|
-
primaryColor: {
|
|
232
|
-
action: string;
|
|
233
|
-
value: string;
|
|
234
|
-
};
|
|
235
|
-
spriteId: {
|
|
236
|
-
action: string;
|
|
237
|
-
value: string;
|
|
238
|
-
};
|
|
239
|
-
};
|
|
240
|
-
};
|
|
241
|
-
zerion: {
|
|
242
|
-
brand: {
|
|
243
|
-
primaryColor: {
|
|
244
|
-
action: string;
|
|
245
|
-
value: string;
|
|
246
|
-
};
|
|
247
|
-
};
|
|
248
|
-
};
|
|
249
|
-
};
|
|
1
|
+
export declare const WALLET_CONNECT_ENTRIES_TO_REMOVE: string[];
|
|
2
|
+
export declare const applyOverrides: (sourceData: any, overrides?: {
|
|
3
|
+
cryptocom: {
|
|
4
|
+
mobile: {
|
|
5
|
+
action: string;
|
|
6
|
+
value: null;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
dawn: {
|
|
10
|
+
brand: {
|
|
11
|
+
imageId: {
|
|
12
|
+
action: string;
|
|
13
|
+
value: null;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
exodus: {
|
|
18
|
+
group: {
|
|
19
|
+
action: string;
|
|
20
|
+
value: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
ledger: {
|
|
24
|
+
switchNetworkOnlyFromWallet: {
|
|
25
|
+
action: string;
|
|
26
|
+
value: boolean;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
lilico: {
|
|
30
|
+
brand: {
|
|
31
|
+
imageId: {
|
|
32
|
+
action: string;
|
|
33
|
+
value: null;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
metamask: {
|
|
38
|
+
brand: {
|
|
39
|
+
imageId: {
|
|
40
|
+
action: string;
|
|
41
|
+
value: null;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
walletConnect: {
|
|
45
|
+
sdks: {
|
|
46
|
+
action: string;
|
|
47
|
+
value: string[];
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
okxwallet: {
|
|
52
|
+
desktop: {
|
|
53
|
+
action: string;
|
|
54
|
+
value: {
|
|
55
|
+
chromeId: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
walletConnect: {
|
|
59
|
+
sdks: {
|
|
60
|
+
action: string;
|
|
61
|
+
value: string[];
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
rainbow: {
|
|
66
|
+
brand: {
|
|
67
|
+
imageId: {
|
|
68
|
+
action: string;
|
|
69
|
+
value: null;
|
|
70
|
+
};
|
|
71
|
+
spriteId: {
|
|
72
|
+
action: string;
|
|
73
|
+
value: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
safe: {
|
|
78
|
+
mobile: {
|
|
79
|
+
native: {
|
|
80
|
+
action: string;
|
|
81
|
+
value: null;
|
|
82
|
+
};
|
|
83
|
+
universal: {
|
|
84
|
+
action: string;
|
|
85
|
+
value: null;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
safepal: {
|
|
90
|
+
switchNetworkOnlyFromWallet: {
|
|
91
|
+
action: string;
|
|
92
|
+
value: boolean;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
trust: {
|
|
96
|
+
chains: {
|
|
97
|
+
action: string;
|
|
98
|
+
value: string[];
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
zengo: {
|
|
102
|
+
brand: {
|
|
103
|
+
imageId: {
|
|
104
|
+
action: string;
|
|
105
|
+
value: null;
|
|
106
|
+
};
|
|
107
|
+
primaryColor: {
|
|
108
|
+
action: string;
|
|
109
|
+
value: string;
|
|
110
|
+
};
|
|
111
|
+
spriteId: {
|
|
112
|
+
action: string;
|
|
113
|
+
value: string;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
zerion: {
|
|
118
|
+
brand: {
|
|
119
|
+
primaryColor: {
|
|
120
|
+
action: string;
|
|
121
|
+
value: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
}) => void;
|
|
126
|
+
export declare const walletConnectOverrides: {
|
|
127
|
+
cryptocom: {
|
|
128
|
+
mobile: {
|
|
129
|
+
action: string;
|
|
130
|
+
value: null;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
dawn: {
|
|
134
|
+
brand: {
|
|
135
|
+
imageId: {
|
|
136
|
+
action: string;
|
|
137
|
+
value: null;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
exodus: {
|
|
142
|
+
group: {
|
|
143
|
+
action: string;
|
|
144
|
+
value: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
ledger: {
|
|
148
|
+
switchNetworkOnlyFromWallet: {
|
|
149
|
+
action: string;
|
|
150
|
+
value: boolean;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
lilico: {
|
|
154
|
+
brand: {
|
|
155
|
+
imageId: {
|
|
156
|
+
action: string;
|
|
157
|
+
value: null;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
metamask: {
|
|
162
|
+
brand: {
|
|
163
|
+
imageId: {
|
|
164
|
+
action: string;
|
|
165
|
+
value: null;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
walletConnect: {
|
|
169
|
+
sdks: {
|
|
170
|
+
action: string;
|
|
171
|
+
value: string[];
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
okxwallet: {
|
|
176
|
+
desktop: {
|
|
177
|
+
action: string;
|
|
178
|
+
value: {
|
|
179
|
+
chromeId: string;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
walletConnect: {
|
|
183
|
+
sdks: {
|
|
184
|
+
action: string;
|
|
185
|
+
value: string[];
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
rainbow: {
|
|
190
|
+
brand: {
|
|
191
|
+
imageId: {
|
|
192
|
+
action: string;
|
|
193
|
+
value: null;
|
|
194
|
+
};
|
|
195
|
+
spriteId: {
|
|
196
|
+
action: string;
|
|
197
|
+
value: string;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
safe: {
|
|
202
|
+
mobile: {
|
|
203
|
+
native: {
|
|
204
|
+
action: string;
|
|
205
|
+
value: null;
|
|
206
|
+
};
|
|
207
|
+
universal: {
|
|
208
|
+
action: string;
|
|
209
|
+
value: null;
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
safepal: {
|
|
214
|
+
switchNetworkOnlyFromWallet: {
|
|
215
|
+
action: string;
|
|
216
|
+
value: boolean;
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
trust: {
|
|
220
|
+
chains: {
|
|
221
|
+
action: string;
|
|
222
|
+
value: string[];
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
zengo: {
|
|
226
|
+
brand: {
|
|
227
|
+
imageId: {
|
|
228
|
+
action: string;
|
|
229
|
+
value: null;
|
|
230
|
+
};
|
|
231
|
+
primaryColor: {
|
|
232
|
+
action: string;
|
|
233
|
+
value: string;
|
|
234
|
+
};
|
|
235
|
+
spriteId: {
|
|
236
|
+
action: string;
|
|
237
|
+
value: string;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
zerion: {
|
|
242
|
+
brand: {
|
|
243
|
+
primaryColor: {
|
|
244
|
+
action: string;
|
|
245
|
+
value: string;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { WalletGroupRecordSchema } from '../../../schemas';
|
|
2
|
-
export declare const walletGroups: WalletGroupRecordSchema;
|
|
1
|
+
import { WalletGroupRecordSchema } from '../../../schemas';
|
|
2
|
+
export declare const walletGroups: WalletGroupRecordSchema;
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var react = require('react');
|
|
6
6
|
|
|
7
|
-
const WalletBookContext = react.createContext({});
|
|
8
|
-
const WalletBookContextProvider = ({ walletBook, children, }) => react.createElement(WalletBookContext.Provider, {
|
|
9
|
-
value: { walletBook },
|
|
7
|
+
const WalletBookContext = react.createContext({});
|
|
8
|
+
const WalletBookContextProvider = ({ walletBook, children, }) => react.createElement(WalletBookContext.Provider, {
|
|
9
|
+
value: { walletBook },
|
|
10
10
|
}, children);
|
|
11
11
|
|
|
12
12
|
exports.WalletBookContext = WalletBookContext;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { WalletBookSchema } from '../schemas';
|
|
2
|
-
export type IWalletBookContext = {
|
|
3
|
-
walletBook: WalletBookSchema;
|
|
4
|
-
};
|
|
5
|
-
export declare const WalletBookContext: import("react").Context<IWalletBookContext>;
|
|
6
|
-
export declare const WalletBookContextProvider: ({ walletBook, children, }: {
|
|
7
|
-
walletBook: WalletBookSchema;
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
}) => import("react").FunctionComponentElement<import("react").ProviderProps<IWalletBookContext>>;
|
|
1
|
+
import { WalletBookSchema } from '../schemas';
|
|
2
|
+
export type IWalletBookContext = {
|
|
3
|
+
walletBook: WalletBookSchema;
|
|
4
|
+
};
|
|
5
|
+
export declare const WalletBookContext: import("react").Context<IWalletBookContext>;
|
|
6
|
+
export declare const WalletBookContextProvider: ({ walletBook, children, }: {
|
|
7
|
+
walletBook: WalletBookSchema;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) => import("react").FunctionComponentElement<import("react").ProviderProps<IWalletBookContext>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createContext, createElement } from 'react';
|
|
2
2
|
|
|
3
|
-
const WalletBookContext = createContext({});
|
|
4
|
-
const WalletBookContextProvider = ({ walletBook, children, }) => createElement(WalletBookContext.Provider, {
|
|
5
|
-
value: { walletBook },
|
|
3
|
+
const WalletBookContext = createContext({});
|
|
4
|
+
const WalletBookContextProvider = ({ walletBook, children, }) => createElement(WalletBookContext.Provider, {
|
|
5
|
+
value: { walletBook },
|
|
6
6
|
}, children);
|
|
7
7
|
|
|
8
8
|
export { WalletBookContext, WalletBookContextProvider };
|
|
@@ -11,25 +11,25 @@ require('../schemas/walletBookSchema.cjs');
|
|
|
11
11
|
require('../schemas/walletSchema.cjs');
|
|
12
12
|
var useWalletBookContext = require('../hooks/useWalletBookContext.cjs');
|
|
13
13
|
|
|
14
|
-
const WalletIcon = ({ walletKey, children, ...props }) => {
|
|
15
|
-
const { walletBook } = useWalletBookContext.useWalletBookContext();
|
|
16
|
-
const walletData = findWalletBookWallet.findWalletBookWallet(walletBook, walletKey);
|
|
17
|
-
const [imgError, setImgError] = react.useState(false);
|
|
18
|
-
const walletIconUrl = getWalletIconUrl.getWalletIconUrl(walletBook, walletKey);
|
|
19
|
-
const defaultWalletIconUrl = getWalletIconUrl.getDefaultWalletIconUrl();
|
|
20
|
-
if (!walletData || !walletData.brand || !walletIconUrl) {
|
|
21
|
-
return react.createElement(react.Fragment, {}, children);
|
|
22
|
-
}
|
|
23
|
-
const onError = () => {
|
|
24
|
-
setImgError(true);
|
|
25
|
-
};
|
|
26
|
-
return react.createElement('img', {
|
|
27
|
-
'data-testid': `wallet-icon-${walletKey}`,
|
|
28
|
-
...props,
|
|
29
|
-
alt: walletData.brand.alt,
|
|
30
|
-
onError: onError,
|
|
31
|
-
src: imgError ? defaultWalletIconUrl : walletIconUrl,
|
|
32
|
-
}, children);
|
|
14
|
+
const WalletIcon = ({ walletKey, children, ...props }) => {
|
|
15
|
+
const { walletBook } = useWalletBookContext.useWalletBookContext();
|
|
16
|
+
const walletData = findWalletBookWallet.findWalletBookWallet(walletBook, walletKey);
|
|
17
|
+
const [imgError, setImgError] = react.useState(false);
|
|
18
|
+
const walletIconUrl = getWalletIconUrl.getWalletIconUrl(walletBook, walletKey);
|
|
19
|
+
const defaultWalletIconUrl = getWalletIconUrl.getDefaultWalletIconUrl();
|
|
20
|
+
if (!walletData || !walletData.brand || !walletIconUrl) {
|
|
21
|
+
return react.createElement(react.Fragment, {}, children);
|
|
22
|
+
}
|
|
23
|
+
const onError = () => {
|
|
24
|
+
setImgError(true);
|
|
25
|
+
};
|
|
26
|
+
return react.createElement('img', {
|
|
27
|
+
'data-testid': `wallet-icon-${walletKey}`,
|
|
28
|
+
...props,
|
|
29
|
+
alt: walletData.brand.alt,
|
|
30
|
+
onError: onError,
|
|
31
|
+
src: imgError ? defaultWalletIconUrl : walletIconUrl,
|
|
32
|
+
}, children);
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
exports.WalletIcon = WalletIcon;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, { FC, ReactNode } from 'react';
|
|
2
|
-
type WalletIconProps = React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> & {
|
|
3
|
-
walletKey: string | undefined;
|
|
4
|
-
} & {
|
|
5
|
-
children?: ReactNode | any;
|
|
6
|
-
};
|
|
7
|
-
export declare const WalletIcon: FC<WalletIconProps>;
|
|
8
|
-
export {};
|
|
1
|
+
import React, { FC, ReactNode } from 'react';
|
|
2
|
+
type WalletIconProps = React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> & {
|
|
3
|
+
walletKey: string | undefined;
|
|
4
|
+
} & {
|
|
5
|
+
children?: ReactNode | any;
|
|
6
|
+
};
|
|
7
|
+
export declare const WalletIcon: FC<WalletIconProps>;
|
|
8
|
+
export {};
|
|
@@ -7,25 +7,25 @@ import '../schemas/walletBookSchema.js';
|
|
|
7
7
|
import '../schemas/walletSchema.js';
|
|
8
8
|
import { useWalletBookContext } from '../hooks/useWalletBookContext.js';
|
|
9
9
|
|
|
10
|
-
const WalletIcon = ({ walletKey, children, ...props }) => {
|
|
11
|
-
const { walletBook } = useWalletBookContext();
|
|
12
|
-
const walletData = findWalletBookWallet(walletBook, walletKey);
|
|
13
|
-
const [imgError, setImgError] = useState(false);
|
|
14
|
-
const walletIconUrl = getWalletIconUrl(walletBook, walletKey);
|
|
15
|
-
const defaultWalletIconUrl = getDefaultWalletIconUrl();
|
|
16
|
-
if (!walletData || !walletData.brand || !walletIconUrl) {
|
|
17
|
-
return createElement(Fragment, {}, children);
|
|
18
|
-
}
|
|
19
|
-
const onError = () => {
|
|
20
|
-
setImgError(true);
|
|
21
|
-
};
|
|
22
|
-
return createElement('img', {
|
|
23
|
-
'data-testid': `wallet-icon-${walletKey}`,
|
|
24
|
-
...props,
|
|
25
|
-
alt: walletData.brand.alt,
|
|
26
|
-
onError: onError,
|
|
27
|
-
src: imgError ? defaultWalletIconUrl : walletIconUrl,
|
|
28
|
-
}, children);
|
|
10
|
+
const WalletIcon = ({ walletKey, children, ...props }) => {
|
|
11
|
+
const { walletBook } = useWalletBookContext();
|
|
12
|
+
const walletData = findWalletBookWallet(walletBook, walletKey);
|
|
13
|
+
const [imgError, setImgError] = useState(false);
|
|
14
|
+
const walletIconUrl = getWalletIconUrl(walletBook, walletKey);
|
|
15
|
+
const defaultWalletIconUrl = getDefaultWalletIconUrl();
|
|
16
|
+
if (!walletData || !walletData.brand || !walletIconUrl) {
|
|
17
|
+
return createElement(Fragment, {}, children);
|
|
18
|
+
}
|
|
19
|
+
const onError = () => {
|
|
20
|
+
setImgError(true);
|
|
21
|
+
};
|
|
22
|
+
return createElement('img', {
|
|
23
|
+
'data-testid': `wallet-icon-${walletKey}`,
|
|
24
|
+
...props,
|
|
25
|
+
alt: walletData.brand.alt,
|
|
26
|
+
onError: onError,
|
|
27
|
+
src: imgError ? defaultWalletIconUrl : walletIconUrl,
|
|
28
|
+
}, children);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export { WalletIcon };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './WalletIcon';
|
|
2
|
-
export * from './WalletBookContext';
|
|
1
|
+
export * from './WalletIcon';
|
|
2
|
+
export * from './WalletBookContext';
|