@raydium-io/raydium-sdk-v2 0.1.92-alpha → 0.1.94-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.
Files changed (104) hide show
  1. package/lib/api/api.d.ts +1 -1
  2. package/lib/api/index.d.ts +1 -1
  3. package/lib/api/type.d.ts +1 -1
  4. package/lib/{api-9d98bd04.d.ts → api-c8ce9f12.d.ts} +18 -18
  5. package/lib/common/accountInfo.d.ts +1 -1
  6. package/lib/common/bignumber.d.ts +1 -1
  7. package/lib/common/constant.d.ts +1 -1
  8. package/lib/common/fractionUtil.d.ts +1 -1
  9. package/lib/common/index.d.ts +1 -1
  10. package/lib/common/transfer.d.ts +1 -1
  11. package/lib/common/txTool/txTool.d.ts +1 -1
  12. package/lib/common/txTool/txUtils.d.ts +1 -1
  13. package/lib/common/utility.d.ts +1 -1
  14. package/lib/index.d.ts +3 -3
  15. package/lib/index.js +1 -1
  16. package/lib/index.js.map +1 -1
  17. package/lib/index.mjs +1 -1
  18. package/lib/index.mjs.map +1 -1
  19. package/lib/module/amount.d.ts +1 -1
  20. package/lib/module/fraction.d.ts +1 -1
  21. package/lib/module/index.d.ts +1 -1
  22. package/lib/module/percent.d.ts +1 -1
  23. package/lib/module/price.d.ts +1 -1
  24. package/lib/raydium/account/account.d.ts +3 -3
  25. package/lib/raydium/account/account.js +1 -1
  26. package/lib/raydium/account/account.js.map +1 -1
  27. package/lib/raydium/account/account.mjs +1 -1
  28. package/lib/raydium/account/account.mjs.map +1 -1
  29. package/lib/raydium/account/index.d.ts +1 -1
  30. package/lib/raydium/account/instruction.d.ts +1 -1
  31. package/lib/raydium/account/layout.d.ts +3 -3
  32. package/lib/raydium/account/types.d.ts +1 -1
  33. package/lib/raydium/account/util.d.ts +1 -1
  34. package/lib/raydium/clmm/clmm.d.ts +3 -3
  35. package/lib/raydium/clmm/index.d.ts +3 -3
  36. package/lib/raydium/clmm/instrument.d.ts +2 -2
  37. package/lib/raydium/clmm/layout.d.ts +12 -12
  38. package/lib/raydium/clmm/type.d.ts +2 -2
  39. package/lib/raydium/clmm/utils/math.d.ts +2 -2
  40. package/lib/raydium/clmm/utils/pool.d.ts +2 -2
  41. package/lib/raydium/clmm/utils/position.d.ts +2 -2
  42. package/lib/raydium/clmm/utils/tick.d.ts +2 -2
  43. package/lib/raydium/clmm/utils/tickQuery.d.ts +2 -2
  44. package/lib/raydium/clmm/utils/tickarrayBitmap.d.ts +2 -2
  45. package/lib/raydium/cpmm/cpmm.d.ts +3 -3
  46. package/lib/raydium/cpmm/curve/calculator.d.ts +1 -1
  47. package/lib/raydium/cpmm/curve/constantProduct.d.ts +1 -1
  48. package/lib/raydium/cpmm/index.d.ts +1 -1
  49. package/lib/raydium/cpmm/instruction.d.ts +1 -1
  50. package/lib/raydium/cpmm/layout.d.ts +3 -3
  51. package/lib/raydium/cpmm/type.d.ts +1 -1
  52. package/lib/raydium/farm/config.d.ts +1 -1
  53. package/lib/raydium/farm/farm.d.ts +3 -3
  54. package/lib/raydium/farm/farm.js +1 -1
  55. package/lib/raydium/farm/farm.js.map +1 -1
  56. package/lib/raydium/farm/farm.mjs +1 -1
  57. package/lib/raydium/farm/farm.mjs.map +1 -1
  58. package/lib/raydium/farm/index.d.ts +1 -1
  59. package/lib/raydium/farm/instruction.d.ts +1 -1
  60. package/lib/raydium/farm/layout.d.ts +1 -1
  61. package/lib/raydium/farm/type.d.ts +1 -1
  62. package/lib/raydium/farm/util.d.ts +1 -1
  63. package/lib/raydium/ido/ido.d.ts +3 -3
  64. package/lib/raydium/ido/index.d.ts +3 -3
  65. package/lib/raydium/ido/instruction.d.ts +1 -1
  66. package/lib/raydium/ido/type.d.ts +1 -1
  67. package/lib/raydium/index.d.ts +3 -3
  68. package/lib/raydium/index.js +1 -1
  69. package/lib/raydium/index.js.map +1 -1
  70. package/lib/raydium/index.mjs +1 -1
  71. package/lib/raydium/index.mjs.map +1 -1
  72. package/lib/raydium/liquidity/index.d.ts +1 -1
  73. package/lib/raydium/liquidity/instruction.d.ts +1 -1
  74. package/lib/raydium/liquidity/layout.d.ts +4 -4
  75. package/lib/raydium/liquidity/liquidity.d.ts +3 -3
  76. package/lib/raydium/liquidity/type.d.ts +1 -1
  77. package/lib/raydium/liquidity/utils.d.ts +1 -1
  78. package/lib/raydium/marketV2/createMarket.d.ts +3 -3
  79. package/lib/raydium/marketV2/index.d.ts +3 -3
  80. package/lib/raydium/moduleBase.d.ts +3 -3
  81. package/lib/raydium/raydium.d.ts +3 -3
  82. package/lib/raydium/raydium.js +1 -1
  83. package/lib/raydium/raydium.js.map +1 -1
  84. package/lib/raydium/raydium.mjs +1 -1
  85. package/lib/raydium/raydium.mjs.map +1 -1
  86. package/lib/raydium/serum/layout.d.ts +2 -2
  87. package/lib/raydium/token/constant.d.ts +1 -1
  88. package/lib/raydium/token/index.d.ts +1 -1
  89. package/lib/raydium/token/layout.d.ts +2 -2
  90. package/lib/raydium/token/token.d.ts +3 -3
  91. package/lib/raydium/token/type.d.ts +1 -1
  92. package/lib/raydium/token/utils.d.ts +1 -1
  93. package/lib/raydium/tradeV2/index.d.ts +2 -2
  94. package/lib/raydium/tradeV2/instrument.d.ts +2 -2
  95. package/lib/raydium/tradeV2/trade.d.ts +3 -3
  96. package/lib/raydium/tradeV2/type.d.ts +2 -2
  97. package/lib/raydium/type.d.ts +1 -1
  98. package/lib/raydium/utils1216/index.d.ts +3 -3
  99. package/lib/raydium/utils1216/utils1216.d.ts +3 -3
  100. package/lib/{raydium-cfb7854f.d.ts → raydium-7bc83789.d.ts} +6 -5
  101. package/lib/{type-351304d7.d.ts → type-2c421f5d.d.ts} +1 -1
  102. package/package.json +1 -1
  103. package/src/raydium/account/account.ts +9 -18
  104. package/src/raydium/farm/farm.ts +43 -11
