@pancakeswap/pools 4.0.8 → 4.0.10

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 (65) hide show
  1. package/dist/constants/contracts.d.ts +15 -0
  2. package/dist/constants/contracts.d.ts.map +1 -1
  3. package/dist/constants/pools/1101.d.ts +5 -0
  4. package/dist/constants/pools/1101.d.ts.map +1 -0
  5. package/dist/constants/pools/1442.d.ts +5 -0
  6. package/dist/constants/pools/1442.d.ts.map +1 -0
  7. package/dist/constants/pools/280.d.ts +5 -0
  8. package/dist/constants/pools/280.d.ts.map +1 -0
  9. package/dist/constants/pools/324.d.ts +5 -0
  10. package/dist/constants/pools/324.d.ts.map +1 -0
  11. package/dist/constants/pools/56.d.ts.map +1 -1
  12. package/dist/constants/pools/59140.d.ts +5 -0
  13. package/dist/constants/pools/59140.d.ts.map +1 -0
  14. package/dist/constants/pools/59144.d.ts +5 -0
  15. package/dist/constants/pools/59144.d.ts.map +1 -0
  16. package/dist/constants/pools/8453.d.ts +5 -0
  17. package/dist/constants/pools/8453.d.ts.map +1 -0
  18. package/dist/constants/pools/84531.d.ts +5 -0
  19. package/dist/constants/pools/84531.d.ts.map +1 -0
  20. package/dist/constants/pools/index.d.ts +2 -2
  21. package/dist/constants/pools/index.d.ts.map +1 -1
  22. package/dist/constants/supportedChains.d.ts +1 -1
  23. package/dist/constants/supportedChains.d.ts.map +1 -1
  24. package/dist/index.js +310 -34
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +311 -35
  27. package/dist/index.mjs.map +1 -1
  28. package/package.json +6 -3
  29. package/.turbo/turbo-build.log +0 -18
  30. package/CHANGELOG.md +0 -132
  31. package/src/abis/ICake.ts +0 -59
  32. package/src/abis/ICakeFlexibleSideVaultV2.ts +0 -487
  33. package/src/abis/ICakeVaultV2.ts +0 -487
  34. package/src/abis/ISmartChef.ts +0 -326
  35. package/src/abis/ISousChef.ts +0 -122
  36. package/src/abis/ISousChefBNB.ts +0 -166
  37. package/src/abis/ISousChefV2.ts +0 -341
  38. package/src/abis/ISousChefV3.ts +0 -326
  39. package/src/constants/contracts.ts +0 -32
  40. package/src/constants/index.ts +0 -10
  41. package/src/constants/pools/1.ts +0 -80
  42. package/src/constants/pools/42161.ts +0 -26
  43. package/src/constants/pools/421613.ts +0 -69
  44. package/src/constants/pools/56.ts +0 -2942
  45. package/src/constants/pools/97.ts +0 -74
  46. package/src/constants/pools/index.ts +0 -50
  47. package/src/constants/supportedChains.ts +0 -11
  48. package/src/index.ts +0 -14
  49. package/src/queries/fetchPools.ts +0 -350
  50. package/src/queries/fetchUserIfo.ts +0 -53
  51. package/src/queries/fetchUserPoolsData.ts +0 -143
  52. package/src/queries/fetchVaultPublic.ts +0 -175
  53. package/src/queries/fetchVaultUser.ts +0 -106
  54. package/src/queries/getAddresses.ts +0 -12
  55. package/src/queries/index.ts +0 -6
  56. package/src/types.ts +0 -207
  57. package/src/utils/apr.ts +0 -35
  58. package/src/utils/getContractAddress.ts +0 -11
  59. package/src/utils/getPoolContractBySousId.ts +0 -111
  60. package/src/utils/index.ts +0 -5
  61. package/src/utils/isLegacyPool.ts +0 -15
  62. package/src/utils/isPoolsSupported.ts +0 -5
  63. package/tsconfig.json +0 -14
  64. package/tsup.config.ts +0 -26
  65. 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, 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';
