-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransfer.go
64 lines (47 loc) · 2.18 KB
/
transfer.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package circlesdk
// TransferStatus contains the status value for the transfer.
type TransferStatus string
const (
// TransferStatusPending = "pending".
TransferStatusPending TransferStatus = "pending"
// TransferStatusComplete = "complete".
TransferStatusComplete TransferStatus = "complete"
// TransferStatusFailed = "failed".
TransferStatusFailed TransferStatus = "failed"
)
// TransferErrorCode contains the error code value for the transfer.
type TransferErrorCode string
const (
// TransferErrorCodeInsufficientFunds = "insufficient_funds".
TransferErrorCodeInsufficientFunds TransferErrorCode = "insufficient_funds"
// TransferErrorCodeBlockChainError = "blockchain_error".
TransferErrorCodeBlockChainError TransferErrorCode = "blockchain_error"
// TransferErrorCodeTransferDenied = "transfer_denied".
TransferErrorCodeTransferDenied TransferErrorCode = "transfer_denied"
// TransferErrorCodeTransferFailed = "transfer_failed".
TransferErrorCodeTransferFailed TransferErrorCode = "transfer_failed"
)
// Transfer of funds between a `source` and `destination` addresses.
type Transfer struct {
// Unique identifier for this transfer.
ID string `json:"id,omitempty"`
// Source of the funds.
Source *DepositAddress `json:"source,omitempty"`
// Destination of the funds.
Destination *DepositAddress `json:"destination,omitempty"`
// Nominal value transferred.
Amount *Amount `json:"amount,omitempty"`
// A hash that uniquely identifies the on-chain transaction. This is only
// available where either source or destination are of type blockchain.
TxHash string `json:"transactionHash,omitempty"`
// Status of the transfer. Status `pending` indicates that the transfer is in
// the process of running; `complete` indicates it finished successfully;
// `failed` indicates it failed.
Status TransferStatus `json:"status,omitempty"`
// Indicates the failure reason of a transfer. Only present for transfers in a
// failed state. Possible values are `insufficient_funds`, `blockchain_error`,
// `transfer_denied` and `transfer_failed`.
ErrorCode TransferErrorCode `json:"errorCode,omitempty"`
// The creation date of the transfer.
CreateDate string `json:"createDate,omitempty"`
}