diff --git a/packages/dashboard/chains/mainnet/iris.json b/packages/dashboard/chains/mainnet/iris.json new file mode 100644 index 00000000..be28a1ca --- /dev/null +++ b/packages/dashboard/chains/mainnet/iris.json @@ -0,0 +1,20 @@ +{ + "chain_name": "iris", + "alias": "iris-network", + "api": ["https://api.gon.irisnet.org"], + "rpc": ["http://34.82.96.8:26657","http://34.77.68.145:26657"], + "snapshot_provider": "fcc1d9bc43163b20ce5163cf41a302b33f25375f@34.82.96.8:26656", + "sdk_version": "0.46.1", + "coin_type": "118", + "min_tx_fee": "40000", + "addr_prefix": "iaa", + "excludes": "mint", + "logo": "/logos/iris-network.svg", + "assets": [{ + "base": "uiris", + "symbol": "IRIS", + "exponent": "6", + "coingecko_id": "iris-network", + "logo": "/logos/iris-network.svg" + }] +} \ No newline at end of file diff --git a/packages/dashboard/chains/mainnet/juno.json b/packages/dashboard/chains/mainnet/juno.json new file mode 100644 index 00000000..7996dd15 --- /dev/null +++ b/packages/dashboard/chains/mainnet/juno.json @@ -0,0 +1,17 @@ +{ + "chain_name": "juno", + "api": ["https://api.uni.junonetwork.io"], + "rpc": [""], + "sdk_version": "0.46.1", + "coin_type": "118", + "min_tx_fee": "3000", + "addr_prefix": "juno", + "logo": "/logos/juno.png", + "assets": [{ + "base": "ujunox", + "symbol": "JUNOX", + "exponent": "6", + "coingecko_id": "juno-network", + "logo": "/logos/juno.png" + }] +} \ No newline at end of file diff --git a/packages/dashboard/chains/mainnet/omniflix.json b/packages/dashboard/chains/mainnet/omniflix.json new file mode 100644 index 00000000..1b86d8cd --- /dev/null +++ b/packages/dashboard/chains/mainnet/omniflix.json @@ -0,0 +1,18 @@ +{ + "chain_name": "omniflix", + "api": ["https://api.testnet.omniflix.network"], + "rpc": [""], + "snapshot_provider": "", + "sdk_version": "0.46.1", + "coin_type": "118", + "min_tx_fee": "3000", + "addr_prefix": "omniflix", + "logo": "/logos/omniflix.png", + "assets": [{ + "base": "uflix", + "symbol": "FLIX", + "exponent": "6", + "coingecko_id": "", + "logo": "/logos/omniflix.png" + }] +} diff --git a/packages/dashboard/chains/mainnet/stargaze.json b/packages/dashboard/chains/mainnet/stargaze.json new file mode 100644 index 00000000..d28122c8 --- /dev/null +++ b/packages/dashboard/chains/mainnet/stargaze.json @@ -0,0 +1,18 @@ +{ + "chain_name": "stargaze", + "api": ["https://rest.elgafar-1.stargaze-apis.com"], + "rpc": [""], + "snapshot_provider": "", + "sdk_version": "0.45.6", + "coin_type": "118", + "min_tx_fee": "800", + "addr_prefix": "stars", + "logo": "/logos/stargaze.png", + "assets": [{ + "base": "ustars", + "symbol": "STARS", + "exponent": "6", + "coingecko_id": "stargaze", + "logo": "/logos/stargaze.png" + }] +} \ No newline at end of file diff --git a/packages/dashboard/chains/testnet/iris.json b/packages/dashboard/chains/testnet/iris.json new file mode 100644 index 00000000..be28a1ca --- /dev/null +++ b/packages/dashboard/chains/testnet/iris.json @@ -0,0 +1,20 @@ +{ + "chain_name": "iris", + "alias": "iris-network", + "api": ["https://api.gon.irisnet.org"], + "rpc": ["http://34.82.96.8:26657","http://34.77.68.145:26657"], + "snapshot_provider": "fcc1d9bc43163b20ce5163cf41a302b33f25375f@34.82.96.8:26656", + "sdk_version": "0.46.1", + "coin_type": "118", + "min_tx_fee": "40000", + "addr_prefix": "iaa", + "excludes": "mint", + "logo": "/logos/iris-network.svg", + "assets": [{ + "base": "uiris", + "symbol": "IRIS", + "exponent": "6", + "coingecko_id": "iris-network", + "logo": "/logos/iris-network.svg" + }] +} \ No newline at end of file diff --git a/packages/dashboard/chains/testnet/juno.json b/packages/dashboard/chains/testnet/juno.json new file mode 100644 index 00000000..7996dd15 --- /dev/null +++ b/packages/dashboard/chains/testnet/juno.json @@ -0,0 +1,17 @@ +{ + "chain_name": "juno", + "api": ["https://api.uni.junonetwork.io"], + "rpc": [""], + "sdk_version": "0.46.1", + "coin_type": "118", + "min_tx_fee": "3000", + "addr_prefix": "juno", + "logo": "/logos/juno.png", + "assets": [{ + "base": "ujunox", + "symbol": "JUNOX", + "exponent": "6", + "coingecko_id": "juno-network", + "logo": "/logos/juno.png" + }] +} \ No newline at end of file diff --git a/packages/dashboard/chains/testnet/omniflix.json b/packages/dashboard/chains/testnet/omniflix.json new file mode 100644 index 00000000..1b86d8cd --- /dev/null +++ b/packages/dashboard/chains/testnet/omniflix.json @@ -0,0 +1,18 @@ +{ + "chain_name": "omniflix", + "api": ["https://api.testnet.omniflix.network"], + "rpc": [""], + "snapshot_provider": "", + "sdk_version": "0.46.1", + "coin_type": "118", + "min_tx_fee": "3000", + "addr_prefix": "omniflix", + "logo": "/logos/omniflix.png", + "assets": [{ + "base": "uflix", + "symbol": "FLIX", + "exponent": "6", + "coingecko_id": "", + "logo": "/logos/omniflix.png" + }] +} diff --git a/packages/dashboard/chains/testnet/stargaze.json b/packages/dashboard/chains/testnet/stargaze.json new file mode 100644 index 00000000..d28122c8 --- /dev/null +++ b/packages/dashboard/chains/testnet/stargaze.json @@ -0,0 +1,18 @@ +{ + "chain_name": "stargaze", + "api": ["https://rest.elgafar-1.stargaze-apis.com"], + "rpc": [""], + "snapshot_provider": "", + "sdk_version": "0.45.6", + "coin_type": "118", + "min_tx_fee": "800", + "addr_prefix": "stars", + "logo": "/logos/stargaze.png", + "assets": [{ + "base": "ustars", + "symbol": "STARS", + "exponent": "6", + "coingecko_id": "stargaze", + "logo": "/logos/stargaze.png" + }] +} \ No newline at end of file diff --git a/packages/dashboard/package.json b/packages/dashboard/package.json index f0c1f6a2..eabaa260 100644 --- a/packages/dashboard/package.json +++ b/packages/dashboard/package.json @@ -25,6 +25,7 @@ "apexcharts": "^3.37.1", "axios": "^1.3.2", "cross-fetch": "^3.1.5", + "long": "^5.2.1", "md-editor-v3": "^2.8.1", "numeral": "^2.0.6", "osmojs": "^14.0.0-rc.0", diff --git a/packages/dashboard/public/logos/8ball.png b/packages/dashboard/public/logos/8ball.png new file mode 100644 index 00000000..edc10827 Binary files /dev/null and b/packages/dashboard/public/logos/8ball.png differ diff --git a/packages/dashboard/public/logos/DWS.png b/packages/dashboard/public/logos/DWS.png new file mode 100644 index 00000000..bc701256 Binary files /dev/null and b/packages/dashboard/public/logos/DWS.png differ diff --git a/packages/dashboard/public/logos/VDL.png b/packages/dashboard/public/logos/VDL.png new file mode 100644 index 00000000..d171bdaa Binary files /dev/null and b/packages/dashboard/public/logos/VDL.png differ diff --git a/packages/dashboard/public/logos/agoric-bld.svg b/packages/dashboard/public/logos/agoric-bld.svg new file mode 100644 index 00000000..9397bea8 --- /dev/null +++ b/packages/dashboard/public/logos/agoric-bld.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + diff --git a/packages/dashboard/public/logos/agoric.png b/packages/dashboard/public/logos/agoric.png new file mode 100644 index 00000000..3d6ff8c9 Binary files /dev/null and b/packages/dashboard/public/logos/agoric.png differ diff --git a/packages/dashboard/public/logos/akash-network.png b/packages/dashboard/public/logos/akash-network.png new file mode 100644 index 00000000..71170346 Binary files /dev/null and b/packages/dashboard/public/logos/akash-network.png differ diff --git a/packages/dashboard/public/logos/androma.png b/packages/dashboard/public/logos/androma.png new file mode 100644 index 00000000..6139b4be Binary files /dev/null and b/packages/dashboard/public/logos/androma.png differ diff --git a/packages/dashboard/public/logos/aura.png b/packages/dashboard/public/logos/aura.png new file mode 100644 index 00000000..2bbe3905 Binary files /dev/null and b/packages/dashboard/public/logos/aura.png differ diff --git a/packages/dashboard/public/logos/axelar.svg b/packages/dashboard/public/logos/axelar.svg new file mode 100644 index 00000000..a993fb49 --- /dev/null +++ b/packages/dashboard/public/logos/axelar.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/dashboard/public/logos/band-protocol.svg b/packages/dashboard/public/logos/band-protocol.svg new file mode 100644 index 00000000..cb0e497c --- /dev/null +++ b/packages/dashboard/public/logos/band-protocol.svg @@ -0,0 +1,12 @@ + + + D09EECB6-251A-416B-B21C-25832F33D878 + + + + + + + + + \ No newline at end of file diff --git a/packages/dashboard/public/logos/beezee.png b/packages/dashboard/public/logos/beezee.png new file mode 100644 index 00000000..81c72d22 Binary files /dev/null and b/packages/dashboard/public/logos/beezee.png differ diff --git a/packages/dashboard/public/logos/bitcanna.svg b/packages/dashboard/public/logos/bitcanna.svg new file mode 100644 index 00000000..8285019e --- /dev/null +++ b/packages/dashboard/public/logos/bitcanna.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/dashboard/public/logos/bitsong.svg b/packages/dashboard/public/logos/bitsong.svg new file mode 100644 index 00000000..7178c8c9 --- /dev/null +++ b/packages/dashboard/public/logos/bitsong.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/packages/dashboard/public/logos/bostrom.png b/packages/dashboard/public/logos/bostrom.png new file mode 100644 index 00000000..a5d95ce8 Binary files /dev/null and b/packages/dashboard/public/logos/bostrom.png differ diff --git a/packages/dashboard/public/logos/c4e.png b/packages/dashboard/public/logos/c4e.png new file mode 100644 index 00000000..b0e03c20 Binary files /dev/null and b/packages/dashboard/public/logos/c4e.png differ diff --git a/packages/dashboard/public/logos/canto.png b/packages/dashboard/public/logos/canto.png new file mode 100644 index 00000000..7708dc06 Binary files /dev/null and b/packages/dashboard/public/logos/canto.png differ diff --git a/packages/dashboard/public/logos/carbon.svg b/packages/dashboard/public/logos/carbon.svg new file mode 100644 index 00000000..1c1cea31 --- /dev/null +++ b/packages/dashboard/public/logos/carbon.svg @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/dashboard/public/logos/ccc.png b/packages/dashboard/public/logos/ccc.png new file mode 100644 index 00000000..b4497df4 Binary files /dev/null and b/packages/dashboard/public/logos/ccc.png differ diff --git a/packages/dashboard/public/logos/celestia.png b/packages/dashboard/public/logos/celestia.png new file mode 100644 index 00000000..9f555414 Binary files /dev/null and b/packages/dashboard/public/logos/celestia.png differ diff --git a/packages/dashboard/public/logos/cerberus.png b/packages/dashboard/public/logos/cerberus.png new file mode 100644 index 00000000..81e51feb Binary files /dev/null and b/packages/dashboard/public/logos/cerberus.png differ diff --git a/packages/dashboard/public/logos/cheqd.png b/packages/dashboard/public/logos/cheqd.png new file mode 100644 index 00000000..dd7808d1 Binary files /dev/null and b/packages/dashboard/public/logos/cheqd.png differ diff --git a/packages/dashboard/public/logos/chihuahua.png b/packages/dashboard/public/logos/chihuahua.png new file mode 100644 index 00000000..c2d0a6a6 Binary files /dev/null and b/packages/dashboard/public/logos/chihuahua.png differ diff --git a/packages/dashboard/public/logos/chronic-token.jpg b/packages/dashboard/public/logos/chronic-token.jpg new file mode 100644 index 00000000..b160f364 Binary files /dev/null and b/packages/dashboard/public/logos/chronic-token.jpg differ diff --git a/packages/dashboard/public/logos/com.png b/packages/dashboard/public/logos/com.png new file mode 100644 index 00000000..40e410a3 --- /dev/null +++ b/packages/dashboard/public/logos/com.png @@ -0,0 +1,1527 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + chain-registry/com.png at master · cosmos/chain-registry · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ + + + + +
+ + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + +
+ + + + + + + + +Permalink + +
+ +
+
+ + + master + + + + +
+
+
+ Switch branches/tags + +
+ + + +
+ +
+ +
+ + +
+ +
+ + + + + + + + + + + + + + + +
+ + +
+
+
+
+ +
+ +
+ + +
+ +
+
+
+

