-
Notifications
You must be signed in to change notification settings - Fork 13
/
owned.go
40 lines (31 loc) · 914 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
39
40
// SPDX-License-Identifier: ISC
// Copyright (c) 2014-2020 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/account"
"github.com/bitmark-inc/bitmarkd/rpc/owner"
)
// OwnedData - data for an ownership request
type OwnedData struct {
Owner *account.Account
Start uint64
Count int
}
// GetOwned - obtain list of owned bitmarks
func (client *Client) GetOwned(ownedConfig *OwnedData) (*owner.BitmarksReply, error) {
ownedArgs := owner.BitmarksArguments{
Owner: ownedConfig.Owner,
Start: ownedConfig.Start,
Count: ownedConfig.Count,
}
client.printJson("Owned Request", ownedArgs)
reply := &owner.BitmarksReply{}
err := client.client.Call("Owner.Bitmarks", ownedArgs, reply)
if nil != err {
return nil, err
}
client.printJson("Owned Reply", reply)
return reply, nil
}