@dhedge/trading-widget 1.0.5 → 1.1.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 (31) hide show
  1. package/README.md +109 -105
  2. package/core-kit/const/flat-money.d.ts +3 -0
  3. package/core-kit/const/index.d.ts +1 -0
  4. package/core-kit/const/tokens/base.d.ts +1 -0
  5. package/core-kit/hooks/state/action.d.ts +1 -0
  6. package/core-kit/hooks/state/index.d.ts +1 -1
  7. package/core-kit/types/state.types.d.ts +2 -0
  8. package/core-kit/utils/flat-money.d.ts +3 -0
  9. package/core-kit/utils/index.d.ts +1 -1
  10. package/index-dca213af.cjs +207 -0
  11. package/{index-a391969b.js → index-f2316dae.js} +28021 -27926
  12. package/index.cjs +1 -1
  13. package/index.d.ts +1 -1
  14. package/index.js +196 -195
  15. package/package.json +1 -1
  16. package/{pyth-adapter-9bc1dcc8.js → pyth-adapter-838d5775.js} +1 -1
  17. package/{pyth-adapter-8163f926.cjs → pyth-adapter-e7d0a027.cjs} +1 -1
  18. package/style.css +1 -1
  19. package/trading-widget/components/common/alert/alert.d.ts +6 -0
  20. package/trading-widget/components/common/index.d.ts +1 -0
  21. package/trading-widget/components/widget/widget-input/asset-composition-table/asset-composition-table.hooks.d.ts +1 -0
  22. package/trading-widget/providers/component-provider/component-provider.d.ts +1 -0
  23. package/trading-widget/providers/component-provider/component-provider.defaults.d.ts +2 -0
  24. package/trading-widget/providers/component-provider/component-provider.hooks.d.ts +1 -0
  25. package/trading-widget/providers/component-provider/component-provider.types.d.ts +1 -0
  26. package/trading-widget/providers/config-provider/config-provider.types.d.ts +2 -1
  27. package/trading-widget/providers/overlay-provider/overlay-provider.hooks.d.ts +2 -1
  28. package/trading-widget/providers/overlay-provider/overlay-provider.types.d.ts +3 -2
  29. package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +1 -0
  30. package/core-kit/utils/fmed.d.ts +0 -2
  31. package/index-c83fa790.cjs +0 -207
package/README.md CHANGED
@@ -62,6 +62,7 @@ Top level provider component. Headless part of trading logic. API handles params
62
62
  > | `onUpdateTradingModal` | (payload: Partial\<{ isOpen: `boolean`; status: `'Success' \| 'None' \| 'Mining' \| 'Wallet'` }\>) => void | undefined | triggers on trading modal change |
63
63
  > | `onUpdateTransactions` | (payload: AddTransaction \| UpdateTransaction \| RemoveTransaction) => void | undefined | triggers on transaction action change |
64
64
  > | `onUpdateEntryFee` | (payload: Partial\<Record<DepositMethodName, number>\>) => void | undefined | triggers on transaction action change |
65
+ > | `onTradingSettleError` | (error: `Error`) => void | undefined | triggers on trading settle error |
65
66
  > | `onTransactionError` | (error: `Error`, action: `TransactionAction` \| `undefined`, chainId?: `ChainId`, txHash?: `Address`) => void | undefined | triggers on transaction error |
66
67
  > | `onTransactionSuccess` | (data: `WaitForTransactionReceiptReturnType`, action: `TransactionAction` \| `undefined`, link?: `string`) => void | undefined | triggers on transaction success |
67
68
  > | `onTransactionEstimationError` | (error: `EstimationError`, address: `Address`, chainId?: `ChainId`, account?: `Address`) => void | undefined | triggers on transaction estimation error |
@@ -104,29 +105,30 @@ UI configuration provider. Manages params to configure custom styling, component
104
105
 
105
106
  ##### params
106
107
 
