1 | import { decodeAddress } from './decode.js';
|
2 | import { encodeAddress } from './encode.js';
|
3 | import { createKeyDerived } from './keyDerived.js';
|
4 | /**
|
5 | * @name encodeDerivedAddress
|
6 | * @summary Creates a derived address as used in Substrate utility.
|
7 | * @description
|
8 | * Creates a Substrate derived address based on the input address/publicKey and the index supplied.
|
9 | */
|
10 | export function encodeDerivedAddress(who, index, ss58Format) {
|
11 | return encodeAddress(createKeyDerived(decodeAddress(who), index), ss58Format);
|
12 | }
|