@raydium-io/raydium-sdk-v2 0.1.36-alpha → 0.1.38-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 (107) hide show
  1. package/lib/api/api.d.ts +1 -1
  2. package/lib/api/api.js +1 -1
  3. package/lib/api/api.js.map +1 -1
  4. package/lib/api/api.mjs +1 -1
  5. package/lib/api/api.mjs.map +1 -1
  6. package/lib/api/index.d.ts +1 -1
  7. package/lib/api/index.js +1 -1
  8. package/lib/api/index.js.map +1 -1
  9. package/lib/api/index.mjs +1 -1
  10. package/lib/api/index.mjs.map +1 -1
  11. package/lib/api/type.d.ts +1 -1
  12. package/lib/api/url.js +1 -1
  13. package/lib/api/url.js.map +1 -1
  14. package/lib/api/url.mjs +1 -1
  15. package/lib/api/url.mjs.map +1 -1
  16. package/lib/{api-33b5ab27.d.ts → api-364b009b.d.ts} +9 -9
  17. package/lib/common/accountInfo.d.ts +1 -1
  18. package/lib/common/bignumber.d.ts +1 -1
  19. package/lib/common/fractionUtil.d.ts +1 -1
  20. package/lib/common/index.d.ts +1 -1
  21. package/lib/common/transfer.d.ts +1 -1
  22. package/lib/common/txTool/txTool.d.ts +1 -1
  23. package/lib/common/txTool/txUtils.d.ts +1 -1
  24. package/lib/common/utility.d.ts +1 -1
  25. package/lib/index.d.ts +3 -3
  26. package/lib/index.js +1 -1
  27. package/lib/index.js.map +1 -1
  28. package/lib/index.mjs +1 -1
  29. package/lib/index.mjs.map +1 -1
  30. package/lib/module/amount.d.ts +1 -1
  31. package/lib/module/fraction.d.ts +1 -1
  32. package/lib/module/index.d.ts +1 -1
  33. package/lib/module/percent.d.ts +1 -1
  34. package/lib/module/price.d.ts +1 -1
  35. package/lib/raydium/account/account.d.ts +3 -3
  36. package/lib/raydium/account/index.d.ts +1 -1
  37. package/lib/raydium/account/instruction.d.ts +1 -1
  38. package/lib/raydium/account/types.d.ts +1 -1
  39. package/lib/raydium/account/util.d.ts +1 -1
  40. package/lib/raydium/clmm/clmm.d.ts +3 -3
  41. package/lib/raydium/clmm/index.d.ts +3 -3
  42. package/lib/raydium/clmm/instrument.d.ts +2 -2
  43. package/lib/raydium/clmm/layout.d.ts +6 -6
  44. package/lib/raydium/clmm/type.d.ts +2 -2
  45. package/lib/raydium/clmm/utils/math.d.ts +2 -2
  46. package/lib/raydium/clmm/utils/pool.d.ts +2 -2
  47. package/lib/raydium/clmm/utils/position.d.ts +2 -2
  48. package/lib/raydium/clmm/utils/tick.d.ts +2 -2
  49. package/lib/raydium/clmm/utils/tickQuery.d.ts +2 -2
  50. package/lib/raydium/clmm/utils/tickarrayBitmap.d.ts +2 -2
  51. package/lib/raydium/cpmm/cpmm.d.ts +3 -3
  52. package/lib/raydium/cpmm/index.d.ts +1 -1
  53. package/lib/raydium/cpmm/layout.d.ts +1 -1
  54. package/lib/raydium/cpmm/type.d.ts +1 -1
  55. package/lib/raydium/farm/config.d.ts +1 -1
  56. package/lib/raydium/farm/farm.d.ts +3 -3
  57. package/lib/raydium/farm/index.d.ts +1 -1
  58. package/lib/raydium/farm/instruction.d.ts +1 -1
  59. package/lib/raydium/farm/layout.d.ts +1 -1
  60. package/lib/raydium/farm/type.d.ts +1 -1
  61. package/lib/raydium/farm/util.d.ts +1 -1
  62. package/lib/raydium/ido/ido.d.ts +3 -3
  63. package/lib/raydium/ido/index.d.ts +3 -3
  64. package/lib/raydium/ido/instruction.d.ts +1 -1
  65. package/lib/raydium/ido/type.d.ts +1 -1
  66. package/lib/raydium/index.d.ts +3 -3
  67. package/lib/raydium/index.js +1 -1
  68. package/lib/raydium/index.js.map +1 -1
  69. package/lib/raydium/index.mjs +1 -1
  70. package/lib/raydium/index.mjs.map +1 -1
  71. package/lib/raydium/liquidity/index.d.ts +1 -1
  72. package/lib/raydium/liquidity/instruction.d.ts +1 -1
  73. package/lib/raydium/liquidity/layout.d.ts +6 -6
  74. package/lib/raydium/liquidity/liquidity.d.ts +3 -3
  75. package/lib/raydium/liquidity/type.d.ts +1 -1
  76. package/lib/raydium/liquidity/utils.d.ts +1 -1
  77. package/lib/raydium/marketV2/createMarket.d.ts +3 -3
  78. package/lib/raydium/marketV2/index.d.ts +3 -3
  79. package/lib/raydium/moduleBase.d.ts +3 -3
  80. package/lib/raydium/raydium.d.ts +3 -3
  81. package/lib/raydium/raydium.js +1 -1
  82. package/lib/raydium/raydium.js.map +1 -1
  83. package/lib/raydium/raydium.mjs +1 -1
  84. package/lib/raydium/raydium.mjs.map +1 -1
  85. package/lib/raydium/token/constant.d.ts +1 -1
  86. package/lib/raydium/token/index.d.ts +1 -1
  87. package/lib/raydium/token/token.d.ts +3 -3
  88. package/lib/raydium/token/token.js +1 -1
  89. package/lib/raydium/token/token.js.map +1 -1
  90. package/lib/raydium/token/token.mjs +1 -1
  91. package/lib/raydium/token/token.mjs.map +1 -1
  92. package/lib/raydium/token/type.d.ts +1 -1
  93. package/lib/raydium/token/utils.d.ts +1 -1
  94. package/lib/raydium/tradeV2/index.d.ts +2 -2
  95. package/lib/raydium/tradeV2/instrument.d.ts +2 -2
  96. package/lib/raydium/tradeV2/trade.d.ts +3 -3
  97. package/lib/raydium/tradeV2/type.d.ts +2 -2
  98. package/lib/raydium/type.d.ts +1 -1
  99. package/lib/raydium/utils1216/index.d.ts +3 -3
  100. package/lib/raydium/utils1216/utils1216.d.ts +3 -3
  101. package/lib/{raydium-b84847b9.d.ts → raydium-c65b6b21.d.ts} +5 -8
  102. package/lib/{type-7da56d56.d.ts → type-8e8becba.d.ts} +1 -1
  103. package/package.json +1 -1
  104. package/src/api/api.ts +4 -4
  105. package/src/api/url.ts +1 -1
  106. package/src/raydium/raydium.ts +29 -21
  107. package/src/raydium/token/token.ts +1 -3
