diff --git a/package.json b/package.json index d931ad2d..d267f9f9 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,8 @@ "prepare": "husky && ./scripts/gen-defuse-types.sh" }, "dependencies": { - "@defuse-protocol/bridge-sdk": "^0.7.4", + "@defuse-protocol/bridge-sdk": "0.10.0", + "@defuse-protocol/internal-utils": "0.1.2", "@lifeomic/attempt": "^3.1.0", "@noble/curves": "1.4.0", "@noble/hashes": "^1.7.1", diff --git a/src/constants/aurora.ts b/src/constants/aurora.ts index 90237ab6..6f5b42cf 100644 --- a/src/constants/aurora.ts +++ b/src/constants/aurora.ts @@ -1,26 +1,36 @@ -import type { SupportedChainName } from "src/types/base" +import type { VirtualChains } from "../types/base" /** * SiloToSilo addresses on blockchains within Aurora Engine */ -export const siloToSiloAddress = { +export const siloToSiloAddress: Record = { aurora: "0x055707c67977e8217F98f19cFa8aca18B2282D0C", turbochain: "0x8a4Bf14C51e1092581F1392810eE38c5A20f83da", tuxappchain: "0xA50fFd8a0953B3965E70C4F7F880B00BcdB9A313", vertex: "0xA50fFd8a0953B3965E70C4F7F880B00BcdB9A313", optima: "0xA50fFd8a0953B3965E70C4F7F880B00BcdB9A313", easychain: "0xA50fFd8a0953B3965E70C4F7F880B00BcdB9A313", -} as const +} /** * Account ids on Near of Aurora Engine powered blockchains * Mapping: ChainName -> AccountId */ -export const auroraEngineContractId = { +export const auroraEngineContractId: Record = { aurora: "aurora", turbochain: "0x4e45415f.c.aurora", tuxappchain: "0x4e454165.c.aurora", vertex: "0x4e454173.c.aurora", optima: "0x4e454161.c.aurora", easychain: "0x4e454218.c.aurora", -} as Record +} + +export function getAuroraEngineContractId(chainName: string) { + if (!(chainName in auroraEngineContractId)) { + throw new Error(`Unsupported virtual chain = ${chainName}`) + } + + return auroraEngineContractId[ + chainName as keyof typeof auroraEngineContractId + ] +} diff --git a/src/features/machines/intentStatusMachine.ts b/src/features/machines/intentStatusMachine.ts index 7f2677f0..8e4eb9c5 100644 --- a/src/features/machines/intentStatusMachine.ts +++ b/src/features/machines/intentStatusMachine.ts @@ -1,4 +1,8 @@ -import type { BridgeSDK } from "@defuse-protocol/bridge-sdk" +import { + type RouteConfig, + createNearWithdrawalRoute, + createVirtualChainRoute, +} from "@defuse-protocol/bridge-sdk" import { solverRelay } from "@defuse-protocol/internal-utils" import { type ActorRef, @@ -9,7 +13,7 @@ import { sendTo, setup, } from "xstate" -import { auroraEngineContractId } from "../../constants/aurora" +import { getAuroraEngineContractId } from "../../constants/aurora" import { bridgeSDK } from "../../constants/bridgeSdk" import { logger } from "../../logger" import type { @@ -20,7 +24,7 @@ import type { } from "../../types/base" import type { IntentsUserId } from "../../types/intentsUserId" import { assert } from "../../utils/assert" -import { CAIP2_NETWORK } from "../../utils/caip2" +import { getCAIP2 } from "../../utils/caip2" import type { IntentDescription } from "./swapIntentMachine" type ChildEvent = { @@ -99,7 +103,7 @@ export const intentStatusMachine = setup({ }) => { return bridgeSDK .waitForWithdrawalCompletion({ - bridge: toBridgeConfig( + routeConfig: toRouteConfig( input.nearIntentsNetwork ? "direct" : input.bridge, input.chainName ), @@ -249,32 +253,29 @@ export const intentStatusMachine = setup({ }, }) -function toBridgeConfig( +function toRouteConfig( bridge: SupportedBridge, chainName: SupportedChainName -): Parameters< - (typeof BridgeSDK.prototype)["waitForWithdrawalCompletion"] ->["0"]["bridge"] { +): RouteConfig { switch (bridge) { - case "aurora_engine": - return { - bridge, - auroraEngineContractId: auroraEngineContractId[chainName], - proxyTokenContractId: null, // TODO: provide the correct value once you know it - } + case "aurora_engine": { + return createVirtualChainRoute( + getAuroraEngineContractId(chainName), + null // TODO: provide the correct value once you know it + ) + } case "hot_omni": return { - bridge: "hot", - // biome-ignore lint/suspicious/noExplicitAny: it expects just a caip2 string, but mistakenly strongly typed - chain: CAIP2_NETWORK[chainName] as any, + route: "hot_bridge", + chain: getCAIP2(chainName), } case "poa": - case "direct": return { - bridge, - // biome-ignore lint/suspicious/noExplicitAny: it expects just a caip2 string, but mistakenly strongly typed - chain: CAIP2_NETWORK[chainName] as any, + route: "poa_bridge", + chain: getCAIP2(chainName), } + case "direct": + return createNearWithdrawalRoute() default: bridge satisfies never throw new Error(`Unsupported bridge: ${bridge}`) diff --git a/src/sdk/aggregatedQuote/getAggregatedQuoteExactIn.test.ts b/src/sdk/aggregatedQuote/getAggregatedQuoteExactIn.test.ts index f18a70d8..88aaed35 100644 --- a/src/sdk/aggregatedQuote/getAggregatedQuoteExactIn.test.ts +++ b/src/sdk/aggregatedQuote/getAggregatedQuoteExactIn.test.ts @@ -6,7 +6,11 @@ import { QuoteError } from "../solverRelay/errors/quote" import { AggregatedQuoteError } from "./errors/aggregatedQuoteError" import { getAggregatedQuoteExactIn } from "./getAggregatedQuoteExactIn" -vi.spyOn(solverRelay, "quote") +vi.mock("@defuse-protocol/internal-utils", () => ({ + solverRelay: { + quote: vi.fn(), + }, +})) const tokenInfo: BaseTokenInfo = { defuseAssetId: "", diff --git a/src/services/quoteService.test.ts b/src/services/quoteService.test.ts index 673527e1..89b88f72 100644 --- a/src/services/quoteService.test.ts +++ b/src/services/quoteService.test.ts @@ -4,7 +4,11 @@ import type { BaseTokenInfo } from "../types/base" import { adjustDecimals } from "../utils/tokenUtils" import { queryQuote } from "./quoteService" -vi.spyOn(solverRelay, "quote") +vi.mock("@defuse-protocol/internal-utils", () => ({ + solverRelay: { + quote: vi.fn(), + }, +})) const tokenInfo: BaseTokenInfo = { defuseAssetId: "", diff --git a/src/services/withdrawService.ts b/src/services/withdrawService.ts index 099ea979..ba43d46a 100644 --- a/src/services/withdrawService.ts +++ b/src/services/withdrawService.ts @@ -1,10 +1,15 @@ import { type FeeEstimation, FeeExceedsAmountError, + type RouteConfig, + createDefaultRoute, + createInternalTransferRoute, + createNearWithdrawalRoute, + createVirtualChainRoute, } from "@defuse-protocol/bridge-sdk" import { Err, Ok, type Result } from "@thames/monads" import { type ActorRefFrom, waitFor } from "xstate" -import { auroraEngineContractId } from "../constants/aurora" +import { getAuroraEngineContractId } from "../constants/aurora" import { bridgeSDK } from "../constants/bridgeSdk" import type { QuoteInput, @@ -74,21 +79,6 @@ export type PreparationOutput = | { tag: "ok"; value: PreparedWithdrawReturnType } | { tag: "err"; value: PrepareWithdrawErrorType } -// todo: import it from bridge-sdk -type BridgeConfig = - | { - bridge: "direct" - chain: "near:mainnet" - } - | { - bridge: "aurora_engine" - auroraEngineContractId: string - proxyTokenContractId: string | null - } - | { - bridge: "intents" - } - export async function prepareWithdraw( { formValues, @@ -197,24 +187,22 @@ export async function prepareWithdraw( directWithdrawAvailable ) - const bridgeConfig: BridgeConfig | undefined = isAuroraVirtualChain( + const routeConfig: RouteConfig | undefined = isAuroraVirtualChain( formValues.tokenOut.chainName ) - ? { - bridge: "aurora_engine", - auroraEngineContractId: - auroraEngineContractId[formValues.tokenOut.chainName], - proxyTokenContractId: null, // TODO: provide the correct value once you know it - } + ? createVirtualChainRoute( + getAuroraEngineContractId(formValues.tokenOut.chainName), + null // TODO: provide the correct value once you know it + ) : formValues.tokenOut.chainName === "near" - ? { bridge: "direct", chain: "near:mainnet" } - : undefined + ? createNearWithdrawalRoute() + : createDefaultRoute() const feeEstimation = await estimateFee({ defuseAssetId: formValues.tokenOut.defuseAssetId, amount: totalWithdrawn.amount, recipient: formValues.parsedRecipient, - bridgeConfig, + routeConfig, }) if (feeEstimation.isErr()) { return { tag: "err", value: feeEstimation.unwrapErr() } @@ -250,7 +238,7 @@ export async function prepareWithdraw( destinationAddress: formValues.parsedRecipient, destinationMemo: formValues.parsedDestinationMemo ?? undefined, feeInclusive: false, - bridgeConfig, + routeConfig, }, feeEstimation: feeEstimation.unwrap(), }) @@ -375,12 +363,12 @@ async function estimateFee({ defuseAssetId, amount, recipient, - bridgeConfig, + routeConfig, }: { defuseAssetId: string amount: bigint recipient: string - bridgeConfig: BridgeConfig | undefined + routeConfig: RouteConfig | undefined }): Promise> { return bridgeSDK .estimateWithdrawalFee({ @@ -389,7 +377,7 @@ async function estimateFee({ amount: amount, destinationAddress: recipient, feeInclusive: true, - bridgeConfig, + routeConfig, }, }) .then(Ok, (err) => { @@ -581,9 +569,7 @@ async function prepareNearIntentsWithdraw({ destinationAddress: formValues.parsedRecipient, destinationMemo: undefined, // Destination memo is only used for XRP Ledger withdrawals feeInclusive: false, - bridgeConfig: { - bridge: "intents", - }, + routeConfig: createInternalTransferRoute(), }, feeEstimation: { amount: 0n, diff --git a/src/types/base.ts b/src/types/base.ts index 7b6234c8..62b4ec0b 100644 --- a/src/types/base.ts +++ b/src/types/base.ts @@ -6,12 +6,6 @@ export type SupportedChainName = | "bitcoin" | "solana" | "dogecoin" - | "turbochain" - | "tuxappchain" - | "vertex" - | "optima" - | "easychain" - | "aurora" | "xrpledger" | "zcash" | "gnosis" @@ -19,13 +13,24 @@ export type SupportedChainName = | "tron" | "polygon" | "bsc" - | "hyperliquid" | "ton" | "optimism" | "avalanche" | "sui" | "stellar" | "aptos" + | VirtualChains + | MockedChains + +export type VirtualChains = + | "turbochain" + | "tuxappchain" + | "vertex" + | "optima" + | "easychain" + | "aurora" + +export type MockedChains = "hyperliquid" export type SupportedBridge = "direct" | "poa" | "aurora_engine" | "hot_omni" diff --git a/src/utils/caip2.ts b/src/utils/caip2.ts index 40546df5..ecd17fe5 100644 --- a/src/utils/caip2.ts +++ b/src/utils/caip2.ts @@ -1,31 +1,38 @@ -import type { SupportedChainName } from "../types/base" +import { CAIP2_NETWORK } from "@defuse-protocol/bridge-sdk" +import type { + MockedChains, + SupportedChainName, + VirtualChains, +} from "../types/base" -export const CAIP2_NETWORK: Record = { - bitcoin: "bip122:000000000019d6689c085ae165831e93", - eth: "eip155:1", - base: "eip155:8453", - arbitrum: "eip155:42161", - bsc: "eip155:56", - polygon: "eip155:137", - near: "near:mainnet", - solana: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", - tron: "tron:27Lqcw", - gnosis: "eip155:100", - xrpledger: "xrpl:0", - dogecoin: "bip122:1a91e3dace36e2be3bf030a65679fe82", - zcash: "zcash:0", - berachain: "eip155:80085", - ton: "tvm:-239", - aurora: "eip155:1313161554", - turbochain: "eip155:1313161567", - tuxappchain: "eip155:1313161573", - vertex: "eip155:1313161587", - optima: "eip155:1313161569", - easychain: "eip155:1313161752", - hyperliquid: "hyperliquid:mainnet", // todo: This is not reviewed and most likely incorrect - optimism: "eip155:10", - avalanche: "eip155:43114", - sui: "sui:mainnet", - stellar: "stellar:mainnet", - aptos: "aptos:mainnet", +type RealChains = Exclude + +const mapping: Record = { + bitcoin: CAIP2_NETWORK.Bitcoin, + eth: CAIP2_NETWORK.Ethereum, + base: CAIP2_NETWORK.Base, + arbitrum: CAIP2_NETWORK.Arbitrum, + bsc: CAIP2_NETWORK.BNB, + polygon: CAIP2_NETWORK.Polygon, + near: CAIP2_NETWORK.Near, + solana: CAIP2_NETWORK.Solana, + tron: CAIP2_NETWORK.Tron, + gnosis: CAIP2_NETWORK.Gnosis, + xrpledger: CAIP2_NETWORK.XRPL, + dogecoin: CAIP2_NETWORK.Dogecoin, + zcash: CAIP2_NETWORK.Zcash, + berachain: CAIP2_NETWORK.Berachain, + ton: CAIP2_NETWORK.TON, + optimism: CAIP2_NETWORK.Optimism, + avalanche: CAIP2_NETWORK.Avalanche, + sui: CAIP2_NETWORK.Sui, + stellar: CAIP2_NETWORK.Stellar, + aptos: CAIP2_NETWORK.Aptos, +} + +export function getCAIP2(chainName: SupportedChainName): CAIP2_NETWORK { + if (chainName in mapping) { + return mapping[chainName as keyof typeof mapping] + } + throw new Error(`Unsupported chain name: ${chainName}`) } diff --git a/yarn.lock b/yarn.lock index 1fbe47d0..8e791180 100644 --- a/yarn.lock +++ b/yarn.lock @@ -367,42 +367,43 @@ tweetnacl "^1.0.3" tweetnacl-util "^0.15.1" -"@defuse-protocol/bridge-sdk@^0.7.4": - version "0.7.4" - resolved "https://registry.yarnpkg.com/@defuse-protocol/bridge-sdk/-/bridge-sdk-0.7.4.tgz#3c71967635c579714f620a05086c59c35fdb347c" - integrity sha512-zqYxqX7CQvHhP30OLHnkVJm5dmssubDM51jF2JkgADCfYRwMsLcADaV+Klk8ebnsb8e/b9T3QpHHFaN+PlseNw== +"@defuse-protocol/bridge-sdk@0.10.0": + version "0.10.0" + resolved "https://registry.yarnpkg.com/@defuse-protocol/bridge-sdk/-/bridge-sdk-0.10.0.tgz#68a7770cb2f881055699765d8a12d1942f178fc2" + integrity sha512-urSujeuloO1N2EWi332WpuKfZhdwFchjveHzFdpv1RkWTPW3y9wUjg93kPUeg+BfSUk8KCjK/BmDxUIDbYGrkQ== dependencies: "@defuse-protocol/contract-types" "0.0.3" - "@defuse-protocol/internal-utils" "0.0.10" - "@hot-labs/omni-sdk" "2.8.3" + "@defuse-protocol/internal-utils" "0.1.2" + "@hot-labs/omni-sdk" "2.14.0" + "@isaacs/ttlcache" "^1.0.0" "@lifeomic/attempt" "^3.0.0" - "@scure/base" "^1.2.5" + "@scure/base" "^1.0.0" borsher "^4.0.0" - near-api-js "^5.0.1" - viem "^2.29.4" + near-api-js "^4.0.0 || ^5.0.0" + viem "^2.0.0" "@defuse-protocol/contract-types@0.0.3": version "0.0.3" resolved "https://registry.yarnpkg.com/@defuse-protocol/contract-types/-/contract-types-0.0.3.tgz#ed7f8070c80e9cd2ac2fd7f2c4dd6cd4918205a8" integrity sha512-N3LJS4tfshw6+kldrx6Hij8c8tzTHbmNPVByhursQ86Apu8p/gOPixfBbUZh21fKCCqktERbjeKzGe5EJV0gWA== -"@defuse-protocol/internal-utils@0.0.10": - version "0.0.10" - resolved "https://registry.yarnpkg.com/@defuse-protocol/internal-utils/-/internal-utils-0.0.10.tgz#73d7592bc4668a9959c0651dc95c4e3612d1efee" - integrity sha512-zHHAjZJslHm4mtIRhxI6waRyAymmFynAlOIi9i/3kcDnECctkq13D2oMaOO93VLjud3ZDHpsCbsbSTtDsrncYQ== +"@defuse-protocol/internal-utils@0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@defuse-protocol/internal-utils/-/internal-utils-0.1.2.tgz#a1647aaf8f3b12f850946cd572ee97b71d21e6e0" + integrity sha512-AiPO7oURTnnn2JBG8yHtDsY4XegL1U3MyNO5Omptgqu8PUiVD/cNIChrb/V32C5fuOuquly8jQ2JL1qwKoOFRQ== dependencies: "@defuse-protocol/contract-types" "0.0.3" "@hot-labs/omni-sdk" "2.8.3" - "@lifeomic/attempt" "^3.1.0" + "@lifeomic/attempt" "^3.0.0" "@noble/hashes" "^1.7.1" - "@peculiar/asn1-ecc" "^2.3.15" - "@peculiar/asn1-schema" "^2.3.15" - "@scure/base" "^1.1.9" + "@peculiar/asn1-ecc" "^2.0.0" + "@peculiar/asn1-schema" "^2.0.0" + "@scure/base" "^1.0.0" "@thames/monads" "^0.7.0" - near-api-js "^5.0.1" - tweetnacl "^1.0.3" - valibot "^1.0.0-rc.1" - viem "^2.18.1" + near-api-js "^4.0.0 || ^5.0.0" + tweetnacl "^1.0.0" + valibot "^1.0.0" + viem "^2.0.0" "@emurgo/cardano-serialization-lib-browser@^13.2.0": version "13.2.1" @@ -604,6 +605,28 @@ resolved "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.8.tgz" integrity sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig== +"@hot-labs/omni-sdk@2.14.0": + version "2.14.0" + resolved "https://registry.yarnpkg.com/@hot-labs/omni-sdk/-/omni-sdk-2.14.0.tgz#5dc6c534a2d84f74660fed71c0e00ae59cb88ac2" + integrity sha512-AjGol0QmACDN0ODXxkSRrSUKaA3oYOPtARiu/L6gcNL+NLJCl/tRWYiz0cQ1OEp6kP24u8R1VFbL0CkXbQTVFA== + dependencies: + "@coral-xyz/anchor" "0.29.0" + "@near-js/crypto" "^2.0.0" + "@near-js/providers" "^2.0.0" + "@near-js/transactions" "^2.0.0" + "@near-js/types" "^2.0.0" + "@near-js/utils" "^2.0.0" + "@solana/spl-token" "0.4.0" + "@solana/web3.js" "1.98.0" + "@stellar/stellar-sdk" "^13.0.0" + "@ton-api/client" "^0.4.0" + "@ton-api/ton-adapter" "^0.4.0" + "@ton/core" "^0.59.0" + "@ton/crypto" "^3.3.0" + "@ton/ton" "^15.1.0" + ethers "^6.0.0" + rlp "3.0.0" + "@hot-labs/omni-sdk@2.8.3": version "2.8.3" resolved "https://registry.yarnpkg.com/@hot-labs/omni-sdk/-/omni-sdk-2.8.3.tgz#852501daa6bd1a033e7c5c72f7c9c3150f95ec08" @@ -657,6 +680,11 @@ resolved "https://registry.npmjs.org/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz" integrity sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ== +"@isaacs/ttlcache@^1.0.0": + version "1.4.1" + resolved "https://registry.yarnpkg.com/@isaacs/ttlcache/-/ttlcache-1.4.1.tgz#21fb23db34e9b6220c6ba023a0118a2dd3461ea2" + integrity sha512-RQgQ4uQ+pLbqXfOmieB91ejmLwvSgv9nLx6sT6sD83s7umBypgg+OIBOBbEUiJXrfpnp9j0mRhYYdzp9uqq3lA== + "@istanbuljs/schema@^0.1.2": version "0.1.3" resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz" @@ -886,6 +914,18 @@ randombytes "2.1.0" secp256k1 "5.0.1" +"@near-js/crypto@2.2.3", "@near-js/crypto@^2.0.0": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@near-js/crypto/-/crypto-2.2.3.tgz#256a92711874848dc00346cf6184db80a34d413b" + integrity sha512-fL8w5HbrvlgFO6aZuGqGjoU5OCQlOCCLiYwxBzUUOv+P462fauPHzX12GgxY8IX9DXRCu2Eq9jNu5TnoUPjR8Q== + dependencies: + "@near-js/types" "2.2.3" + "@near-js/utils" "2.2.3" + "@noble/curves" "1.8.1" + borsh "1.0.0" + randombytes "2.1.0" + secp256k1 "5.0.1" + "@near-js/keystores-browser@0.2.2": version "0.2.2" resolved "https://registry.yarnpkg.com/@near-js/keystores-browser/-/keystores-browser-0.2.2.tgz#9df046c9dcca91fc743d33e798ba4c205d5f673b" @@ -923,6 +963,20 @@ optionalDependencies: node-fetch "2.6.7" +"@near-js/providers@^2.0.0": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@near-js/providers/-/providers-2.2.3.tgz#704a161e6948fad9151e17e90ab1f51d99746e8c" + integrity sha512-lP0NgkpHdPVDVb54eDOitxBVjojxG7gxod/SXWF/hVJan7GqWbKEenMRDKMFTMaOt5Y67JVXTcoO2OTQ+S0rmA== + dependencies: + "@near-js/crypto" "2.2.3" + "@near-js/transactions" "2.2.3" + "@near-js/types" "2.2.3" + "@near-js/utils" "2.2.3" + borsh "1.0.0" + exponential-backoff "^3.1.2" + optionalDependencies: + node-fetch "2.6.7" + "@near-js/signers@0.2.2": version "0.2.2" resolved "https://registry.yarnpkg.com/@near-js/signers/-/signers-0.2.2.tgz#ae521e1ea72c9b49ad1dfc63f2d90d847207fea7" @@ -944,11 +998,27 @@ "@noble/hashes" "1.7.1" borsh "1.0.0" +"@near-js/transactions@2.2.3", "@near-js/transactions@^2.0.0": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@near-js/transactions/-/transactions-2.2.3.tgz#59f17382bc058d6c48d288b4cd24f38a08d3a9e2" + integrity sha512-gafFKmFUzpXgIdNVCPqexuYhB28vBsjuxj8K6WW1W2m8Soz5rFtTTGbEeWOHX72+FZ8jskPm3SXT5/mFqug1uw== + dependencies: + "@near-js/crypto" "2.2.3" + "@near-js/types" "2.2.3" + "@near-js/utils" "2.2.3" + "@noble/hashes" "1.7.1" + borsh "1.0.0" + "@near-js/types@0.3.1": version "0.3.1" resolved "https://registry.yarnpkg.com/@near-js/types/-/types-0.3.1.tgz#35f2649f85881d72fc231a16142e1f0e3b0e8377" integrity sha512-8qIA7ynAEAuVFNAQc0cqz2xRbfyJH3PaAG5J2MgPPhD18lu/tCGd6pzYg45hjhtiJJRFDRjh/FUWKS+ZiIIxUw== +"@near-js/types@2.2.3", "@near-js/types@^2.0.0": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@near-js/types/-/types-2.2.3.tgz#f74d8ecc64f0a9e3dc614bc7c0b18f836dc649c5" + integrity sha512-8VFhTsTKs47WQF1NNZASsoTZJvZulW98SYyfUE5LEM8PoLFsvvPnyyKcOppzeIPrwr+68t0rK0Dl+ANEHCFlbw== + "@near-js/utils@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@near-js/utils/-/utils-1.0.1.tgz#c86b31ce3877631f0e4f4664d5746bb88a7cf581" @@ -969,6 +1039,16 @@ depd "2.0.0" mustache "4.0.0" +"@near-js/utils@2.2.3", "@near-js/utils@^2.0.0": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@near-js/utils/-/utils-2.2.3.tgz#c39d8fca5e9fb3c3ca8cb4f24d7cb217b96e17a6" + integrity sha512-Ac966+QzuRdiKUKYgQG/AmMIc3WPH/MTnRK/TpUoz1kEVXu+bePkenezCvLcfOqYg9NEr1i84w971XG+muNZpw== + dependencies: + "@near-js/types" "2.2.3" + "@scure/base" "^1.2.4" + depd "2.0.0" + mustache "4.0.0" + "@near-js/wallet-account@1.3.3": version "1.3.3" resolved "https://registry.yarnpkg.com/@near-js/wallet-account/-/wallet-account-1.3.3.tgz#ac23509e0c1c124945a8539d3cd2f654aed727e8" @@ -1383,6 +1463,16 @@ dependencies: "@octokit/openapi-types" "^22.2.0" +"@peculiar/asn1-ecc@^2.0.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-ecc/-/asn1-ecc-2.4.0.tgz#e21f87b12a0be3e57d6a914e576b6d10aa4a35d4" + integrity sha512-fJiYUBCJBDkjh347zZe5H81BdJ0+OGIg0X9z06v8xXUoql3MFeENUX0JsjCaVaU9A0L85PefLPGYkIoGpTnXLQ== + dependencies: + "@peculiar/asn1-schema" "^2.4.0" + "@peculiar/asn1-x509" "^2.4.0" + asn1js "^3.0.6" + tslib "^2.8.1" + "@peculiar/asn1-ecc@^2.3.15": version "2.3.15" resolved "https://registry.npmjs.org/@peculiar/asn1-ecc/-/asn1-ecc-2.3.15.tgz" @@ -1393,6 +1483,15 @@ asn1js "^3.0.5" tslib "^2.8.1" +"@peculiar/asn1-schema@^2.0.0", "@peculiar/asn1-schema@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-schema/-/asn1-schema-2.4.0.tgz#e3aa7917d433b4c3fcfa1fcb57eac233b1c38787" + integrity sha512-umbembjIWOrPSOzEGG5vxFLkeM8kzIhLkgigtsOrfLKnuzxWxejAcUX+q/SoZCdemlODOcr5WiYa7+dIEzBXZQ== + dependencies: + asn1js "^3.0.6" + pvtsutils "^1.3.6" + tslib "^2.8.1" + "@peculiar/asn1-schema@^2.3.15": version "2.3.15" resolved "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.3.15.tgz" @@ -1412,6 +1511,16 @@ pvtsutils "^1.3.6" tslib "^2.8.1" +"@peculiar/asn1-x509@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@peculiar/asn1-x509/-/asn1-x509-2.4.0.tgz#ca8ec0d409678e1a47bc324c3dc739085186123f" + integrity sha512-F7mIZY2Eao2TaoVqigGMLv+NDdpwuBKU1fucHPONfzaBS4JXXCNCmfO0Z3dsy7JzKGqtDcYC1mr9JjaZQZNiuw== + dependencies: + "@peculiar/asn1-schema" "^2.4.0" + asn1js "^3.0.6" + pvtsutils "^1.3.6" + tslib "^2.8.1" + "@phosphor-icons/react@^2.1.7": version "2.1.7" resolved "https://registry.npmjs.org/@phosphor-icons/react/-/react-2.1.7.tgz" @@ -2235,6 +2344,11 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.0.tgz#0574d7e87b44ee8511d08cc7f914bcb802b70818" integrity sha512-fbMkAF7fufku0N2dE5TBXcNlg0pt0cJue4xBRE2Qc5Vqikxr4VCgKj/ht6SMdFcOacVA9rqF70APJ8RN/4vMJw== +"@scure/base@^1.0.0", "@scure/base@^1.2.4": + version "1.2.6" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.2.6.tgz#ca917184b8231394dd8847509c67a0be522e59f6" + integrity sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg== + "@scure/base@^1.1.3", "@scure/base@^1.1.9": version "1.2.1" resolved "https://registry.npmjs.org/@scure/base/-/base-1.2.1.tgz" @@ -2245,11 +2359,6 @@ resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.2.5.tgz#f9d1b232425b367d0dcb81c96611dcc651d58671" integrity sha512-9rE6EOVeIQzt5TSu4v+K523F8u6DhBsoZWPGKlnCshhlDhy0kJzUX4V+tr2dWmzF1GdekvThABoEQBGBQI7xZw== -"@scure/base@^1.2.5": - version "1.2.6" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.2.6.tgz#ca917184b8231394dd8847509c67a0be522e59f6" - integrity sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg== - "@scure/base@~1.1.6", "@scure/base@~1.1.8": version "1.1.9" resolved "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz" @@ -2896,13 +3005,23 @@ dependencies: "@solana/codecs" "2.0.0-rc.1" -"@solana/spl-token-metadata@^0.1.6": +"@solana/spl-token-metadata@^0.1.2", "@solana/spl-token-metadata@^0.1.6": version "0.1.6" resolved "https://registry.npmjs.org/@solana/spl-token-metadata/-/spl-token-metadata-0.1.6.tgz" integrity sha512-7sMt1rsm/zQOQcUWllQX9mD2O6KhSAtY1hFR2hfFwgqfFWzSY9E9GDvFVNYUI1F0iQKcm6HmePU9QbKRXTEBiA== dependencies: "@solana/codecs" "2.0.0-rc.1" +"@solana/spl-token@0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.4.0.tgz#c057e82afd2b9ea59019525f3fbf6c9a20349a54" + integrity sha512-jjBIBG9IsclqQVl5Y82npGE6utdCh7Z9VFcF5qgJa5EUq2XgspW3Dt1wujWjH/vQDRnkp9zGO+BqQU/HhX/3wg== + dependencies: + "@solana/buffer-layout" "^4.0.0" + "@solana/buffer-layout-utils" "^0.2.0" + "@solana/spl-token-metadata" "^0.1.2" + buffer "^6.0.3" + "@solana/spl-token@0.4.9", "@solana/spl-token@^0.4.9": version "0.4.9" resolved "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.4.9.tgz" @@ -3191,7 +3310,7 @@ resolved "https://registry.yarnpkg.com/@stellar/js-xdr/-/js-xdr-3.1.2.tgz#db7611135cf21e989602fd72f513c3bed621bc74" integrity sha512-VVolPL5goVEIsvuGqDc5uiKxV03lzfWdvYg1KikvwheDmTBO68CKDji3bAZ/kppZrx5iTA8z3Ld5yuytcvhvOQ== -"@stellar/stellar-base@^13.0.1": +"@stellar/stellar-base@^13.0.1", "@stellar/stellar-base@^13.1.0": version "13.1.0" resolved "https://registry.yarnpkg.com/@stellar/stellar-base/-/stellar-base-13.1.0.tgz#06d9075cc72da05bc5dd6f1971e6682a0525cec9" integrity sha512-90EArG+eCCEzDGj3OJNoCtwpWDwxjv+rs/RNPhvg4bulpjN/CSRj+Ys/SalRcfM4/WRC5/qAfjzmJBAuquWhkA== @@ -3219,6 +3338,20 @@ toml "^3.0.0" urijs "^1.19.1" +"@stellar/stellar-sdk@^13.0.0": + version "13.3.0" + resolved "https://registry.yarnpkg.com/@stellar/stellar-sdk/-/stellar-sdk-13.3.0.tgz#72bf3eea4797de053aaebb889bf4de342d0b6b54" + integrity sha512-8+GHcZLp+mdin8gSjcgfb/Lb6sSMYRX6Nf/0LcSJxvjLQR0XHpjGzOiRbYb2jSXo51EnA6kAV5j+4Pzh5OUKUg== + dependencies: + "@stellar/stellar-base" "^13.1.0" + axios "^1.8.4" + bignumber.js "^9.3.0" + eventsource "^2.0.2" + feaxios "^0.0.23" + randombytes "^2.1.0" + toml "^3.0.0" + urijs "^1.19.1" + "@swc/helpers@^0.5.11": version "0.5.15" resolved "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz" @@ -3272,19 +3405,19 @@ resolved "https://registry.npmjs.org/@thames/monads/-/monads-0.7.0.tgz" integrity sha512-D9gK5uUdKJEfUESAJPwTdnhgd1odkxiVvcTlQmYeYhgDMlW4w8KcOyqEJ+m2fzxgIga9mk8IbFsy4xXrM5ssrA== -"@ton-api/client@0.4.0": +"@ton-api/client@0.4.0", "@ton-api/client@^0.4.0": version "0.4.0" resolved "https://registry.yarnpkg.com/@ton-api/client/-/client-0.4.0.tgz#5b43fdf9280b3e80a242de67fdcf9ccbccf6c247" integrity sha512-k3d6RzNWRDEZpVa9Gig2kHqp74tGvaK/imkjb08RIGxn+wKC7Yv5g98GnXEHf3srRkjtRCG0Nnjx8EsasOMJkw== dependencies: core-js-pure "^3.38.0" -"@ton-api/ton-adapter@0.4.1": +"@ton-api/ton-adapter@0.4.1", "@ton-api/ton-adapter@^0.4.0": version "0.4.1" resolved "https://registry.yarnpkg.com/@ton-api/ton-adapter/-/ton-adapter-0.4.1.tgz#7f12f524548c49b3c007349b6f27c8eea742a88f" integrity sha512-snvd49M2PnDiIgMyeeIpGPTWI7ECnRYz4qIcFplv/mmYvV+6OiNM4UtHOplAh7sGR1JY1xBf+HP+RJ8qzCN2Hw== -"@ton/core@0.59.1": +"@ton/core@0.59.1", "@ton/core@^0.59.0": version "0.59.1" resolved "https://registry.yarnpkg.com/@ton/core/-/core-0.59.1.tgz#fe568069ccdf2f4191da1eadc930076c0c012789" integrity sha512-SxFBAvutYJaIllTkv82vbHTJhJI6NxzqUhi499CDEjJEZ9i6i9lHJiK2df4dlLAb/4SiWX6+QUzESkK4DEdnCw== @@ -3298,7 +3431,7 @@ dependencies: jssha "3.2.0" -"@ton/crypto@3.3.0": +"@ton/crypto@3.3.0", "@ton/crypto@^3.3.0": version "3.3.0" resolved "https://registry.yarnpkg.com/@ton/crypto/-/crypto-3.3.0.tgz#019103df6540fbc1d8102979b4587bc85ff9779e" integrity sha512-/A6CYGgA/H36OZ9BbTaGerKtzWp50rg67ZCH2oIjV1NcrBaCK9Z343M+CxedvM7Haf3f/Ee9EhxyeTp0GKMUpA== @@ -3318,6 +3451,17 @@ teslabot "^1.3.0" zod "^3.21.4" +"@ton/ton@^15.1.0": + version "15.3.1" + resolved "https://registry.yarnpkg.com/@ton/ton/-/ton-15.3.1.tgz#c20688b27eb8ce8474610843804a7599679c38a2" + integrity sha512-+UuvbE0o0VIU/0W90STO+emRIDr3Vs39LdbX5ySm/Ra+RQJSiH0KX6TDOFqWDmD2Wzk4/zw21KwSiZ6Xjk8zlw== + dependencies: + axios "^1.6.7" + dataloader "^2.0.0" + symbol.inspect "1.0.1" + teslabot "^1.3.0" + zod "^3.21.4" + "@ton/ton@^15.3.0": version "15.3.0" resolved "https://registry.yarnpkg.com/@ton/ton/-/ton-15.3.0.tgz#868c8e605cab6a5be6878afe2a13792f04613561" @@ -4198,6 +4342,15 @@ asn1js@^3.0.5: pvutils "^1.1.3" tslib "^2.4.0" +asn1js@^3.0.6: + version "3.0.6" + resolved "https://registry.yarnpkg.com/asn1js/-/asn1js-3.0.6.tgz#53e002ebe00c5f7fd77c1c047c3557d7c04dce25" + integrity sha512-UOCGPYbl0tv8+006qks/dTgV9ajs97X2p0FAbyS2iyCRrmLSRolDaHdp+v/CLgnzHc3fVB+CwYiUmei7ndFcgA== + dependencies: + pvtsutils "^1.3.6" + pvutils "^1.1.3" + tslib "^2.8.1" + assert@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/assert/-/assert-2.1.0.tgz#6d92a238d05dc02e7427c881fb8be81c8448b2dd" @@ -4261,6 +4414,15 @@ axios@^1.6.7: form-data "^4.0.0" proxy-from-env "^1.1.0" +axios@^1.8.4: + version "1.11.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.11.0.tgz#c2ec219e35e414c025b2095e8b8280278478fdb6" + integrity sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA== + dependencies: + follow-redirects "^1.15.6" + form-data "^4.0.4" + proxy-from-env "^1.1.0" + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" @@ -4381,6 +4543,11 @@ bignumber.js@^9.0.1: resolved "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz" integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug== +bignumber.js@^9.3.0: + version "9.3.1" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.3.1.tgz#759c5aaddf2ffdc4f154f7b493e1c8770f88c4d7" + integrity sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ== + bin-links@^4.0.4: version "4.0.4" resolved "https://registry.npmjs.org/bin-links/-/bin-links-4.0.4.tgz" @@ -5668,6 +5835,19 @@ ethers@6.13.5: tslib "2.7.0" ws "8.17.1" +ethers@^6.0.0: + version "6.15.0" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.15.0.tgz#2980f2a3baf0509749b7e21f8692fa8a8349c0e3" + integrity sha512-Kf/3ZW54L4UT0pZtsY/rf+EkBU7Qi5nnhonjUb8yTXcxH3cdcWrV2cRyk0Xk/4jK6OoHhxxZHriyhje20If2hQ== + dependencies: + "@adraffy/ens-normalize" "1.10.1" + "@noble/curves" "1.2.0" + "@noble/hashes" "1.3.2" + "@types/node" "22.7.5" + aes-js "4.0.0-beta.5" + tslib "2.7.0" + ws "8.17.1" + eventemitter3@5.0.1, eventemitter3@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz" @@ -5899,6 +6079,17 @@ form-data@^4.0.0: es-set-tostringtag "^2.1.0" mime-types "^2.1.12" +form-data@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.4.tgz#784cdcce0669a9d68e94d11ac4eea98088edd2c4" + integrity sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + es-set-tostringtag "^2.1.0" + hasown "^2.0.2" + mime-types "^2.1.12" + fraction.js@^4.3.7: version "4.3.7" resolved "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz" @@ -7555,7 +7746,7 @@ near-abi@0.2.0: dependencies: "@types/json-schema" "^7.0.11" -near-api-js@5.0.1, near-api-js@^5.0.1, near-api-js@^5.1.1: +near-api-js@5.0.1, "near-api-js@^4.0.0 || ^5.0.0", near-api-js@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/near-api-js/-/near-api-js-5.1.1.tgz#64905f74d0ad9ce0b4f5ad6ec4aaa8403b8e5968" integrity sha512-h23BGSKxNv8ph+zU6snicstsVK1/CTXsQz4LuGGwoRE24Hj424nSe4+/1tzoiC285Ljf60kPAqRCmsfv9etF2g== @@ -10077,7 +10268,7 @@ tweetnacl-util@^0.15.1: resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== -tweetnacl@1.0.3, tweetnacl@^1.0.3: +tweetnacl@1.0.3, tweetnacl@^1.0.0, tweetnacl@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz" integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== @@ -10299,6 +10490,11 @@ uuid@^8.3.2: resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +valibot@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/valibot/-/valibot-1.1.0.tgz#873bb1af9e1577391690307bfe0520bd1360ec2d" + integrity sha512-Nk8lX30Qhu+9txPYTwM0cFlWLdPFsFr6LblzqIySfbZph9+BFsAHsNvHOymEviUepeIW6KFHzpX8TKhbptBXXw== + valibot@^1.0.0-rc.1: version "1.0.0-rc.1" resolved "https://registry.npmjs.org/valibot/-/valibot-1.0.0-rc.1.tgz" @@ -10332,6 +10528,20 @@ varuint-bitcoin@2.0.0: dependencies: uint8array-tools "^0.0.8" +viem@^2.0.0: + version "2.33.0" + resolved "https://registry.yarnpkg.com/viem/-/viem-2.33.0.tgz#d4ed73a69e26507c523ae70d19548572bfedc0f8" + integrity sha512-SxBM3CmeU+LWLlBclV9MPdbuFV8mQEl0NeRc9iyYU4a7Xb5sr5oku3s/bRGTPpEP+1hCAHYpM09/ui3/dQ6EsA== + dependencies: + "@noble/curves" "1.9.2" + "@noble/hashes" "1.8.0" + "@scure/bip32" "1.7.0" + "@scure/bip39" "1.6.0" + abitype "1.0.8" + isows "1.0.7" + ox "0.8.1" + ws "8.18.2" + viem@^2.18.1: version "2.21.15" resolved "https://registry.npmjs.org/viem/-/viem-2.21.15.tgz" @@ -10347,20 +10557,6 @@ viem@^2.18.1: webauthn-p256 "0.0.5" ws "8.17.1" -viem@^2.29.4: - version "2.31.3" - resolved "https://registry.yarnpkg.com/viem/-/viem-2.31.3.tgz#4157d7c87db5a23eee5f5e230849d5f30e731825" - integrity sha512-q3JGI5QFB4LEiLfg9f2ZwjUygAn2W0wMLtj++7E/L2i8Y7zKAkR4TEEOhwBn7gyYXpuc7f1vfd26PJbkEKuj5w== - dependencies: - "@noble/curves" "1.9.2" - "@noble/hashes" "1.8.0" - "@scure/bip32" "1.7.0" - "@scure/bip39" "1.6.0" - abitype "1.0.8" - isows "1.0.7" - ox "0.8.1" - ws "8.18.2" - vite-node@2.1.2: version "2.1.2" resolved "https://registry.npmjs.org/vite-node/-/vite-node-2.1.2.tgz"