Skip to content

Commit

Permalink
Merge branch 'dp' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
scorpiotzh committed Nov 15, 2023
2 parents 5e8afdd + ea31d0b commit 6baafc7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
38 changes: 32 additions & 6 deletions dao/dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,14 @@ func Initialize(db *gorm.DB) (*DbDao, error) {
if err := tx.Model(TableTokenPriceInfo{}).
Where("token_id=?", tokenList[i].TokenId).
Updates(map[string]interface{}{
"chain_type": tokenList[i].ChainType,
"name": tokenList[i].Name,
"symbol": tokenList[i].Symbol,
"decimals": tokenList[i].Decimals,
"logo": tokenList[i].Logo,
"coin_type": tokenList[i].CoinType,
"chain_type": tokenList[i].ChainType,
"name": tokenList[i].Name,
"symbol": tokenList[i].Symbol,
"decimals": tokenList[i].Decimals,
"logo": tokenList[i].Logo,
"coin_type": tokenList[i].CoinType,
"display_name": tokenList[i].DisplayName,
"icon": tokenList[i].Icon,
}).Error; err != nil {
return err
}
Expand All @@ -120,6 +122,8 @@ var tokenList = []TableTokenPriceInfo{
Decimals: 8,
Logo: "https://app.did.id/images/components/portal-wallet.svg",
LastUpdatedAt: time.Now().Unix(),
DisplayName: ".bit Balance",
Icon: "dotbit-balance",
},
{
TokenId: "eth_eth",
Expand All @@ -131,6 +135,8 @@ var tokenList = []TableTokenPriceInfo{
Decimals: 18,
Logo: "https://app.did.id/images/components/ethereum.svg",
LastUpdatedAt: time.Now().Unix(),
DisplayName: "Ethereum",
Icon: "ethereum",
},
{
TokenId: "btc_btc",
Expand All @@ -142,6 +148,8 @@ var tokenList = []TableTokenPriceInfo{
Decimals: 8,
Logo: "https://app.did.id/images/components/bitcoin.svg",
LastUpdatedAt: time.Now().Unix(),
DisplayName: "Bitcoin",
Icon: "",
},
{
TokenId: "tron_trx",
Expand All @@ -153,6 +161,8 @@ var tokenList = []TableTokenPriceInfo{
Decimals: 6,
Logo: "https://app.did.id/images/components/tron.svg",
LastUpdatedAt: time.Now().Unix(),
DisplayName: "TRON",
Icon: "tron",
},
{
TokenId: "bsc_bnb",
Expand All @@ -164,6 +174,8 @@ var tokenList = []TableTokenPriceInfo{
Decimals: 18,
Logo: "https://app.did.id/images/components/binance-smart-chain.svg",
LastUpdatedAt: time.Now().Unix(),
DisplayName: "Binance",
Icon: "binance-smart-chain",
},
{
TokenId: "polygon_matic",
Expand All @@ -175,6 +187,8 @@ var tokenList = []TableTokenPriceInfo{
Decimals: 18,
Logo: "https://app.did.id/images/components/polygon.svg",
LastUpdatedAt: time.Now().Unix(),
DisplayName: "Polygon",
Icon: "polygon",
},
{
TokenId: "doge_doge",
Expand All @@ -186,6 +200,8 @@ var tokenList = []TableTokenPriceInfo{
Decimals: 8,
Logo: "https://app.did.id/images/components/doge.svg",
LastUpdatedAt: time.Now().Unix(),
DisplayName: "Dogecoin",
Icon: "dogecoin",
},
{
TokenId: "eth_erc20_usdt",
Expand All @@ -198,6 +214,8 @@ var tokenList = []TableTokenPriceInfo{
Logo: "",
Price: decimal.NewFromInt(1),
LastUpdatedAt: time.Now().Unix(),
DisplayName: "Ethereum",
Icon: "ethereum",
},
{
TokenId: "bsc_bep20_usdt",
Expand All @@ -210,6 +228,8 @@ var tokenList = []TableTokenPriceInfo{
Logo: "",
Price: decimal.NewFromInt(1),
LastUpdatedAt: time.Now().Unix(),
DisplayName: "Binance",
Icon: "binance-smart-chain",
},
{
TokenId: "tron_trc20_usdt",
Expand All @@ -222,6 +242,8 @@ var tokenList = []TableTokenPriceInfo{
Logo: "",
Price: decimal.NewFromInt(1),
LastUpdatedAt: time.Now().Unix(),
DisplayName: "TRON",
Icon: "tron",
},
{
TokenId: "stripe_usd",
Expand All @@ -233,6 +255,8 @@ var tokenList = []TableTokenPriceInfo{
Logo: "",
Price: decimal.NewFromInt(1),
LastUpdatedAt: time.Now().Unix(),
DisplayName: "by stripe",
Icon: "stripe",
},
{
TokenId: "did_point",
Expand All @@ -244,6 +268,8 @@ var tokenList = []TableTokenPriceInfo{
Logo: "",
Price: decimal.NewFromInt(1),
LastUpdatedAt: time.Now().Unix(),
DisplayName: "DIDPoint",
Icon: "didpoint",
},
}

Expand Down
2 changes: 2 additions & 0 deletions dao/dao_token_price_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ type TableTokenPriceInfo struct {
MarketCap decimal.Decimal `json:"market_cap" gorm:"column:market_cap;type:decimal(50, 8) NOT NULL DEFAULT '0.00000000' COMMENT ''"`
LastUpdatedAt int64 `json:"last_updated_at" gorm:"column:last_updated_at;type:bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT ''"`
Status int `json:"status" gorm:"column:status;type:smallint(6) NOT NULL DEFAULT '0' COMMENT '0: normal 1: banned'"`
Icon string `json:"icon" gorm:"column:icon; type:varchar(255) NOT NULL DEFAULT '' COMMENT '';"`
DisplayName string `json:"display_name" gorm:"column:display_name; type:varchar(255) NOT NULL DEFAULT '' COMMENT '';"`
CreatedAt time.Time `json:"created_at" gorm:"column:created_at;type:timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ''"`
UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at;type:timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ''"`
}
Expand Down

0 comments on commit 6baafc7

Please sign in to comment.