@pancakeswap/pools 4.0.5 → 4.0.7
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 +15 -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/56.d.ts.map +1 -1
- 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 +120 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +121 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- 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/56.ts +9 -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';
|
|
@@ -108,6 +108,15 @@ var livePools2 = [
|
|
|
108
108
|
tokenPerBlock: "10",
|
|
109
109
|
isFinished: false
|
|
110
110
|
},
|
|
111
|
+
{
|
|
112
|
+
sousId: 360,
|
|
113
|
+
stakingToken: bscTokens.cake,
|
|
114
|
+
earningToken: bscTokens.axl,
|
|
115
|
+
contractAddress: "0x32f0414a4e970a3edd9e7db367A43348F25D74cD",
|
|
116
|
+
poolCategory: "Core" /* CORE */,
|
|
117
|
+
tokenPerBlock: "0.05358",
|
|
118
|
+
version: 3
|
|
119
|
+
},
|
|
111
120
|
{
|
|
112
121
|
sousId: 359,
|
|
113
122
|
stakingToken: bscTokens.cake,
|
|
@@ -3088,7 +3097,92 @@ var livePools3 = [
|
|
|
3088
3097
|
}));
|
|
3089
3098
|
var finishedPools3 = [];
|
|
3090
3099
|
var pools3 = [...livePools3, ...finishedPools3];
|
|
3091
|
-
var
|
|
3100
|
+
var livePools4 = [
|
|
3101
|
+
{
|
|
3102
|
+
sousId: 1,
|
|
3103
|
+
stakingToken: arbitrumTokens.alp,
|
|
3104
|
+
earningToken: arbitrumTokens.cake,
|
|
3105
|
+
contractAddress: "0x3dBdE2682330105902fb482d9849C270aa8E0881",
|
|
3106
|
+
poolCategory: "Core" /* CORE */,
|
|
3107
|
+
tokenPerSecond: "0.01135",
|
|
3108
|
+
version: 3
|
|
3109
|
+
}
|
|
3110
|
+
].map((p) => ({
|
|
3111
|
+
...p,
|
|
3112
|
+
contractAddress: getAddress(p.contractAddress),
|
|
3113
|
+
stakingToken: p.stakingToken.serialize,
|
|
3114
|
+
earningToken: p.earningToken.serialize
|
|
3115
|
+
}));
|
|
3116
|
+
var finishedPools4 = [];
|
|
3117
|
+
var pools4 = [...livePools4, ...finishedPools4];
|
|
3118
|
+
var livePools5 = [
|
|
3119
|
+
{
|
|
3120
|
+
sousId: 5,
|
|
3121
|
+
stakingToken: arbitrumGoerliTokens.cake,
|
|
3122
|
+
earningToken: arbitrumGoerliTokens.mockA,
|
|
3123
|
+
contractAddress: "0x291f459243621E7d7c83a67644D87022F1FC39F5",
|
|
3124
|
+
poolCategory: "Core" /* CORE */,
|
|
3125
|
+
tokenPerSecond: "0.01",
|
|
3126
|
+
version: 3
|
|
3127
|
+
},
|
|
3128
|
+
{
|
|
3129
|
+
sousId: 4,
|
|
3130
|
+
stakingToken: arbitrumGoerliTokens.cake,
|
|
3131
|
+
earningToken: arbitrumGoerliTokens.mockA,
|
|
3132
|
+
contractAddress: "0xbA17c9f21bDea078c54F263a8cc63227F28EBfF8",
|
|
3133
|
+
poolCategory: "Core" /* CORE */,
|
|
3134
|
+
tokenPerSecond: "0.01",
|
|
3135
|
+
version: 3
|
|
3136
|
+
},
|
|
3137
|
+
{
|
|
3138
|
+
sousId: 3,
|
|
3139
|
+
stakingToken: arbitrumGoerliTokens.cake,
|
|
3140
|
+
earningToken: arbitrumGoerliTokens.mockA,
|
|
3141
|
+
contractAddress: "0xdDa7E82fF3c7b308c7f91a7080e474e41173F7f1",
|
|
3142
|
+
poolCategory: "Core" /* CORE */,
|
|
3143
|
+
tokenPerSecond: "0.01",
|
|
3144
|
+
version: 3
|
|
3145
|
+
}
|
|
3146
|
+
].map((p) => ({
|
|
3147
|
+
...p,
|
|
3148
|
+
contractAddress: getAddress(p.contractAddress),
|
|
3149
|
+
stakingToken: p.stakingToken.serialize,
|
|
3150
|
+
earningToken: p.earningToken.serialize
|
|
3151
|
+
}));
|
|
3152
|
+
var finishedPools5 = [
|
|
3153
|
+
{
|
|
3154
|
+
sousId: 2,
|
|
3155
|
+
stakingToken: arbitrumGoerliTokens.cake,
|
|
3156
|
+
earningToken: arbitrumGoerliTokens.mockA,
|
|
3157
|
+
contractAddress: "0x4aB4ec9EC094E6042E822A73Cd3979A946280E56",
|
|
3158
|
+
poolCategory: "Core" /* CORE */,
|
|
3159
|
+
tokenPerSecond: "0.01",
|
|
3160
|
+
version: 3
|
|
3161
|
+
},
|
|
3162
|
+
{
|
|
3163
|
+
sousId: 1,
|
|
3164
|
+
stakingToken: arbitrumGoerliTokens.cake,
|
|
3165
|
+
earningToken: arbitrumGoerliTokens.mockA,
|
|
3166
|
+
contractAddress: "0x5b37404299Ef7DCABA32B00A8f36f0F43eC28E92",
|
|
3167
|
+
poolCategory: "Core" /* CORE */,
|
|
3168
|
+
tokenPerSecond: "0.01",
|
|
3169
|
+
version: 3
|
|
3170
|
+
}
|
|
3171
|
+
].map((p) => ({
|
|
3172
|
+
...p,
|
|
3173
|
+
isFinished: true,
|
|
3174
|
+
contractAddress: getAddress(p.contractAddress),
|
|
3175
|
+
stakingToken: p.stakingToken.serialize,
|
|
3176
|
+
earningToken: p.earningToken.serialize
|
|
3177
|
+
}));
|
|
3178
|
+
var pools5 = [...livePools5, ...finishedPools5];
|
|
3179
|
+
var SUPPORTED_CHAIN_IDS = [
|
|
3180
|
+
ChainId.BSC,
|
|
3181
|
+
ChainId.BSC_TESTNET,
|
|
3182
|
+
ChainId.ETHEREUM,
|
|
3183
|
+
ChainId.ARBITRUM_ONE,
|
|
3184
|
+
ChainId.ARBITRUM_GOERLI
|
|
3185
|
+
];
|
|
3092
3186
|
|
|
3093
3187
|
// src/utils/isPoolsSupported.ts
|
|
3094
3188
|
function isPoolsSupported(chainId) {
|
|
@@ -3099,12 +3193,16 @@ function isPoolsSupported(chainId) {
|
|
|
3099
3193
|
var POOLS_CONFIG_BY_CHAIN = {
|
|
3100
3194
|
[ChainId.ETHEREUM]: pools,
|
|
3101
3195
|
[ChainId.BSC]: pools2,
|
|
3102
|
-
[ChainId.BSC_TESTNET]: pools3
|
|
3196
|
+
[ChainId.BSC_TESTNET]: pools3,
|
|
3197
|
+
[ChainId.ARBITRUM_ONE]: pools4,
|
|
3198
|
+
[ChainId.ARBITRUM_GOERLI]: pools5
|
|
3103
3199
|
};
|
|
3104
3200
|
var LIVE_POOLS_CONFIG_BY_CHAIN = {
|
|
3105
3201
|
[ChainId.ETHEREUM]: livePools,
|
|
3106
3202
|
[ChainId.BSC]: livePools2,
|
|
3107
|
-
[ChainId.BSC_TESTNET]: livePools3
|
|
3203
|
+
[ChainId.BSC_TESTNET]: livePools3,
|
|
3204
|
+
[ChainId.ARBITRUM_ONE]: livePools4,
|
|
3205
|
+
[ChainId.ARBITRUM_GOERLI]: livePools5
|
|
3108
3206
|
};
|
|
3109
3207
|
var getPoolsConfig = (chainId) => {
|
|
3110
3208
|
if (!isPoolsSupported(chainId)) {
|
|
@@ -3126,17 +3224,23 @@ var DURATION_FACTOR = 31536000n;
|
|
|
3126
3224
|
var ICAKE = {
|
|
3127
3225
|
[ChainId.BSC]: "0x3C458828D1622F5f4d526eb0d24Da8C4Eb8F07b1",
|
|
3128
3226
|
[ChainId.BSC_TESTNET]: "0x",
|
|
3129
|
-
[ChainId.ETHEREUM]: "0x"
|
|
3227
|
+
[ChainId.ETHEREUM]: "0x",
|
|
3228
|
+
[ChainId.ARBITRUM_ONE]: "0x",
|
|
3229
|
+
[ChainId.ARBITRUM_GOERLI]: "0x"
|
|
3130
3230
|
};
|
|
3131
3231
|
var CAKE_VAULT = {
|
|
3132
3232
|
[ChainId.BSC]: "0x45c54210128a065de780C4B0Df3d16664f7f859e",
|
|
3133
3233
|
[ChainId.BSC_TESTNET]: "0x1088Fb24053F03802F673b84d16AE1A7023E400b",
|
|
3134
|
-
[ChainId.ETHEREUM]: "0x"
|
|
3234
|
+
[ChainId.ETHEREUM]: "0x",
|
|
3235
|
+
[ChainId.ARBITRUM_ONE]: "0x",
|
|
3236
|
+
[ChainId.ARBITRUM_GOERLI]: "0x"
|
|
3135
3237
|
};
|
|
3136
3238
|
var CAKE_FLEXIBLE_SIDE_VAULT = {
|
|
3137
3239
|
[ChainId.BSC]: "0x615e896A8C2CA8470A2e9dc2E9552998f8658Ea0",
|
|
3138
3240
|
[ChainId.BSC_TESTNET]: "0x",
|
|
3139
|
-
[ChainId.ETHEREUM]: "0x"
|
|
3241
|
+
[ChainId.ETHEREUM]: "0x",
|
|
3242
|
+
[ChainId.ARBITRUM_ONE]: "0x",
|
|
3243
|
+
[ChainId.ARBITRUM_GOERLI]: "0x"
|
|
3140
3244
|
};
|
|
3141
3245
|
|
|
3142
3246
|
// src/constants/index.ts
|
|
@@ -4535,8 +4639,8 @@ function getPoolContractBySousId({ chainId, sousId, signer, publicClient }) {
|
|
|
4535
4639
|
if (!chainId) {
|
|
4536
4640
|
return null;
|
|
4537
4641
|
}
|
|
4538
|
-
const
|
|
4539
|
-
const pool =
|
|
4642
|
+
const pools6 = getPoolsConfig(chainId);
|
|
4643
|
+
const pool = pools6?.find((p) => p.sousId === Number(sousId));
|
|
4540
4644
|
if (!pool) {
|
|
4541
4645
|
return null;
|
|
4542
4646
|
}
|
|
@@ -4558,11 +4662,11 @@ var getLivePoolsWithEnd = async (chainId) => {
|
|
|
4558
4662
|
}
|
|
4559
4663
|
return poolsConfig.filter((p) => p.sousId !== 0 && !p.isFinished);
|
|
4560
4664
|
};
|
|
4561
|
-
async function fetchUpgradedPoolsTimeLimits(
|
|
4562
|
-
if (!
|
|
4665
|
+
async function fetchUpgradedPoolsTimeLimits(pools6, chainId, provider) {
|
|
4666
|
+
if (!pools6.length) {
|
|
4563
4667
|
return [];
|
|
4564
4668
|
}
|
|
4565
|
-
const calls =
|
|
4669
|
+
const calls = pools6.flatMap(({ contractAddress }) => {
|
|
4566
4670
|
return [
|
|
4567
4671
|
{
|
|
4568
4672
|
abi: smartChefABI,
|
|
@@ -4589,7 +4693,7 @@ async function fetchUpgradedPoolsTimeLimits(pools4, chainId, provider) {
|
|
|
4589
4693
|
resultArray[chunkIndex].push(item);
|
|
4590
4694
|
return resultArray;
|
|
4591
4695
|
}, []);
|
|
4592
|
-
return
|
|
4696
|
+
return pools6.map((cakePoolConfig, index) => {
|
|
4593
4697
|
const [startTimestamp, endTimestamp] = startEndResult[index];
|
|
4594
4698
|
return {
|
|
4595
4699
|
sousId: cakePoolConfig.sousId,
|
|
@@ -4598,11 +4702,11 @@ async function fetchUpgradedPoolsTimeLimits(pools4, chainId, provider) {
|
|
|
4598
4702
|
};
|
|
4599
4703
|
});
|
|
4600
4704
|
}
|
|
4601
|
-
var fetchLegacyPoolsBlockLimits = async (
|
|
4602
|
-
if (!
|
|
4705
|
+
var fetchLegacyPoolsBlockLimits = async (pools6, chainId, provider) => {
|
|
4706
|
+
if (!pools6.length) {
|
|
4603
4707
|
return [];
|
|
4604
4708
|
}
|
|
4605
|
-
const startEndBlockCalls =
|
|
4709
|
+
const startEndBlockCalls = pools6.flatMap(({ contractAddress }) => {
|
|
4606
4710
|
return [
|
|
4607
4711
|
{
|
|
4608
4712
|
abi: sousChefABI,
|
|
@@ -4635,7 +4739,7 @@ var fetchLegacyPoolsBlockLimits = async (pools4, chainId, provider) => {
|
|
|
4635
4739
|
const getTimestampFromBlock = (targetBlock) => {
|
|
4636
4740
|
return Number(block.timestamp) + (targetBlock - Number(block.number)) * BSC_BLOCK_TIME;
|
|
4637
4741
|
};
|
|
4638
|
-
return
|
|
4742
|
+
return pools6.map((cakePoolConfig, index) => {
|
|
4639
4743
|
const [startBlock, endBlock] = startEndBlockResult[index];
|
|
4640
4744
|
return {
|
|
4641
4745
|
sousId: cakePoolConfig.sousId,
|