Skip to main content

Create and validate action envelopes

Version: V2
View Markdown

API for @0xintuition/sdk@4.1.0. Compatibility · Source.

Import from @0xintuition/sdk/actions.

Signatures show the exact accepted inputs and return types. Named input/output structures and dependency-injection types are listed below; viem and protocol types come from their respective packages. Preparation and quote functions can perform RPC reads. Envelope builders on the action-envelope pages use caller-supplied read context and perform no RPC reads or signing. feeProxyExecutePlan sends transactions; the other SDK actions on these pages prepare transactions or read data.

bigintToDecimalString​

Convert a bigint to its decimal string representation for a JSON action envelope.

Source

function bigintToDecimalString(value: bigint): `${bigint}`;

validateAgentActionStep​

Validate a step target, calldata, and decimal value. Throws for invalid input; does not simulate the transaction.

Source

function validateAgentActionStep(
step: AgentActionStep,
index?,
): AgentActionStep;

Defaults: index = 0. Dependency arguments are optional test/customization hooks; normal consumers use the built-in dependencies.

createAgentActionStep​

Resolve a supported target intent and construct a validated action step.

Source

function createAgentActionStep(
input: CreateAgentActionStepInput,
index?,
): AgentActionStep;

Defaults: index = 0. Dependency arguments are optional test/customization hooks; normal consumers use the built-in dependencies.

validateAgentActionEnvelope​

Validate envelope schema, metadata, unique step IDs, and individual steps. Does not authorize or execute them.

Source

function validateAgentActionEnvelope(
envelope: AgentActionEnvelope,
): AgentActionEnvelope;

createAgentActionEnvelope​

Construct and validate a JSON-serializable envelope of ordered transaction steps.

Source

function createAgentActionEnvelope(
inputs: CreateAgentActionEnvelopeInputs,
): AgentActionEnvelope;

Imported type provenance​

Public import locations and the definitions used by these signatures and helper types. Value imports appear where a dependency hook uses typeof.

Name in this modulePublic importDefinition
AgentActionEnvelopeimport type { AgentActionEnvelope } from '@0xintuition/sdk/actions'AgentActionEnvelope
AgentActionMetadataimport type { AgentActionMetadata } from '@0xintuition/sdk/actions'AgentActionMetadata
AgentActionStepimport type { AgentActionStep } from '@0xintuition/sdk/actions'AgentActionStep
CreateAgentActionStepInputimport type { CreateAgentActionStepInput } from '@0xintuition/sdk/actions'CreateAgentActionStepInput
JsonObjectimport type { JsonObject } from '@0xintuition/sdk/actions'JsonObject

Input and result types​

Exported declarations are public imports from the SDK subpath above. Module-local helper aliases describe accepted shapes but are not public exports.

CreateAgentActionEnvelopeInputs​

Public export.

export type CreateAgentActionEnvelopeInputs = {
action: string;
steps: CreateAgentActionStepInput[];
metadata?: AgentActionMetadata;
estimates?: JsonObject;
warnings?: string[];
};

Applies to V2 · @0xintuition/sdk 4.1.0