namespace bdk { }; [Error] enum BdkError { "InvalidU32Bytes", "Generic", "ScriptDoesntHaveAddressForm", "NoRecipients", "NoUtxosSelected", "OutputBelowDustLimit", "InsufficientFunds", "BnBTotalTriesExceeded", "BnBNoExactMatch", "UnknownUtxo", "TransactionNotFound", "TransactionConfirmed", "IrreplaceableTransaction", "FeeRateTooLow", "FeeTooLow", "FeeRateUnavailable", "MissingKeyOrigin", "Key", "ChecksumMismatch", "SpendingPolicyRequired", "InvalidPolicyPathError", "Signer", "InvalidNetwork", "InvalidProgressValue", "ProgressUpdateError", "InvalidOutpoint", "Descriptor", "AddressValidator", "Encode", "Miniscript", "Bip32", "Secp256k1", "Json", "Hex", "Psbt", "PsbtParse", "Electrum", "Esplora", "Sled", }; enum Network { "Bitcoin", "Testnet", "Signet", "Regtest", }; dictionary SledDbConfiguration { string path; string tree_name; }; [Enum] interface DatabaseConfig { Memory(string junk); Sled(SledDbConfiguration config); }; interface OfflineWallet { [Throws=BdkError] constructor(string descriptor, Network network, DatabaseConfig database_config); string get_new_address(); }; dictionary ElectrumConfig { string url; string? socks5; u8 retry; u8? timeout; u64 stop_gap; }; dictionary EsploraConfig { string base_url; string? proxy; u64 timeout_read; u64 timeout_write; u64 stop_gap; }; [Enum] interface BlockchainConfig { Electrum(ElectrumConfig config); Esplora(EsploraConfig config); }; interface OnlineWallet { [Throws=BdkError] constructor(string descriptor, Network network, DatabaseConfig database_config, BlockchainConfig blockchain_config); Network get_network(); };