zkverifyjs
Version:
Submit proofs to zkVerify and query proof state with ease using our npm package.
31 lines • 1.85 kB
TypeScript
import { KeyringPair } from '@polkadot/keyring/types';
/**
* Sets up the account using the provided secret seed phrase.
*
* @param {string} secretSeedPhrase - The secret seed phrase used to create the account.
* Must be a BIP39 mnemonic (12/15/18/21/24 words) or a 32-byte 0x-prefixed hex seed.
* Substrate dev-account SURIs (e.g. `//Alice`) are rejected unless `isCustomNetwork` is true.
* @param {boolean} [isMainnetNetwork] - True for zkVerify mainnet (affects SS58 encoding).
* @param {boolean} [isCustomNetwork] - True when the session targets a Custom network;
* permits substrate dev SURIs that would never be accepted by Volta or zkVerify.
* @returns {KeyringPair} The initialized account.
* @throws Will throw an error if the seed phrase is invalid.
*/
export declare const setupAccount: (secretSeedPhrase: string, isMainnetNetwork?: boolean, isCustomNetwork?: boolean) => KeyringPair;
/** Canonical SS58 address for a pair/public key (fixed to chain prefix). */
export declare const canonicalAddress: (pairOrPublicKey: KeyringPair | Uint8Array, isMainnetNetwork?: boolean) => string;
/**
* Derives a hard child account at `//{index}` from `base`.
* Returns the derived keypair, its SS58-encoded address (using `CHAIN_SS58_PREFIX`), and the derivation path.
*
* @param {KeyringPair} base - The base sr25519 keypair to derive from.
* @param {number} index - The child index to derive at (hard path `//index`, appended to any existing path on `base`).
* @returns {{ pair: KeyringPair, address: string, path: string }} The derived `pair`, its SS58 `address`, and the `path`.
* @throws {Error} If derivation fails.
*/
export declare const deriveChildAt: (base: KeyringPair, index: number, isMainnetNetwork?: boolean) => {
pair: KeyringPair;
address: string;
path: string;
};
//# sourceMappingURL=index.d.ts.map