@dhedge/trading-widget 3.2.0 → 3.2.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.
Files changed (28) hide show
  1. package/README.md +95 -94
  2. package/core-kit/abi/easy-swapper-v2.d.ts +4 -0
  3. package/core-kit/hooks/pool/multicall/use-pool.static.d.ts +8 -0
  4. package/core-kit/hooks/trading/deposit-v2/use-deposit-quote-contract-read.d.ts +4 -0
  5. package/core-kit/hooks/trading/use-is-transaction-loading.d.ts +2 -0
  6. package/core-kit/hooks/trading/withdraw-v2/init-step/use-init-withdraw-transaction.d.ts +5 -1
  7. package/core-kit/hooks/trading/withdraw-v2/use-withdrawal-vault-address.d.ts +4 -0
  8. package/core-kit/hooks/user/multicall/use-user-multicall.d.ts +4 -0
  9. package/{index-d62956b7.js → index-1ece81a6.js} +6395 -6357
  10. package/{index-8d920656.cjs → index-925f46e2.cjs} +42 -42
  11. package/index.cjs +1 -1
  12. package/index.js +1 -1
  13. package/package.json +1 -1
  14. package/{pyth-adapter-c8d76d79.cjs → pyth-adapter-59d66d7b.cjs} +1 -1
  15. package/{pyth-adapter-e278f630.js → pyth-adapter-de3394ab.js} +1 -1
  16. package/style.css +1 -1
  17. package/trading-widget/components/deposit/button/trade-button/trade-button.hooks.d.ts +1 -0
  18. package/trading-widget/components/deposit/button/valid-deposit-button/valid-deposit-button.hooks.d.ts +1 -0
  19. package/trading-widget/components/widget/widget-buttons/approve-button/approve-button.hooks.d.ts +1 -0
  20. package/trading-widget/components/widget/widget-buttons/reload-swap-quote-button/reload-deposit-swap-quote-button/reload-deposit-swap-quote-button.hooks.d.ts +0 -1
  21. package/trading-widget/components/widget/widget-buttons/reload-swap-quote-button/reload-withdraw-swap-quote-button/reload-withdraw-swap-quote-button.hooks.d.ts +0 -1
  22. package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-overlay.hooks.d.ts +1 -0
  23. package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-summary/vault-transaction-summary.d.ts +1 -7
  24. package/trading-widget/components/withdraw/complete-step/button/claim-button/claim-button.hooks.d.ts +1 -0
  25. package/trading-widget/components/withdraw/complete-step/button/swap-button/swap-button.hooks.d.ts +1 -0
  26. package/trading-widget/components/withdraw/init-step/button/init-withdraw-button/init-withdraw-button.hooks.d.ts +1 -0
  27. package/trading-widget/components/withdraw/init-step/meta/transaction-disclosure/transaction-disclosure.hooks.d.ts +1 -0
  28. package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +1 -0
package/README.md CHANGED
@@ -427,101 +427,102 @@ path: `component.meta[name]`
427
427
  <code>Translation keys</code>
428
428
  </summary>|
429
429
 