@@ -108,6 +108,33 @@ var livePools2 = [
108
108
  tokenPerBlock: "10",
109
109
  isFinished: false
110
110
  },
111
+ {
112
+ sousId: 363,
113
+ stakingToken: bscTokens.cake,
114
+ earningToken: bscTokens.play,
115
+ contractAddress: "0x17D87e825A2231628bCBf1aF1aaEaD419dd3a53D",
116
+ poolCategory: "Core" /* CORE */,
117
+ tokenPerBlock: "0.5902",
118
+ version: 3
119
+ },
120
+ {
121
+ sousId: 362,
122
+ stakingToken: bscTokens.cake,
123
+ earningToken: bscTokens.xcad,
124
+ contractAddress: "0x1328F684569cE0Cb0F13ce023e1C910f23CaBcA8",
125
+ poolCategory: "Core" /* CORE */,
126
+ tokenPerBlock: "0.01658",
127
+ version: 3
128
+ },
129
+ {
130
+ sousId: 361,
131
+ stakingToken: bscTokens.cake,
132
+ earningToken: bscTokens.mbx,
133
+ contractAddress: "0x51ebC2F8D7Af302835A1C2Bd02111a3af573e399",
134
+ poolCategory: "Core" /* CORE */,
135
+ tokenPerBlock: "0.1118",
136
+ version: 3
137
+ },
111
138
  {
112
139
  sousId: 360,
113
140
  stakingToken: bscTokens.cake,
@@ -144,15 +171,6 @@ var livePools2 = [
144
171
  tokenPerBlock: "0.5594",
145
172
  version: 3
146
173
  },
147
- {
148
- sousId: 355,
149
- stakingToken: bscTokens.cake,
150
- earningToken: bscTokens.planet,
151
- contractAddress: "0x69Aeec4EBA2333deC563E378a6AFD5eF23437677",
152
- poolCategory: "Core" /* CORE */,
153
- tokenPerBlock: "150.4",
154
- version: 3
155
- },
156
174
  {
157
175
  sousId: 354,
158
176
  stakingToken: bscTokens.cake,
@@ -232,6 +250,22 @@ var livePools2 = [
232
250
  contractAddress: "0x5250320d765F366E2B96Cd5c7d08F1902422195e",
233
251
  poolCategory: "Core" /* CORE */,
234
252
  tokenPerBlock: "2.017"
253
+ }
254
+ ].map((p) => ({
255
+ ...p,
256
+ contractAddress: getAddress(p.contractAddress),
257
+ stakingToken: p.stakingToken.serialize,
258
+ earningToken: p.earningToken.serialize
259
+ }));
260
+ var finishedPools2 = [
261
+ {
262
+ sousId: 355,
263
+ stakingToken: bscTokens.cake,
264
+ earningToken: bscTokens.planet,
265
+ contractAddress: "0x69Aeec4EBA2333deC563E378a6AFD5eF23437677",
266
+ poolCategory: "Core" /* CORE */,
267
+ tokenPerBlock: "150.4",
268
+ version: 3
235
269
  },
236
270
  {
237
271
  sousId: 325,
@@ -241,14 +275,7 @@ var livePools2 = [
241
275
  poolCategory: "Core" /* CORE */,
242
276
  tokenPerBlock: "0.009765",
243
277
  version: 3
244
- }
245
- ].map((p) => ({
246
- ...p,
247
- contractAddress: getAddress(p.contractAddress),
248
- stakingToken: p.stakingToken.serialize,
249
- earningToken: p.earningToken.serialize
250
- }));
251
- var finishedPools2 = [
278
+ },
252
279
  {
253
280
  sousId: 345,
254
281
  stakingToken: bscTokens.cake,
@@ -3176,12 +3203,230 @@ var finishedPools5 = [
3176
3203
  earningToken: p.earningToken.serialize
3177
3204
  }));
3178
3205
  var pools5 = [...livePools5, ...finishedPools5];
3206
+ var livePools6 = [
3207
+ {
3208
+ sousId: 1,
3209
+ stakingToken: zksyncTokens.cake,
3210
+ earningToken: zksyncTokens.tes,
3211
+ contractAddress: "0xedB2E9eB4fc47d57c08B387775e09E5fC9e21EBE",
3212
+ poolCategory: "Core" /* CORE */,
3213
+ tokenPerSecond: "0.02546",
3214
+ version: 3
3215
+ }
3216
+ ].map((p) => ({
3217
+ ...p,
3218
+ contractAddress: getAddress(p.contractAddress),
3219
+ stakingToken: p.stakingToken.serialize,
3220
+ earningToken: p.earningToken.serialize
3221
+ }));
3222
+ var finishedPools6 = [];
3223
+ var pools6 = [...livePools6, ...finishedPools6];
3224
+ var livePools7 = [
3225
+ {
3226
+ sousId: 4,
3227
+ stakingToken: zkSyncTestnetTokens.cake,
3228
+ earningToken: zkSyncTestnetTokens.mock,
3229
+ contractAddress: "0x4BDFF8A608be623077E54F6916761f631e87D884",
3230
+ poolCategory: "Core" /* CORE */,
3231
+ tokenPerSecond: "0.01",
3232
+ version: 3
3233
+ },
3234
+ {
3235
+ sousId: 3,
3236
+ stakingToken: zkSyncTestnetTokens.cake,
3237
+ earningToken: zkSyncTestnetTokens.mock,
3238
+ contractAddress: "0x926E99bad2BC7dA5c0880f0bebD7f448Be86562B",
3239
+ poolCategory: "Core" /* CORE */,
3240
+ tokenPerSecond: "0.01",
3241
+ version: 3
3242
+ },
3243
+ {
3244
+ sousId: 2,
3245
+ stakingToken: zkSyncTestnetTokens.cake,
3246
+ earningToken: zkSyncTestnetTokens.mock,
3247
+ contractAddress: "0x5F7Cc0C5E3FC6e26bC98d392fa3516D4F33Df8aD",
3248
+ poolCategory: "Core" /* CORE */,
3249
+ tokenPerSecond: "0.01",
3250
+ version: 3
3251
+ },
3252
+ {
3253
+ sousId: 1,
3254
+ stakingToken: zkSyncTestnetTokens.cake,
3255
+ earningToken: zkSyncTestnetTokens.mock,
3256
+ contractAddress: "0x455d2eBbfb172CDba2D499cAf36cBbF5366F976D",
3257
+ poolCategory: "Core" /* CORE */,
3258
+ tokenPerSecond: "0.01",
3259
+ version: 3
3260
+ }
3261
+ ].map((p) => ({
3262
+ ...p,
3263
+ contractAddress: getAddress(p.contractAddress),
3264
+ stakingToken: p.stakingToken.serialize,
3265
+ earningToken: p.earningToken.serialize
3266
+ }));
3267
+ var finishedPools7 = [];
3268
+ var pools7 = [...livePools7, ...finishedPools7];
3269
+
3270
+ // src/constants/pools/8453.ts
3271
+ var livePools8 = [];
3272
+ var finishedPools8 = [];
3273
+ var pools8 = [...livePools8, ...finishedPools8];
3274
+ var livePools9 = [
3275
+ {
3276
+ sousId: 4,
3277
+ stakingToken: baseTestnetTokens.cake,
3278
+ earningToken: baseTestnetTokens.mockA,
3279
+ contractAddress: "0x55F8912596F06453466e208e79AB808328146d06",
3280
+ poolCategory: "Core" /* CORE */,
3281
+ tokenPerSecond: "0.01",
3282
+ version: 3
3283
+ },
3284
+ {
3285
+ sousId: 3,
3286
+ stakingToken: baseTestnetTokens.cake,
3287
+ earningToken: baseTestnetTokens.mockA,
3288
+ contractAddress: "0xE61a1065B740a61950E08C073833B85D3362f48B",
3289
+ poolCategory: "Core" /* CORE */,
3290
+ tokenPerSecond: "0.01",
3291
+ version: 3
3292
+ },
3293
+ {
3294
+ sousId: 2,
3295
+ stakingToken: baseTestnetTokens.cake,
3296
+ earningToken: baseTestnetTokens.mockA,
3297
+ contractAddress: "0xF9991a0e33115c1B7e0690109115747ab5C48D9E",
3298
+ poolCategory: "Core" /* CORE */,
3299
+ tokenPerSecond: "0.01",
3300
+ version: 3
3301
+ },
3302
+ {
3303
+ sousId: 1,
3304
+ stakingToken: baseTestnetTokens.cake,
3305
+ earningToken: baseTestnetTokens.mockA,
3306
+ contractAddress: "0x35DB927618560B8878543ea0019A8E664581ADb5",
3307
+ poolCategory: "Core" /* CORE */,
3308
+ tokenPerSecond: "0.01",
3309
+ version: 3
3310
+ }
3311
+ ].map((p) => ({
3312
+ ...p,
3313
+ contractAddress: getAddress(p.contractAddress),
3314
+ stakingToken: p.stakingToken.serialize,
3315
+ earningToken: p.earningToken.serialize
3316
+ }));
3317
+ var finishedPools9 = [];
3318
+ var pools9 = [...livePools9, ...finishedPools9];
3319
+
3320
+ // src/constants/pools/59144.ts
3321
+ var livePools10 = [];
3322
+ var finishedPools10 = [];
3323
+ var pools10 = [...livePools10, ...finishedPools10];
3324
+ var livePools11 = [
3325
+ {
3326
+ sousId: 4,
3327
+ stakingToken: lineaTestnetTokens.cake,
3328
+ earningToken: lineaTestnetTokens.mockA,
3329
+ contractAddress: "0x5d4A2dCefA1B6D5031f57a05651F0b49f4E0eC74",
3330
+ poolCategory: "Core" /* CORE */,
3331
+ tokenPerSecond: "0.01",
3332
+ version: 3
3333
+ },
3334
+ {
3335
+ sousId: 3,
3336
+ stakingToken: lineaTestnetTokens.cake,
3337
+ earningToken: lineaTestnetTokens.mockA,
3338
+ contractAddress: "0xa014641f932E8b7985Ffd6F722DfE6995bbA15aF",
3339
+ poolCategory: "Core" /* CORE */,
3340
+ tokenPerSecond: "0.01",
3341
+ version: 3
3342
+ },
3343
+ {
3344
+ sousId: 2,
3345
+ stakingToken: lineaTestnetTokens.cake,
3346
+ earningToken: lineaTestnetTokens.mockA,
3347
+ contractAddress: "0x4dc9C14A5542f3D0544a6c11d717AD04A70afF8C",
3348
+ poolCategory: "Core" /* CORE */,
3349
+ tokenPerSecond: "0.01",
3350
+ version: 3
3351
+ },
3352
+ {
3353
+ sousId: 1,
3354
+ stakingToken: lineaTestnetTokens.cake,
3355
+ earningToken: lineaTestnetTokens.mockA,
3356
+ contractAddress: "0x30669C960b90Eb71DB4173D8b5069ca83CD2d400",
3357
+ poolCategory: "Core" /* CORE */,
3358
+ tokenPerSecond: "0.01",
3359
+ version: 3
3360
+ }
3361
+ ].map((p) => ({
3362
+ ...p,
3363
+ contractAddress: getAddress(p.contractAddress),
3364
+ stakingToken: p.stakingToken.serialize,
3365
+ earningToken: p.earningToken.serialize
3366
+ }));
3367
+ var finishedPools11 = [];
3368
+ var pools11 = [...livePools11, ...finishedPools11];
3369
+
3370
+ // src/constants/pools/1101.ts
3371
+ var livePools12 = [];
3372
+ var finishedPools12 = [];
3373
+ var pools12 = [...livePools12, ...finishedPools12];
3374
+ var livePools13 = [
3375
+ {
3376
+ sousId: 4,
3377
+ stakingToken: polygonZkEvmTestnetTokens.cake,
3378
+ earningToken: polygonZkEvmTestnetTokens.mockA,
3379
+ contractAddress: "0x6e9Cf632243070984A44743d9009CD48cb232F83",
3380
+ poolCategory: "Core" /* CORE */,
3381
+ tokenPerSecond: "0.01",
3382
+ version: 3
3383
+ },
3384
+ {
3385
+ sousId: 3,
3386
+ stakingToken: polygonZkEvmTestnetTokens.cake,
3387
+ earningToken: polygonZkEvmTestnetTokens.mockA,
3388
+ contractAddress: "0x6C9ffC1FE0f6aD00eeedbF99384E60517CA3E706",
3389
+ poolCategory: "Core" /* CORE */,
3390
+ tokenPerSecond: "0.01",
3391
+ version: 3
3392
+ },
3393
+ {
3394
+ sousId: 2,
3395
+ stakingToken: polygonZkEvmTestnetTokens.cake,
3396
+ earningToken: polygonZkEvmTestnetTokens.mockA,
3397
+ contractAddress: "0x452ED06e65aF886Ff778E9aF319fdC0ffaFA9d85",
3398
+ poolCategory: "Core" /* CORE */,
3399
+ tokenPerSecond: "0.01",
3400
+ version: 3
3401
+ },
3402
+ {
3403
+ sousId: 1,
3404
+ stakingToken: polygonZkEvmTestnetTokens.cake,
3405
+ earningToken: polygonZkEvmTestnetTokens.mockA,
3406
+ contractAddress: "0xd6bF7f0C9B1A19A7124625ECF7d6Db8b5610444A",
3407
+ poolCategory: "Core" /* CORE */,
3408
+ tokenPerSecond: "0.01",
3409
+ version: 3
3410
+ }
3411
+ ].map((p) => ({
3412
+ ...p,
3413
+ contractAddress: getAddress(p.contractAddress),
3414
+ stakingToken: p.stakingToken.serialize,
3415
+ earningToken: p.earningToken.serialize
3416
+ }));
3417
+ var finishedPools13 = [];
3418
+ var pools13 = [...livePools13, ...finishedPools13];
3179
3419
  var SUPPORTED_CHAIN_IDS = [
3180
3420
  ChainId.BSC,
3181
3421
  ChainId.BSC_TESTNET,
3182
3422
  ChainId.ETHEREUM,
3183
3423
  ChainId.ARBITRUM_ONE,
3184
- ChainId.ARBITRUM_GOERLI
3424
+ ChainId.ARBITRUM_GOERLI,
3425
+ ChainId.ZKSYNC,
3426
+ ChainId.ZKSYNC_TESTNET,
3427
+ ChainId.LINEA_TESTNET,
3428
+ ChainId.BASE_TESTNET,
3429
+ ChainId.POLYGON_ZKEVM_TESTNET
3185
3430
  ];
3186
3431
 
3187
3432
  // src/utils/isPoolsSupported.ts
@@ -3195,14 +3440,30 @@ var POOLS_CONFIG_BY_CHAIN = {
3195
3440
  [ChainId.BSC]: pools2,
3196
3441
  [ChainId.BSC_TESTNET]: pools3,
3197
3442
  [ChainId.ARBITRUM_ONE]: pools4,
3198
- [ChainId.ARBITRUM_GOERLI]: pools5
3443
+ [ChainId.ARBITRUM_GOERLI]: pools5,
3444
+ [ChainId.ZKSYNC]: pools6,
3445
+ [ChainId.ZKSYNC_TESTNET]: pools7,
3446
+ [ChainId.BASE]: pools8,
3447
+ [ChainId.BASE_TESTNET]: pools9,
3448
+ [ChainId.LINEA]: pools10,
3449
+ [ChainId.LINEA_TESTNET]: pools11,
3450
+ [ChainId.POLYGON_ZKEVM]: pools12,
3451
+ [ChainId.POLYGON_ZKEVM_TESTNET]: pools13
3199
3452
  };
3200
3453
  var LIVE_POOLS_CONFIG_BY_CHAIN = {
3201
3454
  [ChainId.ETHEREUM]: livePools,
3202
3455
  [ChainId.BSC]: livePools2,
3203
3456
  [ChainId.BSC_TESTNET]: livePools3,
3204
3457
  [ChainId.ARBITRUM_ONE]: livePools4,
3205
- [ChainId.ARBITRUM_GOERLI]: livePools5
3458
+ [ChainId.ARBITRUM_GOERLI]: livePools5,
3459
+ [ChainId.ZKSYNC]: livePools6,
3460
+ [ChainId.ZKSYNC_TESTNET]: livePools7,
3461
+ [ChainId.BASE]: livePools8,
3462
+ [ChainId.BASE_TESTNET]: livePools9,
3463
+ [ChainId.LINEA]: livePools10,
3464
+ [ChainId.LINEA_TESTNET]: livePools11,
3465
+ [ChainId.POLYGON_ZKEVM]: livePools12,
3466
+ [ChainId.POLYGON_ZKEVM_TESTNET]: livePools13
3206
3467
  };
3207
3468
  var getPoolsConfig = (chainId) => {
3208
3469
  if (!isPoolsSupported(chainId)) {
@@ -3226,21 +3487,36 @@ var ICAKE = {
3226
3487
  [ChainId.BSC_TESTNET]: "0x",
3227
3488
  [ChainId.ETHEREUM]: "0x",
3228
3489
  [ChainId.ARBITRUM_ONE]: "0x",
3229
- [ChainId.ARBITRUM_GOERLI]: "0x"
3490
+ [ChainId.ARBITRUM_GOERLI]: "0x",
3491
+ [ChainId.ZKSYNC]: "0x",
3492
+ [ChainId.ZKSYNC_TESTNET]: "0x",
3493
+ [ChainId.BASE_TESTNET]: "0x",
3494
+ [ChainId.LINEA_TESTNET]: "0x",
3495
+ [ChainId.POLYGON_ZKEVM_TESTNET]: "0x"
3230
3496
  };
3231
3497
  var CAKE_VAULT = {
3232
3498
  [ChainId.BSC]: "0x45c54210128a065de780C4B0Df3d16664f7f859e",
3233
3499
  [ChainId.BSC_TESTNET]: "0x1088Fb24053F03802F673b84d16AE1A7023E400b",
3234
3500
  [ChainId.ETHEREUM]: "0x",
3235
3501
  [ChainId.ARBITRUM_ONE]: "0x",
3236
- [ChainId.ARBITRUM_GOERLI]: "0x"
3502
+ [ChainId.ARBITRUM_GOERLI]: "0x",
3503
+ [ChainId.ZKSYNC]: "0x",
3504
+ [ChainId.ZKSYNC_TESTNET]: "0x",
3505
+ [ChainId.BASE_TESTNET]: "0x",
3506
+ [ChainId.LINEA_TESTNET]: "0x",
3507
+ [ChainId.POLYGON_ZKEVM_TESTNET]: "0x"
3237
3508
  };
3238
3509
  var CAKE_FLEXIBLE_SIDE_VAULT = {
3239
3510
  [ChainId.BSC]: "0x615e896A8C2CA8470A2e9dc2E9552998f8658Ea0",
3240
3511
  [ChainId.BSC_TESTNET]: "0x",
3241
3512
  [ChainId.ETHEREUM]: "0x",
3242
3513
  [ChainId.ARBITRUM_ONE]: "0x",
3243
- [ChainId.ARBITRUM_GOERLI]: "0x"
3514
+ [ChainId.ARBITRUM_GOERLI]: "0x",
3515
+ [ChainId.ZKSYNC]: "0x",
3516
+ [ChainId.ZKSYNC_TESTNET]: "0x",
3517
+ [ChainId.BASE_TESTNET]: "0x",
3518
+ [ChainId.LINEA_TESTNET]: "0x",
3519
+ [ChainId.POLYGON_ZKEVM_TESTNET]: "0x"
3244
3520
  };
3245
3521
 
3246
3522
  // src/constants/index.ts
@@ -4639,8 +4915,8 @@ function getPoolContractBySousId({ chainId, sousId, signer, publicClient }) {
4639
4915
  if (!chainId) {
4640
4916
  return null;
4641
4917
  }
4642
- const pools6 = getPoolsConfig(chainId);
4643
- const pool = pools6?.find((p) => p.sousId === Number(sousId));
4918
+ const pools14 = getPoolsConfig(chainId);
4919
+ const pool = pools14?.find((p) => p.sousId === Number(sousId));
4644
4920
  if (!pool) {
4645
4921
  return null;
4646
4922
  }
@@ -4662,11 +4938,11 @@ var getLivePoolsWithEnd = async (chainId) => {
4662
4938
  }
4663
4939
  return poolsConfig.filter((p) => p.sousId !== 0 && !p.isFinished);
4664
4940
  };
4665
- async function fetchUpgradedPoolsTimeLimits(pools6, chainId, provider) {
4666
- if (!pools6.length) {
4941
+ async function fetchUpgradedPoolsTimeLimits(pools14, chainId, provider) {
4942
+ if (!pools14.length) {
4667
4943
  return [];
4668
4944
  }
4669
- const calls = pools6.flatMap(({ contractAddress }) => {
4945
+ const calls = pools14.flatMap(({ contractAddress }) => {
4670
4946
  return [
4671
4947
  {
4672
4948
  abi: smartChefABI,
@@ -4693,7 +4969,7 @@ async function fetchUpgradedPoolsTimeLimits(pools6, chainId, provider) {
4693
4969
  resultArray[chunkIndex].push(item);
4694
4970
  return resultArray;
4695
4971
  }, []);
4696
- return pools6.map((cakePoolConfig, index) => {
4972
+ return pools14.map((cakePoolConfig, index) => {
4697
4973
  const [startTimestamp, endTimestamp] = startEndResult[index];
4698
4974
  return {
4699
4975
  sousId: cakePoolConfig.sousId,
@@ -4702,11 +4978,11 @@ async function fetchUpgradedPoolsTimeLimits(pools6, chainId, provider) {
4702
4978
  };
4703
4979
  });
4704
4980
  }
4705
- var fetchLegacyPoolsBlockLimits = async (pools6, chainId, provider) => {
4706
- if (!pools6.length) {
4981
+ var fetchLegacyPoolsBlockLimits = async (pools14, chainId, provider) => {
4982
+ if (!pools14.length) {
4707
4983
  return [];
4708
4984
  }
4709
- const startEndBlockCalls = pools6.flatMap(({ contractAddress }) => {
4985
+ const startEndBlockCalls = pools14.flatMap(({ contractAddress }) => {
4710
4986
  return [
4711
4987
  {
4712
4988
  abi: sousChefABI,
@@ -4739,7 +5015,7 @@ var fetchLegacyPoolsBlockLimits = async (pools6, chainId, provider) => {
4739
5015
  const getTimestampFromBlock = (targetBlock) => {
4740
5016
  return Number(block.timestamp) + (targetBlock - Number(block.number)) * BSC_BLOCK_TIME;
4741
5017
  };
4742
- return pools6.map((cakePoolConfig, index) => {
5018
+ return pools14.map((cakePoolConfig, index) => {
4743
5019
  const [startBlock, endBlock] = startEndBlockResult[index];
4744
5020
  return {
4745
5021
  sousId: cakePoolConfig.sousId,
@@ -4971,7 +5247,7 @@ var fetchUserBalances = async ({ account, chainId, provider }) => {
4971
5247
  return [pool.sousId, new BigNumber7(tokenBalances[pool.stakingToken.address].toString()).toJSON()];
4972
5248
  }).filter((p) => Boolean(p))
4973
5249
  );
4974
- const bnbBalanceJson = new BigNumber7(bnbBalance.result.toString()).toJSON();
5250
+ const bnbBalanceJson = new BigNumber7(bnbBalance.result?.toString()).toJSON();
4975
5251
  const bnbBalances = fromPairs2(bnbPools.map((pool) => [pool.sousId, bnbBalanceJson]));
4976
5252
  return { ...poolTokenBalances, ...bnbBalances };
4977
5253
  };