Skip to content

Commit

Permalink
New coins (#116)
Browse files Browse the repository at this point in the history
* new coins
  • Loading branch information
defisaur authored Jul 31, 2023
1 parent c766041 commit 8aee75c
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 1 deletion.
27 changes: 26 additions & 1 deletion coin/coins.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions coin/coins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -742,3 +742,10 @@
name: Acala
decimals: 12
blockchain: Polkadot

- id: 10000787
symbol: ACA
handle: acalaevm
name: Acala EVM
decimals: 18
blockchain: Ethereum
2 changes: 2 additions & 0 deletions coin/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ func GetCoinExploreURL(c Coin, tokenID, tokenType string) (string, error) {
return fmt.Sprintf("https://acala.subscan.io/custom_token?customTokenId=%s", tokenID), nil
}
return fmt.Sprintf("https://acala.subscan.io/system_token_detail?unique_id=%s", tokenID), nil
case ACALAEVM:
return fmt.Sprintf("https://blockscout.acala.network/token/%s", tokenID), nil
}

return "", errors.New("no explorer for coin: " + c.Handle)
Expand Down
1 change: 1 addition & 0 deletions coin/models_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ var evmCoinsTestSet = map[uint]struct{}{
POLYGONZKEVM: {},
ZKSYNC: {},
CFXEVM: {},
ACALAEVM: {},
}

// TestEvmCoinsList This test will automatically fail when new EVM chain is added to coins.yml
Expand Down
2 changes: 2 additions & 0 deletions types/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ func GetChainFromAssetType(assetType string) (coin.Coin, error) {
return coin.Cfxevm(), nil
case ACA:
return coin.Acala(), nil
case ACALAEVM:
return coin.Acalaevm(), nil
}

return coin.Coin{}, errors.New("unknown asset type: " + assetType)
Expand Down
1 change: 1 addition & 0 deletions types/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const (
FA2 TokenType = "FA2"
CFXEVM TokenType = "CFXEVM"
ACA TokenType = "ACA"
ACALAEVM TokenType = "ACALAEVM"
)

const (
Expand Down

0 comments on commit 8aee75c

Please sign in to comment.