-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(token-registry): Implement strongly typed Nibiru Token Registry …
…and generation command (#2144) * wip!: checkpoint * fix(evm): query of NIBI should use bank state, not the StateDB * add jSON save behavior to token registry * feat: Generate the Nibiru Token Registry files * chore: changelog * refactor: linter and fmt * chore: more tests and address PR comments * one more PR comment
- Loading branch information
1 parent
de7239f
commit e5274c0
Showing
16 changed files
with
719 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Nibiru/token-registry | ||
|
||
This directory implements the Nibiru Token Registry by providing a means to | ||
register offchain digital token metadata to onchain identifiers for use with | ||
applications like wallets. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,199 @@ | ||
package tokenregistry | ||
|
||
func NibiruAssetList() AssetList { | ||
var tokens = TOKENS() | ||
for idx, token := range tokens { | ||
tokens[idx] = token.GitHubify() | ||
} | ||
|
||
return AssetList{ | ||
Schema: "../assetlist.schema.json", | ||
ChainName: "nibiru", | ||
Assets: tokens, | ||
} | ||
} | ||
|
||
func TOKENS() []Token { | ||
return []Token{ | ||
{ | ||
Description: "The native token of Nibiru blockchain", | ||
ExtendedDescription: some("Nibiru is a smart contract ecosystem with a high-performance, EVM-equivalent execution layer. Nibiru is engineered to meet the growing demand for versatile, scalable, and easy-to-use Web3 applications."), | ||
Socials: &SocialLinks{ | ||
Website: some("https://nibiru.fi"), | ||
Twitter: some("https://twitter.com/nibiruchain"), | ||
}, | ||
DenomUnits: []DenomUnit{ | ||
{Denom: "unibi", Exponent: 0}, | ||
{Denom: "nibi", Exponent: 6}, | ||
{Denom: "attonibi", Exponent: 18}, | ||
}, | ||
Base: "unibi", | ||
Name: "Nibiru", | ||
Display: "nibi", | ||
Symbol: "NIBI", | ||
LogoURIs: &LogoURIs{ | ||
Png: some("./img/0000_nibiru.png"), | ||
Svg: some("./img/0000_nibiru.svg"), | ||
}, | ||
CoingeckoID: some("nibiru"), | ||
Images: []AssetImage{ | ||
{ | ||
Png: some("./img/0000_nibiru.png"), | ||
Svg: some("./img/0000_nibiru.svg"), | ||
Theme: &ImageTheme{ | ||
PrimaryColorHex: some("#14c0ce"), | ||
}, | ||
}, | ||
}, | ||
TypeAsset: TypeAsset_SDKCoin, | ||
}, | ||
{ | ||
Description: "Liquid Staked Nibiru (Eris)", | ||
ExtendedDescription: some("Liquid Staked Nibiru, powered by Eris Protocol's amplifier contracts. Nibiru is a smart contract ecosystem with a high-performance, EVM-equivalent execution layer. Nibiru is engineered to meet the growing demand for versatile, scalable, and easy-to-use Web3 applications."), | ||
Socials: &SocialLinks{ | ||
Website: some("https://nibiru.fi/docs/learn/liquid-stake/"), | ||
Twitter: some("https://x.com/eris_protocol"), | ||
}, | ||
DenomUnits: []DenomUnit{ | ||
{Denom: "tf/nibi1udqqx30cw8nwjxtl4l28ym9hhrp933zlq8dqxfjzcdhvl8y24zcqpzmh8m/ampNIBI", Exponent: 0}, | ||
{Denom: "stNIBI", Exponent: 6}, | ||
}, | ||
Base: "tf/nibi1udqqx30cw8nwjxtl4l28ym9hhrp933zlq8dqxfjzcdhvl8y24zcqpzmh8m/ampNIBI", | ||
Name: "Liquid Staked Nibiru (Eris)", | ||
Display: "stNIBI", | ||
Symbol: "stNIBI", | ||
LogoURIs: &LogoURIs{ | ||
Png: some("./img/0001_stnibi-500x500.png"), | ||
Svg: some("./img/0001_stnibi-500x500.svg"), | ||
}, | ||
Images: []AssetImage{ | ||
{ | ||
Png: some("./img/0001_stnibi-500x500.png"), | ||
Svg: some("./img/0001_stnibi-500x500.svg"), | ||
Theme: &ImageTheme{ | ||
PrimaryColorHex: some("#14c0ce"), | ||
}, | ||
}, | ||
}, | ||
Traces: []Trace{ | ||
{ | ||
Type: "liquid-stake", | ||
Counterparty: Counterparty{ | ||
ChainName: "nibiru", | ||
BaseDenom: "unibi", | ||
}, | ||
Provider: some("Eris Protocol"), | ||
}, | ||
}, | ||
TypeAsset: TypeAsset_SDKCoin, | ||
}, | ||
{ | ||
Description: "Noble USDC on Nibiru", | ||
DenomUnits: []DenomUnit{ | ||
{Denom: "ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349", Exponent: 0}, | ||
{Denom: "usdc", Exponent: 6}, | ||
}, | ||
Base: "ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349", | ||
Name: "Noble USDC", | ||
Display: "usdc", | ||
Symbol: "USDC", | ||
Traces: []Trace{ | ||
{ | ||
Type: TraceType_IBC, | ||
Counterparty: Counterparty{ | ||
ChainName: "noble", | ||
BaseDenom: "uusdc", | ||
ChannelID: some("channel-67"), | ||
}, | ||
Chain: &TraceChainInfo{ | ||
ChannelID: "channel-2", | ||
Path: "transfer/channel-2/uusdc", | ||
}, | ||
}, | ||
}, | ||
Images: []AssetImage{ | ||
{ | ||
ImageSync: &ImageSync{ | ||
ChainName: "noble", | ||
BaseDenom: "uusdc", | ||
}, | ||
Png: some("./img/0002_usdc.png"), | ||
Svg: some("./img/0002_usdc.svg"), | ||
Theme: &ImageTheme{ | ||
Circle: some(true), | ||
PrimaryColorHex: some("#2775CA"), | ||
}, | ||
}, | ||
}, | ||
LogoURIs: &LogoURIs{ | ||
Png: some("./img/0002_usdc.png"), | ||
Svg: some("./img/0002_usdc.svg"), | ||
}, | ||
TypeAsset: TypeAsset_ICS20, | ||
}, | ||
{ | ||
Description: "AXV", | ||
ExtendedDescription: some("AXV is the Astrovault token."), | ||
Socials: &SocialLinks{ | ||
Website: some("https://astrovault.io/"), | ||
Twitter: some("https://x.com/axvdex"), | ||
}, | ||
DenomUnits: []DenomUnit{ | ||
{Denom: "tf/nibi1vetfuua65frvf6f458xgtjerf0ra7wwjykrdpuyn0jur5x07awxsfka0ga/axv", Exponent: 0}, | ||
{Denom: "AXV", Exponent: 6}, | ||
}, | ||
Base: "tf/nibi1vetfuua65frvf6f458xgtjerf0ra7wwjykrdpuyn0jur5x07awxsfka0ga/axv", | ||
Name: "AXV", | ||
Display: "AXV", | ||
Symbol: "AXV", | ||
LogoURIs: &LogoURIs{ | ||
Png: some("./img/0003_astrovault-axv.png"), | ||
Svg: some("./img/0003_astrovault-axv.svg"), | ||
}, | ||
Images: []AssetImage{ | ||
{ | ||
ImageSync: &ImageSync{ | ||
ChainName: "neutron", | ||
BaseDenom: "cw20:neutron10dxyft3nv4vpxh5vrpn0xw8geej8dw3g39g7nqp8mrm307ypssksau29af", | ||
}, | ||
Png: some("./img/0003_astrovault-axv.png"), | ||
Svg: some("./img/0003_astrovault-axv.svg"), | ||
}, | ||
}, | ||
TypeAsset: TypeAsset_SDKCoin, | ||
}, | ||
{ | ||
Description: "uoprek", | ||
DenomUnits: []DenomUnit{ | ||
{Denom: "tf/nibi149m52kn7nvsg5nftvv4fh85scsavpdfxp5nr7zasz97dum89dp5qkyhy0t/uoprek", Exponent: 0}, | ||
}, | ||
Base: "tf/nibi149m52kn7nvsg5nftvv4fh85scsavpdfxp5nr7zasz97dum89dp5qkyhy0t/uoprek", | ||
Name: "uoprek", | ||
Display: "tf/nibi149m52kn7nvsg5nftvv4fh85scsavpdfxp5nr7zasz97dum89dp5qkyhy0t/uoprek", | ||
Symbol: "UOPREK", | ||
TypeAsset: TypeAsset_SDKCoin, | ||
}, | ||
{ | ||
Description: "utestate", | ||
DenomUnits: []DenomUnit{ | ||
{Denom: "tf/nibi1lp28kx3gz0prsztl024z730ufkg3alahaq3e7a6gae22nk0dqdvsyrrgqw/utestate", Exponent: 0}, | ||
}, | ||
Base: "tf/nibi1lp28kx3gz0prsztl024z730ufkg3alahaq3e7a6gae22nk0dqdvsyrrgqw/utestate", | ||
Name: "utestate", | ||
Display: "tf/nibi1lp28kx3gz0prsztl024z730ufkg3alahaq3e7a6gae22nk0dqdvsyrrgqw/utestate", | ||
Symbol: "UTESTATE", | ||
TypeAsset: TypeAsset_SDKCoin, | ||
}, | ||
{ | ||
Description: "npp", | ||
DenomUnits: []DenomUnit{ | ||
{Denom: "tf/nibi1xpp7yn0tce62ffattws3gpd6v0tah0mlevef3ej3r4pnfvsehcgqk3jvxq/NPP", Exponent: 0}, | ||
}, | ||
Base: "tf/nibi1xpp7yn0tce62ffattws3gpd6v0tah0mlevef3ej3r4pnfvsehcgqk3jvxq/NPP", | ||
Name: "npp", | ||
Display: "tf/nibi1xpp7yn0tce62ffattws3gpd6v0tah0mlevef3ej3r4pnfvsehcgqk3jvxq/NPP", | ||
Symbol: "NPP", | ||
TypeAsset: TypeAsset_SDKCoin, | ||
}, | ||
} | ||
} |
Oops, something went wrong.