Skip to main content
Every function, class and decorator in the actor SDK, cowboy_sdk. To learn it step by step, start with Build your first actor. For the rules actor code runs under, see Determinism. Where call() and send() below refer to payload_codec.CODECS, the members of that set and the behavior of each are documented under Payload codecs and Strict JSON codec; CIP-6 §9.5 is the normative version.

Actors (Actor)

Module: cowboy_sdk.actor

Actor

ActorRef

derive_actor_address

Who may call a handler (@public, @callable_by)

Module: cowboy_sdk.permissions

public

callable_by

Handler modes (@pure, @deferred)

Module: cowboy_sdk.handler_mode

pure

deferred

Runtime — host calls (state, time, randomness, timers, tokens)

Module: cowboy_sdk.runtime

mode

is_production

is_development

is_checkpoint_mode

require_fsm

get_pvm_version

get_chain_id

get_chain_instance_id

context

get_actor_address

actor_address

get_tx_hash

get_block_height

get_timestamp_ms

charge_gas

emit_event

get_state

set_state

delete_state

get_owner

owner

is_initialized

scan_state_prefix

send_message

call_actor

fork_actor

transfer_balance

schedule_timer

schedule_timer_ex

Both timer scheduling functions use the CIP-5 cycle policy. Let G = TimerConfig.max_cycles_per_fire. Omission, None, or gas_limit=0 selects G below TIMER_FIRE_CYCLES_FOLLOW_CONFIG_ACTIVATION_HEIGHT, and min(550_000, G) from that height. At the ordinary governed maximum, this is 550,000 cycles. The SDK sends None as the host ABI’s zero sentinel; explicit zero uses the same default. Once the gate is active and governance raises G, opt in to a larger fire with a positive gas_limit, bounded by min(G, 2_200_000). For example, a timer that does handler work before submitting a Runner job can request gas_limit=1_500_000 when G is at least 1,500,000. The handler and its JobSubmit share that budget; select enough for both. Governance alone does not increase a new default timer’s request. The fire-time cap and admission-shortfall receipt are defined in CIP-5 §6.2. This gate is currently dormant.

extend_timer

cancel_timer

schedule_after

seconds_to_blocks

subscribe_event

unsubscribe_event

force_unsubscribe_event

update_bid

topup_subscription

upgrade_self

submit_job

intent_deposit

intent_withdraw

intent_broadcast

randomness

keccak256

token_create

token_balance_of

token_total_supply

budget_left

token_transfer

token_approve

token_allowance

token_transfer_from

token_mint

token_burn

offchain_image_initialize

offchain_image_update

verify_signature

hire_id

is_allowed_caller

Types (Address, TokenId, ordered_set)

Module: cowboy_sdk.types

ordered_set

BlockHeight

Address

to_address_bytes

TokenId

Sorted map

Module: cowboy_sdk.sorted_map

SortedMap

Actor signing keys and signature verification

Module: cowboy_sdk.signing

set_signing_key

get_signing_key

verify_with_signing_key

Cross-actor calls

Module: cowboy_sdk.call

call

ActorCallBuilder

call_builder

Async messages

Module: cowboy_sdk.send

send

send_raw

Self-clone (fork)

Module: cowboy_sdk.fork

fork

Timers (@timer)

Module: cowboy_sdk.timer

timer

timer.schedule

Recurring work (@every)

Module: cowboy_sdk.every

every

every.start

every.stop

Block time

Module: cowboy_sdk.pvm_time

time

time_ns

time_ms

monotonic

monotonic_ns

localtime

strftime

block_height

block_height_obj

Deterministic randomness

Module: cowboy_sdk.pvm_random

seed

getstate

setstate

getrandbits

random

randbytes

randint

randrange

choice

shuffle

uniform

sample

System metadata

Module: cowboy_sdk.pvm_sys

get_context

get_actor_address

get_tx_hash

get_block_height

get_timestamp_ms

Escrow — CIP-20 tokens held for others

Module: cowboy_sdk.escrow

Escrow

Caller limits (@limit)

Module: cowboy_sdk.limits

limit

Pause and exit (Pausable, @exit)

Module: cowboy_sdk.pausable

Paused

exit

Pausable

Storage guards

Module: cowboy_sdk.guards

GuardedValue

storage_guard

GuardSet

Bounded loops

Module: cowboy_sdk.bounded_loop

bounded_loop

check_iteration

BoundedRange

BoundedIterator

Off-chain runner jobs (LLM / HTTP / MCP)

Module: cowboy_sdk.runner

llm

http

agent

mcp

container

continuation

waits

cancel

single_flight

extract_text

RunnerResult

decode_reply

cowchat_room

LlmFailure

StructuredResult

decode_reply

Secret

secret

Continuation state

Module: cowboy_sdk.continuation

Capture

carry

carried

new_cid

Retry strategies (Retry)

Module: cowboy_sdk.retry

Retry

Parallel runner jobs (JobGroup)

Module: cowboy_sdk.jobgroup

TaskHandle

JobGroup

Off-chain function errors

Module: cowboy_sdk.offchain

OffchainError

TEE-required jobs

Module: cowboy_sdk.tee

tee_call

HTTP routes (CIP-15)

Module: cowboy_sdk.routes

Pays

Access

HttpRouteSpec

StaticRouteSpec

route

get

post

put

patch

delete

mount

Structured output models (CowboyModel)

Module: cowboy_sdk.models

CowboyModel

Event hooks (emit / on_event)

Module: cowboy_sdk.events

on_event

Stream readers (@on_stream)

Module: cowboy_sdk.on_stream

stream_cursor

reset_stream_cursor

on_stream

read_page

Watchtower

Module: cowboy_sdk.watchtower

WatchtowerClient

Deterministic codec (CBOR)

Module: cowboy_sdk.codec

encode

decode

Payload codecs — the handler/caller selector

Module: cowboy_sdk.payload_codec

normalize_codec

decode_payload

encode_args

decode_return

Strict JSON codec

Module: cowboy_sdk.json_codec

encode

decode

Errors

Module: cowboy_sdk.errors

CowboyError

DeterminismError

StateConflictError

LoopBoundExceeded

CaptureTypeError

UncarriedNameError

ContinuationLimitError

ContinuationNotFoundError

ContinuationCorruptedError

ContinuationSizeLimitError

ContinuationCountLimitError

CycleLimitExceeded

CallDepthExceeded

RunnerTimeoutError

RunnerValidationError

DeterministicValidationError

CodecError

AddressError

TokenIdError

ActorNotFoundError

ActorCallError

PurityViolationError

PermissionDeniedError

JobFailed

Busy

LimitReached

Test doubles (SimulatedChain, CallMock)

Module: cowboy_sdk.testing

CallMock

SimulatedChain

llm_value

llm_failure

Mock host for tests

Module: cowboy_sdk.mock_host

HostError

reset

set_block_height

set_context

set_call_handler

context

seed_actor_owner

actor_owner

seed_hire

seed_allowed_caller

is_allowed_caller

get_state

set_state

delete_state

set_reserved_state

delete_reserved_state

scan_state_prefix

set_budget_left

budget_left

current_block

call_actor

fork_actor

get_fork_log

transfer_balance

get_transfer_log

upgrade_self

get_upgrade_log

send_message

get_send_log

keccak256

schedule_timer

schedule_timer_ex

extend_timer

cancel_timer

get_timers

subscribe_event

unsubscribe_event

force_unsubscribe_event

update_bid

topup_subscription

get_subs

offchain_image_initialize

offchain_image_update

verify_signature

savepoint_effects

rollback_effects