mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-10-26 21:09:48 +00:00
The header rule takes the current year as the end of the range, as upstream's does; 581 sources still ended at 2025, which failed lint. Lint never ran to completion here, so this went unseen. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
20 lines
763 B
TypeScript
20 lines
763 B
TypeScript
// Copyright 2017-2026 @pezkuwi/util-crypto authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { BN } from '@pezkuwi/util';
|
|
import type { Prefix } from './types.js';
|
|
|
|
import { decodeAddress } from './decode.js';
|
|
import { encodeAddress } from './encode.js';
|
|
import { createKeyDerived } from './keyDerived.js';
|
|
|
|
/**
|
|
* @name encodeDerivedAddress
|
|
* @summary Creates a derived address as used in Substrate utility.
|
|
* @description
|
|
* Creates a Substrate derived address based on the input address/publicKey and the index supplied.
|
|
*/
|
|
export function encodeDerivedAddress (who: string | Uint8Array, index: bigint | BN | number, ss58Format?: Prefix): string {
|
|
return encodeAddress(createKeyDerived(decodeAddress(who), index), ss58Format);
|
|
}
|