@dhedge/trading-widget 1.0.4 → 1.1.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.
package/README.md CHANGED
@@ -104,29 +104,30 @@ UI configuration provider. Manages params to configure custom styling, component
104
104
 
105
105
  ##### params
106
106
 
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` |
107
+ > | name | type | default value | description |
108
+ > |------------------------------------|----------------------------------------------------------------|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
109
+ > | `isGeoBlocked` | `boolean` | `false` | Restricts depositing action button and conditionally renders GeoBlockAlert component |
110
+ > | `isSanctioned` | `boolean` | `false` | Restricts depositing action button and conditionally renders SanctionedAlert component |
111
+ > | `depositQuoteDiffWarningThreshold` | `number` | `1` | Deposit slippage absolute percent value warning threshold, Affects styling to warn user |
112
+ > | `depositQuoteDiffErrorThreshold` | `number` | `3` | Deposit slippage absolute percent value error threshold, Affects styling to warn user |
113
+ > | `defaultDepositSlippage` | `number` | `0` | Initial deposit slippage absolute percent. Further adjustments are available in panel settings |
114
+ > | `defaultDepositSlippageScale` | `number[]` | `[0]` | Initial deposit slippage absolute percent. Further adjustments are available in panel settings |
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 to bypass entry fee and can be managed in panel settings) |
117
+ > | `customLockTime` | `string` | `'15 minutes'` | Formatted custom deposit lock time alternative 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` |
123
124
 
124
125
  ##### actions
125
126
 
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 |
127
+ > | name | type | default value | description |
128
+ > |--------------------------------------|--------------------------|-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
129
+ > | `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 |
130
+ > | `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
131
 
131
132
  ###### Source: `packages/trading-widget/src/trading-widget/providers/config-provider`
132
133
  ###### Default values: `packages/trading-widget/src/trading-widget/providers/config-provider/config-provider.defaults.ts`
@@ -139,15 +140,16 @@ UI configuration provider. Manages params to configure custom styling, component
139
140
  <code>Custom components to be injected into widget layout</code>
140
141
  </summary>
141
142
 
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 |
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 |
151
153
 
152
154
 
153
155
  ###### Source: `packages/trading-widget/src/trading-widget/providers/component-provider/component-provider.tsx`