From a9657a7c67ada22610438ce10228548530263bfc Mon Sep 17 00:00:00 2001 From: Enzo Cioppettini Date: Mon, 14 Mar 2022 12:27:23 -0300 Subject: [PATCH] update C header --- bindings/wallet-c/wallet.h | 202 +------------------------------------ 1 file changed, 2 insertions(+), 200 deletions(-) diff --git a/bindings/wallet-c/wallet.h b/bindings/wallet-c/wallet.h index ea09fe76..3bbf0cd9 100644 --- a/bindings/wallet-c/wallet.h +++ b/bindings/wallet-c/wallet.h @@ -57,6 +57,8 @@ typedef struct Proposal typedef struct Proposal *ProposalPtr; +typedef struct Settings *SettingsPtr; + typedef struct Wallet { @@ -64,15 +66,6 @@ typedef struct Wallet typedef struct Wallet *WalletPtr; -typedef struct Settings *SettingsPtr; - -typedef struct Conversion -{ - -} Conversion; - -typedef struct Conversion *ConversionPtr; - typedef struct PerCertificateFee { uint64_t certificate_pool_registration; @@ -308,102 +301,6 @@ ErrorPtr iohk_jormungandr_vote_proposal_new_public(const uint8_t *vote_plan_id, uint8_t num_choices, ProposalPtr *proposal_out); -/** - * once funds have been retrieved with `iohk_jormungandr_wallet_retrieve_funds` - * it is possible to convert all existing funds to the new wallet. - * - * The returned arrays are transactions to send to the network in order to do the - * funds conversion. - * - * Don't forget to call `iohk_jormungandr_wallet_delete_conversion` to - * properly free the memory - * - * # Errors - * - * On error the function returns a `ErrorPtr`. On success `NULL` is returned. - * The `ErrorPtr` can then be observed to gathered details of the error. - * Don't forget to call `iohk_jormungandr_wallet_delete_error` to free - * the `ErrorPtr` from memory and avoid memory leaks. - * - * # Safety - * - * This function dereference raw pointers. Even though - * the function checks if the pointers are null. Mind not to put random values - * in or you may see unexpected behaviors - * - */ -ErrorPtr iohk_jormungandr_wallet_convert(WalletPtr wallet, - SettingsPtr settings, - struct BlockDate valid_until, - ConversionPtr *conversion_out); - -/** - * get the total value ignored in the conversion - * - * value_out: will returns the total value lost into dust inputs - * ignored_out: will returns the number of dust utxos - * - * these returned values are informational only and this show that - * there are UTxOs entries that are unusable because of the way they - * are populated with dusts. - * - * # Errors - * - * On error the function returns a `ErrorPtr`. On success `NULL` is returned. - * The `ErrorPtr` can then be observed to gathered details of the error. - * Don't forget to call `iohk_jormungandr_wallet_delete_error` to free - * the `ErrorPtr` from memory and avoid memory leaks. - * - * # Safety - * - * This function dereference raw pointers. Even though - * the function checks if the pointers are null. Mind not to put random values - * in or you may see unexpected behaviors - * - */ -ErrorPtr iohk_jormungandr_wallet_convert_ignored(ConversionPtr conversion, - uint64_t *value_out, - uintptr_t *ignored_out); - -/** - * retrieve the index-nth transactions in the conversions starting from 0 - * and finishing at `size-1` where size is retrieved from - * `iohk_jormungandr_wallet_convert_transactions_size`. - * - * the memory allocated returned is not owned and should not be kept - * for longer than potential call to `iohk_jormungandr_wallet_delete_conversion` - * - * # Errors - * - * On error the function returns a `ErrorPtr`. On success `NULL` is returned. - * The `ErrorPtr` can then be observed to gathered details of the error. - * Don't forget to call `iohk_jormungandr_wallet_delete_error` to free - * the `ErrorPtr` from memory and avoid memory leaks. - * - * # Safety - * - * This function dereference raw pointers. Even though - * the function checks if the pointers are null. Mind not to put random values - * in or you may see unexpected behaviors - * - */ -ErrorPtr iohk_jormungandr_wallet_convert_transactions_get(ConversionPtr conversion, - uintptr_t index, - const uint8_t **transaction_out, - uintptr_t *transaction_size); - -/** - * get the number of transactions built to convert the retrieved wallet - * - * # Safety - * - * This function dereference raw pointers. Even though - * the function checks if the pointers are null. Mind not to put random values - * in or you may see unexpected behaviors - * - */ -uintptr_t iohk_jormungandr_wallet_convert_transactions_size(ConversionPtr conversion); - /** * Delete a binary buffer that was returned by this library alongside with its * length. @@ -416,18 +313,6 @@ uintptr_t iohk_jormungandr_wallet_convert_transactions_size(ConversionPtr conver */ void iohk_jormungandr_wallet_delete_buffer(uint8_t *ptr, uintptr_t length); -/** - * delete the pointer - * - * # Safety - * - * This function dereference raw pointers. Even though - * the function checks if the pointers are null. Mind not to put random values - * in or you may see unexpected behaviors - * - */ -void iohk_jormungandr_wallet_delete_conversion(ConversionPtr conversion); - /** * delete the pointer and free the allocated memory * @@ -599,89 +484,6 @@ ErrorPtr iohk_jormungandr_wallet_import_keys(const uint8_t *account_key, uintptr_t utxo_keys_len, WalletPtr *wallet_out); -/** - * retrieve a wallet from the given mnemonics, password and protocol magic - * - * this function will work for all yoroi, daedalus and other wallets - * as it will try every kind of wallet anyway - * - * You can also use this function to recover a wallet even after you have - * transferred all the funds to the new format (see the _convert_ function) - * - * The recovered wallet will be returned in `wallet_out`. - * - * # parameters - * - * * mnemonics: a null terminated utf8 string (already normalized NFKD) in english; - * * password: pointer to the password (in bytes, can be UTF8 string or a bytes of anything); - * this value is optional and passing a null pointer will result in no password; - * * password_length: the length of the password; - * * wallet_out: a pointer to a pointer. The recovered wallet will be allocated on this pointer; - * - * # errors - * - * The function may fail if: - * - * * the mnemonics are not valid (invalid length or checksum); - * * the `wallet_out` is null pointer - * - * On error the function returns a `ErrorPtr`. On success `NULL` is returned. - * The `ErrorPtr` can then be observed to gathered details of the error. - * Don't forget to call `iohk_jormungandr_wallet_delete_error` to free - * the `ErrorPtr` from memory and avoid memory leaks. - * - * # Safety - * - * This function dereference raw pointers. Even though - * the function checks if the pointers are null. Mind not to put random values - * in or you may see unexpected behaviors - * - */ -ErrorPtr iohk_jormungandr_wallet_recover(const char *mnemonics, - const uint8_t *password, - uintptr_t password_length, - WalletPtr *wallet_out); - -/** - * retrieve funds from daedalus or yoroi wallet in the given block0 (or - * any other blocks). - * - * Execute this function then you can check who much funds you have - * retrieved from the given block. - * - * this function may take sometimes so it is better to only call this - * function if needed. - * - * # Parameters - * - * * wallet: the recovered wallet (see recover function); - * * block0: the pointer to the bytes of the block0; - * * block0_length: the length of the block0 byte string; - * * settings_out: the settings that will be parsed from the given - * block0; - * - * # Errors - * - * * this function may fail if the wallet pointer is null; - * * the block is not valid (cannot be decoded) - * - * On error the function returns a `ErrorPtr`. On success `NULL` is returned. - * The `ErrorPtr` can then be observed to gathered details of the error. - * Don't forget to call `iohk_jormungandr_wallet_delete_error` to free - * the `ErrorPtr` from memory and avoid memory leaks. - * - * # Safety - * - * This function dereference raw pointers. Even though - * the function checks if the pointers are null. Mind not to put random values - * in or you may see unexpected behaviors - * - */ -ErrorPtr iohk_jormungandr_wallet_retrieve_funds(WalletPtr wallet, - const uint8_t *block0, - uintptr_t block0_length, - SettingsPtr *settings_out); - /** * update the wallet account state *