-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathkey_wallet_ffi.h
More file actions
3802 lines (2969 loc) · 117 KB
/
key_wallet_ffi.h
File metadata and controls
3802 lines (2969 loc) · 117 KB
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
/**
* Key Wallet FFI - C Header File
*
* This header provides C-compatible function declarations for the key-wallet
* Rust library FFI bindings.
*
* AUTO-GENERATED FILE - DO NOT EDIT
* Generated using cbindgen
*/
#ifndef KEY_WALLET_FFI_H
#define KEY_WALLET_FFI_H
/* Generated with cbindgen:0.29.0 */
/* Warning: This file is auto-generated by cbindgen. Do not modify manually. */
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
/*
FFI Account Creation Option Type
*/
typedef enum {
/*
Create default accounts (BIP44 account 0, CoinJoin account 0, and special accounts)
*/
DEFAULT = 0,
/*
Create all specified accounts plus all special purpose accounts
*/
ALL_ACCOUNTS = 1,
/*
Create only BIP44 accounts (no CoinJoin or special accounts)
*/
BIP44_ACCOUNTS_ONLY = 2,
/*
Create specific accounts with full control
*/
SPECIFIC_ACCOUNTS = 3,
/*
Create no accounts at all
*/
NO_ACCOUNTS = 4,
} FFIAccountCreationOptionType;
/*
Account type enumeration matching all key_wallet AccountType variants
This enum provides a complete FFI representation of all account types
supported by the key_wallet library:
- Standard accounts: BIP44 and BIP32 variants for regular transactions
- CoinJoin: Privacy-enhanced transactions
- Identity accounts: Registration, top-up, and invitation funding
- Provider accounts: Various masternode provider key types (voting, owner, operator, platform)
*/
typedef enum {
/*
Standard BIP44 account (m/44'/coin_type'/account'/x/x)
*/
STANDARD_BIP44 = 0,
/*
Standard BIP32 account (m/account'/x/x)
*/
STANDARD_BIP32 = 1,
/*
CoinJoin account for private transactions
*/
COIN_JOIN = 2,
/*
Identity registration funding
*/
IDENTITY_REGISTRATION = 3,
/*
Identity top-up funding (requires registration_index)
*/
IDENTITY_TOP_UP = 4,
/*
Identity top-up funding not bound to a specific identity
*/
IDENTITY_TOP_UP_NOT_BOUND_TO_IDENTITY = 5,
/*
Identity invitation funding
*/
IDENTITY_INVITATION = 6,
/*
Provider voting keys (DIP-3) - Path: m/9'/5'/3'/1'/[key_index]
*/
PROVIDER_VOTING_KEYS = 7,
/*
Provider owner keys (DIP-3) - Path: m/9'/5'/3'/2'/[key_index]
*/
PROVIDER_OWNER_KEYS = 8,
/*
Provider operator keys (DIP-3) - Path: m/9'/5'/3'/3'/[key_index]
*/
PROVIDER_OPERATOR_KEYS = 9,
/*
Provider platform P2P keys (DIP-3, ED25519) - Path: m/9'/5'/3'/4'/[key_index]
*/
PROVIDER_PLATFORM_KEYS = 10,
} FFIAccountType;
/*
Address pool type
*/
typedef enum {
/*
External (receive) addresses
*/
EXTERNAL = 0,
/*
Internal (change) addresses
*/
INTERNAL = 1,
/*
Single pool (for non-standard accounts)
*/
SINGLE = 2,
} FFIAddressPoolType;
/*
Derivation path type for DIP9
*/
typedef enum {
PATH_UNKNOWN = 0,
PATH_BIP32 = 1,
PATH_BIP44 = 2,
PATH_BLOCKCHAIN_IDENTITIES = 3,
PATH_PROVIDER_FUNDS = 4,
PATH_PROVIDER_VOTING_KEYS = 5,
PATH_PROVIDER_OPERATOR_KEYS = 6,
PATH_PROVIDER_OWNER_KEYS = 7,
PATH_CONTACT_BASED_FUNDS = 8,
PATH_CONTACT_BASED_FUNDS_ROOT = 9,
PATH_CONTACT_BASED_FUNDS_EXTERNAL = 10,
PATH_BLOCKCHAIN_IDENTITY_CREDIT_REGISTRATION_FUNDING = 11,
PATH_BLOCKCHAIN_IDENTITY_CREDIT_TOPUP_FUNDING = 12,
PATH_BLOCKCHAIN_IDENTITY_CREDIT_INVITATION_FUNDING = 13,
PATH_PROVIDER_PLATFORM_NODE_KEYS = 14,
PATH_COIN_JOIN = 15,
PATH_ROOT = 255,
} FFIDerivationPathType;
/*
FFI Error code
*/
typedef enum {
SUCCESS = 0,
INVALID_INPUT = 1,
ALLOCATION_FAILED = 2,
INVALID_MNEMONIC = 3,
INVALID_DERIVATION_PATH = 4,
INVALID_NETWORK = 5,
INVALID_ADDRESS = 6,
INVALID_TRANSACTION = 7,
WALLET_ERROR = 8,
SERIALIZATION_ERROR = 9,
NOT_FOUND = 10,
INVALID_STATE = 11,
INTERNAL_ERROR = 12,
} FFIErrorCode;
/*
Language enumeration for mnemonic generation
This enum must be kept in sync with key_wallet::mnemonic::Language.
When adding new languages to the key_wallet crate, remember to update
this FFI enum and both From implementations below.
*/
typedef enum {
ENGLISH = 0,
CHINESE_SIMPLIFIED = 1,
CHINESE_TRADITIONAL = 2,
CZECH = 3,
FRENCH = 4,
ITALIAN = 5,
JAPANESE = 6,
KOREAN = 7,
PORTUGUESE = 8,
SPANISH = 9,
} FFILanguage;
/*
FFI Network type (bit flags for multiple networks)
*/
typedef enum {
NO_NETWORKS = 0,
DASH = 1,
TESTNET = 2,
REGTEST = 4,
DEVNET = 8,
ALL_NETWORKS = 15,
} FFINetworks;
/*
Provider key type
*/
typedef enum {
/*
BLS voting keys (m/9'/5'/3'/1'/[key_index])
*/
VOTING_KEYS = 0,
/*
BLS owner keys (m/9'/5'/3'/2'/[key_index])
*/
OWNER_KEYS = 1,
/*
BLS operator keys (m/9'/5'/3'/3'/[key_index])
*/
OPERATOR_KEYS = 2,
/*
EdDSA platform P2P keys (m/9'/5'/3'/4'/[key_index])
*/
PLATFORM_KEYS = 3,
} FFIProviderKeyType;
/*
Transaction context for checking
*/
typedef enum {
/*
Transaction is in mempool (unconfirmed)
*/
MEMPOOL = 0,
/*
Transaction is in a block
*/
IN_BLOCK = 1,
/*
Transaction is in a chain-locked block
*/
IN_CHAIN_LOCKED_BLOCK = 2,
} FFITransactionContext;
/*
Opaque account handle
*/
typedef struct FFIAccount FFIAccount;
/*
Opaque handle to an account collection
*/
typedef struct FFIAccountCollection FFIAccountCollection;
/*
FFI wrapper for an AddressPool from a ManagedAccount
This is a lightweight wrapper that holds a reference to an AddressPool
from within a ManagedAccount. It allows querying addresses and pool information.
*/
typedef struct FFIAddressPool FFIAddressPool;
/*
Opaque BLS account handle
*/
typedef struct FFIBLSAccount FFIBLSAccount;
/*
Opaque EdDSA account handle
*/
typedef struct FFIEdDSAAccount FFIEdDSAAccount;
/*
Extended private key structure
*/
typedef struct FFIExtendedPrivKey FFIExtendedPrivKey;
/*
Opaque type for an extended private key
*/
typedef struct FFIExtendedPrivateKey FFIExtendedPrivateKey;
/*
Extended public key structure
*/
typedef struct FFIExtendedPubKey FFIExtendedPubKey;
/*
Opaque type for an extended public key
*/
typedef struct FFIExtendedPublicKey FFIExtendedPublicKey;
/*
Opaque managed account handle that wraps ManagedAccount
*/
typedef struct FFIManagedAccount FFIManagedAccount;
/*
Opaque handle to a managed account collection
*/
typedef struct FFIManagedAccountCollection FFIManagedAccountCollection;
/*
FFI wrapper for ManagedWalletInfo
*/
typedef struct FFIManagedWalletInfo FFIManagedWalletInfo;
/*
Opaque type for a private key (SecretKey)
*/
typedef struct FFIPrivateKey FFIPrivateKey;
/*
Opaque type for a public key
*/
typedef struct FFIPublicKey FFIPublicKey;
/*
Opaque wallet handle
*/
typedef struct FFIWallet FFIWallet;
/*
FFI wrapper for WalletManager
*/
typedef struct FFIWalletManager FFIWalletManager;
/*
FFI Result type for Account operations
*/
typedef struct {
/*
The account handle if successful, NULL if error
*/
FFIAccount *account;
/*
Error code (0 = success)
*/
int32_t error_code;
/*
Error message (NULL if success, must be freed by caller if not NULL)
*/
char *error_message;
} FFIAccountResult;
/*
FFI Error structure
*/
typedef struct {
FFIErrorCode code;
char *message;
} FFIError;
/*
C-compatible summary of all accounts in a collection
This struct provides Swift with structured data about all accounts
that exist in the collection, allowing programmatic access to account
indices and presence information.
*/
typedef struct {
/*
Array of BIP44 account indices
*/
unsigned int *bip44_indices;
/*
Number of BIP44 accounts
*/
size_t bip44_count;
/*
Array of BIP32 account indices
*/
unsigned int *bip32_indices;
/*
Number of BIP32 accounts
*/
size_t bip32_count;
/*
Array of CoinJoin account indices
*/
unsigned int *coinjoin_indices;
/*
Number of CoinJoin accounts
*/
size_t coinjoin_count;
/*
Array of identity top-up registration indices
*/
unsigned int *identity_topup_indices;
/*
Number of identity top-up accounts
*/
size_t identity_topup_count;
/*
Whether identity registration account exists
*/
bool has_identity_registration;
/*
Whether identity invitation account exists
*/
bool has_identity_invitation;
/*
Whether identity top-up not bound account exists
*/
bool has_identity_topup_not_bound;
/*
Whether provider voting keys account exists
*/
bool has_provider_voting_keys;
/*
Whether provider owner keys account exists
*/
bool has_provider_owner_keys;
/*
Whether provider operator keys account exists
*/
bool has_provider_operator_keys;
/*
Whether provider platform keys account exists
*/
bool has_provider_platform_keys;
} FFIAccountCollectionSummary;
/*
FFI wrapper for ManagedWalletInfo that includes transaction checking capabilities
*/
typedef struct {
ManagedWalletInfo *inner;
} FFIManagedWallet;
/*
Address pool info
*/
typedef struct {
/*
Pool type
*/
FFIAddressPoolType pool_type;
/*
Number of generated addresses
*/
unsigned int generated_count;
/*
Number of used addresses
*/
unsigned int used_count;
/*
Current gap (unused addresses at the end)
*/
unsigned int current_gap;
/*
Gap limit setting
*/
unsigned int gap_limit;
/*
Highest used index (-1 if none used)
*/
int32_t highest_used_index;
} FFIAddressPoolInfo;
/*
FFI-compatible version of AddressInfo
*/
typedef struct {
/*
Address as string
*/
char *address;
/*
Script pubkey bytes
*/
uint8_t *script_pubkey;
/*
Length of script pubkey
*/
size_t script_pubkey_len;
/*
Public key bytes (nullable)
*/
uint8_t *public_key;
/*
Length of public key
*/
size_t public_key_len;
/*
Derivation index
*/
uint32_t index;
/*
Derivation path as string
*/
char *path;
/*
Whether address has been used
*/
bool used;
/*
When generated (timestamp)
*/
uint64_t generated_at;
/*
When first used (0 if never)
*/
uint64_t used_at;
/*
Transaction count
*/
uint32_t tx_count;
/*
Total received
*/
uint64_t total_received;
/*
Total sent
*/
uint64_t total_sent;
/*
Current balance
*/
uint64_t balance;
/*
Custom label (nullable)
*/
char *label;
} FFIAddressInfo;
/*
FFI Result type for ManagedAccount operations
*/
typedef struct {
/*
The managed account handle if successful, NULL if error
*/
FFIManagedAccount *account;
/*
Error code (0 = success)
*/
int32_t error_code;
/*
Error message (NULL if success, must be freed by caller if not NULL)
*/
char *error_message;
} FFIManagedAccountResult;
/*
FFI Balance type for representing wallet balances
*/
typedef struct {
/*
Confirmed balance in duffs
*/
uint64_t confirmed;
/*
Unconfirmed balance in duffs
*/
uint64_t unconfirmed;
/*
Immature balance in duffs (e.g., mining rewards)
*/
uint64_t immature;
/*
Total balance (confirmed + unconfirmed) in duffs
*/
uint64_t total;
} FFIBalance;
/*
C-compatible summary of all accounts in a managed collection
This struct provides Swift with structured data about all accounts
that exist in the managed collection, allowing programmatic access to account
indices and presence information.
*/
typedef struct {
/*
Array of BIP44 account indices
*/
unsigned int *bip44_indices;
/*
Number of BIP44 accounts
*/
size_t bip44_count;
/*
Array of BIP32 account indices
*/
unsigned int *bip32_indices;
/*
Number of BIP32 accounts
*/
size_t bip32_count;
/*
Array of CoinJoin account indices
*/
unsigned int *coinjoin_indices;
/*
Number of CoinJoin accounts
*/
size_t coinjoin_count;
/*
Array of identity top-up registration indices
*/
unsigned int *identity_topup_indices;
/*
Number of identity top-up accounts
*/
size_t identity_topup_count;
/*
Whether identity registration account exists
*/
bool has_identity_registration;
/*
Whether identity invitation account exists
*/
bool has_identity_invitation;
/*
Whether identity top-up not bound account exists
*/
bool has_identity_topup_not_bound;
/*
Whether provider voting keys account exists
*/
bool has_provider_voting_keys;
/*
Whether provider owner keys account exists
*/
bool has_provider_owner_keys;
/*
Whether provider operator keys account exists
*/
bool has_provider_operator_keys;
/*
Whether provider platform keys account exists
*/
bool has_provider_platform_keys;
} FFIManagedAccountCollectionSummary;
/*
Provider key info
*/
typedef struct {
/*
Key index
*/
unsigned int key_index;
/*
Public key bytes (48 bytes for BLS, 32 bytes for EdDSA)
*/
uint8_t *public_key;
/*
Public key length
*/
size_t public_key_len;
/*
Private key bytes (32 bytes, only if available)
*/
uint8_t *private_key;
/*
Private key length (0 if not available)
*/
size_t private_key_len;
/*
Derivation path as string
*/
char *derivation_path;
} FFIProviderKeyInfo;
/*
Transaction output for building
*/
typedef struct {
const char *address;
uint64_t amount;
} FFITxOutput;
/*
Transaction check result
*/
typedef struct {
/*
Whether the transaction belongs to the wallet
*/
bool is_relevant;
/*
Total amount received
*/
uint64_t total_received;
/*
Total amount sent
*/
uint64_t total_sent;
/*
Number of affected accounts
*/
uint32_t affected_accounts_count;
} FFITransactionCheckResult;
/*
UTXO structure for FFI
*/
typedef struct {
uint8_t txid[32];
uint32_t vout;
uint64_t amount;
char *address;
uint8_t *script_pubkey;
size_t script_len;
uint32_t height;
uint32_t confirmations;
} FFIUTXO;
/*
FFI structure for wallet account creation options
This single struct represents all possible account creation configurations
*/
typedef struct {
/*
The type of account creation option
*/
FFIAccountCreationOptionType option_type;
/*
Array of BIP44 account indices to create
*/
const uint32_t *bip44_indices;
size_t bip44_count;
/*
Array of BIP32 account indices to create
*/
const uint32_t *bip32_indices;
size_t bip32_count;
/*
Array of CoinJoin account indices to create
*/
const uint32_t *coinjoin_indices;
size_t coinjoin_count;
/*
Array of identity top-up registration indices to create
*/
const uint32_t *topup_indices;
size_t topup_count;
/*
For SpecificAccounts: Additional special account types to create
(e.g., IdentityRegistration, ProviderKeys, etc.)
This is an array of FFIAccountType values
*/
const FFIAccountType *special_account_types;
size_t special_account_types_count;
} FFIWalletAccountCreationOptions;
/*
FFI-compatible transaction context details
*/
typedef struct {
/*
The context type
*/
FFITransactionContext context_type;
/*
Block height (0 for mempool)
*/
unsigned int height;
/*
Block hash (32 bytes, null for mempool or if unknown)
*/
const uint8_t *block_hash;
/*
Timestamp (0 if unknown)
*/
unsigned int timestamp;
} FFITransactionContextDetails;
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
/*
Initialize the library
*/
bool key_wallet_ffi_initialize(void) ;
/*
Get library version
Returns a static string that should NOT be freed by the caller
*/
const char *key_wallet_ffi_version(void) ;
/*
Get an account handle for a specific account type
Returns a result containing either the account handle or an error
# Safety
- `wallet` must be a valid pointer to an FFIWallet instance
- The caller must ensure the wallet pointer remains valid for the duration of this call
*/
FFIAccountResult wallet_get_account(const FFIWallet *wallet,
FFINetworks network,
unsigned int account_index,
FFIAccountType account_type)
;
/*
Get an IdentityTopUp account handle with a specific registration index
This is used for top-up accounts that are bound to a specific identity
Returns a result containing either the account handle or an error
# Safety
- `wallet` must be a valid pointer to an FFIWallet instance
- The caller must ensure the wallet pointer remains valid for the duration of this call
*/
FFIAccountResult wallet_get_top_up_account_with_registration_index(const FFIWallet *wallet,
FFINetworks network,
unsigned int registration_index)
;
/*
Free an account handle
# Safety
- `account` must be a valid pointer to an FFIAccount that was allocated by this library
- The pointer must not be used after calling this function
- This function must only be called once per allocation
*/
void account_free(FFIAccount *account) ;
/*
Free a BLS account handle
# Safety
- `account` must be a valid pointer to an FFIBLSAccount
- The pointer must not be used after calling this function
- This function must only be called once per allocation
*/
void bls_account_free(FFIBLSAccount *account) ;
/*
Free an EdDSA account handle
# Safety
- `account` must be a valid pointer to an FFIEdDSAAccount
- The pointer must not be used after calling this function
- This function must only be called once per allocation
*/
void eddsa_account_free(FFIEdDSAAccount *account) ;
/*
Free an account result's error message (if any)
Note: This does NOT free the account handle itself - use account_free for that
# Safety
- `result` must be a valid pointer to an FFIAccountResult
- The error_message field must be either null or a valid CString allocated by this library
- The caller must ensure the result pointer remains valid for the duration of this call
*/
void account_result_free_error(FFIAccountResult *result) ;
/*
Get the extended public key of an account as a string
# Safety
- `account` must be a valid pointer to an FFIAccount instance
- The returned string must be freed by the caller using `string_free`
- Returns NULL if the account is null
*/
char *account_get_extended_public_key_as_string(const FFIAccount *account) ;
/*
Get the network of an account
# Safety
- `account` must be a valid pointer to an FFIAccount instance
- Returns FFINetwork::NoNetworks if the account is null
*/
FFINetworks account_get_network(const FFIAccount *account) ;
/*
Get the parent wallet ID of an account
# Safety
- `account` must be a valid pointer to an FFIAccount instance
- Returns a pointer to the 32-byte wallet ID, or NULL if not set or account is null
- The returned pointer is valid only as long as the account exists
- The caller should copy the data if needed for longer use
*/
const uint8_t *account_get_parent_wallet_id(const FFIAccount *account) ;
/*
Get the account type of an account
# Safety
- `account` must be a valid pointer to an FFIAccount instance
- `out_index` must be a valid pointer to a c_uint where the index will be stored
- Returns FFIAccountType::StandardBIP44 with index 0 if the account is null
*/
FFIAccountType account_get_account_type(const FFIAccount *account, unsigned int *out_index) ;
/*
Check if an account is watch-only
# Safety
- `account` must be a valid pointer to an FFIAccount instance
- Returns false if the account is null
*/
bool account_get_is_watch_only(const FFIAccount *account) ;
/*
Get the extended public key of a BLS account as a string
# Safety
- `account` must be a valid pointer to an FFIBLSAccount instance
- The returned string must be freed by the caller using `string_free`
- Returns NULL if the account is null
*/
char *bls_account_get_extended_public_key_as_string(const FFIBLSAccount *account) ;
/*
Get the network of a BLS account
# Safety
- `account` must be a valid pointer to an FFIBLSAccount instance
- Returns FFINetwork::NoNetworks if the account is null
*/
FFINetworks bls_account_get_network(const FFIBLSAccount *account) ;
/*
Get the parent wallet ID of a BLS account
# Safety
- `account` must be a valid pointer to an FFIBLSAccount instance
- Returns a pointer to the 32-byte wallet ID, or NULL if not set or account is null
- The returned pointer is valid only as long as the account exists
- The caller should copy the data if needed for longer use
*/
const uint8_t *bls_account_get_parent_wallet_id(const FFIBLSAccount *account) ;
/*
Get the account type of a BLS account
# Safety
- `account` must be a valid pointer to an FFIBLSAccount instance
- `out_index` must be a valid pointer to a c_uint where the index will be stored
- Returns FFIAccountType::StandardBIP44 with index 0 if the account is null
*/
FFIAccountType bls_account_get_account_type(const FFIBLSAccount *account,
unsigned int *out_index)
;
/*
Check if a BLS account is watch-only
# Safety
- `account` must be a valid pointer to an FFIBLSAccount instance
- Returns false if the account is null
*/
bool bls_account_get_is_watch_only(const FFIBLSAccount *account) ;
/*
Get the extended public key of an EdDSA account as a string
# Safety
- `account` must be a valid pointer to an FFIEdDSAAccount instance
- The returned string must be freed by the caller using `string_free`
- Returns NULL if the account is null
*/
char *eddsa_account_get_extended_public_key_as_string(const FFIEdDSAAccount *account) ;
/*
Get the network of an EdDSA account
# Safety
- `account` must be a valid pointer to an FFIEdDSAAccount instance
- Returns FFINetwork::NoNetworks if the account is null
*/
FFINetworks eddsa_account_get_network(const FFIEdDSAAccount *account) ;
/*
Get the parent wallet ID of an EdDSA account
# Safety
- `account` must be a valid pointer to an FFIEdDSAAccount instance