Skip to content

How to use encodeAbiParameters with an array of tuples? #2114

Answered by joepegler
joepegler asked this question in Question
Discussion options

You must be logged in to vote

Got it.

    const abiParameters = [
      { type: "address" },
      {
        type: "tuple[]",
        components: [
          { type: "uint48" },
          { type: "uint48" },
          { type: "address" },
          { type: "bytes" },
          { type: "bytes32[]" },
          { type: "bytes" }
        ]
      },
      { type: "bytes" }
    ]

    const paddedSignatureWithViem = encodeAbiParameters(abiParameters, [
      myAddress, myTupleArray, signature
    ])

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by joepegler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant