ethos-bitcoind 30.2.11

Generated client for ethos-bitcoind.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
//! wallet RPC method wrappers
//!
//! This module contains transport wrappers for wallet methods.

use serde_json::{json, Value};

use crate::transport::core::{TransportError, TransportTrait};

/// Mark in-wallet transaction <txid> as abandoned
/// This will mark this transaction and all its in-wallet descendants as abandoned which will allow
/// for their inputs to be respent.  It can be used to replace "stuck" or evicted transactions.
/// It only works on transactions which are not included in a block and are not currently in the mempool.
/// It has no effect on transactions which are already abandoned.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.abandontransaction(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::abandontransaction(&transport, ...).await`
///
/// Calls the `abandontransaction` RPC method.
pub async fn abandon_transaction(
    transport: &dyn TransportTrait,
    txid: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(txid)];
    let raw = transport.send_request("abandontransaction", &params).await?;
    Ok(raw)
}

/// Stops current wallet rescan triggered by an RPC call, e.g. by a rescanblockchain call.
/// Note: Use "getwalletinfo" to query the scanning progress.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.abortrescan(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::abortrescan(&transport, ...).await`
///
/// Calls the `abortrescan` RPC method.
pub async fn abort_rescan(transport: &dyn TransportTrait) -> Result<Value, TransportError> {
    let params = Vec::<Value>::new();
    let raw = transport.send_request("abortrescan", &params).await?;
    Ok(raw)
}

/// Safely copies the current wallet file to the specified destination, which can either be a directory or a path with a filename.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.backupwallet(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::backupwallet(&transport, ...).await`
///
/// Calls the `backupwallet` RPC method.
pub async fn backup_wallet(
    transport: &dyn TransportTrait,
    destination: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(destination)];
    let raw = transport.send_request("backupwallet", &params).await?;
    Ok(raw)
}

/// Bumps the fee of a transaction T, replacing it with a new transaction B.
/// A transaction with the given txid must be in the wallet.
/// The command will pay the additional fee by reducing change outputs or adding inputs when necessary.
/// It may add a new change output if one does not already exist.
/// All inputs in the original transaction will be included in the replacement transaction.
/// The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.
/// By default, the new fee will be calculated automatically using the estimatesmartfee RPC.
/// The user can specify a confirmation target for estimatesmartfee.
/// Alternatively, the user can specify a fee rate in sat/vB for the new transaction.
/// At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee
/// returned by getnetworkinfo) to enter the node's mempool.
/// * WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB. *
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.bumpfee(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::bumpfee(&transport, ...).await`
///
/// Calls the `bumpfee` RPC method.
pub async fn bump_fee(
    transport: &dyn TransportTrait,
    txid: serde_json::Value,
    options: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(txid), json!(options)];
    let raw = transport.send_request("bumpfee", &params).await?;
    Ok(raw)
}

/// Creates and loads a new wallet.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.createwallet(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::createwallet(&transport, ...).await`
///
/// Calls the `createwallet` RPC method.
#[allow(clippy::too_many_arguments)]
pub async fn create_wallet(
    transport: &dyn TransportTrait,
    wallet_name: serde_json::Value,
    disable_private_keys: serde_json::Value,
    blank: serde_json::Value,
    passphrase: serde_json::Value,
    avoid_reuse: serde_json::Value,
    descriptors: serde_json::Value,
    load_on_startup: serde_json::Value,
    external_signer: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![
        json!(wallet_name),
        json!(disable_private_keys),
        json!(blank),
        json!(passphrase),
        json!(avoid_reuse),
        json!(descriptors),
        json!(load_on_startup),
        json!(external_signer),
    ];
    let raw = transport.send_request("createwallet", &params).await?;
    Ok(raw)
}

/// Creates the wallet's descriptor for the given address type. The address type must be one that the wallet does not already have a descriptor for.
/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.createwalletdescriptor(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::createwalletdescriptor(&transport, ...).await`
///
/// Calls the `createwalletdescriptor` RPC method.
pub async fn create_wallet_descriptor(
    transport: &dyn TransportTrait,
    r#type: serde_json::Value,
    options: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(r#type), json!(options)];
    let raw = transport.send_request("createwalletdescriptor", &params).await?;
    Ok(raw)
}

/// Encrypts the wallet with 'passphrase'. This is for first time encryption.
/// After this, any calls that interact with private keys such as sending or signing
/// will require the passphrase to be set prior to making these calls.
/// Use the walletpassphrase call for this, and then walletlock call.
/// If the wallet is already encrypted, use the walletpassphrasechange call.
/// ** IMPORTANT **
/// For security reasons, the encryption process will generate a new HD seed, resulting
/// in the creation of a fresh set of active descriptors. Therefore, it is crucial to
/// securely back up the newly generated wallet file using the backupwallet RPC.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.encryptwallet(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::encryptwallet(&transport, ...).await`
///
/// Calls the `encryptwallet` RPC method.
pub async fn encrypt_wallet(
    transport: &dyn TransportTrait,
    passphrase: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(passphrase)];
    let raw = transport.send_request("encryptwallet", &params).await?;
    Ok(raw)
}

/// Returns the list of addresses assigned the specified label.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.getaddressesbylabel(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::getaddressesbylabel(&transport, ...).await`
///
/// Calls the `getaddressesbylabel` RPC method.
pub async fn get_addresses_by_label(
    transport: &dyn TransportTrait,
    label: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(label)];
    let raw = transport.send_request("getaddressesbylabel", &params).await?;
    Ok(raw)
}

