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 BLAST and SCROLL #170

Merged
merged 1 commit into from
May 13, 2024
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
285 changes: 170 additions & 115 deletions coin/coins.go

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

16 changes: 16 additions & 0 deletions coin/coins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1021,3 +1021,19 @@
decimals: 18
blockchain: Ethereum
isTokenSupported: true

- id: 81457
symbol: ETH
handle: blast
name: Blast
decimals: 18
blockchain: Ethereum
isTokenSupported: true

- id: 534352
symbol: ETH
handle: scroll
name: Scroll
decimals: 18
blockchain: Ethereum
isTokenSupported: true
4 changes: 4 additions & 0 deletions coin/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ func GetCoinExploreURL(c Coin, tokenID, tokenType string) (string, error) {
return fmt.Sprintf("https://explorer.zetachain.com/address/%s", tokenID), nil
case BITCOIN:
return fmt.Sprintf("https://unisat.io/brc20/%s", tokenID), nil
case BLAST:
return fmt.Sprintf("https://blastscan.io/token/%s", tokenID), nil
case SCROLL:
return fmt.Sprintf("https://scrollscan.com/token/%s", tokenID), nil
}

return "", errors.New("no explorer for coin: " + c.Handle)
Expand Down
22 changes: 22 additions & 0 deletions coin/models_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,26 @@ func TestGetCoinExploreURL(t *testing.T) {
want: "https://explorer.celo.org/mainnet/address/0x639A647fbe20b6c8ac19E48E2de44ea792c62c5C",
wantErr: false,
},
{
name: "Test Blast",
args: args{
addr: "0x4300000000000000000000000000000000000004",
tokenType: "BLAST",
chain: Blast(),
},
want: "https://blastscan.io/token/0x4300000000000000000000000000000000000004",
wantErr: false,
},
{
name: "Test Scroll",
args: args{
addr: "0xf55bec9cafdbe8730f096aa55dad6d22d44099df",
tokenType: "SCROLL",
chain: Scroll(),
},
want: "https://scrollscan.com/token/0xf55bec9cafdbe8730f096aa55dad6d22d44099df",
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down Expand Up @@ -456,6 +476,8 @@ var evmCoinsTestSet = map[uint]struct{}{
MANTA: {},
ZETAEVM: {},
MERLIN: {},
BLAST: {},
SCROLL: {},
}

// TestEvmCoinsList This test will automatically fail when new EVM chain is added to coins.yml
Expand Down
Loading
Loading