@pushchain/core
Version:
## Overview
57 lines (56 loc) • 2.14 kB
TypeScript
import { MsgDeployUEA, MsgExecutePayload, MsgMintPC } from '../generated/v1/tx';
import { Any } from 'cosmjs-types/google/protobuf/any';
import { TxBody, TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx';
import { DeliverTxResponse } from '@cosmjs/stargate';
import { EvmClient } from '../vm-client/evm-client';
import { PushClientOptions } from './push-client.types';
export declare class PushClient extends EvmClient {
pushChainInfo: {
chainId: string;
vm: import("../constants/enums").VM;
lockerContract?: string;
defaultRPC: string[];
confirmations: number;
timeout: number;
} & {
denom: string;
tendermintRpc: string;
prefix: string;
factoryAddress: `0x${string}`;
pushDecimals: bigint;
usdcDecimals: bigint;
pushToUsdcNumerator: bigint;
pushToUsdcDenominator: bigint;
};
private readonly ephemeralKey;
constructor(clientOptions: PushClientOptions);
/**
* Converts nPUSH (1e18) to USDC (1e8), fixed rate: 1 PUSH = 0.1 USDC
*/
pushToUSDC(amount: bigint): bigint;
/**
* Converts USDC (1e8) to nPUSH (1e18), fixed rate: 1 PUSH = 0.1 USDC
*/
usdcToPush(amount: bigint): bigint;
createMsgDeployUEA(input: MsgDeployUEA): Any;
createMsgMintPC(input: MsgMintPC): Any;
createMsgExecutePayload(input: MsgExecutePayload): Any;
createCosmosTxBody(messages: Any[], memo?: string): Promise<TxBody>;
getSignerAddress(): {
evmAddress: `0x${string}`;
cosmosAddress: string;
};
/**
* Signs a Cosmos tx using a temporary account.
* In prod, signer should be passed in instead.
*/
signCosmosTx(txBody: TxBody): Promise<TxRaw>;
broadcastCosmosTx(txRaw: TxRaw): Promise<DeliverTxResponse>;
/**
* Fetches a Cosmos transaction by its hash.
* @param txHash The hex‐encoded transaction hash (without “0x” or with—both work).
* @returns The indexed transaction (height, logs, events, etc.).
* @throws If the tx isn’t found.
*/
getCosmosTx(txHash: string): Promise<DeliverTxResponse>;
}