-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from atmoner/dev
Dev
- Loading branch information
Showing
18 changed files
with
257 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<template> | ||
<div> | ||
<button class="button" @click="getBalanceNow()"> | ||
<i v-if="!inLoading" class="fa fa-play" aria-hidden="true"></i> | ||
<span v-if="!inLoading"> Try it</span> | ||
<i v-if="inLoading" class="fa fa-spinner fa-spin" style="font-size:24px"></i> | ||
</button> | ||
</div> | ||
<div v-if="loaded" class="language-javascript" data-ext="json"> | ||
<pre class="language-javascript"><code>{{ getBalance }}</code></pre> | ||
</div> | ||
<button v-if="loaded" class="buttonColse" @click="closeResulte()"> | ||
<i class="fa fa-times" aria-hidden="true"></i> Close result | ||
</button> | ||
</template> | ||
|
||
<script> | ||
import { StargateClient } from "@cosmjs/stargate" | ||
export default { | ||
data() { | ||
return { | ||
getBalance: '', | ||
loaded: false, | ||
inLoading: false | ||
} | ||
}, | ||
async mounted() { | ||
}, | ||
methods: { | ||
async getBalanceNow() { | ||
this.inLoading = true | ||
this.loaded = false | ||
try { | ||
const client = await StargateClient.connect('https://rpc.cosmos.directory/cosmoshub') | ||
const getBalance = await client.getBalance('cosmos13jawsn574rf3f0u5rhu7e8n6sayx5gkwjvqrkr', 'uatom') | ||
this.getBalance = getBalance | ||
this.loaded = true | ||
this.inLoading = false | ||
client.disconnect() | ||
} catch (error) { | ||
this.getBalance = "Error! Try again" + error | ||
this.loaded = true | ||
this.inLoading = false | ||
} | ||
}, | ||
closeResulte() { | ||
this.loaded = false | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
.button { | ||
display: block; | ||
width: 100%; | ||
border: none; | ||
background-color: #343E51; | ||
padding: 14px 28px; | ||
font-size: 16px; | ||
cursor: pointer; | ||
text-align: center; | ||
border-radius: 4px; | ||
} | ||
.buttonColse { | ||
display: block; | ||
width: 100%; | ||
border: none; | ||
background-color: #343E51; | ||
padding: 14px 28px; | ||
font-size: 16px; | ||
cursor: pointer; | ||
text-align: center; | ||
border-radius: 4px; | ||
} | ||
</style> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<template> | ||
<div> | ||
<button class="button" @click="getBlockNow()"> | ||
<i v-if="!inLoading" class="fa fa-play" aria-hidden="true"></i> | ||
<span v-if="!inLoading"> Try it</span> | ||
<i v-if="inLoading" class="fa fa-spinner fa-spin" style="font-size:24px"></i> | ||
</button> | ||
</div> | ||
<div v-if="loaded" class="language-javascript" data-ext="json"> | ||
<pre class="language-javascript"><code>{{ getBlock }}</code></pre> | ||
</div> | ||
<button v-if="loaded" class="buttonColse" @click="closeResulte()"> | ||
<i class="fa fa-times" aria-hidden="true"></i> Close result | ||
</button> | ||
</template> | ||
|
||
<script> | ||
import { StargateClient } from "@cosmjs/stargate" | ||
export default { | ||
data() { | ||
return { | ||
getBlock: '', | ||
loaded: false, | ||
inLoading: false | ||
} | ||
}, | ||
async mounted() { | ||
}, | ||
methods: { | ||
async getBlockNow() { | ||
this.inLoading = true | ||
this.loaded = false | ||
const client = await StargateClient.connect('https://rpc.cosmos.directory/cosmoshub') | ||
const getBlock = await client.getBlock() | ||
console.log(getBlock.header) | ||
this.getBlock = getBlock.header | ||
this.loaded = true | ||
this.inLoading = false | ||
client.disconnect() | ||
}, | ||
closeResulte() { | ||
this.loaded = false | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
.button { | ||
display: block; | ||
width: 100%; | ||
border: none; | ||
background-color: #343E51; | ||
padding: 14px 28px; | ||
font-size: 16px; | ||
cursor: pointer; | ||
text-align: center; | ||
border-radius: 4px; | ||
} | ||
.buttonColse { | ||
display: block; | ||
width: 100%; | ||
border: none; | ||
background-color: #343E51; | ||
padding: 14px 28px; | ||
font-size: 16px; | ||
cursor: pointer; | ||
text-align: center; | ||
border-radius: 4px; | ||
} | ||
</style> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,6 @@ export default navbar([ | |
"/", | ||
"/stargate/", | ||
"/query/", | ||
"/broadcast/" | ||
"/broadcast/", | ||
"/tips/" | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,7 @@ index: false | |
copyright: false | ||
--- | ||
|
||
|
||
|
||
::: info | ||
This page will be completed soon | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
--- | ||
title: Authz tx | ||
icon: file | ||
order: 3 | ||
order: 2 | ||
copyright: false | ||
--- | ||
|
||
# Authz tx | ||
|
||
::: info | ||
This page will be completed soon | ||
::: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,7 @@ copyright: false | |
--- | ||
|
||
# Feegrant tx | ||
|
||
|
||
::: info | ||
This page will be completed soon | ||
::: |
Oops, something went wrong.