Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Sep 6, 2024
1 parent ce2aed4 commit b80fc27
Show file tree
Hide file tree
Showing 14 changed files with 71 additions and 66 deletions.
10 changes: 5 additions & 5 deletions packages/client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import merge from "lodash/merge";

import {
deposit,
evmCall,
evmDeposit,
evmDepositAndCall,
getBalances,
getChainId,
getEndpoint,
Expand All @@ -20,12 +23,9 @@ import {
solanaDeposit,
trackCCTX,
withdraw,
zetachainWithdrawAndCall,
zetachainWithdraw,
zetachainCall,
evmDepositAndCall,
evmCall,
evmDeposit,
zetachainWithdraw,
zetachainWithdrawAndCall,
} from ".";

export interface ZetaChainClientParamsBase {
Expand Down
8 changes: 4 additions & 4 deletions packages/client/src/evmCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { ZetaChainClient } from "./client";
export const evmCall = async function (
this: ZetaChainClient,
args: {
receiver: string;
gatewayEvm: string;
callOnRevert: boolean;
revertAddress: string;
gasPrice: ethers.BigNumber;
gasLimit: number;
gasPrice: ethers.BigNumber;
gatewayEvm: string;
onRevertGasLimit: number;
receiver: string;
revertAddress: string;
revertMessage: string;
types: string;
values: any[];
Expand Down
12 changes: 6 additions & 6 deletions packages/client/src/evmDeposit.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import ERC20_ABI from "@openzeppelin/contracts/build/contracts/ERC20.json";
import { ethers } from "ethers";

import GatewayABI from "./abi/GatewayEVM.sol/GatewayEVM.json";
import { ZetaChainClient } from "./client";
import ERC20_ABI from "@openzeppelin/contracts/build/contracts/ERC20.json";

export const evmDeposit = async function (
this: ZetaChainClient,
args: {
amount: string;
receiver: string;
gatewayEvm: string;
callOnRevert: boolean;
revertAddress: string;
gasPrice: ethers.BigNumber;
erc20: string;
gasLimit: number;
gasPrice: ethers.BigNumber;
gatewayEvm: string;
onRevertGasLimit: number;
receiver: string;
revertAddress: string;
revertMessage: string;
erc20: string;
}
) {
const signer = this.signer;
Expand Down
12 changes: 6 additions & 6 deletions packages/client/src/evmDepositAndCall.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import ERC20_ABI from "@openzeppelin/contracts/build/contracts/ERC20.json";
import { ethers } from "ethers";

import GatewayABI from "./abi/GatewayEVM.sol/GatewayEVM.json";
import { ZetaChainClient } from "./client";
import ERC20_ABI from "@openzeppelin/contracts/build/contracts/ERC20.json";

export const evmDepositAndCall = async function (
this: ZetaChainClient,
args: {
amount: string;
receiver: string;
gatewayEvm: string;
callOnRevert: boolean;
revertAddress: string;
gasPrice: ethers.BigNumber;
erc20: string;
gasLimit: number;
gasPrice: ethers.BigNumber;
gatewayEvm: string;
onRevertGasLimit: number;
receiver: string;
revertAddress: string;
revertMessage: string;
erc20: string;
types: string;
values: any[];
}
Expand Down
10 changes: 5 additions & 5 deletions packages/client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export * from "./client";
export * from "./deposit";
export * from "./evmCall";
export * from "./evmDeposit";
export * from "./evmDepositAndCall";
export * from "./getBalances";
export * from "./getChainId";
export * from "./getEndpoint";
Expand All @@ -14,9 +17,6 @@ export * from "./sendZeta";
export * from "./solanaDeposit";
export * from "./trackCCTX";
export * from "./withdraw";
export * from "./zetachainWithdrawAndCall";
export * from "./zetachainWithdraw";
export * from "./zetachainCall";
export * from "./evmDepositAndCall";
export * from "./evmCall";
export * from "./evmDeposit";
export * from "./zetachainWithdraw";
export * from "./zetachainWithdrawAndCall";
10 changes: 5 additions & 5 deletions packages/client/src/zetachainCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ export const zetachainCall = async function (
this: ZetaChainClient,
args: {
amount: string;
zrc20: string;
receiver: string;
callOnRevert: boolean;
function: string;
types: string;
values: any[];
gasLimit: number;
gasPrice: ethers.BigNumber;
gatewayZetaChain: string;
callOnRevert: boolean;
onRevertGasLimit: number;
receiver: string;
revertAddress: string;
revertMessage: string;
types: string;
values: any[];
zrc20: string;
}
) {
const signer = this.signer;
Expand Down
6 changes: 3 additions & 3 deletions packages/client/src/zetachainWithdraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ export const zetachainWithdraw = async function (
this: ZetaChainClient,
args: {
amount: string;
zrc20: string;
receiver: string;
callOnRevert: boolean;
gasLimit: number;
gasPrice: ethers.BigNumber;
gatewayZetaChain: string;
callOnRevert: boolean;
onRevertGasLimit: number;
receiver: string;
revertAddress: string;
revertMessage: string;
zrc20: string;
}
) {
const signer = this.signer;
Expand Down
10 changes: 5 additions & 5 deletions packages/client/src/zetachainWithdrawAndCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ export const zetachainWithdrawAndCall = async function (
this: ZetaChainClient,
args: {
amount: string;
zrc20: string;
receiver: string;
callOnRevert: boolean;
function: string;
types: string;
values: any[];
gasLimit: number;
gasPrice: ethers.BigNumber;
gatewayZetaChain: string;
callOnRevert: boolean;
onRevertGasLimit: number;
receiver: string;
revertAddress: string;
revertMessage: string;
types: string;
values: any[];
zrc20: string;
}
) {
const signer = this.signer;
Expand Down
9 changes: 5 additions & 4 deletions packages/tasks/src/evmCall.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import { task, types } from "hardhat/config";
import type { HardhatRuntimeEnvironment } from "hardhat/types";

import { ZetaChainClient } from "../../client/src/";

export const evmCall = async (args: any, hre: HardhatRuntimeEnvironment) => {
try {
const [signer] = await hre.ethers.getSigners();
const client = new ZetaChainClient({ network: "testnet", signer });
const tx = await client.evmCall({
receiver: args.receiver,
gatewayEvm: args.gatewayEvm,
callOnRevert: args.callOnRevert,
revertAddress: args.revertAddress,
gasPrice: args.gasPrice,
gasLimit: args.gasLimit,
gasPrice: args.gasPrice,
gatewayEvm: args.gatewayEvm,
onRevertGasLimit: args.onRevertGasLimit,
receiver: args.receiver,
revertAddress: args.revertAddress,
revertMessage: args.revertMessage,
types: args.types,
values: args.values,
Expand Down
11 changes: 6 additions & 5 deletions packages/tasks/src/evmDeposit.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { task, types } from "hardhat/config";
import type { HardhatRuntimeEnvironment } from "hardhat/types";

import { ZetaChainClient } from "../../client/src/";

export const evmDeposit = async (args: any, hre: HardhatRuntimeEnvironment) => {
Expand All @@ -8,15 +9,15 @@ export const evmDeposit = async (args: any, hre: HardhatRuntimeEnvironment) => {
const client = new ZetaChainClient({ network: "testnet", signer });
const tx = await client.evmDeposit({
amount: args.amount,
receiver: args.receiver,
gatewayEvm: args.gatewayEvm,
callOnRevert: args.callOnRevert,
revertAddress: args.revertAddress,
gasPrice: args.gasPrice,
erc20: args.erc20,
gasLimit: args.gasLimit,
gasPrice: args.gasPrice,
gatewayEvm: args.gatewayEvm,
onRevertGasLimit: args.onRevertGasLimit,
receiver: args.receiver,
revertAddress: args.revertAddress,
revertMessage: args.revertMessage,
erc20: args.erc20,
});
if (tx) {
const receipt = await tx.wait();
Expand Down
11 changes: 6 additions & 5 deletions packages/tasks/src/evmDepositAndCall.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { task, types } from "hardhat/config";
import type { HardhatRuntimeEnvironment } from "hardhat/types";

import { ZetaChainClient } from "../../client/src/";

export const evmDepositAndCall = async (
Expand All @@ -11,15 +12,15 @@ export const evmDepositAndCall = async (
const client = new ZetaChainClient({ network: "testnet", signer });
const tx = await client.evmDepositAndCall({
amount: args.amount,
receiver: args.receiver,
gatewayEvm: args.gatewayEvm,
callOnRevert: args.callOnRevert,
revertAddress: args.revertAddress,
gasPrice: args.gasPrice,
erc20: args.erc20,
gasLimit: args.gasLimit,
gasPrice: args.gasPrice,
gatewayEvm: args.gatewayEvm,
onRevertGasLimit: args.onRevertGasLimit,
receiver: args.receiver,
revertAddress: args.revertAddress,
revertMessage: args.revertMessage,
erc20: args.erc20,
types: args.types,
values: args.values,
});
Expand Down
11 changes: 6 additions & 5 deletions packages/tasks/src/zetachainCall.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { task, types } from "hardhat/config";
import type { HardhatRuntimeEnvironment } from "hardhat/types";

import { ZetaChainClient } from "../../client/src/";

export const zetachainCall = async (
Expand All @@ -11,18 +12,18 @@ export const zetachainCall = async (
const client = new ZetaChainClient({ network: "testnet", signer });
const tx = await client.zetachainCall({
amount: args.amount,
zrc20: args.zrc20,
receiver: args.receiver,
callOnRevert: args.callOnRevert,
function: args.function,
types: args.types,
values: args.values,
gasLimit: args.gasLimit,
gasPrice: args.gasPrice,
gatewayZetaChain: args.gatewayZetaChain,
callOnRevert: args.callOnRevert,
onRevertGasLimit: args.onRevertGasLimit,
receiver: args.receiver,
revertAddress: args.revertAddress,
revertMessage: args.revertMessage,
types: args.types,
values: args.values,
zrc20: args.zrc20,
});
const receipt = await tx.wait();
console.log("Transaction hash:", receipt.transactionHash);
Expand Down
7 changes: 4 additions & 3 deletions packages/tasks/src/zetachainWithdraw.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { task, types } from "hardhat/config";
import type { HardhatRuntimeEnvironment } from "hardhat/types";

import { ZetaChainClient } from "../../client/src/";

export const zetachainWithdraw = async (
Expand All @@ -11,15 +12,15 @@ export const zetachainWithdraw = async (
const client = new ZetaChainClient({ network: "testnet", signer });
const tx = await client.zetachainWithdraw({
amount: args.amount,
zrc20: args.zrc20,
receiver: args.receiver,
callOnRevert: args.callOnRevert,
gasLimit: args.gasLimit,
gasPrice: args.gasPrice,
gatewayZetaChain: args.gatewayZetaChain,
callOnRevert: args.callOnRevert,
onRevertGasLimit: args.onRevertGasLimit,
receiver: args.receiver,
revertAddress: args.revertAddress,
revertMessage: args.revertMessage,
zrc20: args.zrc20,
});

const receipt = await tx.wait();
Expand Down
10 changes: 5 additions & 5 deletions packages/tasks/src/zetachainWithdrawAndCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ export const zetachainWithdrawAndCall = async (
const client = new ZetaChainClient({ network: "testnet", signer });
const tx = await client.zetachainWithdrawAndCall({
amount: args.amount,
zrc20: args.zrc20,
receiver: args.receiver,
callOnRevert: args.callOnRevert,
function: args.function,
types: args.types,
values: args.values,
gasLimit: args.gasLimit,
gasPrice: args.gasPrice,
gatewayZetaChain: args.gatewayZetaChain,
callOnRevert: args.callOnRevert,
onRevertGasLimit: args.onRevertGasLimit,
receiver: args.receiver,
revertAddress: args.revertAddress,
revertMessage: args.revertMessage,
types: args.types,
values: args.values,
zrc20: args.zrc20,
});

const receipt = await tx.wait();
Expand Down

0 comments on commit b80fc27

Please sign in to comment.