@pancakeswap/pools 4.0.9 → 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 (63) 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/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/56.d.ts.map +1 -1
  8. package/dist/constants/pools/59140.d.ts +5 -0
  9. package/dist/constants/pools/59140.d.ts.map +1 -0
  10. package/dist/constants/pools/59144.d.ts +5 -0
  11. package/dist/constants/pools/59144.d.ts.map +1 -0
  12. package/dist/constants/pools/8453.d.ts +5 -0
  13. package/dist/constants/pools/8453.d.ts.map +1 -0
  14. package/dist/constants/pools/84531.d.ts +5 -0
  15. package/dist/constants/pools/84531.d.ts.map +1 -0
  16. package/dist/constants/pools/index.d.ts +2 -2
  17. package/dist/constants/pools/index.d.ts.map +1 -1
  18. package/dist/constants/supportedChains.d.ts +1 -1
  19. package/dist/constants/supportedChains.d.ts.map +1 -1
  20. package/dist/index.js +208 -16
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +209 -17
  23. package/dist/index.mjs.map +1 -1
  24. package/package.json +6 -3
  25. package/.turbo/turbo-build.log +0 -18
  26. package/CHANGELOG.md +0 -140
  27. package/src/abis/ICake.ts +0 -59
  28. package/src/abis/ICakeFlexibleSideVaultV2.ts +0 -487
  29. package/src/abis/ICakeVaultV2.ts +0 -487
  30. package/src/abis/ISmartChef.ts +0 -326
  31. package/src/abis/ISousChef.ts +0 -122
  32. package/src/abis/ISousChefBNB.ts +0 -166
  33. package/src/abis/ISousChefV2.ts +0 -341
  34. package/src/abis/ISousChefV3.ts +0 -326
  35. package/src/constants/contracts.ts +0 -38
  36. package/src/constants/index.ts +0 -10
  37. package/src/constants/pools/1.ts +0 -80
  38. package/src/constants/pools/280.ts +0 -53
  39. package/src/constants/pools/324.ts +0 -26
  40. package/src/constants/pools/42161.ts +0 -26
  41. package/src/constants/pools/421613.ts +0 -69
  42. package/src/constants/pools/56.ts +0 -2951
  43. package/src/constants/pools/97.ts +0 -74
  44. package/src/constants/pools/index.ts +0 -56
  45. package/src/constants/supportedChains.ts +0 -13
  46. package/src/index.ts +0 -14
  47. package/src/queries/fetchPools.ts +0 -350
  48. package/src/queries/fetchUserIfo.ts +0 -53
  49. package/src/queries/fetchUserPoolsData.ts +0 -143
  50. package/src/queries/fetchVaultPublic.ts +0 -175
  51. package/src/queries/fetchVaultUser.ts +0 -106
  52. package/src/queries/getAddresses.ts +0 -12
  53. package/src/queries/index.ts +0 -6
  54. package/src/types.ts +0 -207
  55. package/src/utils/apr.ts +0 -35
  56. package/src/utils/getContractAddress.ts +0 -11
  57. package/src/utils/getPoolContractBySousId.ts +0 -111
  58. package/src/utils/index.ts +0 -5
  59. package/src/utils/isLegacyPool.ts +0 -15
  60. package/src/utils/isPoolsSupported.ts +0 -5
  61. package/tsconfig.json +0 -14
  62. package/tsup.config.ts +0 -26
  63. package/vitest.config.ts +0 -9