@@ -1,4 +1,4 @@
1
- export { bF as LpToken, bE as SplToken, bC as TokenInfo, bD as TokenJson } from '../../api-33b5ab27.js';
1
+ export { bF as LpToken, bE as SplToken, bC as TokenInfo, bD as TokenJson } from '../../api-364b009b.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, TransferFeeConfig } from '@solana/spl-token';
3
- import { bC as TokenInfo, ac as BigNumberish, c4 as TokenAmount, h as ApiV3Token } from '../../api-33b5ab27.js';
3
+ import { bC as TokenInfo, ac as BigNumberish, c4 as TokenAmount, h as ApiV3Token } from '../../api-364b009b.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-33b5ab27.js';
5
+ import '../../api-364b009b.js';
6
6
  import 'axios';
7
7
  import '../../solana/type.js';
8
8
  import '@solana/spl-token';
@@ -19,7 +19,7 @@ import '../../marshmallow/index.js';
19
19
  import '../../marshmallow/buffer-layout.js';
20
20
  import '../liquidity/type.js';
21
21
  import '../liquidity/layout.js';
22
- import '../../type-7da56d56.js';
22
+ import '../../type-8e8becba.js';
23
23
  import '../clmm/layout.js';
24
24
  import '../cpmm/type.js';
25
25
  import '../cpmm/curve/calculator.js';
