How can I convert an account identifier (string) in typescript to type Array<number>?

I struggle with these conversions all the time. I found this guide. But the array that I get back is of length 64 instead of 32.

To work with dfx I sometimes used a function on the invoice canister to do the conversion but I really need this to work in the front end now.

I’m just trying to call a local version of the ICP ledger to do a transaction.

That’s my guide :wink:.

In nns-js there’s a accountIdentifierToBytes would that fits your need?

1 Like

Thank you very much that is very helpful!!

1 Like