diff --git a/.changeset/curvy-baboons-deliver.md b/.changeset/curvy-baboons-deliver.md new file mode 100644 index 0000000000..931472bace --- /dev/null +++ b/.changeset/curvy-baboons-deliver.md @@ -0,0 +1,5 @@ +--- +'@hyperlane-xyz/sdk': patch +--- + +Use collateral account for sealevel native warp route balance diff --git a/typescript/sdk/src/token/adapters/SealevelTokenAdapter.ts b/typescript/sdk/src/token/adapters/SealevelTokenAdapter.ts index 9529eb4bc4..29ea30b247 100644 --- a/typescript/sdk/src/token/adapters/SealevelTokenAdapter.ts +++ b/typescript/sdk/src/token/adapters/SealevelTokenAdapter.ts @@ -516,6 +516,12 @@ export class SealevelHypNativeAdapter extends SealevelHypTokenAdapter { } override async getBalance(owner: Address): Promise { + if (eqAddress(owner, this.addresses.warpRouter)) { + const collateralAccount = this.deriveNativeTokenCollateralAccount(); + const balance = await this.getProvider().getBalance(collateralAccount); + // TODO: account for rent in https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/4558 + return BigInt(balance.toString()); + } return this.wrappedNative.getBalance(owner); }