Merge remote-tracking branch 'upstream/master' into v3-single

This commit is contained in:
Alisa | Side.one 2023-05-20 13:10:34 +08:00
commit 53292e1308
69 changed files with 1179 additions and 244 deletions

5
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,5 @@
# These are supported funding model platforms
# github: liangping
issuehunt: ping-pub # Replace with a single IssueHunt username

21
.github/workflows/config-check.yaml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Config Checker
on:
# push:
# branches: [ master ]
pull_request:
# branches: [ master ]
paths:
- 'chains/mainnet/**'
- 'chains/testnet/**'
jobs:
deploy:
name: Check Blockchain Config
runs-on: ubuntu-latest
steps:
- name: Git Checkout Latest
uses: actions/checkout@v3
- name: Check Chain Configs
uses: ping-pub/ping-dashboard-config-checker@v1.0

51
.github/workflows/docker.yaml vendored Normal file
View File

@ -0,0 +1,51 @@
name: docker
on:
push:
branches:
- 'master-backup'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# -
# name: Set up QEMU
# uses: docker/setup-qemu-action@v1
# -
# name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
- name: Install
run: yarn install
- name: Build
run: yarn run vue-cli-service build
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
yaoling/wallet
# generate Docker tags based on the following events/attributes
tags: |
type=sha
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

28
.github/workflows/mainnet-deploy.yaml vendored Normal file
View File

@ -0,0 +1,28 @@
name: Deploy to ping.pub
on:
push:
branches: [ master ]
# pull_request:
# branches: [ master ]
jobs:
deploy:
name: Ping deploy
runs-on: mainnet
steps:
- name: Environment
run: export NODE_OPTIONS="--max_old_space_size=4096"
- name: Git Checkout Latest
uses: actions/checkout@v3
- name: Install
run: yarn install --ignore-engines
- name: Build
run: yarn build-only
- name: Deploy
run: cp -rf ./dist/* /var/www/html/

27
.github/workflows/testnet-deploy.yaml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Testnet Deploy
on:
push:
branches: [ testnet ]
pull_request:
branches: [ testnet ]
jobs:
deploy:
name: Ping deploy
runs-on: testnet
steps:
- name: print
run: echo ${GITHUB_REF#refs/heads/}
- name: Git Checkout Latest
uses: actions/checkout@v2
- name: Install
run: yarn install
- name: Build
run: yarn run vue-cli-service build
- name: Deploy
run: cp -rf ./dist/* /var/www/html/

3
.gitignore vendored
View File

@ -1,3 +1,4 @@
node_modules/ node_modules/
**/.vscode **/.vscode
yarn-error.log yarn-error.log
dist

