Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.rhinestone.dev/llms.txt

Use this file to discover all available pages before exploring further.

Sending a transaction is a three-step flow: prepareTransaction fetches a quote, signTransaction signs it, submitTransaction sends it to the orchestrator. Splitting the steps lets you show the user a quote before they approve, fetch on a backend and sign on a mobile frontend, or pick a non-default route.

Send a single-chain transaction

Pass a chain and a list of calls. The example below transfers USDC on Base Sepolia:
import { encodeFunctionData, erc20Abi } from 'viem'
import { baseSepolia } from 'viem/chains'

const receiver = '0xd8da6bf26964af9d7eed9e03e53415d37aa96045'
const usdcAmount = 1n

const prepared = await rhinestoneAccount.prepareTransaction({
  chain: baseSepolia,
  calls: [
    {
      to: 'USDC',
      value: 0n,
      data: encodeFunctionData({
        abi: erc20Abi,
        functionName: 'transfer',
        args: [receiver, usdcAmount],
      }),
    },
  ],
})
const signed = await rhinestoneAccount.signTransaction(prepared)
const transaction = await rhinestoneAccount.submitTransaction(signed)

const result = await rhinestoneAccount.waitForExecution(transaction)
console.log('Result', result)

Send a cross-chain transaction

Swap chain for sourceChains + targetChain. The SDK handles bridging and routing with no separate bridge interaction required:
import { baseSepolia, arbitrumSepolia } from 'viem/chains'

const prepared = await rhinestoneAccount.prepareTransaction({
  sourceChains: [baseSepolia],
  targetChain: arbitrumSepolia,
  calls: [
    {
      to: 'USDC',
      value: 0n,
      data: encodeFunctionData({
        abi: erc20Abi,
        functionName: 'transfer',
        args: [receiver, usdcAmount],
      }),
    },
  ],
  tokenRequests: [
    {
      address: 'USDC',
      amount: usdcAmount,
    },
  ],
})
const signed = await rhinestoneAccount.signTransaction(prepared)
const transaction = await rhinestoneAccount.submitTransaction(signed)

const result = await rhinestoneAccount.waitForExecution(transaction)
To deploy the account on a specific chain before transacting, call await rhinestoneAccount.deploy(chain) first. Otherwise, any transaction triggers deployment as part of the intent — token transfers, contract calls, approvals, anything.

Next steps

Crosschain

Send funds across chains with a single signature. No bridging required.

Unified balance

Aggregate user balances across chains to fund any intent.

Sponsor fees

Cover gas, bridging, and swap fees for your users.