Superbridge
Start typing to search...
The Superbridge API is currently in beta. Endpoints and response formats may change.

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. The shape of the transaction object varies by VM type.

EVM

EVM transactions include to, data, and value fields that can be passed directly to any Ethereum library.

If the quote includes approvals, they must be confirmed before the initiating transaction.

Viem

import { walletClient } from './client';

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

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

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);

Starknet

For Starknet, the initiating transaction includes a calls array of {contractAddress, entrypoint, calldata} objects. This can be submitted directly via the Starknet wallet.

starknet.js

const result = await account.execute(tx.calls);

Wallet API

const result = await wallet.request({
  type: 'wallet_addInvokeTransaction',
  params: {
    calls: tx.calls.map((call) => ({
      contract_address: call.contractAddress,
      entry_point: call.entrypoint,
      calldata: call.calldata,
    })),
  },
});