avalanche-wallet-sdk icon indicating copy to clipboard operation
avalanche-wallet-sdk copied to clipboard

Bug/Feature: insufficient funds

Open eino-makitalo opened this issue 3 years ago • 1 comments

Current dev version at least. Wayt to reproduce bug: `

  1. create singlekeywallet
  2. make exportX( "1000000000", "C",) ... you will get "Insufficient Funds error"

How I fixed it

async exportX(amountAvax: string, destination:ExportChainsX): Promise<string> {
    // const fee: BN = xChain.getDefaultTxFee();
    const amount:BN = new BN(amountAvax);
    // FIX make SingleWallet to update it's uxtos
    const uxtos = await this.swallet.updateUtxosX()
    console.log("destination fro X to ", destination2);//, uxtos);
    return this.swallet.exportXChain(amount, destination2);
  }

I think there should be way to refresh Wallet state after constructing it / I understand the need separate routines which makes network calls and which are not

eino-makitalo avatar Dec 27 '21 16:12 eino-makitalo

Same with exportP but not with exportC

eino-makitalo avatar Dec 27 '21 17:12 eino-makitalo