@dhedge/trading-widget 3.0.0-alpha.4 → 3.0.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.
Files changed (52) hide show
  1. package/README.md +6 -2
  2. package/core-kit/abi/easy-swapper-v2.d.ts +322 -0
  3. package/core-kit/const/default-data.d.ts +2 -0
  4. package/core-kit/const/network.d.ts +156 -1706
  5. package/core-kit/hooks/pool/multicall/use-pool.static.d.ts +644 -0
  6. package/core-kit/hooks/pool/multicall/use-pools.dynamic.d.ts +4 -1
  7. package/core-kit/hooks/trading/deposit-v2/use-deposit-quote-contract-read.d.ts +322 -0
  8. package/core-kit/hooks/trading/withdraw-v2/index.d.ts +1 -0
  9. package/core-kit/hooks/trading/withdraw-v2/init-step/index.d.ts +3 -0
  10. package/core-kit/hooks/trading/withdraw-v2/init-step/use-init-withdraw-estimated-receive-assets.d.ts +210 -0
  11. package/core-kit/hooks/trading/withdraw-v2/init-step/use-init-withdraw-transaction-arguments.d.ts +5 -0
  12. package/core-kit/hooks/trading/withdraw-v2/init-step/use-is-unroll-and-claim-transaction.d.ts +1 -0
  13. package/core-kit/hooks/trading/withdraw-v2/use-withdraw-assets-info.d.ts +219 -0
  14. package/core-kit/hooks/trading/withdraw-v2/use-withdrawal-vault-address.d.ts +832 -0
  15. package/core-kit/hooks/user/multicall/use-user-multicall.d.ts +322 -0
  16. package/core-kit/types/trading-panel.types.d.ts +1 -1
  17. package/core-kit/utils/common.d.ts +4 -0
  18. package/core-kit/utils/index.d.ts +1 -0
  19. package/index-67db9b4a.cjs +217 -0
  20. package/index-bf566a15.js +40447 -0
  21. package/index.cjs +1 -1
  22. package/index.js +1 -1
  23. package/package.json +1 -1
  24. package/pyth-adapter-76f6458b.cjs +11 -0
  25. package/pyth-adapter-7e6e3809.js +5705 -0
  26. package/style.css +1 -1
  27. package/trading-widget/components/common/balance/withdraw-assets-composition-table.d.ts +7 -0
  28. package/trading-widget/components/common/meta/assets-composition-disclosure/assets-composition-disclosure.d.ts +3 -0
  29. package/trading-widget/components/common/spinner/spinner.d.ts +0 -2
  30. package/trading-widget/components/withdraw/complete-step/balance/complete-withdraw-balance.hooks.d.ts +1 -1
  31. package/trading-widget/components/withdraw/complete-step/complete-step.hooks.d.ts +1 -1
  32. package/trading-widget/components/withdraw/init-step/input-group/init-withdraw-input-group.hooks.d.ts +0 -1
  33. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/all-assets-composition-table/all-assets-composition-table.d.ts +2 -0
  34. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/all-assets-composition-table/all-assets-composition-table.hooks.d.ts +14 -0
  35. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/single-asset-composition-table/single-asset-composition-table.d.ts +3 -0
  36. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/single-asset-composition-table/single-asset-composition-table.hooks.d.ts +10 -0
  37. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/withdraw-section.d.ts +4 -1
  38. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/withdraw-section.hooks.d.ts +11 -8
  39. package/trading-widget/components/withdraw/stepper/withdraw-stepper.d.ts +2 -0
  40. package/trading-widget/components/withdraw/stepper/withdraw-stepper.hooks.d.ts +8 -0
  41. package/trading-widget/components/withdraw/tab-panel/tab-panel.hooks.d.ts +0 -2
  42. package/trading-widget/providers/component-provider/component-provider.hooks.d.ts +0 -1
  43. package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +5 -1
  44. package/trading-widget/utils/synthetix-v3.d.ts +8 -9
  45. package/index-9fbabd1e.js +0 -39505
  46. package/index-aca26249.cjs +0 -207
  47. package/pyth-adapter-5451669c.cjs +0 -11
  48. package/pyth-adapter-f527b1bb.js +0 -4119
  49. package/trading-widget/components/widget/widget-meta/stepper.d.ts +0 -9
  50. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/asset-composition-table/asset-composition-table.d.ts +0 -2
  51. package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/asset-composition-table/asset-composition-table.hooks.d.ts +0 -12
  52. /package/trading-widget/components/withdraw/init-step/input-group/withdraw-section/{asset-composition-table → all-assets-composition-table}/withdraw-explanation-tip.d.ts +0 -0