107
- > | name | type | default value | description |
108
- > |------------------------------------|----------------------------------------------------------------|------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
109
- > | `isGeoBlocked` | `boolean` | `false` | Restricts depositing action button and conditionally renders GeoBlockAlert component |
110
- > | `depositQuoteDiffWarningThreshold` | `number` | `1` | Deposit slippage absolute percent value warning threshold, Affects styling to warn user |
111
- > | `depositQuoteDiffErrorThreshold` | `number` | `3` | Deposit slippage absolute percent value error threshold, Affects styling to warn user |
112
- > | `defaultDepositSlippage` | `number` | `0` | Initial deposit slippage absolute percent. Further adjustments are available in panel settings |
113
- > | `defaultDepositSlippageScale` | `number[]` | `[0]` | Initial deposit slippage absolute percent. Further adjustments are available in panel settings |
114
- > | `defaultWithdrawSlippageScale` | `number[]` | `[0.1, 0.3, 0.5, 1, 1.5, 3]` | Initial withdraw slippage absolute percent. Further adjustments are available in panel settings |
115
- > | `defaultLockTime` | `string` | `'24 hours'` | Formatted default deposit lock time to be displayed in panel (Long lockup period is used to bypass entry fee and can be managed in panel settings) |
116
- > | `customLockTime` | `string` | `'15 minutes'` | Formatted custom deposit lock time alternative to be displayed in panel |
117
- > | `stablePrecision` | `number` | `3` | Number of decimals to be displayed in stables (e.g USDC balance) |
118
- > | `defaultPrecision` | `number` | `6` | Number of decimals to be displayed in token values |
119
- > | `stakingChainId` | `number` | `10` (Optimism) | ChainId to be used in staking logic |
120
- > | `termsOfUseAccepted` | `boolean` | `true` | Requires user to confirm terms of use by rendering DepositTermsOfUse component before deposit action |
121
- > | `standalone` | `boolean` | `true` | Handles token selection in SPA mode |
122
- > | `chainConfig` | `Partial<Record<ChainId, { name: string; iconPath: string }>>` | `{}` | Sets map of chain `name` and `iconPath` |
108
+ > | name | type | default value | description |
109
+ > |------------------------------------|----------------------------------------------------------------|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
110
+ > | `isGeoBlocked` | `boolean` | `false` | Restricts depositing action button and conditionally renders GeoBlockAlert component |
111
+ > | `isSanctioned` | `boolean` | `false` | Restricts depositing action button and conditionally renders SanctionedAlert component |
112
+ > | `depositQuoteDiffWarningThreshold` | `number` | `1` | Deposit slippage absolute percent value warning threshold, Affects styling to warn user |
113
+ > | `depositQuoteDiffErrorThreshold` | `number` | `3` | Deposit slippage absolute percent value error threshold, Affects styling to warn user |
114
+ > | `defaultDepositSlippage` | `number` | `0` | Initial deposit slippage absolute percent. Further adjustments are available in panel settings |
115
+ > | `defaultDepositSlippageScale` | `number[]` | `[0]` | Initial deposit slippage absolute percent. Further adjustments are available in panel settings |
116
+ > | `defaultWithdrawSlippageScale` | `number[]` | `[0.1, 0.3, 0.5, 1, 1.5, 3]` | Initial withdraw slippage absolute percent. Further adjustments are available in panel settings |
117
+ > | `defaultLockTime` | `string` | `'24 hours'` | Formatted default deposit lock time to be displayed in panel (Long lockup period is used to bypass entry fee and can be managed in panel settings) |
118
+ > | `customLockTime` | `string` | `'15 minutes'` | Formatted custom deposit lock time alternative to be displayed in panel |
119
+ > | `stablePrecision` | `number` | `3` | Number of decimals to be displayed in stables (e.g USDC balance) |
120
+ > | `defaultPrecision` | `number` | `6` | Number of decimals to be displayed in token values |
121
+ > | `stakingChainId` | `number` | `10` (Optimism) | ChainId to be used in staking logic |
122
+ > | `termsOfUseAccepted` | `boolean` | `true` | Requires user to confirm terms of use by rendering DepositTermsOfUse component before deposit action |
123
+ > | `standalone` | `boolean` | `true` | Handles token selection in SPA mode |
124
+ > | `chainConfig` | `Partial<Record<ChainId, { name: string; iconPath: string }>>` | `{}` | Sets map of chain `name` and `iconPath` |
123
125
 
