@curvefi/api 2.65.0 → 2.65.2

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/lib/curve.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ethers, Contract, Networkish, BigNumberish, Numeric, BrowserProvider, JsonRpcProvider, Signer } from "ethers";
2
2
  import { Provider as MulticallProvider, Contract as MulticallContract } from "@curvefi/ethcall";
3
- import { IPoolData, IDict, ICurve, INetworkName, IChainId, IFactoryPoolType, Abi } from "./interfaces";
3
+ import { IPoolData, IDict, ICurve, IChainId, IFactoryPoolType, Abi, INetworkConstants } from "./interfaces";
4
4
  export declare const memoizedContract: () => (address: string, abi: any, provider: BrowserProvider | JsonRpcProvider | Signer) => Contract;
5
5
  export declare const memoizedMulticallContract: () => (address: string, abi: any) => MulticallContract;
6
6
  export type ContractItem = {
@@ -32,47 +32,7 @@ declare class Curve implements ICurve {
32
32
  maxPriorityFeePerGas?: number | bigint;
33
33
  };
34
34
  L1WeightedGasPrice?: number;
35
- constants: {
36
- NATIVE_TOKEN: {
37
- symbol: string;
38
- wrappedSymbol: string;
39
- address: string;
40
- wrappedAddress: string;
41
- };
42
- NETWORK_NAME: INetworkName;
43
- ALIASES: IDict<string>;
44
- POOLS_DATA: IDict<IPoolData>;
45
- STABLE_FACTORY_CONSTANTS: {
46
- implementationABIDict?: IDict<any>;
47
- basePoolIdZapDict?: IDict<{
48
- address: string;
49
- ABI: any;
50
- }>;
51
- stableNgBasePoolZap?: string;
52
- };
53
- CRYPTO_FACTORY_CONSTANTS: {
54
- lpTokenBasePoolIdDict?: IDict<string>;
55
- basePoolIdZapDict?: IDict<{
56
- address: string;
57
- ABI: any;
58
- }>;
59
- tricryptoDeployImplementations?: IDict<string | number>;
60
- };
61
- FACTORY_POOLS_DATA: IDict<IPoolData>;
62
- CRVUSD_FACTORY_POOLS_DATA: IDict<IPoolData>;
63
- EYWA_FACTORY_POOLS_DATA: IDict<IPoolData>;
64
- CRYPTO_FACTORY_POOLS_DATA: IDict<IPoolData>;
65
- TWOCRYPTO_FACTORY_POOLS_DATA: IDict<IPoolData>;
66
- TRICRYPTO_FACTORY_POOLS_DATA: IDict<IPoolData>;
67
- STABLE_NG_FACTORY_POOLS_DATA: IDict<IPoolData>;
68
- BASE_POOLS: IDict<number>;
69
- LLAMMAS_DATA: IDict<IPoolData>;
70
- COINS: IDict<string>;
71
- DECIMALS: IDict<number>;
72
- GAUGES: string[];
73
- FACTORY_GAUGE_IMPLEMENTATIONS: IDict<IFactoryPoolType>;
74
- ZERO_ADDRESS: string;
75
- };
35
+ constants: INetworkConstants;
76
36
  constructor();
77
37
  init(providerType: 'JsonRpc' | 'Web3' | 'Infura' | 'Alchemy', providerSettings: {
78
38
  url?: string;
@@ -130,6 +90,7 @@ declare class Curve implements ICurve {
130
90
  formatUnits(value: BigNumberish, unit?: string | Numeric): string;
131
91
  parseUnits(value: string, unit?: string | Numeric): bigint;
132
92
  updateFeeData(): Promise<void>;
93
+ getNetworkConstants: () => INetworkConstants;
133
94
  }
134
95
  export declare const curve: Curve;
135
96
  export {};
package/lib/curve.js CHANGED
@@ -296,6 +296,9 @@ class Curve {
296
296
  };
297
297
  this.getPoolsData = () => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, this.constants.POOLS_DATA), this.constants.FACTORY_POOLS_DATA), this.constants.CRVUSD_FACTORY_POOLS_DATA), this.constants.EYWA_FACTORY_POOLS_DATA), this.constants.CRYPTO_FACTORY_POOLS_DATA), this.constants.STABLE_NG_FACTORY_POOLS_DATA), this.constants.TWOCRYPTO_FACTORY_POOLS_DATA), this.constants.TRICRYPTO_FACTORY_POOLS_DATA), this.constants.LLAMMAS_DATA));
298
298
  this.getGaugeImplementation = (factoryType) => this.constants.FACTORY_GAUGE_IMPLEMENTATIONS[factoryType] || this.constants.ZERO_ADDRESS;
299
+ this.getNetworkConstants = () => {
300
+ return this.constants;
301
+ };
299
302
  // @ts-ignore
300
303
  this.provider = null;
301
304
  // @ts-ignore
