-
Notifications
You must be signed in to change notification settings - Fork 13
/
owned.go
38 lines (29 loc) · 855 Bytes
/
owned.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
// Copyright (c) 2014-2018 Bitmark Inc.
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package rpccalls
import (
"github.com/bitmark-inc/bitmarkd/keypair"
"github.com/bitmark-inc/bitmarkd/rpc"
)
type OwnedData struct {
Owner *keypair.KeyPair
Start uint64
Count int
}
func (client *Client) GetOwned(ownedConfig *OwnedData) (*rpc.OwnerBitmarksReply, error) {
ownerAddress := makeAddress(ownedConfig.Owner, client.testnet)
ownedArgs := rpc.OwnerBitmarksArguments{
Owner: ownerAddress,
Start: ownedConfig.Start,
Count: ownedConfig.Count,
}
client.printJson("Owned Request", ownedArgs)
reply := &rpc.OwnerBitmarksReply{}
err := client.client.Call("Owner.Bitmarks", ownedArgs, reply)
if nil != err {
return nil, err
}
client.printJson("Owned Reply", reply)
return reply, nil
}