@tomo-inc/ledger-bitcoin-babylon
Version:
Ledger Hardware Wallet Babylon Application Client
90 lines (89 loc) • 3.33 kB
TypeScript
/// <reference types="node" />
import Transport from '@ledgerhq/hw-transport';
import { Transaction } from '@scure/btc-signer';
import { WalletPolicy } from '../policy';
import { AddressType, SignedMessage } from './types';
export declare function signPsbt({ transport, psbt, policy, }: {
transport: Transport;
psbt: Uint8Array | string;
policy: WalletPolicy;
}): Promise<Transaction>;
interface SignMessageOptions {
transport: Transport;
message: string;
type: 'ecdsa' | 'bip322-simple';
addressType?: AddressType;
derivationPath?: string;
isTestnet?: boolean;
}
export declare function validadteAddress(input: string): {
prefix: string;
data: Uint8Array;
} | void;
export declare function signMessage(options: SignMessageOptions): Promise<SignedMessage>;
export declare function computeLeafHash(psbt: Uint8Array | string): Buffer;
export declare function formatKey(key: string | Buffer, isTestnet: boolean): string;
export type SlashingPolicy = undefined | 'Consent to slashing' | 'Consent to unbonding slashing';
export type SlashingParams = {
leafHash: Buffer;
timelockBlocks: number;
finalityProviders: string[];
covenantThreshold: number;
covenantPks?: string[];
slashingPkScriptHex: string;
slashingFeeSat: number;
};
export declare function slashingPathPolicy({ policyName, transport, params, derivationPath, displayLeafHash, isTestnet, }: {
policyName?: SlashingPolicy;
transport: Transport;
params: SlashingParams;
derivationPath?: string;
displayLeafHash?: boolean;
isTestnet?: boolean;
}): Promise<WalletPolicy>;
export type UnbondingPolicy = undefined | 'Unbonding';
export type UnbondingParams = {
leafHash: Buffer;
timelockBlocks: number;
finalityProviders: string[];
covenantThreshold: number;
covenantPks?: string[];
unbondingFeeSat: number;
};
export declare function unbondingPathPolicy({ policyName, transport, params, derivationPath, displayLeafHash, isTestnet, }: {
policyName?: UnbondingPolicy;
transport: Transport;
params: UnbondingParams;
derivationPath?: string;
displayLeafHash?: boolean;
isTestnet?: boolean;
}): Promise<WalletPolicy>;
export type TimelockPolicy = undefined | 'Withdraw';
export type TimelockParams = {
leafHash: Buffer;
timelockBlocks: number;
};
export declare function timelockPathPolicy({ policyName, transport, params, derivationPath, displayLeafHash, isTestnet, }: {
policyName?: TimelockPolicy;
transport: Transport;
params: TimelockParams;
derivationPath?: string;
displayLeafHash?: boolean;
isTestnet?: boolean;
}): Promise<WalletPolicy>;
export type StakingTxPolicy = undefined | 'Staking transaction';
export type StakingTxParams = {
timelockBlocks: number;
finalityProviders: string[];
covenantThreshold: number;
covenantPks?: string[];
};
export declare function stakingTxPolicy({ policyName, transport, params, derivationPath, isTestnet, }: {
policyName?: StakingTxPolicy;
transport: Transport;
params: StakingTxParams;
derivationPath?: string;
isTestnet?: boolean;
}): Promise<WalletPolicy>;
export declare function tryParsePsbt(transport: Transport, psbtBase64: string, isTestnet?: boolean, leafHash?: Buffer): Promise<WalletPolicy | void>;
export {};