export type Fees = {
// fee for inclusion in the next block
fastestFee: number
// fee for inclusion in a block in 30 mins
halfHourFee: number
// fee for inclusion in a block in 1 hour
hourFee: number
// economy fee: inclusion not guaranteed
economyFee: number
// minimum fee: the minimum fee of the network
minimumFee: number
}
// UTXO is a structure defining attributes for a UTXO
export interface UTXO {
// hash of transaction that holds the UTXO
txid: string
// index of the output in the transaction
vout: number
// amount of satoshis the UTXO holds
value: number
// the script that the UTXO contains
scriptPubKey: string
}
// supported networks
export enum Network {
MAINNET = 'mainnet',
TESTNET = 'testnet',
SIGNET = 'signet'
}
export interface InscriptionResult {
list: Inscription[]
total: number
}
export interface Inscription {
output: string
inscriptionId: string
address: string
offset: number
outputValue: number
location: string
contentType: string
contentLength: number
inscriptionNumber: number
timestamp: number
genesisTransaction: string
}
export abstract class BTCProvider extends WalletProvider {
abstract connectWallet(): Promise<this>
abstract getAddress(): Promise<string>
abstract getPublicKeyHex(): Promise<string>
abstract signPsbt(psbtHex: string): Promise<string>
abstract signPsbts(psbtsHexes: string[]): Promise<string[]>
abstract getNetwork(): Promise<Network>
abstract signMessage(message: string, type: type: 'ecdsa' | 'bip322-simple'): Promise<string>
abstract on(eventName: string, callBack: () => void): void
abstract off(eventName: string, callBack: () => void): void
abstract switchNetwork(network: Network): Promise<void>
abstract sendBitcoin(to: string, satAmount: number): Promise<string>
abstract getNetworkFees(): Promise<Fees>
abstract pushTx(txHex: string): Promise<string>
abstract getUtxos(address: string, amount?: number): Promise<UTXO[]>
abstract getBTCTipHeight(): Promise<number>
abstract getBalance(): Promise<number>
abstract getInscriptions(cursor?: number, size?: number): Promise<InscriptionResult>
}