@spicenet-io/spiceflow-ui 3.0.2 → 3.0.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.
Files changed (45) hide show
  1. package/dist/auth-dynamic.cjs.js +1 -1
  2. package/dist/auth-dynamic.js +1 -1
  3. package/dist/auth-starknet.cjs.js +1 -1
  4. package/dist/auth-starknet.js +1 -1
  5. package/dist/components/AccountDisplay/AccountActions.d.ts +1 -1
  6. package/dist/components/ProviderLogins/index.d.ts +0 -2
  7. package/dist/components/SpiceDeposit/DepositRecoveryPrompt.d.ts +1 -0
  8. package/dist/components/SpiceDeposit/DepositStatusModal.d.ts +4 -0
  9. package/dist/components/SpiceWithdraw/SpiceWithdraw.d.ts +7 -0
  10. package/dist/components/ui/SpiceModalShell.d.ts +1 -0
  11. package/dist/hooks/index.d.ts +1 -0
  12. package/dist/hooks/useGaslessExecution/index.d.ts +4 -1
  13. package/dist/hooks/useSmartWallet.d.ts +1 -0
  14. package/dist/index-BliUKoV3.js +2 -0
  15. package/dist/index-DfIyc-i4.js +2 -0
  16. package/dist/index.cjs.js +13 -13
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.js +9 -9
  19. package/dist/providerWallet-BkoKGNWP.js +2 -0
  20. package/dist/providerWallet-BxQfn50I.js +2 -0
  21. package/dist/providers/SpiceFlowProvider.d.ts +2 -0
  22. package/dist/types/account.d.ts +3 -0
  23. package/dist/types/assets.d.ts +11 -0
  24. package/dist/types/authorization.d.ts +1 -0
  25. package/dist/types/deposit.d.ts +46 -4
  26. package/dist/types/index.d.ts +1 -0
  27. package/dist/types/rollup.d.ts +50 -0
  28. package/dist/types/supply.d.ts +7 -1
  29. package/dist/types/unified.d.ts +32 -0
  30. package/dist/useSpiceBrand-BXIOIB0Z.js +2 -0
  31. package/dist/useSpiceBrand-rUjSu3Za.js +2 -0
  32. package/dist/utils/abis/spicenet.d.ts +49 -0
  33. package/dist/utils/abis/spicenetWalletManager.d.ts +566 -0
  34. package/dist/utils/assetDisplay.d.ts +4 -0
  35. package/dist/utils/chains/index.d.ts +2 -0
  36. package/dist/utils/logos.d.ts +2 -0
  37. package/dist/utils/relayer/index.d.ts +20 -4
  38. package/dist/utils/rollupBalances.d.ts +14 -0
  39. package/package.json +2 -2
  40. package/dist/auth-dynamic-CG0Ou9V1.js +0 -2
  41. package/dist/auth-dynamic-CaSspPic.js +0 -2
  42. package/dist/index-BOMLw4PF.js +0 -2
  43. package/dist/index-DFMaR3pe.js +0 -2
  44. package/dist/useSpiceBrand-Dk9KS_yU.js +0 -2
  45. package/dist/useSpiceBrand-QbPbGjw5.js +0 -2