430
- > | name | type | default value | description |
431
- > | -------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
432
- > | `depositSlippageWarning` | string | Excludes entry fee. Slippage may be amplified by the leverage. See the docs for more info. | |
433
- > | `withdrawSlippageWarning` | string | Slippage only applies to single asset withdrawals and withdrawals from vaults with debt positions in Aave. | |
434
- > | `minSlippageWarning` | string | Flexible min slippage value that is likely enough to process the transaction. | |
435
- > | `highSlippageWarning` | string | We recommend using another asset to trade with lower slippage. | |
436
- > | `recommendedMinSlippage` | string | Recommended Min Slippage | |
437
- > | `projectedDailyEarningsTooltip` | string | Projected daily earnings are based on the current APY and may differ from actual earnings. | |
438
- > | `dailyEarnings` | string | Daily Earnings | |
439
- > | `projectedYearlyEarningsTooltip` | string | Projected yearly earnings are based on the current APY and may differ from actual earnings. | |
440
- > | `yearlyEarnings` | string | Yearly Earnings | |
441
- > | `fullReceiveDetails` | string | See full details influencing what you will receive. | |
442
- > | `tradeDetails` | string | Trade details | |
443
- > | `maxSlippage` | string | Max slippage | |
444
- > | `minReceiveAmount` | string | You will receive no less than this amount. | |
445
- > | `minReceived` | string | Minimum Received | |
446
- > | `estimatedMultiAssetFractions` | string | Estimated multi asset fractions | |
447
- > | `infinite` | string | Infinite | |
448
- > | `tokenAllowance` | string | Token Allowance | |
449
- > | `entryFee` | string | Entry Fee | |
450
- > | `entryFeeExplanation` | string | When you deposit, the token takes a small entry fee. This fee helps cover the costs when we rebalance the underlying funds, and it's shared among all token holders. | |
451
- > | `minDepositUsd` | string | Minimum deposit in USD. | |
452
- > | `minDeposit` | string | Minimum Deposit | |
453
- > | `tokensLockTime` | string | Purchased tokens will have a {lockTime} lock. | |
454
- > | `slippageTolerance` | string | Slippage tolerance | |
455
- > | `bypassEntryFee` | string | Bypass Entry Fee | |
456
- > | `tokenAmountToApprove` | string | Amount of tokens to be approved. | |
457
- > | `auto` | string | Auto | |
458
- > | `lengthenLockup` | string | Lengthen lockup to remove entry fee | |
459
- > | `deposit` | string | Buy | |
460
- > | `withdraw` | string | Sell | |
461
- > | `yourBalance` | string | Your Balance | |
462
- > | `max` | string | Max | |
463
- > | `allAssets` | string | All Assets | |
464
- > | `all` | string | All | |
465
- > | `payWith` | string | Pay with | |
466
- > | `buyEstimated` | string | Buy (estimated) | |
467
- > | `sell` | string | Sell | |
468
- > | `receiveEstimated` | string | Receive (estimated) | |
469
- > | `confirmInWallet` | string | Please confirm in wallet | |
470
- > | `pending` | string | Pending... | |
471
- > | `approve` | string | Approve | |
472
- > | `connectWallet` | string | Connect Wallet | |
473
- > | `minimumPurchase` | string | Minimum purchase is ${value} | |
474
- > | `poolIsInactive` | string | {poolSymbol} token is no longer active. Please withdraw from them. | |
475
- > | `poolIsPrivate` | string | This vault is currently private | |
476
- > | `updateOracles` | string | Update Oracles | |
477
- > | `checkingOracles` | string | Checking Oracles | |
478
- > | `confirmMaxSlippage` | string | Confirm {slippagePercentage}% max slippage | |
479
- > | `withdrawalWindowDisabled` | string | You can sell your {tokenSymbol} tokens during withdrawal window period starting from {startTime} | |
480
- > | `withdrawalLiquidityDisabled` | string | Intended withdraw value is greater than available liquidity ({symbol} {value}) | |
481
- > | `withdrawCooldown` | string | You can sell your {tokenSymbol} tokens in {cooldownEndTime} | |
482
- > | `termsOfUse` | string | Terms Of Use | |
483
- > | `termOfUseDepositListTitle` | string | Please know the following before depositing | |
484
- > | `termOfUseDepositAssetSlippage` | string | When exiting, investors receive single asset or the underlying vault assets. Withdraw slippage can be customized in withdraw settings | |
485
- > | `termOfUseDepositBugs` | string | There may be interface bugs on the platform | |
486
- > | `termOfUseDepositDowntime` | string | There may be interface downtime (planned and unplanned) | |
487
- > | `termOfUseDepositAuditRisk` | string | Smart contracts are audited but a risk is still present | |
488
- > | `termOfUseDepositAccept` | string | Accept & Deposit | |
489
- > | `back` | string | Back | |
490
- > | `highSlippage` | string | High Slippage Alert | |
430
+ > | name | type | default value | description |
431
+ > | -------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- |
432
+ > | `depositSlippageWarning` | string | Excludes entry fee. Slippage may be amplified by the leverage. See the docs for more info. | |
433
+ > | `withdrawSlippageWarning` | string | Slippage only applies to single asset withdrawals and withdrawals from vaults with debt positions in Aave. | |
434
+ > | `minSlippageWarning` | string | Flexible min slippage value that is likely enough to process the transaction. | |
435
+ > | `highSlippageWarning` | string | We recommend using another asset to trade with lower slippage. | |
436
+ > | `recommendedMinSlippage` | string | Recommended Min Slippage | |
437
+ > | `projectedDailyEarningsTooltip` | string | Projected daily earnings are based on the current APY and may differ from actual earnings. | |
438
+ > | `dailyEarnings` | string | Daily Earnings | |
439
+ > | `projectedYearlyEarningsTooltip` | string | Projected yearly earnings are based on the current APY and may differ from actual earnings. | |
440
+ > | `yearlyEarnings` | string | Yearly Earnings | |
441
+ > | `fullReceiveDetails` | string | See full details influencing what you will receive. | |
442
+ > | `tradeDetails` | string | Trade details | |
443
+ > | `maxSlippage` | string | Max slippage | |
444
+ > | `minReceiveAmount` | string | You will receive no less than this amount. | |
445
+ > | `minReceived` | string | Minimum Received | |
446
+ > | `estimatedMultiAssetFractions` | string | Estimated multi asset fractions | |
447
+ > | `infinite` | string | Infinite | |
448
+ > | `tokenAllowance` | string | Token Allowance | |
449
+ > | `entryFee` | string | Entry Fee | |
450
+ > | `entryFeeExplanation` | string | When you deposit, the token takes a small entry fee. This fee helps cover the costs when we rebalance the underlying funds, and it's shared among all token holders. | |
451
+ > | `minDepositUsd` | string | Minimum deposit in USD. | |
452
+ > | `minDeposit` | string | Minimum Deposit | |
453
+ > | `tokensLockTime` | string | Purchased tokens will have a {lockTime} lock. | |
454
+ > | `slippageTolerance` | string | Slippage tolerance | |
455
+ > | `bypassEntryFee` | string | Bypass Entry Fee | |
456
+ > | `tokenAmountToApprove` | string | Amount of tokens to be approved. | |
457
+ > | `auto` | string | Auto | |
458
+ > | `lengthenLockup` | string | Lengthen lockup to remove entry fee | |
459
+ > | `deposit` | string | Buy | |
460
+ > | `withdraw` | string | Sell | |
461
+ > | `yourBalance` | string | Your Balance | |
462
+ > | `max` | string | Max | |
463
+ > | `allAssets` | string | All Assets | |
464
+ > | `all` | string | All | |
465
+ > | `payWith` | string | Pay with | |
466
+ > | `buyEstimated` | string | Buy (estimated) | |
467
+ > | `sell` | string | Sell | |
468
+ > | `receiveEstimated` | string | Receive (estimated) | |
469
+ > | `confirmInWallet` | string | Please confirm in wallet | |
470
+ > | `pending` | string | Pending... | |
471
+ > | `approve` | string | Approve | |
472
+ > | `connectWallet` | string | Connect Wallet | |
473
+ > | `minimumPurchase` | string | Minimum purchase is ${value} | |
474
+ > | `poolIsInactive` | string | {poolSymbol} token is no longer active. Please withdraw from them. | |
475
+ > | `poolIsPrivate` | string | This vault is currently private | |
476
+ > | `updateOracles` | string | Update Oracles | |
477
+ > | `checkingOracles` | string | Checking Oracles | |
478
+ > | `confirmMaxSlippage` | string | Confirm {slippagePercentage}% max slippage | |
479
+ > | `withdrawalWindowDisabled` | string | You can sell your {tokenSymbol} tokens during withdrawal window period starting from {startTime} | |
480
+ > | `withdrawalLiquidityDisabled` | string | Intended withdraw value is greater than available liquidity ({symbol} {value}) | |
481
+ > | `withdrawCooldown` | string | You can sell your {tokenSymbol} tokens in {cooldownEndTime} | |
482
+ > | `termsOfUse` | string | Terms Of Use | |
483
+ > | `termOfUseDepositListTitle` | string | Please know the following before depositing | |
484
+ > | `termOfUseDepositAssetSlippage` | string | When exiting, investors receive single asset or the underlying vault assets. Withdraw slippage can be customized in withdraw settings | |
485
+ > | `termOfUseDepositBugs` | string | There may be interface bugs on the platform | |
486
+ > | `termOfUseDepositDowntime` | string | There may be interface downtime (planned and unplanned) | |
487
+ > | `termOfUseDepositAuditRisk` | string | Smart contracts are audited but a risk is still present | |
488
+ > | `termOfUseDepositAccept` | string | Accept & Deposit | |
489
+ > | `back` | string | Back | |
490
+ > | `highSlippage` | string | High Slippage Alert | |
491
491
  > | `responsibleHighSlippage` | string | By proceeding with this trade, you acknowledge and accept the possibility of experiencing high slippage, resulting in a potential difference between the expected and executed price. | |