@@ -1,9 +1,9 @@
1
1
  import { Structure } from '../../marshmallow/index.js';
2
- import * as BN from 'bn.js';
3
2
  import * as _solana_web3_js from '@solana/web3.js';
3
+ import * as BN from 'bn.js';
4
4
  import { GetStructureSchema } from '../../marshmallow/buffer-layout.js';
5
5
 
6
- declare const MARKET_STATE_LAYOUT_V3: Structure<_solana_web3_js.PublicKey | Buffer | BN, "", {
6
+ declare const MARKET_STATE_LAYOUT_V3: Structure<BN | Buffer | _solana_web3_js.PublicKey, "", {
7
7
  baseMint: _solana_web3_js.PublicKey;
8
8
  quoteMint: _solana_web3_js.PublicKey;
9
9
  ownAddress: _solana_web3_js.PublicKey;
@@ -1,4 +1,4 @@
1
- import { bE as TokenInfo } from '../../api-9d98bd04.js';
1
+ import { bE as TokenInfo } from '../../api-c8ce9f12.js';
2
2
  import 'axios';
3
3
  import '../../solana/type.js';
4
4
  import '@solana/web3.js';
@@ -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-9d98bd04.js';
3
+ export { bH as LpToken, bG as SplToken, bE as TokenInfo, bF as TokenJson } from '../../api-c8ce9f12.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 BN from 'bn.js';
3
2
  import * as _solana_web3_js from '@solana/web3.js';
3
+ import * as BN from 'bn.js';
4
4
  import '../../marshmallow/buffer-layout.js';
5
5
 
6
- declare const SPL_MINT_LAYOUT: Structure<number | _solana_web3_js.PublicKey | BN, "", {
6
+ declare const SPL_MINT_LAYOUT: Structure<number | BN | _solana_web3_js.PublicKey, "", {
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-9d98bd04.js';
3
- export { k as default } from '../../raydium-cfb7854f.js';
2
+ import '../../api-c8ce9f12.js';
3
+ export { k as default } from '../../raydium-7bc83789.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-351304d7.js';
25
+ import '../../type-2c421f5d.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-9d98bd04.js';
1
+ export { bH as LpToken, bG as SplToken, bE as TokenInfo, bF as TokenJson } from '../../api-c8ce9f12.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-9d98bd04.js';
3
+ import { bE as TokenInfo, ad as BigNumberish, c7 as TokenAmount, i as ApiV3Token } from '../../api-c8ce9f12.js';
4
4
  import { Token } from '../../module/token.js';
5
5
  import 'axios';
6
6
  import '../../solana/type.js';
@@ -2,7 +2,7 @@ export { ApiSwapV1Out, makeSwapInstruction, route1Instruction, route2Instruction
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-9d98bd04.js';
5
+ import '../../api-c8ce9f12.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-351304d7.js';
20
+ import '../../type-2c421f5d.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-9d98bd04.js';
3
+ import { r as ApiV3PoolInfoItem, D as PoolKeys } from '../../api-c8ce9f12.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-351304d7.js';
19
+ import '../../type-2c421f5d.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-9d98bd04.js';
3
+ import '../../api-c8ce9f12.js';
4
4
  import '../../common/txTool/txType.js';
5
- export { j as default } from '../../raydium-cfb7854f.js';
6
- import '../../type-351304d7.js';
5
+ export { j as default } from '../../raydium-7bc83789.js';
6
+ import '../../type-2c421f5d.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-9d98bd04.js';
4
+ import { bQ as TransferAmountFee, c7 as TokenAmount, D as PoolKeys, r as ApiV3PoolInfoItem } from '../../api-c8ce9f12.js';
5
5
  import { Token } from '../../module/token.js';
6
- import { d as ComputeClmmPoolInfo } from '../../type-351304d7.js';
6
+ import { d as ComputeClmmPoolInfo } from '../../type-2c421f5d.js';
7
7
  import { ComputeAmountOutParam } from '../liquidity/type.js';
8
8
  import { CpmmComputeData } from '../cpmm/type.js';
9
9
  import 'axios';
@@ -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-9d98bd04.js';
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-c8ce9f12.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-cfb7854f.js';
1
+ export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-7bc83789.js';
2
2
  import '@solana/web3.js';
3
- import '../../api-9d98bd04.js';
3
+ import '../../api-c8ce9f12.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-351304d7.js';
25
+ import '../../type-2c421f5d.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-cfb7854f.js';
4
+ export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-7bc83789.js';
5
5
  import '../../marshmallow/buffer-layout.js';
6
- import '../../api-9d98bd04.js';
6
+ import '../../api-c8ce9f12.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-351304d7.js';
25
+ import '../../type-2c421f5d.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-9d98bd04.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-c8ce9f12.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-351304d7.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-2c421f5d.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';
@@ -61,6 +61,7 @@ declare class Account extends ModuleBase {
61
61
  tokenAccounts: TokenAccount[];
62
62
  tokenAccountRawInfos: TokenAccountRaw[];
63
63
  }>;
64
+ clearAccountChangeCkb(): void;
64
65
  getCreatedTokenAccount({ mint, programId, associatedOnly, }: {
65
66
  mint: PublicKey;
66
67
  programId?: PublicKey;
@@ -491,7 +492,7 @@ interface SHOW_INFO {
491
492
  declare type canClaimErrorType = "outOfOperationalTime" | "alreadyClaimIt" | undefined;
492
493
  declare class Utils1216 extends ModuleBase {
493
494
  static CLAIMED_NUM: number;
494
- static POOL_LAYOUT: Structure<number | PublicKey | Buffer | BN__default | BN__default[] | {
495
+ static POOL_LAYOUT: Structure<number | BN__default | Buffer | PublicKey | BN__default[] | {
495
496
  mintDecimals: number;
496
497
  mintAddress: PublicKey;
497
498
  mintVault: PublicKey;
@@ -512,13 +513,13 @@ declare class Utils1216 extends ModuleBase {
512
513
  totalClaimedAmount: BN__default;
513
514
  }[];
514
515
  }>;
515
- static OWNER_LAYOUT: Structure<number | PublicKey | Buffer | BN__default | BN__default[] | {
516
+ static OWNER_LAYOUT: Structure<number | BN__default | Buffer | PublicKey | BN__default[] | {
516
517
  mintAddress: PublicKey;
517
518
  debtAmount: BN__default;
518
519
  claimedAmount: BN__default;
519
520
  }[], "", {
520
- owner: PublicKey;
521
521
  padding: BN__default[];
522
+ owner: PublicKey;
522
523
  version: number;
523
524
  bump: number;
524
525
  poolId: PublicKey;
@@ -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-9d98bd04.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-c8ce9f12.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.92-alpha",
3
+ "version": "0.1.94-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",
@@ -37,7 +37,7 @@ export default class Account extends ModuleBase {
37
37
  const { tokenAccounts, tokenAccountRawInfos, notSubscribeAccountChange } = params;
38
38
  this._tokenAccounts = tokenAccounts || [];
39
39
  this._tokenAccountRawInfos = tokenAccountRawInfos || [];
40
- this._notSubscribeAccountChange = notSubscribeAccountChange ?? false;
40
+ this._notSubscribeAccountChange = notSubscribeAccountChange ?? true;
41
41
  this._clientOwnedToken = !!(tokenAccounts || tokenAccountRawInfos);
42
42
  }
43
43
 
@@ -87,7 +87,9 @@ export default class Account extends ModuleBase {
87
87
  }> {
88
88
  if (
89
89
  this._clientOwnedToken ||
90
- (!config?.forceUpdate && this._tokenAccounts.length && Date.now() - this._accountFetchTime < 1000 * 60 * 3)
90
+ (!config?.forceUpdate &&
91
+ this._tokenAccounts.length &&
92
+ Date.now() - this._accountFetchTime < (this._notSubscribeAccountChange ? 1000 * 5 : 1000 * 60 * 3))
91
93
  ) {
92
94
  return {
93
95
  tokenAccounts: this._tokenAccounts,
@@ -144,6 +146,11 @@ export default class Account extends ModuleBase {
144
146
  return { tokenAccounts, tokenAccountRawInfos };
145
147
  }
146
148
 
149
+ public clearAccountChangeCkb(): void {
150
+ if (this._accountChangeListenerId !== undefined)
151
+ this.scope.connection.removeAccountChangeListener(this._accountChangeListenerId);
152
+ }
153
+
147
154
  // user token account needed, old _selectTokenAccount
148
155
  public async getCreatedTokenAccount({
149
156
  mint,
@@ -264,22 +271,6 @@ export default class Account extends ModuleBase {
264
271
 
265
272
  return { account: ata, instructionParams: newTxInstructions };
266
273
  } else {
267
- // if (mint.equals(WSOLMint)) {
268
- // const txInstruction = await createWSolAccountInstructions({
269
- // connection: this.scope.connection,
270
- // owner: this.scope.ownerPubKey,
271
- // payer: createInfo.payer || this.scope.ownerPubKey,
272
- // amount: createInfo.amount ?? 0,
273
- // skipCloseAccount,
274
- // });
275
- // newTxInstructions.instructions!.push(...(txInstruction.instructions || []));
276
- // newTxInstructions.endInstructions!.push(...(txInstruction.endInstructions || []));
277
- // newTxInstructions.signers!.push(...(txInstruction.signers || []));
278
- // newTxInstructions.instructionTypes!.push(...(txInstruction.instructionTypes || []));
279
- // newTxInstructions.endInstructionTypes!.push(...(txInstruction.endInstructionTypes || []));
280
-
281
- // return { account: txInstruction.addresses.newAccount, instructionParams: newTxInstructions };
282
- // } else {
283
274
  const newTokenAccount = generatePubKey({ fromPublicKey: owner, programId: tokenProgram, assignSeed });
284
275
  const balanceNeeded = await this.scope.connection.getMinimumBalanceForRentExemption(AccountLayout.span);
285
276
 
@@ -585,7 +585,7 @@ export default class Farm extends ModuleBase {
585
585
  }
586
586
  }
587
587
 
588
- if (!deposited && version !== 4) {
588
+ if (version !== 4) {
589
589
  const ledger = getAssociatedLedgerAccount({
590
590
  programId: new PublicKey(farmInfo.programId),
591
591
  poolId: new PublicKey(farmInfo.id),
@@ -593,9 +593,10 @@ export default class Farm extends ModuleBase {
593
593
  version,
594
594
  });
595
595
  const ledgerData = await this.scope.connection.getAccountInfo(ledger);
596
+
596
597
  if (!ledgerData) {
597
- // user has old not ata farm vault and don't have ata vault
598
- if (version !== 6 && (userAuxiliaryLedgers || []).length > 0) {
598
+ // user has old none ata farm vault and don't have ata vault
599
+ if (version !== 6) {
599
600
  const { instruction, instructionType } = createAssociatedLedgerAccountInstruction({
600
601
  id: new PublicKey(farmKeys.id),
601
602
  programId: new PublicKey(farmKeys.programId),
@@ -604,18 +605,49 @@ export default class Farm extends ModuleBase {
604
605
  owner: this.scope.ownerPubKey,
605
606
  });
606
607
  txBuilder.addInstruction({ instructions: [instruction], instructionTypes: [instructionType] });
607
- } else {
608
- this.logAndCreateError("no lp data", { farmId: farmInfo.id, version, ledgerData });
609
608
  }
610
609
  } else {
611
610
  const ledgerLayout = getFarmLedgerLayout(version)!;
612
611
  const ledgerInfo = ledgerLayout.decode(ledgerData!.data);
613
612
  if (ledgerInfo.deposited.isZero()) this.logAndCreateError("no deposited lp", { farmId: farmInfo.id });
614
613
  }
615
- } else if (deposited) {
616
- if (deposited.isZero()) this.logAndCreateError("no deposited lp", { farmId: farmInfo.id });
617
614
  }
618
615
 
616
+ if (deposited && deposited.isZero() && !(userAuxiliaryLedgers || []).length)
617
+ this.logAndCreateError("no deposited lp", { farmId: farmInfo.id });
618
+
619
+ // if (!deposited && version !== 4) {
620
+ // const ledger = getAssociatedLedgerAccount({
621
+ // programId: new PublicKey(farmInfo.programId),
622
+ // poolId: new PublicKey(farmInfo.id),
623
+ // owner: this.scope.ownerPubKey,
624
+ // version,
625
+ // });
626
+ // const ledgerData = await this.scope.connection.getAccountInfo(ledger);
627
+ // if (!ledgerData) {
628
+ // user has old not ata farm vault and don't have ata vault
629
+ // if (version !== 6 && (userAuxiliaryLedgers || []).length > 0) {
630
+ // const { instruction, instructionType } = createAssociatedLedgerAccountInstruction({
631
+ // id: new PublicKey(farmKeys.id),
632
+ // programId: new PublicKey(farmKeys.programId),
633
+ // version,
634
+ // ledger,
635
+ // owner: this.scope.ownerPubKey,
636
+ // });
637
+ // txBuilder.addInstruction({ instructions: [instruction], instructionTypes: [instructionType] });
638
+ // } else {
639
+ // this.logAndCreateError("no lp data", { farmId: farmInfo.id, version, ledgerData });
640
+ // }
641
+ // } else {
642
+ // const ledgerLayout = getFarmLedgerLayout(version)!;
643
+ // const ledgerInfo = ledgerLayout.decode(ledgerData!.data);
644
+ // if (ledgerInfo.deposited.isZero()) this.logAndCreateError("no deposited lp", { farmId: farmInfo.id });
645
+ // }
646
+ // } else if (deposited) {
647
+ // if (deposited.isZero() && !(userAuxiliaryLedgers || []).length)
648
+ // this.logAndCreateError("no deposited lp", { farmId: farmInfo.id });
649
+ // }
650
+
619
651
  const lpMint = farmKeys.lpMint.address;
620
652
  const lpMintUseSOLBalance = useSOLBalance && lpMint === WSOLMint.toString();
621
653
 
@@ -687,10 +719,10 @@ export default class Farm extends ModuleBase {
687
719
  version === 6
688
720
  ? makeWithdrawInstructionV6(insParams)
689
721
  : version === 5
690
- ? makeWithdrawInstructionV5(insParams)
691
- : version === 4
692
- ? makeWithdrawInstructionV4(insParams)
693
- : makeWithdrawInstructionV3(insParams);
722
+ ? makeWithdrawInstructionV5(insParams)
723
+ : version === 4
724
+ ? makeWithdrawInstructionV4(insParams)
725
+ : makeWithdrawInstructionV3(insParams);
694
726
 
695
727
  const insType = {
696
728
  3: InstructionType.FarmV3Withdraw,