Skip to content

Commit

Permalink
Rename Msgline from Msgport
Browse files Browse the repository at this point in the history
  • Loading branch information
JayJay1024 committed Dec 25, 2023
1 parent 5c8480c commit 8ce4cba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/bridges/xtoken-v3.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BridgeConstructorArgs, GetFeeArgs, Token, TransferOptions } from "@/types";
import { BaseBridge } from ".";
import { Address, Hex, TransactionReceipt, encodeFunctionData } from "viem";
import { fetchMsgportFeeAndParams } from "@/utils";
import { Address, TransactionReceipt, encodeFunctionData } from "viem";
import { fetchMsglineFeeAndParams } from "@/utils";

export class XTokenV3Bridge extends BaseBridge {
constructor(args: BridgeConstructorArgs) {
Expand All @@ -28,7 +28,7 @@ export class XTokenV3Bridge extends BaseBridge {
amount: bigint,
options?: TransferOptions & { askEstimateGas?: boolean },
): Promise<bigint | TransactionReceipt | undefined> {
const feeAndParams = await this._getMsgportFeeAndParams(sender, recipient, amount);
const feeAndParams = await this._getMsglineFeeAndParams(sender, recipient, amount);
const account = await this.getSigner();

if (
Expand Down Expand Up @@ -81,7 +81,7 @@ export class XTokenV3Bridge extends BaseBridge {
return;
}

private async _getMsgportFeeAndParams(sender: Address, recipient: Address, amount: bigint) {
private async _getMsglineFeeAndParams(sender: Address, recipient: Address, amount: bigint) {
const sourceMessager = this.sourceChain?.messager?.msgline;
const targetMessager = this.targetChain?.messager?.msgline;

Expand Down Expand Up @@ -112,7 +112,7 @@ export class XTokenV3Bridge extends BaseBridge {
args: [BigInt(this.sourceChain.id), sourceMessager, targetMessager, message],
});

return fetchMsgportFeeAndParams(
return fetchMsglineFeeAndParams(
this.sourceChain.id,
this.targetChain.id,
sourceMessager,
Expand All @@ -127,7 +127,7 @@ export class XTokenV3Bridge extends BaseBridge {
if (this.sourceNativeToken) {
const sender = args?.sender ?? "0x0000000000000000000000000000000000000000";
const recipient = args?.recipient ?? "0x0000000000000000000000000000000000000000";
const feeAndParams = await this._getMsgportFeeAndParams(sender, recipient, args?.transferAmount ?? 0n);
const feeAndParams = await this._getMsglineFeeAndParams(sender, recipient, args?.transferAmount ?? 0n);
if (feeAndParams) {
return { value: feeAndParams.fee, token: this.sourceNativeToken };
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function isValidFeeRate(rate: number) {
return FEE_RATE_MIN <= rate && rate <= FEE_RATE_MAX;
}

export async function fetchMsgportFeeAndParams(
export async function fetchMsglineFeeAndParams(
sourceChainId: number,
targetChainId: number,
sourceMessager: Address,
Expand Down

0 comments on commit 8ce4cba

Please sign in to comment.