Skip to content

Commit

Permalink
Add BLAST and SCROLL (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
tw-daniel committed May 13, 2024
1 parent db559a2 commit c20f80f
Show file tree
Hide file tree
Showing 7 changed files with 255 additions and 115 deletions.
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

0 comments on commit c20f80f

Please sign in to comment.