339
LICENSE Normal file
View File

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -1,46 +1,65 @@
# framework <div align="center">
This template should help get you started developing with Vue 3 in Vite. ![Ping Wallet](./public/logo.svg)
## Recommended IDE Setup <h1>Ping Dashboard</h1>
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin). **Ping Dashboard is not only an explorer but also a wallet and more ... 🛠**
## Type Support for `.vue` Imports in TS [![version](https://img.shields.io/github/tag/ping-pub/explorer.svg)](https://github.com/ping-pub/explorer/releases/latest)
[![GitHub](https://img.shields.io/github/license/ping-pub/explorer.svg)](https://github.com/ping-pub/explorer/blob/master/LICENSE)
[![Ping Deploy](https://github.com/ping-pub/explorer/actions/workflows/mainnet-deploy.yaml/badge.svg)](https://github.com/ping-pub/explorer/actions/workflows/mainnet-deploy.yaml)
[![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/bukotsunikki.svg?style=social&label=Follow%20%40ping_pub)](https://twitter.com/ping_pub)
[![https://discord.gg/CmjYVSr6GW](https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&longCache=true&style=flat)](https://discord.gg/CmjYVSr6GW)
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps: </div>
1. Disable the built-in TypeScript Extension `Ping Dashboard` is a light explorer for Cosmos-based Blockchains. https://ping.pub .
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
## Customize configuration ## What is the difference between Ping explorer and other explorers?
See [Vite Configuration Reference](https://vitejs.dev/config/). `Ping Dashboard` is designed to explore blockchain data as real as possible, therefore there is no cache, no pre-processing. `Ping Dashboard` only fetch data from Cosmos full node via LCD/RPC endpoints. We call it "Light Explorer".
## Project Setup ## Do you want to list your blockchain on ping.pub?
```sh Submit your pull request [here](./src/chains), We will add your chains as soon as possible. It is **FREE** (You must have 10+ independent validators on your chain).
npm install
We remain neutral to all chains, and we do not comment on their market prospects, technical risks, or investment risks. The only condition we list on ping.pub is if there are ten validators, and we cannot determine if these validators are controlled by the same entity.
## Why Ping explorer use official/trusted third party public LCD/rpc server?
There are two main reasons:
- Trust, in a decentralized system, anything controlled by one entity cannot be trusted. So we decided to build with the community.
- Limited resources: `Ping Dashboard` will list hundreds of cosmos-based blockchains in the future, and it is impossible for our team to run validators or full nodes for all of them.
## Donation
Your donation will help us make better products. Thanks in advance.
- Address for ERC20: USDC, USDT, ETH
```
0x88BFec573Dd3E4b7d2E6BfD4D0D6B11F843F8aa1
``` ```
### Compile and Hot-Reload for Development - You can donate any token in the Cosmos ecosystem: [here](https://ping.pub/coffee)
```sh > If you are an individual please do not donate more than $10, a cup of coffee means a lot to us.
npm run dev
```
### Type-Check, Compile and Minify for Production #### Donations from project
```sh - Point Network: 1000USDC and $1000 worth of POINT
npm run build - Bitsong: 50k BTSG
``` - IRISnet: 100k IRIS
### Lint with [ESLint](https://eslint.org/) ## Hire us
You can hire us by submiting an issue and fund the issue on [IssueHunter](https://issuehunt.io/r/ping-pub/explorer)
## Contributors
Developers: @liangping @dingyiming
```sh
npm run lint
```

View File

@ -1,7 +1,7 @@
{ {
"chain_name": "akash", "chain_name": "akash",
"alias": "akash-network", "alias": "akash-network",
"api": ["https://api-akash-ia.cosmosia.notional.ventures/", "https://akash-api.polkachu.com", "https://akash.c29r3.xyz:443/api", "https://akash.api.ping.pub"], "api": ["https://api-akash-ia.cosmosia.notional.ventures/", "https://akash-api.polkachu.com", "https://akash.c29r3.xyz:443/api"],
"rpc": ["https://rpc-akash-ia.cosmosia.notional.ventures/", "https://akash-rpc.polkachu.com/", "http://rpc.akash.forbole.com:80", "http://akashsentry01.skynetvalidators.com:26657"], "rpc": ["https://rpc-akash-ia.cosmosia.notional.ventures/", "https://akash-rpc.polkachu.com/", "http://rpc.akash.forbole.com:80", "http://akashsentry01.skynetvalidators.com:26657"],
"snapshot_provider": "", "snapshot_provider": "",
"sdk_version": "0.45.4", "sdk_version": "0.45.4",

25
chains/mainnet/aura.json Normal file
View File

@ -0,0 +1,25 @@
{
"chain_name": "aura",
"coingecko": "aura-network",
"api": ["https://lcd.aura.network"],
"rpc": [
"https://rpc.aura.network:443",
"https://snapshot-1.aura.network:443",
"https://snapshot-2.aura.network:443"
],
"snapshot_provider": "",
"sdk_version": "0.45.11",
"coin_type": "118",
"min_tx_fee": "8000",
"addr_prefix": "aura",
"logo": "/logos/aura.png",
"assets": [
{
"base": "uaura",
"symbol": "AURA",
"exponent": "6",
"coingecko_id": "aura-network",
"logo": "/logos/aura.png"
}
]
}

View File

@ -1,30 +1,14 @@
{ {
"chain_name": "cosmos", "chain_name": "cosmos",
"api": [ "api": [
"https://api-cosmoshub-ia.cosmosia.notional.ventures" "https://api-cosmoshub-ia.cosmosia.notional.ventures",
"https://lcd-cosmoshub.blockapsis.com:443"
], ],
"rpc": [{ "rpc": ["https://rpc.cosmos.network:443", "https://cosmos-rpc.icycro.org", "https://rpc.cosmos.dragonstake.io"],
"address": "http://rpc-cosmoshub.freshstaking.com:26657/",
"provider": "FreshSTAKING"
},
{
"address": "https://cosmos-rpc.polkachu.com/",
"provider": "Polkachu"
},
{
"address": "https://rpc.cosmoshub.strange.love/",
"provider": "strangelove-ventures"
},
{
"address": "https://rpc-cosmoshub.whispernode.com/",
"provider": "WhisperNode🤐"
}],
"sdk_version": "0.45.1", "sdk_version": "0.45.1",
"coin_type": "118", "coin_type": "118",
"min_tx_fee": "800", "min_tx_fee": "800",
"addr_prefix": "cosmos", "addr_prefix": "cosmos",
"registry_name": "cosmoshub",
"logo": "/logos/cosmos.svg", "logo": "/logos/cosmos.svg",
"assets": [{ "assets": [{
"base": "uatom", "base": "uatom",

View File

@ -0,0 +1,19 @@
{
"chain_name": "gitopia",
"coingecko": "",
"api": ["https://gitopia-api.polkachu.com"],
"rpc": ["https://gitopia-rpc.polkachu.com"],
"snapshot_provider": "",
"sdk_version": "0.46.12",
"coin_type": "118",
"min_tx_fee": "3000",
"addr_prefix": "gitopia",
"logo": "/logos/gitopia.png",
"assets": [{
"base": "ulore",
"symbol": "LORE",
"exponent": "6",
"coingecko_id": "",
"logo": "/logos/gitopia.png"
}]
}

View File

@ -13,7 +13,7 @@
"base": "ugraviton", "base": "ugraviton",
"symbol": "GRAVITON", "symbol": "GRAVITON",
"exponent": "6", "exponent": "6",
"coingecko_id": "", "coingecko_id": "graviton",
"logo": "/logos/gravity-bridge.png" "logo": "/logos/gravity-bridge.png"
}] }]
} }

18
chains/mainnet/kyve.json Normal file
View File

@ -0,0 +1,18 @@
{
"chain_name": "kyve",
"api": ["https://api-explorer.kyve.network:443"],
"rpc": ["https://rpc-eu-1.kyve.network:443","https://rpc-us-1.kyve.network:443"],
"snapshot_provider": "",
"sdk_version": "0.46.10",
"coin_type": "118",
"min_tx_fee": "4000",
"assets": [{
"base": "ukyve",
"symbol": "KYVE",
"exponent": "6",
"coingecko_id": "",
"logo": "/logos/kyve.svg"
}],
"addr_prefix": "kyve",
"logo": "/logos/kyve.svg"
}

View File

@ -1,21 +1,26 @@
{ {
"chain_name": "Migaloo", "chain_name": "Migaloo",
"coingecko": "", "coingecko": "white-whale",
"api": ["https://api.migaloo.silknodes.io"], "api": [
"rpc": ["https://rpc.migaloo.silknodes.io"], "https://migaloo-api.polkachu.com",
"https://api.migaloo.silknodes.io"
],
"rpc": [
"https://migaloo-rpc.polkachu.com/:443",
"https://rpc.migaloo.silknodes.io"
],
"snapshot_provider": "", "snapshot_provider": "",
"coin_type": 118, "coin_type": 118,
"sdk_version": "0.45.9", "sdk_version": "0.45.9",
"addr_prefix": "migaloo", "addr_prefix": "migaloo",
"logo": "/logos/migaloo.png", "logo": "/logos/migaloo.png",
"assets": [ "assets": [
{ {
"base": "uwhale", "base": "uwhale",
"symbol": "WHALE", "symbol": "WHALE",
"exponent": 6, "exponent": 6,
"coingecko_id": "", "coingecko_id": "white-whale",
"logo": "/logos/whitewhale.jpg" "logo": "/logos/whitewhale.jpg"
} }
] ]
} }

View File

@ -0,0 +1,22 @@
{
"chain_name": "neutron",
"api": ["https://neutron-api.lavenderfive.com/"],
"rpc": ["https://neutron-rpc.lavenderfive.com"],
"provider_chain": {
"api": ["https://api-cosmoshub-ia.cosmosia.notional.ventures"]
},
"features": ["dashboard", "blocks", "ibc", "cosmwasm", "uptime", "parameters", "state-sync"],
"sdk_version": "0.45.1",
"coin_type": "118",
"min_tx_fee": "8000",
"assets": [{
"base": "untrn",
"symbol": "NTRN",
"exponent": "6",
"coingecko_id": "neutron",
"logo": "/logos/neutron.svg"
}],
"addr_prefix": "neutron",
"theme_color": "",
"logo": "/logos/neutron.svg"
}

17
chains/mainnet/nois.json Normal file
View File

@ -0,0 +1,17 @@
{
"chain_name": "nois",
"api": ["https://nois-api.polkachu.com"],
"rpc": ["https://nois-rpc.polkachu.com"],
"sdk_version": "0.45.14",
"addr_prefix": "nois",
"min_tx_fee": "5000",
"logo": "/logos/nois.png",
"assets": [
{
"symbol": "NOIS",
"base": "unois",
"exponent": 6,
"logo": "/logos/nois.png"
}
]
}

View File

@ -0,0 +1,20 @@
{
"chain_name": "Quasar",
"coingecko": "",
"api": ["https://quasar-api.polkachu.com"],
"rpc": ["https://quasar-rpc.polkachu.com"],
"sdk_version": "0.45.14",
"coin_type": 118,
"min_tx_fee": "8000",
"addr_prefix": "quasar",
"logo": "/logos/quasar.png",
"assets": [
{
"base": "uqsr",
"symbol": "QSR",
"exponent": 6,
"coingecko_id": "",
"logo": "/logos/quasar.png"
}
]
}

View File

@ -13,7 +13,7 @@
"base": "uqck", "base": "uqck",
"symbol": "QCK", "symbol": "QCK",
"exponent": "6", "exponent": "6",
"coingecko_id": "", "coingecko_id": "quicksilver",
"logo": "/logos/quicksilver.png" "logo": "/logos/quicksilver.png"
} }
] ]

View File

@ -4,7 +4,7 @@
"api": ["https://public-rest-rpc1.stafihub.io","https://api.stafihub.nodestake.top"], "api": ["https://public-rest-rpc1.stafihub.io","https://api.stafihub.nodestake.top"],
"rpc": ["https://public-rpc1.stafihub.io:443","https://rpc.stafihub.nodestake.top"], "rpc": ["https://public-rpc1.stafihub.io:443","https://rpc.stafihub.nodestake.top"],
"snapshot_provider": "", "snapshot_provider": "",
"sdk_version": "0.45.7", "sdk_version": "0.46.12",
"coin_type": "118", "coin_type": "118",
"min_tx_fee": "20000", "min_tx_fee": "20000",
"addr_prefix": "stafi", "addr_prefix": "stafi",
@ -33,5 +33,11 @@
"exponent": "6", "exponent": "6",
"coingecko_id": "", "coingecko_id": "",
"logo": "/logos/stafihub.png" "logo": "/logos/stafihub.png"
},{
"base": "urswth",
"symbol": "rSWTH",
"exponent": "8",
"coingecko_id": "",
"logo": "/logos/stafihub.png"
}] }]
} }

View File

@ -1,9 +1,9 @@
{ {
"chain_name": "umee", "chain_name": "umee",
"api": ["https://api.barnacle.mainnet.network.umee.cc:443"], "api": ["https://umee-api.polkachu.com:443"],
"rpc": ["https://rpc.barnacle.mainnet.network.umee.cc:443"], "rpc": ["https://umee-rpc.polkachu.com:443"],
"snapshot_provider": "", "snapshot_provider": "",
"sdk_version": "0.46.2", "sdk_version": "0.46.11",
"coin_type": "118", "coin_type": "118",
"min_tx_fee": "8000", "min_tx_fee": "8000",
"addr_prefix": "umee", "addr_prefix": "umee",

View File

@ -0,0 +1,20 @@
{
"chain_name": "whitewhale",
"api": ["https://whitewhale-api.polkachu.com:443"],
"rpc": ["https://whitewhale-rpc.polkachu.com:443"],
"snapshot_provider": "",
"sdk_version": "0.46.9",
"coin_type": "118",
"min_tx_fee": "8000",
"addr_prefix": "migaloo",
"logo": "/logos/whitewhale.png",
"assets": [
{
"base": "uwhale",
"symbol": "WHALE",
"exponent": "6",
"coingecko_id": "white-whale",
"logo": "/logos/whale.png"
}
]
}

View File

@ -22,5 +22,14 @@
</div> </div>
</div> </div>
<script type="module" src="/src/main.ts"></script> <script type="module" src="/src/main.ts"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-238887-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-238887-1');
</script>
</body> </body>
</html> </html>

View File

@ -41,7 +41,7 @@
"md-editor-v3": "^2.8.1", "md-editor-v3": "^2.8.1",
"numeral": "^2.0.6", "numeral": "^2.0.6",
"osmojs": "^14.0.0-rc.0", "osmojs": "^14.0.0-rc.0",
"ping-widget": "^0.0.13", "ping-widget": "^0.0.15",
"pinia": "^2.0.28", "pinia": "^2.0.28",
"postcss": "^8.4.23", "postcss": "^8.4.23",
"prismjs": "^1.29.0", "prismjs": "^1.29.0",

BIN
public/logos/gitopia.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

41
public/logos/kyve.svg Normal file
View File

@ -0,0 +1,41 @@
<svg width="440" height="440" viewBox="0 0 440 440" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_7293_9714)">
<rect width="440" height="440" fill="white"/>
<g filter="url(#filter0_d_7293_9714)">
<rect width="440" height="440" fill="#141C1B"/>
<mask id="mask0_7293_9714" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="440" height="440">
<rect width="440" height="440" fill="#141C1B"/>
</mask>
<g mask="url(#mask0_7293_9714)">
<g filter="url(#filter1_f_7293_9714)">
<ellipse cx="219.5" cy="414.5" rx="338.5" ry="244.5" fill="url(#paint0_linear_7293_9714)" fill-opacity="0.5"/>
</g>
</g>
<path d="M159.423 338H115L165.144 103H209.567L189.038 199.35H197.115L273.173 103H325V107.029L235.481 218.486V224.529L292.019 335.986V338H242.885L193.75 241.65H179.615L159.423 338Z" fill="white"/>
</g>
</g>
<defs>
<filter id="filter0_d_7293_9714" x="-50" y="-46" width="540" height="540" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="4"/>
<feGaussianBlur stdDeviation="25"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_7293_9714"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_7293_9714" result="shape"/>
</filter>
<filter id="filter1_f_7293_9714" x="-319" y="-30" width="1077" height="889" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="100" result="effect1_foregroundBlur_7293_9714"/>
</filter>
<linearGradient id="paint0_linear_7293_9714" x1="219.5" y1="170" x2="219.5" y2="659" gradientUnits="userSpaceOnUse">
<stop stop-color="#58C6B2"/>
<stop offset="1" stop-color="#106757"/>
</linearGradient>
<clipPath id="clip0_7293_9714">
<rect width="440" height="440" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 233 KiB

BIN
public/logos/meme.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

11
public/logos/neutron.svg Normal file
View File

@ -0,0 +1,11 @@
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_757_838)">
<path d="M512 0H36.2663L171.703 159.675C194.221 139.953 223.715 128 256 128C326.692 128 384 185.308 384 256C384 287.887 372.34 317.05 353.052 339.459L512 476.225V0Z" fill="black"/>
<path d="M449.335 512L323.459 364.802C303.872 376.972 280.757 384 256 384C185.308 384 128 326.692 128 256C128 231.467 134.902 208.546 146.87 189.073L0 61.1764V512H449.335Z" fill="black"/>
</g>
<defs>
<clipPath id="clip0_757_838">
<rect width="512" height="512" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 620 B

BIN
public/logos/nois.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
public/logos/side.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

17
public/test.html Normal file
View File

@ -0,0 +1,17 @@
<html>
<head>
<title>Widget Test</title>
<script src="https://unpkg.com/ping-widget@latest/dist/ping-widget.js" type="module" ></script>
</head>
<body>
<div class="p-5">
<div>
<ping-connect-wallet chain-id="kava_2222-10" hd-path="m/44'/118/0'/0/0"/>
</div>
<div>
<label for="PingTokenConvert" class="btn">Buy Kava</label>
<ping-token-convert chain-name="kava" endpoint="https://api.data.kava.io" hd-path="m/44'/118/0'/0/0"/>
</div>
</div>
</body>
</html>

View File

@ -32,7 +32,7 @@ const addFavor = (e: Event) => {
<div class="w-8 h-8 rounded-full overflow-hidden"> <div class="w-8 h-8 rounded-full overflow-hidden">
<img :src="conf.logo" /> <img :src="conf.logo" />
</div> </div>
<div class="font-semibold ml-4 text-base flex-1"> <div class="font-semibold ml-4 text-base flex-1 truncate">
{{ conf?.prettyName || props.name }} {{ conf?.prettyName || props.name }}
</div> </div>
<div <div

View File

@ -22,7 +22,7 @@ const header = computed(() => {
<VTable <VTable
v-if="header.length > 0" v-if="header.length > 0"
density="compact" density="compact"
height="300px" :height="value.length > 5? '300px': ''"
fixed-header fixed-header
hover hover
> >

View File

@ -5,10 +5,10 @@ const props = defineProps(['value']);
</script> </script>
<template> <template>
<div class="overflow-x-auto"> <div class="overflow-x-auto">
<table class="table w-full text-sm"> <table class="table table-compact w-full text-sm">
<tbody> <tbody>
<tr v-for="(v, k) of value"> <tr v-for="(v, k) of value">
<td class="text-capitalize" style="max-width: 100px">{{ String(k).replaceAll("_", " ") }}</td> <td class="text-capitalize whitespace-break-spaces w-1/5" style="min-width: 180px;">{{ String(k).replaceAll("_", " ") }}</td>
<td> <td>
<div <div
class="overflow-hidden w-auto whitespace-normal" class="overflow-hidden w-auto whitespace-normal"

View File

@ -13,6 +13,7 @@ import { useDashboard } from '@/stores/useDashboard';
import NavBarI18n from './NavBarI18n.vue'; import NavBarI18n from './NavBarI18n.vue';
import NavBarWallet from './NavBarWallet.vue'; import NavBarWallet from './NavBarWallet.vue';
import { useBlockchain } from '@/stores'; import { useBlockchain } from '@/stores';
import { computed } from 'vue';
const { appRouteTransition } = useThemeConfig(); const { appRouteTransition } = useThemeConfig();
@ -34,6 +35,7 @@ const changeOpen = (index: Number) => {
sidebarOpen.value = !sidebarOpen.value; sidebarOpen.value = !sidebarOpen.value;
} }
}; };
const showDiscord = window.location.host.search("ping.pub") > -1
</script> </script>
<template> <template>
@ -92,7 +94,7 @@ const changeOpen = (index: Number) => {
</div> </div>
<div <div
v-if="item?.badgeContent" v-if="item?.badgeContent"
class="mr-6 badge badge-sm badge-primary" class="mr-6 badge badge-sm rounded-none" :class="item?.badgeClass"
> >
{{ item?.badgeContent }} {{ item?.badgeContent }}
</div> </div>
@ -137,7 +139,7 @@ const changeOpen = (index: Number) => {
<RouterLink <RouterLink
:to="item?.to" :to="item?.to"
v-if="item?.title && !item?.children?.length" v-if="item?.title && !item?.children?.length && item?.to"
@click="sidebarShow = false" @click="sidebarShow = false"
class="collapse-title px-4 flex items-center py-2 hover:bg-gray-100 dark:hover:bg-[#373f59]" class="collapse-title px-4 flex items-center py-2 hover:bg-gray-100 dark:hover:bg-[#373f59]"
> >
@ -162,7 +164,7 @@ const changeOpen = (index: Number) => {
</div> </div>
<div <div
v-if="item?.badgeContent" v-if="item?.badgeContent"
class="mr-6 badge badge-sm badge-primary" class="mr-6 badge badge-sm" :class="item?.badgeClass"
> >
{{ item?.badgeContent }} {{ item?.badgeContent }}
</div> </div>
@ -174,6 +176,45 @@ const changeOpen = (index: Number) => {
{{ item?.heading }} {{ item?.heading }}
</div> </div>
</div> </div>
<div>
<div class="px-4 text-sm pt-4 text-gray-400 pb-2 uppercase">
Sponsors
</div>
<a href="https://osmosis.zone" class="collapse-title px-4 flex items-center py-2 hover:bg-gray-100 dark:hover:bg-[#373f59]">
<img src="https://ping.pub/logos/osmosis.jpg" class="w-6 h-6 rounded-full mr-3"/>
<div class="text-base capitalize flex-1 text-gray-700 dark:text-gray-200">
Osmosis
</div>
</a>
<a href="https://becole.com" class="collapse-title px-4 flex items-center py-2 hover:bg-gray-100 dark:hover:bg-[#373f59]">
<img src="https://becole.com/static/logo/logo_becole.png" class="w-6 h-6 rounded-full mr-3"/>
<div class="text-base capitalize flex-1 text-gray-700 dark:text-gray-200">
Becole
</div>
</a>
<div class="px-4 text-sm pt-4 text-gray-400 pb-2 uppercase">
Links
</div>
<a href="https://twitter.com/ping_pub" class="collapse-title px-4 flex items-center py-2 hover:bg-gray-100 dark:hover:bg-[#373f59]">
<Icon icon="mdi:twitter" class="text-xl mr-2"/>
<div class="text-base capitalize flex-1 text-gray-700 dark:text-gray-200">
Twitter
</div>
</a>
<a v-if="showDiscord" href="https://discord.com/invite/CmjYVSr6GW" class="collapse-title px-4 flex items-center py-2 hover:bg-gray-100 dark:hover:bg-[#373f59]">
<Icon icon="mdi:discord" class="text-xl mr-2"/>
<div class="text-base capitalize flex-1 text-gray-700 dark:text-gray-200">
Discord
</div>
</a>
<a href="https://github.com/ping-pub/explorer/discussions" class="collapse-title px-4 flex items-center py-2 hover:bg-gray-100 dark:hover:bg-[#373f59]">
<Icon icon="mdi:frequently-asked-questions" class="text-xl mr-2"/>
<div class="text-base capitalize flex-1 text-gray-700 dark:text-gray-200">
FAQ
</div>
</a>
</div>
</div> </div>
<div class="xl:ml-64 px-5"> <div class="xl:ml-64 px-5">
<!-- header --> <!-- header -->

View File

@ -1,10 +1,11 @@
<script setup lang="ts"> <script setup lang="ts">
import { useWalletStore } from '@/stores'; import { useWalletStore } from '@/stores';
import type { Icon } from '@iconify/vue';
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
const walletStore = useWalletStore(); const walletStore = useWalletStore();
walletStore.$subscribe((m, s) => { // walletStore.$subscribe((m, s) => {
console.log(m, s); // console.log(m, s);
}); // });
function walletStateChange(res: any) { function walletStateChange(res: any) {
walletStore.setConnectedWallet(res.detail?.value); walletStore.setConnectedWallet(res.detail?.value);
} }
@ -105,7 +106,7 @@ const addressChange = computed(() => {
<ping-connect-wallet <ping-connect-wallet
:chain-id="'juno-1'" :chain-id="'juno-1'"
:hd-path="`m/44'/118/0'/0/0`" :hd-path="`m/44'/118/0'/0/0`"
@change="walletStateChange" @connect="walletStateChange"
/> />
</Teleport> </Teleport>
</div> </div>

View File

@ -30,7 +30,7 @@ import type {
PaginatedProposals, PaginatedProposals,
Tally, Tally,
} from '@/types/gov'; } from '@/types/gov';
import type { PaginatedSigningInfo } from '@/types/slashing'; import type { PaginatedSigningInfo, SlashingParam } from '@/types/slashing';
import type { import type {
Delegation, Delegation,
PaginatedDelegations, PaginatedDelegations,
@ -90,7 +90,7 @@ export interface RequestRegistry extends AbstractRegistry {
}>; }>;
mint_annual_provisions: Request<{ annual_provisions: string }>; mint_annual_provisions: Request<{ annual_provisions: string }>;
slashing_params: Request<any>; slashing_params: Request<{params: SlashingParam}>;
slashing_signing_info: Request<PaginatedSigningInfo>; slashing_signing_info: Request<PaginatedSigningInfo>;
gov_params_voting: Request<GovParams>; gov_params_voting: Request<GovParams>;

View File

@ -9,7 +9,7 @@ import { loadFonts } from '@/plugins/vuetify/webfontloader';
import '@/plugins/vuetify/@core/scss/template/index.scss'; import '@/plugins/vuetify/@core/scss/template/index.scss';
import '@/plugins/vuetify/styles/styles.scss'; import '@/plugins/vuetify/styles/styles.scss';
import '@/style.css'; import '@/style.css';
import { createApp } from 'vue'; import { createApp, ref } from 'vue';
import { createPinia } from 'pinia'; import { createPinia } from 'pinia';
import LazyLoad from 'lazy-load-vue3'; import LazyLoad from 'lazy-load-vue3';
// import router from "@/plugins/vuetify/router"; // import router from "@/plugins/vuetify/router";
@ -32,4 +32,10 @@ app.mount('#app');
// fetch latest block every 6s // fetch latest block every 6s
const blockStore = useBaseStore() const blockStore = useBaseStore()
setInterval(() => {blockStore.fetchLatest()}, 6000) const requestCounter = ref(0)
setInterval(() => {
requestCounter.value += 1
if(requestCounter.value < 5) { // max allowed request
blockStore.fetchLatest().finally(() => requestCounter.value -= 1)
}
}, 6000)

View File

@ -458,8 +458,10 @@ loadAccount(props.address);
v.height v.height
}}</RouterLink> }}</RouterLink>
</td> </td>
<td class="text-truncate py-3" style="max-width: 200px"> <td class="text-truncate text-primary py-3" style="max-width: 200px">
<RouterLink :to="`/${chain}/tx/${v.txhash}`">
{{ v.txhash }} {{ v.txhash }}
</RouterLink>
</td> </td>
<td class="flex items-center py-3"> <td class="flex items-center py-3">
<div class="mr-2"> <div class="mr-2">

View File

@ -8,6 +8,12 @@ const tab = ref('blocks');
const base = useBaseStore() const base = useBaseStore()
const format = useFormatter(); const format = useFormatter();
const list = computed(() => {
// const recents = base.recents
// return recents.sort((a, b) => (Number(b.block.header.height) - Number(a.block.header.height)))
return base.recents
})
</script> </script>
<template> <template>
<div> <div>
@ -26,41 +32,35 @@ const format = useFormatter();
> >
</div> </div>
<div v-show="tab === 'blocks'" class="bg-base-100 rounded overflow-x-auto"> <div v-show="tab === 'blocks'" class="grid xl:grid-cols-6 md:grid-cols-4 grid-cols-1">
<table class="table w-full">
<thead> <RouterLink
<tr> v-for="item in list"
<th style="position: relative; z-index: 2;">Height</th> class="flex flex-col justify-between rounded border border-gray-100 m-2 p-4 shadow-xl bg-base-100"
<th>Hash</th> :to="`/${chain}/block/${item.block.header.height}`"
<th>Proposer</th> >
<th>Txs</th> <div class="flex justify-between">
<th>Time</th> <h3 class="text-md font-bold sm:text-lg">
</tr> {{ item.block.header.height }}
</thead> </h3>
<tbody v-if="base.recents && base.recents.length > 0" > <span class="rounded text-xs whitespace-nowrap font-medium text-green-600">
<tr v-for="(item, index) in base.recents" :key="index"> {{ format.toDay(item.block?.header?.time, 'from') }}
<td class="text-sm text-primary"> </span>
<RouterLink </div>
:to="`/${props.chain}/block/${item.block?.header?.height}`" <div class="flex justify-between tooltip" data-tip="Block Proposor">
>{{ item.block?.header?.height }}</RouterLink <div class="mt-2 hidden text-sm sm:block truncate">
> <span>{{ format.validator(item.block?.header?.proposer_address) }}</span>
</td> </div>
<td>{{ item.block_id?.hash }}</td> <span class="text-right mt-1 whitespace-nowrap"> {{ item.block?.data?.txs.length }} txs </span>
<td> </div>
{{ format.validator(item.block?.header?.proposer_address) }} </RouterLink>
</td>
<td>{{ item.block?.data?.txs.length }}</td>
<td>{{ format.toDay(item.block?.header?.time, 'from') }}</td>
</tr>
</tbody>
</table>
</div> </div>
<div <div
v-show="tab === 'transactions'" v-show="tab === 'transactions'"
class="bg-base-100 rounded overflow-x-auto" class="bg-base-100 rounded overflow-x-auto"
> >
<table class="table w-full"> <table class="table w-full table-compact">
<thead> <thead>
<tr> <tr>
<th style="position: relative; z-index: 2;">Height</th> <th style="position: relative; z-index: 2;">Height</th>
@ -71,8 +71,12 @@ const format = useFormatter();
</thead> </thead>
<tbody > <tbody >
<tr v-for="(item,index) in base.txsInRecents" :index="index"> <tr v-for="(item,index) in base.txsInRecents" :index="index">
<td>{{ item.height }}</td> <td class="text-sm text-primary">
<td class="text-xs truncate" width="50%"> <RouterLink
:to="`/${props.chain}/block/${item.height}`"
>{{ item.height }}</RouterLink
></td>
<td class="truncate text-primary" width="50%">
<RouterLink :to="`/${props.chain}/tx/${item.hash}`">{{ <RouterLink :to="`/${props.chain}/tx/${item.hash}`">{{
item.hash item.hash
}}</RouterLink> }}</RouterLink>

View File

@ -71,7 +71,7 @@ function color(v: string) {
{ {
meta: { meta: {
i18n: 'ibc', i18n: 'ibc',
order: 8 order: 9
} }
} }
</route> </route>

View File

@ -9,6 +9,7 @@ import {
useTxDialog, useTxDialog,
useWalletStore, useWalletStore,
useStakingStore, useStakingStore,
useParamStore,
} from '@/stores'; } from '@/stores';
import { onMounted, ref } from 'vue'; import { onMounted, ref } from 'vue';
import { useIndexModule } from './indexStore'; import { useIndexModule } from './indexStore';
@ -16,6 +17,9 @@ import { computed } from '@vue/reactivity';
import CardStatisticsVertical from '@/components/CardStatisticsVertical.vue'; import CardStatisticsVertical from '@/components/CardStatisticsVertical.vue';
import ProposalListItem from '@/components/ProposalListItem.vue'; import ProposalListItem from '@/components/ProposalListItem.vue';
import ArrayObjectElement from '@/components/dynamic/ArrayObjectElement.vue'
const props = defineProps(['chain']);
const blockchain = useBlockchain(); const blockchain = useBlockchain();
const store = useIndexModule(); const store = useIndexModule();
@ -23,6 +27,7 @@ const walletStore = useWalletStore();
const format = useFormatter(); const format = useFormatter();
const dialog = useTxDialog(); const dialog = useTxDialog();
const stakingStore = useStakingStore(); const stakingStore = useStakingStore();
const paramStore = useParamStore()
const coinInfo = computed(() => { const coinInfo = computed(() => {
return store.coinInfo; return store.coinInfo;
}); });
@ -30,6 +35,9 @@ const coinInfo = computed(() => {
onMounted(() => { onMounted(() => {
store.loadDashboard(); store.loadDashboard();
walletStore.loadMyAsset(); walletStore.loadMyAsset();
paramStore.handleAbciInfo()
// if(!(coinInfo.value && coinInfo.value.name)) {
// }
}); });
const ticker = computed(() => store.coinInfo.tickers[store.tickerIndex]); const ticker = computed(() => store.coinInfo.tickers[store.tickerIndex]);
@ -40,6 +48,7 @@ blockchain.$subscribe((m, s) => {
) { ) {
store.loadDashboard(); store.loadDashboard();
walletStore.loadMyAsset(); walletStore.loadMyAsset();
paramStore.handleAbciInfo()
} }
}); });
function shortName(name: string, id: string) { function shortName(name: string, id: string) {
@ -100,8 +109,7 @@ const color = computed(() => {
<div class="text-xl font-semibold text-main"> <div class="text-xl font-semibold text-main">
{{ coinInfo.name }} (<span class="uppercase">{{ {{ coinInfo.name }} (<span class="uppercase">{{
coinInfo.symbol coinInfo.symbol
}}</span }}</span>)
>)
</div> </div>
<div class="text-xs mt-2"> <div class="text-xs mt-2">
Rank: Rank:
@ -229,7 +237,7 @@ const color = computed(() => {
</div> </div>
</div> </div>
<div class="bg-base-100 rounded mt-4 shadow"> <div v-if="blockchain.supportModule('governance')" class="bg-base-100 rounded mt-4 shadow">
<div class="px-4 pt-4 pb-2 text-lg font-semibold text-main"> <div class="px-4 pt-4 pb-2 text-lg font-semibold text-main">
Active Proposals Active Proposals
</div> </div>
@ -246,8 +254,8 @@ const color = computed(() => {
{{ walletStore.currentAddress || 'Not Connected' }} {{ walletStore.currentAddress || 'Not Connected' }}
<RouterLink <RouterLink
v-if="walletStore.currentAddress" v-if="walletStore.currentAddress"
class="float-right font-light text-sm cursor-pointert link link-primary no-underline font-medium" class="float-right text-sm cursor-pointert link link-primary no-underline font-medium"
to="/wallet/portfolio" :to="`/${chain}/account/${walletStore.currentAddress}`"
>More</RouterLink >More</RouterLink
> >
</div> </div>
@ -294,7 +302,7 @@ const color = computed(() => {
</div> </div>
</div> </div>
<div class="px-4 pb-4"> <div v-if="walletStore.delegations.length > 0" class="px-4 pb-4">
<table class="table table-compact w-full table-zebra"> <table class="table table-compact w-full table-zebra">
<thead> <thead>
<tr> <tr>
@ -316,27 +324,28 @@ const color = computed(() => {
<td>{{ format.formatToken(item?.balance) }}</td> <td>{{ format.formatToken(item?.balance) }}</td>
<td> <td>
{{ {{
format.formatToken( format.formatTokens(
walletStore?.rewards?.rewards?.find( walletStore?.rewards?.rewards?.find(
(el) => (el) =>
el?.validator_address === el?.validator_address ===
item?.delegation?.validator_address item?.delegation?.validator_address
)?.reward?.[0] )?.reward)
)
}} }}
</td> </td>
<td> <td>
<div> <div>
<button <label for="delegate"
class="btn btn-xs btn-primary btn-ghost text-primary rounded-sm mr-2" class="btn btn-xs btn-primary btn-ghost text-primary rounded-sm mr-2"
@click="dialog.open('delegate', { validator_address: item.delegation.validator_address})"
> >
Delegate Delegate
</button> </label>
<button <label for="withdraw"
class="btn btn-xs btn-primary btn-ghost text-primary rounded-sm" class="btn btn-xs btn-primary btn-ghost text-primary rounded-sm"
@click="dialog.open('withdraw', { validator_address: item.delegation.validator_address})"
> >
Withdraw Rewards Withdraw Rewards
</button> </label>
</div> </div>
</td> </td>
</tr> </tr>
@ -345,13 +354,9 @@ const color = computed(() => {
</div> </div>
<div class="grid grid-cols-3 gap-4 px-4 pb-6 mt-4"> <div class="grid grid-cols-3 gap-4 px-4 pb-6 mt-4">
<label for="send" class="btn btn-success text-white">Send</label> <label for="PingTokenConvert" class="btn btn-primary text-white">Convert</label>
<RouterLink to="/wallet/receive" class="btn btn-info text-white" <label for="send" class="btn btn-success text-white" @click="dialog.open('send', {})">Send</label>
>Receive</RouterLink <RouterLink to="/wallet/receive" class="btn btn-info text-white">Receive</RouterLink>
>
<label for="PingTokenConvert" class="btn btn-primary text-white"
>Convert</label
>
</div> </div>
<Teleport to="body"> <Teleport to="body">
<ping-token-convert <ping-token-convert
@ -361,6 +366,21 @@ const color = computed(() => {
></ping-token-convert> ></ping-token-convert>
</Teleport> </Teleport>
</div> </div>
<div class="bg-base-100 rounded mt-4 shadow">
<div class="px-4 pt-4 pb-2 text-lg font-semibold text-main">
Application
</div>
<!-- Application Version -->
<ArrayObjectElement :value="paramStore.appVersion?.items" :thead="false" />
</div>
<div v-if="!store.coingeckoId" class="bg-base-100 rounded mt-4 shadow">
<div class="px-4 pt-4 pb-2 text-lg font-semibold text-main">
Node Information
</div>
<ArrayObjectElement :value="paramStore.nodeVersion?.items" :thead="false" />
</div>
</div> </div>
</template> </template>

View File

@ -87,29 +87,35 @@ export const useIndexModule = defineStore('module-index', {
return useBankStore(); return useBankStore();
}, },
twitter(): string { twitter(): string {
return `https://twitter.com/${this.coinInfo.links.twitter_screen_name}`; if(!this.coinInfo?.links?.twitter_screen_name) return ""
return `https://twitter.com/${this.coinInfo?.links.twitter_screen_name}`;
}, },
homepage(): string { homepage(): string {
const [page1, page2, page3] = this.coinInfo.links?.homepage; if(!this.coinInfo?.links?.homepage) return ""
const [page1, page2, page3] = this.coinInfo?.links?.homepage;
return page1 || page2 || page3; return page1 || page2 || page3;
}, },
github(): string { github(): string {
const [page1, page2, page3] = this.coinInfo.links?.repos_url?.github; if(!this.coinInfo?.links?.repos_url) return ""
const [page1, page2, page3] = this.coinInfo?.links?.repos_url?.github;
return page1 || page2 || page3; return page1 || page2 || page3;
}, },
telegram(): string { telegram(): string {
return `https://t.me/${this.coinInfo.links.telegram_channel_identifier}`; if(!this.coinInfo?.links?.homepage) return ""
return `https://t.me/${this.coinInfo?.links.telegram_channel_identifier}`;
}, },
priceChange(): string { priceChange(): string {
if(!this.coinInfo?.market_data?.price_change_percentage_24h) return ""
const change = const change =
this.coinInfo.market_data?.price_change_percentage_24h || 0; this.coinInfo?.market_data?.price_change_percentage_24h || 0;
return numeral(change).format('+0.[00]'); return numeral(change).format('+0.[00]');
}, },
priceColor(): string { priceColor(): string {
if(!this.coinInfo?.market_data?.price_change_percentage_24h) return ""
const change = const change =
this.coinInfo.market_data?.price_change_percentage_24h || 0; this.coinInfo?.market_data?.price_change_percentage_24h || 0;
switch (true) { switch (true) {
case change > 0: case change > 0:
return 'text-success'; return 'text-success';
@ -120,7 +126,8 @@ export const useIndexModule = defineStore('module-index', {
} }
}, },
trustColor(): string { trustColor(): string {
const change = this.coinInfo.tickers[this.tickerIndex]?.trust_score; if(!this.coinInfo?.tickers) return ""
const change = this.coinInfo?.tickers[this.tickerIndex]?.trust_score;
return colorMap(change); return colorMap(change);
}, },
@ -193,6 +200,12 @@ export const useIndexModule = defineStore('module-index', {
}, },
]; ];
}, },
coingeckoId() {
this.tickerIndex = 0;
const [firstAsset] = this.blockchain?.assets || [];
return firstAsset.coingecko_id
}
}, },
actions: { actions: {
async loadDashboard() { async loadDashboard() {

View File

@ -56,7 +56,7 @@ onMounted(() => {
{ {
meta: { meta: {
i18n: 'parameters', i18n: 'parameters',
order: 10 order: 50
} }
} }
</route> </route>

View File

@ -55,7 +55,6 @@ staking
const txs = ref({} as PaginatedTxs); const txs = ref({} as PaginatedTxs);
blockchain.rpc.getTxsBySender(addresses.value.account).then((x) => { blockchain.rpc.getTxsBySender(addresses.value.account).then((x) => {
console.log('txs', x);
txs.value = x; txs.value = x;
}); });
@ -77,14 +76,19 @@ const selfRate = computed(() => {
} }
return '-'; return '-';
}); });
const logo = (identity?: string) => {
if (!identity) return '';
const url = avatars.value[identity] || '';
return url.startsWith('http')
? url
: `https://s3.amazonaws.com/keybase_processed_uploads/${url}`;
};
onMounted(() => { onMounted(() => {
if (validator) { if (validator) {
staking.fetchValidator(validator).then((res) => { staking.fetchValidator(validator).then((res) => {
v.value = res.validator; v.value = res.validator;
identity.value = res.validator?.description?.identity || ''; identity.value = res.validator?.description?.identity || '';
if (identity.value && !avatars.value[identity.value]) { if (identity.value && !avatars.value[identity.value]) {
console.log(identity.value, avatars);
staking.keybase(identity.value).then((d) => { staking.keybase(identity.value).then((d) => {
if (Array.isArray(d.them) && d.them.length > 0) { if (Array.isArray(d.them) && d.them.length > 0) {
const uri = String(d.them[0]?.pictures?.primary?.url).replace( const uri = String(d.them[0]?.pictures?.primary?.url).replace(
@ -143,9 +147,7 @@ onMounted(() => {
<div class="w-24 rounded-lg"> <div class="w-24 rounded-lg">
<img <img
v-if="avatars[identity] !== 'undefined'" v-if="avatars[identity] !== 'undefined'"
v-lazy=" v-lazy="logo(identity)"
`https://s3.amazonaws.com/keybase_processed_uploads/${avatars[identity]}`
"
class="object-contain" class="object-contain"
/> />
<Icon <Icon
@ -394,8 +396,10 @@ onMounted(() => {
item.height item.height
}}</RouterLink> }}</RouterLink>
</td> </td>
<td class="text-truncate" style="max-width: 200px"> <td class="text-truncate text-primary" style="max-width: 200px">
<RouterLink :to="`/${props.chain}/tx/${item.txhash}`">
{{ item.txhash }} {{ item.txhash }}
</RouterLink>
</td> </td>
<td> <td>
<div class="flex items-center"> <div class="flex items-center">

View File

@ -58,8 +58,6 @@ async function fetchChange() {
} }
} }
fetchChange();
const changes = computed(() => { const changes = computed(() => {
const changes = {} as Record<string, number>; const changes = {} as Record<string, number>;
Object.keys(latest.value).forEach((k) => { Object.keys(latest.value).forEach((k) => {
@ -92,12 +90,6 @@ const change24Color = (key?: Key) => {
if (v < 0) return 'text-error'; if (v < 0) return 'text-error';
}; };
const update = (m: DebuggerEvent) => {
if (m.key === 'validators') {
loadAvatars();
}
};
const list = computed(() => { const list = computed(() => {
return tab.value === 'active' ? staking.validators : unbondList.value; return tab.value === 'active' ? staking.validators : unbondList.value;
// return staking.validators // return staking.validators
@ -136,15 +128,6 @@ const loadAvatars = () => {
}); });
}; };
staking.$subscribe((m, s) => {
if (Array.isArray(m.events)) {
m.events.forEach((x) => {
update(x);
});
} else {
update(m.events);
}
});
const logo = (identity?: string) => { const logo = (identity?: string) => {
if (!identity) return ''; if (!identity) return '';
const url = avatars.value[identity] || ''; const url = avatars.value[identity] || '';
@ -168,6 +151,10 @@ const rank = function (position: number) {
return 'primary'; return 'primary';
} }
}; };
fetchChange();
loadAvatars();
</script> </script>
<template> <template>
<div> <div>

View File

@ -10,6 +10,15 @@ const blockchain = useBlockchain();
const base = useBaseStore(); const base = useBaseStore();
const nodeInfo = ref({} as NodeInfo); const nodeInfo = ref({} as NodeInfo);
const height = ref(Number(base.latest.block?.header?.height|| 2001))
const hash = ref("")
if(height.value > 2000) {
height.value = Math.round((height.value - 2000) / 1000) * 1000
base.fetchBlock(height.value).then(res => {
hash.value = toHex(fromBase64(res.block_id.hash)).toUpperCase()
})
}
const state = computed(() => { const state = computed(() => {
const rpcs = blockchain.current?.endpoints?.rpc const rpcs = blockchain.current?.endpoints?.rpc
?.map((x) => x.address) ?.map((x) => x.address)
@ -17,10 +26,8 @@ const state = computed(() => {
return `[statesync] return `[statesync]
enable = true enable = true
rpc_servers = "${rpcs}" rpc_servers = "${rpcs}"
trust_height = ${base.latest.block?.header?.height || 'loading'} trust_height = ${height.value || 'loading'}
trust_hash = "${ trust_hash = "${hash.value}"
base.latest.block_id ? toHex(fromBase64(base.latest.block_id?.hash)) : ''
}"
trust_period = "168h" # 2/3 of unbonding time" trust_period = "168h" # 2/3 of unbonding time"
`; `;
}); });
@ -31,7 +38,6 @@ const appName = computed(() => {
onMounted(() => { onMounted(() => {
blockchain.rpc.getBaseNodeInfo().then((x) => { blockchain.rpc.getBaseNodeInfo().then((x) => {
console.log('node info', x);
nodeInfo.value = x; nodeInfo.value = x;
}); });
}); });

View File

@ -39,7 +39,7 @@ const messages = computed(() => {
</tr> </tr>
<tr> <tr>
<td>Height</td> <td>Height</td>
<td> <td class="text-primary">
<RouterLink <RouterLink
:to="`/${props.chain}/block/${tx.tx_response.height}`" :to="`/${props.chain}/block/${tx.tx_response.height}`"
>{{ tx.tx_response.height }}</RouterLink >{{ tx.tx_response.height }}</RouterLink
@ -55,7 +55,7 @@ const messages = computed(() => {
tx.tx_response.code === 0 ? 'success' : 'error' tx.tx_response.code === 0 ? 'success' : 'error'
}`" }`"
> >
<span <span
class="inset-x-0 inset-y-0 opacity-10 absolute" class="inset-x-0 inset-y-0 opacity-10 absolute"
:class="`bg-${ :class="`bg-${
tx.tx_response.code === 0 ? 'success' : 'error' tx.tx_response.code === 0 ? 'success' : 'error'

View File

@ -155,7 +155,7 @@ function color(v: string) {
<tr v-for="v in list"> <tr v-for="v in list">
<td class=" capitalize">{{ v.chainName }}</td> <td class=" capitalize">{{ v.chainName }}</td>
<td>{{ v.v.name }}</td> <td>{{ v.v.name }}</td>
<td><span class="badge " :class="color( v.sigingInfo?.missed_blocks_counter)">{{ v.sigingInfo?.missed_blocks_counter }}</span></td> <td><span v-if="v.sigingInfo" class="badge " :class="color( v.sigingInfo?.missed_blocks_counter)">{{ v.sigingInfo?.missed_blocks_counter }}</span></td>
<td><span v-if="v.sigingInfo">{{ Number(v.sigingInfo.index_offset) - Number(v.sigingInfo.start_height) }}</span></td> <td><span v-if="v.sigingInfo">{{ Number(v.sigingInfo.index_offset) - Number(v.sigingInfo.start_height) }}</span></td>
<td> <td>
<div v-if="v.sigingInfo && !v.sigingInfo?.jailed_until.startsWith('1970')" class="text-xs flex flex-col"> <div v-if="v.sigingInfo && !v.sigingInfo?.jailed_until.startsWith('1970')" class="text-xs flex flex-col">

View File

@ -1,7 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref, onMounted, computed, watchEffect } from 'vue'; import { ref, onMounted, computed, watchEffect } from 'vue';
import { fromHex, toBase64 } from '@cosmjs/encoding'; import { fromHex, toBase64 } from '@cosmjs/encoding';
import { Icon } from '@iconify/vue';
import { import {
useFormatter, useFormatter,
useStakingStore, useStakingStore,
@ -9,9 +8,8 @@ import {
useBlockchain, useBlockchain,
} from '@/stores'; } from '@/stores';
import UptimeBar from '@/components/UptimeBar.vue'; import UptimeBar from '@/components/UptimeBar.vue';
import type { Block, Commit } from '@/types'; import type { Commit, SlashingParam, SigningInfo } from '@/types';
import { consensusPubkeyToHexAddress, valconsToBase64 } from '@/libs'; import { consensusPubkeyToHexAddress, valconsToBase64 } from '@/libs';
import type { SigningInfo } from '@/types/slashing';
const props = defineProps(['chain']); const props = defineProps(['chain']);
@ -23,9 +21,11 @@ const latest = ref(0);
const commits = ref([] as Commit[]); const commits = ref([] as Commit[]);
const keyword = ref(''); const keyword = ref('');
const live = ref(true); const live = ref(true);
const slashingParam = ref({} as SlashingParam)
const signingInfo = ref({} as Record<string, SigningInfo>); const signingInfo = ref({} as Record<string, SigningInfo>);
const filterOptout =ref(false)
// filter validators by keywords // filter validators by keywords
const validators = computed(() => { const validators = computed(() => {
if (keyword) if (keyword)
@ -36,37 +36,45 @@ const validators = computed(() => {
}); });
const list = computed(() => { const list = computed(() => {
return validators.value.map(v => ({ const window = Number(slashingParam.value.signed_blocks_window|| 0)
v, const vset = validators.value.map(v => {
signing: signingInfo.value[consensusPubkeyToHexAddress(v.consensus_pubkey)], const signing = signingInfo.value[consensusPubkeyToHexAddress(v.consensus_pubkey)]
hex: toBase64(fromHex(consensusPubkeyToHexAddress(v.consensus_pubkey))) return {
})) v,
signing,
hex: toBase64(fromHex(consensusPubkeyToHexAddress(v.consensus_pubkey))),
uptime: signing && window > 0 ? (window - Number(signing.missed_blocks_counter)) / window: undefined
}})
return filterOptout.value? vset.filter(x => x.signing) : vset
}) })
onMounted(() => { onMounted(() => {
live.value = true; live.value = true;
baseStore.fetchLatest().then(b => {
baseStore.fetchLatest().then(l => {
let b = l
if(baseStore.recents?.findIndex(x => x.block_id.hash === l.block_id.hash) > -1 ) {
b = baseStore.recents?.at(0) || l
}
latest.value = Number(b.block.header.height); latest.value = Number(b.block.header.height);
commits.value.unshift(b.block.last_commit); commits.value.unshift(b.block.last_commit);
const height = Number(b.block.header?.height || 0); const height = Number(b.block.header?.height || 0);
if (height === 0) { if (height > 50) {
// constructs sequence for loading blocks // constructs sequence for loading blocks
let promise = Promise.resolve(); let promise = Promise.resolve();
for (let i = height - 1; i > height - 50; i -= 1) { for (let i = height - 1; i > height - 50; i -= 1) {
if (i > height - 48) { promise = promise.then(
promise = promise.then( () =>
() => new Promise((resolve, reject) => {
new Promise((resolve, reject) => { if (live.value && commits2.value.length < 50) {
if (live.value && commits2.value.length < 50) { // continue only if the page is living
// continue only if the page is living baseStore.fetchBlock(i).then((x) => {
baseStore.fetchBlock(i).then((x) => { commits.value.unshift(x.block.last_commit);
commits.value.unshift(x.block.last_commit); resolve();
resolve(); });
}); }
} })
}) );
);
}
} }
} }
}); });
@ -76,6 +84,10 @@ onMounted(() => {
signingInfo.value[valconsToBase64(i.address)] = i; signingInfo.value[valconsToBase64(i.address)] = i;
}); });
}); });
chainStore.rpc.getSlashingParams().then(x => {
slashingParam.value = x.params
})
}); });
const commits2 = computed(() => { const commits2 = computed(() => {
@ -91,7 +103,6 @@ const tab = ref("3")
function changeTab(v: string) { function changeTab(v: string) {
tab.value = v tab.value = v
} }
</script> </script>
<template> <template>
@ -109,7 +120,7 @@ function changeTab(v: string) {
@click="changeTab('2')" @click="changeTab('2')"
>Blocks</a >Blocks</a
> >
<RouterLink :to="`/${chain}/uptime/overview`"> <RouterLink :to="`/${chain}/uptime/customize`">
<a <a
class="tab text-gray-400 capitalize" class="tab text-gray-400 capitalize"
>Customize</a >Customize</a
@ -117,12 +128,12 @@ function changeTab(v: string) {
</div> </div>
<div class="bg-base-100 px-5 pt-5"> <div class="bg-base-100 px-5 pt-5">
<div class="flex items-center gap-x-4"> <div class="flex items-center gap-x-4">
<label v-if="chainStore.isConsumerChain" class="text-center">
<input type="checkbox" v-model="filterOptout" class="checkbox"/>
Only Consumer Set
</label>
<input type="text" v-model="keyword" placeholder="Keywords to filter validators" <input type="text" v-model="keyword" placeholder="Keywords to filter validators"
class="input input-sm w-full flex-1" /> class="input input-sm w-full flex-1" />
<RouterLink class="btn btn-primary btn-sm" :to="`/${chain}/uptime/overview`">
<Icon icon="mdi-star" class="mr-2 text-lg" />
<span class="">Favorite</span>
</RouterLink>
</div> </div>
<div class="grid grid-cols-1 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-6 gap-x-4 mt-4" :class="tab === '2'?'':'hidden'"> <div class="grid grid-cols-1 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-6 gap-x-4 mt-4" :class="tab === '2'?'':'hidden'">
<div v-for="({v, signing, hex}, i) in list" :key="i"> <div v-for="({v, signing, hex}, i) in list" :key="i">
@ -130,10 +141,10 @@ function changeTab(v: string) {
<label class="text-truncate text-sm"> <label class="text-truncate text-sm">
<span class="ml-1 text-black dark:text-white">{{ i + 1 }}.{{ v.description.moniker }}</span> <span class="ml-1 text-black dark:text-white">{{ i + 1 }}.{{ v.description.moniker }}</span>
</label> </label>
<div v-if="Number(signing?.missed_blocks_counter || 0) > 10" class="badge badge-error badge-sm text-white"> <div v-if="Number(signing?.missed_blocks_counter || 0) > 10" class="badge badge-sm bg-transparent border-0 text-red-500">
{{ signing?.missed_blocks_counter }} {{ signing?.missed_blocks_counter }}
</div> </div>
<div v-else class="mt-1 badge badge-sm text-white bg-yes border-0"> <div v-else class="badge badge-sm bg-transparent text-green-600 border-0">
{{ signing?.missed_blocks_counter }} {{ signing?.missed_blocks_counter }}
</div> </div>
</div> </div>
@ -143,35 +154,40 @@ function changeTab(v: string) {
<div :class="tab === '3'?'':'hidden'"> <div :class="tab === '3'?'':'hidden'">
<table class="table table-compact w-full mt-5"> <table class="table table-compact w-full mt-5">
<thead> <thead class=" capitalize">
<tr> <tr>
<td rowspan="2">Validator</td> <td>Validator</td>
<td rowspan="2">Start Height</td> <td class="text-right">Uptime</td>
<td rowspan="2">Signed Blocks</td> <td>Last Jailed Time</td>
<td colspan="2">Missing blocks</td> <td class="text-right">Signed Precommits</td>
<td rowspan="2">Last Jailed Time</td> <td class="text-right">Start Height</td>
<td rowspan="2">Tombstoned</td> <td>Tombstoned</td>
</tr>
<tr>
<td>In Window</td>
<td>Over All</td>
</tr> </tr>
</thead> </thead>
<tr v-for="({v, signing}, i) in list"> <tr v-for="({v, signing, uptime}, i) in list" class="hover">
<td>{{ i+1 }}. {{ v.description.moniker }}</td> <td><div class="truncate max-w-sm">{{ i+1 }}. {{ v.description.moniker }}</div></td>
<td>{{ signing?.start_height }}</td> <td class="text-right">
<td>{{ signing?.index_offset }}</td> <span v-if="signing" class="" :class="uptime && uptime > 0.95 ? 'text-green-500':'text-red-500'"><div class="tooltip" :data-tip="`${signing.missed_blocks_counter} missing blocks`"> {{ format.percent(uptime) }} </div> </span>
<td>
<span class="badge badge-sm text-white" :class="Number(signing?.missed_blocks_counter) < 10?'badge-success':'badge-error'">{{ signing?.missed_blocks_counter }}</span>
</td> </td>
<td><span v-if="signing && signing.jailed_until.startsWith('1970')">{{ format.percent(Number(signing.index_offset)/(latest-Number(signing.start_height))) }}</span></td>
<td><span v-if="signing && !signing.jailed_until.startsWith('1970')"> <td><span v-if="signing && !signing.jailed_until.startsWith('1970')">
<div class="tooltip" :data-tip="format.toDay(signing?.jailed_until, 'long')"> <div class="tooltip" :data-tip="format.toDay(signing?.jailed_until, 'long')">
<span>{{ format.toDay(signing?.jailed_until, "from") }}</span> <span>{{ format.toDay(signing?.jailed_until, "from") }}</span>
</div> </div>
</span></td> </span></td>
<td class="text-right text-xs">
{{ signing?.index_offset }}<br>
<span v-if="signing && signing.jailed_until.startsWith('1970')" class="text-xs">{{ format.percent(Number(signing.index_offset)/(latest-Number(signing.start_height))) }}</span>
</td>
<td class="text-right">{{ signing?.start_height }}</td>
<td class=" capitalize">{{ signing?.tombstoned }}</td> <td class=" capitalize">{{ signing?.tombstoned }}</td>
</tr> </tr>
<tfoot>
<tr>
<td colspan="2" class="text-right"> Minimum uptime per window: <span class="lowercase tooltip" :data-tip="`Window size: ${ slashingParam.signed_blocks_window }`"><span class="ml-2 btn btn-error btn-xs">{{ format.percent(slashingParam.min_signed_per_window) }}</span> </span></td>
<td colspan="8"></td>
</tr>
</tfoot>
</table> </table>
</div> </div>

View File

@ -0,0 +1,64 @@
<script lang="ts" setup>
import { useBaseStore, useBlockchain, useFormatter } from '@/stores';
import type { Connection } from '@/types';
import { computed } from 'vue';
import { onMounted } from 'vue';
import { ref } from 'vue';
const props = defineProps(['chain']);
const chainStore = useBlockchain();
const baseStore = useBaseStore()
const endpoint = ref(chainStore.current?.endpoints?.rest?.at(0)?.address)
const chainId = computed(() => baseStore.latest?.block?.header?.chain_id || "")
const chainName = computed(() => chainStore?.chainName || "")
const hdPath = computed(() => {
return `m/44'/${ chainStore.current?.coinType }/0'/0/0`
})
</script>
<template>
<div>
<div class="bg-base-100 px-4 pt-3 pb-4 rounded shadow">
<h2 class="card-title">Initial Setting</h2>
<div class="my-4 grid grid-flow-col auto-cols-max ">
<div class="form-control">
<div class="input-group">
<span>Endpoint</span>
<select v-model="endpoint" class="select select-bordered w-fit">
<option disabled selected>Select Endpoint</option>
<option v-for="v in chainStore.current?.endpoints.rest" :value="v.address">{{ v.address }}</option>
</select>
</div>
</div>
</div>
<span class="text-base">Import global script </span>
<div class="mockup-code my-2">
<pre data-prefix="1"><code class="text-gray-400">&lt;script type="module" src="https://unpkg.com/ping-widget@latest/dist/ping-widget.js"&gt;</code></pre>
</div>
</div>
<div class="bg-base-100 my-5 px-4 pt-3 pb-4 rounded shadow">
<h2 class="card-title">Widgets</h2>
<div class="mt-4">
<span class="text-base"> 1. Connect Wallet </span>
<div class="mockup-code my-2">
<pre data-prefix=">"><code class="text-gray-400">&lt;ping-connect-wallet chain-id="{{ chainId }}" hd-path="{{ hdPath }}"/&gt;</code></pre>
</div>
<span class="text-base"> 2. Osmosis Convert </span>
<div class="mockup-code my-2">
<pre data-prefix=">"><code class="text-gray-400">&lt;ping-token-convert chain-name="{{ chainName }}" endpoint="{{endpoint}}" hd-path="{{hdPath}}"/&gt;</code></pre>
<pre data-prefix=">"><code class="text-gray-400">&lt;label for="PingTokenConvert" class="btn btn-sm"&gt;Buy {{chainName.toUpperCase()}}&lt;/label&gt;</code></pre>
</div>
</div>
</div>
</div>
</template>
<route>
{
meta: {
i18n: 'widget',
order: 300
}
}
</route>

View File

@ -1,13 +1,14 @@
{ {
"module": { "module": {
"dashboard": "Dashboard", "dashboard": "Dashboard",
"blocks": "Blocks&Transaction", "blocks": "Blocks",
"staking": "Staking", "staking": "Staking",
"governance": "Governance", "governance": "Governance",
"parameters": "Parameters", "parameters": "Parameters",
"uptime": "Uptime", "uptime": "Uptime",
"state-sync": "State Sync", "state-sync": "State Sync",
"cosmwasm": "Cosmwasm", "cosmwasm": "Cosmwasm",
"widget": "Widgets",
"ibc": "IBC" "ibc": "IBC"
}, },
"index": { "index": {

View File

@ -12,6 +12,7 @@ import { filterInputProps, makeVInputProps } from 'vuetify/lib/components/VInput
import { filterInputAttrs } from 'vuetify/lib/util/helpers' import { filterInputAttrs } from 'vuetify/lib/util/helpers'
import { useThemeConfig } from '@core/composable/useThemeConfig' import { useThemeConfig } from '@core/composable/useThemeConfig'
import { ref } from 'vue'
const props = defineProps({ const props = defineProps({
...makeVInputProps({ ...makeVInputProps({

View File

@ -1,6 +1,7 @@
import type { ThemeConfig, UserThemeConfig } from './types' import type { ThemeConfig, UserThemeConfig } from './types'
import { RouteTransitions, Skins } from '@core/enums' import { RouteTransitions, Skins } from '@core/enums'
import type { UserConfig as LayoutConfig } from '@layouts/types' import type { UserConfig as LayoutConfig } from '@layouts/types'
import { ref } from 'vue';
export const defineThemeConfig = ( export const defineThemeConfig = (
userConfig: UserThemeConfig, userConfig: UserThemeConfig,

View File

@ -9,6 +9,7 @@ import type { NavGroup, NavLink, NavSectionTitle, VerticalNavItems } from '@layo
import { themeConfig as config } from '@themeConfig' import { themeConfig as config } from '@themeConfig'
console.log("v nav")
interface Props { interface Props {
tag?: string | Component tag?: string | Component
navItems: VerticalNavItems navItems: VerticalNavItems

View File

@ -4,6 +4,7 @@ import { TransitionExpand, VerticalNavLink } from '@layouts/components'
import { themeConfig as config } from '@themeConfig' import { themeConfig as config } from '@themeConfig'
import type { NavGroup } from '@layouts/types' import type { NavGroup } from '@layouts/types'
import { isNavGroupActive, openGroups } from '@layouts/utils' import { isNavGroupActive, openGroups } from '@layouts/utils'
import { ref } from 'vue'
const props = defineProps<{ const props = defineProps<{
item: NavGroup item: NavGroup

View File

@ -1,8 +1,9 @@
import type { MaybeRef } from '@vueuse/shared' import type { MaybeRef } from '@vueuse/shared'
import type { Ref } from 'vue' import { computed, unref, type Ref, ref, watch } from 'vue'
import { AppContentLayoutNav, NavbarType } from '../enums' import { AppContentLayoutNav, NavbarType } from '../enums'
import { themeConfig as config } from '@themeConfig' import { themeConfig as config } from '@themeConfig'
import { injectionKeyIsVerticalNavHovered } from '@layouts' import { injectionKeyIsVerticalNavHovered } from '@layouts'
import { useRoute } from 'vue-router'
export const useLayouts = () => { export const useLayouts = () => {
const navbarType = computed({ const navbarType = computed({

View File

@ -1,5 +1,6 @@
import type { Router } from 'vue-router' import type { Router } from 'vue-router'
import type { NavGroup, NavLink, NavLinkProps } from '@layouts/types' import type { NavGroup, NavLink, NavLinkProps } from '@layouts/types'
import { computed, ref } from 'vue'
export const openGroups = ref<string[]>([]) export const openGroups = ref<string[]>([])
@ -8,6 +9,7 @@ export const openGroups = ref<string[]>([])
* @param {Object, String} item navigation routeName or route Object provided in navigation data * @param {Object, String} item navigation routeName or route Object provided in navigation data
*/ */
export const getComputedNavLinkToProp = computed(() => (link: NavLink) => { export const getComputedNavLinkToProp = computed(() => (link: NavLink) => {
console.log(link)
const props: NavLinkProps = { const props: NavLinkProps = {
target: link.target, target: link.target,
rel: link.rel, rel: link.rel,

View File

@ -1,6 +1,6 @@
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
export const useStoreName = defineStore('bankstore', { export const useStoreName = defineStore('template', {
state: () => { state: () => {
return {}; return {};
}, },

View File

@ -78,7 +78,7 @@ export const useBaseStore = defineStore('baseStore', {
) === -1 ) === -1
) { ) {
if (this.recents.length >= 50) { if (this.recents.length >= 50) {
this.recents.pop(); this.recents.shift();
} }
this.recents.push(this.latest); this.recents.push(this.latest);
} }

View File

@ -1,4 +1,5 @@
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import { useTheme } from 'vuetify';
import { import {
useDashboard, useDashboard,
type ChainConfig, type ChainConfig,
@ -14,6 +15,7 @@ import {
useGovStore, useGovStore,
useMintStore, useMintStore,
useStakingStore, useStakingStore,
useWalletStore,
} from '.'; } from '.';
import { useBlockModule } from '@/modules/[chain]/block/block'; import { useBlockModule } from '@/modules/[chain]/block/block';
import { DEFAULT } from '@/libs'; import { DEFAULT } from '@/libs';
@ -50,6 +52,10 @@ export const useBlockchain = defineStore('blockchain', {
dashboard() { dashboard() {
return useDashboard(); return useDashboard();
}, },
isConsumerChain() {
// @ts-ignore
return this.current && this.current.providerChain
},
computedChainMenu() { computedChainMenu() {
let currNavItem: VerticalNavItems = []; let currNavItem: VerticalNavItems = [];
@ -61,8 +67,11 @@ export const useBlockchain = defineStore('blockchain', {
title: this.current?.prettyName || this.chainName || '', title: this.current?.prettyName || this.chainName || '',
icon: { image: this.current.logo, size: '22' }, icon: { image: this.current.logo, size: '22' },
i18n: false, i18n: false,
badgeContent: this.isConsumerChain? 'Consumer': undefined,
badgeClass: 'bg-error',
children: routes children: routes
.filter((x) => x.meta.i18n) .filter((x) => x.meta.i18n) // defined menu name
.filter((x) => !this.current?.features || this.current.features.includes(String(x.meta.i18n))) // filter none-custom module
.map((x) => ({ .map((x) => ({
title: `module.${x.meta.i18n}`, title: `module.${x.meta.i18n}`,
to: { path: x.path.replace(':chain', this.chainName) }, to: { path: x.path.replace(':chain', this.chainName) },
@ -112,6 +121,11 @@ export const useBlockchain = defineStore('blockchain', {
}, },
actions: { actions: {
async initial() { async initial() {
// this.current?.themeColor {
// const { global } = useTheme();
// global.current
// }
useWalletStore().$reset()
await this.randomSetupEndpoint(); await this.randomSetupEndpoint();
await useStakingStore().init(); await useStakingStore().init();
useBankStore().initial(); useBankStore().initial();
@ -146,5 +160,8 @@ export const useBlockchain = defineStore('blockchain', {
this.chainName = name; this.chainName = name;
} }
}, },
supportModule(mod: string) {
return !this.current?.features || this.current.features.includes(mod)
}
}, },
}); });

View File

@ -61,6 +61,7 @@ export interface ChainConfig {
coinType: string; coinType: string;
assets: Asset[]; assets: Asset[];
themeColor?: string; themeColor?: string;
features?: string[]
endpoints: { endpoints: {
rest?: Endpoint[]; rest?: Endpoint[];
rpc?: Endpoint[]; rpc?: Endpoint[];
@ -74,12 +75,18 @@ export interface ChainConfig {
}; };
exponent: string; exponent: string;
excludes?: string; excludes?: string;
providerChain: {
api: Endpoint[]
};
} }
export interface LocalConfig { export interface LocalConfig {
addr_prefix: string; addr_prefix: string;
alias: string; alias: string;
api: string[] | Endpoint[]; api: string[] | Endpoint[];
provider_chain: {
api: string[] | Endpoint[]
}
assets: { assets: {
base: string; base: string;
coingecko_id: string; coingecko_id: string;
@ -90,10 +97,12 @@ export interface LocalConfig {
chain_name: string; chain_name: string;
coin_type: string; coin_type: string;
logo: string; logo: string;
theme_color?: string;
min_tx_fee: string; min_tx_fee: string;
rpc: string[] | Endpoint[]; rpc: string[] | Endpoint[];
sdk_version: string; sdk_version: string;
registry_name?: string; registry_name?: string;
features?: string[];
} }
function apiConverter(api: any[]) { function apiConverter(api: any[]) {
@ -135,6 +144,12 @@ export function fromLocal(lc: LocalConfig): ChainConfig {
rest: apiConverter(lc.api), rest: apiConverter(lc.api),
rpc: apiConverter(lc.rpc), rpc: apiConverter(lc.rpc),
}; };
if(lc.provider_chain) {
conf.providerChain = {
api: apiConverter(lc.provider_chain.api)
}
}
conf.features = lc.features
conf.logo = lc.logo; conf.logo = lc.logo;
return conf; return conf;
} }

View File

@ -156,7 +156,6 @@ export const useParamStore = defineStore('paramstore', {
// this.chain.items[chainIndex].value = `${percent(res)}%` // this.chain.items[chainIndex].value = `${percent(res)}%`
// }) // })
const res = await this.getMintParam(); const res = await this.getMintParam();
console.log(res, 'mint');
}, },
async handleSlashingParams() { async handleSlashingParams() {
const res = await this.getSlashingParams(); const res = await this.getSlashingParams();
@ -200,7 +199,6 @@ export const useParamStore = defineStore('paramstore', {
this.nodeVersion.items = Object.entries(res.default_node_info).map( this.nodeVersion.items = Object.entries(res.default_node_info).map(
([key, value]) => ({ subtitle: key, value: value }) ([key, value]) => ({ subtitle: key, value: value })
); );
console.log('handleAbciInfo', this.nodeVersion.items);
}, },
async getBaseTendermintBlockLatest() { async getBaseTendermintBlockLatest() {
return await this.blockchain.rpc?.getBaseBlockLatest(); return await this.blockchain.rpc?.getBaseBlockLatest();

View File

@ -3,6 +3,9 @@ import { useBlockchain } from './useBlockchain';
import { get } from '@/libs/http'; import { get } from '@/libs/http';
import type { StakingParam, StakingPool, Validator } from '@/types'; import type { StakingParam, StakingPool, Validator } from '@/types';
import { CosmosRestClient } from '@/libs/client';
import { consensusPubkeyToHexAddress, valconsToBase64 } from '@/libs';
import { toHex, fromBase64 } from '@cosmjs/encoding';
export const useStakingStore = defineStore('stakingStore', { export const useStakingStore = defineStore('stakingStore', {
state: () => { state: () => {
@ -77,6 +80,20 @@ export const useStakingStore = defineStore('stakingStore', {
); );
}, },
async fetchValidators(status: string) { async fetchValidators(status: string) {
if(this.blockchain.isConsumerChain) {
if(this.blockchain.current?.providerChain.api && this.blockchain.current.providerChain.api.length > 0) {
const client = CosmosRestClient.newDefault(this.blockchain.current.providerChain.api[0].address)
// const vals = await client.getBaseValidatorsetLatest(0)
const res = await client.getStakingValidators(status)
const proVals = res.validators.sort(
(a, b) => Number(b.delegator_shares) - Number(a.delegator_shares)
)
if (status === 'BOND_STATUS_BONDED') {
this.validators = proVals;
}
return proVals
}
}
return this.blockchain.rpc?.getStakingValidators(status).then((res) => { return this.blockchain.rpc?.getStakingValidators(status).then((res) => {
const vals = res.validators.sort( const vals = res.validators.sort(
(a, b) => Number(b.delegator_shares) - Number(a.delegator_shares) (a, b) => Number(b.delegator_shares) - Number(a.delegator_shares)
@ -89,3 +106,5 @@ export const useStakingStore = defineStore('stakingStore', {
}, },
}, },
}); });

View File

@ -7,4 +7,5 @@ export * from './distribution'
export * from './gov' export * from './gov'
export * from './staking' export * from './staking'
export * from './tx' export * from './tx'
export * from './ibc' export * from './ibc'
export * from './slashing'

View File

@ -1,14 +1,22 @@
import type { PaginatedResponse } from "./common"; import type { PaginatedResponse } from "./common";
export interface SigningInfo { export interface SigningInfo {
"address": string, address: string,
"start_height": string, start_height: string,
"index_offset": string, index_offset: string,
"jailed_until": string, jailed_until: string,
"tombstoned": boolean, tombstoned: boolean,
"missed_blocks_counter": string missed_blocks_counter: string
} }
export interface SlashingParam{
signed_blocks_window: string,
min_signed_per_window: string,
downtime_jail_duration: string,
slash_fraction_double_sign: string,
slash_fraction_downtime: string
}
export interface PaginatedSigningInfo extends PaginatedResponse { export interface PaginatedSigningInfo extends PaginatedResponse {
info: SigningInfo[] info: SigningInfo[]
} }

View File

@ -6808,10 +6808,10 @@ pify@^3.0.0:
resolved "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz" resolved "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz"
integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg== integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==
ping-widget@^0.0.13: ping-widget@^0.0.15:
version "0.0.13" version "0.0.15"
resolved "https://registry.yarnpkg.com/ping-widget/-/ping-widget-0.0.13.tgz#3738882da243871f7ed322cd75ef7b1bed8fd3bb" resolved "https://registry.yarnpkg.com/ping-widget/-/ping-widget-0.0.15.tgz#b15698ab7649fc8bd2318d7488366f3b30bcf5c6"
integrity sha512-BPpPcwDdffqHFO/6MeD3JleGWLFhOSSQLG2L0WaI1aiAe1em8gTC03refg86CjjwXtU4XtwJ0xnXgbJAVvZzjA== integrity sha512-aWUJwtwWbL7AXsAXpzQX8G5IQgGbhV5EM96wmcEez9Wp/UbwJ5BYOj8fdVDdW4yjzScnJ35R9KnHlpoOhzlF0g==
dependencies: dependencies:
"@cosmjs/amino" "^0.30.1" "@cosmjs/amino" "^0.30.1"
"@cosmjs/ledger-amino" "^0.30.1" "@cosmjs/ledger-amino" "^0.30.1"