492
- > | `highSlippageListTitle` | string | Please consider the following before confirming | |
493
- > | `highSlippageQuoteDiff` | string | Be aware that the final amount of assets you receive may be different from the initially quoted value. | |
494
- > | `highSlippageRisk` | string | Ensure that you understand the risks associated with high slippage and are comfortable proceeding with the trade. | |
495
- > | `confirm` | string | Confirm | |
496
- > | `selectToken` | string | Select Token | |
497
- > | `sendingOrderToWallet` | string | Sending order to your wallet | |
498
- > | `settingUpTx` | string | Setting up transaction | |
499
- > | `miningTx` | string | Processing | |
500
- > | `updateSynthetixOracles` | string | Updating Synthetix Oracles | |
501
- > | `approveSpending` | string | Approve {symbol} spending | |
502
- > | `pay` | string | Pay | |
503
- > | `multiAssetFractions` | string | multi asset fractions | |
504
- > | `swappableAssets` | string | swappable assets | |
505
- > | `explorer` | string | Explorer | |
506
- > | `as` | string | As | |
507
- > | `switchNetwork` | string | Switch Network | |
508
- > | `depositAction` | string | Buy | |
509
- > | `withdrawAction` | string | Sell | |
510
- > | `swapAction` | string | Swap | |
511
- > | `unrollAction` | string | Unroll | |
512
- > | `unrollAndClaimAction` | string | Claim | |
513
- > | `claimAction` | string | Claim Without Swap | |
514
- > | `claimLabel` | string | Claim Assets | |
515
- > | `swapAndClaimTo` | string | Swap and claim assets to | |
516
- > | `initWithdrawDescription` | string | Unroll | |
517
- > | `initWithdrawTooltip` | string | Unroll prepares assets for single asset withdrawal | |
518
- > | `completeWithdrawDescription` | string | Claim | |
519
- > | `completeWithdrawTooltip` | string | This final step swaps all assets to a single asset and sends it to your wallet | |
520
- > | `unrollAndClaimDescription` | string | Claim | |
521
- > | `total` | string | Total: | |
522
- > | `showAll` | string | Show All | |
523
- > | `hide` | string | Hide | |
524
- > | `refreshSwapQuoteTooltip` | string | Refresh swap quote | |
492
+ > | `highSlippageListTitle` | string | Please consider the following before confirming | |
493
+ > | `highSlippageQuoteDiff` | string | Be aware that the final amount of assets you receive may be different from the initially quoted value. | |
494
+ > | `highSlippageRisk` | string | Ensure that you understand the risks associated with high slippage and are comfortable proceeding with the trade. | |
495
+ > | `confirm` | string | Confirm | |
496
+ > | `selectToken` | string | Select Token | |
497
+ > | `sendingOrderToWallet` | string | Sending order to your wallet | |
498
+ > | `settingUpTx` | string | Setting up transaction | |
499
+ > | `miningTx` | string | Processing | |
500
+ > | `updateSynthetixOracles` | string | Updating Synthetix Oracles | |
501
+ > | `approveSpending` | string | Approve {symbol} spending | |
502
+ > | `pay` | string | Pay | |
503
+ > | `multiAssetFractions` | string | multi asset fractions | |
504
+ > | `swappableAssets` | string | swappable assets | |
505
+ > | `explorer` | string | Explorer | |
506
+ > | `as` | string | As | |
507
+ > | `switchNetwork` | string | Switch Network | |
508
+ > | `depositAction` | string | Buy | |
509
+ > | `withdrawAction` | string | Sell | |
510
+ > | `swapAction` | string | Swap | |
511
+ > | `unrollAction` | string | Unroll | |
512
+ > | `unrollAndClaimAction` | string | Claim | |
513
+ > | `claimAction` | string | Claim Without Swap | |
514
+ > | `claimLabel` | string | Claim Assets | |
515
+ > | `swapAndClaimTo` | string | Swap and claim assets to | |
516
+ > | `initWithdrawDescription` | string | Unroll | |
517
+ > | `initWithdrawTooltip` | string | Unroll prepares assets for single asset withdrawal | |
518
+ > | `completeWithdrawDescription` | string | Claim | |
519
+ > | `completeWithdrawTooltip` | string | This final step swaps all assets to a single asset and sends it to your wallet | |
520
+ > | `unrollAndClaimDescription` | string | Claim | |
521
+ > | `total` | string | Total: | |
522
+ > | `showAll` | string | Show All | |
523
+ > | `hide` | string | Hide | |
524
+ > | `refreshSwapQuoteTooltip` | string | Refresh swap quote | |
525
+ > | `proceedWithNextStep` | string | Please proceed with the next step. | |
525
526
 
