@b3dotfun/sdk 0.0.58-alpha.3 → 0.0.58-test.1
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/anyspend/react/components/common/CryptoPaymentMethod.js +0 -4
- package/dist/cjs/anyspend/utils/index.d.ts +0 -1
- package/dist/cjs/anyspend/utils/index.js +0 -1
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +0 -17
- package/dist/cjs/global-account/react/hooks/useWagmiConfig.d.ts +1 -441
- package/dist/cjs/global-account/react/hooks/useWagmiConfig.js +0 -2
- package/dist/cjs/shared/react/components/CurrencySelector.js +3 -8
- package/dist/cjs/shared/react/components/FormattedCurrency.d.ts +3 -3
- package/dist/cjs/shared/react/components/FormattedCurrency.js +26 -31
- package/dist/cjs/shared/react/hooks/useCurrencyConversion.d.ts +5 -8
- package/dist/cjs/shared/react/hooks/useCurrencyConversion.js +94 -153
- package/dist/cjs/shared/react/stores/currencyStore.d.ts +8 -83
- package/dist/cjs/shared/react/stores/currencyStore.js +5 -147
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +1 -5
- package/dist/esm/anyspend/utils/index.d.ts +0 -1
- package/dist/esm/anyspend/utils/index.js +0 -1
- package/dist/esm/global-account/react/components/B3DynamicModal.js +0 -17
- package/dist/esm/global-account/react/hooks/useWagmiConfig.d.ts +1 -441
- package/dist/esm/global-account/react/hooks/useWagmiConfig.js +0 -2
- package/dist/esm/shared/react/components/CurrencySelector.js +5 -10
- package/dist/esm/shared/react/components/FormattedCurrency.d.ts +3 -3
- package/dist/esm/shared/react/components/FormattedCurrency.js +26 -31
- package/dist/esm/shared/react/hooks/useCurrencyConversion.d.ts +5 -8
- package/dist/esm/shared/react/hooks/useCurrencyConversion.js +95 -154
- package/dist/esm/shared/react/stores/currencyStore.d.ts +8 -83
- package/dist/esm/shared/react/stores/currencyStore.js +5 -143
- package/dist/types/anyspend/utils/index.d.ts +0 -1
- package/dist/types/global-account/react/hooks/useWagmiConfig.d.ts +1 -441
- package/dist/types/shared/react/components/FormattedCurrency.d.ts +3 -3
- package/dist/types/shared/react/hooks/useCurrencyConversion.d.ts +5 -8
- package/dist/types/shared/react/stores/currencyStore.d.ts +8 -83
- package/package.json +8 -4
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +2 -6
- package/src/anyspend/utils/index.ts +0 -1
- package/src/global-account/react/components/B3DynamicModal.tsx +0 -20
- package/src/global-account/react/hooks/useWagmiConfig.tsx +0 -2
- package/src/shared/react/components/CurrencySelector.tsx +5 -36
- package/src/shared/react/components/FormattedCurrency.tsx +30 -36
- package/src/shared/react/hooks/__tests__/useCurrencyConversion.test.ts +14 -14
- package/src/shared/react/hooks/useCurrencyConversion.ts +96 -163
- package/src/shared/react/stores/currencyStore.ts +10 -216
- package/dist/cjs/anyspend/utils/accountStore.d.ts +0 -7
- package/dist/cjs/anyspend/utils/accountStore.js +0 -8
- package/dist/esm/anyspend/utils/accountStore.d.ts +0 -7
- package/dist/esm/anyspend/utils/accountStore.js +0 -5
- package/dist/types/anyspend/utils/accountStore.d.ts +0 -7
- package/src/anyspend/utils/accountStore.ts +0 -12
|
@@ -10,444 +10,4 @@ export declare function useWagmiConfig(partnerId: string, rpcUrls?: Record<numbe
|
|
|
10
10
|
}>;
|
|
11
11
|
}, {
|
|
12
12
|
"thirdweb:lastChainId": number;
|
|
13
|
-
}
|
|
14
|
-
request: import("ox/_types/core/Provider").RequestFn<{
|
|
15
|
-
Request: {
|
|
16
|
-
method: "eth_accounts";
|
|
17
|
-
params?: undefined;
|
|
18
|
-
};
|
|
19
|
-
ReturnType: readonly import("ox/_types/core/Address").Address[];
|
|
20
|
-
} | {
|
|
21
|
-
Request: {
|
|
22
|
-
method: "eth_blobBaseFee";
|
|
23
|
-
params?: undefined;
|
|
24
|
-
};
|
|
25
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
26
|
-
} | {
|
|
27
|
-
Request: {
|
|
28
|
-
method: "eth_blockNumber";
|
|
29
|
-
params?: undefined;
|
|
30
|
-
};
|
|
31
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
32
|
-
} | {
|
|
33
|
-
Request: {
|
|
34
|
-
method: "eth_call";
|
|
35
|
-
params: [transaction: import("ox/_types/core/TransactionRequest").Rpc] | [transaction: import("ox/_types/core/TransactionRequest").Rpc, block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier] | [transaction: import("ox/_types/core/TransactionRequest").Rpc, block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier, stateOverride: unknown];
|
|
36
|
-
};
|
|
37
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
38
|
-
} | {
|
|
39
|
-
Request: {
|
|
40
|
-
method: "eth_chainId";
|
|
41
|
-
params?: undefined;
|
|
42
|
-
};
|
|
43
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
44
|
-
} | {
|
|
45
|
-
Request: {
|
|
46
|
-
method: "eth_coinbase";
|
|
47
|
-
params?: undefined;
|
|
48
|
-
};
|
|
49
|
-
ReturnType: import("ox/_types/core/Address").Address;
|
|
50
|
-
} | {
|
|
51
|
-
Request: {
|
|
52
|
-
method: "eth_estimateGas";
|
|
53
|
-
params: [transaction: import("ox/_types/core/TransactionRequest").Rpc] | [transaction: import("ox/_types/core/TransactionRequest").Rpc, block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier] | [transaction: import("ox/_types/core/TransactionRequest").Rpc, block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier, stateOverride: unknown];
|
|
54
|
-
};
|
|
55
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
56
|
-
} | {
|
|
57
|
-
Request: {
|
|
58
|
-
method: "eth_feeHistory";
|
|
59
|
-
params: [blockCount: import("ox/_types/core/Hex").Hex, newestBlock: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag, rewardPercentiles: number[] | undefined];
|
|
60
|
-
};
|
|
61
|
-
ReturnType: import("ox/_types/core/Fee").FeeHistoryRpc;
|
|
62
|
-
} | {
|
|
63
|
-
Request: {
|
|
64
|
-
method: "eth_gasPrice";
|
|
65
|
-
params?: undefined;
|
|
66
|
-
};
|
|
67
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
68
|
-
} | {
|
|
69
|
-
Request: {
|
|
70
|
-
method: "eth_getBalance";
|
|
71
|
-
params: [address: import("ox/_types/core/Address").Address, block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier];
|
|
72
|
-
};
|
|
73
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
74
|
-
} | {
|
|
75
|
-
Request: {
|
|
76
|
-
method: "eth_getBlockByHash";
|
|
77
|
-
params: [hash: import("ox/_types/core/Hex").Hex, includeTransactionObjects: boolean];
|
|
78
|
-
};
|
|
79
|
-
ReturnType: import("ox/_types/core/Block").Rpc | null;
|
|
80
|
-
} | {
|
|
81
|
-
Request: {
|
|
82
|
-
method: "eth_getBlockByNumber";
|
|
83
|
-
params: [block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag, includeTransactionObjects: boolean];
|
|
84
|
-
};
|
|
85
|
-
ReturnType: import("ox/_types/core/Block").Rpc | null;
|
|
86
|
-
} | {
|
|
87
|
-
Request: {
|
|
88
|
-
method: "eth_getBlockTransactionCountByHash";
|
|
89
|
-
params: [hash: import("ox/_types/core/Hex").Hex];
|
|
90
|
-
};
|
|
91
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
92
|
-
} | {
|
|
93
|
-
Request: {
|
|
94
|
-
method: "eth_getBlockTransactionCountByNumber";
|
|
95
|
-
params: [block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag];
|
|
96
|
-
};
|
|
97
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
98
|
-
} | {
|
|
99
|
-
Request: {
|
|
100
|
-
method: "eth_getCode";
|
|
101
|
-
params: [address: import("ox/_types/core/Address").Address, block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier];
|
|
102
|
-
};
|
|
103
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
104
|
-
} | {
|
|
105
|
-
Request: {
|
|
106
|
-
method: "eth_getFilterChanges";
|
|
107
|
-
params: [filterId: import("ox/_types/core/Hex").Hex];
|
|
108
|
-
};
|
|
109
|
-
ReturnType: readonly import("ox/_types/core/Log").Rpc[] | readonly import("ox/_types/core/Hex").Hex[];
|
|
110
|
-
} | {
|
|
111
|
-
Request: {
|
|
112
|
-
method: "eth_getFilterLogs";
|
|
113
|
-
params: [filterId: import("ox/_types/core/Hex").Hex];
|
|
114
|
-
};
|
|
115
|
-
ReturnType: readonly import("ox/_types/core/Log").Rpc[];
|
|
116
|
-
} | {
|
|
117
|
-
Request: {
|
|
118
|
-
method: "eth_getLogs";
|
|
119
|
-
params: [filter: import("ox/_types/core/Filter").Rpc];
|
|
120
|
-
};
|
|
121
|
-
ReturnType: readonly import("ox/_types/core/Log").Rpc[];
|
|
122
|
-
} | {
|
|
123
|
-
Request: {
|
|
124
|
-
method: "eth_getProof";
|
|
125
|
-
params: [address: import("ox/_types/core/Address").Address, storageKeys: import("ox/_types/core/Hex").Hex[], block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier];
|
|
126
|
-
};
|
|
127
|
-
ReturnType: import("ox/_types/core/AccountProof").Rpc;
|
|
128
|
-
} | {
|
|
129
|
-
Request: {
|
|
130
|
-
method: "eth_getStorageAt";
|
|
131
|
-
params: [address: import("ox/_types/core/Address").Address, index: import("ox/_types/core/Hex").Hex, block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier];
|
|
132
|
-
};
|
|
133
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
134
|
-
} | {
|
|
135
|
-
Request: {
|
|
136
|
-
method: "eth_getTransactionByBlockHashAndIndex";
|
|
137
|
-
params: [hash: import("ox/_types/core/Hex").Hex, index: import("ox/_types/core/Hex").Hex];
|
|
138
|
-
};
|
|
139
|
-
ReturnType: import("ox/_types/core/Transaction").Rpc | null;
|
|
140
|
-
} | {
|
|
141
|
-
Request: {
|
|
142
|
-
method: "eth_getTransactionByBlockNumberAndIndex";
|
|
143
|
-
params: [block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag, index: import("ox/_types/core/Hex").Hex];
|
|
144
|
-
};
|
|
145
|
-
ReturnType: import("ox/_types/core/Transaction").Rpc | null;
|
|
146
|
-
} | {
|
|
147
|
-
Request: {
|
|
148
|
-
method: "eth_getTransactionByHash";
|
|
149
|
-
params: [hash: import("ox/_types/core/Hex").Hex];
|
|
150
|
-
};
|
|
151
|
-
ReturnType: import("ox/_types/core/Transaction").Rpc | null;
|
|
152
|
-
} | {
|
|
153
|
-
Request: {
|
|
154
|
-
method: "eth_getTransactionCount";
|
|
155
|
-
params: [address: import("ox/_types/core/Address").Address, block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag | import("ox/_types/core/Block").Hash | import("ox/_types/core/Block").Identifier];
|
|
156
|
-
};
|
|
157
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
158
|
-
} | {
|
|
159
|
-
Request: {
|
|
160
|
-
method: "eth_getTransactionReceipt";
|
|
161
|
-
params: [hash: import("ox/_types/core/Hex").Hex];
|
|
162
|
-
};
|
|
163
|
-
ReturnType: import("ox/_types/core/TransactionReceipt").Rpc | null;
|
|
164
|
-
} | {
|
|
165
|
-
Request: {
|
|
166
|
-
method: "eth_getUncleCountByBlockHash";
|
|
167
|
-
params: [hash: import("ox/_types/core/Hex").Hex];
|
|
168
|
-
};
|
|
169
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
170
|
-
} | {
|
|
171
|
-
Request: {
|
|
172
|
-
method: "eth_getUncleCountByBlockNumber";
|
|
173
|
-
params: [block: import("ox/_types/core/Block").Number<import("ox/_types/core/Hex").Hex> | import("ox/_types/core/Block").Tag];
|
|
174
|
-
};
|
|
175
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
176
|
-
} | {
|
|
177
|
-
Request: {
|
|
178
|
-
method: "eth_maxPriorityFeePerGas";
|
|
179
|
-
params?: undefined;
|
|
180
|
-
};
|
|
181
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
182
|
-
} | {
|
|
183
|
-
Request: {
|
|
184
|
-
method: "eth_newBlockFilter";
|
|
185
|
-
params?: undefined;
|
|
186
|
-
};
|
|
187
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
188
|
-
} | {
|
|
189
|
-
Request: {
|
|
190
|
-
method: "eth_newFilter";
|
|
191
|
-
params: [filter: import("ox/_types/core/Filter").Rpc];
|
|
192
|
-
};
|
|
193
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
194
|
-
} | {
|
|
195
|
-
Request: {
|
|
196
|
-
method: "eth_newPendingTransactionFilter";
|
|
197
|
-
params?: undefined;
|
|
198
|
-
};
|
|
199
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
200
|
-
} | {
|
|
201
|
-
Request: {
|
|
202
|
-
method: "eth_protocolVersion";
|
|
203
|
-
params?: undefined;
|
|
204
|
-
};
|
|
205
|
-
ReturnType: string;
|
|
206
|
-
} | {
|
|
207
|
-
Request: {
|
|
208
|
-
method: "eth_requestAccounts";
|
|
209
|
-
params?: undefined;
|
|
210
|
-
};
|
|
211
|
-
ReturnType: readonly import("ox/_types/core/Address").Address[];
|
|
212
|
-
} | {
|
|
213
|
-
Request: {
|
|
214
|
-
method: "eth_sendRawTransaction";
|
|
215
|
-
params: [serializedTransaction: import("ox/_types/core/Hex").Hex];
|
|
216
|
-
};
|
|
217
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
218
|
-
} | {
|
|
219
|
-
Request: {
|
|
220
|
-
method: "eth_sendTransaction";
|
|
221
|
-
params: [transaction: import("ox/_types/core/TransactionRequest").Rpc];
|
|
222
|
-
};
|
|
223
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
224
|
-
} | {
|
|
225
|
-
Request: {
|
|
226
|
-
method: "eth_signTransaction";
|
|
227
|
-
params: [request: import("ox/_types/core/TransactionRequest").Rpc];
|
|
228
|
-
};
|
|
229
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
230
|
-
} | {
|
|
231
|
-
Request: {
|
|
232
|
-
method: "eth_signTypedData_v4";
|
|
233
|
-
params: [address: import("ox/_types/core/Address").Address, message: string];
|
|
234
|
-
};
|
|
235
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
236
|
-
} | {
|
|
237
|
-
Request: {
|
|
238
|
-
method: "eth_uninstallFilter";
|
|
239
|
-
params: [filterId: import("ox/_types/core/Hex").Hex];
|
|
240
|
-
};
|
|
241
|
-
ReturnType: boolean;
|
|
242
|
-
} | {
|
|
243
|
-
Request: {
|
|
244
|
-
method: "eth_requestAccounts";
|
|
245
|
-
params?: undefined;
|
|
246
|
-
};
|
|
247
|
-
ReturnType: readonly import("ox/_types/core/Address").Address[];
|
|
248
|
-
} | {
|
|
249
|
-
Request: {
|
|
250
|
-
method: "eth_sendRawTransaction";
|
|
251
|
-
params: [serializedTransaction: import("ox/_types/core/Hex").Hex];
|
|
252
|
-
};
|
|
253
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
254
|
-
} | {
|
|
255
|
-
Request: {
|
|
256
|
-
method: "eth_sendTransaction";
|
|
257
|
-
params: [transaction: import("ox/_types/core/TransactionRequest").Rpc];
|
|
258
|
-
};
|
|
259
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
260
|
-
} | {
|
|
261
|
-
Request: {
|
|
262
|
-
method: "eth_signTransaction";
|
|
263
|
-
params: [request: import("ox/_types/core/TransactionRequest").Rpc];
|
|
264
|
-
};
|
|
265
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
266
|
-
} | {
|
|
267
|
-
Request: {
|
|
268
|
-
method: "eth_signTypedData_v4";
|
|
269
|
-
params: [address: import("ox/_types/core/Address").Address, message: string];
|
|
270
|
-
};
|
|
271
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
272
|
-
} | {
|
|
273
|
-
Request: {
|
|
274
|
-
method: "personal_sign";
|
|
275
|
-
params: [data: import("ox/_types/core/Hex").Hex, address: import("ox/_types/core/Address").Address];
|
|
276
|
-
};
|
|
277
|
-
ReturnType: import("ox/_types/core/Hex").Hex;
|
|
278
|
-
} | {
|
|
279
|
-
Request: {
|
|
280
|
-
method: "wallet_addEthereumChain";
|
|
281
|
-
params: [chain: {
|
|
282
|
-
chainId: string;
|
|
283
|
-
chainName: string;
|
|
284
|
-
nativeCurrency?: {
|
|
285
|
-
name: string;
|
|
286
|
-
symbol: string;
|
|
287
|
-
decimals: number;
|
|
288
|
-
} | undefined | undefined;
|
|
289
|
-
rpcUrls: readonly string[];
|
|
290
|
-
blockExplorerUrls?: readonly string[] | undefined;
|
|
291
|
-
iconUrls?: readonly string[] | undefined;
|
|
292
|
-
}];
|
|
293
|
-
};
|
|
294
|
-
ReturnType: null;
|
|
295
|
-
} | {
|
|
296
|
-
Request: {
|
|
297
|
-
method: "wallet_getCallsStatus";
|
|
298
|
-
params?: [string];
|
|
299
|
-
};
|
|
300
|
-
ReturnType: {
|
|
301
|
-
status: "PENDING" | "CONFIRMED";
|
|
302
|
-
receipts?: readonly {
|
|
303
|
-
logs: {
|
|
304
|
-
address: import("ox/_types/core/Hex").Hex;
|
|
305
|
-
data: import("ox/_types/core/Hex").Hex;
|
|
306
|
-
topics: readonly import("ox/_types/core/Hex").Hex[];
|
|
307
|
-
}[];
|
|
308
|
-
status: import("ox/_types/core/Hex").Hex;
|
|
309
|
-
blockHash: import("ox/_types/core/Hex").Hex;
|
|
310
|
-
blockNumber: import("ox/_types/core/Hex").Hex;
|
|
311
|
-
gasUsed: import("ox/_types/core/Hex").Hex;
|
|
312
|
-
transactionHash: import("ox/_types/core/Hex").Hex;
|
|
313
|
-
}[] | undefined;
|
|
314
|
-
};
|
|
315
|
-
} | {
|
|
316
|
-
Request: {
|
|
317
|
-
method: "wallet_getCapabilities";
|
|
318
|
-
params?: [import("ox/_types/core/Address").Address];
|
|
319
|
-
};
|
|
320
|
-
ReturnType: {
|
|
321
|
-
[x: `0x${string}`]: {
|
|
322
|
-
[capability: string]: any;
|
|
323
|
-
};
|
|
324
|
-
};
|
|
325
|
-
} | {
|
|
326
|
-
Request: {
|
|
327
|
-
method: "wallet_getPermissions";
|
|
328
|
-
params?: undefined;
|
|
329
|
-
};
|
|
330
|
-
ReturnType: readonly {
|
|
331
|
-
caveats: readonly {
|
|
332
|
-
type: string;
|
|
333
|
-
value: any;
|
|
334
|
-
}[];
|
|
335
|
-
date: number;
|
|
336
|
-
id: string;
|
|
337
|
-
invoker: `http://${string}` | `https://${string}`;
|
|
338
|
-
parentCapability: "eth_accounts" | string;
|
|
339
|
-
}[];
|
|
340
|
-
} | {
|
|
341
|
-
Request: {
|
|
342
|
-
method: "wallet_grantPermissions";
|
|
343
|
-
params?: [{
|
|
344
|
-
signer?: {
|
|
345
|
-
type: string;
|
|
346
|
-
data?: unknown | undefined;
|
|
347
|
-
} | undefined;
|
|
348
|
-
permissions: readonly {
|
|
349
|
-
data: unknown;
|
|
350
|
-
policies: readonly {
|
|
351
|
-
data: unknown;
|
|
352
|
-
type: string;
|
|
353
|
-
}[];
|
|
354
|
-
required?: boolean | undefined;
|
|
355
|
-
type: string;
|
|
356
|
-
}[];
|
|
357
|
-
expiry: number;
|
|
358
|
-
}];
|
|
359
|
-
};
|
|
360
|
-
ReturnType: {
|
|
361
|
-
expiry: number;
|
|
362
|
-
factory?: `0x${string}` | undefined | undefined;
|
|
363
|
-
factoryData?: string | undefined | undefined;
|
|
364
|
-
grantedPermissions: readonly {
|
|
365
|
-
data: unknown;
|
|
366
|
-
policies: readonly {
|
|
367
|
-
data: unknown;
|
|
368
|
-
type: string;
|
|
369
|
-
}[];
|
|
370
|
-
required?: boolean | undefined;
|
|
371
|
-
type: string;
|
|
372
|
-
}[];
|
|
373
|
-
permissionsContext: string;
|
|
374
|
-
signerData?: {
|
|
375
|
-
userOpBuilder?: `0x${string}` | undefined;
|
|
376
|
-
submitToAddress?: `0x${string}` | undefined;
|
|
377
|
-
} | undefined | undefined;
|
|
378
|
-
};
|
|
379
|
-
} | {
|
|
380
|
-
Request: {
|
|
381
|
-
method: "wallet_requestPermissions";
|
|
382
|
-
params: [permissions: {
|
|
383
|
-
eth_accounts: Record<string, any>;
|
|
384
|
-
}];
|
|
385
|
-
};
|
|
386
|
-
ReturnType: readonly {
|
|
387
|
-
caveats: readonly {
|
|
388
|
-
type: string;
|
|
389
|
-
value: any;
|
|
390
|
-
}[];
|
|
391
|
-
date: number;
|
|
392
|
-
id: string;
|
|
393
|
-
invoker: `http://${string}` | `https://${string}`;
|
|
394
|
-
parentCapability: "eth_accounts" | string;
|
|
395
|
-
}[];
|
|
396
|
-
} | {
|
|
397
|
-
Request: {
|
|
398
|
-
method: "wallet_revokePermissions";
|
|
399
|
-
params: [permissions: {
|
|
400
|
-
eth_accounts: Record<string, any>;
|
|
401
|
-
}];
|
|
402
|
-
};
|
|
403
|
-
ReturnType: null;
|
|
404
|
-
} | {
|
|
405
|
-
Request: {
|
|
406
|
-
method: "wallet_sendCalls";
|
|
407
|
-
params: [{
|
|
408
|
-
calls: readonly {
|
|
409
|
-
to?: import("ox/_types/core/Address").Address | undefined;
|
|
410
|
-
data?: import("ox/_types/core/Hex").Hex | undefined;
|
|
411
|
-
value?: import("ox/_types/core/Hex").Hex | undefined;
|
|
412
|
-
}[];
|
|
413
|
-
capabilities?: {
|
|
414
|
-
[capability: string]: any;
|
|
415
|
-
} | undefined;
|
|
416
|
-
chainId?: import("ox/_types/core/Hex").Hex | undefined;
|
|
417
|
-
from: import("ox/_types/core/Address").Address;
|
|
418
|
-
version: string;
|
|
419
|
-
}];
|
|
420
|
-
};
|
|
421
|
-
ReturnType: string;
|
|
422
|
-
} | {
|
|
423
|
-
Request: {
|
|
424
|
-
method: "wallet_showCallsStatus";
|
|
425
|
-
params: [string];
|
|
426
|
-
};
|
|
427
|
-
ReturnType: undefined;
|
|
428
|
-
} | {
|
|
429
|
-
Request: {
|
|
430
|
-
method: "wallet_switchEthereumChain";
|
|
431
|
-
params: [chain: {
|
|
432
|
-
chainId: string;
|
|
433
|
-
}];
|
|
434
|
-
};
|
|
435
|
-
ReturnType: null;
|
|
436
|
-
} | {
|
|
437
|
-
Request: {
|
|
438
|
-
method: "wallet_watchAsset";
|
|
439
|
-
params: [{
|
|
440
|
-
type: "ERC20";
|
|
441
|
-
options: {
|
|
442
|
-
address: string;
|
|
443
|
-
symbol: string;
|
|
444
|
-
decimals: number;
|
|
445
|
-
image?: string | undefined;
|
|
446
|
-
};
|
|
447
|
-
}];
|
|
448
|
-
};
|
|
449
|
-
ReturnType: boolean;
|
|
450
|
-
}>;
|
|
451
|
-
on: import("ox/_types/core/Provider").EventListenerFn;
|
|
452
|
-
removeListener: import("ox/_types/core/Provider").EventListenerFn;
|
|
453
|
-
}, Record<string, unknown>, Record<string, unknown>>]>;
|
|
13
|
+
}>]>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
interface FormattedCurrencyProps {
|
|
2
|
-
amount:
|
|
3
|
-
sourceCurrency: string;
|
|
2
|
+
amount: number;
|
|
4
3
|
showChange?: boolean;
|
|
5
4
|
showColor?: boolean;
|
|
6
5
|
className?: string;
|
|
7
6
|
subB3Icon?: boolean;
|
|
8
7
|
clickable?: boolean;
|
|
9
8
|
decimals?: number;
|
|
9
|
+
currency?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare function FormattedCurrency({ amount,
|
|
11
|
+
export declare function FormattedCurrency({ amount, showChange, showColor, className, subB3Icon, clickable, decimals, currency, }: FormattedCurrencyProps): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -16,23 +16,20 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function useCurrencyConversion(): {
|
|
18
18
|
/** Currently selected display currency */
|
|
19
|
-
selectedCurrency:
|
|
19
|
+
selectedCurrency: import("../stores/currencyStore").SupportedCurrency;
|
|
20
20
|
/** Base currency used for conversion (typically B3) */
|
|
21
|
-
baseCurrency:
|
|
21
|
+
baseCurrency: import("../stores/currencyStore").SupportedCurrency;
|
|
22
22
|
/** Current exchange rate from base to selected currency (undefined while loading) */
|
|
23
23
|
exchangeRate: number | undefined;
|
|
24
24
|
/** Format a value with currency conversion and proper symbol/decimal handling */
|
|
25
|
-
formatCurrencyValue: (value: number,
|
|
25
|
+
formatCurrencyValue: (value: number, options?: {
|
|
26
26
|
decimals?: number;
|
|
27
|
+
currency?: string;
|
|
27
28
|
}) => string;
|
|
28
29
|
/** Format a tooltip value showing alternate currency representation */
|
|
29
|
-
formatTooltipValue: (value: number,
|
|
30
|
+
formatTooltipValue: (value: number, customCurrency?: string) => string;
|
|
30
31
|
/** Symbol for the currently selected currency (e.g., "$", "€", "ETH") */
|
|
31
32
|
selectedCurrencySymbol: string;
|
|
32
33
|
/** Symbol for the base currency */
|
|
33
34
|
baseCurrencySymbol: string;
|
|
34
|
-
/** Get exchange rate between any two currencies */
|
|
35
|
-
getExchangeRate: (from: string, to: string) => number | undefined;
|
|
36
|
-
/** All registered custom currencies */
|
|
37
|
-
customCurrencies: Record<string, import("../stores/currencyStore").CurrencyMetadata>;
|
|
38
35
|
};
|
|
@@ -1,36 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Supported currencies for display and conversion.
|
|
3
3
|
* Includes fiat currencies (USD, EUR, GBP, JPY, CAD, AUD, KRW) and crypto (ETH, SOL, B3).
|
|
4
4
|
*/
|
|
5
5
|
export type SupportedCurrency = "ETH" | "USD" | "EUR" | "GBP" | "JPY" | "CAD" | "AUD" | "B3" | "SOL" | "KRW";
|
|
6
|
-
/**
|
|
7
|
-
* Metadata for a custom currency including display formatting rules.
|
|
8
|
-
*/
|
|
9
|
-
export interface CurrencyMetadata {
|
|
10
|
-
/** The currency code/symbol (e.g., "BTC", "DOGE") */
|
|
11
|
-
code: string;
|
|
12
|
-
/** Display symbol for the currency (e.g., "₿", "Ð") */
|
|
13
|
-
symbol: string;
|
|
14
|
-
/** Human-readable name (e.g., "Bitcoin", "Dogecoin") */
|
|
15
|
-
name: string;
|
|
16
|
-
/** Whether to show symbol before the value (true for $100, false for 100 ETH) */
|
|
17
|
-
prefixSymbol?: boolean;
|
|
18
|
-
/** Number of decimal places to show (undefined uses smart formatting) */
|
|
19
|
-
decimals?: number;
|
|
20
|
-
/** Whether to use subscript notation for small values */
|
|
21
|
-
showSubscripts?: boolean;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Exchange rate between two currencies.
|
|
25
|
-
*/
|
|
26
|
-
export interface ExchangeRate {
|
|
27
|
-
/** Currency code being converted from */
|
|
28
|
-
from: string;
|
|
29
|
-
/** Currency code being converted to */
|
|
30
|
-
to: string;
|
|
31
|
-
/** Exchange rate multiplier (amount_in_to = amount_in_from * rate) */
|
|
32
|
-
rate: number;
|
|
33
|
-
}
|
|
34
6
|
/**
|
|
35
7
|
* Currency symbols used for display formatting.
|
|
36
8
|
* Prefix currencies (USD, EUR, GBP, CAD, AUD) show symbol before the amount.
|
|
@@ -45,51 +17,24 @@ export declare const CURRENCY_NAMES: Record<SupportedCurrency, string>;
|
|
|
45
17
|
* Currency store state interface.
|
|
46
18
|
* @property selectedCurrency - The currency currently selected for display
|
|
47
19
|
* @property baseCurrency - The base currency for conversion (typically B3)
|
|
48
|
-
* @property customCurrencies - Map of custom currency codes to their metadata
|
|
49
|
-
* @property customExchangeRates - Map of "FROM-TO" pairs to exchange rates
|
|
50
20
|
* @property setSelectedCurrency - Update the selected display currency
|
|
51
21
|
* @property setBaseCurrency - Update the base currency for conversions
|
|
52
|
-
* @property addCurrency - Register a new custom currency with metadata
|
|
53
|
-
* @property removeCurrency - Remove a custom currency
|
|
54
|
-
* @property setExchangeRate - Set a custom exchange rate between two currencies
|
|
55
|
-
* @property getExchangeRate - Get exchange rate between two currencies
|
|
56
|
-
* @property getAllCurrencies - Get all available currencies (built-in + custom)
|
|
57
22
|
*/
|
|
58
23
|
interface CurrencyState {
|
|
59
|
-
selectedCurrency:
|
|
60
|
-
baseCurrency:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
setSelectedCurrency: (currency: string) => void;
|
|
64
|
-
setBaseCurrency: (currency: string) => void;
|
|
65
|
-
addCurrency: (metadata: CurrencyMetadata) => void;
|
|
66
|
-
removeCurrency: (code: string) => void;
|
|
67
|
-
setExchangeRate: (from: string, to: string, rate: number) => void;
|
|
68
|
-
getExchangeRate: (from: string, to: string) => number | undefined;
|
|
69
|
-
getAllCurrencies: () => string[];
|
|
24
|
+
selectedCurrency: SupportedCurrency;
|
|
25
|
+
baseCurrency: SupportedCurrency;
|
|
26
|
+
setSelectedCurrency: (currency: SupportedCurrency) => void;
|
|
27
|
+
setBaseCurrency: (currency: SupportedCurrency) => void;
|
|
70
28
|
}
|
|
71
29
|
/**
|
|
72
30
|
* Zustand store for managing currency selection and conversion.
|
|
73
31
|
* Persists user's selected currency preference in localStorage.
|
|
74
|
-
* Supports dynamic currency registration and custom exchange rates.
|
|
75
32
|
*
|
|
76
33
|
* @example
|
|
77
34
|
* ```tsx
|
|
78
|
-
* const { selectedCurrency, setSelectedCurrency
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* addCurrency({
|
|
82
|
-
* code: "BTC",
|
|
83
|
-
* symbol: "₿",
|
|
84
|
-
* name: "Bitcoin",
|
|
85
|
-
* showSubscripts: true,
|
|
86
|
-
* });
|
|
87
|
-
*
|
|
88
|
-
* // Set exchange rate: 1 BTC = 50000 USD
|
|
89
|
-
* setExchangeRate("BTC", "USD", 50000);
|
|
90
|
-
*
|
|
91
|
-
* // Change display currency
|
|
92
|
-
* setSelectedCurrency('BTC');
|
|
35
|
+
* const { selectedCurrency, setSelectedCurrency } = useCurrencyStore();
|
|
36
|
+
* // Change display currency to USD
|
|
37
|
+
* setSelectedCurrency('USD');
|
|
93
38
|
* ```
|
|
94
39
|
*/
|
|
95
40
|
export declare const useCurrencyStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<CurrencyState>, "persist"> & {
|
|
@@ -103,24 +48,4 @@ export declare const useCurrencyStore: import("zustand").UseBoundStore<Omit<impo
|
|
|
103
48
|
getOptions: () => Partial<import("zustand/middleware").PersistOptions<CurrencyState, CurrencyState>>;
|
|
104
49
|
};
|
|
105
50
|
}>;
|
|
106
|
-
/**
|
|
107
|
-
* Get the symbol for any currency (built-in or custom).
|
|
108
|
-
*/
|
|
109
|
-
export declare function getCurrencySymbol(currency: string): string;
|
|
110
|
-
/**
|
|
111
|
-
* Get the name for any currency (built-in or custom).
|
|
112
|
-
*/
|
|
113
|
-
export declare function getCurrencyName(currency: string): string;
|
|
114
|
-
/**
|
|
115
|
-
* Get metadata for a custom currency.
|
|
116
|
-
*/
|
|
117
|
-
export declare function getCurrencyMetadata(currency: string): CurrencyMetadata | undefined;
|
|
118
|
-
/**
|
|
119
|
-
* Get the number of decimal places for a currency (for converting from smallest unit).
|
|
120
|
-
* Used when parsing amounts from wei/smallest unit format.
|
|
121
|
-
*
|
|
122
|
-
* @param currency - Currency code
|
|
123
|
-
* @returns Number of decimal places (e.g., 18 for ETH/wei, 2 for USD cents, 0 for JPY)
|
|
124
|
-
*/
|
|
125
|
-
export declare function getCurrencyDecimalPlaces(currency: string): number;
|
|
126
51
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@b3dotfun/sdk",
|
|
3
|
-
"version": "0.0.58-
|
|
3
|
+
"version": "0.0.58-test.1",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"react-native": "./dist/cjs/index.native.js",
|
|
@@ -136,6 +136,11 @@
|
|
|
136
136
|
"import": "./dist/esm/global-account/types.js",
|
|
137
137
|
"require": "./dist/cjs/global-account/types.js"
|
|
138
138
|
},
|
|
139
|
+
"./global-account/client-manager": {
|
|
140
|
+
"types": "./dist/types/global-account/client-manager.d.ts",
|
|
141
|
+
"import": "./dist/esm/global-account/client-manager.js",
|
|
142
|
+
"require": "./dist/cjs/global-account/client-manager.js"
|
|
143
|
+
},
|
|
139
144
|
"./global-account/types/*": {
|
|
140
145
|
"types": "./dist/types/global-account/types/*.d.ts",
|
|
141
146
|
"import": "./dist/esm/global-account/types/*.js",
|
|
@@ -279,7 +284,6 @@
|
|
|
279
284
|
"dependencies": {
|
|
280
285
|
"@b3dotfun/b3-api": "0.0.77",
|
|
281
286
|
"@b3dotfun/basement-api": "0.0.11",
|
|
282
|
-
"@farcaster/miniapp-wagmi-connector": "^1.1.0",
|
|
283
287
|
"@feathersjs/authentication-client": "5.0.33",
|
|
284
288
|
"@feathersjs/feathers": "5.0.33",
|
|
285
289
|
"@feathersjs/rest-client": "5.0.33",
|
|
@@ -372,14 +376,14 @@
|
|
|
372
376
|
"@readyplayerme/react-avatar-creator": "0.5.0",
|
|
373
377
|
"@readyplayerme/visage": "6.10.0",
|
|
374
378
|
"@tanstack/react-query": "5.55.0",
|
|
375
|
-
"@wagmi/core": "2.20.3",
|
|
376
379
|
"react": "^18.0.0 || ^19.0.0",
|
|
377
380
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
378
381
|
"react-native-mmkv": "^3.2.0",
|
|
379
382
|
"thirdweb": "5.108.14",
|
|
380
383
|
"three": "^0.175.0",
|
|
381
384
|
"viem": "2.37.9",
|
|
382
|
-
"wagmi": "2.16.9"
|
|
385
|
+
"wagmi": "2.16.9",
|
|
386
|
+
"@wagmi/core": "2.20.3"
|
|
383
387
|
},
|
|
384
388
|
"peerDependenciesMeta": {
|
|
385
389
|
"@react-three/postprocessing": {
|