-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathcandid.did
More file actions
64 lines (52 loc) · 1.12 KB
/
candid.did
File metadata and controls
64 lines (52 loc) · 1.12 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
type Satoshi = nat64;
type OutPoint = record {
txid : blob;
vout : nat32
};
type Utxo = record {
outpoint: OutPoint;
value: Satoshi;
height: nat32;
confirmations: nat32;
};
type GetUtxosRequest = record {
address : text;
min_confirmations: opt nat32;
offset: opt nat32;
};
type GetUtxosError = variant {
MalformedAddress;
// More error types to be added here.
};
type GetBalanceRequest = record {
address : text;
min_confirmations: opt nat32;
};
type GetBalanceError = variant {
MalformedAddress;
// More error types to be added here.
};
type SendTransactionRequest = record {
transaction: blob;
};
type SendTransactionError = variant {
MalformedTransaction;
// More error types to be added here.
};
service bitcoin : {
get_balance: (GetBalanceRequest) -> (variant {
Ok : Satoshi;
Err: opt GetBalanceError;
});
get_utxos: (GetUtxosRequest) -> (variant {
Ok : record {
utxos: vec Utxo;
total_count: nat32;
};
Err : opt GetUtxosError;
});
send_transaction: (SendTransactionRequest) -> (variant {
Ok : null;
Err : opt SendTransactionError;
});
}