-
Notifications
You must be signed in to change notification settings - Fork 19
/
client.go
38 lines (28 loc) · 956 Bytes
/
client.go
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
package hedera
// #include "hedera-client.h"
import "C"
type Client struct {
inner *C.HederaClient
}
func Dial(address string) Client {
return Client{C.hedera_client_dial(C.CString(address))}
}
func (client *Client) Close() {
C.hedera_client_close(client.inner)
}
// Query
// ----------------------------------------------------------------------------
func (client *Client) GetAccountBalance(id AccountID) QueryGetAccountBalance {
return newQueryGetAccountBalance(client, id)
}
func (client *Client) GetTransactionReceipt(id TransactionID) QueryGetTransactionReceipt {
return newQueryGetTransactionReceipt(client, id)
}
// Transaction
// ----------------------------------------------------------------------------
func (client *Client) CreateAccount() TransactionCreateAccount {
return newTransactionCreateAccount(client)
}
func (client *Client) CryptoTransfer() TransactionCryptoTransfer {
return newTransactionCryptoTransfer(client)
}