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

Support ICP #171

Merged
merged 2 commits into from
May 22, 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
262 changes: 144 additions & 118 deletions coin/coins.go

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

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

- id: 223
symbol: ICP
handle: internet_computer
name: Internet Computer
decimals: 8
blockchain: Internet Computer
isTokenSupported: false
2 changes: 2 additions & 0 deletions types/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ func GetChainFromAssetType(assetType string) (coin.Coin, error) {
return coin.Blast(), nil
case SCROLL:
return coin.Scroll(), nil
case ICP:
return coin.Internet_computer(), nil
}

return coin.Coin{}, errors.New("unknown asset type: " + assetType)
Expand Down
6 changes: 5 additions & 1 deletion types/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ const (
MERLIN TokenType = "MERLIN"
BLAST TokenType = "BLAST"
SCROLL TokenType = "SCROLL"
ICP TokenType = "ICP"
)

const (
Expand Down Expand Up @@ -233,6 +234,7 @@ func GetTokenTypes() []TokenType {
MERLIN,
BLAST,
SCROLL,
ICP,
}
}

Expand Down Expand Up @@ -348,6 +350,8 @@ func GetTokenType(c uint, tokenID string) (string, bool) {
return string(BLAST), true
case coin.SCROLL:
return string(SCROLL), true
case coin.INTERNET_COMPUTER:
return string(ICP), true
default:
return "", false
}
Expand Down Expand Up @@ -403,7 +407,7 @@ func GetTokenVersion(tokenType string) (TokenVersion, error) {
return TokenVersionV14, nil
case BRC20:
return TokenVersionV16, nil
case MERLIN:
case MERLIN, ICP:
return TokenVersionV17, nil
case BLAST, SCROLL:
return TokenVersionV18, nil
Expand Down
Loading