rename Withdrawal to Withdraw since it's a noun

This commit is contained in:
c9s 2022-06-02 11:42:03 +08:00
parent c0f5c1963e
commit 5527b3c48a
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
4 changed files with 7 additions and 7 deletions

View File

@ -402,8 +402,8 @@ func (e *Exchange) queryIsolatedMarginAccount(ctx context.Context) (*types.Accou
return a, nil
}
func (e *Exchange) Withdrawal(ctx context.Context, asset string, amount fixedpoint.Value, address string, options *types.WithdrawalOptions) error {
req := e.client.NewCreateWithdrawService()
func (e *Exchange) Withdraw(ctx context.Context, asset string, amount fixedpoint.Value, address string, options *types.WithdrawalOptions) error {
req := e.client2.NewWithdrawRequest()
req.Coin(asset)
req.Address(address)
req.Amount(fmt.Sprintf("%f", amount.Float64()))

View File

@ -407,7 +407,7 @@ func toMaxSubmitOrder(o types.SubmitOrder) (*maxapi.SubmitOrder, error) {
return &maxOrder, nil
}
func (e *Exchange) Withdrawal(ctx context.Context, asset string, amount fixedpoint.Value, address string, options *types.WithdrawalOptions) error {
func (e *Exchange) Withdraw(ctx context.Context, asset string, amount fixedpoint.Value, address string, options *types.WithdrawalOptions) error {
asset = toLocalCurrency(asset)
addresses, err := e.client.WithdrawalService.NewGetWithdrawalAddressesRequest().

View File

@ -84,7 +84,7 @@ func (r *WithdrawalRequest) String() string {
}
func (r *WithdrawalRequest) PlainText() string {
return fmt.Sprintf("Withdrawal request: sending %s %s from %s -> %s",
return fmt.Sprintf("Withdraw request: sending %s %s from %s -> %s",
r.Amount.FormatString(4),
r.Asset,
r.FromSession,
@ -94,7 +94,7 @@ func (r *WithdrawalRequest) PlainText() string {
func (r *WithdrawalRequest) SlackAttachment() slack.Attachment {
var color = "#DC143C"
title := util.Render(`Withdrawal Request {{ .Asset }}`, r)
title := util.Render(`Withdraw Request {{ .Asset }}`, r)
return slack.Attachment{
// Pretext: "",
// Text: text,
@ -265,7 +265,7 @@ func (s *Strategy) checkBalance(ctx context.Context, sessions map[string]*bbgo.E
Amount: requiredAmount,
})
if err := withdrawalService.Withdrawal(ctx, s.Asset, requiredAmount, toAddress.Address, &types.WithdrawalOptions{
if err := withdrawalService.Withdraw(ctx, s.Asset, requiredAmount, toAddress.Address, &types.WithdrawalOptions{
Network: toAddress.Network,
AddressTag: toAddress.AddressTag,
}); err != nil {

View File

@ -122,7 +122,7 @@ type ExchangeTransferService interface {
}
type ExchangeWithdrawalService interface {
Withdrawal(ctx context.Context, asset string, amount fixedpoint.Value, address string, options *WithdrawalOptions) error
Withdraw(ctx context.Context, asset string, amount fixedpoint.Value, address string, options *WithdrawalOptions) error
}
type ExchangeRewardService interface {