@pancakeswap/pools 4.0.5 → 4.0.6
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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +6 -0
- package/dist/constants/contracts.d.ts +6 -0
- package/dist/constants/contracts.d.ts.map +1 -1
- package/dist/constants/pools/42161.d.ts +5 -0
- package/dist/constants/pools/42161.d.ts.map +1 -0
- package/dist/constants/pools/421613.d.ts +5 -0
- package/dist/constants/pools/421613.d.ts.map +1 -0
- package/dist/constants/pools/index.d.ts +2 -2
- package/dist/constants/pools/index.d.ts.map +1 -1
- package/dist/constants/supportedChains.d.ts +1 -1
- package/dist/constants/supportedChains.d.ts.map +1 -1
- package/dist/index.js +111 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +112 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/constants/contracts.ts +6 -0
- package/src/constants/pools/42161.ts +26 -0
- package/src/constants/pools/421613.ts +69 -0
- package/src/constants/pools/index.ts +6 -0
- package/src/constants/supportedChains.ts +7 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChainId } from '@pancakeswap/sdk';
|
|
2
|
-
import { ethereumTokens, bscTokens, bscTestnetTokens, CAKE } from '@pancakeswap/tokens';
|
|
2
|
+
import { ethereumTokens, bscTokens, bscTestnetTokens, arbitrumTokens, arbitrumGoerliTokens, 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';
|
|
@@ -3088,7 +3088,92 @@ var livePools3 = [
|
|
|
3088
3088
|
}));
|
|
3089
3089
|
var finishedPools3 = [];
|
|
3090
3090
|
var pools3 = [...livePools3, ...finishedPools3];
|
|
3091
|
-
var
|
|
3091
|
+
var livePools4 = [
|
|
3092
|
+
{
|
|
3093
|
+
sousId: 1,
|
|
3094
|
+
stakingToken: arbitrumTokens.alp,
|
|
3095
|
+
earningToken: arbitrumTokens.cake,
|
|
3096
|
+
contractAddress: "0x3dBdE2682330105902fb482d9849C270aa8E0881",
|
|
3097
|
+
poolCategory: "Core" /* CORE */,
|
|
3098
|
+
tokenPerSecond: "0.01135",
|
|
3099
|
+
version: 3
|
|
3100
|
+
}
|
|
3101
|
+
].map((p) => ({
|
|
3102
|
+
...p,
|
|
3103
|
+
contractAddress: getAddress(p.contractAddress),
|
|
3104
|
+
stakingToken: p.stakingToken.serialize,
|
|
3105
|
+
earningToken: p.earningToken.serialize
|
|
3106
|
+
}));
|
|
3107
|
+
var finishedPools4 = [];
|
|
3108
|
+
var pools4 = [...livePools4, ...finishedPools4];
|
|
3109
|
+
var livePools5 = [
|
|
3110
|
+
{
|
|
3111
|
+
sousId: 5,
|
|
3112
|
+
stakingToken: arbitrumGoerliTokens.cake,
|
|
3113
|
+
earningToken: arbitrumGoerliTokens.mockA,
|
|
3114
|
+
contractAddress: "0x291f459243621E7d7c83a67644D87022F1FC39F5",
|
|
3115
|
+
poolCategory: "Core" /* CORE */,
|
|
3116
|
+
tokenPerSecond: "0.01",
|
|
3117
|
+
version: 3
|
|
3118
|
+
},
|
|
3119
|
+
{
|
|
3120
|
+
sousId: 4,
|
|
3121
|
+
stakingToken: arbitrumGoerliTokens.cake,
|
|
3122
|
+
earningToken: arbitrumGoerliTokens.mockA,
|
|
3123
|
+
contractAddress: "0xbA17c9f21bDea078c54F263a8cc63227F28EBfF8",
|
|
3124
|
+
poolCategory: "Core" /* CORE */,
|
|
3125
|
+
tokenPerSecond: "0.01",
|
|
3126
|
+
version: 3
|
|
3127
|
+
},
|
|
3128
|
+
{
|
|
3129
|
+
sousId: 3,
|
|
3130
|
+
stakingToken: arbitrumGoerliTokens.cake,
|
|
3131
|
+
earningToken: arbitrumGoerliTokens.mockA,
|
|
3132
|
+
contractAddress: "0xdDa7E82fF3c7b308c7f91a7080e474e41173F7f1",
|
|
3133
|
+
poolCategory: "Core" /* CORE */,
|
|
3134
|
+
tokenPerSecond: "0.01",
|
|
3135
|
+
version: 3
|
|
3136
|
+
}
|
|
3137
|
+
].map((p) => ({
|
|
3138
|
+
...p,
|
|
3139
|
+
contractAddress: getAddress(p.contractAddress),
|
|
3140
|
+
stakingToken: p.stakingToken.serialize,
|
|
3141
|
+
earningToken: p.earningToken.serialize
|
|
3142
|
+
}));
|
|
3143
|
+
var finishedPools5 = [
|
|
3144
|
+
{
|
|
3145
|
+
sousId: 2,
|
|
3146
|
+
stakingToken: arbitrumGoerliTokens.cake,
|
|
3147
|
+
earningToken: arbitrumGoerliTokens.mockA,
|
|
3148
|
+
contractAddress: "0x4aB4ec9EC094E6042E822A73Cd3979A946280E56",
|
|
3149
|
+
poolCategory: "Core" /* CORE */,
|
|
3150
|
+
tokenPerSecond: "0.01",
|
|
3151
|
+
version: 3
|
|
3152
|
+
},
|
|
3153
|
+
{
|
|
3154
|
+
sousId: 1,
|
|
3155
|
+
stakingToken: arbitrumGoerliTokens.cake,
|
|
3156
|
+
earningToken: arbitrumGoerliTokens.mockA,
|
|
3157
|
+
contractAddress: "0x5b37404299Ef7DCABA32B00A8f36f0F43eC28E92",
|
|
3158
|
+
poolCategory: "Core" /* CORE */,
|
|
3159
|
+
tokenPerSecond: "0.01",
|
|
3160
|
+
version: 3
|
|
3161
|
+
}
|
|
3162
|
+
].map((p) => ({
|
|
3163
|
+
...p,
|
|
3164
|
+
isFinished: true,
|
|
3165
|
+
contractAddress: getAddress(p.contractAddress),
|
|
3166
|
+
stakingToken: p.stakingToken.serialize,
|
|
3167
|
+
earningToken: p.earningToken.serialize
|
|
3168
|
+
}));
|
|
3169
|
+
var pools5 = [...livePools5, ...finishedPools5];
|
|
3170
|
+
var SUPPORTED_CHAIN_IDS = [
|
|
3171
|
+
ChainId.BSC,
|
|
3172
|
+
ChainId.BSC_TESTNET,
|
|
3173
|
+
ChainId.ETHEREUM,
|
|
3174
|
+
ChainId.ARBITRUM_ONE,
|
|
3175
|
+
ChainId.ARBITRUM_GOERLI
|
|
3176
|
+
];
|
|
3092
3177
|
|
|
3093
3178
|
// src/utils/isPoolsSupported.ts
|
|
3094
3179
|
function isPoolsSupported(chainId) {
|
|
@@ -3099,12 +3184,16 @@ function isPoolsSupported(chainId) {
|
|
|
3099
3184
|
var POOLS_CONFIG_BY_CHAIN = {
|
|
3100
3185
|
[ChainId.ETHEREUM]: pools,
|
|
3101
3186
|
[ChainId.BSC]: pools2,
|
|
3102
|
-
[ChainId.BSC_TESTNET]: pools3
|
|
3187
|
+
[ChainId.BSC_TESTNET]: pools3,
|
|
3188
|
+
[ChainId.ARBITRUM_ONE]: pools4,
|
|
3189
|
+
[ChainId.ARBITRUM_GOERLI]: pools5
|
|
3103
3190
|
};
|
|
3104
3191
|
var LIVE_POOLS_CONFIG_BY_CHAIN = {
|
|
3105
3192
|
[ChainId.ETHEREUM]: livePools,
|
|
3106
3193
|
[ChainId.BSC]: livePools2,
|
|
3107
|
-
[ChainId.BSC_TESTNET]: livePools3
|
|
3194
|
+
[ChainId.BSC_TESTNET]: livePools3,
|
|
3195
|
+
[ChainId.ARBITRUM_ONE]: livePools4,
|
|
3196
|
+
[ChainId.ARBITRUM_GOERLI]: livePools5
|
|
3108
3197
|
};
|
|
3109
3198
|
var getPoolsConfig = (chainId) => {
|
|
3110
3199
|
if (!isPoolsSupported(chainId)) {
|
|
@@ -3126,17 +3215,23 @@ var DURATION_FACTOR = 31536000n;
|
|
|
3126
3215
|
var ICAKE = {
|
|
3127
3216
|
[ChainId.BSC]: "0x3C458828D1622F5f4d526eb0d24Da8C4Eb8F07b1",
|
|
3128
3217
|
[ChainId.BSC_TESTNET]: "0x",
|
|
3129
|
-
[ChainId.ETHEREUM]: "0x"
|
|
3218
|
+
[ChainId.ETHEREUM]: "0x",
|
|
3219
|
+
[ChainId.ARBITRUM_ONE]: "0x",
|
|
3220
|
+
[ChainId.ARBITRUM_GOERLI]: "0x"
|
|
3130
3221
|
};
|
|
3131
3222
|
var CAKE_VAULT = {
|
|
3132
3223
|
[ChainId.BSC]: "0x45c54210128a065de780C4B0Df3d16664f7f859e",
|
|
3133
3224
|
[ChainId.BSC_TESTNET]: "0x1088Fb24053F03802F673b84d16AE1A7023E400b",
|
|
3134
|
-
[ChainId.ETHEREUM]: "0x"
|
|
3225
|
+
[ChainId.ETHEREUM]: "0x",
|
|
3226
|
+
[ChainId.ARBITRUM_ONE]: "0x",
|
|
3227
|
+
[ChainId.ARBITRUM_GOERLI]: "0x"
|
|
3135
3228
|
};
|
|
3136
3229
|
var CAKE_FLEXIBLE_SIDE_VAULT = {
|
|
3137
3230
|
[ChainId.BSC]: "0x615e896A8C2CA8470A2e9dc2E9552998f8658Ea0",
|
|
3138
3231
|
[ChainId.BSC_TESTNET]: "0x",
|
|
3139
|
-
[ChainId.ETHEREUM]: "0x"
|
|
3232
|
+
[ChainId.ETHEREUM]: "0x",
|
|
3233
|
+
[ChainId.ARBITRUM_ONE]: "0x",
|
|
3234
|
+
[ChainId.ARBITRUM_GOERLI]: "0x"
|
|
3140
3235
|
};
|
|
3141
3236
|
|
|
3142
3237
|
// src/constants/index.ts
|
|
@@ -4535,8 +4630,8 @@ function getPoolContractBySousId({ chainId, sousId, signer, publicClient }) {
|
|
|
4535
4630
|
if (!chainId) {
|
|
4536
4631
|
return null;
|
|
4537
4632
|
}
|
|
4538
|
-
const
|
|
4539
|
-
const pool =
|
|
4633
|
+
const pools6 = getPoolsConfig(chainId);
|
|
4634
|
+
const pool = pools6?.find((p) => p.sousId === Number(sousId));
|
|
4540
4635
|
if (!pool) {
|
|
4541
4636
|
return null;
|
|
4542
4637
|
}
|
|
@@ -4558,11 +4653,11 @@ var getLivePoolsWithEnd = async (chainId) => {
|
|
|
4558
4653
|
}
|
|
4559
4654
|
return poolsConfig.filter((p) => p.sousId !== 0 && !p.isFinished);
|
|
4560
4655
|
};
|
|
4561
|
-
async function fetchUpgradedPoolsTimeLimits(
|
|
4562
|
-
if (!
|
|
4656
|
+
async function fetchUpgradedPoolsTimeLimits(pools6, chainId, provider) {
|
|
4657
|
+
if (!pools6.length) {
|
|
4563
4658
|
return [];
|
|
4564
4659
|
}
|
|
4565
|
-
const calls =
|
|
4660
|
+
const calls = pools6.flatMap(({ contractAddress }) => {
|
|
4566
4661
|
return [
|
|
4567
4662
|
{
|
|
4568
4663
|
abi: smartChefABI,
|
|
@@ -4589,7 +4684,7 @@ async function fetchUpgradedPoolsTimeLimits(pools4, chainId, provider) {
|
|
|
4589
4684
|
resultArray[chunkIndex].push(item);
|
|
4590
4685
|
return resultArray;
|
|
4591
4686
|
}, []);
|
|
4592
|
-
return
|
|
4687
|
+
return pools6.map((cakePoolConfig, index) => {
|
|
4593
4688
|
const [startTimestamp, endTimestamp] = startEndResult[index];
|
|
4594
4689
|
return {
|
|
4595
4690
|
sousId: cakePoolConfig.sousId,
|
|
@@ -4598,11 +4693,11 @@ async function fetchUpgradedPoolsTimeLimits(pools4, chainId, provider) {
|
|
|
4598
4693
|
};
|
|
4599
4694
|
});
|
|
4600
4695
|
}
|
|
4601
|
-
var fetchLegacyPoolsBlockLimits = async (
|
|
4602
|
-
if (!
|
|
4696
|
+
var fetchLegacyPoolsBlockLimits = async (pools6, chainId, provider) => {
|
|
4697
|
+
if (!pools6.length) {
|
|
4603
4698
|
return [];
|
|
4604
4699
|
}
|
|
4605
|
-
const startEndBlockCalls =
|
|
4700
|
+
const startEndBlockCalls = pools6.flatMap(({ contractAddress }) => {
|
|
4606
4701
|
return [
|
|
4607
4702
|
{
|
|
4608
4703
|
abi: sousChefABI,
|
|
@@ -4635,7 +4730,7 @@ var fetchLegacyPoolsBlockLimits = async (pools4, chainId, provider) => {
|
|
|
4635
4730
|
const getTimestampFromBlock = (targetBlock) => {
|
|
4636
4731
|
return Number(block.timestamp) + (targetBlock - Number(block.number)) * BSC_BLOCK_TIME;
|
|
4637
4732
|
};
|
|
4638
|
-
return
|
|
4733
|
+
return pools6.map((cakePoolConfig, index) => {
|
|
4639
4734
|
const [startBlock, endBlock] = startEndBlockResult[index];
|
|
4640
4735
|
return {
|
|
4641
4736
|
sousId: cakePoolConfig.sousId,
|