/// Return information about the given bitcoin address.
/// Some of the information will only be present if the address is in the active wallet.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.getaddressinfo(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::getaddressinfo(&transport, ...).await`
///
/// Calls the `getaddressinfo` RPC method.
pub async fn get_address_info(
    transport: &dyn TransportTrait,
    address: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(address)];
    let raw = transport.send_request("getaddressinfo", &params).await?;
    Ok(raw)
}

/// Returns the total available balance.
/// The available balance is what the wallet considers currently spendable, and is
/// thus affected by options which limit spendability such as -spendzeroconfchange.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.getbalance(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::getbalance(&transport, ...).await`
///
/// Calls the `getbalance` RPC method.
pub async fn get_balance(
    transport: &dyn TransportTrait,
    dummy: serde_json::Value,
    min_conf: serde_json::Value,
    include_watchonly: serde_json::Value,
    avoid_reuse: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(dummy), json!(min_conf), json!(include_watchonly), json!(avoid_reuse)];
    let raw = transport.send_request("getbalance", &params).await?;
    Ok(raw)
}

/// Returns an object with all balances in BTC.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.getbalances(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::getbalances(&transport, ...).await`
///
/// Calls the `getbalances` RPC method.
pub async fn get_balances(transport: &dyn TransportTrait) -> Result<Value, TransportError> {
    let params = Vec::<Value>::new();
    let raw = transport.send_request("getbalances", &params).await?;
    Ok(raw)
}

/// List all BIP 32 HD keys in the wallet and which descriptors use them.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.gethdkeys(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::gethdkeys(&transport, ...).await`
///
/// Calls the `gethdkeys` RPC method.
pub async fn get_hd_keys(
    transport: &dyn TransportTrait,
    options: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(options)];
    let raw = transport.send_request("gethdkeys", &params).await?;
    Ok(raw)
}

/// Returns a new Bitcoin address for receiving payments.
/// If 'label' is specified, it is added to the address book
/// so payments received with the address will be associated with 'label'.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.getnewaddress(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::getnewaddress(&transport, ...).await`
///
/// Calls the `getnewaddress` RPC method.
pub async fn get_new_address(
    transport: &dyn TransportTrait,
    label: serde_json::Value,
    address_type: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(label), json!(address_type)];
    let raw = transport.send_request("getnewaddress", &params).await?;
    Ok(raw)
}

/// Returns a new Bitcoin address, for receiving change.
/// This is for use with raw transactions, NOT normal use.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.getrawchangeaddress(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::getrawchangeaddress(&transport, ...).await`
///
/// Calls the `getrawchangeaddress` RPC method.
pub async fn get_raw_change_address(
    transport: &dyn TransportTrait,
    address_type: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(address_type)];
    let raw = transport.send_request("getrawchangeaddress", &params).await?;
    Ok(raw)
}

/// Returns the total amount received by the given address in transactions with at least minconf confirmations.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.getreceivedbyaddress(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::getreceivedbyaddress(&transport, ...).await`
///
/// Calls the `getreceivedbyaddress` RPC method.
pub async fn get_received_by_address(
    transport: &dyn TransportTrait,
    address: serde_json::Value,
    min_conf: serde_json::Value,
    include_immature_coinbase: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(address), json!(min_conf), json!(include_immature_coinbase)];
    let raw = transport.send_request("getreceivedbyaddress", &params).await?;
    Ok(raw)
}

