Rename CosmosSdkAccount to BaseAccount

This commit is contained in:
Simon Warta 2020-07-25 15:57:46 +02:00
parent a69006b8c3
commit 29e98ec156
7 changed files with 25 additions and 6 deletions

View File

@ -16,6 +16,7 @@
- @cosmjs/sdk38: Remove `Pen` type in favour of `OfflineSigner` and remove - @cosmjs/sdk38: Remove `Pen` type in favour of `OfflineSigner` and remove
`Secp256k1Pen` class in favour of `Secp256k1Wallet` which takes an `Secp256k1Pen` class in favour of `Secp256k1Wallet` which takes an
`OfflineSigner` instead of a `SigningCallback`. `OfflineSigner` instead of a `SigningCallback`.
- @cosmjs/sdk38: Rename `CosmosSdkAccount` to `BaseAccount` and export the type.
- @cosmjs/math: Add missing integer check to `Uint64.fromNumber`. Before - @cosmjs/math: Add missing integer check to `Uint64.fromNumber`. Before
`Uint64.fromNumber(1.1)` produced some result. `Uint64.fromNumber(1.1)` produced some result.
- @cosmjs/sdk38: Add `SigningCosmosClient.signAndPost` as a mid-level - @cosmjs/sdk38: Add `SigningCosmosClient.signAndPost` as a mid-level

View File

@ -30,6 +30,7 @@ export {
AuthExtension, AuthExtension,
BankBalancesResponse, BankBalancesResponse,
BankExtension, BankExtension,
BaseAccount,
BlockResponse, BlockResponse,
BroadcastMode, BroadcastMode,
DistributionCommunityPoolResponse, DistributionCommunityPoolResponse,

View File

@ -2,7 +2,15 @@
import { Coin } from "../coins"; import { Coin } from "../coins";
import { LcdClient } from "./lcdclient"; import { LcdClient } from "./lcdclient";
export interface CosmosSdkAccount { /**
* A Cosmos SDK base account.
*
* This type describes the base account representation as returned
* by the Cosmos SDK 0.370.39 LCD API.
*
* @see https://docs.cosmos.network/master/modules/auth/02_state.html#base-account
*/
export interface BaseAccount {
/** Bech32 account address */ /** Bech32 account address */
readonly address: string; readonly address: string;
readonly coins: readonly Coin[]; readonly coins: readonly Coin[];
@ -16,7 +24,7 @@ export interface AuthAccountsResponse {
readonly height: string; readonly height: string;
readonly result: { readonly result: {
readonly type: "cosmos-sdk/Account"; readonly type: "cosmos-sdk/Account";
readonly value: CosmosSdkAccount; readonly value: BaseAccount;
}; };
} }

View File

@ -2,7 +2,7 @@
// Standard modules (see tracking issue https://github.com/CosmWasm/cosmjs/issues/276) // Standard modules (see tracking issue https://github.com/CosmWasm/cosmjs/issues/276)
// //
export { AuthExtension, AuthAccountsResponse, setupAuthExtension } from "./auth"; export { AuthExtension, AuthAccountsResponse, BaseAccount, setupAuthExtension } from "./auth";
export { BankBalancesResponse, BankExtension, setupBankExtension } from "./bank"; export { BankBalancesResponse, BankExtension, setupBankExtension } from "./bank";
export { export {
DistributionCommunityPoolResponse, DistributionCommunityPoolResponse,

View File

@ -28,6 +28,7 @@ export {
AuthExtension, AuthExtension,
BankBalancesResponse, BankBalancesResponse,
BankExtension, BankExtension,
BaseAccount,
BlockResponse, BlockResponse,
BroadcastMode, BroadcastMode,
DistributionCommunityPoolResponse, DistributionCommunityPoolResponse,

View File

@ -1,6 +1,14 @@
import { Coin } from "../coins"; import { Coin } from "../coins";
import { LcdClient } from "./lcdclient"; import { LcdClient } from "./lcdclient";
export interface CosmosSdkAccount { /**
* A Cosmos SDK base account.
*
* This type describes the base account representation as returned
* by the Cosmos SDK 0.370.39 LCD API.
*
* @see https://docs.cosmos.network/master/modules/auth/02_state.html#base-account
*/
export interface BaseAccount {
/** Bech32 account address */ /** Bech32 account address */
readonly address: string; readonly address: string;
readonly coins: readonly Coin[]; readonly coins: readonly Coin[];
@ -13,7 +21,7 @@ export interface AuthAccountsResponse {
readonly height: string; readonly height: string;
readonly result: { readonly result: {
readonly type: "cosmos-sdk/Account"; readonly type: "cosmos-sdk/Account";
readonly value: CosmosSdkAccount; readonly value: BaseAccount;
}; };
} }
export interface AuthExtension { export interface AuthExtension {

View File

@ -1,4 +1,4 @@
export { AuthExtension, AuthAccountsResponse, setupAuthExtension } from "./auth"; export { AuthExtension, AuthAccountsResponse, BaseAccount, setupAuthExtension } from "./auth";
export { BankBalancesResponse, BankExtension, setupBankExtension } from "./bank"; export { BankBalancesResponse, BankExtension, setupBankExtension } from "./bank";
export { export {
DistributionCommunityPoolResponse, DistributionCommunityPoolResponse,