@avalanche-sdk/client
Version:
A TypeScript SDK for interacting with the Avalanche network through JSON-RPC APIs. This SDK provides a comprehensive set of tools to interact with all Avalanche chains (P-Chain, X-Chain, C-Chain) and various APIs, including wallet functionality for transa
27 lines • 1.16 kB
TypeScript
import { HDKey } from "@scure/bip32";
import { HDKeyToAccountOptions } from "viem/accounts";
import { AvalancheAccount } from "./avalancheAccount.js";
/**
* Options for the hdKeyToAvalancheAccount function.
*/
export type HDKeyToAvalancheAccountOptions = HDKeyToAccountOptions & {
xpAccountIndex?: number;
xpAddressIndex?: number;
xpChangeIndex?: number;
};
/**
* Converts a HD key to an Avalanche account.
*
* Derives the C-chain and P-chain accounts from the HD key.
* @see https://support.avax.network/en/articles/7004986-what-derivation-paths-does-avalanche-use
*
* @param hdKey_ - The HD key to convert. {@link HDKey}
* @param options - The options for the account. {@link HDKeyToAvalancheAccountOptions}
* @returns The Avalanche account {@link AvalancheAccount}.
*/
export declare function hdKeyToAvalancheAccount(hdKey_: HDKey, { accountIndex, addressIndex, changeIndex, xpAccountIndex, xpAddressIndex, xpChangeIndex, path, ...options }?: HDKeyToAccountOptions & {
xpAccountIndex?: number;
xpAddressIndex?: number;
xpChangeIndex?: number;
}): AvalancheAccount;
//# sourceMappingURL=hdKeyToAvalancheAccount.d.ts.map