/// Returns the total amount received by addresses with &lt;label&gt; in transactions with at least \[minconf\] confirmations.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.getreceivedbylabel(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::getreceivedbylabel(&transport, ...).await`
///
/// Calls the `getreceivedbylabel` RPC method.
pub async fn get_received_by_label(
    transport: &dyn TransportTrait,
    label: serde_json::Value,
    min_conf: serde_json::Value,
    include_immature_coinbase: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(label), json!(min_conf), json!(include_immature_coinbase)];
    let raw = transport.send_request("getreceivedbylabel", &params).await?;
    Ok(raw)
}

/// Get detailed information about in-wallet transaction &lt;txid&gt;
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.gettransaction(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::gettransaction(&transport, ...).await`
///
/// Calls the `gettransaction` RPC method.
pub async fn get_transaction(
    transport: &dyn TransportTrait,
    txid: serde_json::Value,
    include_watchonly: serde_json::Value,
    verbose: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(txid), json!(include_watchonly), json!(verbose)];
    let raw = transport.send_request("gettransaction", &params).await?;
    Ok(raw)
}

/// Returns an object containing various wallet state info.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.getwalletinfo(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::getwalletinfo(&transport, ...).await`
///
/// Calls the `getwalletinfo` RPC method.
pub async fn get_wallet_info(transport: &dyn TransportTrait) -> Result<Value, TransportError> {
    let params = Vec::<Value>::new();
    let raw = transport.send_request("getwalletinfo", &params).await?;
    Ok(raw)
}

/// Import descriptors. This will trigger a rescan of the blockchain based on the earliest timestamp of all descriptors being imported. Requires a new wallet backup.
/// When importing descriptors with multipath key expressions, if the multipath specifier contains exactly two elements, the descriptor produced from the second element will be imported as an internal descriptor.
/// Note: This call can take over an hour to complete if using an early timestamp; during that time, other rpc calls
/// may report that the imported keys, addresses or scripts exist but related transactions are still missing.
/// The rescan is significantly faster if block filters are available (using startup option "-blockfilterindex=1").
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.importdescriptors(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::importdescriptors(&transport, ...).await`
///
/// Calls the `importdescriptors` RPC method.
pub async fn import_descriptors(
    transport: &dyn TransportTrait,
    requests: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(requests)];
    let raw = transport.send_request("importdescriptors", &params).await?;
    Ok(raw)
}

/// Imports funds without rescan. Corresponding address or script must previously be included in wallet. Aimed towards pruned wallets. The end-user is responsible to import additional transactions that subsequently spend the imported outputs or rescan after the point in the blockchain the transaction is included.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.importprunedfunds(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::importprunedfunds(&transport, ...).await`
///
/// Calls the `importprunedfunds` RPC method.
pub async fn import_pruned_funds(
    transport: &dyn TransportTrait,
    rawtransaction: serde_json::Value,
    txoutproof: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(rawtransaction), json!(txoutproof)];
    let raw = transport.send_request("importprunedfunds", &params).await?;
    Ok(raw)
}

/// Refills each descriptor keypool in the wallet up to the specified number of new keys.
/// By default, descriptor wallets have 4 active ranged descriptors ("legacy", "p2sh-segwit", "bech32", "bech32m"), each with 1000 entries.
/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.keypoolrefill(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::keypoolrefill(&transport, ...).await`
///
/// Calls the `keypoolrefill` RPC method.
pub async fn keypool_refill(
    transport: &dyn TransportTrait,
    newsize: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(newsize)];
    let raw = transport.send_request("keypoolrefill", &params).await?;
    Ok(raw)
}

/// Lists groups of addresses which have had their common ownership
/// made public by common use as inputs or as the resulting change
/// in past transactions
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.listaddressgroupings(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::listaddressgroupings(&transport, ...).await`
///
/// Calls the `listaddressgroupings` RPC method.
pub async fn list_address_groupings(
    transport: &dyn TransportTrait,
) -> Result<Value, TransportError> {
    let params = Vec::<Value>::new();
    let raw = transport.send_request("listaddressgroupings", &params).await?;
    Ok(raw)
}

/// List all descriptors present in a wallet.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.listdescriptors(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::listdescriptors(&transport, ...).await`
///
/// Calls the `listdescriptors` RPC method.
pub async fn list_descriptors(
    transport: &dyn TransportTrait,
    private: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(private)];
    let raw = transport.send_request("listdescriptors", &params).await?;
    Ok(raw)
}

/// Returns the list of all labels, or labels that are assigned to addresses with a specific purpose.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.listlabels(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::listlabels(&transport, ...).await`
///
/// Calls the `listlabels` RPC method.
pub async fn list_labels(
    transport: &dyn TransportTrait,
    purpose: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(purpose)];
    let raw = transport.send_request("listlabels", &params).await?;
    Ok(raw)
}

