From 8e3c9eea0c2dfd902db87f3744802bfefb8afa6e Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Wed, 5 Apr 2023 10:45:49 +0800 Subject: [PATCH] return types --- src/libs/registry.ts | 11 +++++------ src/modules/wallet/test.vue | 2 +- src/types/gov.ts | 4 ++-- src/types/slashing.ts | 14 ++++++++++++++ 4 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 src/types/slashing.ts diff --git a/src/libs/registry.ts b/src/libs/registry.ts index 828aed4f..5c937f01 100644 --- a/src/libs/registry.ts +++ b/src/libs/registry.ts @@ -1,11 +1,10 @@ -import type { Block, Coin, NodeInfo, PaginatedTendermintValidator, SlashingSigningInfo } from "@/types"; -import type { AuthAccount, PaginabledAccounts } from "@/types/Auth"; -import type { PaginatedTxs, Tx, TxResponse } from "@/types/Tx"; -import type { Txs } from "@/types/Txs"; +import type { AuthAccount, Block, Coin, NodeInfo, PaginabledAccounts, PaginatedTendermintValidator,} from "@/types"; import type { BankParams, PaginatedBalances, PaginatedDenomMetadata, PaginatedSupply } from "@/types/bank"; import type { DistributionParams, PaginatedSlashes } from "@/types/distribution"; import type { GovParams, GovProposal, GovVote, PaginatedProposalDeposit, PaginatedProposalVotes, PaginatedProposals, Tally } from "@/types/gov"; +import type { PaginatedSigningInfo } from "@/types/slashing"; import type { Delegation, PaginatedDelegations, PaginatedRedelegations, PaginatedUnbonding, PaginatedValdiators, StakingParam, StakingPool, Validator } from "@/types/staking"; +import type { PaginatedTxs, Tx, TxResponse } from "@/types/tx"; import semver from "semver"; @@ -32,7 +31,7 @@ export interface RequestRegistry { distribution_validator_slashes: Request; slashing_params: Request; - slashing_signing_info: Request; + slashing_signing_info: Request; gov_params_voting: Request; gov_params_tally: Request; @@ -64,7 +63,7 @@ export interface RequestRegistry { base_tendermint_validatorsets_height: Request; tx_txs: Request; - tx_txs_block: Request; + tx_txs_block: Request; tx_hash: Request<{tx: Tx, tx_response: TxResponse}>; } diff --git a/src/modules/wallet/test.vue b/src/modules/wallet/test.vue index def77044..4bad3712 100644 --- a/src/modules/wallet/test.vue +++ b/src/modules/wallet/test.vue @@ -5,7 +5,7 @@ async function tt() { const address = "echelon1uattqtrtv8944qkmh44ll97qjacj6tgrekqzm9" const validator = "echelonvaloper1uattqtrtv8944qkmh44ll97qjacj6tgr2cupk4" const client = new CosmosRestClient("https://api.ech.network") - let response = await client.getTx("EFF175AF4D46532CFACA4A0F0748DFF1EF8CC1C96DA967D8AFB794EFE048461C"); + let response = await client.getSlashingSigningInfos(); console.log('response:', response) } tt() diff --git a/src/types/gov.ts b/src/types/gov.ts index 1a354840..4f147a61 100644 --- a/src/types/gov.ts +++ b/src/types/gov.ts @@ -1,5 +1,5 @@ -import type { Coin } from "./Coin" -import type { PaginatedResponse } from "./common" + +import type { Coin, PaginatedResponse } from "./common" export interface GovParams { "voting_params": { diff --git a/src/types/slashing.ts b/src/types/slashing.ts new file mode 100644 index 00000000..9e4385a1 --- /dev/null +++ b/src/types/slashing.ts @@ -0,0 +1,14 @@ +import type { PaginatedResponse } from "./common"; + +export interface SigningInfo { + "address": string, + "start_height": string, + "index_offset": string, + "jailed_until": string, + "tombstoned": boolean, + "missed_blocks_counter": string +} + +export interface PaginatedSigningInfo extends PaginatedResponse { + info: SigningInfo[] +} \ No newline at end of file