Skip to content

Commit

Permalink
max: convert chain network to global id
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Dec 16, 2024
1 parent 118b186 commit 0473611
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions pkg/exchange/max/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ import (
"github.com/c9s/bbgo/pkg/types"
)

func toGlobalNetwork(network string) string {
parts := strings.SplitN(network, "-", 2)
if len(parts) > 0 {
return parts[0]
}

return network
}

func toGlobalCurrency(currency string) string {
return strings.ToUpper(currency)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/exchange/max/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ func (e *Exchange) QueryDepositHistory(
TransactionID: d.TxID,
Status: toGlobalDepositStatus(d.State),
Confirmation: strconv.FormatInt(d.Confirmations, 10),
Network: d.NetworkProtocol,
Network: toGlobalNetwork(d.NetworkProtocol),
RawStatus: toRawStatusStr(d),
})
}
Expand Down

0 comments on commit 0473611

Please sign in to comment.