@curvefi/api 2.68.7 → 2.68.8

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.
@@ -0,0 +1,2 @@
1
+ export declare const YB_POOLS: string[];
2
+ export declare const isYBPool: (poolAddress: string) => boolean;
@@ -0,0 +1,8 @@
1
+ export const YB_POOLS = [
2
+ "0xf1f435b05d255a5dbde37333c0f61da6f69c6127",
3
+ "0xd9ff8396554a0d18b2cfbec53e1979b7ecce8373",
4
+ "0x83f24023d15d835a213df24fd309c47dab5beb32",
5
+ ].map((pool) => pool.toLowerCase());
6
+ export const isYBPool = (poolAddress) => {
7
+ return YB_POOLS.includes(poolAddress.toLowerCase());
8
+ };
@@ -12,6 +12,7 @@ import gaugeChildABI from "../constants/abis/gauge_child.json" with { type: "jso
12
12
  import ERC20ABI from "../constants/abis/ERC20.json" with { type: "json" };
13
13
  import cryptoFactorySwapABI from "../constants/abis/factory-crypto/factory-crypto-pool-2.json" with { type: "json" };
14
14
  import twocryptoFactorySwapABI from "../constants/abis/factory-twocrypto/factory-twocrypto-pool.json" with { type: "json" };
15
+ import ybTwocryptoPoolABI from "../constants/abis/factory-twocrypto/yb-twocrypto-pool.json" with { type: "json" };
15
16
  import tricryptoFactorySwapABI from "../constants/abis/factory-tricrypto/factory-tricrypto-pool.json" with { type: "json" };
16
17
  import tricryptoFactoryEthDisabledSwapABI from "../constants/abis/factory-tricrypto/factory-tricrypto-pool-eth-disabled.json" with { type: "json" };
17
18
  import { getPoolIdByAddress, setFactoryZapContracts } from "./common.js";
@@ -20,6 +21,7 @@ import { assetTypeNameHandler, getPoolName, isStableNgPool } from "../utils.js";
20
21
  import StableNgBasePoolZapABI from "../constants/abis/stable-ng-base-pool-zap.json" with { type: "json" };
21
22
  import MetaStableSwapNGABI from "../constants/abis/factory-stable-ng/meta-stableswap-ng.json" with { type: "json" };
22
23
  import PlainStableSwapNGABI from "../constants/abis/factory-stable-ng/plain-stableswap-ng.json" with { type: "json" };
24
+ import { isYBPool } from "../constants/ybPools.js";
23
25
  export const lowerCasePoolDataAddresses = (poolsData) => {
24
26
  var _a;
25
27
  for (const poolData of poolsData) {
@@ -43,6 +45,9 @@ export const lowerCasePoolDataAddresses = (poolsData) => {
43
45
  function getSwapAbiByFactoryType(factoryType, pool) {
44
46
  var _a;
45
47
  const isETHEnabled = pool.implementationAddress === ((_a = this.constants.CRYPTO_FACTORY_CONSTANTS.tricryptoDeployImplementations) === null || _a === void 0 ? void 0 : _a.amm_native_transfers_enabled);
48
+ if (factoryType === "factory-twocrypto" && isYBPool(pool.address)) {
49
+ return ybTwocryptoPoolABI;
50
+ }
46
51
  const map = {
47
52
  "factory-crypto": cryptoFactorySwapABI,
48
53
  "factory-twocrypto": twocryptoFactorySwapABI,
@@ -9,8 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import ERC20ABI from "../constants/abis/ERC20.json" with { type: "json" };
11
11
  import twocryptoFactorySwapABI from "../constants/abis/factory-twocrypto/factory-twocrypto-pool.json" with { type: "json" };
12
+ import ybTwocryptoPoolABI from "../constants/abis/factory-twocrypto/yb-twocrypto-pool.json" with { type: "json" };
12
13
  import factoryGaugeABI from "../constants/abis/gauge_factory.json" with { type: "json" };
13
14
  import gaugeChildABI from "../constants/abis/gauge_child.json" with { type: "json" };
15
+ import { isYBPool } from "../constants/ybPools.js";
14
16
  const deepFlatten = (arr) => [].concat(...arr.map((v) => (Array.isArray(v) ? deepFlatten(v) : v)));
15
17
  function getRecentlyCreatedCryptoPoolId(swapAddress) {
16
18
  return __awaiter(this, void 0, void 0, function* () {
@@ -84,7 +86,8 @@ function getPoolsData(factorySwapAddresses) {
84
86
  }
85
87
  function setTwocryptoFactorySwapContracts(factorySwapAddresses) {
86
88
  factorySwapAddresses.forEach((addr) => {
87
- this.setContract(addr, twocryptoFactorySwapABI);
89
+ const abi = isYBPool(addr) ? ybTwocryptoPoolABI : twocryptoFactorySwapABI;
90
+ this.setContract(addr, abi);
88
91
  });
89
92
  }
90
93
  function setTwocryptoFactoryGaugeContracts(factoryGaugeAddresses) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.68.7",
3
+ "version": "2.68.8",
4
4
  "description": "JavaScript library for curve.finance",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",