0

I would like to pass an address list as argument in order to send some crytos by batch. What I need to send as argument -> ["0x...0","0x...0","0x...0"]. My address variable is :

var addressesBatch = [
    "\"0x00000\"",
    "\"0x00000\"",
    "\"0x00000\"",
    "\"0x00000\""]
export default addressesBatch

Then in my component :

let utilAddressList =  addressesBatch.slice(a,b);
            
  utilAddressList = "["+utilAddressList+"]";
console.log(utilAddressList)

console shows as expected : utilAdressList : ["0x...0","0x...0","0x...0"]

But i get this error :

Unhandled Rejection (Error): expected array value (argument="DesinationAddress", value="[\"0x0000000000\",\"0x0000000000\"",\"0x0000000000\"]", code=INVALID_ARGUMENT, version=abi/5.0.7)

How can i pass the double quote in this case ? I have got the same result when using '"0xxx"'

Thanks.

Edit : solved, it was an issue passing the argument as string in the method.

1
  • You should write an answer instead of the edit with the solution, that way if someone gets the same error they see the question has an answer
    – Julissa DC
    Nov 28 '21 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.