-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtransaction.go
37 lines (30 loc) · 1.14 KB
/
transaction.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
// Copyright (c) 2014-2017 Bitmark Inc.
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package bitmarkdClient
import (
"encoding/json"
"github.com/bitmark-inc/bitmarkd/transactionrecord"
)
// TransactionArguments represents a transaction
type TransactionArguments struct {
Id string `json:"txId"`
}
// GetTransactionStatus will return the status for a specific transaction id.
func (bc *BitmarkdRPCClient) GetTransactionStatus(txId string) (json.RawMessage, error) {
args := TransactionArguments{Id: txId}
var reply json.RawMessage
err := bc.call("Transaction.Status", &args, &reply)
return reply, err
}
// Transfer performs a bitmark transfer request
func (bc *BitmarkdRPCClient) Transfer(transfer transactionrecord.BitmarkTransfer) (json.RawMessage, error) {
var reply json.RawMessage
err := bc.call("Bitmark.Transfer", &transfer, &reply)
return reply, err
}
func (bc *BitmarkdRPCClient) CountersignTransfer(transfer transactionrecord.BitmarkTransferCountersigned) (json.RawMessage, error) {
var reply json.RawMessage
err := bc.call("Bitmark.Transfer", &transfer, &reply)
return reply, err
}