Merge bitcoindevkit/bdk-ffi#147: Clean up UDL file
efc475e33f6f36ac07f142471325f7f59254061f Clean up UDL file (thunderbiscuit) Pull request description: This PR groups related constructs together, fixes indentation inconsistencies (2 spaces is the standard), and adds space between methods in interfaces. ACKs for top commit: notmandatory: ACK efc475e33f6f36ac07f142471325f7f59254061f Tree-SHA512: 8b37afd1d05f23cb51e04664459b88f3cf415f8616ee0a080294bc27c71c16ed8049ea605b4b41091e4c8276b107da21aff0c1712f2ebfb0dd059f68a4240745
This commit is contained in:
commit
f40ab551b6
49
src/bdk.udl
49
src/bdk.udl
@ -1,6 +1,7 @@
|
||||
namespace bdk {
|
||||
[Throws=BdkError]
|
||||
ExtendedKeyInfo generate_extended_key(Network network, WordCount word_count, string? password);
|
||||
|
||||
[Throws=BdkError]
|
||||
ExtendedKeyInfo restore_extended_key(Network network, string mnemonic, string? password);
|
||||
};
|
||||
@ -100,6 +101,20 @@ interface Transaction {
|
||||
Confirmed(TransactionDetails details, BlockTime confirmation);
|
||||
};
|
||||
|
||||
dictionary ExtendedKeyInfo {
|
||||
string mnemonic;
|
||||
string xprv;
|
||||
string fingerprint;
|
||||
};
|
||||
|
||||
enum WordCount {
|
||||
"Words12",
|
||||
"Words15",
|
||||
"Words18",
|
||||
"Words21",
|
||||
"Words24",
|
||||
};
|
||||
|
||||
dictionary ElectrumConfig {
|
||||
string url;
|
||||
string? socks5;
|
||||
@ -125,6 +140,7 @@ interface BlockchainConfig {
|
||||
interface Blockchain {
|
||||
[Throws=BdkError]
|
||||
constructor(BlockchainConfig config);
|
||||
|
||||
[Throws=BdkError]
|
||||
void broadcast([ByRef] PartiallySignedBitcoinTransaction psbt);
|
||||
};
|
||||
@ -136,15 +152,21 @@ callback interface Progress {
|
||||
interface Wallet {
|
||||
[Throws=BdkError]
|
||||
constructor(string descriptor, string? change_descriptor, Network network, DatabaseConfig database_config);
|
||||
|
||||
[Throws=BdkError]
|
||||
AddressInfo get_address(AddressIndex address_index);
|
||||
|
||||
[Throws=BdkError]
|
||||
u64 get_balance();
|
||||
|
||||
[Throws=BdkError]
|
||||
void sign([ByRef] PartiallySignedBitcoinTransaction psbt);
|
||||
|
||||
[Throws=BdkError]
|
||||
sequence<Transaction> get_transactions();
|
||||
|
||||
Network get_network();
|
||||
|
||||
[Throws=BdkError]
|
||||
void sync([ByRef] Blockchain blockchain, Progress? progress);
|
||||
};
|
||||
@ -152,41 +174,40 @@ interface Wallet {
|
||||
interface PartiallySignedBitcoinTransaction {
|
||||
[Throws=BdkError]
|
||||
constructor(string psbt_base64);
|
||||
|
||||
string serialize();
|
||||
|
||||
string txid();
|
||||
};
|
||||
|
||||
interface TxBuilder {
|
||||
constructor();
|
||||
|
||||
TxBuilder add_recipient(string address, u64 amount);
|
||||
|
||||
TxBuilder fee_rate(float sat_per_vbyte);
|
||||
|
||||
TxBuilder drain_wallet();
|
||||
|
||||
TxBuilder drain_to(string address);
|
||||
|
||||
TxBuilder enable_rbf();
|
||||
|
||||
TxBuilder enable_rbf_with_sequence(u32 nsequence);
|
||||
|
||||
[Throws=BdkError]
|
||||
PartiallySignedBitcoinTransaction finish([ByRef] Wallet wallet);
|
||||
};
|
||||
|
||||
interface BumpFeeTxBuilder {
|
||||
constructor(string txid, float new_fee_rate);
|
||||
|
||||
BumpFeeTxBuilder allow_shrinking(string address);
|
||||
|
||||
BumpFeeTxBuilder enable_rbf();
|
||||
|
||||
BumpFeeTxBuilder enable_rbf_with_sequence(u32 nsequence);
|
||||
|
||||
[Throws=BdkError]
|
||||
PartiallySignedBitcoinTransaction finish([ByRef] Wallet wallet);
|
||||
};
|
||||
|
||||
dictionary ExtendedKeyInfo {
|
||||
string mnemonic;
|
||||
string xprv;
|
||||
string fingerprint;
|
||||
};
|
||||
|
||||
enum WordCount {
|
||||
"Words12",
|
||||
"Words15",
|
||||
"Words18",
|
||||
"Words21",
|
||||
"Words24",
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user