@@ -1,111 +0,0 @@
1
- import { ChainId } from '@pancakeswap/sdk'
2
- import { WalletClient, getContract, PublicClient, Address, GetContractReturnType, Account, Chain } from 'viem'
3
-
4
- import { getPoolsConfig } from '../constants'
5
- import { isLegacyPool } from './isLegacyPool'
6
- import { smartChefABI } from '../abis/ISmartChef'
7
- import { PoolCategory } from '../types'
8
- import { sousChefV2ABI } from '../abis/ISousChefV2'
9
- import { sousChefBnbABI } from '../abis/ISousChefBNB'
10
-
11
- interface Params {
12
- chainId?: ChainId
13
- sousId: number
14
- signer?: any
15
- publicClient?: any
16
- }
17
-
18
- type GetContractReturnType_<TAbi extends readonly unknown[]> = GetContractReturnType<TAbi, any, any> & {
19
- abi: TAbi
20
- address: Address
21
- account?: Account
22
- chain?: Chain
23
- }
24
-
25
- export function getSousChefBNBContract({
26
- address,
27
- signer,
28
- publicClient,
29
- }: {
30
- address: Address
31
- signer?: WalletClient
32
- publicClient?: PublicClient
33
- }): GetContractReturnType_<typeof sousChefBnbABI> {
34
- return {
35
- ...getContract({
36
- abi: sousChefBnbABI,
37
- address,
38
- walletClient: signer,
39
- publicClient,
40
- }),
41
- abi: sousChefBnbABI,
42
- address,
43
- account: signer?.account,
44
- chain: signer?.chain,
45
- }
46
- }
47
-
48
- export function getSousChefV2Contract({
49
- address,
50
- signer,
51
- publicClient,
52
- }: {
53
- address: Address
54
- signer?: WalletClient
55
- publicClient?: PublicClient
56
- }): GetContractReturnType_<typeof sousChefV2ABI> {
57
- return {
58
- ...getContract({
59
- abi: sousChefV2ABI,
60
- address,
61
- walletClient: signer,
62
- publicClient,
63
- }),
64
- abi: sousChefV2ABI,
65
- address,
66
- account: signer?.account,
67
- chain: signer?.chain,
68
- }
69
- }
70
-
71
- export function getSmartChefChefV2Contract({
72
- address,
73
- signer,
74
- publicClient,
75
- }: {
76
- address: Address
77
- signer?: WalletClient
78
- publicClient?: PublicClient
79
- }): GetContractReturnType_<typeof smartChefABI> {
80
- return {
81
- ...getContract({
82
- abi: smartChefABI,
83
- address,
84
- walletClient: signer,
85
- publicClient,
86
- }),
87
- abi: smartChefABI,
88
- address,
89
- account: signer?.account,
90
- chain: signer?.chain,
91
- }
92
- }
93
-
94
- export function getPoolContractBySousId({ chainId, sousId, signer, publicClient }: Params): any | null {
95
- if (!chainId) {
96
- return null
97
- }
98
- const pools = getPoolsConfig(chainId)
99
- const pool = pools?.find((p) => p.sousId === Number(sousId))
100
- if (!pool) {
101
- return null
102
- }
103
- const { contractAddress } = pool
104
- if (isLegacyPool(pool)) {
105
- if (pool.poolCategory === PoolCategory.BINANCE) {
106
- return getSousChefBNBContract({ address: contractAddress, signer, publicClient })
107
- }
108
- return getSousChefV2Contract({ address: contractAddress, signer, publicClient })
109
- }
110
- return getSmartChefChefV2Contract({ address: contractAddress, signer, publicClient })
111
- }
@@ -1,5 +0,0 @@
1
- export * from './getContractAddress'
2
- export * from './isPoolsSupported'
3
- export * from './isLegacyPool'
4
- export * from './apr'
5
- export * from './getPoolContractBySousId'
@@ -1,15 +0,0 @@
1
- import { LegacySerializedPool, SerializedPool, UpgradedSerializedPool } from '../types'
2
-
3
- export function isLegacyPool(pool: SerializedPool): pool is LegacySerializedPool {
4
- if ((pool as any).tokenPerBlock) {
5
- return true
6
- }
7
- return false
8
- }
9
-
10
- export function isUpgradedPool(pool: SerializedPool): pool is UpgradedSerializedPool {
11
- if ((pool as any).tokenPerSecond) {
12
- return true
13
- }
14
- return false
15
- }
@@ -1,5 +0,0 @@
1
- import { SupportedChainId, SUPPORTED_CHAIN_IDS } from '../constants/supportedChains'
2
-
3
- export function isPoolsSupported(chainId: number): chainId is SupportedChainId {
4
- return SUPPORTED_CHAIN_IDS.includes(chainId)
5
- }
package/tsconfig.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "extends": "@pancakeswap/tsconfig/base",
3
- "include": ["./src"],
4
- "exclude": ["**/*.test.ts", "./dist/**"],
5
- "compilerOptions": {
6
- "rootDir": "./src",
7
- "outDir": "./dist",
8
- "target": "es2020",
9
- "esModuleInterop": true,
10
- "resolveJsonModule": true,
11
- "isolatedModules": true,
12
- "skipLibCheck": true
13
- }
14
- }
package/tsup.config.ts DELETED
@@ -1,26 +0,0 @@
1
- import { defineConfig } from 'tsup'
2
- import { exec } from 'child_process'
3
-
4
- export default defineConfig((options) => ({
5
- entry: {
6
- index: './src/index.ts',
7
- },
8
- sourcemap: true,
9
- noExternal: ['@pancakeswap/utils'],
10
- skipNodeModulesBundle: true,
11
- format: ['esm', 'cjs'],
12
- dts: false,
13
- clean: !options.watch,
14
- treeshake: true,
15
- splitting: true,
16
- onSuccess: async () => {
17
- exec('tsc --emitDeclarationOnly --declaration', (err, stdout) => {
18
- if (err) {
19
- console.error(stdout)
20
- if (!options.watch) {
21
- process.exit(1)
22
- }
23
- }
24
- })
25
- },
26
- }))
package/vitest.config.ts DELETED
@@ -1,9 +0,0 @@
1
- import { defineConfig } from 'vitest/config'
2
-
3
- export default defineConfig({
4
- test: {
5
- environment: 'node',
6
- globals: true,
7
- passWithNoTests: true,
8
- },
9
- })