Skip to content

Commit

Permalink
feat: add asset and chain id in entities
Browse files Browse the repository at this point in the history
  • Loading branch information
mj committed May 10, 2023
1 parent 2666c27 commit 9f860c7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
4 changes: 3 additions & 1 deletion entity/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ type Asset struct {
LogoPNG string `yaml:"logo_png"`
Types []string `yaml:"types"`
Standards []string `yaml:"standards"`
}

ChainUUID string
func (a *Asset) GetId() string {
return a.Id
}

func (a *Asset) GetName() string {
Expand Down
8 changes: 7 additions & 1 deletion entity/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const (
)

type Chain struct {
Id string `yaml:"id"`
ParentId string `yaml:"parent_id"`
Name string `yaml:"name"`
Symbol string `yaml:"symbol"`
Expand All @@ -17,15 +18,20 @@ type Chain struct {
Type ChainType `yaml:"type"`
}

func NewChain(name, symbol string, chainType ChainType, chainId string) *Chain {
func NewChain(Id, name, symbol string, chainType ChainType, chainId string) *Chain {
return &Chain{
Id: Id,
Name: name,
Symbol: symbol,
ChainId: chainId,
Type: chainType,
}
}

func (c *Chain) GetID() string {
return c.Id
}

func (c *Chain) GetName() string {
return c.Name
}
Expand Down
9 changes: 9 additions & 0 deletions resources/assets.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
bc08bb60-ebfb-11ed-bd6d-bce92fb9ddda:
id: bc08bb60-ebfb-11ed-bd6d-bce92fb9ddda
parent_id: ""
name: Ethereum
symbol: ETH
Expand All @@ -7,6 +8,7 @@ bc08bb60-ebfb-11ed-bd6d-bce92fb9ddda:
type: main
assets:
bc2cd3b5-ebfb-11ed-bd6d-bce92fb9ddda:
id: bc2cd3b5-ebfb-11ed-bd6d-bce92fb9ddda
name: Tether
symbol: USDT
contracts:
Expand All @@ -21,6 +23,7 @@ bc08bb60-ebfb-11ed-bd6d-bce92fb9ddda:
standards:
- ERC20
ae43c0bd-2587-4384-936d-24cc2e5a1b0c:
id: ae43c0bd-2587-4384-936d-24cc2e5a1b0c
name: Dai
symbol: DAI
contracts:
Expand All @@ -35,6 +38,7 @@ bc08bb60-ebfb-11ed-bd6d-bce92fb9ddda:
standards:
- ERC20
db4461d5-4747-436c-9d7c-51c88e597813:
id: db4461d5-4747-436c-9d7c-51c88e597813
name: Binance Coin
symbol: BNB
contracts:
Expand All @@ -48,6 +52,7 @@ bc08bb60-ebfb-11ed-bd6d-bce92fb9ddda:
types: [ ]
standards:
fa7bfc08-25dd-477d-bb83-bf0a1039b446:
id: fa7bfc08-25dd-477d-bb83-bf0a1039b446
name: USD Coin
symbol: USDC
contracts:
Expand All @@ -61,13 +66,15 @@ bc08bb60-ebfb-11ed-bd6d-bce92fb9ddda:
types: [ ]
standards:
cfc035ff-52c3-4357-bebd-02ad6813d123:
id: cfc035ff-52c3-4357-bebd-02ad6813d123
parent_id: ""
name: BNB Smart Chain (BEP20)
symbol: BNB
logo_png: resources/img/db4461d5-4747-436c-9d7c-51c88e597813.png
type: main
assets:
c4ed735b-9c87-4735-a029-fb11fef57ecb:
id: c4ed735b-9c87-4735-a029-fb11fef57ecb
name: XRP Coin
symbol: XRP
contracts:
Expand All @@ -81,6 +88,7 @@ cfc035ff-52c3-4357-bebd-02ad6813d123:
types: []
standards:
f438b0c8-3b98-4da7-88f3-10ff760b9ff1:
id: f438b0c8-3b98-4da7-88f3-10ff760b9ff1
parent_id: ""
name: Goerli
symbol: ETH
Expand All @@ -89,6 +97,7 @@ f438b0c8-3b98-4da7-88f3-10ff760b9ff1:
type: test
assets:
f0e13421-4798-45ed-9ce5-a559cdb5133e:
id: f0e13421-4798-45ed-9ce5-a559cdb5133e
name: Tether
symbol: USDT
contracts:
Expand Down

0 comments on commit 9f860c7

Please sign in to comment.