1

Hoping somone could explain what's going on here.

I am getting this error Error: couldn't unmarshal an argument. Ensure arguments are valid and properly formatted.

with this code, seems like something is wrong with xAddresses format?

const xAddresses:any = xchain.keyChain().getAddresses();

**const utxos:any = await xchain.getUTXOs(xAddresses)**
    .then(element => {console.log("sucess" + element)})
    .catch(Error => {console.log("Error in createSingedTX: " + Error)});

1 Answers1

0

Avalanche default documentation and AvalancheJs examples are both uses wrong variables which is a buffer[] of your keychain addresses. Use string addresses array instead of buffer. It works!

const addressStrings = myKeychain.getAddressStrings();
const utxos = (await avmApi.getUTXOs(addressStrings)).utxos
Matricore
  • 575
  • 7
  • 12