124
126
  ##### actions
125
127
 
126
- > | name | type | default value | description |
127
- > |--------------------------------------|------------------------------------------------------------------|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
128
- > | `onConnect` | `() => void` | `() => {}` | Widget has built-in `Connect Wallet` action button that triggers `onConnect` callback assuming starting of abstract wallet connection process. After all the only requirement is to get connected wallet inside wagmi's `useAccount` hook to make trading operations possible |
129
- > | `onAcceptTermsOfUse` | `() => void` | `() => {}` | Callback is triggered after user's approval of Terms of Use statements assuming switching of external `config.termsOfUseAccepted` param to `true` state |
128
+ > | name | type | default value | description |
129
+ > |--------------------------------------|--------------------------|-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
130
+ > | `onConnect` | `() => void` | `() => {}` | Widget has built-in `Connect Wallet` action button that triggers `onConnect` callback assuming starting of abstract wallet connection process. After all the only requirement is to get connected wallet inside wagmi's `useAccount` hook to make trading operations possible |
131
+ > | `onAcceptTermsOfUse` | `() => Promise<boolean>` | `() => Promise.resolve(true)` | Callback is triggered after user's approval of Terms of Use statements assuming switching of external `config.termsOfUseAccepted` param to `true` state |
130
132
 
131
133
  ###### Source: `packages/trading-widget/src/trading-widget/providers/config-provider`
132
134
  ###### Default values: `packages/trading-widget/src/trading-widget/providers/config-provider/config-provider.defaults.ts`
@@ -139,15 +141,16 @@ UI configuration provider. Manages params to configure custom styling, component
139
141
  <code>Custom components to be injected into widget layout</code>
140
142
  </summary>
141
143
 
142
- > | name | type | default value | description |
143
- > |-----------------------|-------------------------------------|---------------|-----------------------------------------------------------------------------------------------------------------|
144
- > | `GeoBlockAlert` | ComponentType | `undefined` | Component replaces deposit button while `isGeoBlocked` config param is set to `true` |
145
- > | `DepositMetaInfo` | ComponentType | `undefined` | Component is injected into deposit meta part of widget layout nearby TransactionOverviewDisclosure |
146
- > | `WithdrawMetaInfo` | ComponentType | `undefined` | Component is injected into withdraw meta part of widget layout nearby WithdrawTransactionOverviewDisclosure |
147
- > | `ExtraActionButton` | ComponentType | `undefined` | Component is injected below deposit action button and rendered if `isGeoBlocked` config param is set to `false` |
148
- > | `Image` | ComponentType<ImageProps> | `<img>` | Component optionally can be used to pass `nextjs` Image component to be used for assets rendering |
149
- > | `LogoSpinner` | ComponentType<SVGProps<SVGElement>> | `<Spinner>` | Component is injected into widget pending transaction overlay. Assume using of spinning animation |
150
- > | `DepositTermsOfUse` | ComponentType | `undefined` | Component is injected into `TermsOfUseOverlay` to extend default terms of use statement points |
144
+ > | name | type | default value | description |
145
+ > |------------------------|--------------------------------------|---------------------|-----------------------------------------------------------------------------------------------------------------|
146
+ > | `GeoBlockAlert` | ComponentType | `<GeoBlockAlert>` | Component replaces deposit button while `isGeoBlocked` config param is set to `true` |
147
+ > | `SanctionedAlert` | ComponentType | `<SanctionedAlert>` | Component replaces deposit button while `isSanctioned` config param is set to `true` |
148
+ > | `DepositMetaInfo` | ComponentType | `undefined` | Component is injected into deposit meta part of widget layout nearby TransactionOverviewDisclosure |
149
+ > | `WithdrawMetaInfo` | ComponentType | `undefined` | Component is injected into withdraw meta part of widget layout nearby WithdrawTransactionOverviewDisclosure |
150
+ > | `ExtraActionButton` | ComponentType | `undefined` | Component is injected below deposit action button and rendered if `isGeoBlocked` config param is set to `false` |
151
+ > | `Image` | ComponentType<ImageProps> | `<img>` | Component optionally can be used to pass `nextjs` Image component to be used for assets rendering |
152
+ > | `LogoSpinner` | ComponentType<SVGProps<SVGElement>> | `<Spinner>` | Component is injected into widget pending transaction overlay. Assume using of spinning animation |
153
+ > | `DepositTermsOfUse` | ComponentType | `undefined` | Component is injected into `TermsOfUseOverlay` to extend default terms of use statement points |
151
154
 
