交易所接口

This commit is contained in:
zhongqiang
2025-06-27 17:26:16 +08:00
parent f5e8a4b990
commit 8b245587bb

View File

@@ -50,7 +50,7 @@ func (j *JttClient) FindUserForTokenMessage(address string) (res *FindUserForTok
paramMap["publicKey"] = j.PublicKey
paramMap["address"] = address
postRes, err := j.JttPost(paramMap)
postRes, err := j.JttPost("/findUserForTokenMessage", paramMap)
if err != nil {
return
}
@@ -71,6 +71,7 @@ func (j *JttClient) FindUserForTokenMessage(address string) (res *FindUserForTok
}
type FindUserForTokenMessageRes struct {
Code int `json:"code"`
Data *Data `json:"data"`
}
@@ -85,11 +86,11 @@ type UserToken struct {
WalletAddress string `json:"walletAddress"`
}
func (j *JttClient) JttPost(paramMap map[string]any) (res []byte, err error) {
func (j *JttClient) JttPost(url string, paramMap map[string]any) (res []byte, err error) {
bodyByte, _ := json.Marshal(paramMap)
req, err := http.NewRequest(http.MethodPost, j.ApiUrl+"/findUserForTokenMessage", bytes.NewBuffer(bodyByte))
req, err := http.NewRequest(http.MethodPost, j.ApiUrl+url, bytes.NewBuffer(bodyByte))
if err != nil {
return
}