From 6279a68a9d6f92280a414938f8f6c402c014b67b Mon Sep 17 00:00:00 2001 From: Michael Liu Date: Tue, 7 Jan 2025 18:37:28 -0500 Subject: [PATCH] Add withdrawable yield balance check solana function --- packages/examples/package.json | 1 + .../src/solana/checkWithdrawableYield.ts | 43 +++++ .../huma-sdk/src/graphql/generatedTypes.ts | 1 - .../helpers/solana/HumaSolanaProgramHelper.ts | 111 +++++++++++ .../solana/utils/tokenAssetsSharesUtils.ts | 12 ++ yarn.lock | 176 +++++++++--------- 6 files changed, 255 insertions(+), 89 deletions(-) create mode 100644 packages/examples/src/solana/checkWithdrawableYield.ts diff --git a/packages/examples/package.json b/packages/examples/package.json index 3e524037..ca5b8993 100644 --- a/packages/examples/package.json +++ b/packages/examples/package.json @@ -27,6 +27,7 @@ "solanaFetchReceivable": "ts-node src/solana/fetchReceivable.ts", "solanaFetchAvailableCredit": "ts-node src/solana/fetchAvailableCredit.ts", "solanaFetchBorrowerDetails": "ts-node src/solana/fetchBorrowerDetails.ts", + "solanaCheckWithdrawableYield": "ts-node src/solana/checkWithdrawableYield.ts", "solanaDrawdown": "ts-node src/solana/drawdown.ts", "solanaWithdrawYield": "ts-node src/solana/withdrawYield.ts", "solanaPayback": "ts-node src/solana/payback.ts", diff --git a/packages/examples/src/solana/checkWithdrawableYield.ts b/packages/examples/src/solana/checkWithdrawableYield.ts new file mode 100644 index 00000000..383cbc3b --- /dev/null +++ b/packages/examples/src/solana/checkWithdrawableYield.ts @@ -0,0 +1,43 @@ +import { Connection, Keypair, PublicKey } from '@solana/web3.js' +import { + AnchorProvider, + BN, + setProvider, + Wallet, + web3, +} from '@coral-xyz/anchor' +import { POOL_NAME, SolanaChainEnum } from '@huma-finance/shared' +import { HumaSolanaContext, HumaSolanaProgramHelper } from '@huma-finance/sdk' + +require('dotenv').config() + +async function main() { + const TEST_PRIVATE_KEY = process.env.TEST_PRIVATE_KEY + const connection = new Connection( + 'https://api.mainnet-beta.solana.com', + 'confirmed', + ) + + const keypair = web3.Keypair.fromSecretKey( + Buffer.from(JSON.parse(TEST_PRIVATE_KEY)), + ) + const wallet = new Wallet(keypair) + setProvider(new AnchorProvider(connection, wallet)) + + const solanaHumaContext = new HumaSolanaContext({ + publicKey: new PublicKey('C8E8YuXRzdiswUxbyh8aampqBz9pmEscw57S5JM99Li8'), + connection: connection, + chainId: SolanaChainEnum.SolanaMainnet, + poolName: POOL_NAME.ArfCreditPool6Months, + }) + + const humaSolanaProgramHelper = new HumaSolanaProgramHelper({ + solanaContext: solanaHumaContext, + }) + + const data = await humaSolanaProgramHelper.getWithdrawableYields() + + console.log(data) +} + +main() diff --git a/packages/huma-sdk/src/graphql/generatedTypes.ts b/packages/huma-sdk/src/graphql/generatedTypes.ts index 1b6dd4f2..e6aabd5a 100644 --- a/packages/huma-sdk/src/graphql/generatedTypes.ts +++ b/packages/huma-sdk/src/graphql/generatedTypes.ts @@ -1,5 +1,4 @@ import { GraphQLClient } from 'graphql-request' -import * as Dom from 'graphql-request/dist/types.dom' import gql from 'graphql-tag' export type Maybe = T | null diff --git a/packages/huma-sdk/src/helpers/solana/HumaSolanaProgramHelper.ts b/packages/huma-sdk/src/helpers/solana/HumaSolanaProgramHelper.ts index 7151c141..0f79d03f 100644 --- a/packages/huma-sdk/src/helpers/solana/HumaSolanaProgramHelper.ts +++ b/packages/huma-sdk/src/helpers/solana/HumaSolanaProgramHelper.ts @@ -1,16 +1,20 @@ import { BN, utils } from '@coral-xyz/anchor' import { + convertToAssets, getCreditAccounts, getHumaProgram, getSentinelAddress, getSolanaPoolInfo, getTokenAccounts, SolanaTokenUtils, + TrancheType, } from '@huma-finance/shared' import { createApproveCheckedInstruction, createAssociatedTokenAccountInstruction, getAccount, + getAssociatedTokenAddress, + getMint, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, TokenAccountNotFoundError, @@ -23,6 +27,8 @@ import { HumaSolanaContext } from './HumaSolanaContext' export const MPL_CORE_PROGRAM_ID = 'CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d' +const DEFAULT_DECIMALS_FACTOR = BigInt('1000000000000000000') + export class HumaSolanaProgramHelper { #solanaContext: HumaSolanaContext @@ -128,6 +134,111 @@ export class HumaSolanaProgramHelper { return tx } + async getWithdrawableYieldOfTranche( + trancheMint: PublicKey, + trancheType: TrancheType, + trancheAssets: BN[], + ): Promise { + const { connection, chainId, poolName, publicKey } = this.#solanaContext + const program = getHumaProgram(chainId, connection) + const poolInfo = getSolanaPoolInfo(chainId, poolName) + + if (!poolInfo) { + throw new Error(`Could not find pool ${poolName}`) + } + + const mintAccount = await getMint( + connection, + trancheMint, + undefined, + TOKEN_2022_PROGRAM_ID, + ) + const trancheATA = await getAssociatedTokenAddress( + trancheMint, + publicKey, + true, // allowOwnerOffCurve + TOKEN_2022_PROGRAM_ID, + ) + let trancheTokenAccount + try { + trancheTokenAccount = await getAccount( + connection, + trancheATA, + undefined, // commitment + TOKEN_2022_PROGRAM_ID, + ) + } catch (error) { + console.log( + `Couldn't find token account for ${trancheATA.toString()} tranche ${trancheType}`, + ) + return BigInt(0) + } + + const [lenderStatePDA] = PublicKey.findProgramAddressSync( + [ + Buffer.from('lender_state'), + trancheMint.toBuffer(), + publicKey.toBuffer(), + ], + program.programId, + ) + const lenderState = await program.account.lenderState.fetchNullable( + lenderStatePDA, + ) + + if (!lenderState) { + return BigInt(0) + } + + // Scale numbers using `DEFAULT_DECIMALS_FACTOR` to reduce precision loss caused by + // integer division. + const priceWithDecimals = convertToAssets( + BigInt(trancheAssets[trancheType === 'junior' ? 0 : 1].toString()), + mintAccount.supply, + DEFAULT_DECIMALS_FACTOR, + ) + const assetsWithDecimals = + priceWithDecimals * BigInt(trancheTokenAccount.amount.toString()) + const principalWithDecimals = + BigInt(lenderState.depositRecord.principal.toString()) * + DEFAULT_DECIMALS_FACTOR + const yieldsWithDecimals = assetsWithDecimals - principalWithDecimals + return yieldsWithDecimals / DEFAULT_DECIMALS_FACTOR + } + + // Returns the withdrawable yields for the lender for the junior and senior tranche, if applicable + async getWithdrawableYields(): Promise<[bigint, bigint]> { + const { connection, chainId, poolName } = this.#solanaContext + const program = getHumaProgram(chainId, connection) + const poolInfo = getSolanaPoolInfo(chainId, poolName) + + if (!poolInfo) { + throw new Error('Could not find pool') + } + + const poolStateAccountResult = await program.account.poolState.fetch( + new PublicKey(poolInfo.poolState), + ) + + const juniorYield = await this.getWithdrawableYieldOfTranche( + new PublicKey(poolInfo.juniorTrancheMint), + 'junior', + poolStateAccountResult.trancheAssets.assets, + ) + + if (!poolInfo.seniorTrancheMint) { + return [juniorYield, BigInt(0)] + } + + const seniorYield = await this.getWithdrawableYieldOfTranche( + new PublicKey(poolInfo.seniorTrancheMint), + 'senior', + poolStateAccountResult.trancheAssets.assets, + ) + + return [juniorYield, seniorYield] + } + async buildWithdrawYieldsTransaction(): Promise { const { publicKey, connection, chainId, poolName } = this.#solanaContext const program = getHumaProgram(chainId, connection) diff --git a/packages/huma-shared/src/solana/utils/tokenAssetsSharesUtils.ts b/packages/huma-shared/src/solana/utils/tokenAssetsSharesUtils.ts index 5e642f4f..760660d0 100644 --- a/packages/huma-shared/src/solana/utils/tokenAssetsSharesUtils.ts +++ b/packages/huma-shared/src/solana/utils/tokenAssetsSharesUtils.ts @@ -12,3 +12,15 @@ export function convertToShares( return (assets * totalSupply) / totalAssets } + +export function convertToAssets( + totalAssets: bigint, + totalSupply: bigint, + shares: bigint, +): bigint { + if (totalSupply === BigInt(0)) { + return shares + } + + return (shares * totalAssets) / totalSupply +} diff --git a/yarn.lock b/yarn.lock index 9439ad4f..2bf876b8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2929,96 +2929,96 @@ resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.2.0.tgz#5f3d96ec6b2354ad6d8a28bf216a1d97b5426861" integrity sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ== -"@huma-finance/soroban-credit-manager@^0.0.15": - version "0.0.15" - resolved "https://registry.yarnpkg.com/@huma-finance/soroban-credit-manager/-/soroban-credit-manager-0.0.15.tgz#5bc515bd24bf1184fb6483e95e8e9977c02f3eb9" - integrity sha512-OH7AxpJK/coZqsUux2CKuLjmVqNWWxVj8k50YiepQ9EL1yno/k7JRp/S5JoPeTmu55NqO3/FNfDmQCD1N9UiEg== +"@huma-finance/soroban-credit-manager@^0.0.18": + version "0.0.18" + resolved "https://registry.yarnpkg.com/@huma-finance/soroban-credit-manager/-/soroban-credit-manager-0.0.18.tgz#e38bf0d8c647feb5f5c4691c47b1936c7c1f3952" + integrity sha512-fjujwb9O0ryFjwuuKYaxCosW9rhG4CsJ0lNyB540yJZezTa31elHPV1Tjt0yp6cWUt176K848VhvYEs/y9ulFQ== dependencies: - "@stellar/stellar-sdk" "^12.1.0" + "@stellar/stellar-sdk" "13.0.0" buffer "6.0.3" -"@huma-finance/soroban-credit-storage@0.0.15", "@huma-finance/soroban-credit-storage@^0.0.15": - version "0.0.15" - resolved "https://registry.yarnpkg.com/@huma-finance/soroban-credit-storage/-/soroban-credit-storage-0.0.15.tgz#2d836b486578637949a71bac53bfb59f7cc4ac6a" - integrity sha512-hoRhKA5nR0Qtc9vqH0mMKV9D/BYirzvAxiZzPAc3nelvHbRw5eLwNcBLDKZKRCk0HPXUrPH/MVMXdq5uRwHd5w== +"@huma-finance/soroban-credit-storage@0.0.18", "@huma-finance/soroban-credit-storage@^0.0.18": + version "0.0.18" + resolved "https://registry.yarnpkg.com/@huma-finance/soroban-credit-storage/-/soroban-credit-storage-0.0.18.tgz#71d28c1800a4790db85bb197f2237361de97295d" + integrity sha512-xbsmloDE82ZDPp52frIwkv7vWD8HgBTwU6YNY0fqtpPkgJPwAa3xJX5GyYWXhL/QNu6D6k2i+jqJblZ633CRLg== dependencies: - "@stellar/stellar-sdk" "12.1.0" + "@stellar/stellar-sdk" "13.0.0" buffer "6.0.3" -"@huma-finance/soroban-huma-config@0.0.15", "@huma-finance/soroban-huma-config@^0.0.15": - version "0.0.15" - resolved "https://registry.yarnpkg.com/@huma-finance/soroban-huma-config/-/soroban-huma-config-0.0.15.tgz#640507220374145a83969e1c6702b297fb1ddfae" - integrity sha512-YC+G14P/UgEkG1/yPex1IMRcyO9BUAQ6tyno37DpzimLXcDl5+BR2mSMvfG5gaTjnZ7lRHL0a+Kf/6vsFaOuIQ== +"@huma-finance/soroban-huma-config@0.0.18", "@huma-finance/soroban-huma-config@^0.0.18": + version "0.0.18" + resolved "https://registry.yarnpkg.com/@huma-finance/soroban-huma-config/-/soroban-huma-config-0.0.18.tgz#7614724c3269ef57197ddda44ac16c984fff67d2" + integrity sha512-w8p3J1cEb5stfemCq0GgkBOn+fyO/VNzWl4tMbz5w1Zqr0YphqsoY0ovFZrkLwBvQcAET6lgxXg2bYIf9nOSiw== dependencies: - "@stellar/stellar-sdk" "12.1.0" + "@stellar/stellar-sdk" "13.0.0" buffer "6.0.3" -"@huma-finance/soroban-pool-credit@^0.0.15": - version "0.0.15" - resolved "https://registry.yarnpkg.com/@huma-finance/soroban-pool-credit/-/soroban-pool-credit-0.0.15.tgz#4368dfc0e52d408ac638cfef45473cc6e51861bf" - integrity sha512-iH7IKi+KnZYeIVavaktffwc3zahXRqCc0zXLwhpHwLp2yEomGIm3NnL6pMtPFRMX28afHTyMkxhuRkEfKby3Jg== +"@huma-finance/soroban-pool-credit@^0.0.18": + version "0.0.18" + resolved "https://registry.yarnpkg.com/@huma-finance/soroban-pool-credit/-/soroban-pool-credit-0.0.18.tgz#11b456378f9cce552fd7afdc81df7ae39921def3" + integrity sha512-pVpC7yR0GDdTSCLvvx7To7tLdeVgddSs/FYm2MVFXnkqGTx6A7S9wT5Zl2CuvtXmmbvHHqTOqfduKsEaCfqSMA== dependencies: - "@stellar/stellar-sdk" "12.1.0" + "@stellar/stellar-sdk" "13.0.0" buffer "6.0.3" -"@huma-finance/soroban-pool-manager@^0.0.15": - version "0.0.15" - resolved "https://registry.yarnpkg.com/@huma-finance/soroban-pool-manager/-/soroban-pool-manager-0.0.15.tgz#5cb6ab61dcff54e6d46af667368fcfabf221441e" - integrity sha512-2QYWZOyUlg2wR7HE17EgnlIj+GqVDl3O3KVkBo5yH2HbtbRZI2BBlwuznGPtgct0tOuVqofxeZXXZOXfQYNqaQ== +"@huma-finance/soroban-pool-manager@^0.0.18": + version "0.0.18" + resolved "https://registry.yarnpkg.com/@huma-finance/soroban-pool-manager/-/soroban-pool-manager-0.0.18.tgz#45e565e67e36a427203799c0fd2ac024903cc4c9" + integrity sha512-0cJ2AL7HwsWsx9NchFfUADSa6Bp1TcKSvMqRm/Xas2GWXydhzoyBxH3UJlmSjh86e5ajAC0DY3DyHSYyi7TKcA== dependencies: - "@stellar/stellar-sdk" "12.1.0" + "@stellar/stellar-sdk" "13.0.0" buffer "6.0.3" -"@huma-finance/soroban-pool-storage@0.0.15", "@huma-finance/soroban-pool-storage@^0.0.15": - version "0.0.15" - resolved "https://registry.yarnpkg.com/@huma-finance/soroban-pool-storage/-/soroban-pool-storage-0.0.15.tgz#fa2470397029e51ad48c03f94bac073ae6927ec6" - integrity sha512-GsdnRwmlSq7wByr5HGOzlYOG6s6F64mIzmOLhEhfrNWXEUJwbOTk9RU1kSgV0eXvwDVFcnVZB5TJRbwQk11YeA== +"@huma-finance/soroban-pool-storage@0.0.18", "@huma-finance/soroban-pool-storage@^0.0.18": + version "0.0.18" + resolved "https://registry.yarnpkg.com/@huma-finance/soroban-pool-storage/-/soroban-pool-storage-0.0.18.tgz#612f7fce2cf6407e4205275d79fb9319942a98f4" + integrity sha512-hogDT5K4tl9DmhztFywdRTLkC67S8vzzAauSZUn8dEAB+vYhxiQHbdB9U0nSp6NOwSP38Bh7oAy0NXDx9ozdUA== dependencies: - "@stellar/stellar-sdk" "12.1.0" + "@stellar/stellar-sdk" "13.0.0" buffer "6.0.3" -"@huma-finance/soroban-pool@^0.0.15": - version "0.0.15" - resolved "https://registry.yarnpkg.com/@huma-finance/soroban-pool/-/soroban-pool-0.0.15.tgz#82006be938fbc4258664348eb2f9c11845a630f0" - integrity sha512-mxTjRMXNJzGNbCKWCX3swgvQOh3bZQTEExwkb/504SS0BTA6ketYCWaZWhQPFwhkxF9aoH0ruhRynn9ZAMPUmA== +"@huma-finance/soroban-pool@^0.0.18": + version "0.0.18" + resolved "https://registry.yarnpkg.com/@huma-finance/soroban-pool/-/soroban-pool-0.0.18.tgz#3cb8bdc3c8c8a88ae48d8e19df3896bd0b481d12" + integrity sha512-wELbzPUYIR8Tg3AzwnQ/nteze9QCIYeSyyF0/9H/B+jv9xtX2ao5PtI/O99bzlfwVcVi6VjEWcA7FLzkhhoOtA== dependencies: - "@stellar/stellar-sdk" "12.1.0" + "@stellar/stellar-sdk" "13.0.0" buffer "6.0.3" -"@huma-finance/soroban-sdk@^0.0.15": - version "0.0.15" - resolved "https://registry.yarnpkg.com/@huma-finance/soroban-sdk/-/soroban-sdk-0.0.15.tgz#e6fb11ae9de2d856ae39ff88bc3f855c639156b2" - integrity sha512-x9YaXVfM8asFDt4SBQNzx2DteCX7uZBghY7P1NFZ7MSv89JIYaZYhAGh3BHPdFeW8MdjhIbvxrFJxKm3kaPbjw== - dependencies: - "@huma-finance/soroban-credit-manager" "^0.0.15" - "@huma-finance/soroban-credit-storage" "^0.0.15" - "@huma-finance/soroban-huma-config" "^0.0.15" - "@huma-finance/soroban-pool" "^0.0.15" - "@huma-finance/soroban-pool-credit" "^0.0.15" - "@huma-finance/soroban-pool-manager" "^0.0.15" - "@huma-finance/soroban-pool-storage" "^0.0.15" - "@huma-finance/soroban-sep41" "^0.0.15" - "@huma-finance/soroban-tranche-vault" "^0.0.15" - "@stellar/stellar-sdk" "^12.1.0" +"@huma-finance/soroban-sdk@^0.0.18": + version "0.0.18" + resolved "https://registry.yarnpkg.com/@huma-finance/soroban-sdk/-/soroban-sdk-0.0.18.tgz#11f3e90d0f4442e2e6773a8d578ee105d885523a" + integrity sha512-2V4vBMTg3dEt2H7NJO9IVQuawEUYAzY9t3pHyDlzAAZAPRWEix6fpUXkZuooE/FZWANUtSrVo9CpgNrgDguekQ== + dependencies: + "@huma-finance/soroban-credit-manager" "^0.0.18" + "@huma-finance/soroban-credit-storage" "^0.0.18" + "@huma-finance/soroban-huma-config" "^0.0.18" + "@huma-finance/soroban-pool" "^0.0.18" + "@huma-finance/soroban-pool-credit" "^0.0.18" + "@huma-finance/soroban-pool-manager" "^0.0.18" + "@huma-finance/soroban-pool-storage" "^0.0.18" + "@huma-finance/soroban-sep41" "^0.0.18" + "@huma-finance/soroban-tranche-vault" "^0.0.18" + "@stellar/stellar-sdk" "13.0.0" dotenv "^16.0.3" ts-node "^10.9.1" tslib "^2.5.0" typescript "^4.8.4" -"@huma-finance/soroban-sep41@^0.0.15": - version "0.0.15" - resolved "https://registry.yarnpkg.com/@huma-finance/soroban-sep41/-/soroban-sep41-0.0.15.tgz#c172e62a70166a363f8633a84400a871d0149857" - integrity sha512-nhbGgLpgh9yowMXQzMBPafQQgoB/IFHGMQKE3zk6UBfSQHouZTkm8kRX1OSuMt7KWvk2eWPjS5j8VdsWr+gABw== +"@huma-finance/soroban-sep41@^0.0.18": + version "0.0.18" + resolved "https://registry.yarnpkg.com/@huma-finance/soroban-sep41/-/soroban-sep41-0.0.18.tgz#ed64c842d817747b0ecac8cf04b30b178534ea00" + integrity sha512-+vqS4BABdqqH+0jCwZMkcbzhlm9LJfvmntHbxdtunrtfSnaXTl2tJKNSNIOtkM7tOyuO5mKon4ZigPgMrbYrUA== dependencies: - "@stellar/stellar-sdk" "12.1.0" + "@stellar/stellar-sdk" "13.0.0" buffer "6.0.3" -"@huma-finance/soroban-tranche-vault@0.0.15", "@huma-finance/soroban-tranche-vault@^0.0.15": - version "0.0.15" - resolved "https://registry.yarnpkg.com/@huma-finance/soroban-tranche-vault/-/soroban-tranche-vault-0.0.15.tgz#e3127dc008b0580bb6dffca428451f6c69e06dd7" - integrity sha512-PZhKBhDpD8tH1tWJY5Oc8aHZ4fdzCBGUxHUKMlYqDnk7kMbI73X1OAUVuCpqxvb2Y/prxt5GE2B3JW4QFHzUVQ== +"@huma-finance/soroban-tranche-vault@0.0.18", "@huma-finance/soroban-tranche-vault@^0.0.18": + version "0.0.18" + resolved "https://registry.yarnpkg.com/@huma-finance/soroban-tranche-vault/-/soroban-tranche-vault-0.0.18.tgz#6fa54ad49025a8bc57c42dd37ed60f362defa785" + integrity sha512-CcpZ+/wUiGKtxxElXJjXVY7CPgU9s1jsXWWQd03sVjHmAZNEazjQJ8ABHchaf4vaMN9maf3Ht2WCplWaR0VjHA== dependencies: - "@stellar/stellar-sdk" "12.1.0" + "@stellar/stellar-sdk" "13.0.0" buffer "6.0.3" "@humanwhocodes/config-array@^0.11.13": @@ -6251,10 +6251,10 @@ resolved "https://registry.yarnpkg.com/@stellar/js-xdr/-/js-xdr-3.1.2.tgz#db7611135cf21e989602fd72f513c3bed621bc74" integrity sha512-VVolPL5goVEIsvuGqDc5uiKxV03lzfWdvYg1KikvwheDmTBO68CKDji3bAZ/kppZrx5iTA8z3Ld5yuytcvhvOQ== -"@stellar/stellar-base@^12.0.1", "@stellar/stellar-base@^12.1.1": - version "12.1.1" - resolved "https://registry.yarnpkg.com/@stellar/stellar-base/-/stellar-base-12.1.1.tgz#16a07e74995725c544510be7086723c28300ed11" - integrity sha512-gOBSOFDepihslcInlqnxKZdIW9dMUO1tpOm3AtJR33K2OvpXG6SaVHCzAmCFArcCqI9zXTEiSoh70T48TmiHJA== +"@stellar/stellar-base@^13.0.1": + version "13.0.1" + resolved "https://registry.yarnpkg.com/@stellar/stellar-base/-/stellar-base-13.0.1.tgz#0897f77349ded61e838c0d55519f36f720efe3c9" + integrity sha512-Xbd12mc9Oj/130Tv0URmm3wXG77XMshZtZ2yNCjqX5ZbMD5IYpbBs3DVCteLU/4SLj/Fnmhh1dzhrQXnk4r+pQ== dependencies: "@stellar/js-xdr" "^3.1.2" base32.js "^0.1.0" @@ -6263,30 +6263,18 @@ sha.js "^2.3.6" tweetnacl "^1.0.3" optionalDependencies: - sodium-native "^4.1.1" - -"@stellar/stellar-sdk@12.1.0": - version "12.1.0" - resolved "https://registry.yarnpkg.com/@stellar/stellar-sdk/-/stellar-sdk-12.1.0.tgz#eafe064d36696ada5b7bd7e871f7199b6ed39222" - integrity sha512-Va0hu9SaPezmMbO5eMwL5D15Wrx1AGWRtxayUDRWV2Fr3ynY58mvCZS1vsgNQ4kE8MZe3nBVKv6T9Kzqwgx1PQ== - dependencies: - "@stellar/stellar-base" "^12.0.1" - 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" + sodium-native "^4.3.0" -"@stellar/stellar-sdk@^12.1.0", "@stellar/stellar-sdk@^12.3.0": - version "12.3.0" - resolved "https://registry.yarnpkg.com/@stellar/stellar-sdk/-/stellar-sdk-12.3.0.tgz#d3c00364097f6717a66fd1a83d96a1ef5ba43306" - integrity sha512-F2DYFop/M5ffXF0lvV5Ezjk+VWNKg0QDX8gNhwehVU3y5LYA3WAY6VcCarMGPaG9Wdgoeh1IXXzOautpqpsltw== +"@stellar/stellar-sdk@13.0.0": + version "13.0.0" + resolved "https://registry.yarnpkg.com/@stellar/stellar-sdk/-/stellar-sdk-13.0.0.tgz#293f0bf6964b384e489b0ad75174d39cd22a3a69" + integrity sha512-+wvmKi+XWwu27nLYTM17EgBdpbKohEkOfCIK4XKfsI4WpMXAqvnqSm98i9h5dAblNB+w8BJqzGs1JY0PtTGm4A== dependencies: - "@stellar/stellar-base" "^12.1.1" + "@stellar/stellar-base" "^13.0.1" axios "^1.7.7" bignumber.js "^9.1.2" eventsource "^2.0.2" + feaxios "^0.0.20" randombytes "^2.1.0" toml "^3.0.0" urijs "^1.19.1" @@ -9551,7 +9539,7 @@ axios@^1.0.0, axios@^1.4.0: form-data "^4.0.0" proxy-from-env "^1.1.0" -axios@^1.6.7, axios@^1.7.2, axios@^1.7.7: +axios@^1.6.7, axios@^1.7.7: version "1.7.7" resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.7.tgz#2f554296f9892a72ac8d8e4c5b79c14a91d0a47f" integrity sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q== @@ -13656,6 +13644,13 @@ fd-slicer@~1.1.0: dependencies: pend "~1.2.0" +feaxios@^0.0.20: + version "0.0.20" + resolved "https://registry.yarnpkg.com/feaxios/-/feaxios-0.0.20.tgz#04e976beb7345401fedeba764f0e9e1c4d01afd4" + integrity sha512-g3hm2YDNffNxA3Re3Hd8ahbpmDee9Fv1Pb1C/NoWsjY7mtD8nyNeJytUzn+DK0Hyl9o6HppeWOrtnqgmhOYfWA== + dependencies: + is-retry-allowed "^3.0.0" + figures@3.2.0, figures@^3.0.0, figures@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" @@ -15525,6 +15520,11 @@ is-relative@^1.0.0: dependencies: is-unc-path "^1.0.0" +is-retry-allowed@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-3.0.0.tgz#ea79389fd350d156823c491bee9c69f485b1445c" + integrity sha512-9xH0xvoggby+u0uGF7cZXdrutWiBiaFG8ZT4YFPXL8NzkyAwX3AKGLeFQLvzDpM430+nDFBZ1LHkie/8ocL06A== + is-root@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-root/-/is-root-2.1.0.tgz#809e18129cf1129644302a4f8544035d51984a9c" @@ -22368,10 +22368,10 @@ socks@^2.6.2: ip "^2.0.0" smart-buffer "^4.2.0" -sodium-native@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/sodium-native/-/sodium-native-4.3.0.tgz#cc76b70824b0e131cbdc5f56d5369eaa89e1ad72" - integrity sha512-OcMgoS0NJx+4yVUlhvL9uZsVZfmyHZ2RpSXkiIoOHMglqvJDeGwn1rUigPrvcNTq3m9hPXtt6syxQbF3vvwmRQ== +sodium-native@^4.3.0: + version "4.3.1" + resolved "https://registry.yarnpkg.com/sodium-native/-/sodium-native-4.3.1.tgz#221a11b10876259b85ccd288dd28f07ed4dbf35f" + integrity sha512-YdP64gAdpIKHfL4ttuX4aIfjeunh9f+hNeQJpE9C8UMndB3zkgZ7YmmGT4J2+v6Ibyp6Wem8D1TcSrtdW0bqtg== dependencies: node-gyp-build "^4.8.0"