Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: json type asserts #442

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@curvefi/api",
"version": "2.66.1",
"version": "2.66.2",
"description": "JavaScript library for curve.fi",
"main": "lib/index.js",
"author": "Macket",
Expand Down
12 changes: 6 additions & 6 deletions src/curve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import gaugeControllerABI from './constants/abis/gaugecontroller.json' with { type: 'json' };
import depositAndStakeABI from './constants/abis/deposit_and_stake.json' with { type: 'json' };
import depositAndStakeNgOnlyABI from './constants/abis/deposit_and_stake_ng_only.json' with { type: 'json' };
import cryptoCalcZapABI from './constants/abis/crypto_calc.json' assert { type: 'json'};
import cryptoCalcZapABI from './constants/abis/crypto_calc.json' with { type: 'json' };
import StableCalcZapABI from './constants/abis/stable_calc.json' with { type: 'json' };
import routerABI from './constants/abis/router.json' with { type: 'json' };
import routerPolygonABI from './constants/abis/routerPolygon.json' with { type: 'json' };
Expand All @@ -45,11 +45,11 @@
import tricryptoFactoryMainnetABI from './constants/abis/factory-tricrypto-mainnet.json' with { type: 'json' };
import tricryptoFactorySidechainABI from './constants/abis/factory-tricrypto-sidechain.json' with { type: 'json' };
import stableNgFactoryABI from './constants/abis/factory-stable-ng.json' with { type: 'json' };
import gasOracleABI from './constants/abis/gas_oracle_optimism.json' assert { type: 'json'};
import gasOracleBlobABI from './constants/abis/gas_oracle_optimism_blob.json' assert { type: 'json'};
import votingProposalABI from './constants/abis/voting_proposal.json' assert { type: 'json'};
import circulatingSupplyABI from './constants/abis/circulating_supply.json' assert { type: 'json'};
import rootGaugeFactoryABI from "./constants/abis/gauge_factory/root_gauge_factory.json" assert { type: 'json'};
import gasOracleABI from './constants/abis/gas_oracle_optimism.json' with { type: 'json' };
import gasOracleBlobABI from './constants/abis/gas_oracle_optimism_blob.json' with { type: 'json' };
import votingProposalABI from './constants/abis/voting_proposal.json' with { type: 'json' };
import circulatingSupplyABI from './constants/abis/circulating_supply.json' with { type: 'json' };
import rootGaugeFactoryABI from "./constants/abis/gauge_factory/root_gauge_factory.json" with { type: 'json' };

import { lowerCasePoolDataAddresses, extractDecimals, extractGauges } from "./constants/utils.js";
import {_getHiddenPools} from "./external-api.js";
Expand Down Expand Up @@ -209,7 +209,7 @@
} else if (!providerSettings.url?.startsWith("https://rpc.gnosischain.com")) {
try {
this.signer = await this.provider.getSigner();
} catch (e) {

Check warning on line 212 in src/curve.ts

View workflow job for this annotation

GitHub Actions / test

'e' is defined but never used
this.signer = null;
}
}
Expand Down Expand Up @@ -286,7 +286,7 @@
if (this.signer) {
try {
this.signerAddress = await this.signer.getAddress();
} catch (err) {

Check warning on line 289 in src/curve.ts

View workflow job for this annotation

GitHub Actions / test

'err' is defined but never used
this.signer = null;
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/factory/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { curve } from "../curve.js";
import {IDict, IPoolData, ICurve, REFERENCE_ASSET, IPoolDataShort} from "../interfaces";
import ERC20ABI from "../constants/abis/ERC20.json" with { type: 'json' };
import PlainStableSwapNGABI from "../constants/abis/factory-stable-ng/plain-stableswap-ng.json" with { type: 'json' };
import MetaStableSwapNGABI from "../constants/abis/factory-stable-ng/meta-stableswap-ng.json" assert {type: 'json'};
import MetaStableSwapNGABI from "../constants/abis/factory-stable-ng/meta-stableswap-ng.json" with { type: 'json' };
import factoryGaugeABI from "../constants/abis/gauge_factory.json" with { type: 'json' };
import gaugeChildABI from "../constants/abis/gauge_child.json" with { type: 'json' };
import StableNgBasePoolZapABI from "../constants/abis/stable-ng-base-pool-zap.json" with { type: 'json' };
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
_getSubgraphData,
_getVolumes,
} from "./external-api.js";
import ERC20Abi from './constants/abis/ERC20.json' assert {type: 'json'};
import ERC20Abi from './constants/abis/ERC20.json' with { type: 'json' };
import {L2Networks} from './constants/L2Networks.js';
import {volumeNetworks} from "./constants/volumeNetworks.js";
import {getPool} from "./pools/index.js";
Expand Down
Loading