Documentation ¶
Index ¶
- Constants
- func GenerateToken(userID string, key *rsa.PrivateKey, exp time.Duration) string
- func IsErrorCode(err error, code twirp.ErrorCode) bool
- func IsErrorNotFound(err error) bool
- func IsErrorUnauthenticated(err error) bool
- func WithToken(ctx context.Context, token string) context.Context
- type OrderAction
- type TransferAction
Constants ¶
View Source
const ( // 市价极速兑换 StrategyMarket = "MARKET" // 跟随买一卖一下单 StrategyFollow = "FOLLOW" // 限价单 StrategyLimit = "LIMIT" )
View Source
const ( // 兑换失败,退款 TransferActionSourceRefund = "REFUND" // 兑换成功 TransferActionSourceFilled = "FILLED" )
View Source
const ( // api host Endpoint = "https://efox.fox.one" BrokerID = "fb151d94-cc0e-358b-9cdb-57215a557a31" )
Variables ¶
This section is empty.
Functions ¶
func GenerateToken ¶
func IsErrorNotFound ¶
func IsErrorUnauthenticated ¶
Types ¶
type OrderAction ¶
type OrderAction struct { // Asset 为要换取的币的 symbol 或者 mixin asset id Asset string `json:"a,omitempty"` // MARKET or FOLLOW Strategy string `json:"s,omitempty"` // Price 限价价格,仅用在 LIMIT 策略 Price string `json:"price,omitempty"` // 注册或者更新 public key, rsa public key base64 格式 PublicKey string `json:"u,omitempty"` }
func (OrderAction) Encode ¶
func (action OrderAction) Encode() string
type TransferAction ¶
type TransferAction struct { // Service = ATM Service string `json:"s,omitempty"` // REFUND or FILLED Source string `json:"c,omitempty"` // 订单 id OrderID string `json:"t,omitempty"` }
TransferAction 是 atm 兑换完成或者失败后回款的 memo 格式
Click to show internal directories.
Click to hide internal directories.