Copy config from parent dir
This commit is contained in:
Vendored
+16
-5
@@ -1,12 +1,23 @@
|
||||
import { Address, PubkeyBundle } from "@iov/bcp";
|
||||
export declare type CosmosAddressBech32Prefix = "cosmos" | "cosmosvalcons" | "cosmosvaloper";
|
||||
export declare type CosmosPubkeyBech32Prefix = "cosmospub" | "cosmosvalconspub" | "cosmosvaloperpub";
|
||||
export declare type CosmosBech32Prefix = CosmosAddressBech32Prefix | CosmosPubkeyBech32Prefix;
|
||||
export declare type CosmosAddressBech32Prefix =
|
||||
| "cosmos"
|
||||
| "cosmosvalcons"
|
||||
| "cosmosvaloper";
|
||||
export declare type CosmosPubkeyBech32Prefix =
|
||||
| "cosmospub"
|
||||
| "cosmosvalconspub"
|
||||
| "cosmosvaloperpub";
|
||||
export declare type CosmosBech32Prefix =
|
||||
| CosmosAddressBech32Prefix
|
||||
| CosmosPubkeyBech32Prefix;
|
||||
export declare function decodeCosmosAddress(
|
||||
address: Address,
|
||||
address: Address
|
||||
): {
|
||||
readonly prefix: CosmosAddressBech32Prefix;
|
||||
readonly data: Uint8Array;
|
||||
};
|
||||
export declare function isValidAddress(address: string): boolean;
|
||||
export declare function pubkeyToAddress(pubkey: PubkeyBundle, prefix: CosmosBech32Prefix): Address;
|
||||
export declare function pubkeyToAddress(
|
||||
pubkey: PubkeyBundle,
|
||||
prefix: CosmosBech32Prefix
|
||||
): Address;
|
||||
|
||||
Vendored
+6
-2
@@ -8,13 +8,17 @@ import {
|
||||
SigningJob,
|
||||
TransactionId,
|
||||
TxCodec,
|
||||
UnsignedTransaction,
|
||||
UnsignedTransaction
|
||||
} from "@iov/bcp";
|
||||
export declare class CosmosCodec implements TxCodec {
|
||||
bytesToSign(unsigned: UnsignedTransaction, nonce: Nonce): SigningJob;
|
||||
bytesToPost(signed: SignedTransaction): PostableBytes;
|
||||
identifier(signed: SignedTransaction): TransactionId;
|
||||
parseBytes(bytes: PostableBytes, chainId: ChainId, nonce?: Nonce): SignedTransaction;
|
||||
parseBytes(
|
||||
bytes: PostableBytes,
|
||||
chainId: ChainId,
|
||||
nonce?: Nonce
|
||||
): SignedTransaction;
|
||||
identityToAddress(identity: Identity): Address;
|
||||
isValidAddress(address: string): boolean;
|
||||
}
|
||||
|
||||
Vendored
+20
-7
@@ -17,7 +17,7 @@ import {
|
||||
TokenTicker,
|
||||
TransactionId,
|
||||
TransactionQuery,
|
||||
UnsignedTransaction,
|
||||
UnsignedTransaction
|
||||
} from "@iov/bcp";
|
||||
import { Stream } from "xstream";
|
||||
export declare class CosmosConnection implements BlockchainConnection {
|
||||
@@ -37,16 +37,29 @@ export declare class CosmosConnection implements BlockchainConnection {
|
||||
getAccount(query: AccountQuery): Promise<Account | undefined>;
|
||||
watchAccount(_account: AccountQuery): Stream<Account | undefined>;
|
||||
getNonce(query: AddressQuery | PubkeyQuery): Promise<Nonce>;
|
||||
getNonces(query: AddressQuery | PubkeyQuery, count: number): Promise<readonly Nonce[]>;
|
||||
getNonces(
|
||||
query: AddressQuery | PubkeyQuery,
|
||||
count: number
|
||||
): Promise<readonly Nonce[]>;
|
||||
getBlockHeader(height: number): Promise<BlockHeader>;
|
||||
watchBlockHeaders(): Stream<BlockHeader>;
|
||||
getTx(id: TransactionId): Promise<ConfirmedAndSignedTransaction<UnsignedTransaction> | FailedTransaction>;
|
||||
getTx(
|
||||
id: TransactionId
|
||||
): Promise<
|
||||
ConfirmedAndSignedTransaction<UnsignedTransaction> | FailedTransaction
|
||||
>;
|
||||
postTx(tx: PostableBytes): Promise<PostTxResponse>;
|
||||
searchTx(
|
||||
query: TransactionQuery,
|
||||
): Promise<readonly (ConfirmedTransaction<UnsignedTransaction> | FailedTransaction)[]>;
|
||||
listenTx(_query: TransactionQuery): Stream<ConfirmedTransaction<UnsignedTransaction> | FailedTransaction>;
|
||||
liveTx(_query: TransactionQuery): Stream<ConfirmedTransaction<UnsignedTransaction> | FailedTransaction>;
|
||||
query: TransactionQuery
|
||||
): Promise<
|
||||
readonly (ConfirmedTransaction<UnsignedTransaction> | FailedTransaction)[]
|
||||
>;
|
||||
listenTx(
|
||||
_query: TransactionQuery
|
||||
): Stream<ConfirmedTransaction<UnsignedTransaction> | FailedTransaction>;
|
||||
liveTx(
|
||||
_query: TransactionQuery
|
||||
): Stream<ConfirmedTransaction<UnsignedTransaction> | FailedTransaction>;
|
||||
getFeeQuote(tx: UnsignedTransaction): Promise<Fee>;
|
||||
withDefaultFee<T extends UnsignedTransaction>(tx: T): Promise<T>;
|
||||
private parseAndPopulateTxResponse;
|
||||
|
||||
Vendored
+1
-1
@@ -5,5 +5,5 @@ import { CosmosConnection } from "./cosmosconnection";
|
||||
*/
|
||||
export declare function createCosmosConnector(
|
||||
url: string,
|
||||
expectedChainId?: ChainId,
|
||||
expectedChainId?: ChainId
|
||||
): ChainConnector<CosmosConnection>;
|
||||
|
||||
Vendored
+15
-5
@@ -9,20 +9,30 @@ import {
|
||||
SendTransaction,
|
||||
SignatureBytes,
|
||||
SignedTransaction,
|
||||
UnsignedTransaction,
|
||||
UnsignedTransaction
|
||||
} from "@iov/bcp";
|
||||
import amino from "@tendermint/amino-js";
|
||||
import { TxsResponse } from "./restclient";
|
||||
export declare function decodePubkey(pubkey: amino.PubKey): PubkeyBundle;
|
||||
export declare function decodeSignature(signature: string): SignatureBytes;
|
||||
export declare function decodeFullSignature(signature: amino.StdSignature, nonce: number): FullSignature;
|
||||
export declare function decodeFullSignature(
|
||||
signature: amino.StdSignature,
|
||||
nonce: number
|
||||
): FullSignature;
|
||||
export declare function decodeAmount(amount: amino.Coin): Amount;
|
||||
export declare function parseMsg(msg: amino.Msg, chainId: ChainId): SendTransaction;
|
||||
export declare function parseMsg(
|
||||
msg: amino.Msg,
|
||||
chainId: ChainId
|
||||
): SendTransaction;
|
||||
export declare function parseFee(fee: amino.StdFee): Fee;
|
||||
export declare function parseTx(tx: amino.Tx, chainId: ChainId, nonce: Nonce): SignedTransaction;
|
||||
export declare function parseTx(
|
||||
tx: amino.Tx,
|
||||
chainId: ChainId,
|
||||
nonce: Nonce
|
||||
): SignedTransaction;
|
||||
export declare function parseTxsResponse(
|
||||
chainId: ChainId,
|
||||
currentHeight: number,
|
||||
nonce: Nonce,
|
||||
response: TxsResponse,
|
||||
response: TxsResponse
|
||||
): ConfirmedAndSignedTransaction<UnsignedTransaction>;
|
||||
|
||||
Vendored
+11
-2
@@ -1,9 +1,18 @@
|
||||
import { Amount, Fee, FullSignature, PubkeyBundle, SignedTransaction, UnsignedTransaction } from "@iov/bcp";
|
||||
import {
|
||||
Amount,
|
||||
Fee,
|
||||
FullSignature,
|
||||
PubkeyBundle,
|
||||
SignedTransaction,
|
||||
UnsignedTransaction
|
||||
} from "@iov/bcp";
|
||||
import amino from "@tendermint/amino-js";
|
||||
import { AminoTx } from "./types";
|
||||
export declare function encodePubkey(pubkey: PubkeyBundle): amino.PubKey;
|
||||
export declare function encodeAmount(amount: Amount): amino.Coin;
|
||||
export declare function encodeFee(fee: Fee): amino.StdFee;
|
||||
export declare function encodeFullSignature(fullSignature: FullSignature): amino.StdSignature;
|
||||
export declare function encodeFullSignature(
|
||||
fullSignature: FullSignature
|
||||
): amino.StdSignature;
|
||||
export declare function buildUnsignedTx(tx: UnsignedTransaction): AminoTx;
|
||||
export declare function buildSignedTx(tx: SignedTransaction): AminoTx;
|
||||
|
||||
Vendored
+4
-1
@@ -69,7 +69,10 @@ export declare class RestClient {
|
||||
nodeInfo(): Promise<NodeInfoResponse>;
|
||||
blocksLatest(): Promise<BlocksResponse>;
|
||||
blocks(height: number): Promise<BlocksResponse>;
|
||||
authAccounts(address: Address, height?: string): Promise<AuthAccountsResponse>;
|
||||
authAccounts(
|
||||
address: Address,
|
||||
height?: string
|
||||
): Promise<AuthAccountsResponse>;
|
||||
txs(query: string): Promise<SearchTxsResponse>;
|
||||
txsById(id: TransactionId): Promise<TxsResponse>;
|
||||
postTx(tx: PostableBytes): Promise<PostTxsResponse>;
|
||||
|
||||
Vendored
+3
-1
@@ -2,4 +2,6 @@ import amino from "@tendermint/amino-js";
|
||||
export declare type AminoTx = amino.Tx & {
|
||||
readonly value: amino.StdTx;
|
||||
};
|
||||
export declare function isAminoStdTx(txValue: amino.TxValue): txValue is amino.StdTx;
|
||||
export declare function isAminoStdTx(
|
||||
txValue: amino.TxValue
|
||||
): txValue is amino.StdTx;
|
||||
|
||||
Reference in New Issue
Block a user