Custom Transactions/Signing

Sign and broadcast custom built transactions on Ethereum, Solana, and other supported networks. This will require you to build your own transaction calldata.

Sign and Send

Sign and broadcast a transaction.

async signAndSend(request: SignAndSendRequest): Promise<SignAndSendResponse>

Ethereum (EVM Chains)

Request:

  • network (string): Network identifier

  • request (object):

    • toAddress (string): Recipient address (hex string)

    • data (string): Calldata (hex string, use "0x" for transfers)

    • value (string): Wei amount (string)

    • gas (number, optional): Gas limit

    • maxFeePerGas (string, optional): Max fee per gas (wei)

    • maxPriorityFeePerGas (string, optional): Max priority fee per gas (wei)

  • message (string, optional): Context message

Example:

const response = await agent.signAndSend({
  network: "ethereum:1",
  request: {
    toAddress: agent.sessionWalletAddress,
    data: "0x",
    value: "100000000000000", // 0.0001 ETH
  },
  message: "Self-send demo"
});

if (response.success && response.data) {
  await agent.log(`Transaction sent: ${response.data.txHash}`);
  if (response.data.transactionUrl) {
    await agent.log(`View: ${response.data.transactionUrl}`);
  }
} else {
  await agent.log(response.error || response.errorMessage || "Transaction failed", { error: true });
}

Solana

Request:

  • network (string): "solana"

  • request (object):

    • hexTransaction (string): Serialized VersionedTransaction as hex string

Example:

Response:

  • success (boolean): Whether the transaction was signed and broadcast

  • data.txHash / data.tx_hash (string): Transaction hash (on success)

  • data.transactionUrl / data.transaction_url (string, optional): Explorer link (on success)

  • error / error_message (string | null): Error message (on failure)

Sign Message

Sign a message on an EVM network (EIP-712 or EIP-191).

Request:

  • network (string): "ethereum:chainId" for EVM networks

  • request (object):

    • messageType (string): "eip712" or "eip191"

    • chainId (number): Ethereum chain ID

    • data (object): Message data structure

      • For EIP-712: { domain, types, primaryType, message }

      • For EIP-191: { message } (plain text)

Response:

  • v (number): Signature v component

  • r (string): Signature r component (hex)

  • s (string): Signature s component (hex)

  • formattedSignature (string): Complete signature (hex)

  • type (string): Always "evm"

Example:

Notes

  • signMessage is EVM-only. Solana message signing is not supported.

  • Network identifiers: see Overview & Conventions

Last updated