From c063c790374050d750ea0218688a41d465d4fb21 Mon Sep 17 00:00:00 2001 From: Ted Palmer Date: Wed, 17 Apr 2024 15:14:51 -0400 Subject: [PATCH] Sync api types + add useExactInput parameter to demo --- demo/pages/sdk/actions/bridge.tsx | 15 +- demo/pages/sdk/methods/getBridgeQuote.tsx | 16 + packages/sdk/src/routes/index.ts | 1 + packages/sdk/src/types/api.ts | 339 +++++++++++++++++++++- 4 files changed, 361 insertions(+), 10 deletions(-) diff --git a/demo/pages/sdk/actions/bridge.tsx b/demo/pages/sdk/actions/bridge.tsx index 7031db83..717287ae 100644 --- a/demo/pages/sdk/actions/bridge.tsx +++ b/demo/pages/sdk/actions/bridge.tsx @@ -12,6 +12,7 @@ const BridgeActionPage: NextPage = () => { const [currency, setCurrency] =useState('eth') const [usePermit, setUsePermit] = useState(false) const [canonical, setCanonical] = useState(false) + const [useExactInput, setUseExactInput] = useState(false) const [toChainId, setToChainId] = useState(zora.id) const [fromChainId, setFromChainId] = useState(base.id) const [depositGasLimit, setDepositGasLimit] = useState("") @@ -91,6 +92,17 @@ const BridgeActionPage: NextPage = () => { /> +
+ + { + setUseExactInput(e.target.checked) + }} + /> +
+
setRecipient(e.target.value)} /> @@ -132,7 +144,8 @@ const BridgeActionPage: NextPage = () => { depositGasLimit, options: { usePermit: usePermit, - useExternalLiquidity: canonical + useExternalLiquidity: canonical, + useExactInput: useExactInput }, onProgress: (steps, fees, currentStep, currentStepItem, txHashes) => { console.log(steps, fees, currentStep, currentStepItem, txHashes) diff --git a/demo/pages/sdk/methods/getBridgeQuote.tsx b/demo/pages/sdk/methods/getBridgeQuote.tsx index f3f008ef..444743a6 100644 --- a/demo/pages/sdk/methods/getBridgeQuote.tsx +++ b/demo/pages/sdk/methods/getBridgeQuote.tsx @@ -12,6 +12,7 @@ const GetBridgeQuotePage: NextPage = () => { const [currency, setCurrency] =useState('eth') const [toChainId, setToChainId] = useState(zora.id) const [fromChainId, setFromChainId] = useState(base.id) + const [useExactInput, setUseExactInput] = useState(false) const { data: wallet } = useWalletClient() const [response, setResponse] = useState(null) @@ -68,6 +69,18 @@ const GetBridgeQuotePage: NextPage = () => { setRecipient(e.target.value)} />
+ +
+ + { + setUseExactInput(e.target.checked) + }} + /> +
+