diff --git a/package.json b/package.json index 5a5e4d2d..8790e35f 100644 --- a/package.json +++ b/package.json @@ -26,20 +26,20 @@ "@polkadot/types": "^10.12.6", "@reduxjs/toolkit": "^2.2.1", "@scio-labs/use-inkathon": "^0.8.1", - "@soroban-react/chains": "9.1.12", - "@soroban-react/connect-button": "9.1.12", - "@soroban-react/contracts": "9.1.12", - "@soroban-react/core": "9.1.12", - "@soroban-react/events": "9.1.12", - "@soroban-react/freighter": "9.1.12", - "@soroban-react/hana": "9.1.12", - "@soroban-react/lobstr": "9.1.12", - "@soroban-react/types": "9.1.12", - "@soroban-react/utils": "9.1.12", - "@soroban-react/wallet-data": "9.1.12", - "@soroban-react/xbull": "9.1.12", + "@soroban-react/chains": "9.1.13", + "@soroban-react/connect-button": "9.1.13", + "@soroban-react/contracts": "9.1.13", + "@soroban-react/core": "9.1.13", + "@soroban-react/events": "9.1.13", + "@soroban-react/freighter": "9.1.13", + "@soroban-react/hana": "9.1.13", + "@soroban-react/lobstr": "9.1.13", + "@soroban-react/types": "9.1.13", + "@soroban-react/utils": "9.1.13", + "@soroban-react/wallet-data": "9.1.13", + "@soroban-react/xbull": "9.1.13", "@stellar/freighter-api": "1.7.1", - "@stellar/stellar-sdk": "11.3.0", + "@stellar/stellar-sdk": "12.2.0", "@types/qs": "^6.9.7", "@types/react": "18.2.33", "@types/react-dom": "18.2.14", diff --git a/src/functions/generateRoute.ts b/src/functions/generateRoute.ts index c5948da9..c18b8bfd 100644 --- a/src/functions/generateRoute.ts +++ b/src/functions/generateRoute.ts @@ -33,7 +33,7 @@ export const useRouterSDK = () => { const router = useMemo(() => { const protocols = [Protocols.SOROSWAP]; - if (isAggregator) protocols.push(Protocols.PHOENIX); + // if (isAggregator) protocols.push(Protocols.PHOENIX); return new Router({ getPairsFns: shouldUseBackend @@ -53,7 +53,7 @@ export const useRouterSDK = () => { network, maxHops, }); - }, [network, maxHops, isAggregator]); + }, [network, maxHops]); const fromAddressToToken = (address: string) => { return new Token(network, address, 18); @@ -84,7 +84,6 @@ export const useRouterSDK = () => { return router.routeSplit(currencyAmount, quoteCurrency, tradeType); } - // console.log('returning route'); return router.route(currencyAmount, quoteCurrency, tradeType, factory, sorobanContext as any); }; diff --git a/src/helpers/aggregator/index.ts b/src/helpers/aggregator/index.ts index 56143c09..dc1512ee 100644 --- a/src/helpers/aggregator/index.ts +++ b/src/helpers/aggregator/index.ts @@ -1,23 +1,22 @@ -import { Address, nativeToScVal, xdr } from "@stellar/stellar-sdk"; +import { Address, nativeToScVal, xdr } from '@stellar/stellar-sdk'; export interface DexDistribution { protocol_id: string; - path: string[], - parts: number, - is_exact_in: boolean, + path: string[]; + parts: number; + is_exact_in: boolean; } -export const dexDistributionParser = (dexDistributionRaw: DexDistribution[]) : xdr.ScVal => { - +export const dexDistributionParser = (dexDistributionRaw: DexDistribution[]): xdr.ScVal => { const dexDistributionScVal = dexDistributionRaw.map((distribution) => { return xdr.ScVal.scvMap([ - new xdr.ScMapEntry({ - key: xdr.ScVal.scvSymbol('is_exact_in'), - val: xdr.ScVal.scvBool(distribution.is_exact_in), - }), + // new xdr.ScMapEntry({ + // key: xdr.ScVal.scvSymbol('is_exact_in'), + // val: xdr.ScVal.scvBool(distribution.is_exact_in), + // }), new xdr.ScMapEntry({ key: xdr.ScVal.scvSymbol('parts'), - val: nativeToScVal(distribution.parts, {type: "i128"}), + val: nativeToScVal(distribution.parts, { type: 'i128' }), }), new xdr.ScMapEntry({ key: xdr.ScVal.scvSymbol('path'), @@ -30,7 +29,8 @@ export const dexDistributionParser = (dexDistributionRaw: DexDistribution[]) : x ]); }); - return xdr.ScVal.scvVec(dexDistributionScVal) -} + return xdr.ScVal.scvVec(dexDistributionScVal); +}; -export const hasDistribution = (trade: any): trade is { distribution: DexDistribution[] } => trade && 'distribution' in trade; +export const hasDistribution = (trade: any): trade is { distribution: DexDistribution[] } => + trade && 'distribution' in trade; diff --git a/src/hooks/useAggregator.tsx b/src/hooks/useAggregator.tsx index 4edad8f5..0d6b10e0 100644 --- a/src/hooks/useAggregator.tsx +++ b/src/hooks/useAggregator.tsx @@ -16,13 +16,13 @@ export const useAggregator = () => { if (activeChain?.id == 'mainnet') { //TODO: Add mainnet aggregator address - setAddress('CD4NUEFTQU53SM7LPAQX5RHJOWOLOHRBM4HCNGA7UBQJ6MPIJNVGYEVL'); + setAddress('CA4VZX7N577XGPSKDG4RT24CZ6XGR37TM2652SO2AASERVUWP72N4UGZ'); setIsAggregatorEnabled(false && shouldUseAggregator); } else if (activeChain?.id == 'testnet') { - setAddress('CD4NUEFTQU53SM7LPAQX5RHJOWOLOHRBM4HCNGA7UBQJ6MPIJNVGYEVL'); + setAddress('CA4VZX7N577XGPSKDG4RT24CZ6XGR37TM2652SO2AASERVUWP72N4UGZ'); setIsAggregatorEnabled(true && shouldUseAggregator); } else { - setAddress('CD4NUEFTQU53SM7LPAQX5RHJOWOLOHRBM4HCNGA7UBQJ6MPIJNVGYEVL'); + setAddress('CA4VZX7N577XGPSKDG4RT24CZ6XGR37TM2652SO2AASERVUWP72N4UGZ'); setIsAggregatorEnabled(false && shouldUseAggregator); } }, [activeChain?.id, sorobanContext]); diff --git a/src/hooks/useAggregatorCallback.tsx b/src/hooks/useAggregatorCallback.tsx index c089a69e..75bd7837 100644 --- a/src/hooks/useAggregatorCallback.tsx +++ b/src/hooks/useAggregatorCallback.tsx @@ -9,6 +9,8 @@ export enum AggregatorMethod { SWAP = 'swap', GET_PROTOCOLS = 'get_protocols', IS_PROTOCOL_PAUSED = 'is_protocol_paused', + SWAP_EXACT_IN = 'swap_exact_tokens_for_tokens', + SWAP_EXACT_OUT = 'swap_tokens_for_exact_tokens', } // fn swap( diff --git a/src/hooks/useBestTrade.ts b/src/hooks/useBestTrade.ts index de5bce44..c9782c90 100644 --- a/src/hooks/useBestTrade.ts +++ b/src/hooks/useBestTrade.ts @@ -5,6 +5,7 @@ import { useEffect, useMemo, useState } from 'react'; import { TradeType as SdkTradeType } from 'soroswap-router-sdk'; import { InterfaceTrade, QuoteState, TradeState, TradeType } from 'state/routing/types'; import useSWR from 'swr'; +import { useAggregator } from './useAggregator'; const TRADE_NOT_FOUND = { state: TradeState.NO_ROUTE_FOUND, @@ -77,6 +78,8 @@ export function useBestTrade( const [inputAmount, setInputAmount] = useState(); const [outputAmount, setOutputAmount] = useState(); + const { isEnabled: isAggregatorEnabled } = useAggregator(); + useEffect(() => { if (!data || !currencyIn || !currencyOut) return; @@ -104,22 +107,41 @@ export function useBestTrade( const result = data.trade as { amountInMax: string; amountOut: string; + amountIn: string; + amountOutMin: string; path: string[]; }; - setInputAmount({ - value: result?.amountInMax, - currency: currencyIn, - }); - - setOutputAmount({ - value: result?.amountOut, - currency: currencyOut, - }); - - setExpectedAmount(result?.amountInMax); + if (isAggregatorEnabled) { + /*Work around for the aggregator as routeSplit only returns + amountIn and amountOutMin - we should fix this in the router-sdk + */ + + setInputAmount({ + value: result?.amountOutMin, + currency: currencyIn, + }); + setOutputAmount({ + value: result?.amountIn, + currency: currencyOut, + }); + + setExpectedAmount(result?.amountOutMin); + } else { + setInputAmount({ + value: result?.amountInMax, + currency: currencyIn, + }); + + setOutputAmount({ + value: result?.amountOut, + currency: currencyOut, + }); + + setExpectedAmount(result?.amountInMax); + } } - }, [data, currencyIn, currencyOut, tradeType]); + }, [data, currencyIn, currencyOut, tradeType, isAggregatorEnabled]); const trade: InterfaceTrade = useMemo(() => { const baseTrade = { diff --git a/src/hooks/useSwapCallback.tsx b/src/hooks/useSwapCallback.tsx index 4d89ed5e..a0e3da90 100644 --- a/src/hooks/useSwapCallback.tsx +++ b/src/hooks/useSwapCallback.tsx @@ -69,6 +69,11 @@ export const getSwapAmounts = ({ const routerMethod = tradeType == TradeType.EXACT_INPUT ? RouterMethod.SWAP_EXACT_IN : RouterMethod.SWAP_EXACT_OUT; + const aggregatorMethod = + tradeType == TradeType.EXACT_INPUT + ? AggregatorMethod.SWAP_EXACT_IN + : AggregatorMethod.SWAP_EXACT_OUT; + const factorLess = BigNumber(100).minus(allowedSlippage).dividedBy(100); const factorMore = BigNumber(100).plus(allowedSlippage).dividedBy(100); @@ -82,7 +87,7 @@ export const getSwapAmounts = ({ ? BigNumber(outputAmount).multipliedBy(factorLess).decimalPlaces(0) : BigNumber(inputAmount).multipliedBy(factorMore).decimalPlaces(0); - return { amount0, amount1, routerMethod }; + return { amount0, amount1, routerMethod, aggregatorMethod }; }; export type SuccessfullSwapResponse = StellarSdk.SorobanRpc.Api.GetSuccessfulTransactionResponse & @@ -113,7 +118,7 @@ export function useSwapCallback( if (!address || !activeChain) throw new Error('wallet must be connected to swap'); if (!trade.tradeType) throw new Error('tradeType must be defined'); - const { amount0, amount1, routerMethod } = getSwapAmounts({ + const { amount0, amount1, routerMethod, aggregatorMethod } = getSwapAmounts({ tradeType: trade.tradeType, inputAmount: trade.inputAmount?.value as string, outputAmount: trade.outputAmount?.value as string, @@ -128,22 +133,34 @@ export function useSwapCallback( console.log('USING AGGREGATOR'); if (!isUsingAggregator) throw Error('Non distribution'); const dexDistributionScValVec = dexDistributionParser(trade?.distribution); - console.log('🚀 « dexDistributionScValVec:', dexDistributionScValVec); + + console.log({ + aggparams: [ + trade.inputAmount?.currency?.contract, //token_in + trade.outputAmount?.currency?.contract, //token_out + amount0, // amount_in - amount_out + amount1, // amount_out_min - amount_in_max + trade?.distribution, // proxy_addresses: Vec, + address, //admin: Address, + getCurrentTimePlusOneHour(), //deadline + ], + }); const aggregatorSwapParams: StellarSdk.xdr.ScVal[] = [ - new StellarSdk.Address(trade.inputAmount?.currency.contract ?? '').toScVal(), //_from_token: Address, - new StellarSdk.Address(trade.outputAmount?.currency.contract ?? '').toScVal(), //_dest_token: Address, - amount0ScVal, - amount1ScVal, + new StellarSdk.Address(trade.inputAmount?.currency?.contract ?? '').toScVal(), //token_in + new StellarSdk.Address(trade.outputAmount?.currency?.contract ?? '').toScVal(), //token_out + amount0ScVal, // amount_in - amount_out + amount1ScVal, // amount_out_min - amount_in_max dexDistributionScValVec, // proxy_addresses: Vec, new StellarSdk.Address(address).toScVal(), //admin: Address, StellarSdk.nativeToScVal(getCurrentTimePlusOneHour()), //deadline ]; + console.log('🚀 « aggregatorSwapParams:', aggregatorSwapParams); try { const result = (await aggregatorCallback( - AggregatorMethod.SWAP, + aggregatorMethod, aggregatorSwapParams, !simulation, )) as StellarSdk.SorobanRpc.Api.GetTransactionResponse; @@ -168,6 +185,7 @@ export function useSwapCallback( return { ...result, switchValues }; } catch (error) { + console.log({ error }); if (error instanceof Error) { const parsedError = extractContractError(error.message); throw parsedError; diff --git a/src/services/pairs.ts b/src/services/pairs.ts index fa280f34..8b383f81 100644 --- a/src/services/pairs.ts +++ b/src/services/pairs.ts @@ -22,6 +22,7 @@ export const fetchAllSoroswapPairs = async (networkPassphrase: string) => { network: networkName, }, }); + return data; }; diff --git a/yarn.lock b/yarn.lock index 7a4dcfec..93ddd93d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1989,106 +1989,106 @@ resolved "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz#5981a8db18b56ba38ef0efb7d995b12aa7b51918" integrity sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ== -"@soroban-react/chains@9.1.12": - version "9.1.12" - resolved "https://registry.yarnpkg.com/@soroban-react/chains/-/chains-9.1.12.tgz#3dbe4206c84e13639f580c054e22ba49cde9158a" - integrity sha512-mnSf8noEGfv0EZN2M9lLZktjCheIZHqpbtCf2ewgOqX9KRew7K8DvfFSyHuXw4gDkduu4YoypJvr8NRtFKtP8Q== - dependencies: - "@soroban-react/types" "^9.1.12" - "@stellar/stellar-sdk" "11.3.0" - -"@soroban-react/connect-button@9.1.12", "@soroban-react/connect-button@^9.1.12": - version "9.1.12" - resolved "https://registry.yarnpkg.com/@soroban-react/connect-button/-/connect-button-9.1.12.tgz#6062fe13a5435d9a5918903ff1709dd7b86c22eb" - integrity sha512-bNq5yVEkA4W70jz9HzZn0k8Uv6qKGKEnEbyRYXYwwrB6SXmpbX/q8qMjttMkskaUmbtkPUnpeAA8NQIpgFlDwQ== - dependencies: - "@soroban-react/core" "^9.1.12" - -"@soroban-react/contracts@9.1.12": - version "9.1.12" - resolved "https://registry.yarnpkg.com/@soroban-react/contracts/-/contracts-9.1.12.tgz#5ac2414c51ec969c7c6fade735f6a014373347a5" - integrity sha512-zMo7vHWPNUwg876Tj5gnYSvyC4UXSgCC6keognnqek5Q44lbR+1+PS1B3VEOiTAX2LeAihDcAE2+tJoliPAgeg== - dependencies: - "@soroban-react/core" "^9.1.12" - "@stellar/stellar-sdk" "11.3.0" - -"@soroban-react/core@9.1.12", "@soroban-react/core@^9.1.12": - version "9.1.12" - resolved "https://registry.yarnpkg.com/@soroban-react/core/-/core-9.1.12.tgz#59857fde99f524daa58c28a0fe6ed20d1de50cd5" - integrity sha512-V4oxhlcw+JtOQOUkLwvtZikkHbx3Enxlpwy8MQbvlB2K+82PNVJdFDH/9SsZOmC5T/UJ0Dc/7JCtbHJR/r8y+A== - dependencies: - "@soroban-react/freighter" "^9.1.12" - "@soroban-react/lobstr" "^9.1.12" - "@soroban-react/types" "^9.1.12" - "@soroban-react/xbull" "^9.1.12" - "@stellar/stellar-sdk" "11.3.0" - -"@soroban-react/events@9.1.12": - version "9.1.12" - resolved "https://registry.yarnpkg.com/@soroban-react/events/-/events-9.1.12.tgz#a8f65f4547f4fab737b80f5f2c40ed2bbf4397ff" - integrity sha512-22PcxhtwqozxM8wCOyxx3WVKbat/ltL4KOvuIbvL9MlR0/NNkTufzSh0G0qr8ZndSo4TqNmkMeFPmPfHC1NHgQ== - dependencies: - "@soroban-react/core" "^9.1.12" - "@soroban-react/types" "^9.1.12" +"@soroban-react/chains@9.1.13": + version "9.1.13" + resolved "https://registry.yarnpkg.com/@soroban-react/chains/-/chains-9.1.13.tgz#a8eff25c0784636cf225ef1a99d3d6f22a7176f1" + integrity sha512-59TdwMjwk9h8o5WskfJzBvDLgeWcz1TJS22u8bsRANTsRPwt/+tdlBZsMEBzaZKXwmH5f5oPF0lxh0dvn0UyHw== + dependencies: + "@soroban-react/types" "^9.1.13" + "@stellar/stellar-sdk" "12.2.0" + +"@soroban-react/connect-button@9.1.13", "@soroban-react/connect-button@^9.1.13": + version "9.1.13" + resolved "https://registry.yarnpkg.com/@soroban-react/connect-button/-/connect-button-9.1.13.tgz#68eff5db3fee1d10ffd25daf109065ed70cde1fb" + integrity sha512-TMMb5DpqRysBdHVcNXL3BS9Badeu6ogD2LfdOx54ghVVtKVAU9Pd+mGaJcfk3fAz6MkQdJvQu/gPJo4CUDqxAg== + dependencies: + "@soroban-react/core" "^9.1.13" + +"@soroban-react/contracts@9.1.13": + version "9.1.13" + resolved "https://registry.yarnpkg.com/@soroban-react/contracts/-/contracts-9.1.13.tgz#e50e8e1a03305fbba1c4e74345f521db7c48a53f" + integrity sha512-DqV6Ky71o54+nofiPv076RktfX2/KP/LW/d7YjfXegR0bt4yCyTTlwsry7CoH/PRLq4TbCoUWTEnfgJhJAFYPw== + dependencies: + "@soroban-react/core" "^9.1.13" + "@stellar/stellar-sdk" "12.2.0" + +"@soroban-react/core@9.1.13", "@soroban-react/core@^9.1.13": + version "9.1.13" + resolved "https://registry.yarnpkg.com/@soroban-react/core/-/core-9.1.13.tgz#65122c3cd5793720d5e1341b19f96f5a541e4549" + integrity sha512-GGx0X6tXs+OF9oTuyfLLXuD71O6OphMW/8AtYiUpA+Ltxs6DBJmBvG1AdlQVFNh9IiJ2OxSrGRZFpKVOuF3q4g== + dependencies: + "@soroban-react/freighter" "^9.1.13" + "@soroban-react/lobstr" "^9.1.13" + "@soroban-react/types" "^9.1.13" + "@soroban-react/xbull" "^9.1.13" + "@stellar/stellar-sdk" "12.2.0" + +"@soroban-react/events@9.1.13": + version "9.1.13" + resolved "https://registry.yarnpkg.com/@soroban-react/events/-/events-9.1.13.tgz#29d783c4d8bc5b67331ac36ca3899256c9834aa1" + integrity sha512-uzf/J+BDDY1xn/XOTxUT0lJfWuyx6tbxJfHyoFgTyldVpXpK5sa0ThVbRdT48XBif9/eRxeJc1/+kf+xe75XIA== + dependencies: + "@soroban-react/core" "^9.1.13" + "@soroban-react/types" "^9.1.13" soroban-client "1.0.0-beta.4" -"@soroban-react/freighter@9.1.12", "@soroban-react/freighter@^9.1.12": - version "9.1.12" - resolved "https://registry.yarnpkg.com/@soroban-react/freighter/-/freighter-9.1.12.tgz#6178e5b8f882767efd232769903709b5847e8c52" - integrity sha512-RJEWG2hZHidPSBn+nXxGBIfSYdT7pfThUOUnUWIiIFyfpCSi9YLN1Eo1/wQN7Vl87QNxcqdB2CipiO2i4DrJzA== +"@soroban-react/freighter@9.1.13", "@soroban-react/freighter@^9.1.13": + version "9.1.13" + resolved "https://registry.yarnpkg.com/@soroban-react/freighter/-/freighter-9.1.13.tgz#dabebd2e3cb7c62effc282c4354d3e1568bff295" + integrity sha512-a2ZOwYCARRYW/oO5YXGgLXyDhLkkY+fKxlqZ3MxvDIK8XRKVyacd7Rx1r02ZR5CsFe8BMlycZTfenDGPuo3nsQ== dependencies: - "@soroban-react/types" "^9.1.12" + "@soroban-react/types" "^9.1.13" "@stellar/freighter-api" "1.7.1" -"@soroban-react/hana@9.1.12": - version "9.1.12" - resolved "https://registry.yarnpkg.com/@soroban-react/hana/-/hana-9.1.12.tgz#125572f222042bbc0e35183f27dffbf60d7c52f3" - integrity sha512-vcxXlyTOUZ88auM6ssNs55BVYQynr0qULnsf7RGPppc1Le5Oy5EX1fUZQ1DrKaGafx+7EN28+lEDR6SmrNJFhg== +"@soroban-react/hana@9.1.13": + version "9.1.13" + resolved "https://registry.yarnpkg.com/@soroban-react/hana/-/hana-9.1.13.tgz#87944d17f5f54c330c41a20322a9f2345eec22c8" + integrity sha512-zEOdr01LbbTgGbsi5+G0QnonG9SScMYCjbrCkIgdHK19YB6NklvDuAaiPWesp/CaTy+6ESYYgR0vALVShfwTeg== dependencies: - "@soroban-react/types" "^9.1.12" + "@soroban-react/types" "^9.1.13" -"@soroban-react/lobstr@9.1.12", "@soroban-react/lobstr@^9.1.12": - version "9.1.12" - resolved "https://registry.yarnpkg.com/@soroban-react/lobstr/-/lobstr-9.1.12.tgz#348a84c561f655707baeed56410e0e87809a7b4b" - integrity sha512-oZy7K7jHlP7OctD2TlYe/WN1yHQD7552TF1lpq9sw+xKSs+wZr4NQoQHZIWQQeG3SmEhMQoj7Ko6YPyj3aWgEQ== +"@soroban-react/lobstr@9.1.13", "@soroban-react/lobstr@^9.1.13": + version "9.1.13" + resolved "https://registry.yarnpkg.com/@soroban-react/lobstr/-/lobstr-9.1.13.tgz#6616b8ab5acf879269e78b4cfe82cf5bdcc4b5c8" + integrity sha512-jItEGMWmhPgGOzUr3zZ2vJHTkGr4wsyptjWJakE6mJj3Z5J+CEqq/+681Td4eQTmPM2p57wqm5YUDibx04Q43A== dependencies: "@lobstrco/signer-extension-api" "^1.0.0-beta.0" - "@soroban-react/types" "^9.1.12" - "@stellar/stellar-sdk" "11.3.0" + "@soroban-react/types" "^9.1.13" + "@stellar/stellar-sdk" "12.2.0" -"@soroban-react/types@9.1.12", "@soroban-react/types@^9.1.12": - version "9.1.12" - resolved "https://registry.yarnpkg.com/@soroban-react/types/-/types-9.1.12.tgz#5adbf53bff81458d2f100c342afa027b42e03f88" - integrity sha512-SbNC5nUZ//lh6vt+j69zoLCogO1HJFWeXTgBj8WxuiqF1wkcOG/heyHsc6Zh6IL/BR8HpZwoIFLMusU5dtnhuQ== +"@soroban-react/types@9.1.13", "@soroban-react/types@^9.1.13": + version "9.1.13" + resolved "https://registry.yarnpkg.com/@soroban-react/types/-/types-9.1.13.tgz#4ad673ecaf977df3e74d38a87ab061069db275fd" + integrity sha512-iba0pzMwGRh216uLGjIsTAwEolJi5qoFXdnZo/0EWY4TvVATMSSs+WrAKccHMgGXntYJJXpUa0xtIbchQ6yiHA== dependencies: - "@stellar/stellar-sdk" "11.3.0" + "@stellar/stellar-sdk" "12.2.0" -"@soroban-react/utils@9.1.12": - version "9.1.12" - resolved "https://registry.yarnpkg.com/@soroban-react/utils/-/utils-9.1.12.tgz#57b64a0b973991289c4ee8b005d701bd538362f9" - integrity sha512-+OId03H2J2pW8aVWEcaPmkzMgLimtPwAf7tCLl55Yi+3/pvHY/Czb1q3HFp0MsfchPhX5CfTPbjc8D98INE7Kg== +"@soroban-react/utils@9.1.13": + version "9.1.13" + resolved "https://registry.yarnpkg.com/@soroban-react/utils/-/utils-9.1.13.tgz#f8ff9ad9cc76778edb5bfad28fa0b5730a50581a" + integrity sha512-3HHCN/CXnnSTWBb2XOJaM2rDMiVogLWNt27X2GvPPJSv+VvC/00FJfveG/C0HtmvhlrqfMMY+DJZdqQSKjECwQ== dependencies: - "@stellar/stellar-sdk" "11.3.0" + "@stellar/stellar-sdk" "12.2.0" bignumber.js "^9.1.1" -"@soroban-react/wallet-data@9.1.12": - version "9.1.12" - resolved "https://registry.yarnpkg.com/@soroban-react/wallet-data/-/wallet-data-9.1.12.tgz#f13ec48b9d8c4b9a2868787d2ec6f5cecea95b81" - integrity sha512-u4JUn6Fy2zsY0fd+0hj07/Mf44TD8N5UdKVuo4qs/Fmwsu7LF6ikHDZxIPi7A3DWZXo+3PIh8O1bUQo/WPh42Q== +"@soroban-react/wallet-data@9.1.13": + version "9.1.13" + resolved "https://registry.yarnpkg.com/@soroban-react/wallet-data/-/wallet-data-9.1.13.tgz#954c20f3f73b62b6f565e922e4eb0ed1a1a03e8e" + integrity sha512-F5Mg9pGIdjZq6NH6Y+oZ1x+r4gW18ybziDZJEVm1la3tB3lXF2jm9LcJV346Lk97xFR/cHrNcrC7YFLkL1Jbnw== dependencies: - "@soroban-react/connect-button" "^9.1.12" - "@soroban-react/core" "^9.1.12" - "@soroban-react/types" "^9.1.12" - "@stellar/stellar-sdk" "11.3.0" + "@soroban-react/connect-button" "^9.1.13" + "@soroban-react/core" "^9.1.13" + "@soroban-react/types" "^9.1.13" + "@stellar/stellar-sdk" "12.2.0" -"@soroban-react/xbull@9.1.12", "@soroban-react/xbull@^9.1.12": - version "9.1.12" - resolved "https://registry.yarnpkg.com/@soroban-react/xbull/-/xbull-9.1.12.tgz#3a2437cc9aeeb400ce6deecf0412f74c5037ee39" - integrity sha512-LgHkuzBOm0IjdvkJ9d16pFolpJAXQs6ItEVpXDlPltWmlLmsMGeYH7EaljZ8KJxUcF5XSlW2uy8ZEF7aGovpwg== +"@soroban-react/xbull@9.1.13", "@soroban-react/xbull@^9.1.13": + version "9.1.13" + resolved "https://registry.yarnpkg.com/@soroban-react/xbull/-/xbull-9.1.13.tgz#01d64e6fc7b94f07650fc75be6aeb8c3bcf5159b" + integrity sha512-tYsVg39LYytVBSXvXKECz+O3GjvZM/NTz3R52SwaohRjT6DAoEuGnbdHw01CyGn6FQIt2UkydGxrI5AQZ+lHwQ== dependencies: "@creit-tech/xbull-wallet-connect" "github:Creit-Tech/xBull-Wallet-Connect" - "@soroban-react/types" "^9.1.12" - "@stellar/stellar-sdk" "11.3.0" + "@soroban-react/types" "^9.1.13" + "@stellar/stellar-sdk" "12.2.0" "@stellar/freighter-api@1.7.1": version "1.7.1" @@ -2100,6 +2100,11 @@ resolved "https://registry.yarnpkg.com/@stellar/js-xdr/-/js-xdr-3.1.1.tgz#be0ff90c8a861d6e1101bca130fa20e74d5599bb" integrity sha512-3gnPjAz78htgqsNEDkEsKHKosV2BF2iZkoHCNxpmZwUxiPsw+2VaXMed8RRMe0rGk3d5GZe7RrSba8zV80J3Ag== +"@stellar/js-xdr@^3.1.2": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@stellar/js-xdr/-/js-xdr-3.1.2.tgz#db7611135cf21e989602fd72f513c3bed621bc74" + integrity sha512-VVolPL5goVEIsvuGqDc5uiKxV03lzfWdvYg1KikvwheDmTBO68CKDji3bAZ/kppZrx5iTA8z3Ld5yuytcvhvOQ== + "@stellar/stellar-base@^11.0.1": version "11.1.0" resolved "https://registry.yarnpkg.com/@stellar/stellar-base/-/stellar-base-11.1.0.tgz#4b561776cb102a87828379cd1ac5d3ce96db4fb3" @@ -2114,7 +2119,34 @@ optionalDependencies: sodium-native "^4.1.1" -"@stellar/stellar-sdk@11.3.0", "@stellar/stellar-sdk@^11.3.0": +"@stellar/stellar-base@^12.1.0": + version "12.1.0" + resolved "https://registry.yarnpkg.com/@stellar/stellar-base/-/stellar-base-12.1.0.tgz#45b55a38738ed267e0d55a1fee3c4153c82d0fa6" + integrity sha512-pWwn+XWP5NotmIteZNuJzHeNn9DYSqH3lsYbtFUoSYy1QegzZdi9D8dK6fJ2fpBAnf/rcDjHgHOw3gtHaQFVbg== + dependencies: + "@stellar/js-xdr" "^3.1.2" + base32.js "^0.1.0" + bignumber.js "^9.1.2" + buffer "^6.0.3" + sha.js "^2.3.6" + tweetnacl "^1.0.3" + optionalDependencies: + sodium-native "^4.1.1" + +"@stellar/stellar-sdk@12.2.0": + version "12.2.0" + resolved "https://registry.yarnpkg.com/@stellar/stellar-sdk/-/stellar-sdk-12.2.0.tgz#c449bc52be282c7706aabbd257acbc5aec3345b3" + integrity sha512-Wy5sDOqb5JvAC76f4sQIV6Pe3JNyZb0PuyVNjwt3/uWsjtxRkFk6s2yTHTefBLWoR+mKxDjO7QfzhycF1v8FXQ== + dependencies: + "@stellar/stellar-base" "^12.1.0" + axios "^1.7.2" + bignumber.js "^9.1.2" + eventsource "^2.0.2" + randombytes "^2.1.0" + toml "^3.0.0" + urijs "^1.19.1" + +"@stellar/stellar-sdk@^11.3.0": version "11.3.0" resolved "https://registry.yarnpkg.com/@stellar/stellar-sdk/-/stellar-sdk-11.3.0.tgz#7cb010651846a07e1853e0fe30e430ece4da340b" integrity sha512-i+heopibJNRA7iM8rEPz0AXphBPYvy2HDo8rxbDwWpozwCfw8kglP9cLkkhgJe8YicgLrdExz/iQZaLpqLC+6w== @@ -2980,7 +3012,7 @@ axe-core@^4.9.1: resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.9.1.tgz#fcd0f4496dad09e0c899b44f6c4bb7848da912ae" integrity sha512-QbUdXJVTpvUTHU7871ppZkdOLBeGUKBQWHkHrvN2V9IQWGMt61zf3B45BtzjxEJzYuj0JBjBZP/hmYS/R9pmAw== -axios@^1.6.0, axios@^1.6.2, axios@^1.6.5, axios@^1.6.8: +axios@^1.6.0, axios@^1.6.2, axios@^1.6.5, axios@^1.6.8, axios@^1.7.2: version "1.7.2" resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.2.tgz#b625db8a7051fbea61c35a3cbb3a1daa7b9c7621" integrity sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw== @@ -7925,7 +7957,16 @@ strict-event-emitter@^0.5.1: resolved "https://registry.yarnpkg.com/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz#1602ece81c51574ca39c6815e09f1a3e8550bd93" integrity sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ== -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -8005,7 +8046,14 @@ string.prototype.trimstart@^1.0.8: define-properties "^1.2.1" es-object-atoms "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -8698,7 +8746,7 @@ word-wrap@^1.2.5: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -8716,6 +8764,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"