/// Returns list of temporarily unspendable outputs.
/// See the lockunspent call to lock and unlock transactions for spending.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.listlockunspent(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::listlockunspent(&transport, ...).await`
///
/// Calls the `listlockunspent` RPC method.
pub async fn list_lock_unspent(transport: &dyn TransportTrait) -> Result<Value, TransportError> {
    let params = Vec::<Value>::new();
    let raw = transport.send_request("listlockunspent", &params).await?;
    Ok(raw)
}

/// List balances by receiving address.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.listreceivedbyaddress(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::listreceivedbyaddress(&transport, ...).await`
///
/// Calls the `listreceivedbyaddress` RPC method.
pub async fn list_received_by_address(
    transport: &dyn TransportTrait,
    min_conf: serde_json::Value,
    include_empty: serde_json::Value,
    include_watchonly: serde_json::Value,
    address_filter: serde_json::Value,
    include_immature_coinbase: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![
        json!(min_conf),
        json!(include_empty),
        json!(include_watchonly),
        json!(address_filter),
        json!(include_immature_coinbase),
    ];
    let raw = transport.send_request("listreceivedbyaddress", &params).await?;
    Ok(raw)
}

/// List received transactions by label.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.listreceivedbylabel(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::listreceivedbylabel(&transport, ...).await`
///
/// Calls the `listreceivedbylabel` RPC method.
pub async fn list_received_by_label(
    transport: &dyn TransportTrait,
    min_conf: serde_json::Value,
    include_empty: serde_json::Value,
    include_watchonly: serde_json::Value,
    include_immature_coinbase: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![
        json!(min_conf),
        json!(include_empty),
        json!(include_watchonly),
        json!(include_immature_coinbase),
    ];
    let raw = transport.send_request("listreceivedbylabel", &params).await?;
    Ok(raw)
}

/// Get all transactions in blocks since block \[blockhash\], or all transactions if omitted.
/// If "blockhash" is no longer a part of the main chain, transactions from the fork point onward are included.
/// Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the "removed" array.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.listsinceblock(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::listsinceblock(&transport, ...).await`
///
/// Calls the `listsinceblock` RPC method.
pub async fn list_since_block(
    transport: &dyn TransportTrait,
    block_hash: serde_json::Value,
    target_confirmations: serde_json::Value,
    include_watchonly: serde_json::Value,
    include_removed: serde_json::Value,
    include_change: serde_json::Value,
    label: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![
        json!(block_hash),
        json!(target_confirmations),
        json!(include_watchonly),
        json!(include_removed),
        json!(include_change),
        json!(label),
    ];
    let raw = transport.send_request("listsinceblock", &params).await?;
    Ok(raw)
}

/// If a label name is provided, this will return only incoming transactions paying to addresses with the specified label.
/// Returns up to 'count' most recent transactions ordered from oldest to newest while skipping the first number of
/// transactions specified in the 'skip' argument. A transaction can have multiple entries in this RPC response.
/// For instance, a wallet transaction that pays three addresses — one wallet-owned and two external — will produce
/// four entries. The payment to the wallet-owned address appears both as a send entry and as a receive entry.
/// As a result, the RPC response will contain one entry in the receive category and three entries in the send category.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.listtransactions(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::listtransactions(&transport, ...).await`
///
/// Calls the `listtransactions` RPC method.
pub async fn list_transactions(
    transport: &dyn TransportTrait,
    label: serde_json::Value,
    count: serde_json::Value,
    skip: serde_json::Value,
    include_watchonly: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(label), json!(count), json!(skip), json!(include_watchonly)];
    let raw = transport.send_request("listtransactions", &params).await?;
    Ok(raw)
}

