@pancakeswap/pools 4.0.9 → 4.0.11

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 (64) hide show
  1. package/dist/constants/contracts.d.ts +9 -0
  2. package/dist/constants/contracts.d.ts.map +1 -1
  3. package/dist/constants/pools/1.d.ts.map +1 -1
  4. package/dist/constants/pools/1101.d.ts +5 -0
  5. package/dist/constants/pools/1101.d.ts.map +1 -0
  6. package/dist/constants/pools/1442.d.ts +5 -0
  7. package/dist/constants/pools/1442.d.ts.map +1 -0
  8. package/dist/constants/pools/56.d.ts.map +1 -1
  9. package/dist/constants/pools/59140.d.ts +5 -0
  10. package/dist/constants/pools/59140.d.ts.map +1 -0
  11. package/dist/constants/pools/59144.d.ts +5 -0
  12. package/dist/constants/pools/59144.d.ts.map +1 -0
  13. package/dist/constants/pools/8453.d.ts +5 -0
  14. package/dist/constants/pools/8453.d.ts.map +1 -0
  15. package/dist/constants/pools/84531.d.ts +5 -0
  16. package/dist/constants/pools/84531.d.ts.map +1 -0
  17. package/dist/constants/pools/index.d.ts +2 -2
  18. package/dist/constants/pools/index.d.ts.map +1 -1
  19. package/dist/constants/supportedChains.d.ts +1 -1
  20. package/dist/constants/supportedChains.d.ts.map +1 -1
  21. package/dist/index.js +216 -16
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.mjs +217 -17
  24. package/dist/index.mjs.map +1 -1
  25. package/package.json +8 -5
  26. package/.turbo/turbo-build.log +0 -18
  27. package/CHANGELOG.md +0 -140
  28. package/src/abis/ICake.ts +0 -59
  29. package/src/abis/ICakeFlexibleSideVaultV2.ts +0 -487
  30. package/src/abis/ICakeVaultV2.ts +0 -487
  31. package/src/abis/ISmartChef.ts +0 -326
  32. package/src/abis/ISousChef.ts +0 -122
  33. package/src/abis/ISousChefBNB.ts +0 -166
  34. package/src/abis/ISousChefV2.ts +0 -341
  35. package/src/abis/ISousChefV3.ts +0 -326
  36. package/src/constants/contracts.ts +0 -38
  37. package/src/constants/index.ts +0 -10
  38. package/src/constants/pools/1.ts +0 -80
  39. package/src/constants/pools/280.ts +0 -53
  40. package/src/constants/pools/324.ts +0 -26
  41. package/src/constants/pools/42161.ts +0 -26
  42. package/src/constants/pools/421613.ts +0 -69
  43. package/src/constants/pools/56.ts +0 -2951
  44. package/src/constants/pools/97.ts +0 -74
  45. package/src/constants/pools/index.ts +0 -56
  46. package/src/constants/supportedChains.ts +0 -13
  47. package/src/index.ts +0 -14
  48. package/src/queries/fetchPools.ts +0 -350
  49. package/src/queries/fetchUserIfo.ts +0 -53
  50. package/src/queries/fetchUserPoolsData.ts +0 -143
  51. package/src/queries/fetchVaultPublic.ts +0 -175
  52. package/src/queries/fetchVaultUser.ts +0 -106
  53. package/src/queries/getAddresses.ts +0 -12
  54. package/src/queries/index.ts +0 -6
  55. package/src/types.ts +0 -207
  56. package/src/utils/apr.ts +0 -35
  57. package/src/utils/getContractAddress.ts +0 -11
  58. package/src/utils/getPoolContractBySousId.ts +0 -111
  59. package/src/utils/index.ts +0 -5
  60. package/src/utils/isLegacyPool.ts +0 -15
  61. package/src/utils/isPoolsSupported.ts +0 -5
  62. package/tsconfig.json +0 -14
  63. package/tsup.config.ts +0 -26
  64. package/vitest.config.ts +0 -9
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ChainId } from '@pancakeswap/sdk';
2
- import { ethereumTokens, bscTokens, bscTestnetTokens, arbitrumTokens, arbitrumGoerliTokens, zksyncTokens, zkSyncTestnetTokens, CAKE } from '@pancakeswap/tokens';
2
+ import { ethereumTokens, bscTokens, bscTestnetTokens, arbitrumTokens, arbitrumGoerliTokens, zksyncTokens, zkSyncTestnetTokens, baseTestnetTokens, lineaTestnetTokens, polygonZkEvmTestnetTokens, CAKE } from '@pancakeswap/tokens';
3
3
  import { getAddress, getContract } from 'viem';
