Create and validate action envelopes
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.
function bigintToDecimalString(value: bigint): `${bigint}`;
validateAgentActionStep
Validate a step target, calldata, and decimal value. Throws for invalid input; does not simulate the transaction.
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.
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.
function validateAgentActionEnvelope(
envelope: AgentActionEnvelope,
): AgentActionEnvelope;
createAgentActionEnvelope
Construct and validate a JSON-serializable envelope of ordered transaction steps.
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 module | Public import | Definition |
|---|---|---|
AgentActionEnvelope | import type { AgentActionEnvelope } from '@0xintuition/sdk/actions' | AgentActionEnvelope |
AgentActionMetadata | import type { AgentActionMetadata } from '@0xintuition/sdk/actions' | AgentActionMetadata |
AgentActionStep | import type { AgentActionStep } from '@0xintuition/sdk/actions' | AgentActionStep |
CreateAgentActionStepInput | import type { CreateAgentActionStepInput } from '@0xintuition/sdk/actions' | CreateAgentActionStepInput |
JsonObject | import 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