trustwallet / go-primitives

59 stars 25 forks source link

Ensure there is no assets in coins.yml which not exists in Postgres #106

Closed defisaur closed 1 year ago

defisaur commented 1 year ago

Found differences

id coins.yml postgres
19167 ZEL FLUX
508 Elrond MultiversX

Not exists

id name
10000321 KuCoin Community Chain
10002222 KavaEvm
18000 Meter
996 OKX Chain
10001284 Moonbeam
10008217 Klaytn
10001088 Metis
10001285 Moonriver
10000288 Boba

SQL query to insert missing assets

INSERT INTO assets (asset_id, name, symbol, type, token_id, coin, decimals, version, rating, enabled, verified, tags, created_at, updated_at)
VALUES ('c10000321', 'KuCoin Community Chain', 'KCS', 'coin', null, 10000321, 18, -1, 9999, true, true, null, now(), now()),
('c10002222', 'KavaEvm', 'KAVA', 'coin', null, 10002222, 18, -1, 9999, true, true, null, now(), now()),
('c18000', 'Meter', 'MTR', 'coin', null, 18000, 18, -1, 9999, true, true, null, now(), now()),
('c996', 'OKX Chain', 'OKT', 'coin', null, 996, 18, -1, 9999, true, true, null, now(), now()),
('c10001284', 'Moonbeam', 'GLMR', 'coin', null, 10001284, 18, -1, 9999, true, true, null, now(), now()),
('c10008217', 'Klaytn', 'KLAY', 'coin', null, 10008217, 18, -1, 9999, true, true, null, now(), now()),
('c10001088', 'Metis', 'METIS', 'coin', null, 10001088, 18, -1, 9999, true, true, null, now(), now()),
('c10001285', 'Moonriver', 'MOVR', 'coin', null, 10001285, 18, -1, 9999, true, true, null, now(), now()),
('c10000288', 'Boba', 'BOBAETH', 'coin', null, 10000288, 18, -1, 9999, true, true, null, now(), now())
RETURNING *;
defisaur commented 1 year ago

TODO: fix KAVA

edited query (it was not executed yet)