4
4
  import BigNumber7 from 'bignumber.js';
5
5
  import fromPairs2 from 'lodash/fromPairs';
@@ -27,6 +27,14 @@ var VaultKey = /* @__PURE__ */ ((VaultKey2) => {
27
27
 
28
28
  // src/constants/pools/1.ts
29
29
  var livePools = [
30
+ {
31
+ sousId: 8,
32
+ stakingToken: ethereumTokens.cake,
33
+ earningToken: ethereumTokens.wstETH,
34
+ contractAddress: "0x3C6452d5a217Cc65b98F0803c6D1BD7Fe588389A",
35
+ poolCategory: "Core" /* CORE */,
36
+ tokenPerSecond: "0.00000271"
37
+ },
30
38
  {
31
39
  sousId: 7,
32
40
  stakingToken: ethereumTokens.cake,
@@ -108,6 +116,24 @@ var livePools2 = [
108
116
  tokenPerBlock: "10",
109
117
  isFinished: false
110
118
  },
119
+ {
120
+ sousId: 363,
121
+ stakingToken: bscTokens.cake,
122
+ earningToken: bscTokens.play,
123
+ contractAddress: "0x17D87e825A2231628bCBf1aF1aaEaD419dd3a53D",
124
+ poolCategory: "Core" /* CORE */,
125
+ tokenPerBlock: "0.5902",
126
+ version: 3
127
+ },
128
+ {
129
+ sousId: 362,
130
+ stakingToken: bscTokens.cake,
131
+ earningToken: bscTokens.xcad,
132
+ contractAddress: "0x1328F684569cE0Cb0F13ce023e1C910f23CaBcA8",
133
+ poolCategory: "Core" /* CORE */,
134
+ tokenPerBlock: "0.01658",
135
+ version: 3
136
+ },
111
137
  {
112
138
  sousId: 361,
113
139
  stakingToken: bscTokens.cake,
@@ -3248,6 +3274,156 @@ var livePools7 = [
3248
3274
  }));
3249
3275
  var finishedPools7 = [];
3250
3276
  var pools7 = [...livePools7, ...finishedPools7];
3277
+
3278
+ // src/constants/pools/8453.ts
3279
+ var livePools8 = [];
3280
+ var finishedPools8 = [];
3281
+ var pools8 = [...livePools8, ...finishedPools8];
3282
+ var livePools9 = [
3283
+ {
3284
+ sousId: 4,
3285
+ stakingToken: baseTestnetTokens.cake,
3286
+ earningToken: baseTestnetTokens.mockA,
3287
+ contractAddress: "0x55F8912596F06453466e208e79AB808328146d06",
3288
+ poolCategory: "Core" /* CORE */,
3289
+ tokenPerSecond: "0.01",
3290
+ version: 3
3291
+ },
3292
+ {
3293
+ sousId: 3,
3294
+ stakingToken: baseTestnetTokens.cake,
3295
+ earningToken: baseTestnetTokens.mockA,
3296
+ contractAddress: "0xE61a1065B740a61950E08C073833B85D3362f48B",
3297
+ poolCategory: "Core" /* CORE */,
3298
+ tokenPerSecond: "0.01",
3299
+ version: 3
3300
+ },
3301
+ {
3302
+ sousId: 2,
3303
+ stakingToken: baseTestnetTokens.cake,
3304
+ earningToken: baseTestnetTokens.mockA,
3305
+ contractAddress: "0xF9991a0e33115c1B7e0690109115747ab5C48D9E",
3306
+ poolCategory: "Core" /* CORE */,
3307
+ tokenPerSecond: "0.01",
3308
+ version: 3
3309
+ },
3310
+ {
3311
+ sousId: 1,
3312
+ stakingToken: baseTestnetTokens.cake,
3313
+ earningToken: baseTestnetTokens.mockA,
3314
+ contractAddress: "0x35DB927618560B8878543ea0019A8E664581ADb5",
3315
+ poolCategory: "Core" /* CORE */,
3316
+ tokenPerSecond: "0.01",
3317
+ version: 3
3318
+ }
3319
+ ].map((p) => ({
3320
+ ...p,
3321
+ contractAddress: getAddress(p.contractAddress),
3322
+ stakingToken: p.stakingToken.serialize,
3323
+ earningToken: p.earningToken.serialize
3324
+ }));
3325
+ var finishedPools9 = [];
3326
+ var pools9 = [...livePools9, ...finishedPools9];
3327
+
3328
+ // src/constants/pools/59144.ts
3329
+ var livePools10 = [];
3330
+ var finishedPools10 = [];
3331
+ var pools10 = [...livePools10, ...finishedPools10];
3332
+ var livePools11 = [
3333
+ {
3334
+ sousId: 4,
3335
+ stakingToken: lineaTestnetTokens.cake,
3336
+ earningToken: lineaTestnetTokens.mockA,
3337
+ contractAddress: "0x5d4A2dCefA1B6D5031f57a05651F0b49f4E0eC74",
3338
+ poolCategory: "Core" /* CORE */,
3339
+ tokenPerSecond: "0.01",
3340
+ version: 3
3341
+ },
3342
+ {
3343
+ sousId: 3,
3344
+ stakingToken: lineaTestnetTokens.cake,
3345
+ earningToken: lineaTestnetTokens.mockA,
3346
+ contractAddress: "0xa014641f932E8b7985Ffd6F722DfE6995bbA15aF",
3347
+ poolCategory: "Core" /* CORE */,
3348
+ tokenPerSecond: "0.01",
3349
+ version: 3
3350
+ },
3351
+ {
3352
+ sousId: 2,
3353
+ stakingToken: lineaTestnetTokens.cake,
3354
+ earningToken: lineaTestnetTokens.mockA,
3355
+ contractAddress: "0x4dc9C14A5542f3D0544a6c11d717AD04A70afF8C",
3356
+ poolCategory: "Core" /* CORE */,
3357
+ tokenPerSecond: "0.01",
3358
+ version: 3
3359
+ },
3360
+ {
3361
+ sousId: 1,
3362
+ stakingToken: lineaTestnetTokens.cake,
3363
+ earningToken: lineaTestnetTokens.mockA,
3364
+ contractAddress: "0x30669C960b90Eb71DB4173D8b5069ca83CD2d400",
3365
+ poolCategory: "Core" /* CORE */,
3366
+ tokenPerSecond: "0.01",
3367
+ version: 3
3368
+ }
3369
+ ].map((p) => ({
3370
+ ...p,
3371
+ contractAddress: getAddress(p.contractAddress),
3372
+ stakingToken: p.stakingToken.serialize,
3373
+ earningToken: p.earningToken.serialize
3374
+ }));
3375
+ var finishedPools11 = [];
3376
+ var pools11 = [...livePools11, ...finishedPools11];
3377
+
3378
+ // src/constants/pools/1101.ts
3379
+ var livePools12 = [];
3380
+ var finishedPools12 = [];
3381
+ var pools12 = [...livePools12, ...finishedPools12];
3382
+ var livePools13 = [
3383
+ {
3384
+ sousId: 4,
3385
+ stakingToken: polygonZkEvmTestnetTokens.cake,
3386
+ earningToken: polygonZkEvmTestnetTokens.mockA,
3387
+ contractAddress: "0x6e9Cf632243070984A44743d9009CD48cb232F83",
3388
+ poolCategory: "Core" /* CORE */,
3389
+ tokenPerSecond: "0.01",
3390
+ version: 3
3391
+ },
3392
+ {
3393
+ sousId: 3,
3394
+ stakingToken: polygonZkEvmTestnetTokens.cake,
3395
+ earningToken: polygonZkEvmTestnetTokens.mockA,
3396
+ contractAddress: "0x6C9ffC1FE0f6aD00eeedbF99384E60517CA3E706",
3397
+ poolCategory: "Core" /* CORE */,
3398
+ tokenPerSecond: "0.01",
3399
+ version: 3
3400
+ },
3401
+ {
3402
+ sousId: 2,
3403
+ stakingToken: polygonZkEvmTestnetTokens.cake,
3404
+ earningToken: polygonZkEvmTestnetTokens.mockA,
3405
+ contractAddress: "0x452ED06e65aF886Ff778E9aF319fdC0ffaFA9d85",
3406
+ poolCategory: "Core" /* CORE */,
3407
+ tokenPerSecond: "0.01",
3408
+ version: 3
3409
+ },
3410
+ {
3411
+ sousId: 1,
3412
+ stakingToken: polygonZkEvmTestnetTokens.cake,
3413
+ earningToken: polygonZkEvmTestnetTokens.mockA,
3414
+ contractAddress: "0xd6bF7f0C9B1A19A7124625ECF7d6Db8b5610444A",
3415
+ poolCategory: "Core" /* CORE */,
3416
+ tokenPerSecond: "0.01",
3417
+ version: 3
3418
+ }
3419
+ ].map((p) => ({
3420
+ ...p,
3421
+ contractAddress: getAddress(p.contractAddress),
3422
+ stakingToken: p.stakingToken.serialize,
3423
+ earningToken: p.earningToken.serialize
3424
+ }));
3425
+ var finishedPools13 = [];
3426
+ var pools13 = [...livePools13, ...finishedPools13];
3251
3427
  var SUPPORTED_CHAIN_IDS = [
3252
3428
  ChainId.BSC,
3253
3429
  ChainId.BSC_TESTNET,
@@ -3255,7 +3431,10 @@ var SUPPORTED_CHAIN_IDS = [
3255
3431
  ChainId.ARBITRUM_ONE,
3256
3432
  ChainId.ARBITRUM_GOERLI,
3257
3433
  ChainId.ZKSYNC,
3258
- ChainId.ZKSYNC_TESTNET
3434
+ ChainId.ZKSYNC_TESTNET,
3435
+ ChainId.LINEA_TESTNET,
3436
+ ChainId.BASE_TESTNET,
3437
+ ChainId.POLYGON_ZKEVM_TESTNET
3259
3438
  ];
3260
3439
 
3261
3440
  // src/utils/isPoolsSupported.ts
@@ -3271,7 +3450,13 @@ var POOLS_CONFIG_BY_CHAIN = {
3271
3450
  [ChainId.ARBITRUM_ONE]: pools4,
3272
3451
  [ChainId.ARBITRUM_GOERLI]: pools5,
3273
3452
  [ChainId.ZKSYNC]: pools6,
3274
- [ChainId.ZKSYNC_TESTNET]: pools7
3453
+ [ChainId.ZKSYNC_TESTNET]: pools7,
3454
+ [ChainId.BASE]: pools8,
3455
+ [ChainId.BASE_TESTNET]: pools9,
3456
+ [ChainId.LINEA]: pools10,
3457
+ [ChainId.LINEA_TESTNET]: pools11,
3458
+ [ChainId.POLYGON_ZKEVM]: pools12,
3459
+ [ChainId.POLYGON_ZKEVM_TESTNET]: pools13
3275
3460
  };
3276
3461
  var LIVE_POOLS_CONFIG_BY_CHAIN = {
3277
3462
  [ChainId.ETHEREUM]: livePools,
@@ -3280,7 +3465,13 @@ var LIVE_POOLS_CONFIG_BY_CHAIN = {
3280
3465
  [ChainId.ARBITRUM_ONE]: livePools4,
3281
3466
  [ChainId.ARBITRUM_GOERLI]: livePools5,
3282
3467
  [ChainId.ZKSYNC]: livePools6,
3283
- [ChainId.ZKSYNC_TESTNET]: livePools7
3468
+ [ChainId.ZKSYNC_TESTNET]: livePools7,
3469
+ [ChainId.BASE]: livePools8,
3470
+ [ChainId.BASE_TESTNET]: livePools9,
3471
+ [ChainId.LINEA]: livePools10,
3472
+ [ChainId.LINEA_TESTNET]: livePools11,
3473
+ [ChainId.POLYGON_ZKEVM]: livePools12,
3474
+ [ChainId.POLYGON_ZKEVM_TESTNET]: livePools13
3284
3475
  };
3285
3476
  var getPoolsConfig = (chainId) => {
3286
3477
  if (!isPoolsSupported(chainId)) {
@@ -3306,7 +3497,10 @@ var ICAKE = {
3306
3497
  [ChainId.ARBITRUM_ONE]: "0x",
3307
3498
  [ChainId.ARBITRUM_GOERLI]: "0x",
3308
3499
  [ChainId.ZKSYNC]: "0x",
3309
- [ChainId.ZKSYNC_TESTNET]: "0x"
3500
+ [ChainId.ZKSYNC_TESTNET]: "0x",
3501
+ [ChainId.BASE_TESTNET]: "0x",
3502
+ [ChainId.LINEA_TESTNET]: "0x",
3503
+ [ChainId.POLYGON_ZKEVM_TESTNET]: "0x"
3310
3504
  };
3311
3505
  var CAKE_VAULT = {
3312
3506
  [ChainId.BSC]: "0x45c54210128a065de780C4B0Df3d16664f7f859e",
@@ -3315,7 +3509,10 @@ var CAKE_VAULT = {
3315
3509
  [ChainId.ARBITRUM_ONE]: "0x",
3316
3510
  [ChainId.ARBITRUM_GOERLI]: "0x",
3317
3511
  [ChainId.ZKSYNC]: "0x",
3318
- [ChainId.ZKSYNC_TESTNET]: "0x"
3512
+ [ChainId.ZKSYNC_TESTNET]: "0x",
3513
+ [ChainId.BASE_TESTNET]: "0x",
3514
+ [ChainId.LINEA_TESTNET]: "0x",
3515
+ [ChainId.POLYGON_ZKEVM_TESTNET]: "0x"
3319
3516
  };
3320
3517
  var CAKE_FLEXIBLE_SIDE_VAULT = {
3321
3518
  [ChainId.BSC]: "0x615e896A8C2CA8470A2e9dc2E9552998f8658Ea0",
@@ -3324,7 +3521,10 @@ var CAKE_FLEXIBLE_SIDE_VAULT = {
3324
3521
  [ChainId.ARBITRUM_ONE]: "0x",
3325
3522
  [ChainId.ARBITRUM_GOERLI]: "0x",
3326
3523
  [ChainId.ZKSYNC]: "0x",
3327
- [ChainId.ZKSYNC_TESTNET]: "0x"
3524
+ [ChainId.ZKSYNC_TESTNET]: "0x",
3525
+ [ChainId.BASE_TESTNET]: "0x",
3526
+ [ChainId.LINEA_TESTNET]: "0x",
3527
+ [ChainId.POLYGON_ZKEVM_TESTNET]: "0x"
3328
3528
  };
3329
3529
 
3330
3530
  // src/constants/index.ts
@@ -4723,8 +4923,8 @@ function getPoolContractBySousId({ chainId, sousId, signer, publicClient }) {
4723
4923
  if (!chainId) {
4724
4924
  return null;
4725
4925
  }
4726
- const pools8 = getPoolsConfig(chainId);
4727
- const pool = pools8?.find((p) => p.sousId === Number(sousId));
4926
+ const pools14 = getPoolsConfig(chainId);
4927
+ const pool = pools14?.find((p) => p.sousId === Number(sousId));
4728
4928
  if (!pool) {
4729
4929
  return null;
4730
4930
  }
@@ -4746,11 +4946,11 @@ var getLivePoolsWithEnd = async (chainId) => {
4746
4946
  }
4747
4947
  return poolsConfig.filter((p) => p.sousId !== 0 && !p.isFinished);
4748
4948
  };
4749
- async function fetchUpgradedPoolsTimeLimits(pools8, chainId, provider) {
4750
- if (!pools8.length) {
4949
+ async function fetchUpgradedPoolsTimeLimits(pools14, chainId, provider) {
4950
+ if (!pools14.length) {
4751
4951
  return [];
4752
4952
  }
4753
- const calls = pools8.flatMap(({ contractAddress }) => {
4953
+ const calls = pools14.flatMap(({ contractAddress }) => {
4754
4954
  return [
4755
4955
  {
4756
4956
  abi: smartChefABI,
@@ -4777,7 +4977,7 @@ async function fetchUpgradedPoolsTimeLimits(pools8, chainId, provider) {
4777
4977
  resultArray[chunkIndex].push(item);
4778
4978
  return resultArray;
4779
4979
  }, []);
4780
- return pools8.map((cakePoolConfig, index) => {
4980
+ return pools14.map((cakePoolConfig, index) => {
4781
4981
  const [startTimestamp, endTimestamp] = startEndResult[index];
4782
4982
  return {
4783
4983
  sousId: cakePoolConfig.sousId,
@@ -4786,11 +4986,11 @@ async function fetchUpgradedPoolsTimeLimits(pools8, chainId, provider) {
4786
4986
  };
4787
4987
  });
4788
4988
  }
4789
- var fetchLegacyPoolsBlockLimits = async (pools8, chainId, provider) => {
4790
- if (!pools8.length) {
4989
+ var fetchLegacyPoolsBlockLimits = async (pools14, chainId, provider) => {
4990
+ if (!pools14.length) {
4791
4991
  return [];
4792
4992
  }
4793
- const startEndBlockCalls = pools8.flatMap(({ contractAddress }) => {
4993
+ const startEndBlockCalls = pools14.flatMap(({ contractAddress }) => {
4794
4994
  return [
4795
4995
  {
4796
4996
  abi: sousChefABI,
@@ -4823,7 +5023,7 @@ var fetchLegacyPoolsBlockLimits = async (pools8, chainId, provider) => {
4823
5023
  const getTimestampFromBlock = (targetBlock) => {
4824
5024
  return Number(block.timestamp) + (targetBlock - Number(block.number)) * BSC_BLOCK_TIME;
4825
5025
  };
4826
- return pools8.map((cakePoolConfig, index) => {
5026
+ return pools14.map((cakePoolConfig, index) => {
4827
5027
  const [startBlock, endBlock] = startEndBlockResult[index];
4828
5028
  return {
4829
5029
  sousId: cakePoolConfig.sousId,