2

In rust I use:

.into_sub_account_truncating()

Is there a Javascript equivalent?

1 Answer 1

0

You can use this code snippet to derive a sub account. You can test it out at this page.

1
  • Its not quite that, though regarding formulating accounts from a concatenation of addresses, this code snippet in the same page is more relevant hexToAccount github.com/shawntabrizi/substrate-js-utilities/blob/…. What i wanted to check if there was already a method i could use which would add zeroes and truncating them so it fits the correct length, before embarking on doing it manually. for now appending a fixed length of zeroes works for me. Jan 30 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.