@dhedge/trading-widget 1.2.8 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -102
- package/core-kit/hooks/trading/synthetix-v3/use-synthetix-v3-oracles-update.d.ts +1 -0
- package/{index-47b9f07f.js → index-76dd5f17.js} +3904 -3869
- package/{index-d069f2c9.cjs → index-83c3afd8.cjs} +44 -44
- package/index.cjs +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/{pyth-adapter-424f168f.cjs → pyth-adapter-4f3cae01.cjs} +1 -1
- package/{pyth-adapter-f1d72aa1.js → pyth-adapter-5642b8a7.js} +1 -1
- package/style.css +1 -1
- package/trading-widget/components/common/button/action-button/action-button.d.ts +1 -0
- package/trading-widget/components/deposit/button/valid-deposit-button/valid-deposit-button.hooks.d.ts +1 -0
- package/trading-widget/components/withdraw/button/valid-withdraw-button/valid-withdraw-button.hooks.d.ts +1 -0
- package/trading-widget/providers/component-provider/component-provider.types.d.ts +1 -0
- package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +2 -0
package/README.md
CHANGED
|
@@ -106,21 +106,21 @@ UI configuration provider. Manages params to configure custom styling, component
|
|
|
106
106
|
|
|
107
107
|
##### params
|
|
108
108
|
|
|
109
|
-
> | name
|
|
110
|
-
>
|
|
111
|
-
> | `isGeoBlocked`
|
|
112
|
-
> | `isSanctioned`
|
|
113
|
-
> | `depositQuoteDiffWarningThreshold`
|
|
114
|
-
> | `depositQuoteDiffErrorThreshold`
|
|
115
|
-
> | `defaultWithdrawSlippageScale`
|
|
116
|
-
> | `defaultLockTime`
|
|
117
|
-
> | `
|
|
118
|
-
> | `stablePrecision`
|
|
119
|
-
> | `defaultPrecision`
|
|
120
|
-
> | `stakingChainId`
|
|
121
|
-
> | `termsOfUseAccepted`
|
|
122
|
-
> | `standalone`
|
|
123
|
-
> | `chainConfig`
|
|
109
|
+
> | name | type | default value | description |
|
|
110
|
+
> |-------------------------------------|-----------------------------------------------------------------|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
111
|
+
> | `isGeoBlocked` | `boolean` | `false` | Restricts depositing action button and conditionally renders GeoBlockAlert component |
|
|
112
|
+
> | `isSanctioned` | `boolean` | `false` | Restricts depositing action button and conditionally renders SanctionedAlert component |
|
|
113
|
+
> | `depositQuoteDiffWarningThreshold` | `number` | `1` | Deposit slippage absolute percent value warning threshold, Affects styling to warn user |
|
|
114
|
+
> | `depositQuoteDiffErrorThreshold` | `number` | `3` | Deposit slippage absolute percent value error threshold, Affects styling to warn user |
|
|
115
|
+
> | `defaultWithdrawSlippageScale` | `number[]` | `[0.1, 0.3, 0.5, 1, 1.5, 3]` | Initial withdraw slippage absolute percent. Further adjustments are available in panel settings |
|
|
116
|
+
> | `defaultLockTime` | `string` | `'24 hours'` | Formatted default deposit lock time to be displayed in panel (Long lockup period is used for PoolLogic abi trading methods and can be managed in panel settings) |
|
|
117
|
+
> | `chainCustomLockTimeMap` | `Record<ChainId, string>` | `{ [chainId]: '60 minutes' }` | Formatted custom deposit lock time per chain for EasySwapper abi trading methods to be displayed in panel |
|
|
118
|
+
> | `stablePrecision` | `number` | `3` | Number of decimals to be displayed in stables (e.g USDC balance) |
|
|
119
|
+
> | `defaultPrecision` | `number` | `6` | Number of decimals to be displayed in token values |
|
|
120
|
+
> | `stakingChainId` | `number` | `10` (Optimism) | ChainId to be used in staking logic |
|
|
121
|
+
> | `termsOfUseAccepted` | `boolean` | `true` | Requires user to confirm terms of use by rendering DepositTermsOfUse component before deposit action |
|
|
122
|
+
> | `standalone` | `boolean` | `true` | Handles token selection in SPA mode |
|
|
123
|
+
> | `chainConfig` | `Partial<Record<ChainId, { name: string; iconPath: string }>>` | `{}` | Sets map of chain `name` and `iconPath` |
|
|
124
124
|
|
|
125
125
|
##### actions
|
|
126
126
|
|
|
@@ -140,16 +140,17 @@ UI configuration provider. Manages params to configure custom styling, component
|
|
|
140
140
|
<code>Custom components to be injected into widget layout</code>
|
|
141
141
|
</summary>
|
|
142
142
|
|
|
143
|
-
> | name
|
|
144
|
-
>
|
|
145
|
-
> | `GeoBlockAlert`
|
|
146
|
-
> | `SanctionedAlert`
|
|
147
|
-
> | `DepositMetaInfo`
|
|
148
|
-
> | `WithdrawMetaInfo`
|
|
149
|
-
> | `ExtraActionButton`
|
|
150
|
-
> | `Image`
|
|
151
|
-
> | `LogoSpinner`
|
|
152
|
-
> | `DepositTermsOfUse`
|
|
143
|
+
> | name | type | default value | description |
|
|
144
|
+
> |-------------------------|--------------------------------------|----------------------|-----------------------------------------------------------------------------------------------------------------|
|
|
145
|
+
> | `GeoBlockAlert` | ComponentType | `<GeoBlockAlert>` | Component replaces deposit button while `isGeoBlocked` config param is set to `true` |
|
|
146
|
+
> | `SanctionedAlert` | ComponentType | `<SanctionedAlert>` | Component replaces deposit button while `isSanctioned` config param is set to `true` |
|
|
147
|
+
> | `DepositMetaInfo` | ComponentType | `undefined` | Component is injected into deposit meta part of widget layout nearby TransactionOverviewDisclosure |
|
|
148
|
+
> | `WithdrawMetaInfo` | ComponentType | `undefined` | Component is injected into withdraw meta part of widget layout nearby WithdrawTransactionOverviewDisclosure |
|
|
149
|
+
> | `ExtraActionButton` | ComponentType | `undefined` | Component is injected below deposit action button and rendered if `isGeoBlocked` config param is set to `false` |
|
|
150
|
+
> | `Image` | ComponentType<ImageProps> | `<img>` | Component optionally can be used to pass `nextjs` Image component to be used for assets rendering |
|
|
151
|
+
> | `LogoSpinner` | ComponentType<SVGProps<SVGElement>> | `<Spinner>` | Component is injected into widget pending transaction overlay. Assume using of spinning animation |
|
|
152
|
+
> | `DepositTermsOfUse` | ComponentType | `undefined` | Component is injected into `TermsOfUseOverlay` to extend default terms of use statement points |
|
|
153
|
+
> | `ActionButton` | ComponentType | `<ActionButton>` | Component overrides default `ActionButton` and has `ButtonProps` API |
|
|
153
154
|
|
|
154
155
|
|
|
155
156
|
###### Source: `packages/trading-widget/src/trading-widget/providers/component-provider/component-provider.tsx`
|
|
@@ -413,83 +414,84 @@ path: `component.meta[name]`
|
|
|
413
414
|
<code>Translation keys</code>
|
|
414
415
|
</summary>
|
|
415
416
|
|
|
416
|
-
> | name
|
|
417
|
-
>
|
|
418
|
-
> | `depositSlippageWarning`
|
|
419
|
-
> | `withdrawSlippageWarning`
|
|
420
|
-
> | `minSlippageWarning`
|
|
421
|
-
> | `highSlippageWarning`
|
|
422
|
-
> | `recommendedMinSlippage`
|
|
423
|
-
> | `projectedDailyEarningsTooltip`
|
|
424
|
-
> | `dailyEarnings`
|
|
425
|
-
> | `projectedYearlyEarningsTooltip`
|
|
426
|
-
> | `yearlyEarnings`
|
|
427
|
-
> | `fullReceiveDetails`
|
|
428
|
-
> | `tradeDetails`
|
|
429
|
-
> | `maxSlippage`
|
|
430
|
-
> | `minReceiveAmount`
|
|
431
|
-
> | `minReceived`
|
|
432
|
-
> | `estimatedMultiAssetFractions`
|
|
433
|
-
> | `infinite`
|
|
434
|
-
> | `tokenAllowance`
|
|
435
|
-
> | `entryFee`
|
|
436
|
-
> | `entryFeeExplanation`
|
|
437
|
-
> | `easySwapperEntryFee`
|
|
438
|
-
> | `amountToBeApproved`
|
|
439
|
-
> | `minDepositUsd`
|
|
440
|
-
> | `minDeposit`
|
|
441
|
-
> | `tokensLockTime`
|
|
442
|
-
> | `slippageTolerance`
|
|
443
|
-
> | `bypassEntryFee`
|
|
444
|
-
> | `entryFeeSwitchWarning`
|
|
445
|
-
> | `tokenAmountToApprove`
|
|
446
|
-
> | `auto`
|
|
447
|
-
> | `autoSlippageDescription`
|
|
448
|
-
> | `lengthenLockup`
|
|
449
|
-
> | `deposit`
|
|
450
|
-
> | `withdraw`
|
|
451
|
-
> | `yourBalance`
|
|
452
|
-
> | `max`
|
|
453
|
-
> | `allAssets`
|
|
454
|
-
> | `all`
|
|
455
|
-
> | `payWith`
|
|
456
|
-
> | `buyEstimated`
|
|
457
|
-
> | `sell`
|
|
458
|
-
> | `receiveEstimated`
|
|
459
|
-
> | `confirmInWallet`
|
|
460
|
-
> | `pending`
|
|
461
|
-
> | `approve`
|
|
462
|
-
> | `connectWallet`
|
|
463
|
-
> | `minimumPurchase`
|
|
464
|
-
> | `poolIsInactive`
|
|
465
|
-
> | `poolIsPrivate`
|
|
466
|
-
> | `updateOracles`
|
|
467
|
-
> | `
|
|
468
|
-
> | `
|
|
469
|
-
> | `
|
|
470
|
-
> | `
|
|
471
|
-
> | `
|
|
472
|
-
> | `
|
|
473
|
-
> | `
|
|
474
|
-
> | `
|
|
475
|
-
> | `
|
|
476
|
-
> | `
|
|
477
|
-
> | `
|
|
478
|
-
> | `
|
|
479
|
-
> | `
|
|
480
|
-
> | `
|
|
481
|
-
> | `
|
|
482
|
-
> | `
|
|
483
|
-
> | `
|
|
484
|
-
> | `
|
|
485
|
-
> | `
|
|
486
|
-
> | `
|
|
487
|
-
> | `
|
|
488
|
-
> | `
|
|
489
|
-
> | `
|
|
490
|
-
> | `
|
|
491
|
-
> | `
|
|
492
|
-
> | `
|
|
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
|
+
> | `checkingOracles` | string | Checking Oracles | |
|
|
469
|
+
> | `confirmMaxSlippage` | string | Confirm {slippagePercentage}% max slippage | |
|
|
470
|
+
> | `withdrawalWindowDisabled` | string | You can sell your {tokenSymbol} tokens during withdrawal window period starting from {startTime} | |
|
|
471
|
+
> | `withdrawCooldown` | string | You can sell your {tokenSymbol} tokens in {cooldownEndTime} | |
|
|
472
|
+
> | `termsOfUse` | string | Terms Of Use | |
|
|
473
|
+
> | `termOfUseDepositListTitle` | string | Please know the following before depositing | |
|
|
474
|
+
> | `termOfUseDepositAssetSlippage` | string | When exiting, investors receive single asset or the underlying vault assets. Withdraw slippage can be customized in withdraw settings | |
|
|
475
|
+
> | `termOfUseDepositBugs` | string | There may be interface bugs on the platform | |
|
|
476
|
+
> | `termOfUseDepositDowntime` | string | There may be interface downtime (planned and unplanned) | |
|
|
477
|
+
> | `termOfUseDepositAuditRisk` | string | Smart contracts are audited but a risk is still present | |
|
|
478
|
+
> | `termOfUseDepositAccept` | string | Accept & Deposit | |
|
|
479
|
+
> | `back` | string | Back | |
|
|
480
|
+
> | `highSlippage` | string | High Slippage Alert | |
|
|
481
|
+
> | `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. | |
|
|
482
|
+
> | `highSlippageListTitle` | string | Please consider the following before confirming | |
|
|
483
|
+
> | `highSlippageQuoteDiff` | string | Be aware that the final amount of assets you receive may be different from the initially quoted value. | |
|
|
484
|
+
> | `highSlippageRisk` | string | Ensure that you understand the risks associated with high slippage and are comfortable proceeding with the trade. | |
|
|
485
|
+
> | `confirm` | string | Confirm | |
|
|
486
|
+
> | `selectToken` | string | Select Token | |
|
|
487
|
+
> | `sendingOrderToWallet` | string | Sending order to your wallet | |
|
|
488
|
+
> | `settingUpTx` | string | Setting up transaction | |
|
|
489
|
+
> | `updateSynthetixOracles` | string | Updating Synthetix Oracles | |
|
|
490
|
+
> | `approveSpending` | string | Approve {symbol} spending | |
|
|
491
|
+
> | `pay` | string | Pay | |
|
|
492
|
+
> | `multiAssetFractions` | string | multi asset fractions | |
|
|
493
|
+
> | `explorer` | string | Explorer | |
|
|
494
|
+
> | `as` | string | As | |
|
|
493
495
|
|
|
494
496
|
###### Source: `packages/trading-widget/src/trading-widget/providers/translation-provider/translation-provider.tsx`
|
|
495
497
|
###### Default values: `packages/trading-widget/src/trading-widget/providers/translation-provider/translation-provider.defaults.ts`
|