152
155
 
153
156
  ###### Source: `packages/trading-widget/src/trading-widget/providers/component-provider/component-provider.tsx`
@@ -411,82 +414,83 @@ path: `component.meta[name]`
411
414
  <code>Translation keys</code>
412
415
  </summary>
413
416
 
414
- > | name | type | default value | description |
415
- > |---------------------------------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|
416
- > | `depositSlippageWarning` | string | Includes entry fee. We recommend 2-3%, but usually it will be < 1%. Slippage may be amplified by the leverage. See the docs for more info. | |
417
- > | `withdrawSlippageWarning` | string | Slippage only applies to single asset withdrawals and withdrawals from vaults with debt positions in Aave. | |
418
- > | `minSlippageWarning` | string | Flexible min slippage value that is likely enough to process the transaction. | |
419
- > | `highSlippageWarning` | string | We recommend using another asset to trade with lower slippage. | |
420
- > | `recommendedMinSlippage` | string | Recommended Min Slippage | |
421
- > | `projectedDailyEarningsTooltip` | string | Projected daily earnings are based on the current APY and may differ from actual earnings. | |
422
- > | `dailyEarnings` | string | Daily Earnings | |
423
- > | `projectedYearlyEarningsTooltip` | string | Projected yearly earnings are based on the current APY and may differ from actual earnings. | |
424
- > | `yearlyEarnings` | string | Yearly Earnings | |
425
- > | `fullReceiveDetails` | string | See full details influencing what you will receive. | |
426
- > | `tradeDetails` | string | Trade details | |
427
- > | `maxSlippage` | string | Max slippage | |
428
- > | `minReceiveAmount` | string | You will receive no less than this amount. | |
429
- > | `minReceived` | string | Minimum Received | |
430
- > | `estimatedMultiAssetFractions` | string | Estimated multi asset fractions | |
431
- > | `infinite` | string | Infinite | |
432
- > | `tokenAllowance` | string | Token Allowance | |
433
- > | `entryFee` | string | Entry Fee | |
434
- > | `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. | |
435
- > | `easySwapperEntryFee` | string | Entry fee is charged when a cooldown of {time} is selected. Bypass Entry Fee at trading settings. | |
436
- > | `amountToBeApproved` | string | Amount of {symbol} tokens to be approved. Can be customized in settings. | |
437
- > | `minDepositUsd` | string | Minimum deposit in USD. | |
438
- > | `minDeposit` | string | Minimum Deposit | |
439
- > | `tokensLockTime` | string | Purchased tokens will have a {lockTime} lock. | |
440
- > | `slippageTolerance` | string | Slippage tolerance | |
441
- > | `bypassEntryFee` | string | Bypass Entry Fee | |
442
- > | `entryFeeSwitchWarning` | string | By removing the entry fee, your position is locked for up to {defaultLockTime} instead of the normal {customLockTime}. | |
443
- > | `tokenAmountToApprove` | string | Amount of tokens to be approved. | |
444
- > | `auto` | string | Auto | |
445
- > | `autoSlippageDescription` | string | App is testing different slippage ranges, starting low and increasing until it's likely to pass | |
446
- > | `lengthenLockup` | string | Lengthen lockup to remove entry fee | |
447
- > | `deposit` | string | Buy | |
448
- > | `withdraw` | string | Sell | |
449
- > | `yourBalance` | string | Your Balance | |
450
- > | `max` | string | Max | |
451
- > | `allAssets` | string | All Assets | |
452
- > | `all` | string | All | |
453
- > | `payWith` | string | Pay with | |
454
- > | `buyEstimated` | string | Buy (estimated) | |
455
- > | `sell` | string | Sell | |
456
- > | `receiveEstimated` | string | Receive (estimated) | |
457
- > | `confirmInWallet` | string | Please confirm in wallet | |
458
- > | `pending` | string | Pending... | |
459
- > | `approve` | string | Approve | |
460
- > | `connectWallet` | string | Connect Wallet | |
461
- > | `minimumPurchase` | string | Minimum purchase is ${value} | |
462
- > | `poolIsInactive` | string | {poolSymbol} token is no longer active. Please withdraw from them. | |
463
- > | `poolIsPrivate` | string | This vault is currently private | |
464
- > | `updateOracles` | string | Update Oracles | |
465
- > | `confirmMaxSlippage` | string | Confirm {slippagePercentage}% max slippage | |
466
- > | `withdrawalWindowDisabled` | string | You can sell your {tokenSymbol} tokens during withdrawal window period starting from {startTime} | |
467
- > | `withdrawCooldown` | string | You can sell your {tokenSymbol} tokens in {cooldownEndTime} | |
468
- > | `termsOfUse` | string | Terms Of Use | |
469
- > | `termOfUseDepositListTitle` | string | Please know the following before depositing | |
470
- > | `termOfUseDepositAssetSlippage` | string | When exiting, investors receive single asset or the underlying vault assets. Withdraw slippage can be customized in withdraw settings | |
471
- > | `termOfUseDepositBugs` | string | There may be interface bugs on the platform | |
472
- > | `termOfUseDepositDowntime` | string | There may be interface downtime (planned and unplanned) | |
473
- > | `termOfUseDepositAuditRisk` | string | Smart contracts are audited but a risk is still present | |
474
- > | `termOfUseDepositAccept` | string | Accept & Deposit | |
475
- > | `back` | string | Back | |
476
- > | `highSlippage` | string | High Slippage Alert | |
477
- > | `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. | |
478
- > | `highSlippageListTitle` | string | Please consider the following before confirming | |
479
- > | `highSlippageQuoteDiff` | string | Be aware that the final amount of assets you receive may be different from the initially quoted value. | |
480
- > | `highSlippageRisk` | string | Ensure that you understand the risks associated with high slippage and are comfortable proceeding with the trade. | |
481
- > | `confirm` | string | Confirm | |
482
- > | `selectToken` | string | Select Token | |
483
- > | `sendingOrderToWallet` | string | Sending order to your wallet | |
484
- > | `settingUpTx` | string | Setting up transaction | |
485
- > | `updateSynthetixOracles` | string | Updating Synthetix Oracles | |
486
- > | `approveSpending` | string | Approve {symbol} spending | |
487
- > | `pay` | string | Pay | |
488
- > | `multiAssetFractions` | string | multi asset fractions | |
489
- > | `explorer` | string | Explorer | |
417
+ > | name | type | default value | description |
418
+ > |----------------------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|
419
+ > | `depositSlippageWarning` | string | Includes entry fee. We recommend 2-3%, but usually it will be < 1%. Slippage may be amplified by the leverage. See the docs for more info. | |
420
+ > | `withdrawSlippageWarning` | string | Slippage only applies to single asset withdrawals and withdrawals from vaults with debt positions in Aave. | |
421
+ > | `minSlippageWarning` | string | Flexible min slippage value that is likely enough to process the transaction. | |
422
+ > | `highSlippageWarning` | string | We recommend using another asset to trade with lower slippage. | |
423
+ > | `recommendedMinSlippage` | string | Recommended Min Slippage | |
424
+ > | `projectedDailyEarningsTooltip` | string | Projected daily earnings are based on the current APY and may differ from actual earnings. | |
425
+ > | `dailyEarnings` | string | Daily Earnings | |
426
+ > | `projectedYearlyEarningsTooltip` | string | Projected yearly earnings are based on the current APY and may differ from actual earnings. | |
427
+ > | `yearlyEarnings` | string | Yearly Earnings | |
428
+ > | `fullReceiveDetails` | string | See full details influencing what you will receive. | |
429
+ > | `tradeDetails` | string | Trade details | |
430
+ > | `maxSlippage` | string | Max slippage | |
431
+ > | `minReceiveAmount` | string | You will receive no less than this amount. | |
432
+ > | `minReceived` | string | Minimum Received | |
433
+ > | `estimatedMultiAssetFractions` | string | Estimated multi asset fractions | |
434
+ > | `infinite` | string | Infinite | |
435
+ > | `tokenAllowance` | string | Token Allowance | |
436
+ > | `entryFee` | string | Entry Fee | |
437
+ > | `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. | |
438
+ > | `easySwapperEntryFee` | string | Entry fee is charged when a cooldown of {time} is selected. Bypass Entry Fee at trading settings. | |
439
+ > | `amountToBeApproved` | string | Amount of {symbol} tokens to be approved. Can be customized in settings. | |
440
+ > | `minDepositUsd` | string | Minimum deposit in USD. | |
441
+ > | `minDeposit` | string | Minimum Deposit | |
442
+ > | `tokensLockTime` | string | Purchased tokens will have a {lockTime} lock. | |
443
+ > | `slippageTolerance` | string | Slippage tolerance | |
444
+ > | `bypassEntryFee` | string | Bypass Entry Fee | |
445
+ > | `entryFeeSwitchWarning` | string | By removing the entry fee, your position is locked for up to {defaultLockTime} instead of the normal {customLockTime}. | |
446
+ > | `tokenAmountToApprove` | string | Amount of tokens to be approved. | |
447
+ > | `auto` | string | Auto | |
448
+ > | `autoSlippageDescription` | string | App is testing different slippage ranges, starting low and increasing until it's likely to pass | |
449
+ > | `lengthenLockup` | string | Lengthen lockup to remove entry fee | |
450
+ > | `deposit` | string | Buy | |
451
+ > | `withdraw` | string | Sell | |
452
+ > | `yourBalance` | string | Your Balance | |
453
+ > | `max` | string | Max | |
454
+ > | `allAssets` | string | All Assets | |
455
+ > | `all` | string | All | |
456
+ > | `payWith` | string | Pay with | |
457
+ > | `buyEstimated` | string | Buy (estimated) | |
458
+ > | `sell` | string | Sell | |
459
+ > | `receiveEstimated` | string | Receive (estimated) | |
460
+ > | `confirmInWallet` | string | Please confirm in wallet | |
461
+ > | `pending` | string | Pending... | |
462
+ > | `approve` | string | Approve | |
463
+ > | `connectWallet` | string | Connect Wallet | |
464
+ > | `minimumPurchase` | string | Minimum purchase is ${value} | |
465
+ > | `poolIsInactive` | string | {poolSymbol} token is no longer active. Please withdraw from them. | |
466
+ > | `poolIsPrivate` | string | This vault is currently private | |
467
+ > | `updateOracles` | string | Update Oracles | |
468
+ > | `confirmMaxSlippage` | string | Confirm {slippagePercentage}% max slippage | |
469
+ > | `withdrawalWindowDisabled` | string | You can sell your {tokenSymbol} tokens during withdrawal window period starting from {startTime} | |
470
+ > | `withdrawCooldown` | string | You can sell your {tokenSymbol} tokens in {cooldownEndTime} | |
471
+ > | `termsOfUse` | string | Terms Of Use | |
472
+ > | `termOfUseDepositListTitle` | string | Please know the following before depositing | |
473
+ > | `termOfUseDepositAssetSlippage` | string | When exiting, investors receive single asset or the underlying vault assets. Withdraw slippage can be customized in withdraw settings | |
474
+ > | `termOfUseDepositBugs` | string | There may be interface bugs on the platform | |
475
+ > | `termOfUseDepositDowntime` | string | There may be interface downtime (planned and unplanned) | |
476
+ > | `termOfUseDepositAuditRisk` | string | Smart contracts are audited but a risk is still present | |
477
+ > | `termOfUseDepositAccept` | string | Accept & Deposit | |
478
+ > | `back` | string | Back | |
479
+ > | `highSlippage` | string | High Slippage Alert | |
480
+ > | `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. | |
481
+ > | `highSlippageListTitle` | string | Please consider the following before confirming | |
482
+ > | `highSlippageQuoteDiff` | string | Be aware that the final amount of assets you receive may be different from the initially quoted value. | |
483
+ > | `highSlippageRisk` | string | Ensure that you understand the risks associated with high slippage and are comfortable proceeding with the trade. | |
484
+ > | `confirm` | string | Confirm | |
485
+ > | `selectToken` | string | Select Token | |
486
+ > | `sendingOrderToWallet` | string | Sending order to your wallet | |
487
+ > | `settingUpTx` | string | Setting up transaction | |
488
+ > | `updateSynthetixOracles` | string | Updating Synthetix Oracles | |
489
+ > | `approveSpending` | string | Approve {symbol} spending | |
490
+ > | `pay` | string | Pay | |
491
+ > | `multiAssetFractions` | string | multi asset fractions | |
492
+ > | `explorer` | string | Explorer | |
493
+ > | `as` | string | As | |
490
494
 
