-
Notifications
You must be signed in to change notification settings - Fork 237
add okx provider #726
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
add okx provider #726
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -61,7 +61,7 @@ | |||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| <transaction-fee-view | ||||||||||||||||||||||||||||||||||||||
| v-model="isOpenSelectFee" | ||||||||||||||||||||||||||||||||||||||
| :fees="gasCostValues" | ||||||||||||||||||||||||||||||||||||||
| :fees="gasCostValues as GasFeeType" | ||||||||||||||||||||||||||||||||||||||
| :selected="selectedFee" | ||||||||||||||||||||||||||||||||||||||
| :is-header="true" | ||||||||||||||||||||||||||||||||||||||
| @gas-type-changed="selectFee" | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -309,8 +309,19 @@ onMounted(async () => { | |||||||||||||||||||||||||||||||||||||
| network.value = (await getNetworkByName(selectedNetwork))!; | ||||||||||||||||||||||||||||||||||||||
| account.value = await KeyRing.getAccount(swapData.fromAddress); | ||||||||||||||||||||||||||||||||||||||
| isWindowPopup.value = account.value.isHardware; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| swapData.trades.forEach((trade, index) => { | ||||||||||||||||||||||||||||||||||||||
| console.log(`Trade ${index + 1}:`, { | ||||||||||||||||||||||||||||||||||||||
| provider: trade.provider, | ||||||||||||||||||||||||||||||||||||||
| fromAmount: trade.fromTokenAmount.toString(), | ||||||||||||||||||||||||||||||||||||||
| toAmount: trade.toTokenAmount.toString(), | ||||||||||||||||||||||||||||||||||||||
| additionalFees: trade.additionalNativeFees.toString(), | ||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+313
to
+320
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Remove or conditionally enable debug logging Debug console.log statements should not be in production code. - swapData.trades.forEach((trade, index) => {
- console.log(`Trade ${index + 1}:`, {
- provider: trade.provider,
- fromAmount: trade.fromTokenAmount.toString(),
- toAmount: trade.toTokenAmount.toString(),
- additionalFees: trade.additionalNativeFees.toString(),
- });
- });
+ if (import.meta.env.DEV) {
+ swapData.trades.forEach((trade, index) => {
+ console.log(`Trade ${index + 1}:`, {
+ provider: trade.provider,
+ fromAmount: trade.fromTokenAmount.toString(),
+ toAmount: trade.toTokenAmount.toString(),
+ additionalFees: trade.additionalNativeFees.toString(),
+ });
+ });
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| let tempBestTrade = pickedTrade.value; | ||||||||||||||||||||||||||||||||||||||
| let tempFinalToFiat = 0; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| for (const trade of swapData.trades) { | ||||||||||||||||||||||||||||||||||||||
| const toTokenFiat = new SwapToken(swapData.toToken).getRawToFiat( | ||||||||||||||||||||||||||||||||||||||
| trade.toTokenAmount, | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -326,12 +337,15 @@ onMounted(async () => { | |||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| const gasCostFiat = parseFloat(gasTier.fiatValue); | ||||||||||||||||||||||||||||||||||||||
| const finalToFiat = toTokenFiat - gasCostFiat; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| if (finalToFiat > tempFinalToFiat) { | ||||||||||||||||||||||||||||||||||||||
| tempBestTrade = trade; | ||||||||||||||||||||||||||||||||||||||
| tempFinalToFiat = finalToFiat; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| pickedTrade.value = tempBestTrade; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| await setTransactionFees(); | ||||||||||||||||||||||||||||||||||||||
| isLooking.value = false; | ||||||||||||||||||||||||||||||||||||||
| trackSwapEvents(SwapEventType.SwapVerify, { | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.