Skip to content
Permalink
Browse files

Merge pull request #200 from MickWang/master

update "my stake" list api
  • Loading branch information
MickWang committed Sep 17, 2019
2 parents 3da4bf5 + db769ca commit 29391343240eb7b2a06c9d879f1f244cd128e0ab
@@ -2,7 +2,7 @@
"name": "owallet",
"productName": "OWallet",
"homepage": "http://ont.io",
"version": "v0.9.16",
"version": "v0.9.17",
"author": "Ontology Foundation Ltd. <devops@ont.io>",
"description": "OWallet is a comprehensive Ontology desktop wallet",
"license": "Apache-2.0",
@@ -64,6 +64,10 @@ export const SWAP_ADDRESS = 'AFmseVrdL9f9oyCzZefL9tG6UbvhPbdYzM'

export const NODE_DETAIL = 'https://explorer.ont.io/nodes/detail/'
export const NODE_NAME_LIST = 'https://ont.io/api/v1/candidate/info/All'
export const OFF_CHAIN_NODES = {
TEST_NET: 'https://polarisexplorer.ont.io/v2/nodes/off-chain-infos',
MAIN_NET: 'https://explorer.ont.io/v2/nodes/off-chain-infos'
}

export const PAX_API = {
Host: 'http://18.138.83.180:20800',
@@ -99,7 +99,7 @@
</a-tooltip>
{{text}}
</a>
<div slot="action" slot-scope="text, record" class="detail-link" v-if="record.maxAuthorize>0">
<div slot="action" slot-scope="text, record" class="detail-link" v-if="record.maxAuthorize>0 && record.process !== '100.00%'">
<a-icon type="arrow-right" @click="handleAuthorizeLogin(record)" v-if="record.maxAuthorize>0"/>
</div>

@@ -1,5 +1,5 @@
import { getNodeUrl} from '../../../core/utils'
import {NODE_DETAIL, NODE_NAME_LIST} from '../../../core/consts'
import {NODE_DETAIL, NODE_NAME_LIST, OFF_CHAIN_NODES} from '../../../core/consts'
import numeral from 'numeral'
import { Crypto, RestClient, utils, GovernanceTxBuilder} from 'ontology-ts-sdk'
import {BigNumber} from 'bignumber.js'
@@ -245,13 +245,14 @@ const actions = {
async searchStakeHistory({commit, dispatch, state}, {address}) {
const url = getNodeUrl();
const list = []
if (state.sortedNodeList.length === 0) {
await dispatch('fetchAllSortedNodeList')
}
const net = localStorage.getItem('net')
const off_chain_nodes_url = OFF_CHAIN_NODES[net];
const userAddr = new Crypto.Address(address);
try {
const infoTemp = await Promise.all(state.sortedNodeList.map(item => {
return GovernanceTxBuilder.getAuthorizeInfo(item.peerPubkey, userAddr, url)
const res = await axios.get(off_chain_nodes_url);
const nodes = res.data.result.filter(node => node.public_key.indexOf('00aaaaaaaaa') < 0); //00aaaaaaaaa开头是无效的公钥
const infoTemp = await Promise.all(nodes.map(item => {
return GovernanceTxBuilder.getAuthorizeInfo(item.public_key, userAddr, url)
}))
console.log(infoTemp)
infoTemp.forEach(item => {

0 comments on commit 2939134

Please sign in to comment.
You can’t perform that action at this time.