Skip to content

Commit

Permalink
Merge pull request #30 from oraichain/feat/dynamic-token-list
Browse files Browse the repository at this point in the history
Feat/dynamic token list
  • Loading branch information
trungbach authored Dec 20, 2024
2 parents df77108 + da8a9d9 commit 08fb28c
Show file tree
Hide file tree
Showing 39 changed files with 516 additions and 180 deletions.
6 changes: 5 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
nodeLinker: node-modules
nodeLinker: node-modules

npmAuthToken: "${{ secrets.NPM_TOKEN }}"

npmRegistryServer: "https://registry.npmjs.org"
14 changes: 4 additions & 10 deletions CHAIN_REGISTRY.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ A sample `Oraichain.json` includes the following information.
"coinDecimals": 6,
"coinGeckoId": "oraichain-token",
"bridgeTo": ["0x38", "0x01", "injective-1"],
"coinImageUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/7533.png",
"coinImageUrl": "https://raw.githubusercontent.com/cosmos/chain-registry/master/oraichain/images/orai-token.png",
"gasPriceStep": { "low": 0.003, "average": 0.005, "high": 0.007 }
},
"feeCurrencies": [
Expand All @@ -63,7 +63,7 @@ A sample `Oraichain.json` includes the following information.
"coinDecimals": 6,
"coinGeckoId": "oraichain-token",
"bridgeTo": ["0x38", "0x01", "injective-1"],
"coinImageUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/7533.png",
"coinImageUrl": "https://raw.githubusercontent.com/cosmos/chain-registry/master/oraichain/images/orai-token.png",
"gasPriceStep": { "low": 0.003, "average": 0.005, "high": 0.007 }
}
],
Expand All @@ -76,13 +76,7 @@ A sample `Oraichain.json` includes the following information.
"bech32PrefixConsAddr": "oraivalcons",
"bech32PrefixConsPub": "oraivalconspub"
},
"features": [
"stargate",
"ibc-transfer",
"cosmwasm",
"wasmd_0.24+",
"no-legacy-stdTx"
],
"features": ["stargate", "ibc-transfer", "cosmwasm", "wasmd_0.24+", "no-legacy-stdTx"],
"txExplorer": {
"name": "Oraiscan",
"txUrl": "https://scan.orai.io/txs/{txHash}",
Expand All @@ -95,7 +89,7 @@ A sample `Oraichain.json` includes the following information.
"coinDecimals": 6,
"coinGeckoId": "oraichain-token",
"bridgeTo": ["0x38", "0x01", "injective-1"],
"coinImageUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/7533.png",
"coinImageUrl": "https://raw.githubusercontent.com/cosmos/chain-registry/master/oraichain/images/orai-token.png",
"gasPriceStep": { "low": 0.003, "average": 0.005, "high": 0.007 }
},
{
Expand Down
35 changes: 35 additions & 0 deletions FEATURES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
The repository contains various logic related to the Oraichain SDK, which includes handling chain information, token items, and supported chain information. Here are some key areas of logic in the repository:

## Chain Information Handling:

Classes like `ChainInfoReader`, `ChainInfoReaderFromBackend`, `ChainInfoReaderFromGit`, and `ChainInfoReaderFromGitRaw` are responsible for reading chain information from various sources such as backend services, GitHub, and raw GitHub content.

The `OraiCommon` class provides methods to initialize chain information from different sources.

## Token Items Handling:

Classes like `TokenItems` and `TokenItemsImpl` manage token items.

The repository includes logic for handling token items, such as fetching and managing token data.

## Supported Chain Information:

Classes like `SupportedChainInfoReader` and `SupportedChainInfoReaderFromGit` handle reading supported chain information from GitHub.

Functions like `readSupportedChainInfo` are used to fetch and process supported chain information.

## Helpers and Utilities:

The repository includes various helper functions and utilities in files like `index.ts`, which provide functionalities such as making HTTP requests with retries, parsing transactions, and converting numbers.

## Constants and Configuration:

Constants related to chain IDs and registry endpoints are defined in files like `chain-ids.ts` and `chain-registry.ts`.

## Package Management:

The repository uses tools like Lerna and Nx for managing multiple packages and their dependencies. The configuration for these tools can be found in files like `lerna.json` and `nx.json`.

## Documentation:

The repository includes documentation files like `CHAIN_REGISTRY.md` that provide information about the chain registry mechanism and how to integrate different blockchains with the Oraichain ecosystem.
27 changes: 25 additions & 2 deletions chains/0x01.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,24 @@
"$schema": "../chain.schema.json",
"rpc": "https://rpc.ankr.com/eth",
"chainId": "0x01",
"chainName": "ethereum",
"chainName": "Ethereum",
"bip44": { "coinType": 60 },
"coinType": 60,
"networkType": "evm",
"features": ["isEvm"],
"chainSymbolImageUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/1027.png",
"feeCurrencies": [
{
"coinDenom": "ETH",
"coinMinimalDenom": "eth",
"contractAddress": "",
"coinDecimals": 18,
"bridgeTo": ["Oraichain"],
"coinGeckoId": "ethereum",
"coinImageUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/1027.png",
"gasPriceStep": { "low": 0, "average": 0.025, "high": 0.04 }
}
],
"currencies": [
{
"coinDenom": "ORAI",
Expand All @@ -16,7 +29,7 @@
"bridgeTo": ["Oraichain"],
"coinGeckoId": "oraichain-token",
"prefixToken": "eth-mainnet",
"coinImageUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/7533.png"
"coinImageUrl": "https://raw.githubusercontent.com/cosmos/chain-registry/master/oraichain/images/orai-token.png"
},
{
"coinDenom": "USDC",
Expand Down Expand Up @@ -76,6 +89,16 @@
"coinGeckoId": "oraidex",
"prefixToken": "eth-mainnet",
"coinImageUrl": "https://i.ibb.co/VmMJtf7/oraix.png"
},
{
"coinDenom": "PEPE",
"coinMinimalDenom": "erc20:0x6982508145454Ce325dDbE47a25d4ec3d2311933:Pepe",
"contractAddress": "0x6982508145454Ce325dDbE47a25d4ec3d2311933",
"coinDecimals": 18,
"bridgeTo": ["Oraichain"],
"coinGeckoId": "pepe",
"prefixToken": "eth-mainnet",
"coinImageUrl": "https://assets.coingecko.com/coins/images/29850/standard/pepe-token.jpeg?1696528776"
}
],
"txExplorer": {
Expand Down
13 changes: 13 additions & 0 deletions chains/0x1ae6.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@
"bip44": { "coinType": 60 },
"coinType": 60,
"features": ["isEvm"],
"chainSymbolImageUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/12313.png",
"feeCurrencies": [
{
"coinDenom": "ERC20 KWT",
"bridgeTo": ["Oraichain", "kawaii_6886-1"],
"coinMinimalDenom": "erc20:0x80b5a32E4F032B2a058b4F29EC95EEfEEB87aDcd:Kawaii Islands",
"contractAddress": "0x80b5a32E4F032B2a058b4F29EC95EEfEEB87aDcd",
"coinDecimals": 18,
"coinGeckoId": "kawaii-islands",
"coinImageUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/12313.png",
"gasPriceStep": { "low": 0, "average": 0.025, "high": 0.04 }
}
],
"currencies": [
{
"coinDenom": "ERC20 MILKY",
Expand Down
16 changes: 15 additions & 1 deletion chains/0x2b6653dc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,22 @@
"rest": "https://api.trongrid.io",
"chainId": "0x2b6653dc",
"networkType": "evm",
"chainName": "tronnetwork",
"chainName": "Tron Network",
"features": ["isEvm"],
"chainSymbolImageUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/1958.png",
"feeCurrencies": [
{
"coinDenom": "wTRX",
"coinMinimalDenom": "trx20_trx",
"contractAddress": "0x891cdb91d149f23B1a45D9c5Ca78a88d0cB44C18",
"bridgeTo": ["Oraichain"],
"coinDecimals": 6,
"coinGeckoId": "tron",
"prefixToken": "trontrx-mainnet",
"coinImageUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/1958.png",
"gasPriceStep": { "low": 0, "average": 0.025, "high": 0.04 }
}
],
"currencies": [
{
"coinDenom": "USDT",
Expand Down
28 changes: 26 additions & 2 deletions chains/0x38.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,23 @@
"rpc": "https://bsc-dataseed1.binance.org",
"networkType": "evm",
"chainId": "0x38",
"chainName": "bsc",
"chainName": "BNB Chain",
"bip44": { "coinType": 60 },
"coinType": 60,
"features": ["isEvm"],
"chainSymbolImageUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/1839.png",
"feeCurrencies": [
{
"coinDenom": "BNB",
"coinMinimalDenom": "bnb",
"contractAddress": "",
"coinDecimals": 18,
"coinGeckoId": "binancecoin",
"bridgeTo": ["Oraichain"],
"coinImageUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/1839.png",
"gasPriceStep": { "low": 0, "average": 0.025, "high": 0.04 }
}
],
"currencies": [
{
"coinDenom": "ORAI",
Expand All @@ -16,7 +29,7 @@
"coinDecimals": 18,
"coinGeckoId": "oraichain-token",
"prefixToken": "oraib",
"coinImageUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/7533.png"
"coinImageUrl": "https://raw.githubusercontent.com/cosmos/chain-registry/master/oraichain/images/orai-token.png"
},
{
"coinDenom": "AIRI",
Expand Down Expand Up @@ -83,13 +96,24 @@
"bridgeTo": ["Oraichain"],
"coinImageUrl": "https://assets.coingecko.com/coins/images/5/standard/dogecoin.png?1696501409"
},
{
"coinDenom": "PEPE",
"coinMinimalDenom": "erc20:0x25d887Ce7a35172C62FeBFD67a1856F20FaEbB00:Pepe",
"contractAddress": "0x25d887Ce7a35172C62FeBFD67a1856F20FaEbB00",
"coinDecimals": 18,
"coinGeckoId": "pepe",
"bridgeTo": ["Oraichain"],
"prefixToken": "oraib",
"coinImageUrl": "https://assets.coingecko.com/coins/images/29850/standard/pepe-token.jpeg?1696528776"
},
{
"coinDenom": "WSOL",
"coinMinimalDenom": "erc20:0xfA54fF1a158B5189Ebba6ae130CEd6bbd3aEA76e:Solana",
"contractAddress": "0xfA54fF1a158B5189Ebba6ae130CEd6bbd3aEA76e",
"coinDecimals": 9,
"coinGeckoId": "solana",
"bridgeTo": ["Oraichain"],
"prefixToken": "oraib",
"coinImageUrl": "https://assets.coingecko.com/coins/images/4128/standard/solana.png?1718769756"
}
],
Expand Down
3 changes: 2 additions & 1 deletion chains/Neutaro-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"rpc": "https://neutaro.rpc.orai.io",
"rest": "https://neutaro.lcd.orai.io",
"chainId": "Neutaro-1",
"chainName": "neutaro",
"chainName": "Neutaro",
"networkType": "cosmos",
"bip44": { "coinType": 118 },
"coinType": 118,
"chainSymbolImageUrl": "https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/Neutaro/chain.png",
"bech32Config": {
"bech32PrefixAccAddr": "neutaro",
"bech32PrefixAccPub": "neutaropub",
Expand Down
Loading

0 comments on commit 08fb28c

Please sign in to comment.