@pancakeswap/infinity-sdk 1.0.0 → 1.0.1
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/dist/index.js +16 -3
- package/dist/index.mjs +14 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ var v3Sdk = require('@pancakeswap/v3-sdk');
|
|
|
6
6
|
var invariant12 = require('tiny-invariant');
|
|
7
7
|
var swapSdkCore = require('@pancakeswap/swap-sdk-core');
|
|
8
8
|
var BigNumber2 = require('bignumber.js');
|
|
9
|
-
var cacheByMem = require('@pancakeswap/utils/cacheByMem');
|
|
10
9
|
|
|
11
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
11
|
|
|
@@ -7145,7 +7144,21 @@ var getCLPool = ({
|
|
|
7145
7144
|
})
|
|
7146
7145
|
};
|
|
7147
7146
|
};
|
|
7148
|
-
|
|
7147
|
+
function cacheByMem(fn) {
|
|
7148
|
+
const cache = /* @__PURE__ */ new Map();
|
|
7149
|
+
return (...args) => {
|
|
7150
|
+
const key = viem.stringify(args);
|
|
7151
|
+
if (cache.has(key)) {
|
|
7152
|
+
return cache.get(key);
|
|
7153
|
+
}
|
|
7154
|
+
const result = fn(...args);
|
|
7155
|
+
cache.set(key, result);
|
|
7156
|
+
return result;
|
|
7157
|
+
};
|
|
7158
|
+
}
|
|
7159
|
+
|
|
7160
|
+
// src/functions/hooks/isDynamicFeeHook.ts
|
|
7161
|
+
var isDynamicFeeHook = cacheByMem((chainId, hook) => {
|
|
7149
7162
|
if (!hook)
|
|
7150
7163
|
return false;
|
|
7151
7164
|
const relatedHook = findHook(hook, chainId);
|
|
@@ -7154,7 +7167,7 @@ var isDynamicFeeHook = cacheByMem.cacheByMem((chainId, hook) => {
|
|
|
7154
7167
|
}
|
|
7155
7168
|
return false;
|
|
7156
7169
|
});
|
|
7157
|
-
var isDynamicFeeHookForSupportedChains = cacheByMem
|
|
7170
|
+
var isDynamicFeeHookForSupportedChains = cacheByMem((hook) => {
|
|
7158
7171
|
if (!hook)
|
|
7159
7172
|
return false;
|
|
7160
7173
|
for (const chainId of INFINITY_SUPPORTED_CHAINS) {
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,6 @@ export { getInputAmount, getOutputAmount } from '@pancakeswap/v3-sdk';
|
|
|
5
5
|
import invariant12 from 'tiny-invariant';
|
|
6
6
|
import { Percent, sortCurrencies, Price, CurrencyAmount } from '@pancakeswap/swap-sdk-core';
|
|
7
7
|
import BigNumber2, { BigNumber } from 'bignumber.js';
|
|
8
|
-
import { cacheByMem } from '@pancakeswap/utils/cacheByMem';
|
|
9
8
|
|
|
10
9
|
// src/constants/index.ts
|
|
11
10
|
|
|
@@ -7139,6 +7138,20 @@ var getCLPool = ({
|
|
|
7139
7138
|
})
|
|
7140
7139
|
};
|
|
7141
7140
|
};
|
|
7141
|
+
function cacheByMem(fn) {
|
|
7142
|
+
const cache = /* @__PURE__ */ new Map();
|
|
7143
|
+
return (...args) => {
|
|
7144
|
+
const key = stringify(args);
|
|
7145
|
+
if (cache.has(key)) {
|
|
7146
|
+
return cache.get(key);
|
|
7147
|
+
}
|
|
7148
|
+
const result = fn(...args);
|
|
7149
|
+
cache.set(key, result);
|
|
7150
|
+
return result;
|
|
7151
|
+
};
|
|
7152
|
+
}
|
|
7153
|
+
|
|
7154
|
+
// src/functions/hooks/isDynamicFeeHook.ts
|
|
7142
7155
|
var isDynamicFeeHook = cacheByMem((chainId, hook) => {
|
|
7143
7156
|
if (!hook)
|
|
7144
7157
|
return false;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.0.
|
|
7
|
+
"version": "1.0.1",
|
|
8
8
|
"description": "⚒️ An SDK for building applications on top of Pancakeswap Infinity",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist"
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
"bignumber.js": "^9.0.0",
|
|
22
22
|
"tiny-invariant": "^1.3.3",
|
|
23
23
|
"viem": "^2.22.23",
|
|
24
|
-
"@pancakeswap/chains": "0.5.
|
|
24
|
+
"@pancakeswap/chains": "0.5.2",
|
|
25
25
|
"@pancakeswap/swap-sdk-core": "1.4.0",
|
|
26
|
-
"@pancakeswap/v3-sdk": "3.9.
|
|
27
|
-
"@pancakeswap/permit2-sdk": "1.1.
|
|
28
|
-
"@pancakeswap/utils": "6.1.0"
|
|
26
|
+
"@pancakeswap/v3-sdk": "3.9.3",
|
|
27
|
+
"@pancakeswap/permit2-sdk": "1.1.3"
|
|
29
28
|
},
|
|
30
29
|
"devDependencies": {
|
|
31
30
|
"tsup": "^6.7.0",
|
|
32
|
-
"@pancakeswap/swap-sdk-evm": "1.1.
|
|
31
|
+
"@pancakeswap/swap-sdk-evm": "1.1.3",
|
|
32
|
+
"@pancakeswap/utils": "6.1.1"
|
|
33
33
|
},
|
|
34
34
|
"engines": {
|
|
35
35
|
"node": ">=10"
|