@alphafi/alphafi-sdk 0.0.39 → 0.0.41
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/adminFunctions.d.ts.map +1 -1
- package/dist/cjs/adminFunctions.js +9 -1
- package/dist/cjs/adminFunctions.js.map +1 -1
- package/dist/cjs/common/coins.d.ts.map +1 -1
- package/dist/cjs/common/coins.js +18 -0
- package/dist/cjs/common/coins.js.map +1 -1
- package/dist/cjs/common/constants.d.ts +288 -0
- package/dist/cjs/common/constants.d.ts.map +1 -1
- package/dist/cjs/common/constants.js +214 -8
- package/dist/cjs/common/constants.js.map +1 -1
- package/dist/cjs/common/maps.d.ts +1 -0
- package/dist/cjs/common/maps.d.ts.map +1 -1
- package/dist/cjs/common/maps.js +207 -14
- package/dist/cjs/common/maps.js.map +1 -1
- package/dist/cjs/common/types.d.ts +58 -5
- package/dist/cjs/common/types.d.ts.map +1 -1
- package/dist/cjs/common/types.js.map +1 -1
- package/dist/cjs/graphql/getMultiReceipts.d.ts.map +1 -1
- package/dist/cjs/graphql/getMultiReceipts.js +49 -36
- package/dist/cjs/graphql/getMultiReceipts.js.map +1 -1
- package/dist/cjs/index.d.ts +5 -9
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +17 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/sui-sdk/functions/fetchUserVaultBalances.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/functions/fetchUserVaultBalances.js +2 -3
- package/dist/cjs/sui-sdk/functions/fetchUserVaultBalances.js.map +1 -1
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js +6 -12
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js.map +1 -1
- package/dist/cjs/sui-sdk/functions/getReceipts.d.ts +6 -3
- package/dist/cjs/sui-sdk/functions/getReceipts.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/functions/getReceipts.js +42 -26
- package/dist/cjs/sui-sdk/functions/getReceipts.js.map +1 -1
- package/dist/cjs/transactions/7k.d.ts +13 -0
- package/dist/cjs/transactions/7k.d.ts.map +1 -0
- package/dist/cjs/transactions/7k.js +46 -0
- package/dist/cjs/transactions/7k.js.map +1 -0
- package/dist/cjs/transactions/alpha.d.ts.map +1 -1
- package/dist/cjs/transactions/alpha.js +1 -0
- package/dist/cjs/transactions/alpha.js.map +1 -1
- package/dist/cjs/transactions/bluefin.d.ts +12 -0
- package/dist/cjs/transactions/bluefin.d.ts.map +1 -1
- package/dist/cjs/transactions/bluefin.js +937 -91
- package/dist/cjs/transactions/bluefin.js.map +1 -1
- package/dist/cjs/transactions/cetus.d.ts +0 -3
- package/dist/cjs/transactions/cetus.d.ts.map +1 -1
- package/dist/cjs/transactions/cetus.js +4 -63
- package/dist/cjs/transactions/cetus.js.map +1 -1
- package/dist/cjs/transactions/deposit.d.ts +3 -0
- package/dist/cjs/transactions/deposit.d.ts.map +1 -1
- package/dist/cjs/transactions/deposit.js +77 -1
- package/dist/cjs/transactions/deposit.js.map +1 -1
- package/dist/cjs/transactions/deposit1.d.ts +1 -0
- package/dist/cjs/transactions/deposit1.d.ts.map +1 -0
- package/dist/cjs/transactions/deposit1.js +86 -0
- package/dist/cjs/transactions/deposit1.js.map +1 -0
- package/dist/cjs/transactions/types.d.ts +14 -0
- package/dist/cjs/transactions/types.d.ts.map +1 -0
- package/dist/cjs/transactions/types.js +3 -0
- package/dist/cjs/transactions/types.js.map +1 -0
- package/dist/cjs/transactions/withdraw.d.ts.map +1 -1
- package/dist/cjs/transactions/withdraw.js +17 -2
- package/dist/cjs/transactions/withdraw.js.map +1 -1
- package/dist/cjs/transactions/zapDeposit.d.ts +9 -0
- package/dist/cjs/transactions/zapDeposit.d.ts.map +1 -1
- package/dist/cjs/transactions/zapDeposit.js +1117 -725
- package/dist/cjs/transactions/zapDeposit.js.map +1 -1
- package/dist/esm/adminFunctions.d.ts.map +1 -1
- package/dist/esm/adminFunctions.js +10 -2
- package/dist/esm/adminFunctions.js.map +1 -1
- package/dist/esm/common/coins.d.ts.map +1 -1
- package/dist/esm/common/coins.js +18 -0
- package/dist/esm/common/coins.js.map +1 -1
- package/dist/esm/common/constants.d.ts +288 -0
- package/dist/esm/common/constants.d.ts.map +1 -1
- package/dist/esm/common/constants.js +214 -8
- package/dist/esm/common/constants.js.map +1 -1
- package/dist/esm/common/maps.d.ts +1 -0
- package/dist/esm/common/maps.d.ts.map +1 -1
- package/dist/esm/common/maps.js +206 -13
- package/dist/esm/common/maps.js.map +1 -1
- package/dist/esm/common/types.d.ts +58 -5
- package/dist/esm/common/types.d.ts.map +1 -1
- package/dist/esm/common/types.js.map +1 -1
- package/dist/esm/graphql/getMultiReceipts.d.ts.map +1 -1
- package/dist/esm/graphql/getMultiReceipts.js +49 -36
- package/dist/esm/graphql/getMultiReceipts.js.map +1 -1
- package/dist/esm/index.d.ts +5 -9
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/sui-sdk/functions/fetchUserVaultBalances.d.ts.map +1 -1
- package/dist/esm/sui-sdk/functions/fetchUserVaultBalances.js +2 -3
- package/dist/esm/sui-sdk/functions/fetchUserVaultBalances.js.map +1 -1
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.d.ts.map +1 -1
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js +7 -13
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js.map +1 -1
- package/dist/esm/sui-sdk/functions/getReceipts.d.ts +6 -3
- package/dist/esm/sui-sdk/functions/getReceipts.d.ts.map +1 -1
- package/dist/esm/sui-sdk/functions/getReceipts.js +43 -26
- package/dist/esm/sui-sdk/functions/getReceipts.js.map +1 -1
- package/dist/esm/transactions/7k.d.ts +13 -0
- package/dist/esm/transactions/7k.d.ts.map +1 -0
- package/dist/esm/transactions/7k.js +42 -0
- package/dist/esm/transactions/7k.js.map +1 -0
- package/dist/esm/transactions/alpha.d.ts.map +1 -1
- package/dist/esm/transactions/alpha.js +1 -0
- package/dist/esm/transactions/alpha.js.map +1 -1
- package/dist/esm/transactions/bluefin.d.ts +12 -0
- package/dist/esm/transactions/bluefin.d.ts.map +1 -1
- package/dist/esm/transactions/bluefin.js +928 -86
- package/dist/esm/transactions/bluefin.js.map +1 -1
- package/dist/esm/transactions/cetus.d.ts +0 -3
- package/dist/esm/transactions/cetus.d.ts.map +1 -1
- package/dist/esm/transactions/cetus.js +2 -57
- package/dist/esm/transactions/cetus.js.map +1 -1
- package/dist/esm/transactions/deposit.d.ts +3 -0
- package/dist/esm/transactions/deposit.d.ts.map +1 -1
- package/dist/esm/transactions/deposit.js +74 -2
- package/dist/esm/transactions/deposit.js.map +1 -1
- package/dist/esm/transactions/deposit1.d.ts +2 -0
- package/dist/esm/transactions/deposit1.d.ts.map +1 -0
- package/dist/esm/transactions/deposit1.js +86 -0
- package/dist/esm/transactions/deposit1.js.map +1 -0
- package/dist/esm/transactions/types.d.ts +14 -0
- package/dist/esm/transactions/types.d.ts.map +1 -0
- package/dist/esm/transactions/types.js +2 -0
- package/dist/esm/transactions/types.js.map +1 -0
- package/dist/esm/transactions/withdraw.d.ts.map +1 -1
- package/dist/esm/transactions/withdraw.js +18 -3
- package/dist/esm/transactions/withdraw.js.map +1 -1
- package/dist/esm/transactions/zapDeposit.d.ts +9 -1
- package/dist/esm/transactions/zapDeposit.d.ts.map +1 -1
- package/dist/esm/transactions/zapDeposit.js +1113 -726
- package/dist/esm/transactions/zapDeposit.js.map +1 -1
- package/docs/assets/highlight.css +78 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1493 -0
- package/docs/functions/alphaLpBreakdown.html +1 -0
- package/docs/functions/cetusLpBreakdown.html +1 -0
- package/docs/functions/claimRewardTxb.html +1 -0
- package/docs/functions/coinAmountToXTokensDoubleAsset.html +1 -0
- package/docs/functions/coinAmountToXTokensSingleAsset.html +1 -0
- package/docs/functions/coinsInPool.html +1 -0
- package/docs/functions/collectRewards.html +1 -0
- package/docs/functions/deposit.html +1 -0
- package/docs/functions/depositDoubleAssetTxb.html +1 -0
- package/docs/functions/depositSingleAssetTxb.html +1 -0
- package/docs/functions/fetchAfterTransactionEvents.html +1 -0
- package/docs/functions/fetchAutoCompoundingEvents.html +1 -0
- package/docs/functions/fetchAutoCompoundingEventsGql.html +1 -0
- package/docs/functions/fetchCetusPools.html +1 -0
- package/docs/functions/fetchChainIdentifier.html +1 -0
- package/docs/functions/fetchCheckRatioEvents.html +1 -0
- package/docs/functions/fetchLiquidityChangeEvents.html +1 -0
- package/docs/functions/fetchMultiReceipts.html +1 -0
- package/docs/functions/fetchNftHolders.html +1 -0
- package/docs/functions/fetchPools.html +1 -0
- package/docs/functions/fetchPortfolioData.html +1 -0
- package/docs/functions/fetchProtocolData.html +1 -0
- package/docs/functions/fetchTVL.html +1 -0
- package/docs/functions/fetchUserVaultBalances.html +1 -0
- package/docs/functions/fetchUserVaults.html +1 -0
- package/docs/functions/fetchUserWalletData.html +1 -0
- package/docs/functions/fetchWithdrawV2Events.html +1 -0
- package/docs/functions/getAirdropShare.html +1 -0
- package/docs/functions/getAllDoubleAssetVaults.html +1 -0
- package/docs/functions/getAllSingleAssetVaults.html +1 -0
- package/docs/functions/getAllVaultBalances.html +1 -0
- package/docs/functions/getAllVaults.html +1 -0
- package/docs/functions/getAlphaUnlocks.html +1 -0
- package/docs/functions/getAlphaVaultBalance.html +1 -0
- package/docs/functions/getAmounts.html +1 -0
- package/docs/functions/getApr.html +1 -0
- package/docs/functions/getAprs.html +1 -0
- package/docs/functions/getApy.html +1 -0
- package/docs/functions/getApys.html +1 -0
- package/docs/functions/getCetusInvestorTicksMap.html +1 -0
- package/docs/functions/getCetusSqrtPriceMap.html +1 -0
- package/docs/functions/getCoinAmountsFromLiquidity.html +1 -0
- package/docs/functions/getConf.html +1 -0
- package/docs/functions/getCurrentTick.html +1 -0
- package/docs/functions/getDoubleAssetVaultBalance.html +1 -0
- package/docs/functions/getDoubleAssetVaults.html +1 -0
- package/docs/functions/getHoldersFromTransactions.html +1 -0
- package/docs/functions/getInvestor.html +1 -0
- package/docs/functions/getInvestorPoolMap.html +1 -0
- package/docs/functions/getLastAutoCompoundTime.html +1 -0
- package/docs/functions/getLatestPrices.html +1 -0
- package/docs/functions/getLiquidity.html +1 -0
- package/docs/functions/getMultiInvestor.html +1 -0
- package/docs/functions/getMultiLatestPrices.html +1 -0
- package/docs/functions/getMultiParentPool.html +1 -0
- package/docs/functions/getMultiPool.html +1 -0
- package/docs/functions/getMultiReceipts.html +1 -0
- package/docs/functions/getParentPool.html +1 -0
- package/docs/functions/getPool.html +1 -0
- package/docs/functions/getPoolExchangeRateMap.html +1 -0
- package/docs/functions/getPositionRange.html +1 -0
- package/docs/functions/getPositionTicks.html +1 -0
- package/docs/functions/getPriceToTick.html +1 -0
- package/docs/functions/getRebalanceHistories.html +1 -0
- package/docs/functions/getRebalanceHistory.html +1 -0
- package/docs/functions/getReceipts.html +1 -0
- package/docs/functions/getSingleAssetVaultBalance.html +1 -0
- package/docs/functions/getSingleAssetVaults.html +1 -0
- package/docs/functions/getSuiClient.html +3 -0
- package/docs/functions/getSuiNodeUrl.html +3 -0
- package/docs/functions/getTVLs.html +1 -0
- package/docs/functions/getTickToPrice.html +1 -0
- package/docs/functions/getUserTokensFromTransactions.html +1 -0
- package/docs/functions/getUserTokensInUsdFromTransactions.html +1 -0
- package/docs/functions/getVaultBalance.html +1 -0
- package/docs/functions/getVaultBalanceForActiveUsers.html +1 -0
- package/docs/functions/getVaults.html +1 -0
- package/docs/functions/getXTokenVaultBalanceForActiveUsers.html +1 -0
- package/docs/functions/getZapAmounts.html +1 -0
- package/docs/functions/lastAutocompoundTime.html +1 -0
- package/docs/functions/liquidityToTokens.html +1 -0
- package/docs/functions/multiLiquidityToTokens.html +1 -0
- package/docs/functions/multiTokensToUsd.html +1 -0
- package/docs/functions/multiXTokensToLiquidity.html +1 -0
- package/docs/functions/parseUserWalletData.html +1 -0
- package/docs/functions/setSuiClient.html +7 -0
- package/docs/functions/setSuiNodeUrl.html +5 -0
- package/docs/functions/withdraw.html +1 -0
- package/docs/functions/withdrawAlphaTxb.html +1 -0
- package/docs/functions/withdrawTxb.html +1 -0
- package/docs/functions/zapDepositTxb.html +1 -0
- package/docs/index.html +76 -0
- package/docs/interfaces/Coin.html +12 -0
- package/docs/interfaces/CoinPair.html +3 -0
- package/docs/interfaces/NaviVoloData.html +3 -0
- package/docs/interfaces/RebalanceHistoryType.html +9 -0
- package/docs/modules.html +177 -0
- package/docs/types/AfterTransactionEventNode.html +1 -0
- package/docs/types/Allocator.html +1 -0
- package/docs/types/AlphaFiDoubleAssetVault.html +1 -0
- package/docs/types/AlphaFiMultiVaultBalance.html +1 -0
- package/docs/types/AlphaFiSingleAssetVault.html +1 -0
- package/docs/types/AlphaFiVault.html +1 -0
- package/docs/types/AlphaFiVaultBalance.html +1 -0
- package/docs/types/AlphaPoolType.html +1 -0
- package/docs/types/AlphaReceipt.html +1 -0
- package/docs/types/AlphaReceiptFields.html +1 -0
- package/docs/types/AlphaVaultBalance.html +1 -0
- package/docs/types/AutoCompoundingEventNode.html +1 -0
- package/docs/types/BluefinInvestor.html +1 -0
- package/docs/types/BluefinPoolType.html +1 -0
- package/docs/types/BucketInvestor.html +1 -0
- package/docs/types/CetusInvestor.html +1 -0
- package/docs/types/CetusPoolType.html +1 -0
- package/docs/types/CetusSwapOptions.html +1 -0
- package/docs/types/CoinAmounts.html +1 -0
- package/docs/types/CoinName.html +1 -0
- package/docs/types/CoinType.html +1 -0
- package/docs/types/CommonInvestorFields.html +1 -0
- package/docs/types/CreatePoolOptions.html +1 -0
- package/docs/types/Distributor.html +1 -0
- package/docs/types/DoubleAssetMultiVaultBalance.html +1 -0
- package/docs/types/DoubleAssetPoolNames.html +1 -0
- package/docs/types/DoubleAssetTokenHoldings.html +1 -0
- package/docs/types/DoubleAssetVaultBalance.html +1 -0
- package/docs/types/GetHoldersParams.html +1 -0
- package/docs/types/GetTokenHoldingsParams.html +1 -0
- package/docs/types/GetUserTokensFromTransactionsParams.html +1 -0
- package/docs/types/GetUserTokensInUsdFromTransactionsParams.html +1 -0
- package/docs/types/GetVaultBalanceForActiveUsersParams.html +1 -0
- package/docs/types/GetVaultBalanceParams.html +1 -0
- package/docs/types/HoldingsObj.html +1 -0
- package/docs/types/Icon.html +1 -0
- package/docs/types/Investor.html +1 -0
- package/docs/types/LiquidityChangeEventNode.html +1 -0
- package/docs/types/LiquidityToTokensParams.html +1 -0
- package/docs/types/LiquidityToUsdParams.html +1 -0
- package/docs/types/LoopingDebt.html +1 -0
- package/docs/types/LpBreakdownType.html +1 -0
- package/docs/types/MemberPoolDataType.html +1 -0
- package/docs/types/MemberType.html +1 -0
- package/docs/types/MultiGetVaultBalancesParams.html +1 -0
- package/docs/types/NaviInvestor.html +1 -0
- package/docs/types/OtherReceiptFields.html +1 -0
- package/docs/types/PoolName.html +1 -0
- package/docs/types/PoolReceipt.html +1 -0
- package/docs/types/PoolType.html +1 -0
- package/docs/types/Receipt.html +1 -0
- package/docs/types/ReceiptGQL.html +1 -0
- package/docs/types/SingleAssetMultiVaultBalance.html +1 -0
- package/docs/types/SingleAssetPoolNames.html +1 -0
- package/docs/types/SingleAssetTokenHoldings.html +1 -0
- package/docs/types/SingleAssetVaultBalance.html +1 -0
- package/docs/types/SingleGetVaultBalancesParams.html +1 -0
- package/docs/types/StrategyType.html +1 -0
- package/docs/types/SuiNetwork.html +1 -0
- package/docs/types/SwapOptions.html +1 -0
- package/docs/types/TickSpacing.html +1 -0
- package/docs/types/TotalWeightType.html +1 -0
- package/docs/types/TransactionBlockType.html +1 -0
- package/docs/types/UserPoolLiquidity.html +1 -0
- package/docs/types/UserPoolTokenHoldings.html +1 -0
- package/docs/types/UserUsdHoldings.html +1 -0
- package/docs/types/VaultBalance.html +1 -0
- package/docs/types/WithdrawV2EventNode.html +1 -0
- package/docs/variables/bluefinPoolMap.html +1 -0
- package/docs/variables/cetusPoolMap.html +1 -0
- package/docs/variables/coinsList.html +1 -0
- package/docs/variables/defunctPoolsSet.html +1 -0
- package/docs/variables/doubleAssetPoolCoinMap.html +1 -0
- package/docs/variables/ignoredWalletsForDailyRevenue.html +1 -0
- package/docs/variables/loopingAccountAddresses.html +1 -0
- package/docs/variables/loopingPoolCoinMap.html +1 -0
- package/docs/variables/naviAssetMap.html +1 -0
- package/docs/variables/poolIdPoolNameMap.html +1 -0
- package/docs/variables/poolInfo.html +1 -0
- package/docs/variables/singleAssetPoolCoinMap.html +1 -0
- package/docs/variables/stableCoins.html +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SevenKGateway = void 0;
|
|
4
|
+
const sdk_ts_1 = require("@7kprotocol/sdk-ts");
|
|
5
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
|
6
|
+
const client_js_1 = require("../sui-sdk/client.js");
|
|
7
|
+
class SevenKGateway {
|
|
8
|
+
constructor() {
|
|
9
|
+
const suiClient = (0, client_js_1.getSuiClient)();
|
|
10
|
+
(0, sdk_ts_1.setSuiClient)(suiClient);
|
|
11
|
+
}
|
|
12
|
+
async getQuote(options) {
|
|
13
|
+
const { pair, inAmount } = options;
|
|
14
|
+
if (inAmount) {
|
|
15
|
+
const quoteResponse = await (0, sdk_ts_1.getQuote)({
|
|
16
|
+
tokenIn: pair.coinA.type,
|
|
17
|
+
tokenOut: pair.coinB.type,
|
|
18
|
+
amountIn: inAmount.toString(),
|
|
19
|
+
});
|
|
20
|
+
return quoteResponse;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
// getTransactionBlock returns a transaction and also returns a coinOut argument which is some coins left out that we have to transfer to the user seperately.
|
|
24
|
+
async getTransactionBlock(options, quoteResponse, transaction = undefined) {
|
|
25
|
+
let txb = new transactions_1.Transaction();
|
|
26
|
+
const { senderAddress, slippage } = options;
|
|
27
|
+
if (transaction)
|
|
28
|
+
txb = transaction;
|
|
29
|
+
const commissionPartnerAddress = "0x401c29204828bed9a2f9f65f9da9b9e54b1e43178c88811e2584e05cf2c3eb6f";
|
|
30
|
+
const { tx, coinOut } = await (0, sdk_ts_1.buildTx)({
|
|
31
|
+
quoteResponse,
|
|
32
|
+
accountAddress: senderAddress,
|
|
33
|
+
slippage: slippage, // 1%
|
|
34
|
+
commission: {
|
|
35
|
+
partner: commissionPartnerAddress,
|
|
36
|
+
commissionBps: 0,
|
|
37
|
+
},
|
|
38
|
+
extendTx: {
|
|
39
|
+
tx: txb,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
return { tx, coinOut };
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.SevenKGateway = SevenKGateway;
|
|
46
|
+
//# sourceMappingURL=7k.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"7k.js","sourceRoot":"","sources":["../../../src/transactions/7k.ts"],"names":[],"mappings":";;;AAAA,+CAK4B;AAC5B,2DAGkC;AAElC,oDAAoD;AAIpD,MAAa,aAAa;IACxB;QACE,MAAM,SAAS,GAAG,IAAA,wBAAY,GAAE,CAAC;QACjC,IAAA,qBAAY,EAAC,SAAS,CAAC,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAA0B;QACvC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;QACnC,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,aAAa,GAAG,MAAM,IAAA,iBAAQ,EAAC;gBACnC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;gBACxB,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;gBACzB,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE;aAC9B,CAAC,CAAC;YACH,OAAO,aAAa,CAAC;QACvB,CAAC;IACH,CAAC;IAED,8JAA8J;IAC9J,KAAK,CAAC,mBAAmB,CACvB,OAA0B,EAC1B,aAA4B,EAC5B,cAAuC,SAAS;QAKhD,IAAI,GAAG,GAAG,IAAI,0BAAW,EAAE,CAAC;QAC5B,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;QAC5C,IAAI,WAAW;YAAE,GAAG,GAAG,WAAW,CAAC;QACnC,MAAM,wBAAwB,GAC5B,oEAAoE,CAAC;QACvE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,MAAM,IAAA,gBAAO,EAAC;YACpC,aAAa;YACb,cAAc,EAAE,aAAa;YAC7B,QAAQ,EAAE,QAAQ,EAAE,KAAK;YACzB,UAAU,EAAE;gBACV,OAAO,EAAE,wBAAwB;gBACjC,aAAa,EAAE,CAAC;aACjB;YACD,QAAQ,EAAE;gBACR,EAAE,EAAE,GAAG;aACR;SACF,CAAC,CAAC;QACH,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC;IACzB,CAAC;CACF;AA9CD,sCA8CC","sourcesContent":["import {\n buildTx,\n getQuote,\n QuoteResponse,\n setSuiClient,\n} from \"@7kprotocol/sdk-ts\";\nimport {\n Transaction,\n TransactionObjectArgument,\n} from \"@mysten/sui/transactions\";\nimport { SwapOptions } from \"../common/types.js\";\nimport { getSuiClient } from \"../sui-sdk/client.js\";\n\nexport type sevenKSwapOptions = SwapOptions;\n\nexport class SevenKGateway {\n constructor() {\n const suiClient = getSuiClient();\n setSuiClient(suiClient);\n }\n\n async getQuote(options: sevenKSwapOptions) {\n const { pair, inAmount } = options;\n if (inAmount) {\n const quoteResponse = await getQuote({\n tokenIn: pair.coinA.type,\n tokenOut: pair.coinB.type,\n amountIn: inAmount.toString(),\n });\n return quoteResponse;\n }\n }\n\n // getTransactionBlock returns a transaction and also returns a coinOut argument which is some coins left out that we have to transfer to the user seperately.\n async getTransactionBlock(\n options: sevenKSwapOptions,\n quoteResponse: QuoteResponse,\n transaction: Transaction | undefined = undefined,\n ): Promise<{\n tx: Transaction;\n coinOut: TransactionObjectArgument | undefined;\n }> {\n let txb = new Transaction();\n const { senderAddress, slippage } = options;\n if (transaction) txb = transaction;\n const commissionPartnerAddress =\n \"0x401c29204828bed9a2f9f65f9da9b9e54b1e43178c88811e2584e05cf2c3eb6f\";\n const { tx, coinOut } = await buildTx({\n quoteResponse,\n accountAddress: senderAddress,\n slippage: slippage, // 1%\n commission: {\n partner: commissionPartnerAddress,\n commissionBps: 0,\n },\n extendTx: {\n tx: txb,\n },\n });\n return { tx, coinOut };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.d.ts","sourceRoot":"","sources":["../../../src/transactions/alpha.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAIvD,eAAO,MAAM,eAAe,WAClB,MAAM,WACL,MAAM,KACd,OAAO,CAAC,WAAW,CAiFrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,YAClB,MAAM,sBACK,OAAO,WAClB,MAAM,KACd,OAAO,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"alpha.d.ts","sourceRoot":"","sources":["../../../src/transactions/alpha.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAIvD,eAAO,MAAM,eAAe,WAClB,MAAM,WACL,MAAM,KACd,OAAO,CAAC,WAAW,CAiFrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,YAClB,MAAM,sBACK,OAAO,WAClB,MAAM,KACd,OAAO,CAAC,WAAW,CAsBrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.js","sourceRoot":"","sources":["../../../src/transactions/alpha.ts"],"names":[],"mappings":";;;AAAA,2DAAuD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B;AAEK,MAAM,gBAAgB,GAAG,KAAK,EACnC,OAAe,EACf,kBAA2B,EAC3B,OAAe,EACO,EAAE;IACxB,MAAM,GAAG,GAAG,IAAI,0BAAW,EAAE,CAAC;IAC9B,MAAM,OAAO,GAAc,MAAM,IAAA,sBAAW,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACrE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,GAAG,CAAC,QAAQ,CAAC;YACX,MAAM,EAAE,GAAG,IAAA,kBAAO,GAAE,CAAC,uBAAuB,4BAA4B;YACxE,aAAa,EAAE,CAAC,IAAA,kBAAO,GAAE,CAAC,eAAe,CAAC;YAC1C,SAAS,EAAE;gBACT,GAAG,CAAC,MAAM,CAAC,IAAA,kBAAO,GAAE,CAAC,OAAO,CAAC;gBAC7B,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;gBAC/B,GAAG,CAAC,MAAM,CAAC,IAAA,kBAAO,GAAE,CAAC,UAAU,CAAC;gBAChC,GAAG,CAAC,MAAM,CAAC,IAAA,kBAAO,GAAE,CAAC,iBAAiB,CAAC;gBACvC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;gBACrB,GAAG,CAAC,MAAM,CAAC,IAAA,kBAAO,GAAE,CAAC,gBAAgB,CAAC;gBACtC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC;aAClC;SACF,CAAC,CAAC;QACH,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACvB,OAAO,GAAG,CAAC;IACb,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACvC,CAAC;AACH,CAAC,CAAC;AA1BW,QAAA,gBAAgB,oBA0B3B","sourcesContent":["import { Transaction } from \"@mysten/sui/transactions\";\nimport { CoinStruct } from \"@mysten/sui/client\";\nimport { getConf, getReceipts, getSuiClient, Receipt } from \"../index.js\";\n\nexport const depositAlphaTxb = async (\n amount: string,\n address: string,\n): Promise<Transaction> => {\n const suiClient = getSuiClient();\n const txb = new Transaction();\n\n let coins: CoinStruct[] = [];\n\n const receipt: Receipt[] = await getReceipts(\"ALPHA\", address, true);\n\n let currentCursor: string | null | undefined = null;\n\n do {\n const response = await suiClient.getCoins({\n owner: address,\n coinType: getConf().ALPHA_COIN_TYPE,\n cursor: currentCursor,\n });\n\n coins = coins.concat(response.data);\n\n // Check if there's a next page\n if (response.hasNextPage && response.nextCursor) {\n currentCursor = response.nextCursor;\n } else {\n // No more pages available\n // console.log(\"No more receipts available.\");\n break;\n }\n } while (true);\n\n let coin: any;\n\n if (coins.length >= 1) {\n [coin] = txb.splitCoins(txb.object(coins[0].coinObjectId), [0]);\n txb.mergeCoins(\n coin,\n coins.map((c) => c.coinObjectId),\n );\n const [depositCoin] = txb.splitCoins(coin, [amount]);\n txb.transferObjects([coin], address);\n\n if (receipt.length == 0) {\n const [receipt] = txb.moveCall({\n target: `0x1::option::none`,\n typeArguments: [getConf().ALPHA_POOL_RECEIPT],\n arguments: [],\n });\n txb.moveCall({\n target: `${getConf().ALPHA_LATEST_PACKAGE_ID}::alphapool::user_deposit`,\n typeArguments: [getConf().ALPHA_COIN_TYPE],\n arguments: [\n txb.object(getConf().VERSION),\n receipt,\n txb.object(getConf().ALPHA_POOL),\n txb.object(getConf().ALPHA_DISTRIBUTOR),\n depositCoin,\n txb.object(getConf().CLOCK_PACKAGE_ID),\n ],\n });\n } else {\n const [someReceipt] = txb.moveCall({\n target: `0x1::option::some`,\n typeArguments: [getConf().ALPHA_POOL_RECEIPT],\n arguments: [txb.object(receipt[0].objectId)],\n });\n txb.moveCall({\n target: `${getConf().ALPHA_LATEST_PACKAGE_ID}::alphapool::user_deposit`,\n typeArguments: [getConf().ALPHA_COIN_TYPE],\n arguments: [\n txb.object(getConf().VERSION),\n someReceipt,\n txb.object(getConf().ALPHA_POOL),\n txb.object(getConf().ALPHA_DISTRIBUTOR),\n depositCoin,\n txb.object(getConf().CLOCK_PACKAGE_ID),\n ],\n });\n }\n return txb;\n } else {\n throw new Error(\"No Alpha Coins\");\n }\n};\n\nexport const withdrawAlphaTxb = async (\n xTokens: string,\n withdrawFromLocked: boolean,\n address: string,\n): Promise<Transaction> => {\n const txb = new Transaction();\n const receipt: Receipt[] = await getReceipts(\"ALPHA\", address, true);\n if (receipt.length > 0) {\n txb.moveCall({\n target: `${getConf().ALPHA_LATEST_PACKAGE_ID}::alphapool::user_withdraw`,\n typeArguments: [getConf().ALPHA_COIN_TYPE],\n arguments: [\n txb.object(getConf().VERSION),\n txb.object(receipt[0].objectId),\n txb.object(getConf().ALPHA_POOL),\n txb.object(getConf().ALPHA_DISTRIBUTOR),\n txb.pure.u64(xTokens),\n txb.object(getConf().CLOCK_PACKAGE_ID),\n txb.pure.bool(withdrawFromLocked),\n ],\n });\n txb.setSender(address);\n return txb;\n } else {\n throw new Error(\"No receipt found!\");\n }\n};\n"]}
|
|
@@ -3,19 +3,31 @@ import { PoolName } from "../common/types.js";
|
|
|
3
3
|
export declare const depositBluefinSuiFirstTxb: (amount: string, poolName: PoolName, isAmountA: boolean, options: {
|
|
4
4
|
address: string;
|
|
5
5
|
}, transaction?: Transaction | undefined) => Promise<Transaction>;
|
|
6
|
+
export declare const depositBluefinSuiSecondTxb: (amount: string, poolName: PoolName, isAmountA: boolean, options: {
|
|
7
|
+
address: string;
|
|
8
|
+
}, transaction?: Transaction | undefined) => Promise<Transaction>;
|
|
6
9
|
export declare const depositBluefinType1Txb: (amount: string, poolName: PoolName, isAmountA: boolean, options: {
|
|
7
10
|
address: string;
|
|
8
11
|
}, transaction?: Transaction | undefined) => Promise<Transaction>;
|
|
9
12
|
export declare const depositBluefinType2Txb: (amount: string, poolName: PoolName, isAmountA: boolean, options: {
|
|
10
13
|
address: string;
|
|
11
14
|
}, transaction?: Transaction | undefined) => Promise<Transaction>;
|
|
15
|
+
export declare const depositBluefinStsuiTxb: (amount: string, poolName: PoolName, isAmountA: boolean, options: {
|
|
16
|
+
address: string;
|
|
17
|
+
}, transaction?: Transaction | undefined) => Promise<Transaction>;
|
|
12
18
|
export declare const withdrawBluefinSuiFirstTxb: (xTokens: string, poolName: PoolName, options: {
|
|
13
19
|
address: string;
|
|
14
20
|
}) => Promise<Transaction>;
|
|
21
|
+
export declare const withdrawBluefinSuiSecondTxb: (xTokens: string, poolName: PoolName, options: {
|
|
22
|
+
address: string;
|
|
23
|
+
}) => Promise<Transaction>;
|
|
15
24
|
export declare const withdrawBluefinType1Txb: (xTokens: string, poolName: PoolName, options: {
|
|
16
25
|
address: string;
|
|
17
26
|
}) => Promise<Transaction>;
|
|
18
27
|
export declare const withdrawBluefinType2Txb: (xTokens: string, poolName: PoolName, options: {
|
|
19
28
|
address: string;
|
|
20
29
|
}) => Promise<Transaction>;
|
|
30
|
+
export declare const withdrawBluefinStsuiTxb: (xTokens: string, poolName: PoolName, options: {
|
|
31
|
+
address: string;
|
|
32
|
+
}) => Promise<Transaction>;
|
|
21
33
|
//# sourceMappingURL=bluefin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bluefin.d.ts","sourceRoot":"","sources":["../../../src/transactions/bluefin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"bluefin.d.ts","sourceRoot":"","sources":["../../../src/transactions/bluefin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAUvD,OAAO,EAAE,QAAQ,EAAW,MAAM,oBAAoB,CAAC;AAKvD,eAAO,MAAM,yBAAyB,WAC5B,MAAM,YACJ,QAAQ,aACP,OAAO,WACT;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,gBACf,WAAW,GAAG,SAAS,KACnC,OAAO,CAAC,WAAW,CA0JrB,CAAC;AAEF,eAAO,MAAM,0B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