/// Returns array of unspent transaction outputs
/// with between minconf and maxconf (inclusive) confirmations.
/// Optionally filter to only include txouts paid to specified addresses.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.listunspent(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::listunspent(&transport, ...).await`
///
/// Calls the `listunspent` RPC method.
pub async fn list_unspent(
    transport: &dyn TransportTrait,
    min_conf: serde_json::Value,
    max_conf: serde_json::Value,
    addresses: serde_json::Value,
    include_unsafe: serde_json::Value,
    query_options: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![
        json!(min_conf),
        json!(max_conf),
        json!(addresses),
        json!(include_unsafe),
        json!(query_options),
    ];
    let raw = transport.send_request("listunspent", &params).await?;
    Ok(raw)
}

/// Returns a list of wallets in the wallet directory.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.listwalletdir(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::listwalletdir(&transport, ...).await`
///
/// Calls the `listwalletdir` RPC method.
pub async fn list_wallet_dir(transport: &dyn TransportTrait) -> Result<Value, TransportError> {
    let params = Vec::<Value>::new();
    let raw = transport.send_request("listwalletdir", &params).await?;
    Ok(raw)
}

/// Returns a list of currently loaded wallets.
/// For full information on the wallet, use "getwalletinfo"
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.listwallets(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::listwallets(&transport, ...).await`
///
/// Calls the `listwallets` RPC method.
pub async fn list_wallets(transport: &dyn TransportTrait) -> Result<Value, TransportError> {
    let params = Vec::<Value>::new();
    let raw = transport.send_request("listwallets", &params).await?;
    Ok(raw)
}

/// Loads a wallet from a wallet file or directory.
/// Note that all wallet command-line options used when starting bitcoind will be
/// applied to the new wallet.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.loadwallet(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::loadwallet(&transport, ...).await`
///
/// Calls the `loadwallet` RPC method.
pub async fn load_wallet(
    transport: &dyn TransportTrait,
    filename: serde_json::Value,
    load_on_startup: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(filename), json!(load_on_startup)];
    let raw = transport.send_request("loadwallet", &params).await?;
    Ok(raw)
}

/// Updates list of temporarily unspendable outputs.
/// Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs.
/// If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked.
/// A locked transaction output will not be chosen by automatic coin selection, when spending bitcoins.
/// Manually selected coins are automatically unlocked.
/// Locks are stored in memory only, unless persistent=true, in which case they will be written to the
/// wallet database and loaded on node start. Unwritten (persistent=false) locks are always cleared
/// (by virtue of process exit) when a node stops or fails. Unlocking will clear both persistent and not.
/// Also see the listunspent call
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.lockunspent(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::lockunspent(&transport, ...).await`
///
/// Calls the `lockunspent` RPC method.
pub async fn lock_unspent(
    transport: &dyn TransportTrait,
    unlock: serde_json::Value,
    transactions: serde_json::Value,
    persistent: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(unlock), json!(transactions), json!(persistent)];
    let raw = transport.send_request("lockunspent", &params).await?;
    Ok(raw)
}

/// Migrate the wallet to a descriptor wallet.
/// A new wallet backup will need to be made.
/// The migration process will create a backup of the wallet before migrating. This backup
/// file will be named &lt;wallet name&gt;-&lt;timestamp&gt;.legacy.bak and can be found in the directory
/// for this wallet. In the event of an incorrect migration, the backup can be restored using restorewallet.
/// Encrypted wallets must have the passphrase provided as an argument to this call.
/// This RPC may take a long time to complete. Increasing the RPC client timeout is recommended.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.migratewallet(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::migratewallet(&transport, ...).await`
///
/// Calls the `migratewallet` RPC method.
pub async fn migrate_wallet(
    transport: &dyn TransportTrait,
    wallet_name: serde_json::Value,
    passphrase: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(wallet_name), json!(passphrase)];
    let raw = transport.send_request("migratewallet", &params).await?;
    Ok(raw)
}