@@ -1,6 +1,6 @@
1
1
  import { PublicKey, TransactionInstruction } from '@solana/web3.js';
2
2
  import BN__default from 'bn.js';
3
- import { q as ApiV3PoolInfoItem, z as PoolKeys } from '../../api-33b5ab27.js';
3
+ import { q as ApiV3PoolInfoItem, z as PoolKeys } from '../../api-364b009b.js';
4
4
  import { ComputePoolType, MakeSwapInstructionParam, ReturnTypeMakeSwapInstruction } from './type.js';
5
5
  import 'axios';
6
6
  import '../../solana/type.js';
@@ -18,7 +18,7 @@ import '../../marshmallow/index.js';
18
18
  import '../../marshmallow/buffer-layout.js';
19
19
  import '../liquidity/type.js';
20
20
  import '../liquidity/layout.js';
21
- import '../../type-7da56d56.js';
21
+ import '../../type-8e8becba.js';
22
22
  import '../clmm/layout.js';
23
23
  import '../cpmm/type.js';
24
24
  import '../cpmm/curve/calculator.js';
@@ -1,10 +1,10 @@
1
1
  import '@solana/web3.js';
2
2
  import '../../common/txTool/txType.js';
3
- import '../../api-33b5ab27.js';
4
- export { i as default } from '../../raydium-b84847b9.js';
3
+ import '../../api-364b009b.js';
4
+ export { i as default } from '../../raydium-c65b6b21.js';
5
5
  import 'bn.js';
6
6
  import '../liquidity/type.js';
7
- import '../../type-7da56d56.js';
7
+ import '../../type-8e8becba.js';
8
8
  import './type.js';
9
9
  import '../cpmm/type.js';
10
10
  import 'axios';
@@ -1,10 +1,10 @@
1
1
  import { PublicKey, Keypair, Signer, TransactionInstruction, Transaction } from '@solana/web3.js';
2
2
  import BN__default from 'bn.js';
3
- import { bN as TransferAmountFee, c4 as TokenAmount, z as PoolKeys, q as ApiV3PoolInfoItem } from '../../api-33b5ab27.js';
3
+ import { bN as TransferAmountFee, c4 as TokenAmount, z as PoolKeys, q as ApiV3PoolInfoItem } from '../../api-364b009b.js';
4
4
  import Decimal from 'decimal.js';
5
5
  import { Token } from '../../module/token.js';
6
6
  import { ComputeAmountOutParam } from '../liquidity/type.js';
7
- import { d as ComputeClmmPoolInfo } from '../../type-7da56d56.js';
7
+ import { d as ComputeClmmPoolInfo } from '../../type-8e8becba.js';
8
8
  import { CpmmComputeData } from '../cpmm/type.js';
9
9
  import 'axios';
10
10
  import '../../solana/type.js';
@@ -1,6 +1,6 @@
1
1
  import '@solana/web3.js';
2
2
  import '@solana/spl-token';
