Superbridge
Start typing to search...

Guides

Signing

Sign and submit pre-built transaction objects on-chain

Quotes and steps return pre-built transaction objects that need to be signed and submitted on-chain.

Approval Transactions

Approval objects also include a tx field with the same structure. If approvals are needed, they must be confirmed before the initiating transaction.

Examples

EVM with Viem

import { walletClient } from "./client";

const hash = await walletClient.sendTransaction({
  to: tx.to,
  data: tx.data,
  value: BigInt(tx.value),
});

EVM with Ethers

import { ethers } from "ethers";

const signer = await provider.getSigner();

const hash = await signer.sendTransaction({
  to: tx.to,
  data: tx.data,
  value: tx.value,
});

SVM with @solana/web3.js

For Solana and other SVM chains, the data field contains a base64-encoded VersionedTransaction. Decode it, sign it, and send it directly — the transaction is self-contained with all instructions, lookup tables, and compute budget already set.

import { VersionedTransaction } from "@solana/web3.js";

const txBytes = Buffer.from(tx.data, "base64");
const transaction = VersionedTransaction.deserialize(txBytes);

transaction.sign([wallet]);
const signature = await connection.sendTransaction(transaction);