-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconst.go
30 lines (22 loc) · 857 Bytes
/
const.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
package xmrto
import (
"fmt"
)
// APIBaseAddress is the base URL of the xmr.to API
const APIBaseAddress = "https://xmr.to/api"
// APITestnetBaseAddress is the base URL of the xmr.to TESTNET API
const APITestnetBaseAddress = "https://test.xmr.to/api/"
// APIVersion is the API version identifier (currently v3)
const APIVersion = "v3"
// APIConversionDirection is the API conversion direction (currently only xmr2btc)
const APIConversionDirection = "xmr2btc"
// ErrorCode is a xmr.to error code table
type ErrorCode int
// APIError represents an error message by the xmr.to API
type APIError struct {
APIError string `json:"error"`
APIErrorMessage string `json:"error_msg"`
}
func (we *APIError) Error() string {
return fmt.Sprintf("%v: (%v) - See https://xmrto-api.readthedocs.io/en/latest/ for help!", we.APIError, we.APIErrorMessage)
}