For AI agents: read the documentation index. Documentation pages are available as Markdown by appending .md to their URL, or requesting Accept: text/markdown.

Namera Docs

Execute

Prepare, authorize, and submit one or more EVM calls.

namera.executions.execute(request) validates and signs the prepared operation, then queues it for broadcast. Each invocation starts a new submission.

Usage

Install @namera-ai/sdk and viem. Replace the example IDs and recipient with your own. The selected session must permit these calls on Base Sepolia.

index.ts
import { namera } from "./client";
import { parseEther } from "viem";

const execution = await namera.executions.execute({
  namespace: "eip155",
  walletId: "0199dfe1-0000-7000-8000-000000000001",
  sessionKeyId: "0199dfe1-0000-7000-8000-000000000002",
  chainId: "eip155:84532",
  calls: [
    {
      to: "0x2222222222222222222222222222222222222222",
      value: parseEther("0.001"),
      data: "0x",
    },
  ],
  sponsor: true,
});

if (!execution.success) throw new Error(execution.error.message);

console.log(execution.data);

Returns

API methods return a Promise<NameraResult<T, E>>. When success is true, data contains the value described below and error is null. On failure, data is null and error describes the failure.

The JSON example shows the complete successful data, with illustrative values. Date-time values use ISO strings in JSON; bigint values use decimal strings. See Handling Results and Errors for the error shape.

  • namespace ("eip155"): Chain namespace.
  • submissionId (string): ID to pass to executions.getStatus().
  • status ("prepared" | "submitted" | "confirmed" | "failed"): Current submission state. Prepared is queued, not confirmed.
  • userOperationHash (`0x${string}`): ERC-4337 user-operation hash, not a transaction hash.

Example Response

{
  "namespace": "eip155",
  "submissionId": "0199dfe1-0000-7000-8000-000000000003",
  "status": "prepared",
  "userOperationHash": "0x1111111111111111111111111111111111111111111111111111111111111111"
}

Parameters

Pass an ExecuteRequest object. Fields below are required unless marked optional.

namespace

  • Type: "eip155"
  • Required

The blockchain namespace. Use "eip155" for every currently supported Namera network. This is not a chain ID; select the specific network with chainId.

index.ts
import { namera } from "./client";
import { parseEther } from "viem";

const execution = await namera.executions.execute({
  namespace: "eip155", 
  walletId: "0199dfe1-0000-7000-8000-000000000001",
  sessionKeyId: "0199dfe1-0000-7000-8000-000000000002",
  chainId: "eip155:84532",
  calls: [
    {
      to: "0x2222222222222222222222222222222222222222",
      value: parseEther("0.001"),
      data: "0x",
    },
  ],
  sponsor: true,
});

if (!execution.success) throw new Error(execution.error.message);

console.log(execution.data);

walletId

  • Type: string
  • Required

The account UUID returned by wallets.list() or wallets.get(). Pass its id, not its onchain address. The account must be accessible to the client’s credential.

index.ts
import { namera } from "./client";
import { parseEther } from "viem";

const execution = await namera.executions.execute({
  namespace: "eip155",
  walletId: "0199dfe1-0000-7000-8000-000000000001", 
  sessionKeyId: "0199dfe1-0000-7000-8000-000000000002",
  chainId: "eip155:84532",
  calls: [
    {
      to: "0x2222222222222222222222222222222222222222",
      value: parseEther("0.001"),
      data: "0x",
    },
  ],
  sponsor: true,
});

if (!execution.success) throw new Error(execution.error.message);

console.log(execution.data);

sessionKeyId

  • Type: string
  • Required

The session-key UUID returned by sessionKeys.list() or sessionKeys.get(). This identifies the delegated session, not its signing key or network installation. Your credential must have an active grant for this key.

For execution or signing, choose a key belonging to walletId with a confirmed installation on chainId and permissions that allow the requested operation.

index.ts
import { namera } from "./client";
import { parseEther } from "viem";

const execution = await namera.executions.execute({
  namespace: "eip155",
  walletId: "0199dfe1-0000-7000-8000-000000000001",
  sessionKeyId: "0199dfe1-0000-7000-8000-000000000002", 
  chainId: "eip155:84532",
  calls: [
    {
      to: "0x2222222222222222222222222222222222222222",
      value: parseEther("0.001"),
      data: "0x",
    },
  ],
  sponsor: true,
});

if (!execution.success) throw new Error(execution.error.message);

console.log(execution.data);

chainId

  • Type: SupportedEvmChainId
  • Required

The target network in CAIP-2 format. For Base Sepolia, use "eip155:84532", not 84532 or "84532". Use the network on which the account will execute, sign, or verify the payload.

The SDK restricts this field to the supported network IDs. Network availability is also checked by the API.

index.ts
import { namera } from "./client";
import { parseEther } from "viem";

const execution = await namera.executions.execute({
  namespace: "eip155",
  walletId: "0199dfe1-0000-7000-8000-000000000001",
  sessionKeyId: "0199dfe1-0000-7000-8000-000000000002",
  chainId: "eip155:84532", 
  calls: [
    {
      to: "0x2222222222222222222222222222222222222222",
      value: parseEther("0.001"),
      data: "0x",
    },
  ],
  sponsor: true,
});