491
495
  ###### Source: `packages/trading-widget/src/trading-widget/providers/translation-provider/translation-provider.tsx`
492
496
  ###### Default values: `packages/trading-widget/src/trading-widget/providers/translation-provider/translation-provider.defaults.ts`
@@ -0,0 +1,3 @@
1
+ import type { Address, ChainId } from '../types';
2
+ export declare const FLATMONEY_LEVERAGED_RETH_ASSET_MAP: Record<ChainId, Address>;
3
+ export declare const FLATMONEY_COLLATERAL_SYMBOL_MAP: Record<ChainId, string>;
@@ -9,3 +9,4 @@ export * from './error';
9
9
  export * from './tokens';
10
10
  export * from './synthetix';
11
11
  export * from './links';
12
+ export * from './flat-money';
@@ -3,3 +3,4 @@ export declare const USDC_BASE: TradingToken;
3
3
  export declare const USDCBC_BASE: TradingToken;
4
4
  export declare const WETH_BASE: TradingToken;
5
5
  export declare const CBETH_BASE: TradingToken;
6
+ export declare const RETH_BASE: TradingToken;
@@ -16,6 +16,7 @@ export declare const useUpdateEntryFee: () => (payload: Partial<Record<import(".
16
16
  export declare const useUpdateTradingModal: () => (payload: Partial<import("../../types").TradingPanelStateModal>) => void;
17
17
  export declare const useUpdatePoolFallbackData: () => (payload: import("../../types").PoolFallbackData) => void;
18
18
  export declare const useOnTransactionError: () => ((error: Error, action: import("../../types").TransactionAction | undefined, chainId?: number | undefined, txHash?: `0x${string}` | undefined) => void) | undefined;
19
+ export declare const useOnTradingSettleError: () => ((error: Error) => void) | undefined;
19
20
  export declare const useOnTransactionSuccess: () => ((data: import("viem").TransactionReceipt, action: import("../../types").TransactionAction | undefined, link?: string | undefined) => void) | undefined;
20
21
  export declare const useOnTransactionEstimationError: () => ((error: import("../../models").EstimationError, address: `0x${string}`, chainId: number, account?: `0x${string}` | undefined) => void) | undefined;
21
22
  export declare const useOnTokenSelector: () => ((payload: import("../../types").TokenSelectorPayload) => void) | undefined;
@@ -1,4 +1,4 @@
1
- export { useSetTradingType, useUpdateTradingMeta, useUpdateTradingModal, useUpdateSendTokenInput, useSetPoolAddress, useUpdateReceiveTokenInput, useUpdateTradingSettings, useUpdateEntryFee, useOnTransactionError, useOnTransactionSuccess, useOnTransactionEstimationError, useOnTokenSelector, useTradingPanelLogger, useOnSimulateTransaction, useUpdatePoolFallbackData, } from './action';
1
+ export { useSetTradingType, useUpdateTradingMeta, useUpdateTradingModal, useUpdateSendTokenInput, useSetPoolAddress, useUpdateReceiveTokenInput, useUpdateTradingSettings, useUpdateEntryFee, useOnTransactionError, useOnTransactionSuccess, useOnTransactionEstimationError, useOnTokenSelector, useTradingPanelLogger, useOnSimulateTransaction, useUpdatePoolFallbackData, useOnTradingSettleError, } from './action';
2
2
  export { useTradingPanelPoolAddress, useTradingPanelPoolConfig, useTradingPanelDepositMethod, useTradingPanelPoolConfigs, useTradingPanelPoolFallbackData, useIsPoolAddress, } from './pool';
3
3
  export { useSendTokenInput, useReceiveTokenInput } from './input';
4
4
  export { useTradingPanelSettings } from './settings';
@@ -57,6 +57,7 @@ export interface CallbackConfig {
57
57
  onUpdateEntryFee: TradingPanelSetters['updateEntryFee'];
58
58
  onUpdateTradingModal: TradingPanelSetters['updateTradingModal'];
59
59
  onUpdateTransactions: TradingPanelSetters['updateTransactions'];
60
+ onTradingSettleError: (error: Error) => void;
60
61
  onTransactionError: (error: Error, action: TransactionAction | undefined, chainId?: ChainId, txHash?: Address) => void;
61
62
  onTransactionSuccess: (data: WaitForTransactionReceiptReturnType, action: TransactionAction | undefined, link?: string) => void;
62
63
  onTransactionEstimationError: (error: EstimationError, address: Address, chainId: ChainId, account?: Address) => void;
@@ -103,6 +104,7 @@ export interface TradingPanelContextConfig {
103
104
  initialState?: Partial<TradingPanelState>;
104
105
  }
105
106
  export type TradingPanelActionsState = TradingPanelSetters & {
107
+ onTradingSettleError: CallbackConfig['onTradingSettleError'] | undefined;
106
108
  onTransactionError: CallbackConfig['onTransactionError'] | undefined;
107
109
  onTransactionSuccess: CallbackConfig['onTransactionSuccess'] | undefined;
108
110
  onTransactionEstimationError: CallbackConfig['onTransactionEstimationError'] | undefined;
@@ -0,0 +1,3 @@
1
+ import type { Address } from 'viem';
2
+ export declare const isFlatMoneyEarlyDepositorAddress: (address: Address) => boolean;
3
+ export declare const isFlatMoneyLeveragedRethAsset: (address: Address) => boolean;
@@ -7,4 +7,4 @@ export * from './error';
7
7
  export * from './formatter';
8
8
  export * from './synthetix';
9
9
  export * from './ua';
10
- export * from './fmed';
10
+ export * from './flat-money';