@alphafi/alphafi-sdk 0.0.94 → 0.0.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/graphql/fetchData.js +1 -1
- package/dist/cjs/graphql/fetchData.js.map +1 -1
- package/dist/cjs/graphql/getMultiReceipts.js +6 -6
- package/dist/cjs/graphql/getMultiReceipts.js.map +1 -1
- package/dist/cjs/graphql/queries/getMultiReceipts.js +1 -1
- package/dist/cjs/graphql/queries/getMultiReceipts.js.map +1 -1
- package/dist/cjs/transactions/get_navi_rewards.d.ts.map +1 -1
- package/dist/cjs/transactions/get_navi_rewards.js +44 -31
- package/dist/cjs/transactions/get_navi_rewards.js.map +1 -1
- package/dist/esm/graphql/fetchData.js +1 -1
- package/dist/esm/graphql/fetchData.js.map +1 -1
- package/dist/esm/graphql/getMultiReceipts.js +6 -6
- package/dist/esm/graphql/getMultiReceipts.js.map +1 -1
- package/dist/esm/graphql/queries/getMultiReceipts.js +1 -1
- package/dist/esm/graphql/queries/getMultiReceipts.js.map +1 -1
- package/dist/esm/transactions/get_navi_rewards.d.ts.map +1 -1
- package/dist/esm/transactions/get_navi_rewards.js +44 -31
- package/dist/esm/transactions/get_navi_rewards.js.map +1 -1
- package/docs/functions/alphaLpBreakdown.html +1 -1
- package/docs/functions/cetusLpBreakdown.html +1 -1
- package/docs/functions/claimRewardTxb.html +1 -1
- package/docs/functions/claimRewardsTxb.html +1 -1
- package/docs/functions/coinAmountToXTokensDoubleAsset.html +1 -1
- package/docs/functions/coinAmountToXTokensSingleAsset.html +1 -1
- package/docs/functions/coinsInPool.html +1 -1
- package/docs/functions/collectAndSwapRewardsSingleLoop.html +1 -1
- package/docs/functions/collectRewardTxb.html +1 -1
- package/docs/functions/collectRewards.html +1 -1
- package/docs/functions/deposit.html +1 -1
- package/docs/functions/depositDoubleAssetTxb.html +1 -1
- package/docs/functions/depositSingleAssetTxb.html +1 -1
- package/docs/functions/fetchAfterTransactionEvents.html +1 -1
- package/docs/functions/fetchAirdropClaimEvents.html +1 -1
- package/docs/functions/fetchAutoCompoundingEvents.html +1 -1
- package/docs/functions/fetchAutoCompoundingEventsGql.html +1 -1
- package/docs/functions/fetchCetusPools.html +1 -1
- package/docs/functions/fetchChainIdentifier.html +1 -1
- package/docs/functions/fetchCheckRatioEvents.html +1 -1
- package/docs/functions/fetchEvents.html +1 -1
- package/docs/functions/fetchLiquidityChangeEvents.html +1 -1
- package/docs/functions/fetchMultiCategoryEvents.html +1 -1
- package/docs/functions/fetchMultiReceipts.html +1 -1
- package/docs/functions/fetchNftHolders.html +1 -1
- package/docs/functions/fetchPools.html +1 -1
- package/docs/functions/fetchPortfolioData.html +1 -1
- package/docs/functions/fetchProtocolData.html +1 -1
- package/docs/functions/fetchRequiredPrices.html +1 -1
- package/docs/functions/fetchTVL.html +1 -1
- package/docs/functions/fetchTransactions.html +1 -1
- package/docs/functions/fetchUserVaultBalances.html +1 -1
- package/docs/functions/fetchUserVaults.html +1 -1
- package/docs/functions/fetchUserWalletData.html +1 -1
- package/docs/functions/fetchVoloExchangeRate.html +1 -1
- package/docs/functions/fetchWithdrawV2Events.html +1 -1
- package/docs/functions/getAirdropShare.html +1 -1
- package/docs/functions/getAllDoubleAssetVaults.html +1 -1
- package/docs/functions/getAllSingleAssetVaults.html +1 -1
- package/docs/functions/getAllVaultBalances.html +1 -1
- package/docs/functions/getAllVaults.html +1 -1
- package/docs/functions/getAlphaUnlocks.html +1 -1
- package/docs/functions/getAlphaVaultBalance.html +1 -1
- package/docs/functions/getAmounts.html +1 -1
- package/docs/functions/getApr.html +1 -1
- package/docs/functions/getAprs.html +1 -1
- package/docs/functions/getApy.html +1 -1
- package/docs/functions/getApys.html +1 -1
- package/docs/functions/getCetusInvestorTicksMap.html +1 -1
- package/docs/functions/getCetusPool.html +1 -1
- package/docs/functions/getCetusSqrtPriceMap.html +1 -1
- package/docs/functions/getCoinAmountsFromLiquidity.html +1 -1
- package/docs/functions/getConf.html +1 -1
- package/docs/functions/getCurrentTick.html +1 -1
- package/docs/functions/getDistributor.html +1 -1
- package/docs/functions/getDoubleAssetVaultBalance.html +1 -1
- package/docs/functions/getDoubleAssetVaults.html +1 -1
- package/docs/functions/getInvestor.html +1 -1
- package/docs/functions/getInvestorPoolMap.html +1 -1
- package/docs/functions/getLastAutoCompoundTime.html +1 -1
- package/docs/functions/getLatestPrices.html +1 -1
- package/docs/functions/getLiquidity.html +1 -1
- package/docs/functions/getMultiCetusPool.html +1 -1
- package/docs/functions/getMultiInvestor.html +1 -1
- package/docs/functions/getMultiLatestPrices.html +1 -1
- package/docs/functions/getMultiParentPool.html +1 -1
- package/docs/functions/getMultiPool.html +1 -1
- package/docs/functions/getMultiReceipts.html +1 -1
- package/docs/functions/getParentPool.html +1 -1
- package/docs/functions/getPool.html +1 -1
- package/docs/functions/getPoolExchangeRate.html +1 -1
- package/docs/functions/getPoolExchangeRateMap.html +1 -1
- package/docs/functions/getPoolsWeightDistribution.html +1 -1
- package/docs/functions/getPositionRange.html +1 -1
- package/docs/functions/getPositionRanges.html +1 -1
- package/docs/functions/getPositionTicks.html +1 -1
- package/docs/functions/getPriceToTick.html +1 -1
- package/docs/functions/getRebalanceHistories.html +1 -1
- package/docs/functions/getRebalanceHistory.html +1 -1
- package/docs/functions/getReceipts.html +1 -1
- package/docs/functions/getSingleAssetVaultBalance.html +1 -1
- package/docs/functions/getSingleAssetVaults.html +1 -1
- package/docs/functions/getSuiClient.html +2 -2
- package/docs/functions/getSuiNodeUrl.html +2 -2
- package/docs/functions/getTVLs-1.html +1 -1
- package/docs/functions/getTickSpacing.html +1 -1
- package/docs/functions/getTickToPrice.html +1 -1
- package/docs/functions/getTvls.html +1 -1
- package/docs/functions/getVaultBalance.html +1 -1
- package/docs/functions/getVaults.html +1 -1
- package/docs/functions/lastAutocompoundTime.html +1 -1
- package/docs/functions/liquidityToTokens.html +1 -1
- package/docs/functions/migrateBoostedToLoop.html +1 -1
- package/docs/functions/multiLiquidityToTokens.html +1 -1
- package/docs/functions/multiTokensToUsd.html +1 -1
- package/docs/functions/multiXTokensToLiquidity.html +1 -1
- package/docs/functions/parseUserWalletData.html +1 -1
- package/docs/functions/pendingRewardAmount.html +1 -1
- package/docs/functions/setCustomSuiClient.html +2 -2
- package/docs/functions/setSuiClient.html +2 -2
- package/docs/functions/setSuiNodeUrl.html +2 -2
- package/docs/functions/setWeights.html +1 -1
- package/docs/functions/withdraw.html +1 -1
- package/docs/functions/withdrawAlphaTxb.html +1 -1
- package/docs/functions/withdrawTxb.html +1 -1
- package/docs/functions/zapDepositQuoteTxb.html +1 -1
- package/docs/functions/zapDepositTxb.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +2 -2
- package/docs/interfaces/Coin.html +6 -6
- package/docs/interfaces/CoinPair.html +2 -2
- package/docs/interfaces/CommonEventAttributes.html +2 -2
- package/docs/interfaces/NaviVoloData.html +2 -2
- package/docs/interfaces/PoolData.html +2 -2
- package/docs/interfaces/PoolWeightDistribution.html +2 -2
- package/docs/interfaces/RebalanceHistoryType.html +2 -2
- package/docs/modules.html +1 -1
- package/docs/types/AfterTransactionEventNode.html +1 -1
- package/docs/types/AirdropClaimEventNode.html +1 -1
- package/docs/types/Allocator.html +2 -2
- package/docs/types/AlphaFiDoubleAssetVault.html +2 -2
- package/docs/types/AlphaFiMultiVaultBalance.html +1 -1
- package/docs/types/AlphaFiSingleAssetVault.html +2 -2
- package/docs/types/AlphaFiVault.html +1 -1
- package/docs/types/AlphaFiVaultBalance.html +1 -1
- package/docs/types/AlphaLendInvestor.html +1 -1
- package/docs/types/AlphaPoolType.html +2 -2
- package/docs/types/AlphaReceipt.html +2 -2
- package/docs/types/AlphaReceiptFields.html +2 -2
- package/docs/types/AlphaVaultBalance.html +2 -2
- package/docs/types/AutoBalancePoolNames.html +1 -1
- package/docs/types/AutoCompoundingEventNode.html +1 -1
- package/docs/types/BluefinInvestor.html +1 -1
- package/docs/types/BluefinPoolType.html +2 -2
- package/docs/types/BucketInvestor.html +2 -2
- package/docs/types/CetusInvestor.html +2 -2
- package/docs/types/CetusPoolType.html +2 -2
- package/docs/types/CetusSwapOptions.html +1 -1
- package/docs/types/CoinAmounts.html +2 -2
- package/docs/types/CoinName.html +1 -1
- package/docs/types/CoinType.html +1 -1
- package/docs/types/CommonInvestorFields.html +2 -2
- package/docs/types/CreatePoolOptions.html +2 -2
- package/docs/types/Distributor.html +2 -2
- package/docs/types/DoubleAssetMultiVaultBalance.html +2 -2
- package/docs/types/DoubleAssetPoolNames.html +1 -1
- package/docs/types/DoubleAssetTokenHoldings.html +2 -2
- package/docs/types/DoubleAssetVaultBalance.html +2 -2
- package/docs/types/EventCategory.html +1 -1
- package/docs/types/EventNode.html +1 -1
- package/docs/types/GetHoldersParams.html +2 -2
- package/docs/types/GetTokenHoldingsParams.html +2 -2
- package/docs/types/GetUserTokensFromTransactionsParams.html +2 -2
- package/docs/types/GetUserTokensInUsdFromTransactionsParams.html +2 -2
- package/docs/types/GetVaultBalanceParams.html +1 -1
- package/docs/types/HoldingsObj.html +2 -2
- package/docs/types/Icon.html +1 -1
- package/docs/types/Investor.html +1 -1
- package/docs/types/LiquidityChangeEventNode.html +1 -1
- package/docs/types/LiquidityToTokensParams.html +2 -2
- package/docs/types/LiquidityToUsdParams.html +2 -2
- package/docs/types/LoopingDebt.html +2 -2
- package/docs/types/LoopingPoolNames.html +1 -1
- package/docs/types/LpBreakdownType.html +2 -2
- package/docs/types/MemberPoolDataType.html +2 -2
- package/docs/types/MemberType.html +2 -2
- package/docs/types/MultiGetVaultBalancesParams.html +2 -2
- package/docs/types/NaviInvestor.html +2 -2
- package/docs/types/OtherReceiptFields.html +2 -2
- package/docs/types/PoolName.html +1 -1
- package/docs/types/PoolReceipt.html +1 -1
- package/docs/types/PoolType.html +2 -2
- package/docs/types/Receipt.html +2 -2
- package/docs/types/ReceiptGQL.html +2 -2
- package/docs/types/SingleAssetMultiVaultBalance.html +2 -2
- package/docs/types/SingleAssetPoolNames.html +1 -1
- package/docs/types/SingleAssetTokenHoldings.html +2 -2
- package/docs/types/SingleAssetVaultBalance.html +2 -2
- package/docs/types/SingleGetVaultBalancesParams.html +2 -2
- package/docs/types/StrategyType.html +1 -1
- package/docs/types/SuiNetwork.html +1 -1
- package/docs/types/SwapOptions.html +1 -1
- package/docs/types/TickSpacing.html +1 -1
- package/docs/types/TotalWeightType.html +2 -2
- package/docs/types/TransactionBlockType.html +2 -2
- package/docs/types/UserPoolLiquidity.html +2 -2
- package/docs/types/UserPoolTokenHoldings.html +1 -1
- package/docs/types/UserUsdHoldings.html +2 -2
- package/docs/types/VaultBalance.html +1 -1
- package/docs/types/VoteCastEvent.html +1 -1
- package/docs/types/WithdrawV2EventNode.html +1 -1
- package/docs/variables/AUTOBALANCE_SUI_FIRST_POOLS.html +1 -1
- package/docs/variables/AUTOBALANCE_SUI_SECOND_POOLS.html +1 -1
- package/docs/variables/AUTOBALANCE_TYPE_1_POOLS.html +1 -1
- package/docs/variables/alphalendMarketIdMap.html +1 -1
- package/docs/variables/bluefinPoolMap.html +1 -1
- package/docs/variables/cetusPoolMap.html +1 -1
- package/docs/variables/coinsList.html +1 -1
- package/docs/variables/defunctPoolsSet.html +1 -1
- package/docs/variables/doubleAssetPoolCoinMap.html +1 -1
- package/docs/variables/eventCategories.html +1 -1
- package/docs/variables/ignoredWalletsForDailyRevenue.html +1 -1
- package/docs/variables/loopingAccountAddresses.html +1 -1
- package/docs/variables/loopingPoolCoinMap.html +1 -1
- package/docs/variables/naviAssetMap.html +1 -1
- package/docs/variables/poolIdPoolNameMap.html +1 -1
- package/docs/variables/poolInfo.html +1 -1
- package/docs/variables/singleAssetPoolCoinMap.html +1 -1
- package/docs/variables/stableCoins.html +1 -1
- package/package.json +2 -3
|
@@ -49,7 +49,7 @@ async function fetchUserVaults(walletAddress) {
|
|
|
49
49
|
address: walletAddress,
|
|
50
50
|
},
|
|
51
51
|
});
|
|
52
|
-
return data?.
|
|
52
|
+
return data?.address;
|
|
53
53
|
}
|
|
54
54
|
async function fetchUserVaultBalances(walletAddress) {
|
|
55
55
|
const { data: poolsData } = await client_js_1.default.query({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchData.js","sourceRoot":"","sources":["../../../src/graphql/fetchData.ts"],"names":[],"mappings":";AAAA,2BAA2B;;;AA+B3B,kDAMC;AAED,8CAKC;AAED,gDAMC;AAED,oDAKC;AAED,0CAQC;AAED,wDA2BC;AAED,gCAKC;AAED,0CAKC;;AA9GD;;GAEG;AAEH,oEAAiC;AACjC,6CAUsB;AAcf,KAAK,UAAU,mBAAmB,CAAC,OAAe;IACvD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,mBAAM,CAAC,KAAK,CAAiB;QAClD,KAAK,EAAE,iCAAoB;QAC3B,SAAS,EAAE,EAAE,OAAO,EAAE;KACvB,CAAC,CAAC;IACH,OAAO,IAAI,EAAE,UAAU,CAAC;AAC1B,CAAC;AAEM,KAAK,UAAU,iBAAiB;IACrC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,mBAAM,CAAC,KAAK,CAAe;QAChD,KAAK,EAAE,8BAAiB;KACzB,CAAC,CAAC;IACH,OAAO,IAAI,EAAE,YAAY,CAAC;AAC5B,CAAC;AAEM,KAAK,UAAU,kBAAkB,CAAC,OAAe;IACtD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,mBAAM,CAAC,KAAK,CAAgB;QACjD,KAAK,EAAE,+BAAkB;QACzB,SAAS,EAAE,EAAE,OAAO,EAAE;KACvB,CAAC,CAAC;IACH,OAAO,IAAI,EAAE,SAAS,CAAC;AACzB,CAAC;AAEM,KAAK,UAAU,oBAAoB;IACxC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,mBAAM,CAAC,KAAK,CAAkB;QACnD,KAAK,EAAE,iCAAoB;KAC5B,CAAC,CAAC;IACH,OAAO,IAAI,EAAE,eAAe,CAAC;AAC/B,CAAC;AAEM,KAAK,UAAU,eAAe,CAAC,a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E,GAAG,MAAM,mBAAM,CAAC,KAAK,CAA0B;QAC3D,KAAK,EAAE,4BAAe;KACvB,CAAC,CAAC;IACH,OAAO,IAAI,IAAI,EAAE,CAAC;AACpB,CAAC;AAED,uFAG4C;AAF1C,iJAAA,6BAA6B,OAAA;AAG/B,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AAExB,0DAA0D","sourcesContent":["// src/graphql/fetchData.ts\n\n/* This file will contain functions that use the Apollo Client to\n/* execute the queries and return data.\n */\n\nimport client from \"./client.js\";\nimport {\n GET_USER_WALLET_DATA,\n GET_PROTOCOL_DATA,\n GET_PORTFOLIO_DATA,\n GET_CHAIN_IDENTIFIER,\n GET_USER_VAULTS,\n GET_USER_VAULT_BALANCES,\n GET_POOLS,\n GET_INVESTORS,\n GET_CETUS_POOLS,\n} from \"./queries.js\";\n\ntype UserWalletData = {\n userWallet: { coins: { name: string; amount: string }[] };\n};\ntype ProtocolData = {\n protocolData: {\n totalValueLocked: unknown;\n pools: { name: string; tvl: unknown }[];\n };\n};\ntype PortfolioData = { portfolio: { poolName: string; investment: unknown }[] };\ntype ChainIdentifier = { chainIdentifier: string };\n\nexport async function fetchUserWalletData(address: string) {\n const { data } = await client.query<UserWalletData>({\n query: GET_USER_WALLET_DATA,\n variables: { address },\n });\n return data?.userWallet;\n}\n\nexport async function fetchProtocolData() {\n const { data } = await client.query<ProtocolData>({\n query: GET_PROTOCOL_DATA,\n });\n return data?.protocolData;\n}\n\nexport async function fetchPortfolioData(address: string) {\n const { data } = await client.query<PortfolioData>({\n query: GET_PORTFOLIO_DATA,\n variables: { address },\n });\n return data?.portfolio;\n}\n\nexport async function fetchChainIdentifier() {\n const { data } = await client.query<ChainIdentifier>({\n query: GET_CHAIN_IDENTIFIER,\n });\n return data?.chainIdentifier;\n}\n\nexport async function fetchUserVaults(walletAddress: string) {\n const { data } = await client.query<{ address: unknown }>({\n query: GET_USER_VAULTS,\n variables: {\n address: walletAddress,\n },\n });\n return (data as any)?.address;\n}\n\nexport async function fetchUserVaultBalances(walletAddress: string) {\n const { data: poolsData } = await client.query<Record<string, unknown>>({\n query: GET_POOLS,\n });\n const { data: cetusPoolsData } = await client.query<Record<string, unknown>>({\n query: GET_CETUS_POOLS,\n });\n const { data: investorsData } = await client.query<Record<string, unknown>>({\n query: GET_INVESTORS,\n });\n const { data: userVaultBalancesData } = await client.query<\n Record<string, unknown>\n >({\n query: GET_USER_VAULT_BALANCES,\n variables: {\n address: walletAddress,\n },\n });\n\n const data = {\n ...(poolsData ?? {}),\n ...(cetusPoolsData ?? {}),\n ...(investorsData ?? {}),\n ...(userVaultBalancesData ?? {}),\n };\n\n return data;\n}\n\nexport async function fetchPools() {\n const { data } = await client.query<Record<string, unknown>>({\n query: GET_POOLS,\n });\n return data ?? {};\n}\n\nexport async function fetchCetusPools() {\n const { data } = await client.query<Record<string, unknown>>({\n query: GET_CETUS_POOLS,\n });\n return data ?? {};\n}\n\nexport {\n fetchAutoCompoundingEventsGql,\n AutoCompoundingEventNode,\n} from \"./fetchAutoCompoundingEventsGql.js\";\nexport { fetchNftHolders } from \"./fetchNftHolders.js\";\n\n// Add more functions for other data fetching requirements\n"]}
|
|
@@ -6,18 +6,18 @@ const getMultiReceipts_js_1 = require("./queries/getMultiReceipts.js");
|
|
|
6
6
|
const maps_js_1 = require("../common/maps.js");
|
|
7
7
|
const client = new core_1.ApolloClient({
|
|
8
8
|
link: new core_1.HttpLink({
|
|
9
|
-
uri: "https://
|
|
9
|
+
uri: "https://graphql.mainnet.sui.io/graphql",
|
|
10
10
|
}),
|
|
11
11
|
cache: new core_1.InMemoryCache({
|
|
12
12
|
typePolicies: {
|
|
13
|
-
|
|
14
|
-
keyFields: (
|
|
15
|
-
const objectKeys = Object.keys(
|
|
13
|
+
Address: {
|
|
14
|
+
keyFields: (addressObj) => {
|
|
15
|
+
const objectKeys = Object.keys(addressObj)
|
|
16
16
|
.filter((k) => k !== "__typename")
|
|
17
17
|
.sort();
|
|
18
18
|
const uniqueKey = objectKeys.join(",");
|
|
19
19
|
// Return the final unique ID string
|
|
20
|
-
return `
|
|
20
|
+
return `Address:${uniqueKey}`;
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
23
|
},
|
|
@@ -69,7 +69,7 @@ async function fetchMultiReceipts(address) {
|
|
|
69
69
|
const data = result.data;
|
|
70
70
|
if (!data)
|
|
71
71
|
break;
|
|
72
|
-
const receipts = data.
|
|
72
|
+
const receipts = data.address;
|
|
73
73
|
hasNextPage = false;
|
|
74
74
|
Object.keys(receipts).forEach((key) => {
|
|
75
75
|
if (key !== "__typename") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMultiReceipts.js","sourceRoot":"","sources":["../../../src/graphql/getMultiReceipts.ts"],"names":[],"mappings":";;AAoDA,gDAuFC;AA3ID,8CAK6B;AAC7B,uEAAsE;AAEtE,+CAA6C;AAO7C,MAAM,MAAM,GAAG,IAAI,mBAAY,CAAC;IAC9B,IAAI,EAAE,IAAI,eAAQ,CAAC;QACjB,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"getMultiReceipts.js","sourceRoot":"","sources":["../../../src/graphql/getMultiReceipts.ts"],"names":[],"mappings":";;AAoDA,gDAuFC;AA3ID,8CAK6B;AAC7B,uEAAsE;AAEtE,+CAA6C;AAO7C,MAAM,MAAM,GAAG,IAAI,mBAAY,CAAC;IAC9B,IAAI,EAAE,IAAI,eAAQ,CAAC;QACjB,GAAG,EAAE,wCAAwC;KAC9C,CAAC;IACF,KAAK,EAAE,IAAI,oBAAa,CAAC;QACvB,YAAY,EAAE;YACZ,OAAO,EAAE;gBACP,SAAS,EAAE,CAAC,UAAU,EAAE,EAAE;oBACxB,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;yBACvC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,YAAY,CAAC;yBACjC,IAAI,EAAE,CAAC;oBACV,MAAM,SAAS,GAAG,UAAU,CAAC,IA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C;;4BAC1D,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC;wBACpC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAS,EAAE,EAAE;4BAC1B,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;wBAC3B,CAAC,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CACV,yEAAyE,EACzE,KAAK,CACN,CAAC;QACJ,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBACxC,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,MAAM,UAAU,GAA8B,IAAI,GAAG,EAAE,CAAC;IACxD,aAAa,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAChC,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QACxC,IAAI,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,GAAG;YAAE,GAAG,GAAG,EAAE,CAAC;QACnB,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClB,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IACH,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import {\n ApolloClient,\n gql,\n HttpLink,\n InMemoryCache,\n} from \"@apollo/client/core\";\nimport { getMultiReceiptsQuery } from \"./queries/getMultiReceipts.js\";\nimport { ReceiptGQL } from \"./types.js\";\nimport { poolInfo } from \"../common/maps.js\";\n\ntype ReceiptType = {\n type: string;\n cursor: string;\n};\n\nconst client = new ApolloClient({\n link: new HttpLink({\n uri: \"https://graphql.mainnet.sui.io/graphql\",\n }),\n cache: new InMemoryCache({\n typePolicies: {\n Address: {\n keyFields: (addressObj) => {\n const objectKeys = Object.keys(addressObj)\n .filter((k) => k !== \"__typename\")\n .sort();\n const uniqueKey = objectKeys.join(\",\");\n\n // Return the final unique ID string\n return `Address:${uniqueKey}`;\n },\n },\n },\n }),\n});\n\nconst getReceiptTypes = () => {\n const receiptTypes: { [key: string]: ReceiptType } = {};\n const mySet: Set<string> = new Set();\n Object.keys(poolInfo).forEach((pool) => {\n const key = pool.replace(/-/g, \"_\");\n if (!mySet.has(poolInfo[pool].receiptType)) {\n receiptTypes[key] = {\n type: poolInfo[pool].receiptType,\n cursor: \"\",\n } as ReceiptType;\n mySet.add(poolInfo[pool].receiptType);\n }\n });\n return receiptTypes;\n};\n\nexport async function fetchMultiReceipts(\n address: string,\n): Promise<Map<string, ReceiptGQL[]>> {\n const multiReceipts: any[] = [];\n\n const receiptTypes = getReceiptTypes();\n const batchSize = 10; // Set the desired batch size\n\n // Convert the receiptTypes object into an array of entries\n const entries = Object.entries(receiptTypes);\n\n // Create an array to hold the batches\n const batches: { [k: string]: ReceiptType }[] = [];\n //const batches = [];\n // Loop through the entries array and create batches\n for (let i = 0; i < entries.length; i += batchSize) {\n const batchEntries = entries.slice(i, i + batchSize);\n batches.push(Object.fromEntries(batchEntries)); // Convert to object before pushing\n }\n\n for (const receiptTypes of batches) {\n let hasNextPage = true;\n\n try {\n while (hasNextPage) {\n const query = getMultiReceiptsQuery(receiptTypes);\n const GET_RECEIPTS = gql`\n ${query}\n `;\n\n type ReceiptBatchResponse = {\n address: Record<\n string,\n | undefined\n | {\n pageInfo: { hasNextPage: boolean; endCursor: string };\n nodes: any[];\n }\n >;\n };\n const result = await client.query<ReceiptBatchResponse>({\n query: GET_RECEIPTS,\n variables: {\n address: address,\n },\n });\n\n const data = result.data;\n if (!data) break;\n const receipts = data.address;\n hasNextPage = false;\n\n Object.keys(receipts).forEach((key) => {\n if (key !== \"__typename\") {\n const entry = receipts[key];\n if (!entry) return;\n const { pageInfo, nodes } = entry;\n hasNextPage = hasNextPage || pageInfo.hasNextPage;\n if (hasNextPage) receiptTypes[key].cursor = pageInfo.endCursor;\n else receiptTypes[key].cursor = \"0\";\n nodes.forEach((node: any) => {\n multiReceipts.push(node);\n });\n }\n });\n }\n } catch (error) {\n console.warn(\n \"Error fetching receipts from GraphQL, now fetching from suiClient query\",\n error,\n );\n } finally {\n Object.keys(receiptTypes).forEach((key) => {\n receiptTypes[key].cursor = \"\";\n });\n }\n }\n\n const receiptMap: Map<string, ReceiptGQL[]> = new Map();\n multiReceipts.forEach((receipt) => {\n const name = receipt.contents.json.name;\n let arr = receiptMap.get(name);\n if (!arr) arr = [];\n arr.push(receipt);\n receiptMap.set(name, arr);\n });\n return receiptMap;\n}\n"]}
|
|
@@ -4,7 +4,7 @@ exports.getMultiReceiptsQuery = getMultiReceiptsQuery;
|
|
|
4
4
|
function getMultiReceiptsQuery(receiptTypes) {
|
|
5
5
|
let query = `
|
|
6
6
|
query GetUserVaultBalances($address: SuiAddress!) {
|
|
7
|
-
|
|
7
|
+
address(address: $address) {`;
|
|
8
8
|
Object.keys(receiptTypes).forEach((key) => {
|
|
9
9
|
if (receiptTypes[key].cursor === "") {
|
|
10
10
|
query += `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMultiReceipts.js","sourceRoot":"","sources":["../../../../src/graphql/queries/getMultiReceipts.ts"],"names":[],"mappings":";;AAAA,sDAsDC;AAtDD,SAAgB,qBAAqB,CAAC,YAAiB;IACrD,IAAI,KAAK,GAAG;;
|
|
1
|
+
{"version":3,"file":"getMultiReceipts.js","sourceRoot":"","sources":["../../../../src/graphql/queries/getMultiReceipts.ts"],"names":[],"mappings":";;AAAA,sDAsDC;AAtDD,SAAgB,qBAAqB,CAAC,YAAiB;IACrD,IAAI,KAAK,GAAG;;mCAEqB,CAAC;IAElC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACxC,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;YACpC,KAAK,IAAI;UACL,GAAG;;qBAEQ,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI;;;;;UAKjC,CAAC;QACP,CAAC;aAAM,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC5C,KAAK,IAAI;UACL,GAAG;;qBAEQ,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI;sBACrB,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM;;;;;UAKpC,CAAC;QACP,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;KAsBN,CAAC;IACJ,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["export function getMultiReceiptsQuery(receiptTypes: any) {\n let query = `\n query GetUserVaultBalances($address: SuiAddress!) {\n address(address: $address) {`;\n\n Object.keys(receiptTypes).forEach((key) => {\n if (receiptTypes[key].cursor === \"\") {\n query += `\n ${key}: objects(\n filter: {\n type: \"${receiptTypes[key].type}\"\n }\n first: 10\n ) {\n ...ReceiptFields\n }`;\n } else if (receiptTypes[key].cursor !== \"0\") {\n query += `\n ${key}: objects(\n filter: {\n type: \"${receiptTypes[key].type}\"\n after: \"${receiptTypes[key].cursor}\"\n }\n first: 10\n ) {\n ...ReceiptFields\n }`;\n }\n });\n\n query += `\n }\n }\n \n fragment ReceiptFields on MoveObjectConnection {\n pageInfo {\n hasNextPage\n endCursor\n }\n nodes {\n address\n version\n digest\n hasPublicTransfer\n contents {\n type {\n repr\n }\n json\n }\n }\n }\n `;\n return query;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_navi_rewards.d.ts","sourceRoot":"","sources":["../../../src/transactions/get_navi_rewards.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get_navi_rewards.d.ts","sourceRoot":"","sources":["../../../src/transactions/get_navi_rewards.ts"],"names":[],"mappings":"AAEA,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,kCAwDxD"}
|
|
@@ -1,42 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAvailableRewards = getAvailableRewards;
|
|
4
|
-
// Fetch polyfill to bypass Cloudflare bot protection
|
|
5
|
-
(() => {
|
|
6
|
-
if (globalThis.fetch.isWraped) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const _fetch = fetch;
|
|
10
|
-
globalThis.fetch = async (input, init) => {
|
|
11
|
-
return _fetch(input, {
|
|
12
|
-
...init,
|
|
13
|
-
headers: {
|
|
14
|
-
...init?.headers,
|
|
15
|
-
Host: "app.naviprotocol.io",
|
|
16
|
-
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36",
|
|
17
|
-
Referer: "https://app.naviprotocol.io/",
|
|
18
|
-
origin: "app.naviprotocol.io",
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
globalThis.fetch.isWraped = true;
|
|
23
|
-
})();
|
|
24
4
|
const lending_1 = require("@naviprotocol/lending");
|
|
25
5
|
async function getAvailableRewards(address) {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
|
|
6
|
+
const originalFetch = globalThis.fetch;
|
|
7
|
+
const headerWrappedFetch = async (input, init) => {
|
|
8
|
+
try {
|
|
9
|
+
const url = typeof input === "string" ? input : input?.url;
|
|
10
|
+
const isNavi = typeof url === "string" &&
|
|
11
|
+
/\.naviprotocol\.io$/i.test(new URL(url).hostname);
|
|
12
|
+
if (!isNavi) {
|
|
13
|
+
return originalFetch(input, init);
|
|
14
|
+
}
|
|
15
|
+
return originalFetch(input, {
|
|
16
|
+
...init,
|
|
17
|
+
headers: {
|
|
18
|
+
...init?.headers,
|
|
19
|
+
Host: "app.naviprotocol.io",
|
|
20
|
+
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36",
|
|
21
|
+
Referer: "https://app.naviprotocol.io/",
|
|
22
|
+
origin: "app.naviprotocol.io",
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
// Fallback: if URL parsing fails, just use the original fetch
|
|
28
|
+
return originalFetch(input, init);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
// Override fetch only within this function's execution
|
|
32
|
+
// and make sure to restore it.
|
|
33
|
+
globalThis.fetch = headerWrappedFetch;
|
|
34
|
+
try {
|
|
35
|
+
const rewards = await (0, lending_1.getUserAvailableLendingRewards)(address);
|
|
36
|
+
// Convert array to map organized by asset coin type (with 0x prefix)
|
|
37
|
+
const rewardsByAsset = {};
|
|
38
|
+
if (Array.isArray(rewards)) {
|
|
39
|
+
for (const reward of rewards) {
|
|
40
|
+
const assetKey = reward.assetCoinType;
|
|
41
|
+
if (assetKey) {
|
|
42
|
+
if (!rewardsByAsset[assetKey]) {
|
|
43
|
+
rewardsByAsset[assetKey] = [];
|
|
44
|
+
}
|
|
45
|
+
rewardsByAsset[assetKey].push(reward);
|
|
35
46
|
}
|
|
36
|
-
rewardsByAsset[assetKey].push(reward);
|
|
37
47
|
}
|
|
38
48
|
}
|
|
49
|
+
return rewardsByAsset;
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
globalThis.fetch = originalFetch;
|
|
39
53
|
}
|
|
40
|
-
return rewardsByAsset;
|
|
41
54
|
}
|
|
42
55
|
//# sourceMappingURL=get_navi_rewards.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_navi_rewards.js","sourceRoot":"","sources":["../../../src/transactions/get_navi_rewards.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"get_navi_rewards.js","sourceRoot":"","sources":["../../../src/transactions/get_navi_rewards.ts"],"names":[],"mappings":";;AAEA,kDAwDC;AA1DD,mDAAuE;AAEhE,KAAK,UAAU,mBAAmB,CAAC,OAAe;IACvD,MAAM,aAAa,GAAG,UAAU,CAAC,KAAK,CAAC;IACvC,MAAM,kBAAkB,GAAG,KAAK,EAAE,KAAU,EAAE,IAAU,EAAE,EAAE;QAC1D,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC;YAC3D,MAAM,MAAM,GACV,OAAO,GAAG,KAAK,QAAQ;gBACvB,sBAAsB,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;YACrD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,aAAa,CAAC,KAAY,EAAE,IAAW,CAAC,CAAC;YAClD,CAAC;YACD,OAAO,aAAa,CAClB,KAAY,EACZ;gBACE,GAAG,IAAI;gBACP,OAAO,EAAE;oBACP,GAAG,IAAI,EAAE,OAAO;oBAChB,IAAI,EAAE,qBAAqB;oBAC3B,YAAY,EACV,uHAAuH;oBACzH,OAAO,EAAE,8BAA8B;oBACvC,MAAM,EAAE,qBAAqB;iBAC9B;aACK,CACT,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,8DAA8D;YAC9D,OAAO,aAAa,CAAC,KAAY,EAAE,IAAW,CAAC,CAAC;QAClD,CAAC;IACH,CAAC,CAAC;IAEF,uDAAuD;IACvD,+BAA+B;IAC9B,UAAkB,CAAC,KAAK,GAAG,kBAAyB,CAAC;IACtD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,IAAA,wCAA8B,EAAC,OAAO,CAAC,CAAC;QAE9D,qEAAqE;QACrE,MAAM,cAAc,GAA0B,EAAE,CAAC;QAEjD,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAC3B,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;gBAC7B,MAAM,QAAQ,GAAG,MAAM,CAAC,aAAa,CAAC;gBACtC,IAAI,QAAQ,EAAE,CAAC;oBACb,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;wBAC9B,cAAc,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;oBAChC,CAAC;oBACD,cAAc,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACxC,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;YAAS,CAAC;QACR,UAAkB,CAAC,KAAK,GAAG,aAAoB,CAAC;IACnD,CAAC;AACH,CAAC","sourcesContent":["import { getUserAvailableLendingRewards } from \"@naviprotocol/lending\";\n\nexport async function getAvailableRewards(address: string) {\n const originalFetch = globalThis.fetch;\n const headerWrappedFetch = async (input: any, init?: any) => {\n try {\n const url = typeof input === \"string\" ? input : input?.url;\n const isNavi =\n typeof url === \"string\" &&\n /\\.naviprotocol\\.io$/i.test(new URL(url).hostname);\n if (!isNavi) {\n return originalFetch(input as any, init as any);\n }\n return originalFetch(\n input as any,\n {\n ...init,\n headers: {\n ...init?.headers,\n Host: \"app.naviprotocol.io\",\n \"User-Agent\":\n \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36\",\n Referer: \"https://app.naviprotocol.io/\",\n origin: \"app.naviprotocol.io\",\n },\n } as any,\n );\n } catch {\n // Fallback: if URL parsing fails, just use the original fetch\n return originalFetch(input as any, init as any);\n }\n };\n\n // Override fetch only within this function's execution\n // and make sure to restore it.\n (globalThis as any).fetch = headerWrappedFetch as any;\n try {\n const rewards = await getUserAvailableLendingRewards(address);\n\n // Convert array to map organized by asset coin type (with 0x prefix)\n const rewardsByAsset: Record<string, any[]> = {};\n\n if (Array.isArray(rewards)) {\n for (const reward of rewards) {\n const assetKey = reward.assetCoinType;\n if (assetKey) {\n if (!rewardsByAsset[assetKey]) {\n rewardsByAsset[assetKey] = [];\n }\n rewardsByAsset[assetKey].push(reward);\n }\n }\n }\n\n return rewardsByAsset;\n } finally {\n (globalThis as any).fetch = originalFetch as any;\n }\n}\n"]}
|
|
@@ -37,7 +37,7 @@ export async function fetchUserVaults(walletAddress) {
|
|
|
37
37
|
address: walletAddress,
|
|
38
38
|
},
|
|
39
39
|
});
|
|
40
|
-
return data?.
|
|
40
|
+
return data?.address;
|
|
41
41
|
}
|
|
42
42
|
export async function fetchUserVaultBalances(walletAddress) {
|
|
43
43
|
const { data: poolsData } = await client.query({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchData.js","sourceRoot":"","sources":["../../../src/graphql/fetchData.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAE3B;;GAEG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,SAAS,EACT,aAAa,EACb,eAAe,GAChB,MAAM,cAAc,CAAC;AActB,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAe;IACvD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAAiB;QAClD,KAAK,EAAE,oBAAoB;QAC3B,SAAS,EAAE,EAAE,OAAO,EAAE;KACvB,CAAC,CAAC;IACH,OAAO,IAAI,EAAE,UAAU,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,i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,IAAI,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAA0B;QAC1E,KAAK,EAAE,aAAa;KACrB,CAAC,CAAC;IACH,MAAM,EAAE,IAAI,EAAE,qBAAqB,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAExD;QACA,KAAK,EAAE,uBAAuB;QAC9B,SAAS,EAAE;YACT,OAAO,EAAE,aAAa;SACvB;KACF,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG;QACX,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;QACpB,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC;QACzB,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC;QACxB,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC;KACjC,CAAC;IAEF,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAA0B;QAC3D,KAAK,EAAE,SAAS;KACjB,CAAC,CAAC;IACH,OAAO,IAAI,IAAI,EAAE,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAA0B;QAC3D,KAAK,EAAE,eAAe;KACvB,CAAC,CAAC;IACH,OAAO,IAAI,IAAI,EAAE,CAAC;AACpB,CAAC;AAED,OAAO,EACL,6BAA6B,GAE9B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,0DAA0D","sourcesContent":["// src/graphql/fetchData.ts\n\n/* This file will contain functions that use the Apollo Client to\n/* execute the queries and return data.\n */\n\nimport client from \"./client.js\";\nimport {\n GET_USER_WALLET_DATA,\n GET_PROTOCOL_DATA,\n GET_PORTFOLIO_DATA,\n GET_CHAIN_IDENTIFIER,\n GET_USER_VAULTS,\n GET_USER_VAULT_BALANCES,\n GET_POOLS,\n GET_INVESTORS,\n GET_CETUS_POOLS,\n} from \"./queries.js\";\n\ntype UserWalletData = {\n userWallet: { coins: { name: string; amount: string }[] };\n};\ntype ProtocolData = {\n protocolData: {\n totalValueLocked: unknown;\n pools: { name: string; tvl: unknown }[];\n };\n};\ntype PortfolioData = { portfolio: { poolName: string; investment: unknown }[] };\ntype ChainIdentifier = { chainIdentifier: string };\n\nexport async function fetchUserWalletData(address: string) {\n const { data } = await client.query<UserWalletData>({\n query: GET_USER_WALLET_DATA,\n variables: { address },\n });\n return data?.userWallet;\n}\n\nexport async function fetchProtocolData() {\n const { data } = await client.query<ProtocolData>({\n query: GET_PROTOCOL_DATA,\n });\n return data?.protocolData;\n}\n\nexport async function fetchPortfolioData(address: string) {\n const { data } = await client.query<PortfolioData>({\n query: GET_PORTFOLIO_DATA,\n variables: { address },\n });\n return data?.portfolio;\n}\n\nexport async function fetchChainIdentifier() {\n const { data } = await client.query<ChainIdentifier>({\n query: GET_CHAIN_IDENTIFIER,\n });\n return data?.chainIdentifier;\n}\n\nexport async function fetchUserVaults(walletAddress: string) {\n const { data } = await client.query<{ address: unknown }>({\n query: GET_USER_VAULTS,\n variables: {\n address: walletAddress,\n },\n });\n return (data as any)?.address;\n}\n\nexport async function fetchUserVaultBalances(walletAddress: string) {\n const { data: poolsData } = await client.query<Record<string, unknown>>({\n query: GET_POOLS,\n });\n const { data: cetusPoolsData } = await client.query<Record<string, unknown>>({\n query: GET_CETUS_POOLS,\n });\n const { data: investorsData } = await client.query<Record<string, unknown>>({\n query: GET_INVESTORS,\n });\n const { data: userVaultBalancesData } = await client.query<\n Record<string, unknown>\n >({\n query: GET_USER_VAULT_BALANCES,\n variables: {\n address: walletAddress,\n },\n });\n\n const data = {\n ...(poolsData ?? {}),\n ...(cetusPoolsData ?? {}),\n ...(investorsData ?? {}),\n ...(userVaultBalancesData ?? {}),\n };\n\n return data;\n}\n\nexport async function fetchPools() {\n const { data } = await client.query<Record<string, unknown>>({\n query: GET_POOLS,\n });\n return data ?? {};\n}\n\nexport async function fetchCetusPools() {\n const { data } = await client.query<Record<string, unknown>>({\n query: GET_CETUS_POOLS,\n });\n return data ?? {};\n}\n\nexport {\n fetchAutoCompoundingEventsGql,\n AutoCompoundingEventNode,\n} from \"./fetchAutoCompoundingEventsGql.js\";\nexport { fetchNftHolders } from \"./fetchNftHolders.js\";\n\n// Add more functions for other data fetching requirements\n"]}
|
|
@@ -3,18 +3,18 @@ import { getMultiReceiptsQuery } from "./queries/getMultiReceipts.js";
|
|
|
3
3
|
import { poolInfo } from "../common/maps.js";
|
|
4
4
|
const client = new ApolloClient({
|
|
5
5
|
link: new HttpLink({
|
|
6
|
-
uri: "https://
|
|
6
|
+
uri: "https://graphql.mainnet.sui.io/graphql",
|
|
7
7
|
}),
|
|
8
8
|
cache: new InMemoryCache({
|
|
9
9
|
typePolicies: {
|
|
10
|
-
|
|
11
|
-
keyFields: (
|
|
12
|
-
const objectKeys = Object.keys(
|
|
10
|
+
Address: {
|
|
11
|
+
keyFields: (addressObj) => {
|
|
12
|
+
const objectKeys = Object.keys(addressObj)
|
|
13
13
|
.filter((k) => k !== "__typename")
|
|
14
14
|
.sort();
|
|
15
15
|
const uniqueKey = objectKeys.join(",");
|
|
16
16
|
// Return the final unique ID string
|
|
17
|
-
return `
|
|
17
|
+
return `Address:${uniqueKey}`;
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
},
|
|
@@ -66,7 +66,7 @@ export async function fetchMultiReceipts(address) {
|
|
|
66
66
|
const data = result.data;
|
|
67
67
|
if (!data)
|
|
68
68
|
break;
|
|
69
|
-
const receipts = data.
|
|
69
|
+
const receipts = data.address;
|
|
70
70
|
hasNextPage = false;
|
|
71
71
|
Object.keys(receipts).forEach((key) => {
|
|
72
72
|
if (key !== "__typename") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMultiReceipts.js","sourceRoot":"","sources":["../../../src/graphql/getMultiReceipts.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BACH,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CACV,yEAAyE,EACzE,KAAK,CACN,CAAC;QACJ,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBACxC,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,MAAM,UAAU,GAA8B,IAAI,GAAG,EAAE,CAAC;IACxD,aAAa,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAChC,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QACxC,IAAI,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,GAAG;YAAE,GAAG,GAAG,EAAE,CAAC;QACnB,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClB,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IACH,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import {\n ApolloClient,\n gql,\n HttpLink,\n InMemoryCache,\n} from \"@apollo/client/core\";\nimport { getMultiReceiptsQuery } from \"./queries/getMultiReceipts.js\";\nimport { ReceiptGQL } from \"./types.js\";\nimport { poolInfo } from \"../common/maps.js\";\n\ntype ReceiptType = {\n type: string;\n cursor: string;\n};\n\nconst client = new ApolloClient({\n link: new HttpLink({\n uri: \"https://graphql.mainnet.sui.io/graphql\",\n }),\n cache: new InMemoryCache({\n typePolicies: {\n Address: {\n keyFields: (addressObj) => {\n const objectKeys = Object.keys(addressObj)\n .filter((k) => k !== \"__typename\")\n .sort();\n const uniqueKey = objectKeys.join(\",\");\n\n // Return the final unique ID string\n return `Address:${uniqueKey}`;\n },\n },\n },\n }),\n});\n\nconst getReceiptTypes = () => {\n const receiptTypes: { [key: string]: ReceiptType } = {};\n const mySet: Set<string> = new Set();\n Object.keys(poolInfo).forEach((pool) => {\n const key = pool.replace(/-/g, \"_\");\n if (!mySet.has(poolInfo[pool].receiptType)) {\n receiptTypes[key] = {\n type: poolInfo[pool].receiptType,\n cursor: \"\",\n } as ReceiptType;\n mySet.add(poolInfo[pool].receiptType);\n }\n });\n return receiptTypes;\n};\n\nexport async function fetchMultiReceipts(\n address: string,\n): Promise<Map<string, ReceiptGQL[]>> {\n const multiReceipts: any[] = [];\n\n const receiptTypes = getReceiptTypes();\n const batchSize = 10; // Set the desired batch size\n\n // Convert the receiptTypes object into an array of entries\n const entries = Object.entries(receiptTypes);\n\n // Create an array to hold the batches\n const batches: { [k: string]: ReceiptType }[] = [];\n //const batches = [];\n // Loop through the entries array and create batches\n for (let i = 0; i < entries.length; i += batchSize) {\n const batchEntries = entries.slice(i, i + batchSize);\n batches.push(Object.fromEntries(batchEntries)); // Convert to object before pushing\n }\n\n for (const receiptTypes of batches) {\n let hasNextPage = true;\n\n try {\n while (hasNextPage) {\n const query = getMultiReceiptsQuery(receiptTypes);\n const GET_RECEIPTS = gql`\n ${query}\n `;\n\n type ReceiptBatchResponse = {\n address: Record<\n string,\n | undefined\n | {\n pageInfo: { hasNextPage: boolean; endCursor: string };\n nodes: any[];\n }\n >;\n };\n const result = await client.query<ReceiptBatchResponse>({\n query: GET_RECEIPTS,\n variables: {\n address: address,\n },\n });\n\n const data = result.data;\n if (!data) break;\n const receipts = data.address;\n hasNextPage = false;\n\n Object.keys(receipts).forEach((key) => {\n if (key !== \"__typename\") {\n const entry = receipts[key];\n if (!entry) return;\n const { pageInfo, nodes } = entry;\n hasNextPage = hasNextPage || pageInfo.hasNextPage;\n if (hasNextPage) receiptTypes[key].cursor = pageInfo.endCursor;\n else receiptTypes[key].cursor = \"0\";\n nodes.forEach((node: any) => {\n multiReceipts.push(node);\n });\n }\n });\n }\n } catch (error) {\n console.warn(\n \"Error fetching receipts from GraphQL, now fetching from suiClient query\",\n error,\n );\n } finally {\n Object.keys(receiptTypes).forEach((key) => {\n receiptTypes[key].cursor = \"\";\n });\n }\n }\n\n const receiptMap: Map<string, ReceiptGQL[]> = new Map();\n multiReceipts.forEach((receipt) => {\n const name = receipt.contents.json.name;\n let arr = receiptMap.get(name);\n if (!arr) arr = [];\n arr.push(receipt);\n receiptMap.set(name, arr);\n });\n return receiptMap;\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export function getMultiReceiptsQuery(receiptTypes) {
|
|
2
2
|
let query = `
|
|
3
3
|
query GetUserVaultBalances($address: SuiAddress!) {
|
|
4
|
-
|
|
4
|
+
address(address: $address) {`;
|
|
5
5
|
Object.keys(receiptTypes).forEach((key) => {
|
|
6
6
|
if (receiptTypes[key].cursor === "") {
|
|
7
7
|
query += `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMultiReceipts.js","sourceRoot":"","sources":["../../../../src/graphql/queries/getMultiReceipts.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,qBAAqB,CAAC,YAAiB;IACrD,IAAI,KAAK,GAAG;;
|
|
1
|
+
{"version":3,"file":"getMultiReceipts.js","sourceRoot":"","sources":["../../../../src/graphql/queries/getMultiReceipts.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,qBAAqB,CAAC,YAAiB;IACrD,IAAI,KAAK,GAAG;;mCAEqB,CAAC;IAElC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACxC,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;YACpC,KAAK,IAAI;UACL,GAAG;;qBAEQ,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI;;;;;UAKjC,CAAC;QACP,CAAC;aAAM,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC5C,KAAK,IAAI;UACL,GAAG;;qBAEQ,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI;sBACrB,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM;;;;;UAKpC,CAAC;QACP,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;;KAsBN,CAAC;IACJ,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["export function getMultiReceiptsQuery(receiptTypes: any) {\n let query = `\n query GetUserVaultBalances($address: SuiAddress!) {\n address(address: $address) {`;\n\n Object.keys(receiptTypes).forEach((key) => {\n if (receiptTypes[key].cursor === \"\") {\n query += `\n ${key}: objects(\n filter: {\n type: \"${receiptTypes[key].type}\"\n }\n first: 10\n ) {\n ...ReceiptFields\n }`;\n } else if (receiptTypes[key].cursor !== \"0\") {\n query += `\n ${key}: objects(\n filter: {\n type: \"${receiptTypes[key].type}\"\n after: \"${receiptTypes[key].cursor}\"\n }\n first: 10\n ) {\n ...ReceiptFields\n }`;\n }\n });\n\n query += `\n }\n }\n \n fragment ReceiptFields on MoveObjectConnection {\n pageInfo {\n hasNextPage\n endCursor\n }\n nodes {\n address\n version\n digest\n hasPublicTransfer\n contents {\n type {\n repr\n }\n json\n }\n }\n }\n `;\n return query;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_navi_rewards.d.ts","sourceRoot":"","sources":["../../../src/transactions/get_navi_rewards.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get_navi_rewards.d.ts","sourceRoot":"","sources":["../../../src/transactions/get_navi_rewards.ts"],"names":[],"mappings":"AAEA,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,kCAwDxD"}
|
|
@@ -1,39 +1,52 @@
|
|
|
1
|
-
// Fetch polyfill to bypass Cloudflare bot protection
|
|
2
|
-
(() => {
|
|
3
|
-
if (globalThis.fetch.isWraped) {
|
|
4
|
-
return;
|
|
5
|
-
}
|
|
6
|
-
const _fetch = fetch;
|
|
7
|
-
globalThis.fetch = async (input, init) => {
|
|
8
|
-
return _fetch(input, {
|
|
9
|
-
...init,
|
|
10
|
-
headers: {
|
|
11
|
-
...init?.headers,
|
|
12
|
-
Host: "app.naviprotocol.io",
|
|
13
|
-
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36",
|
|
14
|
-
Referer: "https://app.naviprotocol.io/",
|
|
15
|
-
origin: "app.naviprotocol.io",
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
globalThis.fetch.isWraped = true;
|
|
20
|
-
})();
|
|
21
1
|
import { getUserAvailableLendingRewards } from "@naviprotocol/lending";
|
|
22
2
|
export async function getAvailableRewards(address) {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
|
|
3
|
+
const originalFetch = globalThis.fetch;
|
|
4
|
+
const headerWrappedFetch = async (input, init) => {
|
|
5
|
+
try {
|
|
6
|
+
const url = typeof input === "string" ? input : input?.url;
|
|
7
|
+
const isNavi = typeof url === "string" &&
|
|
8
|
+
/\.naviprotocol\.io$/i.test(new URL(url).hostname);
|
|
9
|
+
if (!isNavi) {
|
|
10
|
+
return originalFetch(input, init);
|
|
11
|
+
}
|
|
12
|
+
return originalFetch(input, {
|
|
13
|
+
...init,
|
|
14
|
+
headers: {
|
|
15
|
+
...init?.headers,
|
|
16
|
+
Host: "app.naviprotocol.io",
|
|
17
|
+
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36",
|
|
18
|
+
Referer: "https://app.naviprotocol.io/",
|
|
19
|
+
origin: "app.naviprotocol.io",
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
// Fallback: if URL parsing fails, just use the original fetch
|
|
25
|
+
return originalFetch(input, init);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
// Override fetch only within this function's execution
|
|
29
|
+
// and make sure to restore it.
|
|
30
|
+
globalThis.fetch = headerWrappedFetch;
|
|
31
|
+
try {
|
|
32
|
+
const rewards = await getUserAvailableLendingRewards(address);
|
|
33
|
+
// Convert array to map organized by asset coin type (with 0x prefix)
|
|
34
|
+
const rewardsByAsset = {};
|
|
35
|
+
if (Array.isArray(rewards)) {
|
|
36
|
+
for (const reward of rewards) {
|
|
37
|
+
const assetKey = reward.assetCoinType;
|
|
38
|
+
if (assetKey) {
|
|
39
|
+
if (!rewardsByAsset[assetKey]) {
|
|
40
|
+
rewardsByAsset[assetKey] = [];
|
|
41
|
+
}
|
|
42
|
+
rewardsByAsset[assetKey].push(reward);
|
|
32
43
|
}
|
|
33
|
-
rewardsByAsset[assetKey].push(reward);
|
|
34
44
|
}
|
|
35
45
|
}
|
|
46
|
+
return rewardsByAsset;
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
globalThis.fetch = originalFetch;
|
|
36
50
|
}
|
|
37
|
-
return rewardsByAsset;
|
|
38
51
|
}
|
|
39
52
|
//# sourceMappingURL=get_navi_rewards.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_navi_rewards.js","sourceRoot":"","sources":["../../../src/transactions/get_navi_rewards.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"get_navi_rewards.js","sourceRoot":"","sources":["../../../src/transactions/get_navi_rewards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAEvE,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAe;IACvD,MAAM,aAAa,GA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CAAC;oBACb,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;wBAC9B,cAAc,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;oBAChC,CAAC;oBACD,cAAc,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACxC,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;YAAS,CAAC;QACR,UAAkB,CAAC,KAAK,GAAG,aAAoB,CAAC;IACnD,CAAC;AACH,CAAC","sourcesContent":["import { getUserAvailableLendingRewards } from \"@naviprotocol/lending\";\n\nexport async function getAvailableRewards(address: string) {\n const originalFetch = globalThis.fetch;\n const headerWrappedFetch = async (input: any, init?: any) => {\n try {\n const url = typeof input === \"string\" ? input : input?.url;\n const isNavi =\n typeof url === \"string\" &&\n /\\.naviprotocol\\.io$/i.test(new URL(url).hostname);\n if (!isNavi) {\n return originalFetch(input as any, init as any);\n }\n return originalFetch(\n input as any,\n {\n ...init,\n headers: {\n ...init?.headers,\n Host: \"app.naviprotocol.io\",\n \"User-Agent\":\n \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36\",\n Referer: \"https://app.naviprotocol.io/\",\n origin: \"app.naviprotocol.io\",\n },\n } as any,\n );\n } catch {\n // Fallback: if URL parsing fails, just use the original fetch\n return originalFetch(input as any, init as any);\n }\n };\n\n // Override fetch only within this function's execution\n // and make sure to restore it.\n (globalThis as any).fetch = headerWrappedFetch as any;\n try {\n const rewards = await getUserAvailableLendingRewards(address);\n\n // Convert array to map organized by asset coin type (with 0x prefix)\n const rewardsByAsset: Record<string, any[]> = {};\n\n if (Array.isArray(rewards)) {\n for (const reward of rewards) {\n const assetKey = reward.assetCoinType;\n if (assetKey) {\n if (!rewardsByAsset[assetKey]) {\n rewardsByAsset[assetKey] = [];\n }\n rewardsByAsset[assetKey].push(reward);\n }\n }\n }\n\n return rewardsByAsset;\n } finally {\n (globalThis as any).fetch = originalFetch as any;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>alphaLpBreakdown | @alphafi/alphafi-sdk - v0.0.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>alphaLpBreakdown | @alphafi/alphafi-sdk - v0.0.96</title><meta name="description" content="Documentation for @alphafi/alphafi-sdk"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@alphafi/alphafi-sdk - v0.0.96</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">alphaLpBreakdown</a></li></ul><h1>Function alphaLpBreakdown</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="alphalpbreakdown"><span class="tsd-kind-call-signature">alphaLpBreakdown</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">poolName</span><span class="tsd-signature-symbol">:</span> <a href="../types/PoolName.html" class="tsd-signature-type tsd-kind-type-alias">PoolName</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/LpBreakdownType.html" class="tsd-signature-type tsd-kind-type-alias">LpBreakdownType</a><span class="tsd-signature-symbol">></span><a href="#alphalpbreakdown" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">poolName</span>: <a href="../types/PoolName.html" class="tsd-signature-type tsd-kind-type-alias">PoolName</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/LpBreakdownType.html" class="tsd-signature-type tsd-kind-type-alias">LpBreakdownType</a><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/AlphaFiTech/alphafi-sdk/blob/6788641cdcd19ff562b9ee802e6838a861c225af/src/vaultFunctions.ts#L5">vaultFunctions.ts:5</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@alphafi/alphafi-sdk - v0.0.96</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>cetusLpBreakdown | @alphafi/alphafi-sdk - v0.0.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>cetusLpBreakdown | @alphafi/alphafi-sdk - v0.0.96</title><meta name="description" content="Documentation for @alphafi/alphafi-sdk"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@alphafi/alphafi-sdk - v0.0.96</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">cetusLpBreakdown</a></li></ul><h1>Function cetusLpBreakdown</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="cetuslpbreakdown"><span class="tsd-kind-call-signature">cetusLpBreakdown</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">poolName</span><span class="tsd-signature-symbol">:</span> <a href="../types/PoolName.html" class="tsd-signature-type tsd-kind-type-alias">PoolName</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/LpBreakdownType.html" class="tsd-signature-type tsd-kind-type-alias">LpBreakdownType</a><span class="tsd-signature-symbol">></span><a href="#cetuslpbreakdown" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">poolName</span>: <a href="../types/PoolName.html" class="tsd-signature-type tsd-kind-type-alias">PoolName</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../types/LpBreakdownType.html" class="tsd-signature-type tsd-kind-type-alias">LpBreakdownType</a><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/AlphaFiTech/alphafi-sdk/blob/6788641cdcd19ff562b9ee802e6838a861c225af/src/vaultFunctions.ts#L20">vaultFunctions.ts:20</a></li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@alphafi/alphafi-sdk - v0.0.96</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|