526
527
  ###### Source: `packages/trading-widget/src/trading-widget/providers/translation-provider/translation-provider.tsx`
527
528
 
@@ -1,4 +1,8 @@
1
1
  export declare const EasySwapperV2Abi: readonly [{
2
+ readonly inputs: readonly [];
3
+ readonly name: "EmptyPayload";
4
+ readonly type: "error";
5
+ }, {
2
6
  readonly inputs: readonly [];
3
7
  readonly name: "FailedInnerCall";
4
8
  readonly type: "error";
@@ -246,6 +246,10 @@ export declare const usePoolStatic: ({ address, chainId }: PoolContractCallParam
246
246
  }, {
247
247
  readonly address: `0x${string}`;
248
248
  readonly abi: readonly [{
249
+ readonly inputs: readonly [];
250
+ readonly name: "EmptyPayload";
251
+ readonly type: "error";
252
+ }, {
249
253
  readonly inputs: readonly [];
250
254
  readonly name: "FailedInnerCall";
251
255
  readonly type: "error";
@@ -1197,6 +1201,10 @@ export declare const usePoolStatic: ({ address, chainId }: PoolContractCallParam
1197
1201
  }, {
1198
1202
  readonly address: `0x${string}`;
1199
1203
  readonly abi: readonly [{
1204
+ readonly inputs: readonly [];
1205
+ readonly name: "EmptyPayload";
1206
+ readonly type: "error";
1207
+ }, {
1200
1208
  readonly inputs: readonly [];
1201
1209
  readonly name: "FailedInnerCall";
1202
1210
  readonly type: "error";
@@ -1,5 +1,9 @@
1
1
  import type { PoolConfig } from 'core-kit/types/config.types';
2
2
  export declare const useDepositQuoteContractRead: ({ address, chainId, }: Pick<PoolConfig, 'address' | 'chainId'>) => import("wagmi").UseReadContractReturnType<readonly [{
3
+ readonly inputs: readonly [];
4
+ readonly name: "EmptyPayload";
5
+ readonly type: "error";
6
+ }, {
3
7
  readonly inputs: readonly [];
4
8
  readonly name: "FailedInnerCall";
5
9
  readonly type: "error";
@@ -0,0 +1,2 @@
1
+ import type { TransactionAction } from 'core-kit/types';
2
+ export declare const useIsTransactionLoading: (transaction: TransactionAction) => boolean;
@@ -1,2 +1,6 @@
1
+ import type { TransactionAction } from 'core-kit/types';
1
2
  import type { ContractActionFunc } from 'core-kit/types/web3.types';
2
- export declare const useInitWithdrawTransaction: () => ContractActionFunc;
3
+ export declare const useInitWithdrawTransaction: () => {
4
+ withdraw: ContractActionFunc;
5
+ action: TransactionAction;
6
+ };
@@ -1,4 +1,8 @@
1
1
  export declare const useWithdrawalVaultAddress: () => import("wagmi").UseReadContractReturnType<readonly [{
2
+ readonly inputs: readonly [];
3
+ readonly name: "EmptyPayload";
4
+ readonly type: "error";
5
+ }, {
2
6
  readonly inputs: readonly [];
3
7
  readonly name: "FailedInnerCall";
4
8
  readonly type: "error";
@@ -64,6 +64,10 @@ export declare const useUserMulticall: ({ address, chainId, }: PoolContractCallP
64
64
  }, {
65
65
  readonly address: `0x${string}`;
66
66
  readonly abi: readonly [{
67
+ readonly inputs: readonly [];
68
+ readonly name: "EmptyPayload";
69
+ readonly type: "error";
70
+ }, {
67
71
  readonly inputs: readonly [];
68
72
  readonly name: "FailedInnerCall";
69
73
  readonly type: "error";