Skip to content

Commit

Permalink
Update v5_asset_service.go (hirokisan#177)
Browse files Browse the repository at this point in the history
https://bybit-exchange.github.io/docs/v5/asset/unitransfer

It should be fromMemberId, not fromMemberID (and toMemberId, not toMemberID)

Also, fromAccountType can be equal to toAccountType

e.g you can transfer from one spot subaccount to another spot subaccount
  • Loading branch information
grkamil authored Jun 28, 2024
1 parent 3c03f4e commit 7b1d4c2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions v5_asset_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ type V5CreateUniversalTransferParam struct {
Amount string `json:"amount"`
FromAccountType AccountTypeV5 `json:"fromAccountType"`
ToAccountType AccountTypeV5 `json:"toAccountType"`
FromMemberID int `json:"fromMemberID"`
ToMemberID int `json:"toMemberID"`
FromMemberID int `json:"fromMemberId"`
ToMemberID int `json:"toMemberId"`
}

func (p V5CreateUniversalTransferParam) validate() error {
Expand All @@ -168,9 +168,6 @@ func (p V5CreateUniversalTransferParam) validate() error {
if p.Coin == "" || p.FromAccountType == "" || p.ToAccountType == "" {
return fmt.Errorf("coin, fromAccountType and toAccountType needed")
}
if p.FromAccountType == p.ToAccountType {
return fmt.Errorf("toAccountType and fromAccountType must differ")
}
return nil
}

Expand Down

0 comments on commit 7b1d4c2

Please sign in to comment.