938396d82b
- Add multi-currency exchange rate API integration (GetRateForCoin) - Implement native TRX transfer detection alongside TRC20 USDT transfers - Replace deprecated Tronscan API with Trongrid API for better reliability - Add TRON Grid API key configuration support - Refactor order service to support multiple tokens and currencies - Update wallet address locking/unlocking to track token type - Add base58 and gjson dependencies for crypto operations - Optimize SQLite connection with WAL mode and busy timeout - Remove deprecated USDT rate job (replaced by dynamic rate API) - Update order data model to include currency and receive address fields - Enhance TRC20 callback with improved error handling and logging
36 lines
1.0 KiB
Go
36 lines
1.0 KiB
Go
package request
|
|
|
|
import "github.com/gookit/validate"
|
|
|
|
// CreateTransactionRequest 创建交易请求
|
|
type CreateTransactionRequest struct {
|
|
OrderId string `json:"order_id" validate:"required|maxLen:32"`
|
|
Currency string `json:"currency" validate:"required"`
|
|
Token string `json:"token" validate:"required"`
|
|
Amount float64 `json:"amount" validate:"required|isFloat|gt:0.01"`
|
|
NotifyUrl string `json:"notify_url" validate:"required"`
|
|
Signature string `json:"signature" validate:"required"`
|
|
RedirectUrl string `json:"redirect_url"`
|
|
}
|
|
|
|
func (r CreateTransactionRequest) Translates() map[string]string {
|
|
return validate.MS{
|
|
"OrderId": "订单号",
|
|
"Currency": "货币",
|
|
"Token": "币种",
|
|
"Amount": "支付金额",
|
|
"NotifyUrl": "异步回调网址",
|
|
"Signature": "签名",
|
|
}
|
|
}
|
|
|
|
// OrderProcessingRequest 订单处理
|
|
type OrderProcessingRequest struct {
|
|
ReceiveAddress string
|
|
Currency string
|
|
Token string
|
|
Amount float64
|
|
TradeId string
|
|
BlockTransactionId string
|
|
}
|