bdk-ffi/src/bdk.udl

105 lines
1.9 KiB
Plaintext
Raw Normal View History

2021-10-11 23:04:18 -07:00
namespace bdk {
};
2021-10-14 00:05:50 +05:30
[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",
2021-10-15 00:43:17 +05:30
"Esplora",
2021-10-14 00:05:50 +05:30
"Sled",
};
enum Network {
"Bitcoin",
"Testnet",
"Signet",
"Regtest",
};
2021-10-14 04:23:17 +05:30
dictionary SledDbConfiguration {
string path;
string tree_name;
};
[Enum]
interface DatabaseConfig {
Memory(string junk);
2021-10-15 00:43:17 +05:30
Sled(SledDbConfiguration config);
2021-10-14 04:23:17 +05:30
};
2021-10-11 23:04:18 -07:00
interface OfflineWallet {
2021-10-14 00:05:50 +05:30
[Throws=BdkError]
2021-10-14 11:17:52 -07:00
constructor(string descriptor, Network network, DatabaseConfig database_config);
string get_new_address();
2021-10-14 00:05:50 +05:30
};
2021-10-15 00:43:17 +05:30
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);
};
2021-10-15 01:54:32 +05:30
callback interface BdkProgress {
void update(f32 progress, string? message);
};
2021-10-15 00:43:17 +05:30
interface OnlineWallet {
[Throws=BdkError]
constructor(string descriptor, Network network, DatabaseConfig database_config, BlockchainConfig blockchain_config);
2021-10-15 00:48:48 +05:30
Network get_network();
2021-10-15 01:54:32 +05:30
[Throws=BdkError]
void sync(BdkProgress progress_update, u32? max_address_param);
2021-10-15 00:43:17 +05:30
};