Skip to content

Commit

Permalink
Support ICP (#171)
Browse files Browse the repository at this point in the history
* support ICP

* support ICP
  • Loading branch information
iCell authored May 22, 2024
1 parent c20f80f commit 7588e65
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 119 deletions.
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

0 comments on commit 7588e65

Please sign in to comment.