From 56457eb9b989ed00c3b87555a43da7024654667d Mon Sep 17 00:00:00 2001 From: Cafe137 <77121044+Cafe137@users.noreply.github.com> Date: Tue, 5 Jul 2022 14:01:49 +0200 Subject: [PATCH] fix: refresh dai after spending gas (#468) --- src/utils/wallet.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/wallet.ts b/src/utils/wallet.ts index b84beb1..46280ee 100644 --- a/src/utils/wallet.ts +++ b/src/utils/wallet.ts @@ -1,5 +1,4 @@ import { providers, Wallet } from 'ethers' -import { sleepMs } from '.' import { BzzToken } from '../models/BzzToken' import { DaiToken } from '../models/DaiToken' import { estimateNativeTransferTransactionCost, Rpc } from './rpc' @@ -61,7 +60,7 @@ export class ResolvedWallet { public async transfer(destination: string, jsonRpcProvider: string): Promise { if (this.bzz.toDecimal.gt(0.05)) { await Rpc.sendBzzTransaction(this.privateKey, destination, this.bzz.toString, jsonRpcProvider) - await sleepMs(5_000) + await this.refresh() } const { gasPrice, totalCost } = await estimateNativeTransferTransactionCost(this.privateKey, jsonRpcProvider)