Skip to main content

Send Universal Transaction

Overview

Universal transactions let you send native transactions from any Layer 1 chain—EVM or non-EVM, even Push Chain itself—without wrapping, bridging or extra tooling required.

Under the hood, the SDK automatically estimates gas, orchestrates signatures, and replays any EVM or non-EVM proofs, so you can focus on your app—not the network plumbing.

Sending Universal Transaction

pushChainClient.universal.sendTransaction({tx}): Promise<TransactionReceipt>

const txHash = await pushChainClient.universal.sendTransaction({
to: '0xa54E96d3fB93BD9f6cCEf87c2170aEdB1D47E1cF',
value: PushChain.utils.helpers.parseUnits('0.1', 18), // 0.1 PC in uPC
// value: BigInt('100000000000000000') is equivalent here
});

TheseArgumentsare mandatory

ArgumentsTypeDescription
tx.tostringThe address of the recipient.
tx.valueBigIntThe value to send in uPC. smallest unit of PC, like wei in ETH
tx.datastringThe data to send.
tx.gasLimitBigIntThe gas limit for the transaction.
tx.maxFeePerGasBigIntThe maximum fee per gas for the transaction.
tx.maxPriorityFeePerGasBigIntThe maximum priority fee per gas for the transaction.
Advanced Arguments
ArgumentsTypeDefaultDescription
tx.deadlineBigInt-The deadline for the transaction.
tx.progressHook(progress: ProgressHookType) => void-A callback function to receive progress updates during transaction lifecycle, especially useful for tracking cross-chain transactions.
ProgressHook Type and Response
FieldTypeDescription
progressObjectThe progress of the transaction.
progress.idstringUnique identifier for the progress event.
progress.titlestringBrief title of the progress event.
progress.messagestringDetailed message describing the event.
progress.levelINFO | SUCCESS | WARNING | ERRORSeverity level of the event.
progress.timestampstringISO-8601 timestamp when the event occurred (e.g. 2025-06-26T15:04:05.000Z).
IDTitleMessageLevel
SEND-TX-01Origin Chain DetectedOrigin chain: solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1INFO
SEND-TX-02-01Estimating GasEstimating and fetching gas limit, gas price for TX…INFO
SEND-TX-02-02Gas EstimatedTotal execution cost (Gas cost + value): 1011250000000000000 UPCSUCCESS
SEND-TX-03-01Resolving UEAResolving Execution Account (UEA) – computing address, checking deployment status and balanceINFO
SEND-TX-03-02UEA ResolvedUEA: 0x4f17B798A7d643d4F89cb2d8D42A72F84e83e566, Deployed: trueSUCCESS
SEND_TX_04_01Awaiting Signature for Tx ExecutionUniversal Payload Hash: 0x1a579f18…fabac4309INFO
SEND_TX_04_02Generated Universal PayloadSignature CompletedSUCCESS
SEND-TX-05-01Locking Origin Chain FeeLocking fee: 1000063864000000000 UPC on origin chainINFO
SEND-TX-05-02Awaiting Origin Chain ConfirmationsTx sent: 0xabc..234, waiting for 2 confirmations.INFO
SEND-TX-05-03Confirmations ReceivedRequired confirmations received.SUCCESS
SEND-TX-06Broadcasting to Push ChainSending Tx to Push Chain…INFO
SEND-TX-99-01Push Chain TX SuccessSUCCESS
SEND-TX-99-02Push Chain TX FailedERROR
Returns `TxResponse` <object>
{
blockHash: '0xd193f3d61a6d73c167d64ce97577882e4736346bc1460fcafafca9144afc083e',
blockNumber: 803963n,
from: '0xb59cdc85cacd15097ece4c77ed9d225014b4d56d',
gas: 21000n,
gasPrice: 1125000000n,
maxFeePerGas: 1325000000n,
maxPriorityFeePerGas: 125000000n,
hash: '0xa0a2a3a58bd7241785b9ff3470b8ba0bbbdf800b3ec8f2b806bb691595041537',
input: '0x',
nonce: 34,
to: '0xfae3594c68edfc2a61b7527164bdae80bc302108',
transactionIndex: 0,
value: 1n,
type: 'eip1559',
accessList: [],
chainId: 42101,
v: 0n,
r: '0x485939545430e60b5a1b6f4271bf1e1955f3045709a43ef616977f391c8601d1',
s: '0x4848e381fdc59955d9c63162caf15a0fb98d5c78e233dd10b177d7be2144d434',
typeHex: '0x2',
yParity: 0,
wait: [Function: wait]
}

Send Transaction with Contract Interaction

When calling a smart contract method via sendTransaction, supply the ABI-encoded function call as a hex string in the data field. You can choose ethers or viem or any of your favorite libraries to encode the function data. Or, use our utility function PushChain.utils.helpers.encodeTxData to encode the function data.

// Define the ABI for the ERC20 transfer function
const erc20Abi = [
'function transfer(address to, uint256 amount) returns (bool)',
];

// Generate the encoded function data using viem
const data = PushChain.utils.helpers.encodeTxData({
abi: erc20Abi,
functionName: 'transfer',
// Transfer 10 tokens, converted to 18 decimal places
args: ['0xRecipientAddress', PushChain.utils.helpers.parseUnits('10', 18)],
});

// Send the transaction using Push Chain SDK
const txHash = await pushChainClient.universal.sendTransaction({
to: '0xTokenContractAddress', // The smart contract address on Push Chain
value: BigInt('0'), // No $PC being sent, just contract interaction
data: data, // The encoded function call
});

Live Playground

VIRTUAL NODE IDE
Live Playground: Interact with Smart Contract

VIRTUAL NODE IDE
Live Playground: (Advanced) Track the progress lifecycle of a transaction
VIRTUAL NODE IDE

Next Steps

  • Sign arbitrary data with Sign Universal Message
  • Surface live feedback in your UI by handling the progressHook events
  • Leverage pre-built utilities in Contract Helpers
  • Integrate transaction flows into your frontend app using the UI Kit