@raydium-io/raydium-sdk-v2 0.1.0-alpha → 0.1.2-alpha
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/lib/api/api.d.ts +1 -1
- package/lib/api/index.d.ts +1 -1
- package/lib/api/type.d.ts +1 -1
- package/lib/common/accountInfo.d.ts +1 -1
- package/lib/common/bignumber.d.ts +1 -1
- package/lib/common/fractionUtil.d.ts +1 -1
- package/lib/common/index.d.ts +1 -1
- package/lib/common/transfer.d.ts +1 -1
- package/lib/common/txTool/txTool.d.ts +1 -1
- package/lib/common/txTool/txUtils.d.ts +1 -1
- package/lib/common/utility.d.ts +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +1 -1
- package/lib/index.mjs.map +1 -1
- package/lib/module/amount.d.ts +1 -1
- package/lib/module/fraction.d.ts +1 -1
- package/lib/module/index.d.ts +1 -1
- package/lib/module/percent.d.ts +1 -1
- package/lib/module/price.d.ts +1 -1
- package/lib/raydium/account/account.d.ts +3 -3
- package/lib/raydium/account/account.js +1 -1
- package/lib/raydium/account/account.js.map +1 -1
- package/lib/raydium/account/account.mjs +1 -1
- package/lib/raydium/account/account.mjs.map +1 -1
- package/lib/raydium/account/index.d.ts +1 -1
- package/lib/raydium/account/instruction.d.ts +1 -1
- package/lib/raydium/account/types.d.ts +1 -1
- package/lib/raydium/account/util.d.ts +1 -1
- package/lib/raydium/clmm/clmm.d.ts +3 -3
- package/lib/raydium/clmm/index.d.ts +3 -3
- package/lib/raydium/clmm/instrument.d.ts +2 -2
- package/lib/raydium/clmm/layout.d.ts +6 -6
- package/lib/raydium/clmm/type.d.ts +2 -2
- package/lib/raydium/clmm/utils/math.d.ts +2 -2
- package/lib/raydium/clmm/utils/pool.d.ts +2 -2
- package/lib/raydium/clmm/utils/position.d.ts +2 -2
- package/lib/raydium/clmm/utils/tick.d.ts +2 -2
- package/lib/raydium/clmm/utils/tickQuery.d.ts +2 -2
- package/lib/raydium/clmm/utils/tickarrayBitmap.d.ts +2 -2
- package/lib/raydium/cpmm/cpmm.d.ts +3 -3
- package/lib/raydium/cpmm/index.d.ts +1 -1
- package/lib/raydium/cpmm/layout.d.ts +1 -1
- package/lib/raydium/cpmm/type.d.ts +1 -1
- package/lib/raydium/farm/config.d.ts +1 -1
- package/lib/raydium/farm/farm.d.ts +3 -3
- package/lib/raydium/farm/index.d.ts +1 -1
- package/lib/raydium/farm/instruction.d.ts +1 -1
- package/lib/raydium/farm/layout.d.ts +1 -1
- package/lib/raydium/farm/type.d.ts +1 -1
- package/lib/raydium/farm/util.d.ts +1 -1
- package/lib/raydium/ido/ido.d.ts +3 -3
- package/lib/raydium/ido/index.d.ts +3 -3
- package/lib/raydium/ido/instruction.d.ts +1 -1
- package/lib/raydium/ido/type.d.ts +1 -1
- package/lib/raydium/index.d.ts +3 -3
- package/lib/raydium/index.js +1 -1
- package/lib/raydium/index.js.map +1 -1
- package/lib/raydium/index.mjs +1 -1
- package/lib/raydium/index.mjs.map +1 -1
- package/lib/raydium/liquidity/index.d.ts +1 -1
- package/lib/raydium/liquidity/instruction.d.ts +1 -1
- package/lib/raydium/liquidity/layout.d.ts +6 -6
- package/lib/raydium/liquidity/liquidity.d.ts +3 -3
- package/lib/raydium/liquidity/liquidity.js +1 -1
- package/lib/raydium/liquidity/liquidity.js.map +1 -1
- package/lib/raydium/liquidity/liquidity.mjs +1 -1
- package/lib/raydium/liquidity/liquidity.mjs.map +1 -1
- package/lib/raydium/liquidity/type.d.ts +1 -1
- package/lib/raydium/liquidity/utils.d.ts +1 -1
- package/lib/raydium/marketV2/createMarket.d.ts +3 -3
- package/lib/raydium/marketV2/index.d.ts +3 -3
- package/lib/raydium/moduleBase.d.ts +3 -3
- package/lib/raydium/raydium.d.ts +3 -3
- package/lib/raydium/raydium.js +1 -1
- package/lib/raydium/raydium.js.map +1 -1
- package/lib/raydium/raydium.mjs +1 -1
- package/lib/raydium/raydium.mjs.map +1 -1
- package/lib/raydium/token/constant.d.ts +1 -1
- package/lib/raydium/token/index.d.ts +1 -1
- package/lib/raydium/token/token.d.ts +3 -3
- package/lib/raydium/token/type.d.ts +1 -1
- package/lib/raydium/token/utils.d.ts +1 -1
- package/lib/raydium/tradeV2/index.d.ts +2 -2
- package/lib/raydium/tradeV2/instrument.d.ts +2 -2
- package/lib/raydium/tradeV2/trade.d.ts +3 -3
- package/lib/raydium/tradeV2/type.d.ts +2 -2
- package/lib/raydium/type.d.ts +1 -1
- package/lib/raydium/utils1216/index.d.ts +3 -3
- package/lib/raydium/utils1216/utils1216.d.ts +3 -3
- package/lib/{raydium-50d99e08.d.ts → raydium-e681ad95.d.ts} +3 -3
- package/lib/{type-80826393.d.ts → type-389634c9.d.ts} +1 -1
- package/lib/{type-8e0c46e7.d.ts → type-9fe71e3c.d.ts} +8 -8
- package/package.json +1 -1
- package/src/raydium/account/account.ts +1 -1
- package/src/raydium/liquidity/liquidity.ts +44 -47
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { SOL_INFO, TOKEN_WSOL } from './constant.js';
|
|
2
2
|
export { SPL_MINT_LAYOUT, SplMintLayout } from './layout.js';
|
|
3
|
-
export { bC as LpToken, bB as SplToken, bz as TokenInfo, bA as TokenJson } from '../../type-
|
|
3
|
+
export { bC as LpToken, bB as SplToken, bz as TokenInfo, bA as TokenJson } from '../../type-9fe71e3c.js';
|
|
4
4
|
export { parseTokenInfo, solToWSolToken, toToken, toTokenAmount, toTokenInfo, wSolToSolToken } from './utils.js';
|
|
5
5
|
import '@solana/web3.js';
|
|
6
6
|
import 'bn.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@solana/web3.js';
|
|
2
|
-
import '../../type-
|
|
3
|
-
export { j as default } from '../../raydium-
|
|
2
|
+
import '../../type-9fe71e3c.js';
|
|
3
|
+
export { j as default } from '../../raydium-e681ad95.js';
|
|
4
4
|
import 'bn.js';
|
|
5
5
|
import '@solana/spl-token';
|
|
6
6
|
import '../../solana/type.js';
|
|
@@ -21,7 +21,7 @@ import '../account/types.js';
|
|
|
21
21
|
import '../account/layout.js';
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
23
|
import '../liquidity/layout.js';
|
|
24
|
-
import '../../type-
|
|
24
|
+
import '../../type-389634c9.js';
|
|
25
25
|
import '../clmm/layout.js';
|
|
26
26
|
import '../cpmm/type.js';
|
|
27
27
|
import '../cpmm/curve/calculator.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { bC as LpToken, bB as SplToken, bz as TokenInfo, bA as TokenJson } from '../../type-
|
|
1
|
+
export { bC as LpToken, bB as SplToken, bz as TokenInfo, bA as TokenJson } from '../../type-9fe71e3c.js';
|
|
2
2
|
import '../../module/token.js';
|
|
3
3
|
import '@solana/web3.js';
|
|
4
4
|
import 'bn.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
2
2
|
import { RawMint } from '@solana/spl-token';
|
|
3
|
-
import { bz as TokenInfo, a9 as BigNumberish, c1 as TokenAmount, e as ApiV3Token } from '../../type-
|
|
3
|
+
import { bz as TokenInfo, a9 as BigNumberish, c1 as TokenAmount, e as ApiV3Token } from '../../type-9fe71e3c.js';
|
|
4
4
|
import { Token } from '../../module/token.js';
|
|
5
5
|
import 'bn.js';
|
|
6
6
|
import '../../solana/type.js';
|
|
@@ -2,7 +2,7 @@ export { makeSwapInstruction, route1Instruction, route2Instruction, routeInstruc
|
|
|
2
2
|
export { ComputeAmountOutAmmLayout, ComputeAmountOutLayout, ComputeAmountOutRouteLayout, MakeSwapInstructionParam, PoolAccountInfoV4, ReturnTypeFetchMultipleInfo, ReturnTypeGetAddLiquidityDefaultPool, ReturnTypeGetAllRoute, ReturnTypeMakeSwapInstruction, ReturnTypeMakeSwapTransaction, RoutePathType } from './type.js';
|
|
3
3
|
import '@solana/web3.js';
|
|
4
4
|
import 'bn.js';
|
|
5
|
-
import '../../type-
|
|
5
|
+
import '../../type-9fe71e3c.js';
|
|
6
6
|
import '@solana/spl-token';
|
|
7
7
|
import '../../solana/type.js';
|
|
8
8
|
import '../../common/txTool/txType.js';
|
|
@@ -15,5 +15,5 @@ import '../../marshmallow/index.js';
|
|
|
15
15
|
import '../../marshmallow/buffer-layout.js';
|
|
16
16
|
import '../../common/logger.js';
|
|
17
17
|
import '../../module/currency.js';
|
|
18
|
-
import '../../type-
|
|
18
|
+
import '../../type-389634c9.js';
|
|
19
19
|
import '../clmm/layout.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
|
|
2
2
|
import BN__default from 'bn.js';
|
|
3
|
-
import { n as ApiV3PoolInfoItem, w as PoolKeys } from '../../type-
|
|
3
|
+
import { n as ApiV3PoolInfoItem, w as PoolKeys } from '../../type-9fe71e3c.js';
|
|
4
4
|
import { ReturnTypeMakeSwapInstruction, ComputeAmountOutLayout } from './type.js';
|
|
5
5
|
import '@solana/spl-token';
|
|
6
6
|
import '../../solana/type.js';
|
|
@@ -14,7 +14,7 @@ import '../../marshmallow/index.js';
|
|
|
14
14
|
import '../../marshmallow/buffer-layout.js';
|
|
15
15
|
import '../../common/logger.js';
|
|
16
16
|
import '../../module/currency.js';
|
|
17
|
-
import '../../type-
|
|
17
|
+
import '../../type-389634c9.js';
|
|
18
18
|
import '../clmm/layout.js';
|
|
19
19
|
|
|
20
20
|
declare function route1Instruction(programId: PublicKey, poolInfoA: ApiV3PoolInfoItem, poolKeyA: PoolKeys, poolKeyB: PoolKeys, userSourceToken: PublicKey, userRouteToken: PublicKey, userPdaAccount: PublicKey, ownerWallet: PublicKey, inputMint: PublicKey, amountIn: BN__default, amountOut: BN__default, tickArrayA?: PublicKey[]): TransactionInstruction;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@solana/web3.js';
|
|
2
|
-
export { i as default } from '../../raydium-
|
|
2
|
+
export { i as default } from '../../raydium-e681ad95.js';
|
|
3
3
|
import './type.js';
|
|
4
|
-
import '../../type-
|
|
4
|
+
import '../../type-9fe71e3c.js';
|
|
5
5
|
import '../../api/api.js';
|
|
6
6
|
import 'axios';
|
|
7
7
|
import '../../solana/type.js';
|
|
@@ -22,7 +22,7 @@ import '../account/types.js';
|
|
|
22
22
|
import '../account/layout.js';
|
|
23
23
|
import '../liquidity/type.js';
|
|
24
24
|
import '../liquidity/layout.js';
|
|
25
|
-
import '../../type-
|
|
25
|
+
import '../../type-389634c9.js';
|
|
26
26
|
import '../clmm/layout.js';
|
|
27
27
|
import '../cpmm/type.js';
|
|
28
28
|
import '../cpmm/curve/calculator.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PublicKey, Keypair, Signer, TransactionInstruction, Transaction } from '@solana/web3.js';
|
|
2
2
|
import BN__default from 'bn.js';
|
|
3
|
-
import { bK as TransferAmountFee, c6 as Price, c5 as Percent, c1 as TokenAmount, n as ApiV3PoolInfoItem, w as PoolKeys } from '../../type-
|
|
3
|
+
import { bK as TransferAmountFee, c6 as Price, c5 as Percent, c1 as TokenAmount, n as ApiV3PoolInfoItem, w as PoolKeys } from '../../type-9fe71e3c.js';
|
|
4
4
|
import { Token } from '../../module/token.js';
|
|
5
|
-
import { c as ClmmPoolInfo } from '../../type-
|
|
5
|
+
import { c as ClmmPoolInfo } from '../../type-389634c9.js';
|
|
6
6
|
import '@solana/spl-token';
|
|
7
7
|
import '../../solana/type.js';
|
|
8
8
|
import '../../common/txTool/txType.js';
|
package/lib/raydium/type.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@solana/web3.js';
|
|
2
2
|
import '@solana/spl-token';
|
|
3
|
-
export { bS as ArrayItem, bI as ComputeBudgetConfig, bZ as Cover, bT as ExactPartial, bU as ExactRequired, bY as Fallback, bL as GetTransferAmountFee, bW as GetValue, bH as InstructionReturn, bJ as LoadParams, bG as MakeMultiTransaction, bE as MakeTransaction, bF as MakeV0Transaction, bP as MayArray, bQ as MayDeepArray, bR as MayFunction, bO as ReplaceType, bM as ReturnTypeFetchMultipleMintInfo, bN as ReturnTypeFetchMultipleMintInfos, bV as SKeyof, bX as SOR, bD as SignAllTransactions, bK as TransferAmountFee, b_ as UnionCover, b$ as unionArr } from '../type-
|
|
3
|
+
export { bS as ArrayItem, bI as ComputeBudgetConfig, bZ as Cover, bT as ExactPartial, bU as ExactRequired, bY as Fallback, bL as GetTransferAmountFee, bW as GetValue, bH as InstructionReturn, bJ as LoadParams, bG as MakeMultiTransaction, bE as MakeTransaction, bF as MakeV0Transaction, bP as MayArray, bQ as MayDeepArray, bR as MayFunction, bO as ReplaceType, bM as ReturnTypeFetchMultipleMintInfo, bN as ReturnTypeFetchMultipleMintInfos, bV as SKeyof, bX as SOR, bD as SignAllTransactions, bK as TransferAmountFee, b_ as UnionCover, b$ as unionArr } from '../type-9fe71e3c.js';
|
|
4
4
|
import 'bn.js';
|
|
5
5
|
import '../solana/type.js';
|
|
6
6
|
import '../common/txTool/txType.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-
|
|
1
|
+
export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-e681ad95.js';
|
|
2
2
|
import '@solana/web3.js';
|
|
3
3
|
import '../../api/api.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
import '../../solana/type.js';
|
|
6
|
-
import '../../type-
|
|
6
|
+
import '../../type-9fe71e3c.js';
|
|
7
7
|
import 'bn.js';
|
|
8
8
|
import '@solana/spl-token';
|
|
9
9
|
import '../../common/txTool/txType.js';
|
|
@@ -21,7 +21,7 @@ import '../account/types.js';
|
|
|
21
21
|
import '../account/layout.js';
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
23
|
import '../liquidity/layout.js';
|
|
24
|
-
import '../../type-
|
|
24
|
+
import '../../type-389634c9.js';
|
|
25
25
|
import '../clmm/layout.js';
|
|
26
26
|
import '../cpmm/type.js';
|
|
27
27
|
import '../cpmm/curve/calculator.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import '../../marshmallow/index.js';
|
|
2
2
|
import '@solana/web3.js';
|
|
3
3
|
import 'bn.js';
|
|
4
|
-
export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-
|
|
4
|
+
export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-e681ad95.js';
|
|
5
5
|
import '../../marshmallow/buffer-layout.js';
|
|
6
6
|
import '../../api/api.js';
|
|
7
7
|
import 'axios';
|
|
8
8
|
import '../../solana/type.js';
|
|
9
|
-
import '../../type-
|
|
9
|
+
import '../../type-9fe71e3c.js';
|
|
10
10
|
import '@solana/spl-token';
|
|
11
11
|
import '../../common/txTool/txType.js';
|
|
12
12
|
import '../../common/owner.js';
|
|
@@ -21,7 +21,7 @@ import '../account/types.js';
|
|
|
21
21
|
import '../account/layout.js';
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
23
|
import '../liquidity/layout.js';
|
|
24
|
-
import '../../type-
|
|
24
|
+
import '../../type-389634c9.js';
|
|
25
25
|
import '../clmm/layout.js';
|
|
26
26
|
import '../cpmm/type.js';
|
|
27
27
|
import '../cpmm/curve/calculator.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PublicKey, Commitment, Connection, Transaction, Signer, TransactionInstruction, Keypair, EpochInfo } from '@solana/web3.js';
|
|
2
2
|
import { Api } from './api/api.js';
|
|
3
|
-
import { ax as TxBuilder, ap as AddInstructionParam, a9 as BigNumberish, bk as CreateFarm, aw as MakeTxData, bl as CreateFarmExtInfo, bm as UpdateFarmReward, bn as UpdateFarmRewards, bo as FarmDWParam, U as FormatFarmInfoOut, bI as ComputeBudgetConfig, av as MakeMultiTxData, l as ApiV3PoolInfoStandardItem, c5 as Percent, c1 as TokenAmount, s as AmmV4Keys, t as AmmV5Keys, k as ApiV3PoolInfoConcentratedItem, S as FormatFarmInfoOutV6, v as ClmmKeys, bE as MakeTransaction, C as CpmmKeys, bL as GetTransferAmountFee, X as OwnerIdoInfo, Y as IdoKeysData, bJ as LoadParams, J as JupTokenType, bz as TokenInfo, e as ApiV3Token, bD as SignAllTransactions, V as AvailabilityCheckAPI3, f as ApiV3TokenRes } from './type-
|
|
3
|
+
import { ax as TxBuilder, ap as AddInstructionParam, a9 as BigNumberish, bk as CreateFarm, aw as MakeTxData, bl as CreateFarmExtInfo, bm as UpdateFarmReward, bn as UpdateFarmRewards, bo as FarmDWParam, U as FormatFarmInfoOut, bI as ComputeBudgetConfig, av as MakeMultiTxData, l as ApiV3PoolInfoStandardItem, c5 as Percent, c1 as TokenAmount, s as AmmV4Keys, t as AmmV5Keys, k as ApiV3PoolInfoConcentratedItem, S as FormatFarmInfoOutV6, v as ClmmKeys, bE as MakeTransaction, C as CpmmKeys, bL as GetTransferAmountFee, X as OwnerIdoInfo, Y as IdoKeysData, bJ as LoadParams, J as JupTokenType, bz as TokenInfo, e as ApiV3Token, bD as SignAllTransactions, V as AvailabilityCheckAPI3, f as ApiV3TokenRes } from './type-9fe71e3c.js';
|
|
4
4
|
import { API_URL_CONFIG } from './api/url.js';
|
|
5
5
|
import { Owner } from './common/owner.js';
|
|
6
6
|
import { Cluster } from './solana/type.js';
|
|
@@ -11,7 +11,7 @@ import BN__default from 'bn.js';
|
|
|
11
11
|
import Decimal from 'decimal.js';
|
|
12
12
|
import { AddLiquidityParams, RemoveParams, CreatePoolParam, CreatePoolAddress, ComputeAmountOutParam, SwapParam } from './raydium/liquidity/type.js';
|
|
13
13
|
import { liquidityStateV4Layout } from './raydium/liquidity/layout.js';
|
|
14
|
-
import { m as CreateConcentratedPool, O as OpenPositionFromBase, p as OpenPositionFromBaseExtInfo, q as OpenPositionFromLiquidity, r as OpenPositionFromLiquidityExtInfo, I as IncreasePositionFromLiquidity, M as ManipulateLiquidityExtInfo, n as IncreasePositionFromBase, D as DecreaseLiquidity, B as ClosePositionExtInfo, s as InitRewardParams, E as InitRewardExtInfo, t as InitRewardsParams, u as SetRewardParams, v as SetRewardsParams, w as CollectRewardParams, x as CollectRewardsParams, H as HarvestAllRewardsParams } from './type-
|
|
14
|
+
import { m as CreateConcentratedPool, O as OpenPositionFromBase, p as OpenPositionFromBaseExtInfo, q as OpenPositionFromLiquidity, r as OpenPositionFromLiquidityExtInfo, I as IncreasePositionFromLiquidity, M as ManipulateLiquidityExtInfo, n as IncreasePositionFromBase, D as DecreaseLiquidity, B as ClosePositionExtInfo, s as InitRewardParams, E as InitRewardExtInfo, t as InitRewardsParams, u as SetRewardParams, v as SetRewardsParams, w as CollectRewardParams, x as CollectRewardsParams, H as HarvestAllRewardsParams } from './type-389634c9.js';
|
|
15
15
|
import { ClmmPositionLayout, PositionInfoLayout, PoolInfoLayout } from './raydium/clmm/layout.js';
|
|
16
16
|
import { CpmmConfigInfoInterface, CreateCpmmPoolParam, CreateCpmmPoolAddress, AddCpmmLiquidityParams, WithdrawCpmmLiquidityParams, CpmmSwapParams, ComputePairAmountParams } from './raydium/cpmm/type.js';
|
|
17
17
|
import { CpmmPoolInfoLayout } from './raydium/cpmm/layout.js';
|
|
@@ -329,11 +329,11 @@ declare class Utils1216 extends ModuleBase {
|
|
|
329
329
|
perLpLoss: BN__default;
|
|
330
330
|
totalClaimedAmount: BN__default;
|
|
331
331
|
}[], "", {
|
|
332
|
-
status: number;
|
|
333
332
|
padding: BN__default[];
|
|
334
333
|
bump: number;
|
|
335
334
|
endTime: BN__default;
|
|
336
335
|
openTime: BN__default;
|
|
336
|
+
status: number;
|
|
337
337
|
ammId: PublicKey;
|
|
338
338
|
tokenInfo: {
|
|
339
339
|
mintDecimals: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PublicKey, Transaction, Signer, Keypair, TransactionInstruction, EpochInfo } from '@solana/web3.js';
|
|
2
2
|
import BN__default from 'bn.js';
|
|
3
3
|
import Decimal from 'decimal.js';
|
|
4
|
-
import { k as ApiV3PoolInfoConcentratedItem, b as ApiClmmConfigInfo, e as ApiV3Token, bL as GetTransferAmountFee, bK as TransferAmountFee, c6 as Price, c5 as Percent, c1 as TokenAmount, bI as ComputeBudgetConfig, c3 as Fraction, bz as TokenInfo, v as ClmmKeys } from './type-
|
|
4
|
+
import { k as ApiV3PoolInfoConcentratedItem, b as ApiClmmConfigInfo, e as ApiV3Token, bL as GetTransferAmountFee, bK as TransferAmountFee, c6 as Price, c5 as Percent, c1 as TokenAmount, bI as ComputeBudgetConfig, c3 as Fraction, bz as TokenInfo, v as ClmmKeys } from './type-9fe71e3c.js';
|
|
5
5
|
import { TxVersion } from './common/txTool/txType.js';
|
|
6
6
|
import { ClmmPositionLayout } from './raydium/clmm/layout.js';
|
|
7
7
|
|
|
@@ -850,37 +850,37 @@ declare type FarmStateV6 = GetStructureSchema<FarmStateLayoutV6>;
|
|
|
850
850
|
declare type FarmState = FarmStateV3 | FarmStateV5 | FarmStateV6;
|
|
851
851
|
declare type FarmStateLayout = FarmStateLayoutV3 | FarmStateLayoutV5 | FarmStateLayoutV6;
|
|
852
852
|
declare const farmLedgerLayoutV3_1: Structure<PublicKey | BN__default | BN__default[], "", {
|
|
853
|
-
id: PublicKey;
|
|
854
853
|
state: BN__default;
|
|
854
|
+
id: PublicKey;
|
|
855
855
|
owner: PublicKey;
|
|
856
856
|
deposited: BN__default;
|
|
857
857
|
rewardDebts: BN__default[];
|
|
858
858
|
}>;
|
|
859
859
|
declare const farmLedgerLayoutV3_2: Structure<PublicKey | BN__default | BN__default[], "", {
|
|
860
|
-
id: PublicKey;
|
|
861
860
|
state: BN__default;
|
|
861
|
+
id: PublicKey;
|
|
862
862
|
owner: PublicKey;
|
|
863
863
|
deposited: BN__default;
|
|
864
864
|
rewardDebts: BN__default[];
|
|
865
865
|
voteLockedBalance: BN__default;
|
|
866
866
|
}>;
|
|
867
867
|
declare const farmLedgerLayoutV5_1: Structure<PublicKey | BN__default | BN__default[], "", {
|
|
868
|
-
id: PublicKey;
|
|
869
868
|
state: BN__default;
|
|
869
|
+
id: PublicKey;
|
|
870
870
|
owner: PublicKey;
|
|
871
871
|
deposited: BN__default;
|
|
872
872
|
rewardDebts: BN__default[];
|
|
873
873
|
}>;
|
|
874
874
|
declare const farmLedgerLayoutV5_2: Structure<PublicKey | BN__default | BN__default[], "", {
|
|
875
|
-
id: PublicKey;
|
|
876
875
|
state: BN__default;
|
|
876
|
+
id: PublicKey;
|
|
877
877
|
owner: PublicKey;
|
|
878
878
|
deposited: BN__default;
|
|
879
879
|
rewardDebts: BN__default[];
|
|
880
880
|
}>;
|
|
881
881
|
declare const farmLedgerLayoutV6_1: Structure<PublicKey | BN__default | BN__default[], "", {
|
|
882
|
-
id: PublicKey;
|
|
883
882
|
state: BN__default;
|
|
883
|
+
id: PublicKey;
|
|
884
884
|
owner: PublicKey;
|
|
885
885
|
deposited: BN__default;
|
|
886
886
|
rewardDebts: BN__default[];
|
|
@@ -901,7 +901,7 @@ declare const dwLayout: Structure<number | BN__default, "", {
|
|
|
901
901
|
instruction: number;
|
|
902
902
|
amount: BN__default;
|
|
903
903
|
}>;
|
|
904
|
-
declare const VoterVotingMintConfig: Structure<number[] |
|
|
904
|
+
declare const VoterVotingMintConfig: Structure<PublicKey | number[] | BN__default | BN__default[], "", {
|
|
905
905
|
mint: PublicKey;
|
|
906
906
|
grantAuthority: PublicKey;
|
|
907
907
|
baselineVoteWeightScaledFactor: BN__default;
|
|
@@ -911,7 +911,7 @@ declare const VoterVotingMintConfig: Structure<number[] | PublicKey | BN__defaul
|
|
|
911
911
|
reserved1: number[];
|
|
912
912
|
reserved2: BN__default[];
|
|
913
913
|
}>;
|
|
914
|
-
declare const VoterRegistrar: Structure<number | number[] |
|
|
914
|
+
declare const VoterRegistrar: Structure<number | PublicKey | number[] | Buffer | BN__default | BN__default[] | {
|
|
915
915
|
mint: PublicKey;
|
|
916
916
|
grantAuthority: PublicKey;
|
|
917
917
|
baselineVoteWeightScaledFactor: BN__default;
|
|
@@ -966,7 +966,7 @@ declare const VoterDepositEntry: Structure<number | boolean | number[] | BN__def
|
|
|
966
966
|
allowClawback: boolean;
|
|
967
967
|
votingMintConfigIdx: number;
|
|
968
968
|
}>;
|
|
969
|
-
declare const Voter: Structure<number | number[] |
|
|
969
|
+
declare const Voter: Structure<number | PublicKey | number[] | Buffer | {
|
|
970
970
|
reserved: number[];
|
|
971
971
|
lockup: {
|
|
972
972
|
startTime: BN__default;
|
package/package.json
CHANGED
|
@@ -261,7 +261,7 @@ export default class Account extends ModuleBase {
|
|
|
261
261
|
basePubkey: owner,
|
|
262
262
|
seed: newTokenAccount.seed,
|
|
263
263
|
newAccountPubkey: newTokenAccount.publicKey,
|
|
264
|
-
lamports: balanceNeeded,
|
|
264
|
+
lamports: balanceNeeded + Number(createInfo.amount?.toString() ?? 0),
|
|
265
265
|
space: AccountLayout.span,
|
|
266
266
|
programId: tokenProgram,
|
|
267
267
|
});
|
|
@@ -411,8 +411,8 @@ export default class LiquidityModule extends ModuleBase {
|
|
|
411
411
|
|
|
412
412
|
createInfo: mintBaseUseSOLBalance
|
|
413
413
|
? {
|
|
414
|
-
|
|
415
|
-
|
|
414
|
+
payer: this.scope.ownerPubKey,
|
|
415
|
+
}
|
|
416
416
|
: undefined,
|
|
417
417
|
skipCloseAccount: !mintBaseUseSOLBalance,
|
|
418
418
|
notUseTokenAccount: mintBaseUseSOLBalance,
|
|
@@ -429,9 +429,9 @@ export default class LiquidityModule extends ModuleBase {
|
|
|
429
429
|
owner: this.scope.ownerPubKey,
|
|
430
430
|
createInfo: mintQuoteUseSOLBalance
|
|
431
431
|
? {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
432
|
+
payer: this.scope.ownerPubKey!,
|
|
433
|
+
amount: 0,
|
|
434
|
+
}
|
|
435
435
|
: undefined,
|
|
436
436
|
skipCloseAccount: !mintQuoteUseSOLBalance,
|
|
437
437
|
notUseTokenAccount: mintQuoteUseSOLBalance,
|
|
@@ -481,8 +481,8 @@ export default class LiquidityModule extends ModuleBase {
|
|
|
481
481
|
version === 6
|
|
482
482
|
? makeWithdrawInstructionV6(insParams)
|
|
483
483
|
: version === 5
|
|
484
|
-
|
|
485
|
-
|
|
484
|
+
? makeWithdrawInstructionV5(insParams)
|
|
485
|
+
: makeWithdrawInstructionV3(insParams);
|
|
486
486
|
const insType = {
|
|
487
487
|
3: InstructionType.FarmV3Withdraw,
|
|
488
488
|
5: InstructionType.FarmV5Withdraw,
|
|
@@ -579,9 +579,9 @@ export default class LiquidityModule extends ModuleBase {
|
|
|
579
579
|
owner: this.scope.ownerPubKey,
|
|
580
580
|
createInfo: mintAUseSOLBalance
|
|
581
581
|
? {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
582
|
+
payer: payer!,
|
|
583
|
+
amount: baseAmount,
|
|
584
|
+
}
|
|
585
585
|
: undefined,
|
|
586
586
|
notUseTokenAccount: mintAUseSOLBalance,
|
|
587
587
|
skipCloseAccount: !mintAUseSOLBalance,
|
|
@@ -596,9 +596,9 @@ export default class LiquidityModule extends ModuleBase {
|
|
|
596
596
|
owner: this.scope.ownerPubKey,
|
|
597
597
|
createInfo: mintBUseSOLBalance
|
|
598
598
|
? {
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
599
|
+
payer: payer!,
|
|
600
|
+
amount: quoteAmount,
|
|
601
|
+
}
|
|
602
602
|
: undefined,
|
|
603
603
|
|
|
604
604
|
notUseTokenAccount: mintBUseSOLBalance,
|
|
@@ -854,52 +854,48 @@ export default class LiquidityModule extends ModuleBase {
|
|
|
854
854
|
}) as Promise<MakeTxData<T>>;
|
|
855
855
|
}
|
|
856
856
|
|
|
857
|
-
public async getRpcPoolInfo(
|
|
858
|
-
poolId: string,
|
|
859
|
-
): Promise<
|
|
857
|
+
public async getRpcPoolInfo(poolId: string): Promise<
|
|
860
858
|
ReturnType<typeof liquidityStateV4Layout.decode> & {
|
|
861
859
|
baseReserve: BN;
|
|
862
860
|
quoteReserve: BN;
|
|
863
861
|
poolPrice: Decimal;
|
|
864
862
|
}
|
|
865
863
|
> {
|
|
866
|
-
return (await this.getRpcPoolInfos([poolId]))[poolId]
|
|
864
|
+
return (await this.getRpcPoolInfos([poolId]))[poolId];
|
|
867
865
|
}
|
|
868
866
|
|
|
869
|
-
public async getRpcPoolInfos(
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
}
|
|
879
|
-
> {
|
|
880
|
-
const accounts = await this.scope.connection.getMultipleAccountsInfo(poolIds.map(i => new PublicKey(i)));
|
|
881
|
-
const poolInfos: { [poolId: string]: ReturnType<typeof liquidityStateV4Layout.decode> } = {}
|
|
867
|
+
public async getRpcPoolInfos(poolIds: string[]): Promise<{
|
|
868
|
+
[poolId: string]: ReturnType<typeof liquidityStateV4Layout.decode> & {
|
|
869
|
+
baseReserve: BN;
|
|
870
|
+
quoteReserve: BN;
|
|
871
|
+
poolPrice: Decimal;
|
|
872
|
+
};
|
|
873
|
+
}> {
|
|
874
|
+
const accounts = await this.scope.connection.getMultipleAccountsInfo(poolIds.map((i) => new PublicKey(i)));
|
|
875
|
+
const poolInfos: { [poolId: string]: ReturnType<typeof liquidityStateV4Layout.decode> } = {};
|
|
882
876
|
|
|
883
|
-
const needFetchVaults: PublicKey[] = []
|
|
877
|
+
const needFetchVaults: PublicKey[] = [];
|
|
884
878
|
|
|
885
879
|
for (let i = 0; i < poolIds.length; i++) {
|
|
886
|
-
const item = accounts[i]
|
|
887
|
-
if (item === null) throw Error(
|
|
880
|
+
const item = accounts[i];
|
|
881
|
+
if (item === null) throw Error("fetch pool info error: " + String(poolIds[i]));
|
|
888
882
|
const rpc = liquidityStateV4Layout.decode(item.data);
|
|
889
883
|
poolInfos[String(poolIds[i])] = rpc;
|
|
890
884
|
|
|
891
|
-
needFetchVaults.push(rpc.baseVault, rpc.quoteVault)
|
|
885
|
+
needFetchVaults.push(rpc.baseVault, rpc.quoteVault);
|
|
892
886
|
}
|
|
893
887
|
|
|
894
|
-
const vaultInfo: { [vaultId: string]: BN } = {}
|
|
888
|
+
const vaultInfo: { [vaultId: string]: BN } = {};
|
|
895
889
|
|
|
896
|
-
const vaultAccountInfo = await this.scope.connection.getMultipleAccountsInfo(
|
|
890
|
+
const vaultAccountInfo = await this.scope.connection.getMultipleAccountsInfo(
|
|
891
|
+
needFetchVaults.map((i) => new PublicKey(i)),
|
|
892
|
+
);
|
|
897
893
|
|
|
898
894
|
for (let i = 0; i < needFetchVaults.length; i++) {
|
|
899
|
-
const vaultItemInfo = vaultAccountInfo[i]
|
|
900
|
-
if (vaultItemInfo === null) throw Error(
|
|
895
|
+
const vaultItemInfo = vaultAccountInfo[i];
|
|
896
|
+
if (vaultItemInfo === null) throw Error("fetch vault info error: " + needFetchVaults[i]);
|
|
901
897
|
|
|
902
|
-
vaultInfo[String(needFetchVaults[i])] = new BN(AccountLayout.decode(vaultItemInfo.data).amount.toString())
|
|
898
|
+
vaultInfo[String(needFetchVaults[i])] = new BN(AccountLayout.decode(vaultItemInfo.data).amount.toString());
|
|
903
899
|
}
|
|
904
900
|
|
|
905
901
|
const returnData: {
|
|
@@ -907,21 +903,22 @@ export default class LiquidityModule extends ModuleBase {
|
|
|
907
903
|
baseReserve: BN;
|
|
908
904
|
quoteReserve: BN;
|
|
909
905
|
poolPrice: Decimal;
|
|
910
|
-
}
|
|
911
|
-
} = {}
|
|
906
|
+
};
|
|
907
|
+
} = {};
|
|
912
908
|
|
|
913
909
|
for (const [id, info] of Object.entries(poolInfos)) {
|
|
914
|
-
const baseReserve = vaultInfo[info.baseVault.toString()].sub(info.baseNeedTakePnl)
|
|
915
|
-
const quoteReserve = vaultInfo[info.quoteVault.toString()].sub(info.quoteNeedTakePnl)
|
|
910
|
+
const baseReserve = vaultInfo[info.baseVault.toString()].sub(info.baseNeedTakePnl);
|
|
911
|
+
const quoteReserve = vaultInfo[info.quoteVault.toString()].sub(info.quoteNeedTakePnl);
|
|
916
912
|
returnData[id] = {
|
|
917
913
|
...info,
|
|
918
914
|
baseReserve,
|
|
919
915
|
quoteReserve,
|
|
920
|
-
poolPrice: new Decimal(quoteReserve.toString())
|
|
921
|
-
.div(new Decimal(
|
|
922
|
-
|
|
916
|
+
poolPrice: new Decimal(quoteReserve.toString())
|
|
917
|
+
.div(new Decimal(10).pow(info.quoteDecimal.toString()))
|
|
918
|
+
.div(new Decimal(baseReserve.toString()).div(new Decimal(10).pow(info.baseDecimal.toString()))),
|
|
919
|
+
};
|
|
923
920
|
}
|
|
924
921
|
|
|
925
|
-
return returnData
|
|
922
|
+
return returnData;
|
|
926
923
|
}
|
|
927
924
|
}
|