@@ -0,0 +1,566 @@
1
+ export declare const spicenetWalletManagerAbi: readonly [{
2
+ readonly type: "constructor";
3
+ readonly inputs: readonly [];
4
+ readonly stateMutability: "nonpayable";
5
+ }, {
6
+ readonly type: "function";
7
+ readonly name: "DEFAULT_ADMIN_ROLE";
8
+ readonly inputs: readonly [];
9
+ readonly outputs: readonly [{
10
+ readonly name: "";
11
+ readonly type: "bytes32";
12
+ readonly internalType: "bytes32";
13
+ }];
14
+ readonly stateMutability: "view";
15
+ }, {
16
+ readonly type: "function";
17
+ readonly name: "UPGRADER_ROLE";
18
+ readonly inputs: readonly [];
19
+ readonly outputs: readonly [{
20
+ readonly name: "";
21
+ readonly type: "bytes32";
22
+ readonly internalType: "bytes32";
23
+ }];
24
+ readonly stateMutability: "view";
25
+ }, {
26
+ readonly type: "function";
27
+ readonly name: "UPGRADE_INTERFACE_VERSION";
28
+ readonly inputs: readonly [];
29
+ readonly outputs: readonly [{
30
+ readonly name: "";
31
+ readonly type: "string";
32
+ readonly internalType: "string";
33
+ }];
34
+ readonly stateMutability: "view";
35
+ }, {
36
+ readonly type: "function";
37
+ readonly name: "getRoleAdmin";
38
+ readonly inputs: readonly [{
39
+ readonly name: "role";
40
+ readonly type: "bytes32";
41
+ readonly internalType: "bytes32";
42
+ }];
43
+ readonly outputs: readonly [{
44
+ readonly name: "";
45
+ readonly type: "bytes32";
46
+ readonly internalType: "bytes32";
47
+ }];
48
+ readonly stateMutability: "view";
49
+ }, {
50
+ readonly type: "function";
51
+ readonly name: "getRoleMember";
52
+ readonly inputs: readonly [{
53
+ readonly name: "role";
54
+ readonly type: "bytes32";
55
+ readonly internalType: "bytes32";
56
+ }, {
57
+ readonly name: "index";
58
+ readonly type: "uint256";
59
+ readonly internalType: "uint256";
60
+ }];
61
+ readonly outputs: readonly [{
62
+ readonly name: "";
63
+ readonly type: "address";
64
+ readonly internalType: "address";
65
+ }];
66
+ readonly stateMutability: "view";
67
+ }, {
68
+ readonly type: "function";
69
+ readonly name: "getRoleMemberCount";
70
+ readonly inputs: readonly [{
71
+ readonly name: "role";
72
+ readonly type: "bytes32";
73
+ readonly internalType: "bytes32";
74
+ }];
75
+ readonly outputs: readonly [{
76
+ readonly name: "";
77
+ readonly type: "uint256";
78
+ readonly internalType: "uint256";
79
+ }];
80
+ readonly stateMutability: "view";
81
+ }, {
82
+ readonly type: "function";
83
+ readonly name: "getRoleMembers";
84
+ readonly inputs: readonly [{
85
+ readonly name: "role";
86
+ readonly type: "bytes32";
87
+ readonly internalType: "bytes32";
88
+ }];
89
+ readonly outputs: readonly [{
90
+ readonly name: "";
91
+ readonly type: "address[]";
92
+ readonly internalType: "address[]";
93
+ }];
94
+ readonly stateMutability: "view";
95
+ }, {
96
+ readonly type: "function";
97
+ readonly name: "getWithdrawalInfo";
98
+ readonly inputs: readonly [{
99
+ readonly name: "idempotenceKey";
100
+ readonly type: "bytes32";
101
+ readonly internalType: "bytes32";
102
+ }];
103
+ readonly outputs: readonly [{
104
+ readonly name: "";
105
+ readonly type: "tuple";
106
+ readonly internalType: "struct SpicenetWithdrawalManagerV1.WithdrawalInfo";
107
+ readonly components: readonly [{
108
+ readonly name: "processed";
109
+ readonly type: "bool";
110
+ readonly internalType: "bool";
111
+ }, {
112
+ readonly name: "blockNumber";
113
+ readonly type: "uint256";
114
+ readonly internalType: "uint256";
115
+ }, {
116
+ readonly name: "nbf";
117
+ readonly type: "uint256";
118
+ readonly internalType: "uint256";
119
+ }, {
120
+ readonly name: "exp";
121
+ readonly type: "uint256";
122
+ readonly internalType: "uint256";
123
+ }, {
124
+ readonly name: "metadata";
125
+ readonly type: "string";
126
+ readonly internalType: "string";
127
+ }];
128
+ }];
129
+ readonly stateMutability: "view";
130
+ }, {
131
+ readonly type: "function";
132
+ readonly name: "grantRole";
133
+ readonly inputs: readonly [{
134
+ readonly name: "role";
135
+ readonly type: "bytes32";
136
+ readonly internalType: "bytes32";
137
+ }, {
138
+ readonly name: "account";
139
+ readonly type: "address";
140
+ readonly internalType: "address";
141
+ }];
142
+ readonly outputs: readonly [];
143
+ readonly stateMutability: "nonpayable";
144
+ }, {
145
+ readonly type: "function";
146
+ readonly name: "hasRole";
147
+ readonly inputs: readonly [{
148
+ readonly name: "role";
149
+ readonly type: "bytes32";
150
+ readonly internalType: "bytes32";
151
+ }, {
152
+ readonly name: "account";
153
+ readonly type: "address";
154
+ readonly internalType: "address";
155
+ }];
156
+ readonly outputs: readonly [{
157
+ readonly name: "";
158
+ readonly type: "bool";
159
+ readonly internalType: "bool";
160
+ }];
161
+ readonly stateMutability: "view";
162
+ }, {
163
+ readonly type: "function";
164
+ readonly name: "initialize";
165
+ readonly inputs: readonly [{
166
+ readonly name: "defaultAdmin";
167
+ readonly type: "address";
168
+ readonly internalType: "address";
169
+ }];
170
+ readonly outputs: readonly [];
171
+ readonly stateMutability: "nonpayable";
172
+ }, {
173
+ readonly type: "function";
174
+ readonly name: "processWithdrawal";
175
+ readonly inputs: readonly [{
176
+ readonly name: "request";
177
+ readonly type: "tuple";
178
+ readonly internalType: "struct SpicenetWithdrawalManagerV1.WithdrawalRequest";
179
+ readonly components: readonly [{
180
+ readonly name: "idempotenceKey";
181
+ readonly type: "bytes32";
182
+ readonly internalType: "bytes32";
183
+ }, {
184
+ readonly name: "nbf";
185
+ readonly type: "uint256";
186
+ readonly internalType: "uint256";
187
+ }, {
188
+ readonly name: "exp";
189
+ readonly type: "uint256";
190
+ readonly internalType: "uint256";
191
+ }, {
192
+ readonly name: "metadata";
193
+ readonly type: "string";
194
+ readonly internalType: "string";
195
+ }, {
196
+ readonly name: "transfers";
197
+ readonly type: "tuple[]";
198
+ readonly internalType: "struct SpicenetWithdrawalManagerV1.TokenTransfer[]";
199
+ readonly components: readonly [{
200
+ readonly name: "token";
201
+ readonly type: "address";
202
+ readonly internalType: "address";
203
+ }, {
204
+ readonly name: "to";
205
+ readonly type: "address";
206
+ readonly internalType: "address";
207
+ }, {
208
+ readonly name: "amount";
209
+ readonly type: "uint256";
210
+ readonly internalType: "uint256";
211
+ }];
212
+ }];
213
+ }];
214
+ readonly outputs: readonly [];
215
+ readonly stateMutability: "nonpayable";
216
+ }, {
217
+ readonly type: "function";
218
+ readonly name: "proxiableUUID";
219
+ readonly inputs: readonly [];
220
+ readonly outputs: readonly [{
221
+ readonly name: "";
222
+ readonly type: "bytes32";
223
+ readonly internalType: "bytes32";
224
+ }];
225
+ readonly stateMutability: "view";
226
+ }, {
227
+ readonly type: "function";
228
+ readonly name: "renounceRole";
229
+ readonly inputs: readonly [{
230
+ readonly name: "role";
231
+ readonly type: "bytes32";
232
+ readonly internalType: "bytes32";
233
+ }, {
234
+ readonly name: "callerConfirmation";
235
+ readonly type: "address";
236
+ readonly internalType: "address";
237
+ }];
238
+ readonly outputs: readonly [];
239
+ readonly stateMutability: "nonpayable";
240
+ }, {
241
+ readonly type: "function";
242
+ readonly name: "revokeRole";
243
+ readonly inputs: readonly [{
244
+ readonly name: "role";
245
+ readonly type: "bytes32";
246
+ readonly internalType: "bytes32";
247
+ }, {
248
+ readonly name: "account";
249
+ readonly type: "address";
250
+ readonly internalType: "address";
251
+ }];
252
+ readonly outputs: readonly [];
253
+ readonly stateMutability: "nonpayable";
254
+ }, {
255
+ readonly type: "function";
256
+ readonly name: "setWithdrawalInfo";
257
+ readonly inputs: readonly [{
258
+ readonly name: "idempotenceKey";
259
+ readonly type: "bytes32";
260
+ readonly internalType: "bytes32";
261
+ }, {
262
+ readonly name: "withdrawalInfo";
263
+ readonly type: "tuple";
264
+ readonly internalType: "struct SpicenetWithdrawalManagerV1.WithdrawalInfo";
265
+ readonly components: readonly [{
266
+ readonly name: "processed";
267
+ readonly type: "bool";
268
+ readonly internalType: "bool";
269
+ }, {
270
+ readonly name: "blockNumber";
271
+ readonly type: "uint256";
272
+ readonly internalType: "uint256";
273
+ }, {
274
+ readonly name: "nbf";
275
+ readonly type: "uint256";
276
+ readonly internalType: "uint256";
277
+ }, {
278
+ readonly name: "exp";
279
+ readonly type: "uint256";
280
+ readonly internalType: "uint256";
281
+ }, {
282
+ readonly name: "metadata";
283
+ readonly type: "string";
284
+ readonly internalType: "string";
285
+ }];
286
+ }];
287
+ readonly outputs: readonly [];
288
+ readonly stateMutability: "nonpayable";
289
+ }, {
290
+ readonly type: "function";
291
+ readonly name: "supportsInterface";
292
+ readonly inputs: readonly [{
293
+ readonly name: "interfaceId";
294
+ readonly type: "bytes4";
295
+ readonly internalType: "bytes4";
296
+ }];
297
+ readonly outputs: readonly [{
298
+ readonly name: "";
299
+ readonly type: "bool";
300
+ readonly internalType: "bool";
301
+ }];
302
+ readonly stateMutability: "view";
303
+ }, {
304
+ readonly type: "function";
305
+ readonly name: "upgradeToAndCall";
306
+ readonly inputs: readonly [{
307
+ readonly name: "newImplementation";
308
+ readonly type: "address";
309
+ readonly internalType: "address";
310
+ }, {
311
+ readonly name: "data";
312
+ readonly type: "bytes";
313
+ readonly internalType: "bytes";
314
+ }];
315
+ readonly outputs: readonly [];
316
+ readonly stateMutability: "payable";
317
+ }, {
318
+ readonly type: "event";
319
+ readonly name: "Initialized";
320
+ readonly inputs: readonly [{
321
+ readonly name: "version";
322
+ readonly type: "uint64";
323
+ readonly indexed: false;
324
+ readonly internalType: "uint64";
325
+ }];
326
+ readonly anonymous: false;
327
+ }, {
328
+ readonly type: "event";
329
+ readonly name: "RoleAdminChanged";
330
+ readonly inputs: readonly [{
331
+ readonly name: "role";
332
+ readonly type: "bytes32";
333
+ readonly indexed: true;
334
+ readonly internalType: "bytes32";
335
+ }, {
336
+ readonly name: "previousAdminRole";
337
+ readonly type: "bytes32";
338
+ readonly indexed: true;
339
+ readonly internalType: "bytes32";
340
+ }, {
341
+ readonly name: "newAdminRole";
342
+ readonly type: "bytes32";
343
+ readonly indexed: true;
344
+ readonly internalType: "bytes32";
345
+ }];
346
+ readonly anonymous: false;
347
+ }, {
348
+ readonly type: "event";
349
+ readonly name: "RoleGranted";
350
+ readonly inputs: readonly [{
351
+ readonly name: "role";
352
+ readonly type: "bytes32";
353
+ readonly indexed: true;
354
+ readonly internalType: "bytes32";
355
+ }, {
356
+ readonly name: "account";
357
+ readonly type: "address";
358
+ readonly indexed: true;
359
+ readonly internalType: "address";
360
+ }, {
361
+ readonly name: "sender";
362
+ readonly type: "address";
363
+ readonly indexed: true;
364
+ readonly internalType: "address";
365
+ }];
366
+ readonly anonymous: false;
367
+ }, {
368
+ readonly type: "event";
369
+ readonly name: "RoleRevoked";
370
+ readonly inputs: readonly [{
371
+ readonly name: "role";
372
+ readonly type: "bytes32";
373
+ readonly indexed: true;
374
+ readonly internalType: "bytes32";
375
+ }, {
376
+ readonly name: "account";
377
+ readonly type: "address";
378
+ readonly indexed: true;
379
+ readonly internalType: "address";
380
+ }, {
381
+ readonly name: "sender";
382
+ readonly type: "address";
383
+ readonly indexed: true;
384
+ readonly internalType: "address";
385
+ }];
386
+ readonly anonymous: false;
387
+ }, {
388
+ readonly type: "event";
389
+ readonly name: "Upgraded";
390
+ readonly inputs: readonly [{
391
+ readonly name: "implementation";
392
+ readonly type: "address";
393
+ readonly indexed: true;
394
+ readonly internalType: "address";
395
+ }];
396
+ readonly anonymous: false;
397
+ }, {
398
+ readonly type: "event";
399
+ readonly name: "WithdrawalProcessed";
400
+ readonly inputs: readonly [{
401
+ readonly name: "request";
402
+ readonly type: "tuple";
403
+ readonly indexed: false;
404
+ readonly internalType: "struct SpicenetWithdrawalManagerV1.WithdrawalRequest";
405
+ readonly components: readonly [{
406
+ readonly name: "idempotenceKey";
407
+ readonly type: "bytes32";
408
+ readonly internalType: "bytes32";
409
+ }, {
410
+ readonly name: "nbf";
411
+ readonly type: "uint256";
412
+ readonly internalType: "uint256";
413
+ }, {
414
+ readonly name: "exp";
415
+ readonly type: "uint256";
416
+ readonly internalType: "uint256";
417
+ }, {
418
+ readonly name: "metadata";
419
+ readonly type: "string";
420
+ readonly internalType: "string";
421
+ }, {
422
+ readonly name: "transfers";
423
+ readonly type: "tuple[]";
424
+ readonly internalType: "struct SpicenetWithdrawalManagerV1.TokenTransfer[]";
425
+ readonly components: readonly [{
426
+ readonly name: "token";
427
+ readonly type: "address";
428
+ readonly internalType: "address";
429
+ }, {
430
+ readonly name: "to";
431
+ readonly type: "address";
432
+ readonly internalType: "address";
433
+ }, {
434
+ readonly name: "amount";
435
+ readonly type: "uint256";
436
+ readonly internalType: "uint256";
437
+ }];
438
+ }];
439
+ }];
440
+ readonly anonymous: false;
441
+ }, {
442
+ readonly type: "error";
443
+ readonly name: "AccessControlBadConfirmation";
444
+ readonly inputs: readonly [];
445
+ }, {
446
+ readonly type: "error";
447
+ readonly name: "AccessControlUnauthorizedAccount";
448
+ readonly inputs: readonly [{
449
+ readonly name: "account";
450
+ readonly type: "address";
451
+ readonly internalType: "address";
452
+ }, {
453
+ readonly name: "neededRole";
454
+ readonly type: "bytes32";
455
+ readonly internalType: "bytes32";
456
+ }];
457
+ }, {
458
+ readonly type: "error";
459
+ readonly name: "AddressEmptyCode";
460
+ readonly inputs: readonly [{
461
+ readonly name: "target";
462
+ readonly type: "address";
463
+ readonly internalType: "address";
464
+ }];
465
+ }, {
466
+ readonly type: "error";
467
+ readonly name: "ERC1967InvalidImplementation";
468
+ readonly inputs: readonly [{
469
+ readonly name: "implementation";
470
+ readonly type: "address";
471
+ readonly internalType: "address";
472
+ }];
473
+ }, {
474
+ readonly type: "error";
475
+ readonly name: "ERC1967NonPayable";
476
+ readonly inputs: readonly [];
477
+ }, {
478
+ readonly type: "error";
479
+ readonly name: "FailedCall";
480
+ readonly inputs: readonly [];
481
+ }, {
482
+ readonly type: "error";
483
+ readonly name: "InvalidInitialization";
484
+ readonly inputs: readonly [];
485
+ }, {
486
+ readonly type: "error";
487
+ readonly name: "NotInitializing";
488
+ readonly inputs: readonly [];
489
+ }, {
490
+ readonly type: "error";
491
+ readonly name: "SafeERC20FailedOperation";
492
+ readonly inputs: readonly [{
493
+ readonly name: "token";
494
+ readonly type: "address";
495
+ readonly internalType: "address";
496
+ }];
497
+ }, {
498
+ readonly type: "error";
499
+ readonly name: "UUPSUnauthorizedCallContext";
500
+ readonly inputs: readonly [];
501
+ }, {
502
+ readonly type: "error";
503
+ readonly name: "UUPSUnsupportedProxiableUUID";
504
+ readonly inputs: readonly [{
505
+ readonly name: "slot";
506
+ readonly type: "bytes32";
507
+ readonly internalType: "bytes32";
508
+ }];
509
+ }, {
510
+ readonly type: "error";
511
+ readonly name: "WithdrawalAlreadyProcessed";
512
+ readonly inputs: readonly [{
513
+ readonly name: "idempotenceKey";
514
+ readonly type: "bytes32";
515
+ readonly internalType: "bytes32";
516
+ }, {
517
+ readonly name: "withdrawalInfo";
518
+ readonly type: "tuple";
519
+ readonly internalType: "struct SpicenetWithdrawalManagerV1.WithdrawalInfo";
520
+ readonly components: readonly [{
521
+ readonly name: "processed";
522
+ readonly type: "bool";
523
+ readonly internalType: "bool";
524
+ }, {
525
+ readonly name: "blockNumber";
526
+ readonly type: "uint256";
527
+ readonly internalType: "uint256";
528
+ }, {
529
+ readonly name: "nbf";
530
+ readonly type: "uint256";
531
+ readonly internalType: "uint256";
532
+ }, {
533
+ readonly name: "exp";
534
+ readonly type: "uint256";
535
+ readonly internalType: "uint256";
536
+ }, {
537
+ readonly name: "metadata";
538
+ readonly type: "string";
539
+ readonly internalType: "string";
540
+ }];
541
+ }];
542
+ }, {
543
+ readonly type: "error";
544
+ readonly name: "WithdrawalRequestExpired";
545
+ readonly inputs: readonly [{
546
+ readonly name: "currentTime";
547
+ readonly type: "uint256";
548
+ readonly internalType: "uint256";
549
+ }, {
550
+ readonly name: "exp";
551
+ readonly type: "uint256";
552
+ readonly internalType: "uint256";
553
+ }];
554
+ }, {
555
+ readonly type: "error";
556
+ readonly name: "WithdrawalRequestTooEarly";
557
+ readonly inputs: readonly [{
558
+ readonly name: "currentTime";
559
+ readonly type: "uint256";
560
+ readonly internalType: "uint256";
561
+ }, {
562
+ readonly name: "nbf";
563
+ readonly type: "uint256";
564
+ readonly internalType: "uint256";
565
+ }];
566
+ }];
@@ -0,0 +1,4 @@
1
+ import type { Asset } from "../types/assets";
2
+ export declare function getAssetDisplaySymbol(asset: Pick<Asset, "displaySymbol" | "symbol">): string;
3
+ export declare function getAssetDisplayName(asset: Pick<Asset, "displayName" | "name" | "displaySymbol" | "symbol">): string;
4
+ export declare function getAssetDisplayChainName(asset: Pick<Asset, "displayChainName" | "chainId">): string;
@@ -5,6 +5,8 @@ export type { UIChainConfig as ChainConfig } from "./chainData";
5
5
  export declare const CHAIN_CONFIGS: {
6
6
  [chainId: number]: UIChainConfig;
7
7
  };