/// Bumps the fee of a transaction T, replacing it with a new transaction B.
/// Returns a PSBT instead of creating and signing a new transaction.
/// A transaction with the given txid must be in the wallet.
/// The command will pay the additional fee by reducing change outputs or adding inputs when necessary.
/// It may add a new change output if one does not already exist.
/// All inputs in the original transaction will be included in the replacement transaction.
/// The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.
/// By default, the new fee will be calculated automatically using the estimatesmartfee RPC.
/// The user can specify a confirmation target for estimatesmartfee.
/// Alternatively, the user can specify a fee rate in sat/vB for the new transaction.
/// At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee
/// returned by getnetworkinfo) to enter the node's mempool.
/// * WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB. *
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.psbtbumpfee(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::psbtbumpfee(&transport, ...).await`
///
/// Calls the `psbtbumpfee` RPC method.
pub async fn psbt_bump_fee(
    transport: &dyn TransportTrait,
    txid: serde_json::Value,
    options: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(txid), json!(options)];
    let raw = transport.send_request("psbtbumpfee", &params).await?;
    Ok(raw)
}

/// Deletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will affect wallet balances.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.removeprunedfunds(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::removeprunedfunds(&transport, ...).await`
///
/// Calls the `removeprunedfunds` RPC method.
pub async fn remove_pruned_funds(
    transport: &dyn TransportTrait,
    txid: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(txid)];
    let raw = transport.send_request("removeprunedfunds", &params).await?;
    Ok(raw)
}

/// Rescan the local blockchain for wallet related transactions.
/// Note: Use "getwalletinfo" to query the scanning progress.
/// The rescan is significantly faster if block filters are available
/// (using startup option "-blockfilterindex=1").
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.rescanblockchain(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::rescanblockchain(&transport, ...).await`
///
/// Calls the `rescanblockchain` RPC method.
pub async fn rescan_blockchain(
    transport: &dyn TransportTrait,
    start_height: serde_json::Value,
    stop_height: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(start_height), json!(stop_height)];
    let raw = transport.send_request("rescanblockchain", &params).await?;
    Ok(raw)
}

/// Restores and loads a wallet from backup.
/// The rescan is significantly faster if block filters are available
/// (using startup option "-blockfilterindex=1").
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.restorewallet(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::restorewallet(&transport, ...).await`
///
/// Calls the `restorewallet` RPC method.
pub async fn restore_wallet(
    transport: &dyn TransportTrait,
    wallet_name: serde_json::Value,
    backup_file: serde_json::Value,
    load_on_startup: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(wallet_name), json!(backup_file), json!(load_on_startup)];
    let raw = transport.send_request("restorewallet", &params).await?;
    Ok(raw)
}

/// EXPERIMENTAL warning: this call may be changed in future releases.
/// Send a transaction.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.send(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::send(&transport, ...).await`
///
/// Calls the `send` RPC method.
pub async fn send(
    transport: &dyn TransportTrait,
    outputs: serde_json::Value,
    conf_target: serde_json::Value,
    estimate_mode: serde_json::Value,
    fee_rate: serde_json::Value,
    options: serde_json::Value,
    version: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![
        json!(outputs),
        json!(conf_target),
        json!(estimate_mode),
        json!(fee_rate),
        json!(options),
        json!(version),
    ];
    let raw = transport.send_request("send", &params).await?;
    Ok(raw)
}

/// EXPERIMENTAL warning: this call may be changed in future releases.
/// Spend the value of all (or specific) confirmed UTXOs and unconfirmed change in the wallet to one or more recipients.
/// Unconfirmed inbound UTXOs and locked UTXOs will not be spent. Sendall will respect the avoid_reuse wallet flag.
/// If your wallet contains many small inputs, either because it received tiny payments or as a result of accumulating change, consider using `send_max` to exclude inputs that are worth less than the fees needed to spend them.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.sendall(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::sendall(&transport, ...).await`
///
/// Calls the `sendall` RPC method.
pub async fn send_all(
    transport: &dyn TransportTrait,
    recipients: serde_json::Value,
    conf_target: serde_json::Value,
    estimate_mode: serde_json::Value,
    fee_rate: serde_json::Value,
    options: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![
        json!(recipients),
        json!(conf_target),
        json!(estimate_mode),
        json!(fee_rate),
        json!(options),
    ];
    let raw = transport.send_request("sendall", &params).await?;
    Ok(raw)
}

