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. Commented Jan 30, 2023 at 12:41

Your Answer

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

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