3
- export { bV as ArrayItem, bL as ComputeBudgetConfig, c0 as Cover, bW as ExactPartial, bX as ExactRequired, b$ as Fallback, bO as GetTransferAmountFee, bZ as GetValue, bK as InstructionReturn, bM as LoadParams, bJ as MakeMultiTransaction, bH as MakeTransaction, bI as MakeV0Transaction, bS as MayArray, bT as MayDeepArray, bU as MayFunction, bR as ReplaceType, bP as ReturnTypeFetchMultipleMintInfo, bQ as ReturnTypeFetchMultipleMintInfos, bY as SKeyof, b_ as SOR, bG as SignAllTransactions, bN as TransferAmountFee, c1 as UnionCover, c2 as unionArr } from '../api-33b5ab27.js';
3
+ export { bV as ArrayItem, bL as ComputeBudgetConfig, c0 as Cover, bW as ExactPartial, bX as ExactRequired, b$ as Fallback, bO as GetTransferAmountFee, bZ as GetValue, bK as InstructionReturn, bM as LoadParams, bJ as MakeMultiTransaction, bH as MakeTransaction, bI as MakeV0Transaction, bS as MayArray, bT as MayDeepArray, bU as MayFunction, bR as ReplaceType, bP as ReturnTypeFetchMultipleMintInfo, bQ as ReturnTypeFetchMultipleMintInfos, bY as SKeyof, b_ as SOR, bG as SignAllTransactions, bN as TransferAmountFee, c1 as UnionCover, c2 as unionArr } from '../api-364b009b.js';
4
4
  import 'bn.js';
5
5
  import 'axios';
6
6
  import '../solana/type.js';
@@ -1,6 +1,6 @@
1
- export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-b84847b9.js';
1
+ export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-c65b6b21.js';
2
2
  import '@solana/web3.js';
3
- import '../../api-33b5ab27.js';
3
+ import '../../api-364b009b.js';
4
4
  import 'axios';
5
5
  import '../../solana/type.js';
6
6
  import 'bn.js';
@@ -21,7 +21,7 @@ import '../account/layout.js';
21
21
  import '../liquidity/type.js';
22
22
  import '../liquidity/layout.js';
23
23
  import '../liquidity/stable.js';
24
- import '../../type-7da56d56.js';
24
+ import '../../type-8e8becba.js';
25
25
  import '../clmm/layout.js';
26
26
  import '../cpmm/type.js';
27
27
  import '../cpmm/curve/calculator.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-b84847b9.js';
4
+ export { S as SHOW_INFO, d as canClaimErrorType, U as default } from '../../raydium-c65b6b21.js';
5
5
  import '../../marshmallow/buffer-layout.js';
6
- import '../../api-33b5ab27.js';
6
+ import '../../api-364b009b.js';
7
7
  import 'axios';
8
8
  import '../../solana/type.js';
9
9
  import '@solana/spl-token';
@@ -21,7 +21,7 @@ import '../account/layout.js';
21
21
  import '../liquidity/type.js';
22
22
  import '../liquidity/layout.js';
23
23
  import '../liquidity/stable.js';
24
- import '../../type-7da56d56.js';
24
+ import '../../type-8e8becba.js';
25
25
  import '../clmm/layout.js';
26
26
  import '../cpmm/type.js';
27
27
  import '../cpmm/curve/calculator.js';
@@ -1,5 +1,5 @@
1
1
  import { PublicKey, Commitment, EpochInfo, Connection, Transaction, Signer, TransactionInstruction, Keypair } from '@solana/web3.js';
