Skip to content

Commit

Permalink
Web3: Add GetBridgeAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
rsbkmr committed Jun 15, 2024
1 parent 03ce84c commit 85fa83a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/chains/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,7 @@ export interface GetEstimatedTime {
targetToken: string,
): Promise<bigint | undefined>;
}

export interface GetBridgeAddress {
bridge:() => Promise<string>
}
6 changes: 5 additions & 1 deletion src/chains/web3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import type {
FetchTxInfo,
GetApprovedTokenAmount,
GetBalance,
GetBridgeAddress,
GetEmmetHashFromTx,
GetEstimatedTime,
GetProvider,
Expand Down Expand Up @@ -47,7 +48,7 @@ export type Web3Helper = GetBalance &
FetchTxInfo &
ProtocolFee &
GetEmmetHashFromTx &
GetEstimatedTime;
GetEstimatedTime & GetBridgeAddress

export interface Web3Params {
provider: Provider;
Expand All @@ -72,6 +73,9 @@ export async function web3Helper({
async address(contr) {
return await addrBook.get(contr);
},
async bridge() {
return await bridge.getAddress()
},
async txFee(targetChainId, fromToken, targetToken) {
const protocolFee = await data.protocolFee();
const ffc = await data.getForeignFeeCompensation(
Expand Down

0 comments on commit 85fa83a

Please sign in to comment.