/// Send multiple times. Amounts are double-precision floating point numbers.
/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.sendmany(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::sendmany(&transport, ...).await`
///
/// Calls the `sendmany` RPC method.
#[allow(clippy::too_many_arguments)]
pub async fn send_many(
    transport: &dyn TransportTrait,
    dummy: serde_json::Value,
    amounts: serde_json::Value,
    min_conf: serde_json::Value,
    comment: serde_json::Value,
    subtractfeefrom: serde_json::Value,
    replaceable: serde_json::Value,
    conf_target: serde_json::Value,
    estimate_mode: serde_json::Value,
    fee_rate: serde_json::Value,
    verbose: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![
        json!(dummy),
        json!(amounts),
        json!(min_conf),
        json!(comment),
        json!(subtractfeefrom),
        json!(replaceable),
        json!(conf_target),
        json!(estimate_mode),
        json!(fee_rate),
        json!(verbose),
    ];
    let raw = transport.send_request("sendmany", &params).await?;
    Ok(raw)
}

/// Send an amount to a given address.
/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.sendtoaddress(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::sendtoaddress(&transport, ...).await`
///
/// Calls the `sendtoaddress` RPC method.
#[allow(clippy::too_many_arguments)]
pub async fn send_to_address(
    transport: &dyn TransportTrait,
    address: serde_json::Value,
    amount: serde_json::Value,
    comment: serde_json::Value,
    comment_to: serde_json::Value,
    subtract_fee_from_amount: serde_json::Value,
    replaceable: serde_json::Value,
    conf_target: serde_json::Value,
    estimate_mode: serde_json::Value,
    avoid_reuse: serde_json::Value,
    fee_rate: serde_json::Value,
    verbose: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![
        json!(address),
        json!(amount),
        json!(comment),
        json!(comment_to),
        json!(subtract_fee_from_amount),
        json!(replaceable),
        json!(conf_target),
        json!(estimate_mode),
        json!(avoid_reuse),
        json!(fee_rate),
        json!(verbose),
    ];
    let raw = transport.send_request("sendtoaddress", &params).await?;
    Ok(raw)
}

/// Sets the label associated with the given address.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.setlabel(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::setlabel(&transport, ...).await`
///
/// Calls the `setlabel` RPC method.
pub async fn set_label(
    transport: &dyn TransportTrait,
    address: serde_json::Value,
    label: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(address), json!(label)];
    let raw = transport.send_request("setlabel", &params).await?;
    Ok(raw)
}

/// Change the state of the given wallet flag for a wallet.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.setwalletflag(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::setwalletflag(&transport, ...).await`
///
/// Calls the `setwalletflag` RPC method.
pub async fn set_wallet_flag(
    transport: &dyn TransportTrait,
    flag: serde_json::Value,
    value: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(flag), json!(value)];
    let raw = transport.send_request("setwalletflag", &params).await?;
    Ok(raw)
}

/// Sign a message with the private key of an address
/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.signmessage(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::signmessage(&transport, ...).await`
///
/// Calls the `signmessage` RPC method.
pub async fn sign_message(
    transport: &dyn TransportTrait,
    address: serde_json::Value,
    message: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(address), json!(message)];
    let raw = transport.send_request("signmessage", &params).await?;
    Ok(raw)
}

/// Sign inputs for raw transaction (serialized, hex-encoded).
/// The second optional argument (may be null) is an array of previous transaction outputs that
/// this transaction depends on but may not yet be in the block chain.
/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.signrawtransactionwithwallet(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::signrawtransactionwithwallet(&transport, ...).await`
///
/// Calls the `signrawtransactionwithwallet` RPC method.
pub async fn sign_raw_transaction_with_wallet(
    transport: &dyn TransportTrait,
    hex_string: serde_json::Value,
    prev_txs: serde_json::Value,
    sighash_type: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(hex_string), json!(prev_txs), json!(sighash_type)];
    let raw = transport.send_request("signrawtransactionwithwallet", &params).await?;
    Ok(raw)
}

/// Calculate the balance change resulting in the signing and broadcasting of the given transaction(s).
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.simulaterawtransaction(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::simulaterawtransaction(&transport, ...).await`
///
/// Calls the `simulaterawtransaction` RPC method.
pub async fn simulate_raw_transaction(
    transport: &dyn TransportTrait,
    rawtxs: serde_json::Value,
    options: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(rawtxs), json!(options)];
    let raw = transport.send_request("simulaterawtransaction", &params).await?;
    Ok(raw)
}

/// Unloads the wallet referenced by the request endpoint or the wallet_name argument.
/// If both are specified, they must be identical.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.unloadwallet(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::unloadwallet(&transport, ...).await`
///
/// Calls the `unloadwallet` RPC method.
pub async fn unload_wallet(
    transport: &dyn TransportTrait,
    wallet_name: serde_json::Value,
    load_on_startup: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(wallet_name), json!(load_on_startup)];
    let raw = transport.send_request("unloadwallet", &params).await?;
    Ok(raw)
}

