trustwallet-assets/internal/processor/model.go
Daniel 72d5b319d4
Add address checksum validation for tokenlist files (#17416)
* Add address checksum validation for tokenlist files

* Remove updaters_manual.go, move tokenlist validation to assets-go-libs
2022-01-16 17:13:01 +03:00

52 lines
882 B
Go

package processor
import (
"github.com/trustwallet/assets/internal/file"
)
type (
Validator struct {
Name string
Run func(f *file.AssetFile) error
}
Fixer struct {
Name string
Run func(f *file.AssetFile) error
}
Updater struct {
Name string
Run func() error
}
)
type (
ForceListPair struct {
Token0 string
Token1 string
}
TradingPairs struct {
Data struct {
Pairs []TradingPair `json:"pairs"`
} `json:"data"`
}
TradingPair struct {
ID string `json:"id"`
ReserveUSD string `json:"reserveUSD"`
VolumeUSD string `json:"volumeUSD"`
TxCount string `json:"txCount"`
Token0 *TokenInfo `json:"token0"`
Token1 *TokenInfo `json:"token1"`
}
TokenInfo struct {
ID string `json:"id"`
Symbol string `json:"symbol"`
Name string `json:"name"`
Decimals string `json:"decimals"`
}
)