import type { Messenger } from "@metamask/messenger"; import type { PermissionSpecificationBuilder, PermissionValidatorConstraint, RestrictedMethodOptions } from "@metamask/permission-controller"; import { PermissionType } from "@metamask/permission-controller"; import type { GetBip32PublicKeyParams, GetBip32PublicKeyResult } from "@metamask/snaps-sdk"; import type { NonEmptyArray } from "@metamask/utils"; import type { KeyringControllerWithKeyringV2UnsafeAction } from "../types.cjs"; import type { MethodHooksObject } from "../utils.cjs"; declare const targetName = "snap_getBip32PublicKey"; export type GetBip32PublicKeyMethodHooks = { /** * Waits for the extension to be unlocked. * * @returns A promise that resolves once the extension is unlocked. */ getUnlockPromise: (shouldShowUnlockRequest: boolean) => Promise; }; export type GetBip32PublicKeyMessengerActions = KeyringControllerWithKeyringV2UnsafeAction; type GetBip32PublicKeySpecificationBuilderOptions = { methodHooks: GetBip32PublicKeyMethodHooks; messenger: Messenger; }; export declare const Bip32PublicKeyArgsStruct: import("@metamask/superstruct").Struct<{ curve: "secp256k1" | "ed25519" | "ed25519Bip32"; path: string[]; source?: string | undefined; compressed?: boolean | undefined; }, { path: import("@metamask/superstruct").Struct>; curve: import("@metamask/superstruct").Describe<"secp256k1" | "ed25519" | "ed25519Bip32">; compressed: import("@metamask/superstruct").Struct; source: import("@metamask/superstruct").Struct; }>; /** * Gets the [BIP-32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) * public key for the derivation path specified by the `path` parameter. Note * that this returns the public key, not the extended public key (`xpub`), or * Ethereum address. * * @example * ```json name="Manifest" * { * "initialPermissions": { * "snap_getBip32PublicKey": [ * { * "path": ["m", "44'", "3'", "0'", "0", "0"], * "curve": "secp256k1" * } * ] * } * } * ``` * ```ts name="Usage" * // This example uses Dogecoin, which has a derivation path starting with * // "m / 44' / 3'". * const dogecoinPublicKey = await snap.request({ * method: 'snap_getBip32PublicKey', * params: { * // The path and curve must be specified in the initial permissions. * path: ['m', "44'", "3'", "0'", "0", "0"], * curve: 'secp256k1', * compressed: false, * }, * }) * * // '0x...' * console.log(dogecoinPublicKey) * ``` */ export declare const getBip32PublicKeyBuilder: Readonly<{ readonly targetName: "snap_getBip32PublicKey"; readonly specificationBuilder: PermissionSpecificationBuilder; allowedCaveats: Readonly> | null; validator: PermissionValidatorConstraint; }>; readonly methodHooks: MethodHooksObject; readonly actionNames: readonly ["KeyringController:withKeyringV2Unsafe"]; }>; /** * Builds the method implementation for `snap_getBip32PublicKey`. * * @param options - The options. * @param options.messenger - The messenger. * @param options.methodHooks - The RPC method hooks. * @param options.methodHooks.getUnlockPromise - A function that resolves once the MetaMask extension is unlocked * and prompts the user to unlock their MetaMask if it is locked. * @returns The method implementation which returns a public key. * @throws If the params are invalid. */ export declare function getBip32PublicKeyImplementation({ methodHooks: { getUnlockPromise }, messenger, }: GetBip32PublicKeySpecificationBuilderOptions): (args: RestrictedMethodOptions) => Promise; export {}; //# sourceMappingURL=getBip32PublicKey.d.cts.map