2
- import { aA as TxBuilder, as as AddInstructionParam, ac as BigNumberish, bn as CreateFarm, az as MakeTxData, bo as CreateFarmExtInfo, bp as UpdateFarmReward, bq as UpdateFarmRewards, br as FarmDWParam, X as FormatFarmInfoOut, bL as ComputeBudgetConfig, ay as MakeMultiTxData, o as ApiV3PoolInfoStandardItem, c8 as Percent, c4 as TokenAmount, v as AmmV4Keys, w as AmmV5Keys, n as ApiV3PoolInfoConcentratedItem, W as FormatFarmInfoOutV6, y as ClmmKeys, bH as MakeTransaction, bQ as ReturnTypeFetchMultipleMintInfos, C as CpmmKeys, p as ApiV3PoolInfoStandardItemCpmm, bO as GetTransferAmountFee, z as PoolKeys, h as ApiV3Token, _ as OwnerIdoInfo, $ as IdoKeysData, bM as LoadParams, J as JupTokenType, bC as TokenInfo, bG as SignAllTransactions, a as Api, Y as AvailabilityCheckAPI3, i as ApiV3TokenRes } from './api-33b5ab27.js';
2
+ import { aA as TxBuilder, as as AddInstructionParam, ac as BigNumberish, bn as CreateFarm, az as MakeTxData, bo as CreateFarmExtInfo, bp as UpdateFarmReward, bq as UpdateFarmRewards, br as FarmDWParam, X as FormatFarmInfoOut, bL as ComputeBudgetConfig, ay as MakeMultiTxData, o as ApiV3PoolInfoStandardItem, c8 as Percent, c4 as TokenAmount, v as AmmV4Keys, w as AmmV5Keys, n as ApiV3PoolInfoConcentratedItem, W as FormatFarmInfoOutV6, y as ClmmKeys, bH as MakeTransaction, bQ as ReturnTypeFetchMultipleMintInfos, C as CpmmKeys, p as ApiV3PoolInfoStandardItemCpmm, bO as GetTransferAmountFee, z as PoolKeys, h as ApiV3Token, _ as OwnerIdoInfo, $ as IdoKeysData, bM as LoadParams, J as JupTokenType, bC as TokenInfo, bG as SignAllTransactions, a as Api, Y as AvailabilityCheckAPI3, i as ApiV3TokenRes } from './api-364b009b.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';
@@ -10,7 +10,7 @@ import BN__default from 'bn.js';
10
10
  import Decimal from 'decimal.js';
11
11
  import { AddLiquidityParams, RemoveParams, CreatePoolParam, CreatePoolAddress, ComputeAmountOutParam, SwapParam, AmmRpcData } from './raydium/liquidity/type.js';
12
12
  import { StableLayout } from './raydium/liquidity/stable.js';
13
- 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, F as ClmmRpcData, d as ComputeClmmPoolInfo, l as ReturnTypeFetchMultiplePoolTickArrays } from './type-7da56d56.js';
13
+ 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, F as ClmmRpcData, d as ComputeClmmPoolInfo, l as ReturnTypeFetchMultiplePoolTickArrays } from './type-8e8becba.js';
14
14
  import { ClmmPositionLayout, PositionInfoLayout, PoolInfoLayout } from './raydium/clmm/layout.js';
15
15
  import { CpmmRpcData, CpmmComputeData, CreateCpmmPoolParam, CreateCpmmPoolAddress, AddCpmmLiquidityParams, WithdrawCpmmLiquidityParams, CpmmSwapParams, ComputePairAmountParams } from './raydium/cpmm/type.js';
16
16
  import { ComputeAmountOutLayout, BasicPoolInfo, ReturnTypeGetAllRoute, ComputeRoutePathType, ComputePoolType, ReturnTypeFetchMultipleInfo } from './raydium/tradeV2/type.js';