8
+ export declare const setRpcOverrides: (overrides?: Record<number, string>) => void;
9
+ export declare const getRpcUrlForChain: (chainId: number) => string | undefined;
8
10
  export declare const getChainConfig: (chainId: number) => UIChainConfig | undefined;
9
11
  export declare const getChainName: (chainId: number) => string;
10
12
  export declare const getDelegateContractAddress: (chainId: number) => string;
@@ -1,11 +1,13 @@
1
1
  import metamaskLogo from "../assets/icons/metamask.png";
2
2
  import rabbyLogo from "../assets/icons/rabby.png";
3
3
  import phantomLogo from "../assets/icons/phantom.png";
4
+ import spicenetLogo from "../assets/icons/spicenet-mark.svg";
4
5
  export { metamaskLogo, rabbyLogo, phantomLogo };
5
6
  export declare const ethLogo: string;
6
7
  export declare const arbLogo: string;
7
8
  export declare const usdcLogo: string;
8
9
  export declare const wbtcLogo: string;
10
+ export { spicenetLogo };
9
11
  export declare const chainLogoMap: {
10
12
  [key: number]: string;
11
13
  };
@@ -1,12 +1,18 @@
1
- import { CreateActionRequest, CreateActionResponse, ExecuteStepRequest } from "../../types/unified";
1
+ import { CreateActionRequest, CreateActionResponse, EstimateActionFeesResponse, ExecuteStepRequest } from "../../types/unified";
2
+ import { SpiceDepositFeeEstimateRequest, SpiceDepositResponse } from "../../types/deposit";
2
3
  import { SwapStep } from "../../types/status";
