avalanche-wallet-sdk
avalanche-wallet-sdk copied to clipboard
Bug/Feature: insufficient funds
Current dev version at least. Wayt to reproduce bug: `
- create singlekeywallet
- 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
Same with exportP but not with exportC