Skip to content

Commit 5caeda2

Browse files
committed
chore: use explicit ethersproject deps
1 parent 8e8ede4 commit 5caeda2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+155
-138
lines changed

bun.lock

Lines changed: 14 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/GTDOrder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import { Wallet } from "@ethersproject/wallet";
12
import { config as dotenvConfig } from "dotenv";
2-
import { ethers } from "ethers";
33
import { resolve } from "path";
44

55
import { type ApiKeyCreds, Chain, ClobClient, OrderType, Side } from "../src";
66

77
dotenvConfig({ path: resolve(__dirname, "../.env") });
88

99
async function main() {
10-
const wallet = new ethers.Wallet(`${process.env.PK}`);
10+
const wallet = new Wallet(`${process.env.PK}`);
1111
const chainId = parseInt(`${process.env.CHAIN_ID || Chain.AMOY}`) as Chain;
1212
console.log(`Address: ${await wallet.getAddress()}, chainId: ${chainId}`);
1313

examples/approveAllowances.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
import { BigNumber } from "@ethersproject/bignumber";
2+
import * as constants from "@ethersproject/constants";
3+
import { Contract } from "@ethersproject/contracts";
4+
import { JsonRpcProvider } from "@ethersproject/providers";
5+
import { Wallet } from "@ethersproject/wallet";
16
import { config as dotenvConfig } from "dotenv";
2-
import { BigNumber, constants, ethers } from "ethers";
37
import { resolve } from "path";
48

59
import { Chain } from "../src";
@@ -9,7 +13,7 @@ import { usdcAbi } from "./abi/usdcAbi";
913

1014
dotenvConfig({ path: resolve(__dirname, "../.env") });
1115

12-
export function getWallet(mainnetQ: boolean): ethers.Wallet {
16+
export function getWallet(mainnetQ: boolean): Wallet {
1317
const pk = process.env.PK as string;
1418
const rpcToken: string = process.env.RPC_TOKEN as string;
1519
let rpcUrl = "";
@@ -18,22 +22,22 @@ export function getWallet(mainnetQ: boolean): ethers.Wallet {
1822
} else {
1923
rpcUrl = `https://polygon-amoy.g.alchemy.com/v2/${rpcToken}`;
2024
}
21-
const provider = new ethers.providers.JsonRpcProvider(rpcUrl);
22-
let wallet = new ethers.Wallet(pk);
25+
const provider = new JsonRpcProvider(rpcUrl);
26+
let wallet = new Wallet(pk);
2327
wallet = wallet.connect(provider);
2428
return wallet;
2529
}
2630

27-
export function getUsdcContract(mainnetQ: boolean, wallet: ethers.Wallet): ethers.Contract {
31+
export function getUsdcContract(mainnetQ: boolean, wallet: Wallet): Contract {
2832
const chainId = mainnetQ ? 137 : 80002;
2933
const contractConfig = getContractConfig(chainId);
30-
return new ethers.Contract(contractConfig.collateral, usdcAbi, wallet);
34+
return new Contract(contractConfig.collateral, usdcAbi, wallet);
3135
}
3236

33-
export function getCtfContract(mainnetQ: boolean, wallet: ethers.Wallet): ethers.Contract {
37+
export function getCtfContract(mainnetQ: boolean, wallet: Wallet): Contract {
3438
const chainId = mainnetQ ? 137 : 80002;
3539
const contractConfig = getContractConfig(chainId);
36-
return new ethers.Contract(contractConfig.conditionalTokens, ctfAbi, wallet);
40+
return new Contract(contractConfig.conditionalTokens, ctfAbi, wallet);
3741
}
3842

3943
async function main() {

examples/approveNegRiskAllowances.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
import { BigNumber } from "@ethersproject/bignumber";
2+
import * as constants from "@ethersproject/constants";
3+
import { Contract } from "@ethersproject/contracts";
4+
import { JsonRpcProvider } from "@ethersproject/providers";
5+
import { Wallet } from "@ethersproject/wallet";
16
import { config as dotenvConfig } from "dotenv";
2-
import { BigNumber, constants, ethers } from "ethers";
37
import { resolve } from "path";
48

59
import { Chain } from "../src";
@@ -14,7 +18,7 @@ dotenvConfig({ path: resolve(__dirname, "../.env") });
1418
* for the NegRiskCtfExchange and the NegRiskAdapter.
1519
*/
1620

17-
export function getWallet(mainnetQ: boolean): ethers.Wallet {
21+
export function getWallet(mainnetQ: boolean): Wallet {
1822
const pk = process.env.PK as string;
1923
const rpcToken: string = process.env.RPC_TOKEN as string;
2024
let rpcUrl = "";
@@ -23,22 +27,22 @@ export function getWallet(mainnetQ: boolean): ethers.Wallet {
2327
} else {
2428
rpcUrl = `https://polygon-amoy.g.alchemy.com/v2/${rpcToken}`;
2529
}
26-
const provider = new ethers.providers.JsonRpcProvider(rpcUrl);
27-
let wallet = new ethers.Wallet(pk);
30+
const provider = new JsonRpcProvider(rpcUrl);
31+
let wallet = new Wallet(pk);
2832
wallet = wallet.connect(provider);
2933
return wallet;
3034
}
3135

32-
export function getUsdcContract(mainnetQ: boolean, wallet: ethers.Wallet): ethers.Contract {
36+
export function getUsdcContract(mainnetQ: boolean, wallet: Wallet): Contract {
3337
const chainId = mainnetQ ? 137 : 80002;
3438
const contractConfig = getContractConfig(chainId);
35-
return new ethers.Contract(contractConfig.collateral, usdcAbi, wallet);
39+
return new Contract(contractConfig.collateral, usdcAbi, wallet);
3640
}
3741

38-
export function getCtfContract(mainnetQ: boolean, wallet: ethers.Wallet): ethers.Contract {
42+
export function getCtfContract(mainnetQ: boolean, wallet: Wallet): Contract {
3943
const chainId = mainnetQ ? 137 : 80002;
4044
const contractConfig = getContractConfig(chainId);
41-
return new ethers.Contract(contractConfig.conditionalTokens, ctfAbi, wallet);
45+
return new Contract(contractConfig.conditionalTokens, ctfAbi, wallet);
4246
}
4347

4448
async function main() {

examples/areOrdersScoring.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import { Wallet } from "@ethersproject/wallet";
12
import { config as dotenvConfig } from "dotenv";
2-
import { ethers } from "ethers";
33
import { resolve } from "path";
44

55
import { type ApiKeyCreds, Chain, ClobClient } from "../src";
66

77
dotenvConfig({ path: resolve(__dirname, "../.env") });
88

99
async function main() {
10-
const wallet = new ethers.Wallet(`${process.env.PK}`);
10+
const wallet = new Wallet(`${process.env.PK}`);
1111
const chainId = parseInt(`${process.env.CHAIN_ID || Chain.AMOY}`) as Chain;
1212
console.log(`Address: ${await wallet.getAddress()}, chainId: ${chainId}`);
1313

examples/cancelAll.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import { Wallet } from "@ethersproject/wallet";
12
import { config as dotenvConfig } from "dotenv";
2-
import { ethers } from "ethers";
33
import { resolve } from "path";
44

55
import { type ApiKeyCreds, Chain, ClobClient } from "../src";
66

77
dotenvConfig({ path: resolve(__dirname, "../.env") });
88

99
async function main() {
10-
const wallet = new ethers.Wallet(`${process.env.PK}`);
10+
const wallet = new Wallet(`${process.env.PK}`);
1111
const chainId = parseInt(`${process.env.CHAIN_ID || Chain.AMOY}`) as Chain;
1212
console.log(`Address: ${await wallet.getAddress()}, chainId: ${chainId}`);
1313

examples/cancelMarketOrders.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import { Wallet } from "@ethersproject/wallet";
12
import { config as dotenvConfig } from "dotenv";
2-
import { ethers } from "ethers";
33
import { resolve } from "path";
44

55
import { type ApiKeyCreds, Chain, ClobClient } from "../src";
66

77
dotenvConfig({ path: resolve(__dirname, "../.env") });
88

99
async function main() {
10-
const wallet = new ethers.Wallet(`${process.env.PK}`);
10+
const wallet = new Wallet(`${process.env.PK}`);
1111
const chainId = parseInt(`${process.env.CHAIN_ID || Chain.AMOY}`) as Chain;
1212
console.log(`Address: ${await wallet.getAddress()}, chainId: ${chainId}`);
1313

examples/cancelOrder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import { Wallet } from "@ethersproject/wallet";
12
import { config as dotenvConfig } from "dotenv";
2-
import { ethers } from "ethers";
33
import { resolve } from "path";
44

55
import { type ApiKeyCreds, Chain, ClobClient } from "../src";
66

77
dotenvConfig({ path: resolve(__dirname, "../.env") });
88

99
async function main() {
10-
const wallet = new ethers.Wallet(`${process.env.PK}`);
10+
const wallet = new Wallet(`${process.env.PK}`);
1111
const chainId = parseInt(`${process.env.CHAIN_ID || Chain.AMOY}`) as Chain;
1212
console.log(`Address: ${await wallet.getAddress()}, chainId: ${chainId}`);
1313

examples/cancelOrders.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import { Wallet } from "@ethersproject/wallet";
12
import { config as dotenvConfig } from "dotenv";
2-
import { ethers } from "ethers";
33
import { resolve } from "path";
44

55
import { type ApiKeyCreds, Chain, ClobClient } from "../src";
66

77
dotenvConfig({ path: resolve(__dirname, "../.env") });
88

99
async function main() {
10-
const wallet = new ethers.Wallet(`${process.env.PK}`);
10+
const wallet = new Wallet(`${process.env.PK}`);
1111
const chainId = parseInt(`${process.env.CHAIN_ID || Chain.AMOY}`) as Chain;
1212
console.log(`Address: ${await wallet.getAddress()}, chainId: ${chainId}`);
1313

examples/createApiKey.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import { Wallet } from "@ethersproject/wallet";
12
import { config as dotenvConfig } from "dotenv";
2-
import { ethers } from "ethers";
33
import { resolve } from "path";
44

55
import { Chain, ClobClient } from "../src";
66

77
dotenvConfig({ path: resolve(__dirname, "../.env") });
88

99
async function main() {
10-
const wallet = new ethers.Wallet(`${process.env.PK}`);
10+
const wallet = new Wallet(`${process.env.PK}`);
1111
const chainId = parseInt(`${process.env.CHAIN_ID || Chain.AMOY}`) as Chain;
1212
console.log(`Address: ${await wallet.getAddress()}, chainId: ${chainId}`);
1313

0 commit comments

Comments
 (0)