@@ -418,11 +418,11 @@ declare class Utils1216 extends ModuleBase {
418
418
  perLpLoss: BN__default;
419
419
  totalClaimedAmount: BN__default;
420
420
  }[], "", {
421
+ status: number;
421
422
  padding: BN__default[];
422
423
  bump: number;
423
424
  endTime: BN__default;
424
425
  openTime: BN__default;
425
- status: number;
426
426
  ammId: PublicKey;
427
427
  tokenInfo: {
428
428
  mintDecimals: number;
@@ -606,10 +606,7 @@ interface DataBase<T> {
606
606
  interface ApiData {
607
607
  tokens?: DataBase<ApiV3Token[]>;
608
608
  tokenList?: DataBase<ApiV3TokenRes>;
609
- jupTokenList?: {
610
- [JupTokenType.ALL]?: DataBase<ApiV3Token[]>;
611
- [JupTokenType.Strict]?: DataBase<ApiV3Token[]>;
612
- };
609
+ jupTokenList?: DataBase<ApiV3Token[]>;
613
610
  }
614
611
  declare class Raydium {
615
612
  cluster: Cluster;
@@ -648,7 +645,7 @@ declare class Raydium {
648
645
  private isCacheInvalidate;
649
646
  fetchChainTime(): Promise<void>;
650
647
  fetchV3TokenList(forceUpdate?: boolean): Promise<ApiV3TokenRes>;
651
- fetchJupTokenList(type: JupTokenType, forceUpdate?: boolean): Promise<ApiV3Token[]>;
648
+ fetchJupTokenList(forceUpdate?: boolean): Promise<ApiV3Token[]>;
652
649
  get chainTimeData(): {
653
650
  offset: number;
654
651
  chainTime: 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 { n as ApiV3PoolInfoConcentratedItem, d as ApiClmmConfigInfo, h as ApiV3Token, bO as GetTransferAmountFee, bN as TransferAmountFee, c9 as Price, c8 as Percent, c4 as TokenAmount, bL as ComputeBudgetConfig, c6 as Fraction, bC as TokenInfo, y as ClmmKeys } from './api-33b5ab27.js';
4
+ import { n as ApiV3PoolInfoConcentratedItem, d as ApiClmmConfigInfo, h as ApiV3Token, bO as GetTransferAmountFee, bN as TransferAmountFee, c9 as Price, c8 as Percent, c4 as TokenAmount, bL as ComputeBudgetConfig, c6 as Fraction, bC as TokenInfo, y as ClmmKeys } from './api-364b009b.js';
5
5
  import { TxVersion } from './common/txTool/txType.js';
6
6
  import { ClmmPositionLayout, PoolInfoLayout } 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.36-alpha",
3
+ "version": "0.1.38-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",
package/src/api/api.ts CHANGED
@@ -168,9 +168,9 @@ export class Api {
168
168
  return res.data;
169
169
  }
170
170
 
171
- async getJupTokenList(type?: JupTokenType): Promise<ApiV3Token[]> {
171
+ async getJupTokenList(): Promise<ApiV3Token[]> {
172
172
  return this.api.get("", {
173
- baseURL: (this.urlConfigs.JUP_TOKEN_LIST || API_URLS.JUP_TOKEN_LIST).replace("{type}", type || JupTokenType.ALL),
173
+ baseURL: this.urlConfigs.JUP_TOKEN_LIST || API_URLS.JUP_TOKEN_LIST,
174
174
  });
175
175
  }
176
176
 
@@ -185,7 +185,7 @@ export class Api {
185
185
  const { type = "all", sort = "liquidity", order = "desc", page = 0, pageSize = 100 } = props;
186
186
  const res = await this.api.get<PoolsApiReturn>(
187
187
  (this.urlConfigs.POOL_LIST || API_URLS.POOL_LIST) +
188
- `?poolType=${type}&poolSortField=${sort}&sortType=${order}&page=${page}&pageSize=${pageSize}`,
188
+ `?poolType=${type}&poolSortField=${sort}&sortType=${order}&page=${page}&pageSize=${pageSize}`,
189
189
  );
190
190
  return res.data;
191
191
  }
@@ -246,7 +246,7 @@ export class Api {
246
246
 
247
247
  const res = await this.api.get(
248
248
  (this.urlConfigs.POOL_SEARCH_MINT || API_URLS.POOL_SEARCH_MINT) +
249
- `?mint1=${baseMint}&mint2=${quoteMint}&poolType=${type}&poolSortField=${sort}&sortType=${order}&pageSize=100&page=${page}`,
249
+ `?mint1=${baseMint}&mint2=${quoteMint}&poolType=${type}&poolSortField=${sort}&sortType=${order}&pageSize=100&page=${page}`,
250
250
  );
251
251
  return res.data;
252
252
  }
package/src/api/url.ts CHANGED
@@ -21,7 +21,7 @@ export const API_URLS = {
21
21
  TOKEN_LIST: "/mint/list",
22
22
  MINT_INFO_ID: "/mint/ids",
23
23
 
24
- JUP_TOKEN_LIST: "https://token.jup.ag/{type}",
24
+ JUP_TOKEN_LIST: "https://tokens.jup.ag/tokens?tags=lst,community",
25
25
  /**
26
26
  * poolType: {all, concentrated, standard, allFarm, concentratedFarm, standardFarm}
27
27
  * poolSortField: {liquidity | volume_24h / 7d / 30d | fee_24h / 7d / 30d | apr_24h / 7d / 30d}
@@ -62,10 +62,7 @@ interface ApiData {
62
62
 
63
63
  // v3 data
64
64
  tokenList?: DataBase<ApiV3TokenRes>;
65
- jupTokenList?: {
66
- [JupTokenType.ALL]?: DataBase<ApiV3Token[]>;
67
- [JupTokenType.Strict]?: DataBase<ApiV3Token[]>;
68
- };
65
+ jupTokenList?: DataBase<ApiV3Token[]>;
69
66
  }
70
67
 
71
68
  export class Raydium {
@@ -238,29 +235,40 @@ export class Raydium {
238
235
  public async fetchV3TokenList(forceUpdate?: boolean): Promise<ApiV3TokenRes> {
239
236
  if (this.apiData.tokenList && !this.isCacheInvalidate(this.apiData.tokenList.fetched) && !forceUpdate)
240
237
  return this.apiData.tokenList.data;
241
- const raydiumList = await this.api.getTokenList();
242
- const dataObject = {
243
- fetched: Date.now(),
244
- data: raydiumList,
245
- };
246
- this.apiData.tokenList = dataObject;
247
-
248
- return dataObject.data;
238
+ try {
239
+ const raydiumList = await this.api.getTokenList();
240
+ const dataObject = {
241
+ fetched: Date.now(),
242
+ data: raydiumList,
243
+ };
244
+ this.apiData.tokenList = dataObject;
245
+
246
+ return dataObject.data;
247
+ } catch (e) {
248
+ console.error(e);
249
+ return {
250
+ mintList: [],
251
+ blacklist: [],
252
+ whiteList: [],
253
+ };
254
+ }
249
255
  }
250
256
 
251
- public async fetchJupTokenList(type: JupTokenType, forceUpdate?: boolean): Promise<ApiV3Token[]> {
252
- const prevFetched = this.apiData.jupTokenList?.[type];
257
+ public async fetchJupTokenList(forceUpdate?: boolean): Promise<ApiV3Token[]> {
258
+ const prevFetched = this.apiData.jupTokenList;
253
259
  if (prevFetched && !this.isCacheInvalidate(prevFetched.fetched) && !forceUpdate) return prevFetched.data;
254
- const jupList = await this.api.getJupTokenList(type);
255
- this.apiData.jupTokenList = {
256
- ...this.apiData.jupTokenList,
257
- [type]: {
260
+ try {
261
+ const jupList = await this.api.getJupTokenList();
262
+ this.apiData.jupTokenList = {
258
263
  fetched: Date.now(),
259
264
  data: jupList,
260
- },
261
- };
265
+ };
262
266
 
263
- return this.apiData.jupTokenList[type]!.data;
267
+ return this.apiData.jupTokenList.data;
268
+ } catch (e) {
269
+ console.error(e);
270
+ return [];
271
+ }
264
272
  }
265
273
 
266
274
  get chainTimeData(): { offset: number; chainTime: number } | undefined {
@@ -1,8 +1,6 @@
1
1
  import { PublicKey } from "@solana/web3.js";
2
2
  import { MintLayout, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID } from "@solana/spl-token";
3
3
 
4
- import { Price, Token } from "@/module";
5
- import { validateAndParsePublicKey, SOLMint } from "@/common/pubKey";
6
4
  import { ApiV3Token, JupTokenType } from "@/api/type";
7
5
  import ModuleBase, { ModuleBaseProps } from "../moduleBase";
8
6
  import { LoadParams } from "../type";
@@ -30,7 +28,7 @@ export default class TokenModule extends ModuleBase {
30
28
  this.checkDisabled();
31
29
  const { forceUpdate = false, type = JupTokenType.Strict } = params || {};
32
30
  const { mintList, blacklist, whiteList } = await this.scope.fetchV3TokenList(forceUpdate);
33
- const jup = await this.scope.fetchJupTokenList(type, forceUpdate);
31
+ const jup = await this.scope.fetchJupTokenList(forceUpdate);
34
32
  // reset all data
35
33
  this._tokenList = [];
36
34
  this._tokenMap = new Map();