-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path17_4_createemptypsbt.c
50 lines (31 loc) · 891 Bytes
/
17_4_createemptypsbt.c
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
#include <stdio.h>
#include <stdlib.h>
#include "wally_core.h"
#include "wally_psbt.h"
#include "wally_transaction.h"
int main(void) {
int lw_response;
struct wally_psbt *psbt;
char *psbt_64;
lw_response = wally_psbt_init_alloc(0,1,1,0,&psbt);
if (lw_response) {
printf("Error: Wally_psbt_init_alloc failed: %d\n",lw_response);
exit(-1);
}
struct wally_tx *gtx;
lw_response = wally_tx_init_alloc(0,0,1,1,>x);
if (lw_response) {
printf("Error: Wally_tx_init_alloc failed: %d\n",lw_response);
exit(-1);
}
lw_response = wally_psbt_set_global_tx(psbt,gtx);
if (lw_response) {
printf("Error: Wally_psbt_set_global_tx failed: %d\n",lw_response);
exit(-1);
}
wally_psbt_to_base64(psbt,0,&psbt_64);
printf("%s\n",psbt_64);
wally_tx_free(gtx);
wally_psbt_free(psbt);
wally_cleanup(0);
}