Use DO SDK with iOS
IOS can directly use SDK libraries without the need for other tools.
Use the SDK​
Except for the get_version
interface, all other interfaces that return char* must use free
to release the heap space occupied by the return value
/**
* @brief Return SDK version
* @return const char* : Version information
*/
const char *get_version();
/**
* @brief Pass in the base64 encoding of the private key and return the handle of the private key
* @param buf: Base64 encoding of private key
* @param buf_size: The length of the base64 encoding for the private key
* @return long long: Private key handle
*/
long long import_base64_prikey_handler(const char *buf, int buf_size);
/**
* @brief Export the base64 encoding of the private key
* @return char*: Base64 encoding of private key
*/
char *export_new_prikey_base64();
/**
* @brief Generate seeds and return the hexadecimal string of the seeds
* @return char*: The hexadecimal string of the seed
*/
char *export_new_seed();
/**
* @brief Pass in the hexadecimal encoding of the private key and return the handle of the private key
* @param str: Hexadecimal encoding of private key
* @return long long Private key handle
*/
long long import_prikey_handler_from_hex(const char *str);
/**
* @brief Obtain private key handle based on hexadecimal seed string
* @param seed:
* @return long long
*/
long long import_prikey_handler_from_seed(char *seed);
/**
* @brief Pass in the private key handle and return the hexadecimal encoding of the private key
*
* @param pkey: handle
* @return char* Hexadecimal encoding of private key
*/
char *export_new_prikey_to_hex(long long pkey);
/**
* @brief Enter seeds and return mnemonic words
* @param seed: seeds
* @return char* Private key handle
*/
char *export_mnemonic_from_seed(const char *seed);
/**
* @brief Enter seed mnemonic words and return hexadecimal seeds
* @param mnemonic: Seed mnemonic words
* @return char* seed
*/
char *import_seed_from_mnemonic(const char *mnemonic);
/**
* @brief Pass in the private key handle and return the addr account address of the private key
* @param pkey: Private key handle
* @return char* Address account address
*/
char *get_addr(long long pkey);
/**
* @brief Pass in the private key handle and return the base64 encoding of the public key
* @param pkey: Private key handle
* @return char* Base64 encoding of public key
*/
char *get_pubstr_base64(long long pkey);
/**
* @brief Release the private key handle
* @param pkey: Private key handle
*/
void free_prikey_handler(long long pkey);
/**
* @brief Sign the resulting transaction for GetTransaction
* @param message: "tx"json
* @param msize: "tx"json lenght
* @param pkey: Private key handle
* @return char* Message after signature
*/
char *sig_tx(const char *message, int msize, long long pkey);
/**
* @brief Sign the resulting transaction for GetTransaction
* @param message: contract"tx"json
* @param msize: contract"tx"json lenght
* @param pkey: Private key handle
* @return char* Message after signature
*/
char *sig_contract_tx(const char *message, int msize, long long pkey);
/**
* @brief Sign the information
* @param message Information to be signed
* @param mesage_size Information length
* @param pkey Private key handle
* @return char* Signed information
*/
char *sign(const char *message, int mesage_size, long long pkey);
/**
* @brief Sign the 'txJson' in the 'result' field of the transaction return value
* @param txjson: "txJson" information
* @param pkey: Private key handle
* @return char* Signed information
*/
char* txJsonSign(const char* txjson, void *pkey);
/**
* @brief Verify the information signature
* @param pubstr Public Key
* @param pubsize Public Key length
* @param message Signed information
* @param messagesize Signed information length
* @param signature Information to be signed
* @param signature_size The length of the information to be signed
* @return int 0 represents success, -1 represents failure
*/
int verif_by_public_str(const char *pubstr, int pubsize, const char *message, int messagesize, const char *signature, int signature_size);