@openocean.finance/widget 1.0.21 → 1.0.23
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/dist/esm/components/AmountInput/AmountInput.js +2 -2
- package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.style.d.ts +2 -2
- package/dist/esm/components/AmountInput/AmountInput.style.js +2 -2
- package/dist/esm/components/ChainSelect/useChainSelect.d.ts +1 -2
- package/dist/esm/components/Step/StepList.d.ts +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/hooks/useAvailableChains.d.ts +1 -1
- package/dist/esm/hooks/useChain.d.ts +1 -1
- package/dist/esm/hooks/useChains.d.ts +1 -1
- package/dist/esm/hooks/useGasRecommendation.d.ts +1 -1
- package/dist/esm/hooks/useGasRefuel.d.ts +3 -3
- package/dist/esm/hooks/useGasSufficiency.d.ts +1 -1
- package/dist/esm/hooks/useIsBatchingSupported.d.ts +1 -1
- package/dist/esm/hooks/useRouteExecution.d.ts +1 -1
- package/dist/esm/hooks/useRoutes.d.ts +3 -3
- package/dist/esm/hooks/useRoutes.js +1 -1
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useToAddressRequirements.d.ts +2 -2
- package/dist/esm/hooks/useTokenAddressBalance.d.ts +1 -1
- package/dist/esm/hooks/useTokenBalance.d.ts +1 -1
- package/dist/esm/hooks/useTokenBalances.d.ts +1 -1
- package/dist/esm/hooks/useTokens.d.ts +1 -1
- package/dist/esm/hooks/useTools.d.ts +1 -2
- package/dist/esm/hooks/useTransactionDetails.d.ts +1 -2
- package/dist/esm/hooks/useTransactionHistory.d.ts +0 -1
- package/dist/esm/services/DebridgeService.js +1 -1
- package/dist/esm/services/DebridgeService.js.map +1 -1
- package/dist/esm/stores/form/useFieldController.d.ts +1 -1
- package/dist/esm/stores/routes/useExecutingRoutesIds.d.ts +1 -1
- package/dist/esm/stores/routes/useSetExecutableRoute.d.ts +1 -1
- package/dist/esm/stores/routes/utils.d.ts +6 -6
- package/dist/esm/utils/chainType.d.ts +5 -5
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
- package/src/components/AmountInput/AmountInput.style.tsx +2 -2
- package/src/components/AmountInput/AmountInput.tsx +13 -10
- package/src/config/version.ts +1 -1
- package/src/hooks/useRoutes.ts +1 -1
- package/src/services/DebridgeService.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openocean.finance/widget",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
4
4
|
"description": "Openocean Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/esm/index.js",
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
styled,
|
|
7
7
|
} from '@mui/material'
|
|
8
8
|
|
|
9
|
-
export const maxInputFontSize =
|
|
10
|
-
export const minInputFontSize =
|
|
9
|
+
export const maxInputFontSize = 22
|
|
10
|
+
export const minInputFontSize = 12
|
|
11
11
|
|
|
12
12
|
export const FormContainer = styled(Box)(({ theme }) => ({
|
|
13
13
|
display: 'flex',
|
|
@@ -80,16 +80,19 @@ export const AmountInputBase: React.FC<
|
|
|
80
80
|
const amountKey = FormKeyHelper.getAmountKey(formType)
|
|
81
81
|
const { onChange, onBlur, value } = useFieldController({ name: amountKey })
|
|
82
82
|
inputValue = value || ''
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
const {
|
|
86
|
+
routes,
|
|
87
|
+
isLoading,
|
|
88
|
+
isFetching,
|
|
89
|
+
isFetched,
|
|
90
|
+
dataUpdatedAt,
|
|
91
|
+
refetchTime,
|
|
92
|
+
refetch,
|
|
93
|
+
} = useRoutes()
|
|
94
|
+
|
|
83
95
|
if(formType === 'to'){
|
|
84
|
-
const {
|
|
85
|
-
routes,
|
|
86
|
-
isLoading,
|
|
87
|
-
isFetching,
|
|
88
|
-
isFetched,
|
|
89
|
-
dataUpdatedAt,
|
|
90
|
-
refetchTime,
|
|
91
|
-
refetch,
|
|
92
|
-
} = useRoutes()
|
|
93
96
|
const router = routes?.[0]
|
|
94
97
|
if (
|
|
95
98
|
router &&
|
|
@@ -126,7 +129,7 @@ export const AmountInputBase: React.FC<
|
|
|
126
129
|
if (ref.current) {
|
|
127
130
|
fitInputText(maxInputFontSize, minInputFontSize, ref.current)
|
|
128
131
|
}
|
|
129
|
-
}, [value])
|
|
132
|
+
}, [value, inputValue, routes])
|
|
130
133
|
|
|
131
134
|
const title =
|
|
132
135
|
subvariant === 'custom'
|
package/src/config/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@openocean.finance/widget'
|
|
2
|
-
export const version = '1.0.
|
|
2
|
+
export const version = '1.0.23'
|
package/src/hooks/useRoutes.ts
CHANGED
|
@@ -340,7 +340,7 @@ export const useRoutes = ({ observableRoute }: RoutesProps = {}) => {
|
|
|
340
340
|
(isDebridge
|
|
341
341
|
? data?.to
|
|
342
342
|
: '0x6352a56caadC4F1E25CD6c75970Fa768A3304e64'),
|
|
343
|
-
executionDuration: data?.executionDuration ||
|
|
343
|
+
executionDuration: data?.executionDuration || Math.floor(Math.random() * 20) + 40,
|
|
344
344
|
tool: isDebridge ? 'debridge' : 'openocean',
|
|
345
345
|
feeCosts: data?.feeCosts || [
|
|
346
346
|
{
|
|
@@ -482,7 +482,7 @@ export class DebridgeService {
|
|
|
482
482
|
// Estimate details
|
|
483
483
|
approveContract: to, // Approval needed for the Debridge contract
|
|
484
484
|
// executionDuration: approximateFulfillmentDelay ? approximateFulfillmentDelay * 1000 : 300000, // Convert seconds to ms? Needs verification. Defaulting to 5min.
|
|
485
|
-
executionDuration:
|
|
485
|
+
executionDuration: 0, // Hardcoding 5min for now, Debridge delay unit unclear.
|
|
486
486
|
// Fee details
|
|
487
487
|
feeCosts: finalFeeToken
|
|
488
488
|
? [
|