Skip to Content
API Reference@cfxdevkit/corederiveFaucetAccount

@cfxdevkit/core


@cfxdevkit/core / deriveFaucetAccount

Function: deriveFaucetAccount()

deriveFaucetAccount(mnemonic, coreNetworkId?): DerivedAccount

Defined in: packages/core/src/wallet/derivation.ts:245

Derive the faucet/mining account

The faucet account uses a separate derivation path (mining type) at index 0. This is used for the mining rewards recipient and as the source for faucet operations.

Parameters

mnemonic

string

BIP-39 mnemonic phrase

coreNetworkId?

number = CORE_NETWORK_IDS.LOCAL

Core Space network ID (default: 2029 for local)

Returns

DerivedAccount

The faucet account

Example

const faucet = deriveFaucetAccount(mnemonic); // Uses paths: m/44'/503'/1'/0/0 and m/44'/60'/1'/0/0