Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion pkg/dia/scraper/exchange-scrapers/VelarScraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,17 @@ func (s *VelarScraper) Update() error {
}

if swapInfo.TokenIn == "" || swapInfo.TokenOut == "" {
for _, arg := range tx.ContractCall.FunctionArgs {
// This is a temporary workaround introduced due to a bug in hiro stacks API.
// Results returned from /blocks/{block_height}/transactions route have empty
// `name` field in `contract_call.function_args` list.
// TODO: remove this as soon as the issue is fixed.
normalizedTx, err := s.api.GetTransactionAt(tx.TxID)
if err != nil {
s.logger.WithError(err).Error("failed to GetTransactionAt")
continue
}

for _, arg := range normalizedTx.ContractCall.FunctionArgs {
switch arg.Name {
case "token-in":
swapInfo.TokenIn = arg.Repr[1:]
Expand Down