diff --git a/.aider.chat.history.md b/.aider.chat.history.md deleted file mode 100644 index db2cc53a4..000000000 --- a/.aider.chat.history.md +++ /dev/null @@ -1,182 +0,0 @@ - -# aider chat started at 2024-09-18 21:55:21 - -> Add .aider* to .gitignore (recommended)? (Y)es/(N)o [Yes]: y -> Added .aider* to .gitignore -> /Library/Frameworks/Python.framework/Versions/3.12/bin/aider -> Warning: gpt-4o-2024-08-06 expects these environment variables -> - OPENAI_API_KEY: ✗ Not set -> If you just set these environment variables using `setx` you may need to restart your terminal or command prompt for the changes to take effect. -> For more info, see: https://aider.chat/docs/llms/warnings.html -> Warning: gpt-4o-mini expects these environment variables -> - OPENAI_API_KEY: ✗ Not set -> If you just set these environment variables using `setx` you may need to restart your terminal or command prompt for the changes to take effect. -> For more info, see: https://aider.chat/docs/llms/warnings.html -> You can skip this check with --no-show-model-warnings -> Proceed anyway? (Y)es/(N)o [Yes]: y -> Aider v0.56.0 -> Main model: gpt-4o-2024-08-06 with diff edit format -> Weak model: gpt-4o-mini -> Git repo: .git with 477 files -> Repo-map: using 1024 tokens, auto refresh -> Use /help for help, run "aider --help" to see cmd line args -> -> -> ^C again to exit -> -> -> ^C KeyboardInterrupt - -# aider chat started at 2024-09-18 21:57:02 - -> /Library/Frameworks/Python.framework/Versions/3.12/bin/aider --sonnet --anthropic-api-key ...DgAA -> Aider v0.56.0 -> Main model: claude-3-5-sonnet-20240620 with diff edit format, infinite output -> Weak model: claude-3-haiku-20240307 -> Git repo: .git with 477 files -> Repo-map: using 1024 tokens, auto refresh -> Use /help for help, run "aider --help" to see cmd line args - -#### /add packages/swapkit/helpers/src/types/network.ts -> Added /Users/damian/Workspace/Crypto/Thorswap/SwapKit/packages/swapkit/helpers/src/types/network.ts to the chat - -#### add fallbacks for all `RPCUrl` -> Initial repo scan can be slow in larger repos, but only happens once. - -To add fallbacks for all `RPCUrl` entries, we'll modify the `RPCUrl` enum in the `packages/swapkit/helpers/src/types/network.ts` file. We'll add a fallback URL for each network, separated by a comma. Here's the proposed change: - -packages/swapkit/helpers/src/types/network.ts -```typescript -<<<<<<< SEARCH -export enum RPCUrl { - Arbitrum = "https://arb1.arbitrum.io/rpc", - Avalanche = "https://node-router.thorswap.net/avalanche-c", - Base = "https://base.llamarpc.com", - BinanceSmartChain = "https://bsc-dataseed.binance.org", - Bitcoin = "https://node-router.thorswap.net/bitcoin", - BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash", - Chainflip = "wss://mainnet-archive.chainflip.io", - Cosmos = "https://node-router.thorswap.net/cosmos/rpc", - Dash = "https://node-router.thorswap.net/dash", - Dogecoin = "https://node-router.thorswap.net/dogecoin", - Ethereum = "https://node-router.thorswap.net/ethereum", - Kujira = "https://rpc-kujira.synergynodes.com/", - Litecoin = "https://node-router.thorswap.net/litecoin", - Maya = "https://tendermint.mayachain.info", - MayaStagenet = "https://stagenet.tendermint.mayachain.info", - Optimism = "https://mainnet.optimism.io", - Polkadot = "wss://rpc.polkadot.io", - Polygon = "https://polygon-rpc.com", - Radix = "https://radix-mainnet.rpc.grove.city/v1/326002fc/core", - THORChain = "https://rpc.thorswap.net", - THORChainStagenet = "https://stagenet-rpc.ninerealms.com", - Solana = "https://mainnet.helius-rpc.com", -} -======= -export enum RPCUrl { - Arbitrum = "https://arb1.arbitrum.io/rpc,https://arbitrum-one.public.blastapi.io", - Avalanche = "https://node-router.thorswap.net/avalanche-c,https://api.avax.network/ext/bc/C/rpc", - Base = "https://base.llamarpc.com,https://mainnet.base.org", - BinanceSmartChain = "https://bsc-dataseed.binance.org,https://bsc-dataseed1.defibit.io", - Bitcoin = "https://node-router.thorswap.net/bitcoin,https://btc.getblock.io/mainnet/", - BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash,https://smartbch.greyh.at", - Chainflip = "wss://mainnet-archive.chainflip.io,wss://mainnet-secondary.chainflip.io", - Cosmos = "https://node-router.thorswap.net/cosmos/rpc,https://cosmos-rpc.polkachu.com", - Dash = "https://node-router.thorswap.net/dash,https://dashcore-rpc.strobnz.net", - Dogecoin = "https://node-router.thorswap.net/dogecoin,https://dogecoin-rpc.dogechain.info", - Ethereum = "https://node-router.thorswap.net/ethereum,https://eth.llamarpc.com", - Kujira = "https://rpc-kujira.synergynodes.com/,https://kujira-rpc.polkachu.com", - Litecoin = "https://node-router.thorswap.net/litecoin,https://ltc.getblock.io/mainnet/", - Maya = "https://tendermint.mayachain.info,https://rpc.mayachain.info", - MayaStagenet = "https://stagenet.tendermint.mayachain.info,https://stagenet-rpc.mayachain.info", - Optimism = "https://mainnet.optimism.io,https://optimism-mainnet.public.blastapi.io", - Polkadot = "wss://rpc.polkadot.io,wss://polkadot.api.onfinality.io/public-ws", - Polygon = "https://polygon-rpc.com,https://polygon-mainnet.public.blastapi.io", - Radix = "https://radix-mainnet.rpc.grove.city/v1/326002fc/core,https://mainnet.radixdlt.com", - THORChain = "https://rpc.thorswap.net,https://thornode.ninerealms.com", - THORChainStagenet = "https://stagenet-rpc.ninerealms.com,https://testnet.thornode.thorchain.info", - Solana = "https://mainnet.helius-rpc.com,https://api.mainnet-beta.solana.com", -} ->>>>>>> REPLACE -``` - -This change adds a fallback RPC URL for each network, separated by a comma. The fallback URLs are chosen based on commonly used public RPC endpoints for each network. In case the primary URL fails, the system can try the fallback URL. - -Note that some of these fallback URLs might have rate limits or other restrictions, so it's important to monitor their performance and reliability in a production environment. - -> Tokens: 3.8k sent, 1.1k received. Cost: $0.03 message, $0.03 session. -> Applied edit to packages/swapkit/helpers/src/types/network.ts -> Commit c141e3d feat: add fallbacks for all RPCUrl -> No changes made to git tracked files. -> You can use /undo to undo and discard each aider commit. - -#### do it as array - -Certainly! I'll modify the `RPCUrl` enum to use arrays instead of comma-separated strings. Here's the change: - -packages/swapkit/helpers/src/types/network.ts -```typescript -<<<<<<< SEARCH -export enum RPCUrl { - Arbitrum = "https://arb1.arbitrum.io/rpc,https://arbitrum-one.public.blastapi.io", - Avalanche = "https://node-router.thorswap.net/avalanche-c,https://api.avax.network/ext/bc/C/rpc", - Base = "https://base.llamarpc.com,https://mainnet.base.org", - BinanceSmartChain = "https://bsc-dataseed.binance.org,https://bsc-dataseed1.defibit.io", - Bitcoin = "https://node-router.thorswap.net/bitcoin,https://btc.getblock.io/mainnet/", - BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash,https://smartbch.greyh.at", - Chainflip = "wss://mainnet-archive.chainflip.io,wss://mainnet-secondary.chainflip.io", - Cosmos = "https://node-router.thorswap.net/cosmos/rpc,https://cosmos-rpc.polkachu.com", - Dash = "https://node-router.thorswap.net/dash,https://dashcore-rpc.strobnz.net", - Dogecoin = "https://node-router.thorswap.net/dogecoin,https://dogecoin-rpc.dogechain.info", - Ethereum = "https://node-router.thorswap.net/ethereum,https://eth.llamarpc.com", - Kujira = "https://rpc-kujira.synergynodes.com/,https://kujira-rpc.polkachu.com", - Litecoin = "https://node-router.thorswap.net/litecoin,https://ltc.getblock.io/mainnet/", - Maya = "https://tendermint.mayachain.info,https://rpc.mayachain.info", - MayaStagenet = "https://stagenet.tendermint.mayachain.info,https://stagenet-rpc.mayachain.info", - Optimism = "https://mainnet.optimism.io,https://optimism-mainnet.public.blastapi.io", - Polkadot = "wss://rpc.polkadot.io,wss://polkadot.api.onfinality.io/public-ws", - Polygon = "https://polygon-rpc.com,https://polygon-mainnet.public.blastapi.io", - Radix = "https://radix-mainnet.rpc.grove.city/v1/326002fc/core,https://mainnet.radixdlt.com", - THORChain = "https://rpc.thorswap.net,https://thornode.ninerealms.com", - THORChainStagenet = "https://stagenet-rpc.ninerealms.com,https://testnet.thornode.thorchain.info", - Solana = "https://mainnet.helius-rpc.com,https://api.mainnet-beta.solana.com", -} -======= -export const RPCUrl = { - Arbitrum: ["https://arb1.arbitrum.io/rpc", "https://arbitrum-one.public.blastapi.io"], - Avalanche: ["https://node-router.thorswap.net/avalanche-c", "https://api.avax.network/ext/bc/C/rpc"], - Base: ["https://base.llamarpc.com", "https://mainnet.base.org"], - BinanceSmartChain: ["https://bsc-dataseed.binance.org", "https://bsc-dataseed1.defibit.io"], - Bitcoin: ["https://node-router.thorswap.net/bitcoin", "https://btc.getblock.io/mainnet/"], - BitcoinCash: ["https://node-router.thorswap.net/bitcoin-cash", "https://smartbch.greyh.at"], - Chainflip: ["wss://mainnet-archive.chainflip.io", "wss://mainnet-secondary.chainflip.io"], - Cosmos: ["https://node-router.thorswap.net/cosmos/rpc", "https://cosmos-rpc.polkachu.com"], - Dash: ["https://node-router.thorswap.net/dash", "https://dashcore-rpc.strobnz.net"], - Dogecoin: ["https://node-router.thorswap.net/dogecoin", "https://dogecoin-rpc.dogechain.info"], - Ethereum: ["https://node-router.thorswap.net/ethereum", "https://eth.llamarpc.com"], - Kujira: ["https://rpc-kujira.synergynodes.com/", "https://kujira-rpc.polkachu.com"], - Litecoin: ["https://node-router.thorswap.net/litecoin", "https://ltc.getblock.io/mainnet/"], - Maya: ["https://tendermint.mayachain.info", "https://rpc.mayachain.info"], - MayaStagenet: ["https://stagenet.tendermint.mayachain.info", "https://stagenet-rpc.mayachain.info"], - Optimism: ["https://mainnet.optimism.io", "https://optimism-mainnet.public.blastapi.io"], - Polkadot: ["wss://rpc.polkadot.io", "wss://polkadot.api.onfinality.io/public-ws"], - Polygon: ["https://polygon-rpc.com", "https://polygon-mainnet.public.blastapi.io"], - Radix: ["https://radix-mainnet.rpc.grove.city/v1/326002fc/core", "https://mainnet.radixdlt.com"], - THORChain: ["https://rpc.thorswap.net", "https://thornode.ninerealms.com"], - THORChainStagenet: ["https://stagenet-rpc.ninerealms.com", "https://testnet.thornode.thorchain.info"], - Solana: ["https://mainnet.helius-rpc.com", "https://api.mainnet-beta.solana.com"], -} as const; ->>>>>>> REPLACE -``` - -This change converts the `RPCUrl` enum into a constant object where each property is an array of strings containing the primary and fallback URLs. The `as const` assertion at the end ensures that TypeScript treats this object as a readonly constant with specific string literal types for each URL. - -This new structure allows for easier programmatic access to multiple URLs for each network, which can be useful for implementing fallback logic or load balancing. - -Note that this change might require updates in other parts of the codebase where `RPCUrl` is used, as it's no longer an enum but an object with array values. - -> Tokens: 5.3k sent, 1.4k received. Cost: $0.04 message, $0.07 session. -> Applied edit to packages/swapkit/helpers/src/types/network.ts -> Commit cfecbc9 feat: Convert RPCUrl to use arrays instead of comma-separated strings -> No changes made to git tracked files. -> You can use /undo to undo and discard each aider commit. diff --git a/packages/plugins/kado/src/plugin.ts b/packages/plugins/kado/src/plugin.ts index 2ba56c652..679a85f0b 100644 --- a/packages/plugins/kado/src/plugin.ts +++ b/packages/plugins/kado/src/plugin.ts @@ -326,7 +326,7 @@ function plugin({ partner: "fortress", amount: buyAsset.getValue("string"), asset: asset.symbol, - blockchain: asset.chain, + blockchain: ChainToKadoChain(asset.chain), currency, }; diff --git a/playgrounds/vite/src/Swap/index.tsx b/playgrounds/vite/src/Swap/index.tsx index 07f1b904b..e3419db9d 100644 --- a/playgrounds/vite/src/Swap/index.tsx +++ b/playgrounds/vite/src/Swap/index.tsx @@ -1,5 +1,5 @@ "use client"; -import { AssetValue, FeeOption, type QuoteResponseRoute } from "@swapkit/sdk"; +import { type AssetValue, FeeOption, type QuoteResponseRoute } from "@swapkit/sdk"; import { useCallback } from "react"; import type { SwapKitClient } from "../swapKitClient"; @@ -31,18 +31,18 @@ export default function Swap({ [inputAsset, outputAsset?.chain, skClient], ); - const kadoWidget = async () => { - const quote = await skClient?.kado.onRampQuote({ - assetValue: AssetValue.from({ asset: "ETH.ETH", value: 0.01 }), - fiatValue: AssetValue.from({ asset: "FIAT.USD", value: 1000 }), - }); +// const kadoWidget = async () => { + // const quote = await skClient?.kado.onRampQuote({ + // assetValue: AssetValue.from({ asset: "ETH.ETH", value: 0.01 }), + // fiatValue: AssetValue.from({ asset: "FIAT.USD", value: 1000 }), + // }); - if (quote?.routes[0]) { - skClient?.kado.swap({ route: quote.routes[0] }); - } - }; + // if (quote?.routes[0]) { + // skClient?.kado.swap({ route: quote.routes[0] }); + // } + // }; - kadoWidget(); + // kadoWidget(); return ( <>