@raydium-io/raydium-sdk-v2 0.1.115-alpha → 0.1.116-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-373aef5f.d.ts → api-790b1baf.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/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 +12 -12
- 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/index.js.map +1 -1
- package/lib/raydium/tradeV2/index.mjs.map +1 -1
- package/lib/raydium/tradeV2/instrument.d.ts +2 -2
- package/lib/raydium/tradeV2/trade.d.ts +3 -3
- package/lib/raydium/tradeV2/trade.js +1 -1
- package/lib/raydium/tradeV2/trade.js.map +1 -1
- package/lib/raydium/tradeV2/trade.mjs +1 -1
- package/lib/raydium/tradeV2/trade.mjs.map +1 -1
- 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-3019c096.d.ts → raydium-3aeddb2c.d.ts} +4 -4
- package/lib/{type-8aeb1b3b.d.ts → type-e7d4dc1c.d.ts} +1 -1
- package/package.json +1 -1
- package/src/raydium/tradeV2/trade.ts +17 -17
|
@@ -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 { bR as TransferAmountFee, c8 as TokenAmount, D as PoolKeys, r as ApiV3PoolInfoItem } from '../../api-
|
|
4
|
+
import { bR as TransferAmountFee, c8 as TokenAmount, D as PoolKeys, r as ApiV3PoolInfoItem } from '../../api-790b1baf.js';
|
|
5
5
|
import { Token } from '../../module/token.js';
|
|
6
|
-
import { d as ComputeClmmPoolInfo } from '../../type-
|
|
6
|
+
import { d as ComputeClmmPoolInfo } from '../../type-e7d4dc1c.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 { bZ as ArrayItem, bO as ComputeBudgetConfig, c4 as Cover, b_ as ExactPartial, b$ as ExactRequired, c3 as Fallback, bS as GetTransferAmountFee, c1 as GetValue, bN as InstructionReturn, bQ as LoadParams, bM as MakeMultiTransaction, bK as MakeTransaction, bL as MakeV0Transaction, bW as MayArray, bX as MayDeepArray, bY as MayFunction, bV as ReplaceType, bT as ReturnTypeFetchMultipleMintInfo, bU as ReturnTypeFetchMultipleMintInfos, bI as ReturnTypeMakeInstructions, c0 as SKeyof, c2 as SOR, bJ as SignAllTransactions, bR as TransferAmountFee, bP as TxTipConfig, c5 as UnionCover, c6 as unionArr } from '../api-
|
|
4
|
+
export { bZ as ArrayItem, bO as ComputeBudgetConfig, c4 as Cover, b_ as ExactPartial, b$ as ExactRequired, c3 as Fallback, bS as GetTransferAmountFee, c1 as GetValue, bN as InstructionReturn, bQ as LoadParams, bM as MakeMultiTransaction, bK as MakeTransaction, bL as MakeV0Transaction, bW as MayArray, bX as MayDeepArray, bY as MayFunction, bV as ReplaceType, bT as ReturnTypeFetchMultipleMintInfo, bU as ReturnTypeFetchMultipleMintInfos, bI as ReturnTypeMakeInstructions, c0 as SKeyof, c2 as SOR, bJ as SignAllTransactions, bR as TransferAmountFee, bP as TxTipConfig, c5 as UnionCover, c6 as unionArr } from '../api-790b1baf.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-3aeddb2c.js';
|
|
2
2
|
import '@solana/web3.js';
|
|
3
|
-
import '../../api-
|
|
3
|
+
import '../../api-790b1baf.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-e7d4dc1c.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-3aeddb2c.js';
|
|
5
5
|
import '../../marshmallow/buffer-layout.js';
|
|
6
|
-
import '../../api-
|
|
6
|
+
import '../../api-790b1baf.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-e7d4dc1c.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, bP as TxTipConfig, aA as MakeMultiTxData, p as ApiV3PoolInfoStandardItem, cc as Percent, c8 as TokenAmount, w as AmmV4Keys, x as AmmV5Keys, o as ApiV3PoolInfoConcentratedItem, Y as FormatFarmInfoOutV6, B as ClmmKeys, bK as MakeTransaction, bU as ReturnTypeFetchMultipleMintInfos, y as CpmmKeys, q as ApiV3PoolInfoStandardItemCpmm, bS as GetTransferAmountFee, D as PoolKeys, i as ApiV3Token, a0 as OwnerIdoInfo, a1 as IdoKeysData, bQ 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, bP as TxTipConfig, aA as MakeMultiTxData, p as ApiV3PoolInfoStandardItem, cc as Percent, c8 as TokenAmount, w as AmmV4Keys, x as AmmV5Keys, o as ApiV3PoolInfoConcentratedItem, Y as FormatFarmInfoOutV6, B as ClmmKeys, bK as MakeTransaction, bU as ReturnTypeFetchMultipleMintInfos, y as CpmmKeys, q as ApiV3PoolInfoStandardItemCpmm, bS as GetTransferAmountFee, D as PoolKeys, i as ApiV3Token, a0 as OwnerIdoInfo, a1 as IdoKeysData, bQ as LoadParams, J as JupTokenType, bE as TokenInfo, bJ as SignAllTransactions, a as Api, _ as AvailabilityCheckAPI3, j as ApiV3TokenRes } from './api-790b1baf.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-e7d4dc1c.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';
|
|
@@ -510,7 +510,7 @@ interface SHOW_INFO {
|
|
|
510
510
|
declare type canClaimErrorType = "outOfOperationalTime" | "alreadyClaimIt" | undefined;
|
|
511
511
|
declare class Utils1216 extends ModuleBase {
|
|
512
512
|
static CLAIMED_NUM: number;
|
|
513
|
-
static POOL_LAYOUT: Structure<number |
|
|
513
|
+
static POOL_LAYOUT: Structure<number | PublicKey | Buffer | BN__default | BN__default[] | {
|
|
514
514
|
mintDecimals: number;
|
|
515
515
|
mintAddress: PublicKey;
|
|
516
516
|
mintVault: PublicKey;
|
|
@@ -531,7 +531,7 @@ declare class Utils1216 extends ModuleBase {
|
|
|
531
531
|
totalClaimedAmount: BN__default;
|
|
532
532
|
}[];
|
|
533
533
|
}>;
|
|
534
|
-
static OWNER_LAYOUT: Structure<number |
|
|
534
|
+
static OWNER_LAYOUT: Structure<number | PublicKey | Buffer | BN__default | BN__default[] | {
|
|
535
535
|
mintAddress: PublicKey;
|
|
536
536
|
debtAmount: BN__default;
|
|
537
537
|
claimedAmount: BN__default;
|
|
@@ -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, bS as GetTransferAmountFee, bR as TransferAmountFee, cd as Price, cc as Percent, c8 as TokenAmount, bO as ComputeBudgetConfig, bP as TxTipConfig, ca as Fraction, bE as TokenInfo, B as ClmmKeys } from './api-
|
|
4
|
+
import { o as ApiV3PoolInfoConcentratedItem, d as ApiClmmConfigInfo, i as ApiV3Token, bS as GetTransferAmountFee, bR as TransferAmountFee, cd as Price, cc as Percent, c8 as TokenAmount, bO as ComputeBudgetConfig, bP as TxTipConfig, ca as Fraction, bE as TokenInfo, B as ClmmKeys } from './api-790b1baf.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
|
@@ -73,17 +73,17 @@ export default class TradeV2 extends ModuleBase {
|
|
|
73
73
|
txVersion?: T;
|
|
74
74
|
feePayer?: PublicKey;
|
|
75
75
|
}): Promise<MakeTxData<T>> {
|
|
76
|
-
const { amount, tokenProgram, txVersion = TxVersion.LEGACY, feePayer
|
|
76
|
+
const { amount, tokenProgram, txVersion = TxVersion.LEGACY, feePayer } = props;
|
|
77
77
|
const tokenAccounts = await this.getWSolAccounts();
|
|
78
78
|
const txBuilder = this.createTxBuilder(feePayer);
|
|
79
79
|
txBuilder.addCustomComputeBudget(props.computeBudgetConfig);
|
|
80
|
-
const ins = await createWSolAccountInstructions({
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
});
|
|
86
|
-
txBuilder.addInstruction(ins);
|
|
80
|
+
// const ins = await createWSolAccountInstructions({
|
|
81
|
+
// connection: this.scope.connection,
|
|
82
|
+
// owner: this.scope.ownerPubKey,
|
|
83
|
+
// payer: this.scope.ownerPubKey,
|
|
84
|
+
// amount: 0,
|
|
85
|
+
// });
|
|
86
|
+
// txBuilder.addInstruction(ins);
|
|
87
87
|
|
|
88
88
|
const amountBN = parseBigNumberish(amount);
|
|
89
89
|
for (let i = 0; i < tokenAccounts.length; i++) {
|
|
@@ -198,9 +198,9 @@ export default class TradeV2 extends ModuleBase {
|
|
|
198
198
|
skipCloseAccount: !useSolBalance,
|
|
199
199
|
createInfo: useSolBalance
|
|
200
200
|
? {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
201
|
+
payer: this.scope.ownerPubKey,
|
|
202
|
+
amount: amountIn.amount.raw,
|
|
203
|
+
}
|
|
204
204
|
: undefined,
|
|
205
205
|
associatedOnly: useSolBalance ? false : ownerInfo.associatedOnly,
|
|
206
206
|
checkCreateATAOwner: ownerInfo.checkCreateATAOwner,
|
|
@@ -811,9 +811,9 @@ export default class TradeV2 extends ModuleBase {
|
|
|
811
811
|
feeConfig === undefined
|
|
812
812
|
? undefined
|
|
813
813
|
: {
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
814
|
+
feeAmount: _amountInFee,
|
|
815
|
+
feeAccount: feeConfig.feeAccount,
|
|
816
|
+
};
|
|
817
817
|
const outputToken = {
|
|
818
818
|
...propOutputToken,
|
|
819
819
|
address: solToWSol(propOutputToken.address).toString(),
|
|
@@ -918,9 +918,9 @@ export default class TradeV2 extends ModuleBase {
|
|
|
918
918
|
remainingAccounts: [maxFirstIn.data.remainingAccounts[0], outC.remainingAccounts[0]],
|
|
919
919
|
minMiddleAmountFee: outC.amountOut.fee?.raw
|
|
920
920
|
? new TokenAmount(
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
921
|
+
(maxFirstIn.data.amountOut.amount as TokenAmount).token,
|
|
922
|
+
(maxFirstIn.data.amountOut.fee?.raw ?? ZERO).add(outC.amountOut.fee?.raw ?? ZERO),
|
|
923
|
+
)
|
|
924
924
|
: undefined,
|
|
925
925
|
middleToken: (maxFirstIn.data.amountOut.amount as TokenAmount).token,
|
|
926
926
|
poolReady: maxFirstIn.data.poolReady && outC.poolReady,
|