@funkit/fun-relay
Version:
18 lines • 1.18 kB
TypeScript
import { adaptBitcoinWallet } from '@relayprotocol/relay-bitcoin-wallet-adapter';
import type { AdaptedWallet } from '@relayprotocol/relay-sdk';
type Base16 = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f';
export type BitcoinAddress = `1${string}` | `3${string}` | `bc1${string}` | `bc1p${string}`;
export type BitcoinTxHash = `${Base16}${string}`;
export type BitcoinWallet = {
address(): Promise<BitcoinAddress>;
vmType: 'bvm';
} & AdaptedWallet;
/** bitcoinjs-lib Psbt */
export type BitcoinPsbt = Parameters<Parameters<typeof adaptBitcoinWallet>[1]>[1];
export type BitcoinPsbtDynamicParams = Parameters<Parameters<typeof adaptBitcoinWallet>[1]>[2];
/** bitcoinjs-lib Signer */
export type BitcoinSigner = Parameters<BitcoinPsbt['signAllInputs']>[0];
export declare function getBitcoinWallet(walletAddress: BitcoinAddress, signPsbt: (address: BitcoinAddress, psbt: BitcoinPsbt, dynamicParams: BitcoinPsbtDynamicParams) => Promise<string>): BitcoinWallet;
export declare function getBitcoinWalletFromSigner(walletAddress: BitcoinAddress, signer: BitcoinSigner): BitcoinWallet;
export {};
//# sourceMappingURL=bitcoin.d.ts.map