3
4
  import { ChainBatch } from "../../types/authorization";
5
+ import { CreateWalletRequest, WalletInfo, CreateWithdrawalRequest, CreateWithdrawalResponse, WithdrawalStatus, RollupTimestamp } from "../../types/rollup";
4
6
  export declare const RELAYER_API_URL: string;
5
7
  export declare class RelayerService {
6
8
  private baseUrl;
7
9
  constructor();
8
10
  setBaseUrl(url: string): void;
11
+ getBaseUrl(): string;
12
+ private getEffectiveBaseUrl;
9
13
  createAction(request: CreateActionRequest): Promise<CreateActionResponse>;
14
+ estimateActionFees(request: CreateActionRequest): Promise<NonNullable<EstimateActionFeesResponse["data"]>["feeEstimate"]>;
15
+ estimateSpiceDepositFees(request: SpiceDepositFeeEstimateRequest): Promise<NonNullable<EstimateActionFeesResponse["data"]>["feeEstimate"]>;
10
16
  executeStep(actionId: string, intentIndex: number, stepIndex: number, request: ExecuteStepRequest): Promise<{
11
17
  success: true;
12
18
  transactionHash?: string;
@@ -25,12 +31,17 @@ export declare class RelayerService {
25
31
  tokenAddress: string;
26
32
  chainId: number;
27
33
  amount: string;
34
+ amountMode?: "gross_input" | "net_input";
28
35
  isDeposit?: boolean;
36
+ }): Promise<SpiceDepositResponse>;
37
+ requestSpiceUsdAirdrop(params: {
38
+ chainId: number;
39
+ address: string;
29
40
  }): Promise<{
30
41
  success: boolean;
31
- error?: {
32
- message: string;
33
- };
42
+ txHash?: string;
43
+ amount?: string;
44
+ errorMessage?: string;
34
45
  }>;
35
46
  requestAirdrop(params: {
36
47
  chainId: number;
@@ -43,6 +54,11 @@ export declare class RelayerService {
43
54
  txHash?: string;
44
55
  errorMessage?: string;
45
56
  }>;
57
+ createWallet(address: string, request: CreateWalletRequest): Promise<WalletInfo>;
58
+ getWallet(address: string): Promise<WalletInfo>;
59
+ createWithdrawal(request: CreateWithdrawalRequest): Promise<CreateWithdrawalResponse>;
60
+ getWithdrawal(idempotenceKey: string): Promise<WithdrawalStatus>;
61
+ getRollupTimestamp(): Promise<RollupTimestamp>;
46
62
  }
47
63
  export declare const relayerService: RelayerService;
48
64
  export declare const createInitialSteps: (chainBatches: ChainBatch[], customGetChainName?: (chainId: number) => string) => SwapStep[];
@@ -0,0 +1,14 @@
1
+ import type { Asset } from "../types/assets";
2
+ export interface RollupBalanceEntry {
3
+ receiptToken?: string;
4
+ tokenName: string;
5
+ balanceAvailable: string;
6
+ chainTokens?: string[] | Record<string, {
7
+ name?: string;
8
+ decimals?: number;
9
+ }>;
10
+ decimals?: number;
11
+ balanceUsd?: number | string | null;
12
+ }
13
+ export declare function parseRollupBalanceEntry(token: RollupBalanceEntry, supportedChains?: number[]): Asset | null;
14
+ export declare function fallbackRollupChainName(chainId: number): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spicenet-io/spiceflow-ui",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "description": "Spiceflow UI SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
@@ -65,7 +65,7 @@
65
65
  "author": "",
66
66
  "license": "MIT",
67
67
  "dependencies": {
68
- "@spicenet-io/spiceflow-core": "^0.3.4",
68
+ "@spicenet-io/spiceflow-core": "^0.3.5",
69
69
  "lucide-react": "^0.562.0",
70
70
  "tslib": "^2.8.1"
71
71
  },
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{jsx as i,jsxs as p}from"react/jsx-runtime";import z,{useState as E,useEffect as g}from"react";import{B as u,c as C,S as D}from"./Button-DjsYc4v4.js";import{useDynamicContext as T}from"@dynamic-labs/sdk-react-core";import{createWalletClient as j,custom as B}from"viem";import{b as q}from"./index-DFMaR3pe.js";const v=e=>{if(!e)return!1;const t=e.connector;if(!t)return!1;if(t.isEmbeddedWallet===!0)return!0;const n=(t.key||t.connectorKey||"").toLowerCase();if(n.includes("embedded")||n.includes("turnkey"))return!0;const r=(t.name||e.walletName||"").toLowerCase();return!!(r.includes("embedded")||r.includes("turnkey"))},N=e=>(e?.connectedWallets||[]).find(t=>v(t))||(v(e?.primaryWallet)?e.primaryWallet:null),K=e=>(e?.connectedWallets||[]).find(t=>t?.address&&t?.connector&&!v(t))||null,S=async(e,t)=>{if(!e?.address)throw new Error("Wallet not available");if(typeof e.getWalletClient=="function"){const n=t===void 0?[void 0]:[String(t),t,void 0];let r=null;for(const l of n)try{const a=await e.getWalletClient(l);if(a)return a}catch(a){r=a}if(r)throw r}if(typeof e.getEthereumProvider=="function"){const n=await e.getEthereumProvider(),r=t?q(t)?.viemChain:void 0;return j({account:e.address,chain:r,transport:B(n)})}throw new Error("Wallet client not available")},M=async(e,t)=>{if(!e?.address)throw new Error("Wallet not available");if(typeof e.getEthereumProvider=="function")return e.getEthereumProvider();const n=await S(e,t);return{request:r=>n.request(r)}},O=(e,t)=>({address:e?.address||t.address,chainId:Number(e?.chainId??t.chainId),contractAddress:e?.contractAddress||e?.delegate||t.contractAddress,nonce:BigInt(e?.nonce??t.nonce),r:e?.r,s:e?.s,yParity:(()=>{if(typeof e?.yParity=="number")return e.yParity;const n=Number(e?.v??27);return Number.isFinite(n)?n>=27?n-27:n:0})()}),$=({onAuthSuccess:e,onAuthError:t,theme:n="light",className:r="",buttonText:l="Login with Dynamic",autoTrigger:a=!1})=>{const o=C(n),[m,P]=E(!1),[w,k]=E(!1),L=T(),{user:A,primaryWallet:b,connectedWallets:F,handleLogOut:I,setShowAuthFlow:h,sdkHasLoaded:f,showAuthFlow:x}=L,s=(N({connectedWallets:F,primaryWallet:b})||b)?.address,W=!!A,c=W&&!!s;return g(()=>{P(!0)},[]),g(()=>{c&&s&&e&&e(s)},[c,s,e]),g(()=>{a&&f&&m&&!c&&!x&&!w&&(k(!0),h(!0))},[a,f,m,c,x,w,h]),m?f?W&&!s?i("div",{className:r,children:p("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",flexDirection:"column",gap:"12px"},children:[i(D,{size:40,borderWidth:3,color:o.colors.primary}),i("p",{style:{color:o.colors.textMuted,fontSize:"14px"},children:"Finishing wallet setup..."})]})}):c&&s?i("div",{className:r,children:p(u,{variant:"primary",onClick:async()=>{try{await I()}catch(y){const d=`Dynamic logout failed: ${String(y)}`;t?t(d):console.error(d)}},theme:o,children:["Logout (",s.slice(0,6),"...",s.slice(-4),")"]})}):a?i("div",{className:r,children:p("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",flexDirection:"column",gap:"12px"},children:[i(D,{size:40,borderWidth:3,color:o.colors.primary}),i("p",{style:{color:o.colors.textMuted,fontSize:"14px"},children:"Opening login..."})]})}):i("div",{className:r,children:i(u,{variant:"primary",onClick:()=>{try{h(!0)}catch(y){const d=`Dynamic login failed: ${String(y)}`;t?t(d):console.error(d)}},theme:o,children:l})}):i("div",{className:r,children:i(u,{variant:"primary",disabled:!0,theme:o,children:"Loading..."})}):i("div",{className:r,children:i(u,{variant:"primary",disabled:!0,theme:o,children:l})})};class H extends z.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?this.props.fallback:this.props.children}}const G=e=>{const{theme:t="light",className:n="",buttonText:r="Login with Dynamic",onAuthError:l}=e,a=C(t);return i(H,{fallback:i("div",{className:n,children:i(u,{variant:"primary",onClick:()=>{l&&l('DynamicLogin must be used within SpiceFlowProvider provider="dynamic" and a mounted DynamicContextProvider.')},theme:a,children:r})}),children:i($,{...e})})};export{G as D,M as a,K as b,S as c,N as g,O as n};