UNPKG

@avalanche-sdk/client

Version:

A TypeScript SDK for interacting with the Avalanche network through JSON-RPC APIs. This SDK provides a comprehensive set of tools to interact with all Avalanche chains (P-Chain, X-Chain, C-Chain) and various APIs, including wallet functionality for transa

30 lines 1.35 kB
import { Common, Credential, UnsignedTx } from "@avalabs/avalanchejs"; /** * Get a transaction from a buffer or hex string * @param txBytes - The buffer or hex string to get the transaction from `string` or `Uint8Array` * @param chainAlias - The chain alias to get the transaction from `"P" | "X" | "C"` * @returns A array with the transaction {@link Common.Transaction} and credentials {@link Credential[]} * * @example * ```ts * import { getTxFromBytes } from "@avalanche-sdk/client/utils"; * * const [tx, credentials] = getTxFromBytes("0x1234567890abcdef", "P"); * ``` */ export declare function getTxFromBytes(txBytes: string, chainAlias: "P" | "X" | "C"): [Common.Transaction, Credential[]]; /** * Get an unsigned transaction from a buffer or hex string * @param txBytes - The buffer or hex string to get the transaction from `string` or `Uint8Array` * @param chainAlias - The chain alias to get the transaction from `"P" | "X" | "C"` * @returns An unsigned transaction {@link UnsignedTx} * * @example * ```ts * import { getUnsignedTxFromBytes } from "@avalanche-sdk/client/utils"; * * const unsignedTx = getUnsignedTxFromBytes("0x1234567890abcdef", "P"); * ``` */ export declare function getUnsignedTxFromBytes(txBytes: string, chainAlias: "P" | "X" | "C"): UnsignedTx; //# sourceMappingURL=getTxFromBytes.d.ts.map