UNPKG

@pushchain/core

Version:

Push Chain is a true universal L1 that is 100% EVM compatible. It allows developers to deploy once and make their apps instantly compatible with users from all other L1s (Ethereum, Solana, etc) with zero on-chain code change.

67 lines (66 loc) 2.54 kB
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 { QueryGetUniversalTxResponse } from '../generated/uexecutor/v1/query'; 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; dex?: { uniV3Factory?: `0x${string}`; uniV3QuoterV2?: `0x${string}`; weth?: `0x${string}`; }; } & { 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>; /** * Queries Push Chain's uexecutor gRPC service for a UniversalTx by its ID. */ getUniversalTxById(id: string): Promise<QueryGetUniversalTxResponse>; /** * 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>; }