Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exact output bug #308

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/rude-buckets-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@reservoir0x/relay-sdk': patch
'@reservoir0x/relay-kit-ui': patch
---

Replace exact_output with expected_output tradeType
4 changes: 2 additions & 2 deletions demo/pages/hooks/usePrice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const UsePrice: NextPage = () => {
const [destinationCurrency, setDestinationCurrency] =
useState<string>(zeroAddress)
const [recipient, setRecipient] = useState<string | undefined>()
const [tradeType, setTradeType] = useState<'EXACT_INPUT' | 'EXACT_OUTPUT'>(
const [tradeType, setTradeType] = useState<'EXACT_INPUT' | 'EXPECTED_OUTPUT'>(
'EXACT_INPUT'
)
const [source, setSource] = useState<string | undefined>()
Expand Down Expand Up @@ -120,7 +120,7 @@ const UsePrice: NextPage = () => {
}}
>
<option value="EXACT_INPUT">EXACT_INPUT</option>
<option value="EXACT_OUTPUT">EXACT_OUTPUT</option>
<option value="EXPECTED_OUTPUT">EXPECTED_OUTPUT</option>
</select>
</div>
<div>
Expand Down
6 changes: 3 additions & 3 deletions demo/pages/hooks/useQuote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const UseQuote: NextPage = () => {
const [originCurrency, setOriginCurrency] = useState<string>('')
const [destinationCurrency, setDestinationCurrency] = useState<string>('')
const [recipient, setRecipient] = useState<string | undefined>()
const [tradeType, setTradeType] = useState<'EXACT_INPUT' | 'EXACT_OUTPUT'>(
'EXACT_INPUT'
const [tradeType, setTradeType] = useState<'EXACT_INPUT' | 'EXPECTED_OUTPUT'>(
'EXPECTED_OUTPUT'
)
const [source, setSource] = useState<string | undefined>()
const [useExternalLiquidity, setUseExternalLiquidity] =
Expand Down Expand Up @@ -125,7 +125,7 @@ const UseQuote: NextPage = () => {
}}
>
<option value="EXACT_INPUT">EXACT_INPUT</option>
<option value="EXACT_OUTPUT">EXACT_OUTPUT</option>
<option value="EXPECTED_OUTPUT">EXPECTED_OUTPUT</option>
</select>
</div>
<div>
Expand Down
2 changes: 1 addition & 1 deletion demo/pages/sdk/actions/bridge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const BridgeActionPage: NextPage = () => {
currency,
toCurrency: currency,
recipient: recipient ? (recipient as Address) : undefined,
tradeType: useExactInput ? 'EXACT_INPUT' : 'EXACT_OUTPUT',
tradeType: useExactInput ? 'EXACT_INPUT' : 'EXPECTED_OUTPUT',
options: {
usePermit: usePermit,
useExternalLiquidity: canonical
Expand Down
2 changes: 1 addition & 1 deletion demo/pages/sdk/actions/getBridgeQuote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const GetBridgeQuotePage: NextPage = () => {
currency,
toCurrency: zeroAddress,
recipient: recipient ? (recipient as Address) : undefined,
tradeType: useExactInput ? 'EXACT_INPUT' : 'EXACT_OUTPUT'
tradeType: useExactInput ? 'EXACT_INPUT' : 'EXPECTED_OUTPUT'
})
setResponse(quote)
}}
Expand Down
2 changes: 1 addition & 1 deletion demo/pages/sdk/actions/getPrice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const GetPricePage: NextPage = () => {
originCurrency,
destinationCurrency,
recipient: recipient ? (recipient as Address) : undefined,
tradeType: useExactInput ? 'EXACT_INPUT' : 'EXACT_OUTPUT'
tradeType: useExactInput ? 'EXACT_INPUT' : 'EXPECTED_OUTPUT'
})
setResponse(price)
}}
Expand Down
2 changes: 1 addition & 1 deletion demo/pages/sdk/actions/getSwapQuote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const GetSwapQuote: NextPage = () => {
amount,
currency: fromCurrency,
recipient: recipient ? (recipient as Address) : undefined,
tradeType: useExactOuput ? 'EXACT_OUTPUT' : 'EXACT_INPUT'
tradeType: useExactOuput ? 'EXPECTED_OUTPUT' : 'EXACT_INPUT'
})
setResponse(quote)
}}
Expand Down
9 changes: 7 additions & 2 deletions packages/sdk/src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@ export const routes = [
"/execute/permits",
"/quote",
"/price",
"/execute/user-op/{chainId}",
"/lives",
"/intents/status",
"/intents/quote",
"/intents/status/v2",
"/intents/quote",
"/intents/quote/v2",
"/requests/{requestId}/signature",
"/requests",
"/requests/v2",
"/transactions/index",
"/transactions/status",
"/conduit/install",
"/prices/rates",
"/currencies/v1",
"/currencies/token/price"
"/tokenlist",
"/currencies/token/price",
"/provision/chain"
];
2 changes: 1 addition & 1 deletion packages/sdk/src/types/RelayChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type Erc20Currencies = NonNullable<
paths['/chains']['get']['responses']['200']['content']['application/json']['chains']
>['0']['erc20Currencies']

export type ChainVM = 'evm' | 'svm'
export type ChainVM = 'evm' | 'svm' | 'bvm'

export type RelayChain = {
id: number
Expand Down
Loading