Name already in use

+
+
+ +
+
+
+
+ +
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? +
+ +
+
+ + +
+
+ + + + Go to file + +
+ + + + +
+
+
+ + + + + + + + + +
+ +
+
+
 
+
+ +
+
 
+ Cannot retrieve contributors at this time +
+
+ + + + + + + + + +
+ +
+ + +
+ + 101 KB +
+ +
+ + + + +
+
+ +
+
+ +
+ +
+
+ + + +
+ +
+ com.png +
+
+ +
+ + + + +
+ + +
+ + +
+
+ + + +
+ +
+ + +
+ +
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + diff --git a/packages/dashboard/public/logos/comdex.png b/packages/dashboard/public/logos/comdex.png new file mode 100644 index 00000000..79cc094e Binary files /dev/null and b/packages/dashboard/public/logos/comdex.png differ diff --git a/packages/dashboard/public/logos/commercionetwork.png b/packages/dashboard/public/logos/commercionetwork.png new file mode 100644 index 00000000..be8284e3 Binary files /dev/null and b/packages/dashboard/public/logos/commercionetwork.png differ diff --git a/packages/dashboard/public/logos/cosmic-horizon.png b/packages/dashboard/public/logos/cosmic-horizon.png new file mode 100644 index 00000000..63a223b0 Binary files /dev/null and b/packages/dashboard/public/logos/cosmic-horizon.png differ diff --git a/packages/dashboard/public/logos/cosmos.svg b/packages/dashboard/public/logos/cosmos.svg new file mode 100644 index 00000000..aedd3e70 --- /dev/null +++ b/packages/dashboard/public/logos/cosmos.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/dashboard/public/logos/craft.png b/packages/dashboard/public/logos/craft.png new file mode 100644 index 00000000..69bc8101 Binary files /dev/null and b/packages/dashboard/public/logos/craft.png differ diff --git a/packages/dashboard/public/logos/cre.png b/packages/dashboard/public/logos/cre.png new file mode 100644 index 00000000..cbd3ddc3 Binary files /dev/null and b/packages/dashboard/public/logos/cre.png differ diff --git a/packages/dashboard/public/logos/cronos.png b/packages/dashboard/public/logos/cronos.png new file mode 100644 index 00000000..68f2db74 Binary files /dev/null and b/packages/dashboard/public/logos/cronos.png differ diff --git a/packages/dashboard/public/logos/crypto-com-chain.png b/packages/dashboard/public/logos/crypto-com-chain.png new file mode 100644 index 00000000..8cb2ce54 Binary files /dev/null and b/packages/dashboard/public/logos/crypto-com-chain.png differ diff --git a/packages/dashboard/public/logos/dai.svg b/packages/dashboard/public/logos/dai.svg new file mode 100644 index 00000000..31f55841 --- /dev/null +++ b/packages/dashboard/public/logos/dai.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/packages/dashboard/public/logos/decentr.png b/packages/dashboard/public/logos/decentr.png new file mode 100644 index 00000000..65f3adc2 Binary files /dev/null and b/packages/dashboard/public/logos/decentr.png differ diff --git a/packages/dashboard/public/logos/desmos.png b/packages/dashboard/public/logos/desmos.png new file mode 100644 index 00000000..fc988d2d Binary files /dev/null and b/packages/dashboard/public/logos/desmos.png differ diff --git a/packages/dashboard/public/logos/dig1.png b/packages/dashboard/public/logos/dig1.png new file mode 100644 index 00000000..9b8cdb1e Binary files /dev/null and b/packages/dashboard/public/logos/dig1.png differ diff --git a/packages/dashboard/public/logos/dot.svg b/packages/dashboard/public/logos/dot.svg new file mode 100644 index 00000000..17a12423 --- /dev/null +++ b/packages/dashboard/public/logos/dot.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/packages/dashboard/public/logos/e-money.jpg b/packages/dashboard/public/logos/e-money.jpg new file mode 100644 index 00000000..d0758dd4 Binary files /dev/null and b/packages/dashboard/public/logos/e-money.jpg differ diff --git a/packages/dashboard/public/logos/echelon.gif b/packages/dashboard/public/logos/echelon.gif new file mode 100644 index 00000000..29a8363c Binary files /dev/null and b/packages/dashboard/public/logos/echelon.gif differ diff --git a/packages/dashboard/public/logos/empower.png b/packages/dashboard/public/logos/empower.png new file mode 100644 index 00000000..0a486a08 Binary files /dev/null and b/packages/dashboard/public/logos/empower.png differ diff --git a/packages/dashboard/public/logos/ethereum.png b/packages/dashboard/public/logos/ethereum.png new file mode 100644 index 00000000..abca2ac8 Binary files /dev/null and b/packages/dashboard/public/logos/ethereum.png differ diff --git a/packages/dashboard/public/logos/evmos.jpeg b/packages/dashboard/public/logos/evmos.jpeg new file mode 100644 index 00000000..e9103e26 Binary files /dev/null and b/packages/dashboard/public/logos/evmos.jpeg differ diff --git a/packages/dashboard/public/logos/evmos.png b/packages/dashboard/public/logos/evmos.png new file mode 100644 index 00000000..e801519d Binary files /dev/null and b/packages/dashboard/public/logos/evmos.png differ diff --git a/packages/dashboard/public/logos/fetchhub.png b/packages/dashboard/public/logos/fetchhub.png new file mode 100644 index 00000000..6a6f5578 Binary files /dev/null and b/packages/dashboard/public/logos/fetchhub.png differ diff --git a/packages/dashboard/public/logos/game_of_chain.jpeg b/packages/dashboard/public/logos/game_of_chain.jpeg new file mode 100644 index 00000000..054353ad Binary files /dev/null and b/packages/dashboard/public/logos/game_of_chain.jpeg differ diff --git a/packages/dashboard/public/logos/genesisl1.png b/packages/dashboard/public/logos/genesisl1.png new file mode 100644 index 00000000..c5e1ab7d Binary files /dev/null and b/packages/dashboard/public/logos/genesisl1.png differ diff --git a/packages/dashboard/public/logos/gravity-bridge.png b/packages/dashboard/public/logos/gravity-bridge.png new file mode 100644 index 00000000..bd08ed48 Binary files /dev/null and b/packages/dashboard/public/logos/gravity-bridge.png differ diff --git a/packages/dashboard/public/logos/haqq.png b/packages/dashboard/public/logos/haqq.png new file mode 100644 index 00000000..0db2ab1b Binary files /dev/null and b/packages/dashboard/public/logos/haqq.png differ diff --git a/packages/dashboard/public/logos/haqq.svg b/packages/dashboard/public/logos/haqq.svg new file mode 100644 index 00000000..672a7272 --- /dev/null +++ b/packages/dashboard/public/logos/haqq.svg @@ -0,0 +1,14 @@ + + + diff --git a/packages/dashboard/public/logos/injective.jpg b/packages/dashboard/public/logos/injective.jpg new file mode 100644 index 00000000..80d9cdf1 Binary files /dev/null and b/packages/dashboard/public/logos/injective.jpg differ diff --git a/packages/dashboard/public/logos/iris-network.svg b/packages/dashboard/public/logos/iris-network.svg new file mode 100644 index 00000000..0d3af322 --- /dev/null +++ b/packages/dashboard/public/logos/iris-network.svg @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/dashboard/public/logos/islm.png b/packages/dashboard/public/logos/islm.png new file mode 100644 index 00000000..bd708591 Binary files /dev/null and b/packages/dashboard/public/logos/islm.png differ diff --git a/packages/dashboard/public/logos/islm.svg b/packages/dashboard/public/logos/islm.svg new file mode 100644 index 00000000..83d770f0 --- /dev/null +++ b/packages/dashboard/public/logos/islm.svg @@ -0,0 +1,14 @@ + + + diff --git a/packages/dashboard/public/logos/ixo.svg b/packages/dashboard/public/logos/ixo.svg new file mode 100644 index 00000000..78671b05 --- /dev/null +++ b/packages/dashboard/public/logos/ixo.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/packages/dashboard/public/logos/jackal.png b/packages/dashboard/public/logos/jackal.png new file mode 100644 index 00000000..305e01af Binary files /dev/null and b/packages/dashboard/public/logos/jackal.png differ diff --git a/packages/dashboard/public/logos/juno.jpg b/packages/dashboard/public/logos/juno.jpg new file mode 100644 index 00000000..a407ce9e Binary files /dev/null and b/packages/dashboard/public/logos/juno.jpg differ diff --git a/packages/dashboard/public/logos/juno.png b/packages/dashboard/public/logos/juno.png new file mode 100644 index 00000000..30f5011b Binary files /dev/null and b/packages/dashboard/public/logos/juno.png differ diff --git a/packages/dashboard/public/logos/kava.png b/packages/dashboard/public/logos/kava.png new file mode 100644 index 00000000..5db778f0 Binary files /dev/null and b/packages/dashboard/public/logos/kava.png differ diff --git a/packages/dashboard/public/logos/kichain.png b/packages/dashboard/public/logos/kichain.png new file mode 100644 index 00000000..96655c39 Binary files /dev/null and b/packages/dashboard/public/logos/kichain.png differ diff --git a/packages/dashboard/public/logos/kujira.png b/packages/dashboard/public/logos/kujira.png new file mode 100644 index 00000000..e310f1fd Binary files /dev/null and b/packages/dashboard/public/logos/kujira.png differ diff --git a/packages/dashboard/public/logos/lambda.png b/packages/dashboard/public/logos/lambda.png new file mode 100644 index 00000000..b45be448 Binary files /dev/null and b/packages/dashboard/public/logos/lambda.png differ diff --git a/packages/dashboard/public/logos/likecoin.png b/packages/dashboard/public/logos/likecoin.png new file mode 100644 index 00000000..cfbb2fac Binary files /dev/null and b/packages/dashboard/public/logos/likecoin.png differ diff --git a/packages/dashboard/public/logos/lum-network.png b/packages/dashboard/public/logos/lum-network.png new file mode 100644 index 00000000..bba0e5cc Binary files /dev/null and b/packages/dashboard/public/logos/lum-network.png differ diff --git a/packages/dashboard/public/logos/lumen.png b/packages/dashboard/public/logos/lumen.png new file mode 100644 index 00000000..db6e00d3 Binary files /dev/null and b/packages/dashboard/public/logos/lumen.png differ diff --git a/packages/dashboard/public/logos/mars.jpg b/packages/dashboard/public/logos/mars.jpg new file mode 100644 index 00000000..e5c26c50 Binary files /dev/null and b/packages/dashboard/public/logos/mars.jpg differ diff --git a/packages/dashboard/public/logos/mars.png b/packages/dashboard/public/logos/mars.png new file mode 100644 index 00000000..73de99a1 Binary files /dev/null and b/packages/dashboard/public/logos/mars.png differ diff --git a/packages/dashboard/public/logos/meme.svg b/packages/dashboard/public/logos/meme.svg new file mode 100644 index 00000000..78b10aeb --- /dev/null +++ b/packages/dashboard/public/logos/meme.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/packages/dashboard/public/logos/microtick.png b/packages/dashboard/public/logos/microtick.png new file mode 100644 index 00000000..f3b5edb2 Binary files /dev/null and b/packages/dashboard/public/logos/microtick.png differ diff --git a/packages/dashboard/public/logos/migaloo.png b/packages/dashboard/public/logos/migaloo.png new file mode 100644 index 00000000..95aef059 Binary files /dev/null and b/packages/dashboard/public/logos/migaloo.png differ diff --git a/packages/dashboard/public/logos/nois.svg b/packages/dashboard/public/logos/nois.svg new file mode 100644 index 00000000..3763db67 --- /dev/null +++ b/packages/dashboard/public/logos/nois.svg @@ -0,0 +1,68 @@ + + + + + + + + + + + + + diff --git a/packages/dashboard/public/logos/nym.jpeg b/packages/dashboard/public/logos/nym.jpeg new file mode 100644 index 00000000..0fb3a9d7 Binary files /dev/null and b/packages/dashboard/public/logos/nym.jpeg differ diff --git a/packages/dashboard/public/logos/odin.png b/packages/dashboard/public/logos/odin.png new file mode 100644 index 00000000..8b7745c5 Binary files /dev/null and b/packages/dashboard/public/logos/odin.png differ diff --git a/packages/dashboard/public/logos/okexchain.svg b/packages/dashboard/public/logos/okexchain.svg new file mode 100644 index 00000000..cc4d119f --- /dev/null +++ b/packages/dashboard/public/logos/okexchain.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/packages/dashboard/public/logos/okp4.svg b/packages/dashboard/public/logos/okp4.svg new file mode 100644 index 00000000..e57e3e71 --- /dev/null +++ b/packages/dashboard/public/logos/okp4.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/packages/dashboard/public/logos/omniflix.png b/packages/dashboard/public/logos/omniflix.png new file mode 100644 index 00000000..ab69ae00 Binary files /dev/null and b/packages/dashboard/public/logos/omniflix.png differ diff --git a/packages/dashboard/public/logos/osmosis.jpg b/packages/dashboard/public/logos/osmosis.jpg new file mode 100644 index 00000000..6b2305fe Binary files /dev/null and b/packages/dashboard/public/logos/osmosis.jpg differ diff --git a/packages/dashboard/public/logos/passage.png b/packages/dashboard/public/logos/passage.png new file mode 100644 index 00000000..20479a11 Binary files /dev/null and b/packages/dashboard/public/logos/passage.png differ diff --git a/packages/dashboard/public/logos/persistence.png b/packages/dashboard/public/logos/persistence.png new file mode 100644 index 00000000..99384cc5 Binary files /dev/null and b/packages/dashboard/public/logos/persistence.png differ diff --git a/packages/dashboard/public/logos/planq.png b/packages/dashboard/public/logos/planq.png new file mode 100644 index 00000000..8e254394 Binary files /dev/null and b/packages/dashboard/public/logos/planq.png differ diff --git a/packages/dashboard/public/logos/point-logo.png b/packages/dashboard/public/logos/point-logo.png new file mode 100644 index 00000000..1620e96f Binary files /dev/null and b/packages/dashboard/public/logos/point-logo.png differ diff --git a/packages/dashboard/public/logos/provenance.svg b/packages/dashboard/public/logos/provenance.svg new file mode 100644 index 00000000..9956e842 --- /dev/null +++ b/packages/dashboard/public/logos/provenance.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/packages/dashboard/public/logos/quasar.png b/packages/dashboard/public/logos/quasar.png new file mode 100644 index 00000000..7885e123 Binary files /dev/null and b/packages/dashboard/public/logos/quasar.png differ diff --git a/packages/dashboard/public/logos/quicksilver.png b/packages/dashboard/public/logos/quicksilver.png new file mode 100644 index 00000000..514b4ae5 Binary files /dev/null and b/packages/dashboard/public/logos/quicksilver.png differ diff --git a/packages/dashboard/public/logos/rebus.png b/packages/dashboard/public/logos/rebus.png new file mode 100644 index 00000000..68581541 Binary files /dev/null and b/packages/dashboard/public/logos/rebus.png differ diff --git a/packages/dashboard/public/logos/regen.svg b/packages/dashboard/public/logos/regen.svg new file mode 100644 index 00000000..e79b6531 --- /dev/null +++ b/packages/dashboard/public/logos/regen.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/packages/dashboard/public/logos/rizon.svg b/packages/dashboard/public/logos/rizon.svg new file mode 100644 index 00000000..d38a1eee --- /dev/null +++ b/packages/dashboard/public/logos/rizon.svg @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/dashboard/public/logos/secret.png b/packages/dashboard/public/logos/secret.png new file mode 100644 index 00000000..a3a22b1d Binary files /dev/null and b/packages/dashboard/public/logos/secret.png differ diff --git a/packages/dashboard/public/logos/sentinel.png b/packages/dashboard/public/logos/sentinel.png new file mode 100644 index 00000000..e6ab64cc Binary files /dev/null and b/packages/dashboard/public/logos/sentinel.png differ diff --git a/packages/dashboard/public/logos/shentu.jpg b/packages/dashboard/public/logos/shentu.jpg new file mode 100644 index 00000000..41e8c4a7 Binary files /dev/null and b/packages/dashboard/public/logos/shentu.jpg differ diff --git a/packages/dashboard/public/logos/sifchain.jpeg b/packages/dashboard/public/logos/sifchain.jpeg new file mode 100644 index 00000000..531803c3 Binary files /dev/null and b/packages/dashboard/public/logos/sifchain.jpeg differ diff --git a/packages/dashboard/public/logos/stafihub.png b/packages/dashboard/public/logos/stafihub.png new file mode 100644 index 00000000..3a17a6a4 Binary files /dev/null and b/packages/dashboard/public/logos/stafihub.png differ diff --git a/packages/dashboard/public/logos/stargaze.png b/packages/dashboard/public/logos/stargaze.png new file mode 100644 index 00000000..bb117d21 Binary files /dev/null and b/packages/dashboard/public/logos/stargaze.png differ diff --git a/packages/dashboard/public/logos/starname.jpg b/packages/dashboard/public/logos/starname.jpg new file mode 100644 index 00000000..d237ddcc Binary files /dev/null and b/packages/dashboard/public/logos/starname.jpg differ diff --git a/packages/dashboard/public/logos/stride.png b/packages/dashboard/public/logos/stride.png new file mode 100644 index 00000000..46f8bacc Binary files /dev/null and b/packages/dashboard/public/logos/stride.png differ diff --git a/packages/dashboard/public/logos/teritori.svg b/packages/dashboard/public/logos/teritori.svg new file mode 100644 index 00000000..e8dff7dd --- /dev/null +++ b/packages/dashboard/public/logos/teritori.svg @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/dashboard/public/logos/terra-luna-krt.png b/packages/dashboard/public/logos/terra-luna-krt.png new file mode 100644 index 00000000..7c0a08ac Binary files /dev/null and b/packages/dashboard/public/logos/terra-luna-krt.png differ diff --git a/packages/dashboard/public/logos/terra-luna-tokenlogo.webp b/packages/dashboard/public/logos/terra-luna-tokenlogo.webp new file mode 100644 index 00000000..467b1f58 Binary files /dev/null and b/packages/dashboard/public/logos/terra-luna-tokenlogo.webp differ diff --git a/packages/dashboard/public/logos/terra-luna-ust.png b/packages/dashboard/public/logos/terra-luna-ust.png new file mode 100644 index 00000000..0e9c88ff Binary files /dev/null and b/packages/dashboard/public/logos/terra-luna-ust.png differ diff --git a/packages/dashboard/public/logos/terra-luna.jpg b/packages/dashboard/public/logos/terra-luna.jpg new file mode 100644 index 00000000..3f50f69b Binary files /dev/null and b/packages/dashboard/public/logos/terra-luna.jpg differ diff --git a/packages/dashboard/public/logos/umee.png b/packages/dashboard/public/logos/umee.png new file mode 100644 index 00000000..cbed4277 Binary files /dev/null and b/packages/dashboard/public/logos/umee.png differ diff --git a/packages/dashboard/public/logos/unification.png b/packages/dashboard/public/logos/unification.png new file mode 100644 index 00000000..35b41d1e Binary files /dev/null and b/packages/dashboard/public/logos/unification.png differ diff --git a/packages/dashboard/public/logos/usdc.svg b/packages/dashboard/public/logos/usdc.svg new file mode 100644 index 00000000..262ff391 --- /dev/null +++ b/packages/dashboard/public/logos/usdc.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/packages/dashboard/public/logos/usdt.svg b/packages/dashboard/public/logos/usdt.svg new file mode 100644 index 00000000..e5308224 --- /dev/null +++ b/packages/dashboard/public/logos/usdt.svg @@ -0,0 +1 @@ +tether-usdt-logo \ No newline at end of file diff --git a/packages/dashboard/public/logos/wavax.svg b/packages/dashboard/public/logos/wavax.svg new file mode 100644 index 00000000..21794816 --- /dev/null +++ b/packages/dashboard/public/logos/wavax.svg @@ -0,0 +1,6 @@ + + + + diff --git a/packages/dashboard/public/logos/weth.svg b/packages/dashboard/public/logos/weth.svg new file mode 100644 index 00000000..2438150f --- /dev/null +++ b/packages/dashboard/public/logos/weth.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/packages/dashboard/public/logos/whitewhale.png b/packages/dashboard/public/logos/whitewhale.png new file mode 100644 index 00000000..f578f6c6 Binary files /dev/null and b/packages/dashboard/public/logos/whitewhale.png differ diff --git a/packages/dashboard/public/logos/wmatic.svg b/packages/dashboard/public/logos/wmatic.svg new file mode 100644 index 00000000..fd4edad9 --- /dev/null +++ b/packages/dashboard/public/logos/wmatic.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/packages/dashboard/src/components/CardStatisticsHorizontal.vue b/packages/dashboard/src/components/CardStatisticsHorizontal.vue new file mode 100644 index 00000000..cd92a789 --- /dev/null +++ b/packages/dashboard/src/components/CardStatisticsHorizontal.vue @@ -0,0 +1,55 @@ + + + diff --git a/packages/dashboard/src/components/CardStatisticsVertical.vue b/packages/dashboard/src/components/CardStatisticsVertical.vue new file mode 100644 index 00000000..e9362935 --- /dev/null +++ b/packages/dashboard/src/components/CardStatisticsVertical.vue @@ -0,0 +1,64 @@ + + + diff --git a/packages/dashboard/src/components/CardStatisticsWithImages.vue b/packages/dashboard/src/components/CardStatisticsWithImages.vue new file mode 100644 index 00000000..a6a2900b --- /dev/null +++ b/packages/dashboard/src/components/CardStatisticsWithImages.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/packages/dashboard/src/components/charts/PriceMarketChart.vue b/packages/dashboard/src/components/charts/PriceMarketChart.vue index 1a026e83..a947a19b 100644 --- a/packages/dashboard/src/components/charts/PriceMarketChart.vue +++ b/packages/dashboard/src/components/charts/PriceMarketChart.vue @@ -2,7 +2,7 @@ import VueApexCharts from 'vue3-apexcharts' import { useTheme } from 'vuetify' import { getAreaChartSplineConfig, getMarketPriceChartConfig } from './apexCharConfig' -import { useIndexModule } from '@/modules/[chain]/store'; +import { useIndexModule } from '@/modules/[chain]/indexStore'; import { computed, ref } from '@vue/reactivity'; const store = useIndexModule() diff --git a/packages/dashboard/src/components/charts/apexCharConfig.ts b/packages/dashboard/src/components/charts/apexCharConfig.ts index 920f2759..0703d32c 100644 --- a/packages/dashboard/src/components/charts/apexCharConfig.ts +++ b/packages/dashboard/src/components/charts/apexCharConfig.ts @@ -18,7 +18,9 @@ export const getMarketPriceChartConfig = (themeColors: ThemeInstance['themes'][' return { chart: { - height: 260, + redrawOnParentResize: false, + width: '100%', + height: '260px;', parentHeightOffset: 0, toolbar: { show: false }, }, diff --git a/packages/dashboard/src/layouts/components/ChainProfile.vue b/packages/dashboard/src/layouts/components/ChainProfile.vue index bd0b9ba9..df75e46a 100644 --- a/packages/dashboard/src/layouts/components/ChainProfile.vue +++ b/packages/dashboard/src/layouts/components/ChainProfile.vue @@ -1,7 +1,8 @@ @@ -49,7 +50,7 @@ const chainStore = useBlockchain() - {{ chainStore.current?.chainId || '' }} + {{ baseStore.latest.block?.header?.chain_id || '' }} {{ chainStore.availableEndpoint }} diff --git a/packages/dashboard/src/layouts/components/DefaultLayout.vue b/packages/dashboard/src/layouts/components/DefaultLayout.vue index b10ac042..ea5d68d4 100644 --- a/packages/dashboard/src/layouts/components/DefaultLayout.vue +++ b/packages/dashboard/src/layouts/components/DefaultLayout.vue @@ -15,6 +15,7 @@ import NavSearchBar from './NavSearchBar.vue' import NavBarNotifications from './NavBarNotifications.vue' import TheCustomizer from '@/plugins/vuetify/@core/components/TheCustomizer.vue' import Breadcrumbs from './Breadcrumbs.vue' +import { useBlockchain } from '@/stores' const { appRouteTransition, isLessThanOverlayNavBreakpoint, isVerticalNavCollapsed } = useThemeConfig() const { width: windowWidth } = useWindowSize() @@ -26,14 +27,19 @@ watch(isVerticalNavCollapsed, val => { verticalNavHeaderActionAnimationName.value = val ? 'rotate-180' : 'rotate-back-180' }) - const dashboard = useDashboard() dashboard.initial() - +const blockchain = useBlockchain() +// blockchain.initial() +blockchain.$subscribe((m, s) => { + if(m.events.key === 'rest') { + blockchain.initial() + } +}) diff --git a/packages/dashboard/src/router/index.ts b/packages/dashboard/src/router/index.ts index 645b8cef..20ca2ac5 100644 --- a/packages/dashboard/src/router/index.ts +++ b/packages/dashboard/src/router/index.ts @@ -1,11 +1,8 @@ +import { useBlockchain } from "@/stores"; import { setupLayouts } from "virtual:generated-layouts"; import { createRouter, createWebHistory } from "vue-router"; -import { useDashboard } from "@/stores/useDashboard"; import routes from "~pages"; -// import { useDashboard } from "@/stores/useDashboard"; -// const dashboard = useDashboard() - const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: [...setupLayouts(routes)], @@ -14,10 +11,9 @@ const router = createRouter({ //update current blockchain router.beforeEach((to) => { const { chain } = to.params - console.log('chain', chain) if(chain){ - const dashboard = useDashboard() - dashboard.setCurrentChain(chain.toString()) + const blockchain = useBlockchain() + blockchain.setCurrent(chain.toString()) } }) diff --git a/packages/dashboard/src/stores/index.ts b/packages/dashboard/src/stores/index.ts index ed1a543d..ba3be05b 100644 --- a/packages/dashboard/src/stores/index.ts +++ b/packages/dashboard/src/stores/index.ts @@ -1,4 +1,6 @@ export * from './useBankStore' export * from './useBlockchain' export * from './useCoinGecko' -export * from './useDashboard' \ No newline at end of file +export * from './useDashboard' +export * from './useBaseStore' +export * from './useFormatter' \ No newline at end of file diff --git a/packages/dashboard/src/stores/useBankStore.ts b/packages/dashboard/src/stores/useBankStore.ts index 7653681f..c6668d03 100644 --- a/packages/dashboard/src/stores/useBankStore.ts +++ b/packages/dashboard/src/stores/useBankStore.ts @@ -1,48 +1,66 @@ import { defineStore } from "pinia"; -import type { QuerySupplyOfRequest, QueryTotalSupplyRequest, QueryBalanceRequest,QueryAllBalancesRequest, QueryAllBalancesResponseSDKType, QueryBalanceResponseSDKType, QueryTotalSupplyResponseSDKType } from "osmojs/types/codegen/cosmos/bank/v1beta1/query"; - import { useBlockchain } from "./useBlockchain"; -import type { CoinSDKType } from "osmojs/types/codegen/cosmos/base/v1beta1/coin"; +import { createBankClientForChain } from "@/libs/client"; +import { QuerySupplyOfRequest, type QueryTotalSupplyRequest, type QueryTotalSupplyResponseSDKType } from "@ping-pub/codegen/src/cosmos/bank/v1beta1/query"; +import type { CoinSDKType } from "@ping-pub/codegen/src/cosmos/base/v1beta1/coin"; +import { useStakingStore } from "./useStakingStore"; export const useBankStore = defineStore('bankstore', { state: () => { return { + supply: {} as CoinSDKType, balances: {} as Record, totalSupply: {supply: []} as QueryTotalSupplyResponseSDKType, } }, - // getters: { - // lcdClient() { - // return new client.bank.LCDQueryClient( { - // requestClient: useBlockchain().restClient - // }) - // }, - // }, - // actions: { - // cacheBalance(address: string, balances: CoinSDKType[]) { - // if(this.balances[address]) { - // this.balances[address] = [...this.balances[address], ... balances] - // }else { - // this.balances[address] = balances - // } - // }, - // async fetchBalance(param: QueryBalanceRequest) : Promise { - // const response : QueryBalanceResponseSDKType = await this.lcdClient.balance(param) - // if (response.balance) this.cacheBalance(param.address, [response.balance]) - // return response - // }, - // async fetchAllBalance(param: QueryAllBalancesRequest) : Promise { - // const response : QueryAllBalancesResponseSDKType = await this.lcdClient.allBalances(param) - // if (response.balances) this.cacheBalance(param.address, response.balances) - // return response - // }, - // async fetchTotalSupply(param: QueryTotalSupplyRequest): Promise { - // const response = await this.lcdClient.totalSupply(param) - // this.totalSupply.supply = [...this.totalSupply.supply, ...response.supply] - // this.totalSupply.pagination = response.pagination - // return response - // }, - // } + getters: { + blockchain() { + return useBlockchain() + }, + client() { + const chain = useBlockchain() + return createBankClientForChain(chain.chainName, chain.restClient) + }, + staking() { + return useStakingStore() + } + }, + actions: { + initial() { + this.supply = {} as CoinSDKType + const denom = this.staking.params.bond_denom || this.blockchain.current.assets[0].base + this.fetchSupply(denom).then(res => { + if(res.amount) this.supply = res.amount + }) + }, + + // cacheBalance(address: string, balances: CoinSDKType[]) { + // if(this.balances[address]) { + // this.balances[address] = [...this.balances[address], ... balances] + // }else { + // this.balances[address] = balances + // } + // }, + // async fetchBalance(param: QueryBalanceRequest) : Promise { + // const response : QueryBalanceResponseSDKType = await this.lcdClient.balance(param) + // if (response.balance) this.cacheBalance(param.address, [response.balance]) + // return response + // }, + // async fetchAllBalance(param: QueryAllBalancesRequest) : Promise { + // const response : QueryAllBalancesResponseSDKType = await this.lcdClient.allBalances(param) + // if (response.balances) this.cacheBalance(param.address, response.balances) + // return response + // }, + async fetchTotalSupply(param: QueryTotalSupplyRequest): Promise { + const response = await this.client.totalSupply(param) + this.totalSupply.supply = [...this.totalSupply.supply, ...response.supply] + this.totalSupply.pagination = response.pagination + return response + }, + async fetchSupply(denom: string) { + return this.client.supplyOf( { denom } ) + } + } }) diff --git a/packages/dashboard/src/stores/useBaseStore.ts b/packages/dashboard/src/stores/useBaseStore.ts new file mode 100644 index 00000000..8481af08 --- /dev/null +++ b/packages/dashboard/src/stores/useBaseStore.ts @@ -0,0 +1,41 @@ +import { defineStore } from "pinia"; +import { createBaseClientForChain } from "@/libs/client"; +import { useBlockchain } from "@/stores"; +import type { GetLatestBlockResponseSDKType } from "@ping-pub/codegen/src/cosmos/base/tendermint/v1beta1/query"; + +export const useBaseStore = defineStore('baseStore', { + state: () => { + return { + latest: {} as GetLatestBlockResponseSDKType, + recents: [] as GetLatestBlockResponseSDKType[] + } + }, + getters: { + client() { + const chain = useBlockchain() + return createBaseClientForChain(chain.chainName, chain.restClient) + } + }, + actions: { + async initial() { + this.fetchLatest() + }, + async clearRecentBlocks() { + this.recents = [] + }, + async fetchLatest() { + this.latest = await this.client.getLatestBlock() + if(this.recents.length>= 50) { + this.recents.pop() + } + this.recents.push(this.latest) + return this.latest + }, + async fetchSync() { + return this.client.getSyncing() + }, + async fetchNodeInfo() { + return this.client.getNodeInfo() + } + } +}) \ No newline at end of file diff --git a/packages/dashboard/src/stores/useBlockchain.ts b/packages/dashboard/src/stores/useBlockchain.ts index e6592674..dc296ab3 100644 --- a/packages/dashboard/src/stores/useBlockchain.ts +++ b/packages/dashboard/src/stores/useBlockchain.ts @@ -1,35 +1,27 @@ -import { ref, computed } from "vue"; import { defineStore } from "pinia"; -import { getLogo, useDashboard, type ChainConfig } from "./useDashboard"; -import { useTheme } from 'vuetify' +import { useDashboard, type ChainConfig } from "./useDashboard"; import { LCDClient } from '@osmonauts/lcd' -import { cosmos } from '@ping-pub/codegen' -import { createBaseClientForChain } from "@/libs/client"; +import type { VerticalNavItems } from '@/@layouts/types' +import { useRouter } from "vue-router"; +import { useStakingStore } from "./useStakingStore"; +import { useBankStore } from "./useBankStore"; +import { useBaseStore } from "./useBaseStore"; export const useBlockchain = defineStore("blockchain", { state: () => { return { status: {} as Record, - rest: '' + rest: '', + chainName: "" } }, getters: { - current() { - return useDashboard().getCurrentChain() + current() : ChainConfig { + return this.dashboard.chains[this.chainName] }, - logo() { + logo(): string { return this.current?.logo || '' }, - name() { - return this.current?.chainName || '' - }, - primaryColor() { - const color = this.current.themeColor || '#666CFF' - const vuetifyTheme = useTheme() - const currentThemeName = vuetifyTheme.name.value - vuetifyTheme.themes.value[currentThemeName].colors.primary = color - return color - }, availableEndpoint() : string { const all = this.current?.endpoints?.rest if(all) { @@ -41,19 +33,80 @@ export const useBlockchain = defineStore("blockchain", { } return this.rest }, - restClient() { - return new LCDClient({restEndpoint: this.availableEndpoint()}) + restClient() : LCDClient { + return new LCDClient({restEndpoint: this.rest}) + }, + dashboard() { + return useDashboard() + }, + computedChainMenu() { + + let currNavItem: VerticalNavItems = [] + + const router = useRouter() + const routes = router?.getRoutes()||[] + if(this.current && routes) { + currNavItem = [{ + title: this.current?.prettyName || this.chainName || '', + icon: {image: this.current.logo, size: '22'}, + i18n: false, + children: routes + .filter(x=>x.name && x.name.toString().startsWith('chain')) + .map(x => ({ + title: `module.${x.name?.toString()}`, + to: {path: x.path.replace(':chain',this.chainName)}, + icon: { icon: 'mdi-chevron-right', size: '22'}, + i18n: true + })) + .sort((a,b)=>a.to.path.length - b.to.path.length) + }] + } + // compute favorite menu + const favNavItems: VerticalNavItems = [] + this.dashboard.favorite.forEach(name => { + const ch = this.dashboard.chains[name] + if(ch) { + favNavItems.push({ + title: ch.prettyName || ch.chainName || name, + to: { path: `/${ch.chainName || name}`}, + icon: {image: ch.logo, size: '22'} + } ) + } + }) + + // combine all together + return [...currNavItem, + { heading: 'Ecosystem' }, + { + title: 'Favorite', + children: favNavItems, + badgeContent: favNavItems.length, + badgeClass: 'bg-primary', + i18n: true, + icon: { icon: 'mdi-star', size: '22'} + }, + { + title: 'All Blockchains', + to: { path : '/'}, + badgeContent: this.dashboard.length, + badgeClass: 'bg-primary', + i18n: true, + icon: { icon: 'mdi-grid', size: '22'} + } + ] }, }, actions: { + async initial() { + await useStakingStore().init() + await useBankStore().initial() + useBaseStore().initial() + }, setRestEndpoint(endpoint: string) { this.rest = endpoint }, - calltest() { - console.log('call test') - const base = createBaseClientForChain(this.current.chainName, new LCDClient({restEndpoint: 'https://api.evmos.nodestake.top/'})) - console.log('base: ', base) - base.getLatestBlock().then(x => console.log(x)) + setCurrent(name: string) { + this.chainName = name } } }) diff --git a/packages/dashboard/src/stores/useCoinGecko.ts b/packages/dashboard/src/stores/useCoinGecko.ts index 10b56473..4032b020 100644 --- a/packages/dashboard/src/stores/useCoinGecko.ts +++ b/packages/dashboard/src/stores/useCoinGecko.ts @@ -42,8 +42,10 @@ export const useCoingecko = defineStore('coingecko', { return get(`https://api.coingecko.com/api/v3/coins/${coinId}`) }, setSecondaryCurrency(currency: string) { - localStorage.setItem(LocalStoreKey, currency) - this.currency = currency + if(currency !== 'usd') { + localStorage.setItem(LocalStoreKey, currency) + this.currency = currency + } } } }) \ No newline at end of file diff --git a/packages/dashboard/src/stores/useDashboard.ts b/packages/dashboard/src/stores/useDashboard.ts index 7c08e7e2..be6210d8 100644 --- a/packages/dashboard/src/stores/useDashboard.ts +++ b/packages/dashboard/src/stores/useDashboard.ts @@ -2,9 +2,7 @@ import { ref, computed } from "vue"; import { defineStore } from "pinia"; import { get } from '../libs/http' import type { Chain, Asset } from '@ping-pub/chain-registry-client/dist/types' -import type { VerticalNavItems } from '@/@layouts/types' -import ChainRegistryClient from '@ping-pub/chain-registry-client' -import { useRouter } from "vue-router"; +import { useBlockchain } from "./useBlockchain"; export enum EndpointType { rpc, @@ -74,6 +72,56 @@ export interface ChainConfig { }, } +export interface LocalConfig { + addr_prefix: string, + alias: string, + api: string[] | Endpoint[], + assets: {base: string, coingecko_id: string, exponent: string, logo: string, symbol: string}[] + chain_name: string, + coin_type: string + logo: string, + min_tx_fee: string, + rpc: string[] | Endpoint[], + sdk_version: string, +} + +function apiConverter(api: any[]){ + return api.map(x => { + if(typeof x === 'string') { + const parts = String(x).split('.') + return { + address: x, + provider: parts.length >=2 ? parts[parts.length-2] : x + } + }else{ + return x as Endpoint + } + }) +} + +export function fromLocal(lc: LocalConfig ): ChainConfig { + const conf = {} as ChainConfig + conf.assets = lc.assets.map(x => ({ + name: x.base, + base: x.base, + display: x.symbol, + symbol: x.symbol, + logo_URIs: { svg: x.logo }, + coingecko_id: x.coingecko_id, + denom_units: [{denom: x.base, exponent: 0}, {denom: x.symbol.toLowerCase(), exponent: Number(x.exponent)}] + })) + conf.bech32Prefix = lc.addr_prefix + conf.chainName = lc.chain_name + conf.prettyName = lc.chain_name + conf.endpoints = { + rest: apiConverter(lc.api), + rpc: apiConverter(lc.rpc), + } + conf.logo = lc.logo + return conf +} + + export function fromDirectory(source: DirectoryChain): ChainConfig { const conf = {} as ChainConfig conf.assets = source.assets, @@ -129,7 +177,6 @@ function createChainFromDirectory(source: DirectoryChain) : Chain { svg: source.image } } - return conf } @@ -138,120 +185,64 @@ export enum LoadingStatus { Loading, Loaded, } +export enum NetworkType { + Mainnet, + Testnet, +} export enum ConfigSource { MainnetCosmosDirectory = "https://chains.cosmos.directory", TestnetCosmosDirectory = "https://chains.testcosmos.directory", - Local = './src/blockchain', + Local = 'local', } -export const useDashboard = defineStore("dashboard", () => { - const status = ref(LoadingStatus.Empty) - // current blockchain for display - const source = ref(ConfigSource.MainnetCosmosDirectory) - const favorite = ref(JSON.parse(localStorage.getItem('favorite') || '["cosmoshub", "osmosis"]') as string[]) - const current = ref(favorite.value[0]) - const chains = ref({} as Record); - - const findChainByName = computed((name) => chains.value[name]); - - const computeChainNav = computed(() => { - // compute current menu - const currChain = chains.value[current.value] - let currNavItem: VerticalNavItems = [] - - const router = useRouter() - const routes = router?.getRoutes()||[] - if(currChain && routes) { - currNavItem = [{ - title: currChain.prettyName || currChain.chainName || current.value, - icon: {image: currChain.logo, size: '22'}, - i18n: false, - children: routes - .filter(x=>x.name && x.name.toString().startsWith('chain')) - .map(x => ({ - title: `module.${x.name?.toString()}`, - to: {path: x.path.replace(':chain',current.value)}, - icon: { icon: 'mdi-chevron-right', size: '22'}, - i18n: true - })) - .sort((a,b)=>a.to.path.length - b.to.path.length) - }] +export const useDashboard = defineStore('dashboard', { + state: () => { + const fav = JSON.parse(localStorage.getItem('favorite') || '["cosmoshub", "osmosis"]') + return { + status: LoadingStatus.Empty, + source: ConfigSource.MainnetCosmosDirectory, + networkType: NetworkType.Mainnet, + favorite: fav as string[], + chains: {} as Record, + } + }, + getters: { + current() : string { + const blockchain = useBlockchain() + return blockchain.chainName || this.favorite[0] || '' + }, + length() : number { + return Object.keys(this.chains).length } - // compute favorite menu - const favNavItems: VerticalNavItems = [] - favorite.value.forEach(name => { - const ch = chains.value[name] - if(ch) { - favNavItems.push({ - title: ch.prettyName || ch.chainName || name, - to: { path: `/${ch.chainName || name}`}, - icon: {image: ch.logo, size: '22'} - } ) - } - }) - - // combine all together - return [...currNavItem, - { heading: 'Ecosystem' }, - { - title: 'Favorite', - children: favNavItems, - badgeContent: favorite.value.length, - badgeClass: 'bg-primary', - i18n: true, - icon: { icon: 'mdi-star', size: '22'} - }, - { - title: 'All Blockchains', - to: { path : '/'}, - badgeContent: length.value, - badgeClass: 'bg-primary', - i18n: true, - icon: { icon: 'mdi-grid', size: '22'} - } - ] - }) - - const length = computed(()=> { - return Object.keys(chains.value).length - }) - async function initial() { - await loadingFromRegistry() - } - - async function loadingChainByName(name: string) { - // const chain = await client.fetchChainInfo(name) - // chains.value[name] = chain - } - function loadingFromRegistry() { - if(status.value === LoadingStatus.Empty) { - status.value = LoadingStatus.Loading - get(source.value).then((res)=> { - res.chains.forEach(( x: DirectoryChain ) => { - chains.value[x.chain_name] = fromDirectory(x) - }); - status.value = LoadingStatus.Loaded - }) + }, + actions: { + initial() { + this.loadingFromLocal() + // this.loadingFromRegistry() + }, + async loadingFromRegistry() { + if(this.status === LoadingStatus.Empty) { + this.status = LoadingStatus.Loading + get(this.source).then((res)=> { + res.chains.forEach(( x: DirectoryChain ) => { + this.chains[x.chain_name] = fromDirectory(x) + }); + this.status = LoadingStatus.Loaded + }) + } + }, + async loadingFromLocal() { + const source = this.networkType === NetworkType.Mainnet + ? import.meta.glob('../../chains/mainnet/*.json', {eager: true}) + : import.meta.glob('../../chains/testnet/*.json', {eager: true}) + Object.values(source).forEach((x: LocalConfig) => { + this.chains[x.chain_name] = fromLocal(x) + }) + this.status = LoadingStatus.Loaded + }, + setConfigSource(newSource: ConfigSource) { + this.source = newSource + this.initial() } } - function setCurrentChain(name: string) { - if(name && name !== current.value) { - current.value = name - } - } - function getCurrentChain() { - return chains.value[current.value] || Object.values(chains.value)[0] - } - function setConfigSource(newSource: ConfigSource) { - source.value = newSource - initial() - } - return { - // states - status, favorite, current, chains, length, - // getters - computeChainNav, findChainByName, getCurrentChain, - // actions - initial, loadingFromRegistry, loadingChainByName, setCurrentChain, setConfigSource - }; -}); +}) diff --git a/packages/dashboard/src/stores/useDistributionStore.ts b/packages/dashboard/src/stores/useDistributionStore.ts new file mode 100644 index 00000000..046f8b63 --- /dev/null +++ b/packages/dashboard/src/stores/useDistributionStore.ts @@ -0,0 +1,21 @@ +import { defineStore } from "pinia"; +import { useBlockchain } from "./useBlockchain"; +import { createDistributionClientForChain } from "@/libs/client"; + +export const useDistributionStore = defineStore('distributionStore', { + state: () => { + return { + } + }, + getters: { + client() { + const chain = useBlockchain() + return createDistributionClientForChain(chain.chainName, chain.restClient) + } + }, + actions: { + fetchCommunityPool() { + return this.client.communityPool() + } + } +}) \ No newline at end of file diff --git a/packages/dashboard/src/stores/useEndpoint.ts b/packages/dashboard/src/stores/useEndpoint.ts deleted file mode 100644 index 07c7b9d1..00000000 --- a/packages/dashboard/src/stores/useEndpoint.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { defineStore } from "pinia"; -import type { LCDClient } from '@osmonauts/lcd'; - -export const useEndpoint = defineStore('pinia.endpoint', { - state: () => { - return { - restClient: {} as LCDClient, - } - }, - actions: { - setRestClient(client: LCDClient) { - this.restClient = client - } - } -}) \ No newline at end of file diff --git a/packages/dashboard/src/stores/useFormatter.ts b/packages/dashboard/src/stores/useFormatter.ts new file mode 100644 index 00000000..ddb7089f --- /dev/null +++ b/packages/dashboard/src/stores/useFormatter.ts @@ -0,0 +1,65 @@ +import { defineStore } from "pinia"; +import { useBlockchain } from "./useBlockchain"; +import Long from "long"; +import numeral from "numeral"; +import type { PoolSDKType } from "@ping-pub/codegen/src/cosmos/staking/v1beta1/staking"; + +export const useFormatter = defineStore('formatter', { + state: () => { + return { + } + }, + getters: { + blockchain() { + return useBlockchain() + } + }, + actions: { + formatTokenAmount(token: {denom: string, amount: string;}) { + return this.formatToken(token, false) + }, + formatToken(token: { denom: string, amount: string;}, withDenom = true) : string { + if(token && token.amount) { + let amount = Long.fromValue(token.amount) + let denom = token.denom + const conf = this.blockchain.current?.assets?.find(x => x.base === token.denom || x.base.denom === token.denom) + if(conf) { + let unit = {exponent: 0, denom: ''} + // find the max exponent for display + conf.denom_units.forEach(x => { + if(x.exponent >= unit.exponent) { + unit = x + } + }) + if(unit && unit.exponent > 0) { + amount = Long.fromValue(token.amount).divide(Math.pow(10, unit?.exponent)) + denom = unit.denom.toUpperCase() + } + + console.log("===============") + console.log(unit, token, amount, denom) + console.log("===============") + } + return `${numeral(amount).format('0.0a')} ${withDenom ? denom: ''}` + } + return '-' + }, + formatTokens(tokens: { denom: string, amount: string;}[], withDenom = true) : string { + return tokens.map(x => this.formatToken(x, withDenom)).join(',') + }, + calculateBondedRatio(pool: {bonded_tokens: string, not_bonded_tokens: string}|undefined) { + if(pool && pool.bonded_tokens) { + const b = Number(pool.bonded_tokens) + const nb = Number(pool.not_bonded_tokens) + const p = b/(b+nb) + console.log(b, nb, p, pool) + return numeral(p).format('0.[00]%') + } + return '-' + }, + formatDecimalToPercent(decimal: string) { + return numeral(decimal).format('0.[00]%') + }, + } +}) + diff --git a/packages/dashboard/src/stores/useGovStore.ts b/packages/dashboard/src/stores/useGovStore.ts new file mode 100644 index 00000000..902fad23 --- /dev/null +++ b/packages/dashboard/src/stores/useGovStore.ts @@ -0,0 +1,29 @@ +import { defineStore } from "pinia"; +import { useBlockchain } from "./useBlockchain"; +import { createGovRestClientForChain } from "@/libs/client"; +import type { ProposalStatus } from "@ping-pub/codegen/src/cosmos/gov/v1/gov"; +import type { PageRequest } from "@ping-pub/codegen/src/helpers"; + +export const useStoreName = defineStore('govStore', { + state: () => { + return { + } + }, + getters: { + client() { + const chain = useBlockchain() + return createGovRestClientForChain(chain.chainName, chain.restClient) + } + }, + actions: { + fetehProposals( proposalStatus: ProposalStatus, pagination?: PageRequest ) { + const param = { + proposalStatus, + voter: '', + depositor: '', + pagination, + } + return this.client.proposals(param) + } + } +}) \ No newline at end of file diff --git a/packages/dashboard/src/stores/useMintStore.ts b/packages/dashboard/src/stores/useMintStore.ts new file mode 100644 index 00000000..920f1002 --- /dev/null +++ b/packages/dashboard/src/stores/useMintStore.ts @@ -0,0 +1,25 @@ +import { defineStore } from "pinia"; +import { useBlockchain } from "./useBlockchain"; +import { createMintClientForChain } from "@/libs/client"; + +export const useMintStore = defineStore('mintStore', { + state: () => { + return { + inflation: "", + } + }, + getters: { + client() { + const chain = useBlockchain() + return createMintClientForChain(chain.chainName, chain.restClient) + } + }, + actions: { + fetchInflation() { + this.client.inflation({}).then(x => { + this.inflation = String(x.inflation) + console.log(this.inflation) + }) + } + } +}) \ No newline at end of file diff --git a/packages/dashboard/src/stores/useStakingStore.ts b/packages/dashboard/src/stores/useStakingStore.ts new file mode 100644 index 00000000..fabd3fab --- /dev/null +++ b/packages/dashboard/src/stores/useStakingStore.ts @@ -0,0 +1,36 @@ +import { defineStore } from "pinia"; +import { useBlockchain } from "./useBlockchain"; +import { createStakingRestClientForChain } from "@/libs/client"; +import type { ParamsSDKType, PoolSDKType } from "@ping-pub/codegen/src/cosmos/staking/v1beta1/staking"; + +export const useStakingStore = defineStore('stakingStore', { + state: () => { + return { + params: {} as ParamsSDKType, + pool: {} as PoolSDKType, + } + }, + getters: { + client() { + const chain = useBlockchain() + return createStakingRestClientForChain(chain.chainName, chain.restClient) + } + }, + actions: { + async init() { + this.fetchPool() + return await this.fetchParams() + }, + async fetchParams() { + const response = await this.client.params({}) + if(response.params) this.params = response.params + return this.params + }, + async fetchPool() { + const response = await this.client.pool({}) + if(response.pool) { + this.pool = response.pool + } + } + } +}) \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 0b80be45..feab3889 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7097,7 +7097,7 @@ long@^4.0.0: resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== -long@^5.2.0: +long@^5.2.0, long@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/long/-/long-5.2.1.tgz#e27595d0083d103d2fa2c20c7699f8e0c92b897f" integrity sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A==