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" ;
16import { config as dotenvConfig } from "dotenv" ;
2- import { BigNumber , constants , ethers } from "ethers" ;
37import { resolve } from "path" ;
48
59import { 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
4448async function main ( ) {
0 commit comments