@@ -64,6 +64,131 @@ export declare const useUserMulticall: ({ address, chainId, }: PoolContractCallP
64
64
  }, {
65
65
  readonly address: `0x${string}`;
66
66
  readonly abi: readonly [{
67
+ readonly anonymous: false;
68
+ readonly inputs: readonly [{
69
+ readonly indexed: true;
70
+ readonly internalType: "address";
71
+ readonly name: "previousOwner";
72
+ readonly type: "address";
73
+ }, {
74
+ readonly indexed: true;
75
+ readonly internalType: "address";
76
+ readonly name: "newOwner";
77
+ readonly type: "address";
78
+ }];
79
+ readonly name: "OwnershipTransferred";
80
+ readonly type: "event";
81
+ }, {
82
+ readonly anonymous: false;
83
+ readonly inputs: readonly [{
84
+ readonly indexed: false;
85
+ readonly internalType: "address";
86
+ readonly name: "proxy";
87
+ readonly type: "address";
88
+ }];
89
+ readonly name: "ProxyCreated";
90
+ readonly type: "event";
91
+ }, {
92
+ readonly anonymous: false;
93
+ readonly inputs: readonly [{
94
+ readonly indexed: false;
95
+ readonly internalType: "address";
96
+ readonly name: "withdrawalVault";
97
+ readonly type: "address";
98
+ }, {
99
+ readonly indexed: true;
100
+ readonly internalType: "address";
101
+ readonly name: "depositor";
102
+ readonly type: "address";
103
+ }];
104
+ readonly name: "WithdrawalCompleted";
105
+ readonly type: "event";
106
+ }, {
107
+ readonly anonymous: false;
108
+ readonly inputs: readonly [{
109
+ readonly indexed: false;
110
+ readonly internalType: "address";
111
+ readonly name: "withdrawalVault";
112
+ readonly type: "address";
113
+ }, {
114
+ readonly indexed: true;
115
+ readonly internalType: "address";
116
+ readonly name: "depositor";
117
+ readonly type: "address";
118
+ }, {
119
+ readonly indexed: false;
120
+ readonly internalType: "address";
121
+ readonly name: "dHedgeVault";
122
+ readonly type: "address";
123
+ }, {
124
+ readonly indexed: false;
125
+ readonly internalType: "uint256";
126
+ readonly name: "amountWithdrawn";
127
+ readonly type: "uint256";
128
+ }];
129
+ readonly name: "WithdrawalInitiated";
130
+ readonly type: "event";
131
+ }, {
132
+ readonly anonymous: false;
133
+ readonly inputs: readonly [{
134
+ readonly indexed: false;
135
+ readonly internalType: "address";
136
+ readonly name: "withdrawalVault";
137
+ readonly type: "address";
138
+ }, {
139
+ readonly indexed: true;
140
+ readonly internalType: "address";
141
+ readonly name: "depositor";
142
+ readonly type: "address";
143
+ }];
144
+ readonly name: "WithdrawalVaultCreated";
145
+ readonly type: "event";
146
+ }, {
147
+ readonly anonymous: false;
148
+ readonly inputs: readonly [{
149
+ readonly indexed: true;
150
+ readonly internalType: "address";
151
+ readonly name: "depositor";
152
+ readonly type: "address";
153
+ }, {
154
+ readonly indexed: true;
155
+ readonly internalType: "address";
156
+ readonly name: "dHedgeVault";
157
+ readonly type: "address";
158
+ }, {
159
+ readonly indexed: false;
160
+ readonly internalType: "contract IERC20";
161
+ readonly name: "vaultDepositToken";
162
+ readonly type: "address";
163
+ }, {
164
+ readonly indexed: false;
165
+ readonly internalType: "contract IERC20";
166
+ readonly name: "userDepositToken";
167
+ readonly type: "address";
168
+ }, {
169
+ readonly indexed: false;
170
+ readonly internalType: "uint256";
171
+ readonly name: "amountReceived";
172
+ readonly type: "uint256";
173
+ }, {
174
+ readonly indexed: false;
175
+ readonly internalType: "uint256";
176
+ readonly name: "lockupTime";
177
+ readonly type: "uint256";
178
+ }];
179
+ readonly name: "ZapDepositCompleted";
180
+ readonly type: "event";
181
+ }, {
182
+ readonly inputs: readonly [];
183
+ readonly name: "DEFAULT_COOLDOWN";
184
+ readonly outputs: readonly [{
185
+ readonly internalType: "uint256";
186
+ readonly name: "";
187
+ readonly type: "uint256";
188
+ }];
189
+ readonly stateMutability: "view";
190
+ readonly type: "function";
191
+ }, {
67
192
  readonly inputs: readonly [{
68
193
  readonly components: readonly [{
69
194
  readonly components: readonly [{
@@ -147,6 +272,16 @@ export declare const useUserMulticall: ({ address, chainId, }: PoolContractCallP
147
272
  }];
148
273
  readonly stateMutability: "view";
149
274
  readonly type: "function";
275
+ }, {
276
+ readonly inputs: readonly [];
277
+ readonly name: "dHedgePoolFactory";
278
+ readonly outputs: readonly [{
279
+ readonly internalType: "address";
280
+ readonly name: "";
281
+ readonly type: "address";
282
+ }];
283
+ readonly stateMutability: "view";
284
+ readonly type: "function";
150
285
  }, {
151
286
  readonly inputs: readonly [{
152
287
  readonly internalType: "address";
@@ -213,6 +348,20 @@ export declare const useUserMulticall: ({ address, chainId, }: PoolContractCallP
213
348
  readonly outputs: readonly [];
214
349
  readonly stateMutability: "nonpayable";
215
350
  readonly type: "function";
351
+ }, {
352
+ readonly inputs: readonly [{
353
+ readonly internalType: "uint8";
354
+ readonly name: "";
355
+ readonly type: "uint8";
356
+ }];
357
+ readonly name: "getLogic";
358
+ readonly outputs: readonly [{
359
+ readonly internalType: "address";
360
+ readonly name: "";
361
+ readonly type: "address";
362
+ }];
363
+ readonly stateMutability: "view";
364
+ readonly type: "function";
216
365
  }, {
217
366
  readonly inputs: readonly [{
218
367
  readonly internalType: "address";
@@ -251,9 +400,66 @@ export declare const useUserMulticall: ({ address, chainId, }: PoolContractCallP
251
400
  readonly type: "uint256";
252
401
  }];
253
402
  readonly name: "initWithdrawal";
403
+ readonly outputs: readonly [{
404
+ readonly components: readonly [{
405
+ readonly internalType: "address";
406
+ readonly name: "token";
407
+ readonly type: "address";
408
+ }, {
409
+ readonly internalType: "uint256";
410
+ readonly name: "balance";
411
+ readonly type: "uint256";
412
+ }];
413
+ readonly internalType: "struct IWithdrawalVault.TrackedAsset[]";
414
+ readonly name: "trackedAssets";
415
+ readonly type: "tuple[]";
416
+ }, {
417
+ readonly internalType: "address";
418
+ readonly name: "vault";
419
+ readonly type: "address";
420
+ }];
421
+ readonly stateMutability: "nonpayable";
422
+ readonly type: "function";
423
+ }, {
424
+ readonly inputs: readonly [{
425
+ readonly internalType: "address";
426
+ readonly name: "_vaultLogic";
427
+ readonly type: "address";
428
+ }, {
429
+ readonly internalType: "address";
430
+ readonly name: "_weth";
431
+ readonly type: "address";
432
+ }, {
433
+ readonly internalType: "contract IWETH";
434
+ readonly name: "_wrappedNativeToken";
435
+ readonly type: "address";
436
+ }, {
437
+ readonly internalType: "contract ISwapper";
438
+ readonly name: "_swapper";
439
+ readonly type: "address";
440
+ }, {
441
+ readonly internalType: "uint256";
442
+ readonly name: "_customCooldown";
443
+ readonly type: "uint256";
444
+ }];
445
+ readonly name: "initialize";
254
446
  readonly outputs: readonly [];
255
447
  readonly stateMutability: "nonpayable";
256
448
  readonly type: "function";
449
+ }, {
450
+ readonly inputs: readonly [{
451
+ readonly internalType: "address";
452
+ readonly name: "_dHedgeVault";
453
+ readonly type: "address";
454
+ }];
455
+ readonly name: "isdHedgeVault";
456
+ readonly outputs: readonly [{
457
+ readonly internalType: "bool";
458
+ readonly name: "isVault";
459
+ readonly type: "bool";
460
+ }];
461
+ readonly stateMutability: "view";
462
+ readonly type: "function";
257
463
  }, {
258
464
  readonly inputs: readonly [{
259
465
  readonly internalType: "address";
@@ -282,6 +488,16 @@ export declare const useUserMulticall: ({ address, chainId, }: PoolContractCallP
282
488
  readonly outputs: readonly [];
283
489
  readonly stateMutability: "payable";
284
490
  readonly type: "function";
491
+ }, {
492
+ readonly inputs: readonly [];
493
+ readonly name: "owner";
494
+ readonly outputs: readonly [{
495
+ readonly internalType: "address";
496
+ readonly name: "";
497
+ readonly type: "address";
498
+ }];
499
+ readonly stateMutability: "view";
500
+ readonly type: "function";
285
501
  }, {
286
502
  readonly inputs: readonly [{
287
503
  readonly internalType: "uint256";
@@ -296,6 +512,71 @@ export declare const useUserMulticall: ({ address, chainId, }: PoolContractCallP
296
512
  readonly outputs: readonly [];
297
513
  readonly stateMutability: "nonpayable";
298
514
  readonly type: "function";
515
+ }, {
516
+ readonly inputs: readonly [];
517
+ readonly name: "renounceOwnership";
518
+ readonly outputs: readonly [];
519
+ readonly stateMutability: "nonpayable";
520
+ readonly type: "function";
521
+ }, {
522
+ readonly inputs: readonly [{
523
+ readonly internalType: "uint256";
524
+ readonly name: "_customCooldown";
525
+ readonly type: "uint256";
526
+ }];
527
+ readonly name: "setCustomCooldown";
528
+ readonly outputs: readonly [];
529
+ readonly stateMutability: "nonpayable";
530
+ readonly type: "function";
531
+ }, {
532
+ readonly inputs: readonly [{
533
+ readonly components: readonly [{
534
+ readonly internalType: "address";
535
+ readonly name: "dHedgeVault";
536
+ readonly type: "address";
537
+ }, {
538
+ readonly internalType: "bool";
539
+ readonly name: "whitelisted";
540
+ readonly type: "bool";
541
+ }];
542
+ readonly internalType: "struct EasySwapperV2.CustomCooldownSetting[]";
543
+ readonly name: "_whitelistSettings";
544
+ readonly type: "tuple[]";
545
+ }];
546
+ readonly name: "setCustomCooldownWhitelist";
547
+ readonly outputs: readonly [];
548
+ readonly stateMutability: "nonpayable";
549
+ readonly type: "function";
550
+ }, {
551
+ readonly inputs: readonly [{
552
+ readonly internalType: "address";
553
+ readonly name: "_vaultLogic";
554
+ readonly type: "address";
555
+ }];
556
+ readonly name: "setLogic";
557
+ readonly outputs: readonly [];
558
+ readonly stateMutability: "nonpayable";
559
+ readonly type: "function";
560
+ }, {
561
+ readonly inputs: readonly [{
562
+ readonly internalType: "contract ISwapper";
563
+ readonly name: "_swapper";
564
+ readonly type: "address";
565
+ }];
566
+ readonly name: "setSwapper";
567
+ readonly outputs: readonly [];
568
+ readonly stateMutability: "nonpayable";
569
+ readonly type: "function";
570
+ }, {
571
+ readonly inputs: readonly [{
572
+ readonly internalType: "address";
573
+ readonly name: "_dHedgePoolFactory";
574
+ readonly type: "address";
575
+ }];
576
+ readonly name: "setdHedgePoolFactory";
577
+ readonly outputs: readonly [];
578
+ readonly stateMutability: "nonpayable";
579
+ readonly type: "function";
299
580
  }, {
300
581
  readonly inputs: readonly [];
301
582
  readonly name: "swapper";
@@ -306,6 +587,47 @@ export declare const useUserMulticall: ({ address, chainId, }: PoolContractCallP
306
587
  }];
307
588
  readonly stateMutability: "view";
308
589
  readonly type: "function";
590
+ }, {
591
+ readonly inputs: readonly [{
592
+ readonly internalType: "address";
593
+ readonly name: "newOwner";
594
+ readonly type: "address";
595
+ }];
596
+ readonly name: "transferOwnership";
597
+ readonly outputs: readonly [];
598
+ readonly stateMutability: "nonpayable";
599
+ readonly type: "function";
600
+ }, {
601
+ readonly inputs: readonly [{
602
+ readonly internalType: "address";
603
+ readonly name: "_dHedgeVault";
604
+ readonly type: "address";
605
+ }, {
606
+ readonly internalType: "uint256";
607
+ readonly name: "_amountIn";
608
+ readonly type: "uint256";
609
+ }, {
610
+ readonly internalType: "uint256";
611
+ readonly name: "_slippageTolerance";
612
+ readonly type: "uint256";
613
+ }];
614
+ readonly name: "unrollAndClaim";
615
+ readonly outputs: readonly [{
616
+ readonly components: readonly [{
617
+ readonly internalType: "address";
618
+ readonly name: "token";
619
+ readonly type: "address";
620
+ }, {
621
+ readonly internalType: "uint256";
622
+ readonly name: "balance";
623
+ readonly type: "uint256";
624
+ }];
625
+ readonly internalType: "struct IWithdrawalVault.TrackedAsset[]";
626
+ readonly name: "";
627
+ readonly type: "tuple[]";
628
+ }];
629
+ readonly stateMutability: "nonpayable";
630
+ readonly type: "function";
309
631
  }, {
310
632
  readonly inputs: readonly [];
311
633
  readonly name: "weth";
@@ -27,7 +27,7 @@ type RemoveTransaction = {
27
27
  } & Partial<PendingTransaction>;
28
28
  export type UpdateTransactionsArguments = AddTransaction | UpdateTransaction | RemoveTransaction;
29
29
  export type TradingPanelType = 'deposit' | 'withdraw';
30
- export type TransactionAction = 'deposit' | 'multi_withdraw' | 'single_withdraw' | 'approve' | 'oraclesUpdate' | 'swap' | 'claim';
30
+ export type TransactionAction = 'deposit' | 'multi_withdraw' | 'single_withdraw' | 'approve' | 'oraclesUpdate' | 'swap' | 'claim' | 'single_withdraw_and_claim';
31
31
  export type SwapEntity = 'token' | 'pool';
32
32
  export interface TokenSelectorPayload {
33
33
  isOpen: boolean;
@@ -0,0 +1,4 @@
1
+ export declare const sliceByIndex: <T>(data: T[], index: number) => {
2
+ firstPart: T[];
3
+ secondPart: T[];
4
+ };
@@ -1,3 +1,4 @@
1
+ export * from './common';
1
2
  export * from './url';
2
3
  export * from './web3';
3
4
  export * from './number';