mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
rename Withdrawal to Withdraw since it's a noun
This commit is contained in:
parent
c0f5c1963e
commit
5527b3c48a
|
@ -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()))
|
||||
|
|
|
@ -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().
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user