/// Creates and funds a transaction in the Partially Signed Transaction format.
/// Implements the Creator and Updater roles.
/// All existing inputs must either have their previous output transaction be in the wallet
/// or be in the UTXO set. Solving data must be provided for non-wallet inputs.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.walletcreatefundedpsbt(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::walletcreatefundedpsbt(&transport, ...).await`
///
/// Calls the `walletcreatefundedpsbt` RPC method.
pub async fn wallet_create_funded_psbt(
    transport: &dyn TransportTrait,
    inputs: serde_json::Value,
    outputs: serde_json::Value,
    lock_time: serde_json::Value,
    options: serde_json::Value,
    bip32_derivs: serde_json::Value,
    version: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![
        json!(inputs),
        json!(outputs),
        json!(lock_time),
        json!(options),
        json!(bip32_derivs),
        json!(version),
    ];
    let raw = transport.send_request("walletcreatefundedpsbt", &params).await?;
    Ok(raw)
}

/// Display address on an external signer for verification.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.walletdisplayaddress(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::walletdisplayaddress(&transport, ...).await`
///
/// Calls the `walletdisplayaddress` RPC method.
pub async fn wallet_display_address(
    transport: &dyn TransportTrait,
    address: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(address)];
    let raw = transport.send_request("walletdisplayaddress", &params).await?;
    Ok(raw)
}

/// Removes the wallet encryption key from memory, locking the wallet.
/// After calling this method, you will need to call walletpassphrase again
/// before being able to call any methods which require the wallet to be unlocked.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.walletlock(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::walletlock(&transport, ...).await`
///
/// Calls the `walletlock` RPC method.
pub async fn wallet_lock(transport: &dyn TransportTrait) -> Result<Value, TransportError> {
    let params = Vec::<Value>::new();
    let raw = transport.send_request("walletlock", &params).await?;
    Ok(raw)
}

/// Stores the wallet decryption key in memory for 'timeout' seconds.
/// This is needed prior to performing transactions related to private keys such as sending bitcoins
/// Note:
/// Issuing the walletpassphrase command while the wallet is already unlocked will set a new unlock
/// time that overrides the old one.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.walletpassphrase(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::walletpassphrase(&transport, ...).await`
///
/// Calls the `walletpassphrase` RPC method.
pub async fn wallet_passphrase(
    transport: &dyn TransportTrait,
    passphrase: serde_json::Value,
    timeout: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(passphrase), json!(timeout)];
    let raw = transport.send_request("walletpassphrase", &params).await?;
    Ok(raw)
}

/// Changes the wallet passphrase from 'oldpassphrase' to 'newpassphrase'.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.walletpassphrasechange(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::walletpassphrasechange(&transport, ...).await`
///
/// Calls the `walletpassphrasechange` RPC method.
pub async fn wallet_passphrase_change(
    transport: &dyn TransportTrait,
    old_passphrase: serde_json::Value,
    new_passphrase: serde_json::Value,
) -> Result<Value, TransportError> {
    let params = vec![json!(old_passphrase), json!(new_passphrase)];
    let raw = transport.send_request("walletpassphrasechange", &params).await?;
    Ok(raw)
}

/// Update a PSBT with input information from our wallet and then sign inputs
/// that we can sign for.
/// Requires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.
///
/// # Usage
/// This method can be called using the high-level client interface:
/// - `client.walletprocesspsbt(...).await`
/// Or directly via the transport layer for advanced use cases:
/// - `transport::walletprocesspsbt(&transport, ...).await`
///
/// Calls the `walletprocesspsbt` RPC method.
pub async fn wallet_process_psbt(
    transport: &dyn TransportTrait,
    psbt: serde_json::Value,
    sign: serde_json::Value,
    sighash_type: serde_json::Value,
    bip32_derivs: serde_json::Value,
    finalize: serde_json::Value,
) -> Result<Value, TransportError> {
    let params =
        vec![json!(psbt), json!(sign), json!(sighash_type), json!(bip32_derivs), json!(finalize)];
    let raw = transport.send_request("walletprocesspsbt", &params).await?;
    Ok(raw)
}