Skip to content

Commit

Permalink
fix ethers 6 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaurello committed Feb 12, 2024
1 parent 4d2b346 commit 688fb0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 3 additions & 4 deletions packages/sdk/src/contract/contracts/Xtokens/Xtokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,11 @@ export class Xtokens implements TransferContractInterface {

private async getGasPrice() {
if (isEthersSigner(this.#signer)) {
if (!this.#signer.provider) return 0n;
const { gasPrice, maxPriorityFeePerGas } =
await this.#signer.getFeeData();
await this.#signer.provider.getFeeData();

return (
(gasPrice?.toBigInt() || 0n) + (maxPriorityFeePerGas?.toBigInt() || 0n)
);
return (gasPrice || 0n) + (maxPriorityFeePerGas || 0n);
}

const publicClient = createPublicClient({
Expand Down
5 changes: 2 additions & 3 deletions packages/sdk/src/getTransferData/getTransferData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,8 @@ export async function getDestinationFeeWithSourceDecimals(
sourcePolkadot: PolkadotService,
destinationFee: AssetAmount,
): Promise<AssetAmount> {
const destinationFeeDecimals = await sourcePolkadot.getAssetDecimals(
destinationFee,
);
const destinationFeeDecimals =
await sourcePolkadot.getAssetDecimals(destinationFee);
const destinationFeeAsset =
destinationFee.decimals === destinationFeeDecimals
? destinationFee
Expand Down

0 comments on commit 688fb0b

Please sign in to comment.