if (!execution.success) throw new Error(execution.error.message);

console.log(execution.data);

calls

  • Type: readonly { to: EthereumAddress; value: bigint; data: Hex }[]
  • Required

One or more EVM calls, in execution order. Every call uses the same account, network, and session key. Supply all three fields on each call; there are no implicit values for value or data.

index.ts
import { namera } from "./client";
import { parseEther } from "viem";

const execution = await namera.executions.execute({
  namespace: "eip155",
  walletId: "0199dfe1-0000-7000-8000-000000000001",
  sessionKeyId: "0199dfe1-0000-7000-8000-000000000002",
  chainId: "eip155:84532",
  calls: [
    {
      to: "0x2222222222222222222222222222222222222222",
      value: parseEther("0.001"), 
      data: "0x",
    },
  ],
  sponsor: true,
});

if (!execution.success) throw new Error(execution.error.message);

console.log(execution.data);

calls.to

  • Type: EthereumAddress (`0x${string}`)
  • Required

The 20-byte recipient or contract address. Native transfers target the recipient; contract calls target the contract, not the recipient encoded in its arguments. The session’s permissions must allow this target.

index.ts
import { namera } from "./client";
import { parseEther } from "viem";

const execution = await namera.executions.execute({
  namespace: "eip155",
  walletId: "0199dfe1-0000-7000-8000-000000000001",
  sessionKeyId: "0199dfe1-0000-7000-8000-000000000002",
  chainId: "eip155:84532",
  calls: [
    {
      to: "0x2222222222222222222222222222222222222222", 
      value: parseEther("0.001"),
      data: "0x",
    },
  ],
  sponsor: true,
});

if (!execution.success) throw new Error(execution.error.message);

console.log(execution.data);

calls.value

  • Type: bigint
  • Required

The native-token amount in wei. Use parseEther("0.001") for 0.001 ETH or 0n for a call that sends no native tokens. Negative amounts are rejected. ERC-20 amounts belong in encoded calldata, not this field.

index.ts
import { namera } from "./client";
import { parseEther } from "viem";

const execution = await namera.executions.execute({
  namespace: "eip155",
  walletId: "0199dfe1-0000-7000-8000-000000000001",
  sessionKeyId: "0199dfe1-0000-7000-8000-000000000002",
  chainId: "eip155:84532",
  calls: [
    {
      to: "0x2222222222222222222222222222222222222222",
      value: parseEther("0.001"), 
      data: "0x",
    },
  ],
  sponsor: true,
});

if (!execution.success) throw new Error(execution.error.message);

console.log(execution.data);

calls.data

  • Type: Hex (`0x${string}`)
  • Required

The encoded contract call. Use "0x" for a native transfer. For contract functions, use viem’s encodeFunctionData; the SDK does not accept abi, functionName, or args directly in a call.

index.ts
import { namera } from "./client";
import { encodeFunctionData, erc20Abi, parseUnits } from "viem";

const result = await namera.executions.execute({
  namespace: "eip155",
  walletId: "0199dfe1-0000-7000-8000-000000000001",
  sessionKeyId: "0199dfe1-0000-7000-8000-000000000002",
  chainId: "eip155:84532",
  calls: [
    {
      to: "0x3333333333333333333333333333333333333333",
      value: 0n,
      data: encodeFunctionData({
        abi: erc20Abi,
        functionName: "transfer",
        args: ["0x2222222222222222222222222222222222222222", parseUnits("1", 6)],
      }),
    },
  ],
});
if (!result.success) throw new Error(result.error.message);

console.log(result.data);

This encodes a transfer of one token with six decimals. Use your token’s actual decimals and pass its contract address as to.

  • Type: boolean
  • Optional
  • Default: true

Sponsorship covers gas, not transferred assets, and remains subject to workspace allowances and policies.

Set false to pay from the account. Fund both the transfer and gas, and configure maxGasCostWei. A custom signer must carry its own fee ceiling.

See Sponsor Gas for a complete self-funded example.

index.ts
import { namera } from "./client";
import { parseEther } from "viem";

const execution = await namera.executions.execute({
  namespace: "eip155",
  walletId: "0199dfe1-0000-7000-8000-000000000001",
  sessionKeyId: "0199dfe1-0000-7000-8000-000000000002",
  chainId: "eip155:84532",
  calls: [
    {
      to: "0x2222222222222222222222222222222222222222",
      value: parseEther("0.001"),
      data: "0x",
    },
  ],
  sponsor: true, 
});

if (!execution.success) throw new Error(execution.error.message);

console.log(execution.data);

Behavior

Use Get Submission Status to track this submission. Do not call execute again to poll. Internal preparation retries reuse one idempotency key; completion retries reuse the same submission.

Errors

Policy, authorization, billing, and execution failures return success: false. Prepared-operation validation failures use kind: "signer". See Handling Results and Errors for authentication, transport, and contract errors.

Guide: Transfer Assets.