Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add USDT KAVAevm #26511

Merged
merged 27 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "Tether",
"symbol": "USDT",
"type": "KAVAEVM",
Copy link
Contributor

@defisaur defisaur Oct 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vcoolish @cryptomanz1 KAVAEVM (not KAVAERC20) as requested

"decimals": 6,
"description": "Tether (USDT) is a cryptocurrency with a value meant to mirror the value of the U.S. dollar.",
"website": "https://tether.to",
"explorer": "https://explorer.kava.io/token/0x919C1c267BC06a7039e03fcc2eF738525769109c",
"status": "active",
"id": "0x919C1c267BC06a7039e03fcc2eF738525769109c",
"links": [
{
"name": "facebook",
"url": "https://facebook.com/tether.to/"
},
{
"name": "twitter",
"url": "https://twitter.com/Tether_to/"
},
{
"name": "coinmarketcap",
"url": "https://coinmarketcap.com/ru/currencies/tether/"
}
],
"tags": [
"stablecoin"
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ go 1.18
require (
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.7.0
github.com/trustwallet/assets-go-libs v0.3.6
github.com/trustwallet/assets-go-libs v0.3.7
github.com/trustwallet/go-libs v0.7.3
github.com/trustwallet/go-primitives v0.0.95
github.com/trustwallet/go-primitives v0.1.8
)

require (
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ github.com/trustwallet/assets-go-libs v0.3.6-0.20230629071828-ea4bb0afbcd1 h1:Ml
github.com/trustwallet/assets-go-libs v0.3.6-0.20230629071828-ea4bb0afbcd1/go.mod h1:4BokTTw6UBPEsyXv8jHmX07bKECLcDbzX8YnIBNrCg8=
github.com/trustwallet/assets-go-libs v0.3.6 h1:JJO/1R8YxMiYt8aDq1ttIhMEj8zjh/LmWCjYetKr3nc=
github.com/trustwallet/assets-go-libs v0.3.6/go.mod h1:4BokTTw6UBPEsyXv8jHmX07bKECLcDbzX8YnIBNrCg8=
github.com/trustwallet/assets-go-libs v0.3.7 h1:i33k7eD1DFG+0mRFkXhB3qjTJPb87KkBi+4W/QAMvxI=
github.com/trustwallet/assets-go-libs v0.3.7/go.mod h1:4BokTTw6UBPEsyXv8jHmX07bKECLcDbzX8YnIBNrCg8=
github.com/trustwallet/go-libs v0.7.3 h1:X5KTj2/582Iv/3Pbm9AKPABBlwGE0tLGbQir66jD6U0=
github.com/trustwallet/go-libs v0.7.3/go.mod h1:5TQECBJo2ZUhGvB4pTKtyYeclGhzlYooVv/EufU4Axk=
github.com/trustwallet/go-primitives v0.0.77 h1:iHEyXUQFguF1ro2boze/10xqiN8eGRaorpcUQHTa+ok=
Expand All @@ -271,6 +273,10 @@ github.com/trustwallet/go-primitives v0.0.88 h1:wt5A6Wf2pnobWUYcnfOEbCIWZz+2BvdI
github.com/trustwallet/go-primitives v0.0.88/go.mod h1:GN9WNIOvtz9j77FSYLEqC7apbMlzQnFLNO9LOCMy5Mc=
github.com/trustwallet/go-primitives v0.0.95 h1:iqJ6VnxxMNnO799ayYvX9iyKo6mDUZ5rAqeb0WcBbgs=
github.com/trustwallet/go-primitives v0.0.95/go.mod h1:GN9WNIOvtz9j77FSYLEqC7apbMlzQnFLNO9LOCMy5Mc=
github.com/trustwallet/go-primitives v0.1.8-0.20231006102715-8e7efc6f7540 h1:vSIML835Df7uygBDUw6aSm59L03jw7p/8gF4tjjNb9A=
github.com/trustwallet/go-primitives v0.1.8-0.20231006102715-8e7efc6f7540/go.mod h1:GN9WNIOvtz9j77FSYLEqC7apbMlzQnFLNO9LOCMy5Mc=
github.com/trustwallet/go-primitives v0.1.8 h1:WjZ80+nJW93PDkbb8401JBOMgU/jJ7C8y9TrMBysICM=
github.com/trustwallet/go-primitives v0.1.8/go.mod h1:GN9WNIOvtz9j77FSYLEqC7apbMlzQnFLNO9LOCMy5Mc=
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
9 changes: 6 additions & 3 deletions internal/processor/fixers.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,12 @@ func (s *Service) FixAssetInfo(f *file.AssetFile) error {
expectedTokenType = strings.ToUpper(assetType)
}

if chain.ID != f.Chain().ID || !strings.EqualFold(assetType, expectedTokenType) {
assetInfo.Type = &expectedTokenType
isModified = true
// https://github.com/trustwallet/backend/issues/2561
if chain.ID != coin.CRYPTOORG && chain.ID != coin.CRONOS {
if chain.ID != f.Chain().ID || !strings.EqualFold(assetType, expectedTokenType) {
assetInfo.Type = &expectedTokenType
isModified = true
}
}

// Fix asset id.
Expand Down
9 changes: 6 additions & 3 deletions internal/processor/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,12 @@ func (s *Service) ValidateAssetInfoFile(f *file.AssetFile) error {
return err
}

err := info.ValidateAsset(assetInfo, f.Chain(), f.Asset())
if err != nil {
return err
// https://github.com/trustwallet/backend/issues/2561
if f.Chain() != coin.Cryptoorg() && f.Chain() != coin.Cronos() {
err := info.ValidateAsset(assetInfo, f.Chain(), f.Asset())
if err != nil {
return err
}
}

return nil
Expand Down