@raydium-io/raydium-sdk-v2 0.1.80-alpha → 0.1.81-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/{api-32ee53bc.d.ts → api-7264fa6b.d.ts} +13 -13
- package/lib/common/accountInfo.d.ts +1 -1
- package/lib/common/bignumber.d.ts +1 -1
- package/lib/common/constant.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/layout.d.ts +2 -2
- 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 +15 -15
- 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/curve/calculator.d.ts +1 -1
- package/lib/raydium/cpmm/curve/constantProduct.d.ts +1 -1
- package/lib/raydium/cpmm/index.d.ts +1 -1
- package/lib/raydium/cpmm/instruction.d.ts +1 -1
- package/lib/raydium/cpmm/layout.d.ts +3 -3
- 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 +2 -2
- package/lib/raydium/liquidity/liquidity.d.ts +3 -3
- 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/serum/layout.d.ts +2 -2
- package/lib/raydium/token/constant.d.ts +1 -1
- package/lib/raydium/token/index.d.ts +1 -1
- package/lib/raydium/token/layout.d.ts +2 -2
- 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-7a07027a.d.ts → raydium-dc89bd2c.d.ts} +8 -5
- package/lib/{type-af770c47.d.ts → type-c36f6551.d.ts} +1 -1
- package/package.json +2 -2
- package/src/raydium/account/account.ts +21 -7
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Structure } from '../../marshmallow/index.js';
|
|
2
|
-
import * as _solana_web3_js from '@solana/web3.js';
|
|
3
2
|
import * as BN from 'bn.js';
|
|
3
|
+
import * as _solana_web3_js from '@solana/web3.js';
|
|
4
4
|
import { GetStructureSchema } from '../../marshmallow/buffer-layout.js';
|
|
5
5
|
|
|
6
|
-
declare const MARKET_STATE_LAYOUT_V3: Structure<
|
|
6
|
+
declare const MARKET_STATE_LAYOUT_V3: Structure<_solana_web3_js.PublicKey | Buffer | BN, "", {
|
|
7
7
|
baseMint: _solana_web3_js.PublicKey;
|
|
8
8
|
quoteMint: _solana_web3_js.PublicKey;
|
|
9
9
|
ownAddress: _solana_web3_js.PublicKey;
|
|
@@ -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 { bH as LpToken, bG as SplToken, bE as TokenInfo, bF as TokenJson } from '../../api-
|
|
3
|
+
export { bH as LpToken, bG as SplToken, bE as TokenInfo, bF as TokenJson } from '../../api-7264fa6b.js';
|
|
4
4
|
export { parseTokenInfo, solToWSolToken, toApiV3Token, toFeeConfig, toToken, toTokenAmount, toTokenInfo, wSolToSolToken } from './utils.js';
|
|
5
5
|
import 'axios';
|
|
6
6
|
import '../../solana/type.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Structure } from '../../marshmallow/index.js';
|
|
2
|
-
import * as _solana_web3_js from '@solana/web3.js';
|
|
3
2
|
import * as BN from 'bn.js';
|
|
3
|
+
import * as _solana_web3_js from '@solana/web3.js';
|
|
4
4
|
import '../../marshmallow/buffer-layout.js';
|
|
5
5
|
|
|
6
|
-
declare const SPL_MINT_LAYOUT: Structure<number |
|
|
6
|
+
declare const SPL_MINT_LAYOUT: Structure<number | _solana_web3_js.PublicKey | BN, "", {
|
|
7
7
|
decimals: number;
|
|
8
8
|
freezeAuthority: _solana_web3_js.PublicKey;
|
|
9
9
|
mintAuthority: _solana_web3_js.PublicKey;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@solana/web3.js';
|
|
2
|
-
import '../../api-
|
|
3
|
-
export { k as default } from '../../raydium-
|
|
2
|
+
import '../../api-7264fa6b.js';
|
|
3
|
+
export { k as default } from '../../raydium-dc89bd2c.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
import '../../solana/type.js';
|
|
6
6
|
import 'bn.js';
|
|
@@ -22,7 +22,7 @@ import '../liquidity/stable.js';
|
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
23
|
import '../liquidity/layout.js';
|
|
24
24
|
import '../clmm/layout.js';
|
|
25
|
-
import '../../type-
|
|
25
|
+
import '../../type-c36f6551.js';
|
|
26
26
|
import '../cpmm/type.js';
|
|
27
27
|
import '../cpmm/curve/calculator.js';
|
|
28
28
|
import '../cpmm/layout.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { bH as LpToken, bG as SplToken, bE as TokenInfo, bF as TokenJson } from '../../api-
|
|
1
|
+
export { bH as LpToken, bG as SplToken, bE as TokenInfo, bF as TokenJson } from '../../api-7264fa6b.js';
|
|
2
2
|
import '../../module/token.js';
|
|
3
3
|
import 'axios';
|
|
4
4
|
import '../../solana/type.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
2
2
|
import { RawMint, TransferFeeConfigLayout } from '@solana/spl-token';
|
|
3
|
-
import { bE as TokenInfo, ad as BigNumberish, c7 as TokenAmount, i as ApiV3Token } from '../../api-
|
|
3
|
+
import { bE as TokenInfo, ad as BigNumberish, c7 as TokenAmount, i as ApiV3Token } from '../../api-7264fa6b.js';
|
|
4
4
|
import { Token } from '../../module/token.js';
|
|
5
5
|
import 'axios';
|
|
6
6
|
import '../../solana/type.js';
|
|
@@ -2,7 +2,7 @@ export { makeSwapInstruction, route1Instruction, route2Instruction, routeInstruc
|
|
|
2
2
|
export { BasicPoolInfo, ComputeAmountOutAmmLayout, ComputeAmountOutLayout, ComputeAmountOutRouteLayout, ComputePoolType, ComputeRoutePathType, MakeSwapInstructionParam, PoolAccountInfoV4, ReturnTypeFetchMultipleInfo, ReturnTypeGetAddLiquidityDefaultPool, ReturnTypeGetAllRoute, ReturnTypeMakeSwapInstruction, ReturnTypeMakeSwapTransaction, RoutePathType } from './type.js';
|
|
3
3
|
import '@solana/web3.js';
|
|
4
4
|
import 'bn.js';
|
|
5
|
-
import '../../api-
|
|
5
|
+
import '../../api-7264fa6b.js';
|
|
6
6
|
import 'axios';
|
|
7
7
|
import '../../solana/type.js';
|
|
8
8
|
import '@solana/spl-token';
|
|
@@ -17,7 +17,7 @@ import '../../common/logger.js';
|
|
|
17
17
|
import '../../module/currency.js';
|
|
18
18
|
import '../../marshmallow/index.js';
|
|
19
19
|
import '../../marshmallow/buffer-layout.js';
|
|
20
|
-
import '../../type-
|
|
20
|
+
import '../../type-c36f6551.js';
|
|
21
21
|
import '../clmm/layout.js';
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
23
|
import '../liquidity/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 { r as ApiV3PoolInfoItem, D as PoolKeys } from '../../api-
|
|
3
|
+
import { r as ApiV3PoolInfoItem, D as PoolKeys } from '../../api-7264fa6b.js';
|
|
4
4
|
import { ComputePoolType, MakeSwapInstructionParam, ReturnTypeMakeSwapInstruction } from './type.js';
|
|
5
5
|
import 'axios';
|
|
6
6
|
import '../../solana/type.js';
|
|
@@ -16,7 +16,7 @@ import '../../common/logger.js';
|
|
|
16
16
|
import '../../module/currency.js';
|
|
17
17
|
import '../../marshmallow/index.js';
|
|
18
18
|
import '../../marshmallow/buffer-layout.js';
|
|
19
|
-
import '../../type-
|
|
19
|
+
import '../../type-c36f6551.js';
|
|
20
20
|
import '../clmm/layout.js';
|
|
21
21
|
import '../liquidity/type.js';
|
|
22
22
|
import '../liquidity/layout.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import '@solana/web3.js';
|
|
2
2
|
import 'bn.js';
|
|
3
|
-
import '../../api-
|
|
3
|
+
import '../../api-7264fa6b.js';
|
|
4
4
|
import '../../common/txTool/txType.js';
|
|
5
|
-
export { j as default } from '../../raydium-
|
|
6
|
-
import '../../type-
|
|
5
|
+
export { j as default } from '../../raydium-dc89bd2c.js';
|
|
6
|
+
import '../../type-c36f6551.js';
|
|
7
7
|
import '../liquidity/type.js';
|
|
8
8
|
import '../cpmm/type.js';
|
|
9
9
|
import './type.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PublicKey, Keypair, Signer, TransactionInstruction, Transaction } from '@solana/web3.js';
|
|
2
2
|
import BN__default from 'bn.js';
|
|
3
3
|
import Decimal from 'decimal.js';
|
|
4
|
-
import { bQ as TransferAmountFee, c7 as TokenAmount, D as PoolKeys, r as ApiV3PoolInfoItem } from '../../api-
|
|
4
|
+
import { bQ as TransferAmountFee, c7 as TokenAmount, D as PoolKeys, r as ApiV3PoolInfoItem } from '../../api-7264fa6b.js';
|
|
5
5
|
import { Token } from '../../module/token.js';
|
|
6
|
-
import { d as ComputeClmmPoolInfo } from '../../type-
|
|
6
|
+
import { d as ComputeClmmPoolInfo } from '../../type-c36f6551.js';
|
|
7
7
|
import { ComputeAmountOutParam } from '../liquidity/type.js';
|
|
8
8
|
import { CpmmComputeData } from '../cpmm/type.js';
|
|
9
9
|
import 'axios';
|
package/lib/raydium/type.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@solana/web3.js';
|
|
2
2
|
import 'bn.js';
|
|
3
3
|
import '@solana/spl-token';
|
|
4
|
-
export { bY as ArrayItem, bO as ComputeBudgetConfig, c3 as Cover, bZ as ExactPartial, b_ as ExactRequired, c2 as Fallback, bR as GetTransferAmountFee, c0 as GetValue, bN as InstructionReturn, bP as LoadParams, bM as MakeMultiTransaction, bK as MakeTransaction, bL as MakeV0Transaction, bV as MayArray, bW as MayDeepArray, bX as MayFunction, bU as ReplaceType, bS as ReturnTypeFetchMultipleMintInfo, bT as ReturnTypeFetchMultipleMintInfos, bI as ReturnTypeMakeInstructions, b$ as SKeyof, c1 as SOR, bJ as SignAllTransactions, bQ as TransferAmountFee, c4 as UnionCover, c5 as unionArr } from '../api-
|
|
4
|
+
export { bY as ArrayItem, bO as ComputeBudgetConfig, c3 as Cover, bZ as ExactPartial, b_ as ExactRequired, c2 as Fallback, bR as GetTransferAmountFee, c0 as GetValue, bN as InstructionReturn, bP as LoadParams, bM as MakeMultiTransaction, bK as MakeTransaction, bL as MakeV0Transaction, bV as MayArray, bW as MayDeepArray, bX as MayFunction, bU as ReplaceType, bS as ReturnTypeFetchMultipleMintInfo, bT as ReturnTypeFetchMultipleMintInfos, bI as ReturnTypeMakeInstructions, b$ as SKeyof, c1 as SOR, bJ as SignAllTransactions, bQ as TransferAmountFee, c4 as UnionCover, c5 as unionArr } from '../api-7264fa6b.js';
|
|
5
5
|
import 'axios';
|
|
6
6
|
import '../solana/type.js';
|
|
7
7
|
import '../api/url.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
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-dc89bd2c.js';
|
|
2
2
|
import '@solana/web3.js';
|
|
3
|
-
import '../../api-
|
|
3
|
+
import '../../api-7264fa6b.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
import '../../solana/type.js';
|
|
6
6
|
import 'bn.js';
|
|
@@ -22,7 +22,7 @@ import '../liquidity/stable.js';
|
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
23
|
import '../liquidity/layout.js';
|
|
24
24
|
import '../clmm/layout.js';
|
|
25
|
-
import '../../type-
|
|
25
|
+
import '../../type-c36f6551.js';
|
|
26
26
|
import '../cpmm/type.js';
|
|
27
27
|
import '../cpmm/curve/calculator.js';
|
|
28
28
|
import '../cpmm/layout.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
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-dc89bd2c.js';
|
|
5
5
|
import '../../marshmallow/buffer-layout.js';
|
|
6
|
-
import '../../api-
|
|
6
|
+
import '../../api-7264fa6b.js';
|
|
7
7
|
import 'axios';
|
|
8
8
|
import '../../solana/type.js';
|
|
9
9
|
import '@solana/spl-token';
|
|
@@ -22,7 +22,7 @@ import '../liquidity/stable.js';
|
|
|
22
22
|
import '../liquidity/type.js';
|
|
23
23
|
import '../liquidity/layout.js';
|
|
24
24
|
import '../clmm/layout.js';
|
|
25
|
-
import '../../type-
|
|
25
|
+
import '../../type-c36f6551.js';
|
|
26
26
|
import '../cpmm/type.js';
|
|
27
27
|
import '../cpmm/curve/calculator.js';
|
|
28
28
|
import '../cpmm/layout.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PublicKey, Commitment, EpochInfo, Connection, Transaction, Signer, TransactionInstruction, Keypair } from '@solana/web3.js';
|
|
2
|
-
import { aC as TxBuilder, au as AddInstructionParam, ad as BigNumberish, bp as CreateFarm, aB as MakeTxData, bq as CreateFarmExtInfo, br as UpdateFarmReward, bs as UpdateFarmRewards, bt as FarmDWParam, Z as FormatFarmInfoOut, bO as ComputeBudgetConfig, aA as MakeMultiTxData, p as ApiV3PoolInfoStandardItem, cb as Percent, c7 as TokenAmount, w as AmmV4Keys, x as AmmV5Keys, o as ApiV3PoolInfoConcentratedItem, Y as FormatFarmInfoOutV6, B as ClmmKeys, bK as MakeTransaction, bT as ReturnTypeFetchMultipleMintInfos, y as CpmmKeys, q as ApiV3PoolInfoStandardItemCpmm, bR as GetTransferAmountFee, D as PoolKeys, i as ApiV3Token, a0 as OwnerIdoInfo, a1 as IdoKeysData, bP as LoadParams, J as JupTokenType, bE as TokenInfo, bJ as SignAllTransactions, a as Api, _ as AvailabilityCheckAPI3, j as ApiV3TokenRes } from './api-
|
|
2
|
+
import { aC as TxBuilder, au as AddInstructionParam, ad as BigNumberish, bp as CreateFarm, aB as MakeTxData, bq as CreateFarmExtInfo, br as UpdateFarmReward, bs as UpdateFarmRewards, bt as FarmDWParam, Z as FormatFarmInfoOut, bO as ComputeBudgetConfig, aA as MakeMultiTxData, p as ApiV3PoolInfoStandardItem, cb as Percent, c7 as TokenAmount, w as AmmV4Keys, x as AmmV5Keys, o as ApiV3PoolInfoConcentratedItem, Y as FormatFarmInfoOutV6, B as ClmmKeys, bK as MakeTransaction, bT as ReturnTypeFetchMultipleMintInfos, y as CpmmKeys, q as ApiV3PoolInfoStandardItemCpmm, bR as GetTransferAmountFee, D as PoolKeys, i as ApiV3Token, a0 as OwnerIdoInfo, a1 as IdoKeysData, bP as LoadParams, J as JupTokenType, bE as TokenInfo, bJ as SignAllTransactions, a as Api, _ as AvailabilityCheckAPI3, j as ApiV3TokenRes } from './api-7264fa6b.js';
|
|
3
3
|
import { API_URL_CONFIG } from './api/url.js';
|
|
4
4
|
import { Owner } from './common/owner.js';
|
|
5
5
|
import { Cluster } from './solana/type.js';
|
|
@@ -11,7 +11,7 @@ import Decimal from 'decimal.js';
|
|
|
11
11
|
import { StableLayout } from './raydium/liquidity/stable.js';
|
|
12
12
|
import { AddLiquidityParams, RemoveParams, CreatePoolParam, CreatePoolAddress, CreateMarketAndPoolParam, ComputeAmountOutParam, ComputeAmountInParam, SwapParam, AmmRpcData } from './raydium/liquidity/type.js';
|
|
13
13
|
import { ClmmPositionLayout, PositionInfoLayout, PoolInfoLayout } from './raydium/clmm/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, L as LockPosition, J as ClmmLockAddress, H as HarvestLockPosition, s as InitRewardParams, E as InitRewardExtInfo, t as InitRewardsParams, u as SetRewardParams, v as SetRewardsParams, w as CollectRewardParams, x as CollectRewardsParams, y as HarvestAllRewardsParams, F as ClmmRpcData, d as ComputeClmmPoolInfo, l as ReturnTypeFetchMultiplePoolTickArrays } 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, L as LockPosition, J as ClmmLockAddress, H as HarvestLockPosition, s as InitRewardParams, E as InitRewardExtInfo, t as InitRewardsParams, u as SetRewardParams, v as SetRewardsParams, w as CollectRewardParams, x as CollectRewardsParams, y as HarvestAllRewardsParams, F as ClmmRpcData, d as ComputeClmmPoolInfo, l as ReturnTypeFetchMultiplePoolTickArrays } from './type-c36f6551.js';
|
|
15
15
|
import { CpmmRpcData, CpmmComputeData, CreateCpmmPoolParam, CreateCpmmPoolAddress, AddCpmmLiquidityParams, WithdrawCpmmLiquidityParams, CpmmSwapParams, LockCpmmLpParams, CpmmLockExtInfo, HarvestLockCpmmLpParams, ComputePairAmountParams } from './raydium/cpmm/type.js';
|
|
16
16
|
import { ComputeAmountOutLayout, BasicPoolInfo, ReturnTypeGetAllRoute, ComputeRoutePathType, ComputePoolType, ReturnTypeFetchMultipleInfo } from './raydium/tradeV2/type.js';
|
|
17
17
|
import { Structure } from './marshmallow/index.js';
|
|
@@ -35,6 +35,7 @@ declare class ModuleBase {
|
|
|
35
35
|
interface TokenAccountDataProp {
|
|
36
36
|
tokenAccounts?: TokenAccount[];
|
|
37
37
|
tokenAccountRawInfos?: TokenAccountRaw[];
|
|
38
|
+
notSubscribeAccountChange?: boolean;
|
|
38
39
|
}
|
|
39
40
|
declare class Account extends ModuleBase {
|
|
40
41
|
private _tokenAccounts;
|
|
@@ -42,10 +43,12 @@ declare class Account extends ModuleBase {
|
|
|
42
43
|
private _accountChangeListenerId?;
|
|
43
44
|
private _accountListener;
|
|
44
45
|
private _clientOwnedToken;
|
|
46
|
+
private _notSubscribeAccountChange;
|
|
45
47
|
private _accountFetchTime;
|
|
46
48
|
constructor(params: TokenAccountDataProp & ModuleBaseProps);
|
|
47
49
|
get tokenAccounts(): TokenAccount[];
|
|
48
50
|
get tokenAccountRawInfos(): TokenAccountRaw[];
|
|
51
|
+
set notSubscribeAccountChange(subscribe: boolean);
|
|
49
52
|
updateTokenAccount({ tokenAccounts, tokenAccountRawInfos }: TokenAccountDataProp): Account;
|
|
50
53
|
addAccountChangeListener(cbk: (data: TokenAccountDataProp) => void): Account;
|
|
51
54
|
removeAccountChangeListener(cbk: (data: TokenAccountDataProp) => void): Account;
|
|
@@ -488,7 +491,7 @@ interface SHOW_INFO {
|
|
|
488
491
|
declare type canClaimErrorType = "outOfOperationalTime" | "alreadyClaimIt" | undefined;
|
|
489
492
|
declare class Utils1216 extends ModuleBase {
|
|
490
493
|
static CLAIMED_NUM: number;
|
|
491
|
-
static POOL_LAYOUT: Structure<number |
|
|
494
|
+
static POOL_LAYOUT: Structure<number | PublicKey | Buffer | BN__default | BN__default[] | {
|
|
492
495
|
mintDecimals: number;
|
|
493
496
|
mintAddress: PublicKey;
|
|
494
497
|
mintVault: PublicKey;
|
|
@@ -509,7 +512,7 @@ declare class Utils1216 extends ModuleBase {
|
|
|
509
512
|
totalClaimedAmount: BN__default;
|
|
510
513
|
}[];
|
|
511
514
|
}>;
|
|
512
|
-
static OWNER_LAYOUT: Structure<number |
|
|
515
|
+
static OWNER_LAYOUT: Structure<number | PublicKey | Buffer | BN__default | BN__default[] | {
|
|
513
516
|
mintAddress: PublicKey;
|
|
514
517
|
debtAmount: BN__default;
|
|
515
518
|
claimedAmount: BN__default;
|
|
@@ -698,4 +701,4 @@ declare class Raydium {
|
|
|
698
701
|
fetchAvailabilityStatus(skipCheck?: boolean): Promise<Partial<AvailabilityCheckAPI3>>;
|
|
699
702
|
}
|
|
700
703
|
|
|
701
|
-
export { Account as A, Clmm as C, Farm as F, LiquidityModule as L, MarketExtInfo as M, RaydiumLoadParams as R, SHOW_INFO as S, TokenAccountDataProp as T, Utils1216 as U, RaydiumApiBatchRequestParams as a, RaydiumConstructorParams as b, Raydium as c, canClaimErrorType as d, MarketV2
|
|
704
|
+
export { Account as A, Clmm as C, Farm as F, LiquidityModule as L, MarketExtInfo as M, RaydiumLoadParams as R, SHOW_INFO as S, TokenAccountDataProp as T, Utils1216 as U, RaydiumApiBatchRequestParams as a, RaydiumConstructorParams as b, Raydium as c, canClaimErrorType as d, MarketV2 as e, MarketV2$1 as f, ModuleBase as g, ModuleBaseProps as h, CpmmModule as i, TradeV2 as j, TokenModule as k };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PublicKey, Transaction, Signer, Keypair, EpochInfo } from '@solana/web3.js';
|
|
2
2
|
import BN__default from 'bn.js';
|
|
3
3
|
import Decimal from 'decimal.js';
|
|
4
|
-
import { o as ApiV3PoolInfoConcentratedItem, d as ApiClmmConfigInfo, i as ApiV3Token, bR as GetTransferAmountFee, bQ as TransferAmountFee, cc as Price, cb as Percent, c7 as TokenAmount, bO as ComputeBudgetConfig, c9 as Fraction, bE as TokenInfo, B as ClmmKeys } from './api-
|
|
4
|
+
import { o as ApiV3PoolInfoConcentratedItem, d as ApiClmmConfigInfo, i as ApiV3Token, bR as GetTransferAmountFee, bQ as TransferAmountFee, cc as Price, cb as Percent, c7 as TokenAmount, bO as ComputeBudgetConfig, c9 as Fraction, bE as TokenInfo, B as ClmmKeys } from './api-7264fa6b.js';
|
|
5
5
|
import { TxVersion } from './common/txTool/txType.js';
|
|
6
6
|
import { PoolInfoLayout, ClmmPositionLayout, LockClPositionLayoutV2 } from './raydium/clmm/layout.js';
|
|
7
7
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raydium-io/raydium-sdk-v2",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.81-alpha",
|
|
4
4
|
"description": "An SDK for building applications on top of Raydium.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -78,4 +78,4 @@
|
|
|
78
78
|
"typescript": "^4.7.3",
|
|
79
79
|
"yarn": "^1.22.19"
|
|
80
80
|
}
|
|
81
|
-
}
|
|
81
|
+
}
|
|
@@ -21,6 +21,7 @@ import { generatePubKey, parseTokenAccountResp } from "./util";
|
|
|
21
21
|
export interface TokenAccountDataProp {
|
|
22
22
|
tokenAccounts?: TokenAccount[];
|
|
23
23
|
tokenAccountRawInfos?: TokenAccountRaw[];
|
|
24
|
+
notSubscribeAccountChange?: boolean;
|
|
24
25
|
}
|
|
25
26
|
export default class Account extends ModuleBase {
|
|
26
27
|
private _tokenAccounts: TokenAccount[] = [];
|
|
@@ -28,13 +29,15 @@ export default class Account extends ModuleBase {
|
|
|
28
29
|
private _accountChangeListenerId?: number;
|
|
29
30
|
private _accountListener: ((data: TokenAccountDataProp) => void)[] = [];
|
|
30
31
|
private _clientOwnedToken = false;
|
|
32
|
+
private _notSubscribeAccountChange = false;
|
|
31
33
|
private _accountFetchTime = 0;
|
|
32
34
|
|
|
33
35
|
constructor(params: TokenAccountDataProp & ModuleBaseProps) {
|
|
34
36
|
super(params);
|
|
35
|
-
const { tokenAccounts, tokenAccountRawInfos } = params;
|
|
37
|
+
const { tokenAccounts, tokenAccountRawInfos, notSubscribeAccountChange } = params;
|
|
36
38
|
this._tokenAccounts = tokenAccounts || [];
|
|
37
39
|
this._tokenAccountRawInfos = tokenAccountRawInfos || [];
|
|
40
|
+
this._notSubscribeAccountChange = notSubscribeAccountChange ?? false;
|
|
38
41
|
this._clientOwnedToken = !!(tokenAccounts || tokenAccountRawInfos);
|
|
39
42
|
}
|
|
40
43
|
|
|
@@ -45,6 +48,10 @@ export default class Account extends ModuleBase {
|
|
|
45
48
|
return this._tokenAccountRawInfos;
|
|
46
49
|
}
|
|
47
50
|
|
|
51
|
+
set notSubscribeAccountChange(subscribe: boolean) {
|
|
52
|
+
this._notSubscribeAccountChange = subscribe;
|
|
53
|
+
}
|
|
54
|
+
|
|
48
55
|
public updateTokenAccount({ tokenAccounts, tokenAccountRawInfos }: TokenAccountDataProp): Account {
|
|
49
56
|
if (tokenAccounts) this._tokenAccounts = tokenAccounts;
|
|
50
57
|
if (tokenAccountRawInfos) this._tokenAccountRawInfos = tokenAccountRawInfos;
|
|
@@ -120,12 +127,19 @@ export default class Account extends ModuleBase {
|
|
|
120
127
|
|
|
121
128
|
this._accountFetchTime = Date.now();
|
|
122
129
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
this.scope.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
if (!this._notSubscribeAccountChange) {
|
|
131
|
+
this._accountChangeListenerId && this.scope.connection.removeAccountChangeListener(this._accountChangeListenerId);
|
|
132
|
+
this._accountChangeListenerId = this.scope.connection.onAccountChange(
|
|
133
|
+
this.scope.ownerPubKey,
|
|
134
|
+
() => {
|
|
135
|
+
this.fetchWalletTokenAccounts({ forceUpdate: true });
|
|
136
|
+
this._accountListener.forEach((cb) =>
|
|
137
|
+
cb({ tokenAccounts: this._tokenAccounts, tokenAccountRawInfos: this._tokenAccountRawInfos }),
|
|
138
|
+
);
|
|
139
|
+
},
|
|
140
|
+
{ commitment: config?.commitment },
|
|
141
|
+
);
|
|
142
|
+
}
|
|
129
143
|
|
|
130
144
|
return { tokenAccounts, tokenAccountRawInfos };
|
|
131
145
|
}
|