package/lib/index.d.ts CHANGED
@@ -63,6 +63,7 @@ declare const curve: {
63
63
  hasDepositAndStake: () => boolean;
64
64
  hasRouter: () => boolean;
65
65
  getCurveLiteNetworks: () => Promise<import("./interfaces.js").ICurveLiteNetwork[]>;
66
+ getNetworkConstants: () => import("./interfaces.js").INetworkConstants;
66
67
  factory: {
67
68
  fetchPools: (useApi?: boolean) => Promise<void>;
68
69
  fetchNewPools: () => Promise<string[]>;
package/lib/index.js CHANGED
@@ -57,6 +57,7 @@ const curve = {
57
57
  hasDepositAndStake,
58
58
  hasRouter,
59
59
  getCurveLiteNetworks,
60
+ getNetworkConstants: _curve.getNetworkConstants,
60
61
  factory: {
61
62
  fetchPools: _curve.fetchFactoryPools,
62
63
  fetchNewPools: _curve.fetchNewFactoryPools,
@@ -47,6 +47,47 @@ export interface IPoolData {
47
47
  is_gauge_killed?: boolean;
48
48
  gauge_status?: Record<string, boolean> | null;
49
49
  }
50
+ export interface INetworkConstants {
51
+ NATIVE_TOKEN: {
52
+ symbol: string;
53
+ wrappedSymbol: string;
54
+ address: string;
55
+ wrappedAddress: string;
56
+ };
57
+ NETWORK_NAME: INetworkName;
58
+ ALIASES: IDict<string>;
59
+ POOLS_DATA: IDict<IPoolData>;
60
+ STABLE_FACTORY_CONSTANTS: {
61
+ implementationABIDict?: IDict<any>;
62
+ basePoolIdZapDict?: IDict<{
63
+ address: string;
64
+ ABI: any;
65
+ }>;
66
+ stableNgBasePoolZap?: string;
67
+ };
68
+ CRYPTO_FACTORY_CONSTANTS: {
69
+ lpTokenBasePoolIdDict?: IDict<string>;
70
+ basePoolIdZapDict?: IDict<{
71
+ address: string;
72
+ ABI: any;
73
+ }>;
74
+ tricryptoDeployImplementations?: IDict<string | number>;
75
+ };
76
+ FACTORY_POOLS_DATA: IDict<IPoolData>;
77
+ STABLE_NG_FACTORY_POOLS_DATA: IDict<IPoolData>;
78
+ CRVUSD_FACTORY_POOLS_DATA: IDict<IPoolData>;
79
+ CRYPTO_FACTORY_POOLS_DATA: IDict<IPoolData>;
80
+ TWOCRYPTO_FACTORY_POOLS_DATA: IDict<IPoolData>;
81
+ TRICRYPTO_FACTORY_POOLS_DATA: IDict<IPoolData>;
82
+ EYWA_FACTORY_POOLS_DATA: IDict<IPoolData>;
83
+ BASE_POOLS: IDict<number>;
84
+ LLAMMAS_DATA: IDict<IPoolData>;
85
+ COINS: IDict<string>;
86
+ DECIMALS: IDict<number>;
87
+ GAUGES: string[];
88
+ FACTORY_GAUGE_IMPLEMENTATIONS: any;
89
+ ZERO_ADDRESS: string;
90
+ }
50
91
  export interface ICurve {
51
92
  provider: ethers.BrowserProvider | ethers.JsonRpcProvider;
52
93
  multicallProvider: MulticallProvider;
@@ -73,42 +114,7 @@ export interface ICurve {
73
114
  maxFeePerGas?: number | bigint;
74
115
  maxPriorityFeePerGas?: number | bigint;
75
116
  };
76
- constants: {
77
- NATIVE_TOKEN: {
78
- symbol: string;
79
- wrappedSymbol: string;
80
- address: string;
81
- wrappedAddress: string;
82
- };
83
- NETWORK_NAME: INetworkName;
84
- ALIASES: IDict<string>;
85
- POOLS_DATA: IDict<IPoolData>;
86
- STABLE_FACTORY_CONSTANTS: {
87
- implementationABIDict?: IDict<any>;
88
- basePoolIdZapDict?: IDict<{
89
- address: string;
90
- ABI: any;
91
- }>;
92
- stableNgBasePoolZap?: string;
93
- };
94
- CRYPTO_FACTORY_CONSTANTS: {
95
- lpTokenBasePoolIdDict?: IDict<string>;
96
- basePoolIdZapDict?: IDict<{
97
- address: string;
98
- ABI: any;
99
- }>;
100
- tricryptoDeployImplementations?: IDict<string | number>;
101
- };
102
- FACTORY_POOLS_DATA: IDict<IPoolData>;
103
- CRVUSD_FACTORY_POOLS_DATA: IDict<IPoolData>;
104
- CRYPTO_FACTORY_POOLS_DATA: IDict<IPoolData>;
105
- TRICRYPTO_FACTORY_POOLS_DATA: IDict<IPoolData>;
106
- BASE_POOLS: IDict<number>;
107
- LLAMMAS_DATA: IDict<IPoolData>;
108
- COINS: IDict<string>;
109
- DECIMALS: IDict<number>;
110
- GAUGES: string[];
111
- };
117
+ constants: INetworkConstants;
112
118
  setContract: (address: string | undefined, abi: any) => void;
113
119
  }
114
120
  export interface ICoinFromPoolDataApi {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.65.0",
3
+ "version": "2.65.2",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",