mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +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
|
return a, 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 {
|
||||||
req := e.client.NewCreateWithdrawService()
|
req := e.client2.NewWithdrawRequest()
|
||||||
req.Coin(asset)
|
req.Coin(asset)
|
||||||
req.Address(address)
|
req.Address(address)
|
||||||
req.Amount(fmt.Sprintf("%f", amount.Float64()))
|
req.Amount(fmt.Sprintf("%f", amount.Float64()))
|
||||||
|
|
|
@ -407,7 +407,7 @@ func toMaxSubmitOrder(o types.SubmitOrder) (*maxapi.SubmitOrder, error) {
|
||||||
return &maxOrder, nil
|
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)
|
asset = toLocalCurrency(asset)
|
||||||
|
|
||||||
addresses, err := e.client.WithdrawalService.NewGetWithdrawalAddressesRequest().
|
addresses, err := e.client.WithdrawalService.NewGetWithdrawalAddressesRequest().
|
||||||
|
|
|
@ -84,7 +84,7 @@ func (r *WithdrawalRequest) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *WithdrawalRequest) PlainText() 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.Amount.FormatString(4),
|
||||||
r.Asset,
|
r.Asset,
|
||||||
r.FromSession,
|
r.FromSession,
|
||||||
|
@ -94,7 +94,7 @@ func (r *WithdrawalRequest) PlainText() string {
|
||||||
|
|
||||||
func (r *WithdrawalRequest) SlackAttachment() slack.Attachment {
|
func (r *WithdrawalRequest) SlackAttachment() slack.Attachment {
|
||||||
var color = "#DC143C"
|
var color = "#DC143C"
|
||||||
title := util.Render(`Withdrawal Request {{ .Asset }}`, r)
|
title := util.Render(`Withdraw Request {{ .Asset }}`, r)
|
||||||
return slack.Attachment{
|
return slack.Attachment{
|
||||||
// Pretext: "",
|
// Pretext: "",
|
||||||
// Text: text,
|
// Text: text,
|
||||||
|
@ -265,7 +265,7 @@ func (s *Strategy) checkBalance(ctx context.Context, sessions map[string]*bbgo.E
|
||||||
Amount: requiredAmount,
|
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,
|
Network: toAddress.Network,
|
||||||
AddressTag: toAddress.AddressTag,
|
AddressTag: toAddress.AddressTag,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
|
|
@ -122,7 +122,7 @@ type ExchangeTransferService interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExchangeWithdrawalService 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 {
|
type ExchangeRewardService interface {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user