@curvefi/api 2.66.0 → 2.66.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/lib/curve.d.ts +1 -8
- package/lib/curve.js +4 -6
- package/lib/index.d.ts +2 -2
- package/package.json +1 -1
package/lib/curve.d.ts
CHANGED
|
@@ -11,10 +11,6 @@ export type ContractItem = {
|
|
|
11
11
|
};
|
|
12
12
|
declare class Curve implements ICurve {
|
|
13
13
|
provider: ethers.BrowserProvider | ethers.JsonRpcProvider;
|
|
14
|
-
chainOptions?: {
|
|
15
|
-
chainId: number;
|
|
16
|
-
name: string;
|
|
17
|
-
};
|
|
18
14
|
isNoRPC: boolean;
|
|
19
15
|
multicallProvider: MulticallProvider;
|
|
20
16
|
signer: ethers.Signer | null;
|
|
@@ -49,10 +45,7 @@ declare class Curve implements ICurve {
|
|
|
49
45
|
} | {
|
|
50
46
|
network?: Networkish;
|
|
51
47
|
apiKey?: string;
|
|
52
|
-
} | {
|
|
53
|
-
chainId: number;
|
|
54
|
-
networkName: string;
|
|
55
|
-
}, options?: {
|
|
48
|
+
} | 'NoRPC', options?: {
|
|
56
49
|
gasPrice?: number;
|
|
57
50
|
maxFeePerGas?: number;
|
|
58
51
|
maxPriorityFeePerGas?: number;
|
package/lib/curve.js
CHANGED
|
@@ -445,18 +445,16 @@ class Curve {
|
|
|
445
445
|
this.signer = null;
|
|
446
446
|
}
|
|
447
447
|
else if (providerType.toLowerCase() === 'NoRPC'.toLowerCase()) {
|
|
448
|
-
providerSettings = providerSettings;
|
|
449
448
|
this.isNoRPC = true;
|
|
450
|
-
this.chainOptions = {
|
|
451
|
-
chainId: providerSettings.chainId,
|
|
452
|
-
name: providerSettings.networkName,
|
|
453
|
-
};
|
|
454
449
|
this.signer = null;
|
|
450
|
+
if (!options.chainId) {
|
|
451
|
+
throw Error('ChainId is required for NoRPC provider');
|
|
452
|
+
}
|
|
455
453
|
}
|
|
456
454
|
else {
|
|
457
455
|
throw Error('Wrong providerType');
|
|
458
456
|
}
|
|
459
|
-
const network = this.
|
|
457
|
+
const network = this.isNoRPC ? { chainId: options.chainId, name: 'NoRPC' } : yield this.provider.getNetwork();
|
|
460
458
|
console.log("CURVE-JS IS CONNECTED TO NETWORK:", { name: network.name.toUpperCase(), chainId: Number(network.chainId) });
|
|
461
459
|
this.chainId = Number(network.chainId) === 133 || Number(network.chainId) === 31337 ? 1 : Number(network.chainId);
|
|
462
460
|
this.isLiteChain = !(this.chainId in NETWORK_CONSTANTS);
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ethers, Networkish } from "ethers";
|
|
2
2
|
import { PoolTemplate } from "./pools/index.js";
|
|
3
|
-
declare function init(providerType: 'JsonRpc' | 'Web3' | 'Infura' | 'Alchemy', providerSettings: {
|
|
3
|
+
declare function init(providerType: 'JsonRpc' | 'Web3' | 'Infura' | 'Alchemy' | 'NoRPC', providerSettings: {
|
|
4
4
|
url?: string;
|
|
5
5
|
privateKey?: string;
|
|
6
6
|
batchMaxCount?: number;
|
|
@@ -9,7 +9,7 @@ declare function init(providerType: 'JsonRpc' | 'Web3' | 'Infura' | 'Alchemy', p
|
|
|
9
9
|
} | {
|
|
10
10
|
network?: Networkish;
|
|
11
11
|
apiKey?: string;
|
|
12
|
-
}, options?: {
|
|
12
|
+
} | 'NoRPC', options?: {
|
|
13
13
|
gasPrice?: number;
|
|
14
14
|
maxFeePerGas?: number;
|
|
15
15
|
maxPriorityFeePerGas?: number;
|