Skip to content

Commit

Permalink
chore: code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
canhtrinh committed Sep 18, 2023
1 parent 1cbb8e5 commit 8935e56
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 22 deletions.
4 changes: 1 addition & 3 deletions packages/api/src/deposit-address-api/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
type BaseParams = {};

export type GetOTCParams = BaseParams & {
export type GetOTCParams = {
signerAddress?: `0x${string}`;
};

Expand Down
1 change: 0 additions & 1 deletion packages/api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"~/*": ["./src/*"]
},
"types": ["vitest/globals"],
"module": "esnext",
"target": "es2020"
}
}
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export type AxelarConfigAPIUrl = keyof typeof AXELAR_CONFIG_API_URLS;

export const DEPOSIT_ADDRESS_API_URLS = {
testnet: "https://nest-server-testnet.axelar.dev",
mainnet: "https://nest-server-MAINNET.axelar.dev",
mainnet: "https://nest-server-mainnet.axelar.dev",
} as const;

export type DepositAddressAPIUrl = keyof typeof DEPOSIT_ADDRESS_API_URLS;
24 changes: 9 additions & 15 deletions packages/deposit-address/src/getDepositAddress.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,9 @@ import { createDepositAddressApiNodeClient } from "@axelarjs/api/deposit-address
import { createGMPNodeClient } from "@axelarjs/api/gmp/node";
import { ENVIRONMENTS } from "@axelarjs/core";

import {
getDepositAddress,
GetDepositAddressDependencies,
} from "./getDepositAddress";
import { getDepositAddress } from "./getDepositAddress";

describe("getDepositAddress", () => {
const DEFAULT_DEPOSIT_ADDRESS_DEPENDENCIES: GetDepositAddressDependencies = {
configClient: createAxelarConfigNodeClient(ENVIRONMENTS.testnet),
gmpClient: createGMPNodeClient(ENVIRONMENTS.testnet),
depositAddressClient: createDepositAddressApiNodeClient(
ENVIRONMENTS.testnet
),
axelarscanClient: createAxelarscanNodeClient(ENVIRONMENTS.testnet),
};

test("get deposit address", async () => {
const res = await getDepositAddress(
{
Expand All @@ -29,9 +17,15 @@ describe("getDepositAddress", () => {
module: "evm",
environment: ENVIRONMENTS.testnet,
},
DEFAULT_DEPOSIT_ADDRESS_DEPENDENCIES
{
configClient: createAxelarConfigNodeClient(ENVIRONMENTS.testnet),
gmpClient: createGMPNodeClient(ENVIRONMENTS.testnet),
depositAddressClient: createDepositAddressApiNodeClient(
ENVIRONMENTS.testnet
),
axelarscanClient: createAxelarscanNodeClient(ENVIRONMENTS.testnet),
}
);
console.log(res);
expect(res).toBeTruthy();
});
});
2 changes: 1 addition & 1 deletion packages/deposit-address/src/helpers/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from "./networkAddressHelpers";
export * from "./validation";
export * from "./wallet";
export * from "./account";
export * from "./utils";
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import type {
} from "@axelarjs/api/deposit-address-api/types";

import { SendOptions } from "~/types";
import { createDummyAccount, signOtc } from "./account";
import { isStrEqual, poll } from "./utils";
import { createDummyAccount, signOtc } from "./wallet";

export type ListenerParams = {
sourceChain: string;
Expand Down

0 comments on commit 8935e56

Please sign in to comment.