@curvefi/api 2.69.15 → 2.69.16

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.
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * TwoCrypto pool implementation configurations https://docs.curve.finance/deployments/implementations/#cryptoswap-ng
3
3
  */
4
+ import { IDict } from "../interfaces.js";
4
5
  export type TwoCryptoImplementationIndex = number | string;
5
6
  /**
6
7
  * TwoCrypto implementation indices
@@ -17,9 +18,9 @@ export declare enum TwoCryptoImplementation {
17
18
  */
18
19
  export interface TwoCryptoImplementationInfo {
19
20
  index: TwoCryptoImplementationIndex;
20
- address: string;
21
+ addresses: IDict<string>;
21
22
  description: string;
22
23
  availableInUI: boolean;
23
24
  }
24
25
  export declare const TWOCRYPTO_IMPLEMENTATIONS: TwoCryptoImplementationInfo[];
25
- export declare function getTwoCryptoImplementations(uiOnly?: boolean): TwoCryptoImplementationInfo[];
26
+ export declare function getTwoCryptoImplementations(chainId?: number, uiOnly?: boolean): TwoCryptoImplementationInfo[];
@@ -15,35 +15,51 @@ export var TwoCryptoImplementation;
15
15
  export const TWOCRYPTO_IMPLEMENTATIONS = [
16
16
  {
17
17
  index: TwoCryptoImplementation.DEFAULT,
18
- address: "0x934791f7F391727db92BFF94cd789c4623d14c52",
18
+ addresses: {
19
+ 1: "0x934791f7F391727db92BFF94cd789c4623d14c52",
20
+ },
19
21
  description: "",
20
22
  availableInUI: true,
21
23
  },
22
24
  {
23
25
  index: TwoCryptoImplementation.YB_POOLS_0_PERCENT,
24
- address: "0x82c251317ede0514302EEE1aD48f838a7A6EcE2F",
26
+ addresses: {
27
+ 1: "0x82c251317ede0514302EEE1aD48f838a7A6EcE2F",
28
+ },
25
29
  description: "TwoCrypto (0% DAO fee) — for yb pools",
26
30
  availableInUI: false,
27
31
  },
28
32
  {
29
33
  index: TwoCryptoImplementation.FX_25_PERCENT,
30
- address: "0x3B0df55A2c64Ac7A3ada784eEA0898F0FD3cF17e",
34
+ addresses: {
35
+ 1: "0x3B0df55A2c64Ac7A3ada784eEA0898F0FD3cF17e",
36
+ },
31
37
  description: "TwoCrypto (25% DAO fee) — for FX where the asset issuer will be the main source of LP and donations",
32
38
  availableInUI: false,
33
39
  },
34
40
  {
35
41
  index: TwoCryptoImplementation.FX_REGULAR_50_PERCENT,
36
- address: "0xD1FAeCA80d6FDd1DF4CBcCe4b2551b6Ee63Ae3D6",
42
+ addresses: {
43
+ 1: "0xD1FAeCA80d6FDd1DF4CBcCe4b2551b6Ee63Ae3D6",
44
+ 42161: "0x8c8CD70277b02E24aa9afE3dbAD1Ee10443eff2D",
45
+ },
37
46
  description: "TwoCrypto (50% DAO fee) — for FX / regular pairs (where donations may stream from within Curve protocol)",
38
47
  availableInUI: true,
39
48
  },
40
49
  {
41
50
  index: TwoCryptoImplementation.SETTABLE_ADMIN_FEE,
42
- address: "0xeC1045809e383811Cc74B3D25219e1607A5f32dC",
51
+ addresses: {
52
+ 1: "0xeC1045809e383811Cc74B3D25219e1607A5f32dC",
53
+ },
43
54
  description: "Alternative implementation with settable admin fee for two/tricrypto (default admin fee remains at 50%)",
44
55
  availableInUI: false,
45
56
  },
46
57
  ];
47
- export function getTwoCryptoImplementations(uiOnly = false) {
48
- return uiOnly ? TWOCRYPTO_IMPLEMENTATIONS.filter((impl) => impl.availableInUI) : TWOCRYPTO_IMPLEMENTATIONS;
58
+ export function getTwoCryptoImplementations(chainId, uiOnly = false) {
59
+ let implementations = TWOCRYPTO_IMPLEMENTATIONS;
60
+ if (uiOnly)
61
+ implementations = implementations.filter((impl) => impl.availableInUI);
62
+ if (chainId)
63
+ implementations = implementations.filter((impl) => chainId in impl.addresses);
64
+ return implementations;
49
65
  }
package/lib/index.d.ts CHANGED
@@ -2,7 +2,6 @@ import { ethers } from "ethers";
2
2
  import { PoolTemplate } from "./pools/index.js";
3
3
  import { getSupportedNetworks } from "./bridge.js";
4
4
  import { deployCryptoPoolEstimateGas, deployTwocryptoPoolEstimateGas } from './factory/deploy.js';
5
- import { getTwoCryptoImplementations } from './constants/twoCryptoImplementations.js';
6
5
  export declare const createCurve: () => {
7
6
  init: (this: ReturnType<typeof createCurve>, providerType: "JsonRpc" | "Web3" | "Infura" | "Alchemy" | "NoRPC", providerSettings: "NoRPC" | {
8
7
  url?: string;
@@ -157,7 +156,7 @@ export declare const createCurve: () => {
157
156
  getDeployedGaugeMirrorAddressByTx: (tx: ethers.ContractTransactionResponse) => Promise<string>;
158
157
  fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
159
158
  gaugeImplementation: () => string;
160
- getImplementations: typeof getTwoCryptoImplementations;
159
+ getImplementations: (uiOnly?: boolean) => import("./constants/twoCryptoImplementations.js").TwoCryptoImplementationInfo[];
161
160
  estimateGas: {
162
161
  deployPool: typeof deployTwocryptoPoolEstimateGas;
163
162
  deployGauge: (poolAddress: string) => Promise<number>;
@@ -491,7 +490,7 @@ declare const _default: {
491
490
  getDeployedGaugeMirrorAddressByTx: (tx: ethers.ContractTransactionResponse) => Promise<string>;
492
491
  fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
493
492
  gaugeImplementation: () => string;
494
- getImplementations: typeof getTwoCryptoImplementations;
493
+ getImplementations: (uiOnly?: boolean) => import("./constants/twoCryptoImplementations.js").TwoCryptoImplementationInfo[];
495
494
  estimateGas: {
496
495
  deployPool: typeof deployTwocryptoPoolEstimateGas;
497
496
  deployGauge: (poolAddress: string) => Promise<number>;
package/lib/index.js CHANGED
@@ -148,7 +148,7 @@ export const createCurve = () => {
148
148
  getDeployedGaugeMirrorAddressByTx: getDeployedGaugeMirrorAddressByTx.bind(_curve),
149
149
  fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedTwocryptoFactoryPool.bind(_curve),
150
150
  gaugeImplementation: () => _curve.getGaugeImplementation("factory-twocrypto"),
151
- getImplementations: getTwoCryptoImplementations,
151
+ getImplementations: (uiOnly) => getTwoCryptoImplementations(_curve.chainId, uiOnly),
152
152
  estimateGas: {
153
153
  deployPool: deployTwocryptoPoolEstimateGas, //
154
154
  deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeEstimateGas.call(_curve, poolAddress, _curve.constants.ALIASES.twocrypto_factory); }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.69.15",
3
+ "version": "2.69.16",
4
4
  "description": "JavaScript library for curve.finance",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",