2021-06-03 17:51:07 -07:00
|
|
|
#include <stdlib.h>
|
2021-06-04 18:03:34 -07:00
|
|
|
#include <stdio.h>
|
2021-06-03 17:51:07 -07:00
|
|
|
#include "bdk_ffi.h"
|
|
|
|
|
|
|
|
int main (int argc, char const * const argv[])
|
|
|
|
{
|
2021-06-04 18:03:34 -07:00
|
|
|
|
|
|
|
char const * string1 = "string1";
|
|
|
|
char const * string2 = "string2";
|
|
|
|
char * string3 = concat_string(string1, string2);
|
|
|
|
|
|
|
|
print_string(string3);
|
|
|
|
print_string(string3);
|
|
|
|
free_string(string3);
|
2021-06-04 23:01:51 -07:00
|
|
|
//free_string(string3);
|
2021-06-04 18:03:34 -07:00
|
|
|
|
|
|
|
//Point_t a = new_point(84,45);
|
|
|
|
//Point_t b = new_point(0,39);
|
|
|
|
//Point_t m = mid_point(a, b);
|
|
|
|
//print_point(m);
|
|
|
|
|
2021-06-04 23:01:51 -07:00
|
|
|
char const * name = "test_wallet";
|
|
|
|
char const * desc = "wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/0/*)";
|
|
|
|
char const * change = "wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/1/*)";
|
2021-06-04 18:03:34 -07:00
|
|
|
|
|
|
|
//printf("wallet name: %s\n", name);
|
|
|
|
//printf("descriptor: %s\n", desc);
|
|
|
|
//printf("change descriptor: %s\n", change);
|
2021-06-04 23:01:51 -07:00
|
|
|
WalletPtr_t * wallet = new_wallet(name, desc, change);
|
2021-06-04 18:03:34 -07:00
|
|
|
|
2021-06-04 23:01:51 -07:00
|
|
|
sync_wallet(&wallet);
|
|
|
|
sync_wallet(&wallet);
|
|
|
|
|
|
|
|
char const * address1 = new_address(&wallet);
|
|
|
|
printf("address1: %s\n", address1);
|
|
|
|
char const * address2 = new_address(&wallet);
|
|
|
|
printf("address: %s\n", address2);
|
|
|
|
|
|
|
|
//free_wallet(wallet);
|
|
|
|
//sync_wallet(&wallet);
|
2021-06-04 18:03:34 -07:00
|
|
|
|
2021-06-03 17:51:07 -07:00
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|