Skip to main content

Python bindings for Sui Move package analysis and transaction replay

Project description

sui-sandbox

Python bindings for Sui Move package analysis, transaction replay, view function execution, and Move function fuzzing.

Built on sui-sandbox — runs the real Sui Move VM locally via PyO3. All functions are standalone and execute in-process from Python (no CLI subprocess passthrough). With published wheels, pip install sui-sandbox is all you need.

Installation

From PyPI

pip install sui-sandbox

From source (requires Rust toolchain)

cd crates/sui-python
pip install maturin
# For Python 3.14 with current PyO3 constraints:
#   PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 maturin develop --release
maturin develop --release

For maintainers/contributors, see the full build and validation workflow: docs/guides/PYTHON_BINDINGS.md.

Quick Start

import sui_sandbox

# Extract the full interface of the Sui framework
interface = sui_sandbox.extract_interface(package_id="0x2")
for mod_name, mod_data in interface["modules"].items():
    print(f"{mod_name}: {len(mod_data.get('functions', {}))} functions")

# Replay a historical transaction via Walrus (no API key needed)
result = sui_sandbox.replay(
    "At8M8D7QoW3HHXUBHHvrsdhko8hEDdLAeqkZBjNSKFk2",
    checkpoint=239615926,
)
print(f"Success: {result['local_success']}")

# Fuzz a Move function
report = sui_sandbox.fuzz_function("0x1", "u64", "max", iterations=50)
print(f"Successes: {report['outcomes']['successes']}")

For runnable end-to-end scripts, see:

  • python_sui_sandbox/README.md

Naming

Canonical API families now mirror CLI naming:

  • context_* (alias-compatible with context_prepare / replay helpers)
  • adapter_* (alias-compatible with protocol_*)
  • pipeline_* (alias-compatible with workflow_*)

Backwards-compatible aliases remain available.

API Reference

extract_interface(*, package_id=None, bytecode_dir=None, rpc_url="https://fullnode.mainnet.sui.io:443")

Extract the complete interface JSON for a Move package — all modules, structs, functions, type parameters, abilities, and fields.

Provide either package_id (fetched via GraphQL) or bytecode_dir (local directory containing bytecode_modules/*.mv files), but not both.

Returns: dict with full interface tree.

interface = sui_sandbox.extract_interface(package_id="0x1")
for mod_name, mod_data in interface["modules"].items():
    print(f"{mod_name}: {len(mod_data.get('functions', {}))} functions")

get_latest_checkpoint()

Get the latest archived checkpoint number from Walrus.

Returns: int

cp = sui_sandbox.get_latest_checkpoint()
print(f"Latest checkpoint: {cp}")

get_checkpoint(checkpoint)

Fetch a checkpoint from Walrus and return a summary.

Returns: dict with checkpoint, epoch, timestamp_ms, transaction_count, transactions (list), and object_versions_count.

data = sui_sandbox.get_checkpoint(239615926)
for tx in data["transactions"]:
    print(f"  {tx['digest']}: {tx['commands']} commands, {tx['input_objects']} inputs")

doctor(*, rpc_url="https://archive.mainnet.sui.io:443", state_file=None, timeout_secs=20, include_toolchain_checks=False)

Run native preflight checks (CLI parity for sui-sandbox doctor) and return a structured report.

report = sui_sandbox.doctor(timeout_secs=15)
print(report["ok"], report["passed"], report["failed"])
for check in report["checks"]:
    print(check["id"], check["passed"], check["detail"])

session_status(*, state_file=None, rpc_url="https://archive.mainnet.sui.io:443")

Return local sandbox session status (CLI parity for sui-sandbox status).

status = sui_sandbox.session_status()
print(status["packages_loaded"], status["objects_loaded"], status["state_file"])

session_reset(*, state_file=None) / session_clean(*, state_file=None)

  • session_reset: reset to a clean baseline state file (CLI parity for reset)
  • session_clean: remove the state file (CLI parity for clean)
sui_sandbox.session_reset()
sui_sandbox.session_clean()

snapshot_save(name, *, description=None, state_file=None) / snapshot_load(name, *, state_file=None) / snapshot_list() / snapshot_delete(name)

Snapshot lifecycle APIs with CLI parity for sui-sandbox snapshot save|load|list|delete.

sui_sandbox.snapshot_save("pre_test", description="before risky replay")
print(sui_sandbox.snapshot_list())
sui_sandbox.snapshot_load("pre_test")
sui_sandbox.snapshot_delete("pre_test")

ptb_universe(*, source="walrus", latest=10, top_packages=8, max_ptbs=20, out_dir=None, grpc_endpoint=None, stream_timeout_secs=120)

Run the checkpoint-source PTB universe engine from Python (same core engine as the Rust walrus_ptb_universe example wrapper). Artifacts are written to out_dir and returned in the response.

run = sui_sandbox.ptb_universe(
    latest=1,
    top_packages=1,
    max_ptbs=1,
)
print(run["out_dir"])
print(run["artifacts"]["summary"])

discover_checkpoint_targets(*, checkpoint=None, latest=None, package_id=None, include_framework=False, limit=200, walrus_network="mainnet", walrus_caching_url=None, walrus_aggregator_url=None)

Discover replay candidates directly from checkpoint Move calls.

Use this when you want a package-first flow:

  1. discover digest/checkpoint candidates,
  2. prepare package context,
  3. replay with your input/state data.

walrus_network defaults to mainnet; set to testnet or provide both custom endpoint URLs.

Returns: dict with scan summary and targets entries:

  • checkpoint, digest, sender
  • package_ids
  • move_calls (command_index, package, module, function)
targets = sui_sandbox.discover_checkpoint_targets(
    latest=5,
    package_id="0x2",
    limit=20,
)
print(f"matches={targets['matches']}")
for t in targets["targets"][:3]:
    print(t["checkpoint"], t["digest"], t["package_ids"])

# optional Walrus endpoint control (testnet/custom):
targets_testnet = sui_sandbox.discover_checkpoint_targets(
    latest=3,
    walrus_network="testnet",
)

adapter_discover(*, protocol="generic", package_id=None, checkpoint=None, latest=None, include_framework=False, limit=200, walrus_network="mainnet", walrus_caching_url=None, walrus_aggregator_url=None) (alias: protocol_discover)

Protocol-first discovery wrapper:

  • requires package_id for non-generic protocols
targets = sui_sandbox.adapter_discover(
    protocol="deepbook",
    package_id="0x97d9473771b01f77b0940c589484184b49f6444627ec121314fae6a6d36fb86b",
    latest=5,
    limit=20,
)
print(targets["matches"])

pipeline_validate(spec_path) (alias: workflow_validate)

Validate a typed pipeline spec (JSON or YAML) and return step counts.

summary = sui_sandbox.pipeline_validate("examples/data/workflow_replay_analyze_demo.json")
print(summary["steps"], summary["replay_steps"], summary["analyze_replay_steps"])

pipeline_init(*, template="generic", output_path=None, format=None, digest=None, checkpoint=None, include_analyze_step=True, strict_replay=True, name=None, package_id=None, view_objects=[], force=False) (alias: workflow_init)

Generate a typed pipeline spec from built-in planners (generic, cetus, suilend, scallop).

spec = sui_sandbox.pipeline_init(
    template="suilend",
    output_path="workflow.suilend.yaml",
    format="yaml",
    force=True,
)
print(spec["output_file"], spec["steps"])

pipeline_auto(package_id, *, template=None, output_path=None, format=None, digest=None, discover_latest=None, checkpoint=None, name=None, best_effort=False, force=False, walrus_network="mainnet", walrus_caching_url=None, walrus_aggregator_url=None) (alias: workflow_auto)

Auto-generate a package-first draft adapter pipeline with closure checks and optional replay seed discovery.

# scaffold-only draft
draft = sui_sandbox.pipeline_auto("0x2", output_path="workflow.auto.2.json", force=True)
print(draft["replay_steps_included"], draft["template"])

# replay-capable draft using checkpoint discovery
draft_replay = sui_sandbox.pipeline_auto(
    "0x2",
    discover_latest=25,
    output_path="workflow.auto.2.replay.json",
    force=True,
)
print(draft_replay["replay_seed_source"], draft_replay["discovered_checkpoint"])

pipeline_run(spec_path, *, dry_run=False, continue_on_error=False, report_path=None, rpc_url="https://archive.mainnet.sui.io:443", walrus_network="mainnet", walrus_caching_url=None, walrus_aggregator_url=None, verbose=False) (alias: workflow_run)

Execute a typed pipeline spec natively from Python (no CLI passthrough).

report = sui_sandbox.pipeline_run(
    "workflow.auto.2.replay.json",
    report_path="out/workflow_report.json",
)
print(report["succeeded_steps"], report["failed_steps"])

pipeline_run_inline(spec, *, dry_run=False, continue_on_error=False, report_path=None, rpc_url="https://archive.mainnet.sui.io:443", walrus_network="mainnet", walrus_caching_url=None, walrus_aggregator_url=None, verbose=False) (alias: workflow_run_inline)

Execute a typed pipeline from an in-memory Python object (no temp spec file).

Local-cache pipeline replay/analyze is supported in native mode:

sui_sandbox.import_state(state="examples/data/state_json_synthetic_ptb_demo.json")
spec = {
    "version": 1,
    "defaults": {"source": "local"},
    "steps": [
        {"kind": "analyze_replay", "digest": "synthetic_make_move_vec_demo"},
        {"kind": "replay", "digest": "synthetic_make_move_vec_demo"},
    ],
}
report = sui_sandbox.pipeline_run_inline(spec)
print(report["succeeded_steps"], report["failed_steps"])  # 2, 0

Supported pipeline native controls include:

  • replay: profile, fetch_strategy, vm_only, synthesize_missing, self_heal_dynamic_fields
  • analyze_replay: mm2

fetch_object_bcs(object_id, *, version=None, endpoint=None, api_key=None)

Fetch a Sui object's BCS payload via gRPC (optionally pinned to a historical version).

Returns: dict with object_id, version, type_tag, bcs_base64, and owner metadata.

obj = sui_sandbox.fetch_object_bcs("0x6", version=714666359)
print(obj["type_tag"], obj["version"])

fetch_historical_package_bytecodes(package_ids, *, type_refs=None, checkpoint=None, endpoint=None, api_key=None)

Fetch package bytecodes via HistoricalStateProvider with transitive dependency resolution, optionally pinned to a checkpoint.

This mirrors the Rust historical package-loading path used by advanced examples like DeepBook margin reconstruction.

Returns: dict with:

  • packages: package ID -> list of base64 module bytecodes
  • aliases: storage -> runtime package ID aliases
  • linkage_upgrades: runtime -> storage upgrade map
  • package_runtime_ids: storage -> runtime IDs
  • package_linkage: per-package linkage tables
  • package_versions: storage -> package version (used for alias/version-aware child lookup)
  • count, checkpoint, endpoint_used
pkgs = sui_sandbox.fetch_historical_package_bytecodes(
    [
        "0x97d9473771b01f77b0940c589484184b49f6444627ec121314fae6a6d36fb86b",
        "0x337f4f4f6567fcd778d5454f27c16c70e2f274cc6377ea6249ddf491482ef497",
    ],
    type_refs=[
        "0x2::sui::SUI",
        "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
    ],
    checkpoint=240733000,
)
print(f"Fetched {pkgs['count']} packages")

fetch_package_bytecodes(package_id, *, resolve_deps=True)

Fetch package bytecodes via GraphQL, optionally resolving transitive dependencies.

Returns: dict with packages (map of package ID to list of base64-encoded module bytecodes) and count.

pkgs = sui_sandbox.fetch_package_bytecodes("0x2", resolve_deps=True)
print(f"Fetched {pkgs['count']} packages")

context_prepare(package_id, *, resolve_deps=True, output_path=None) (alias: prepare_package_context)

Prepare a portable package context payload for replay workflows.

Returns: dict with:

  • version, package_id, with_deps (plus compatibility mirror resolve_deps)
  • generated_at_ms, packages_fetched, count
  • packages as a v2 array of:
    • address
    • modules
    • bytecodes (base64)
  • count
ctx = sui_sandbox.context_prepare("0x2", output_path="flow_context.json")
print(ctx["count"])

adapter_prepare(*, protocol="generic", package_id=None, resolve_deps=True, output_path=None) (alias: protocol_prepare)

Protocol-first prepare wrapper (non-generic protocols require package_id):

ctx = sui_sandbox.adapter_prepare(
    protocol="deepbook",
    package_id="0x97d9473771b01f77b0940c589484184b49f6444627ec121314fae6a6d36fb86b",
    output_path="flow_context.deepbook.json",
)
print(ctx["package_id"], ctx["count"])

json_to_bcs(type_str, object_json, package_bytecodes)

Convert a Sui object JSON representation to BCS bytes using Move type layout.

Returns: bytes

transaction_json_to_bcs(transaction_json)

Convert Snowflake-style TRANSACTION_JSON (or canonical Sui TransactionData JSON) into raw transaction BCS bytes.

This is useful when your pipeline has transaction JSON but not transaction BCS.

Returns: bytes

call_view_function(package_id, module, function, *, type_args=None, object_inputs=None, pure_inputs=None, child_objects=None, historical_versions=None, fetch_child_objects=False, grpc_endpoint=None, grpc_api_key=None, package_bytecodes=None, fetch_deps=True)

Execute a Move function in the local VM with full control over object and pure inputs.

Returns: dict with success, error, return_values, return_type_tags, gas_used.

object_inputs entries must use:

{
    "object_id": "0x...",
    "type_tag": "0x2::...",
    "bcs_bytes": [1, 2, 3],   # or bytes in Python
    "is_shared": False,       # optional
    "mutable": False,         # optional
}

Legacy compatibility: owner is also accepted as an alias for is_shared: "immutable" / "address_owned" => non-shared, "shared" => shared.

package_bytecodes accepts either:

  • {"0xpackage": [b"...", b"..."]} or {"0xpackage": ["<base64>", ...]}
  • the full payload returned by fetch_historical_package_bytecodes(...)

When passing the full historical payload, dependency fetching is auto-disabled to avoid mixing in latest GraphQL dependency fetches.

To enable on-demand child-object loading (useful for sui::versioned wrappers):

result = sui_sandbox.call_view_function(
    package_id="0x...",
    module="mod",
    function="fn",
    object_inputs=[...],
    historical_versions={"0xchild_or_known_obj": 123},
    fetch_child_objects=True,
)

historical_view_from_versions(*, versions_file, package_id, module, function, required_objects, type_args=[], package_roots=[], type_refs=[], fetch_child_objects=True, grpc_endpoint=None, grpc_api_key=None)

Generic historical view execution helper.

  • loads object versions/checkpoint from snapshot JSON
  • hydrates required historical objects via gRPC
  • hydrates checkpoint-pinned package closure
  • executes the specified Move function locally
out = sui_sandbox.historical_view_from_versions(
    versions_file="examples/data/deepbook_margin_state/deepbook_versions_240733000.json",
    package_id="0x97d9473771b01f77b0940c589484184b49f6444627ec121314fae6a6d36fb86b",
    module="margin_manager",
    function="manager_state",
    required_objects=[...],
    type_args=["0x2::sui::SUI", "<USDC_TYPE>"],
)
print(out["success"], out["gas_used"])
print(out["raw"]["return_values"])

When archive endpoints miss runtime objects, the result includes a retry hint.

Historical replay also attempts dynamic-field auto-hydration by default. Optional env controls: SUI_HISTORICAL_AUTO_HYDRATE_DYNAMIC_FIELDS, SUI_HISTORICAL_DYNAMIC_FIELD_DEPTH, SUI_HISTORICAL_DYNAMIC_FIELD_LIMIT, SUI_HISTORICAL_DYNAMIC_FIELD_MAX_OBJECTS, SUI_HISTORICAL_DYNAMIC_FIELD_PARENT_SCAN_LIMIT, SUI_HISTORICAL_DYNAMIC_FIELD_LOG.

historical_series_from_points(*, points, package_id, module, function, required_objects, type_args=[], package_roots=[], type_refs=[], fetch_child_objects=True, schema=None, command_index=0, grpc_endpoint=None, grpc_api_key=None, max_concurrency=1)

Execute the same historical view request across multiple checkpoint/version points.

  • points: list of {checkpoint, versions, label?, metadata?}
  • schema: optional decode schema (same shape as historical_decode_with_schema)
  • returns {request, points, summary, runs} with per-point raw output and optional decoded fields
points = [
    {"checkpoint": 240732600, "versions": {"0x6": 129466613}, "label": "day-1"},
    {"checkpoint": 240733000, "versions": {"0x6": 129466871}, "label": "day-2"},
]
series = sui_sandbox.historical_series_from_points(
    points=points,
    package_id="0x97d9473771b01f77b0940c589484184b49f6444627ec121314fae6a6d36fb86b",
    module="margin_manager",
    function="manager_state",
    required_objects=[...],
    type_args=["0x2::sui::SUI", "<USDC_TYPE>"],
    schema=[{"index": 2, "name": "risk_ratio_pct", "type_hint": "u64", "scale": 1e7}],
    max_concurrency=4,
)
print(series["summary"])

historical_series_from_files(*, request_file, series_file, schema_file=None, command_index=0, grpc_endpoint=None, grpc_api_key=None, max_concurrency=1)

File-driven historical-series runner (parity with Rust CLI context historical-series).

  • request_file: JSON/YAML HistoricalViewRequest
  • series_file: JSON/YAML points payload (points or daily_snapshots)
  • schema_file: optional JSON/YAML list of decode schema fields
  • returns {request, points, runs, summary}
report = sui_sandbox.historical_series_from_files(
    request_file="examples/data/deepbook_margin_state/manager_state_request.json",
    series_file="examples/data/deepbook_margin_state/position_b_daily_timeseries.json",
    schema_file="examples/data/deepbook_margin_state/manager_state_schema.json",
    max_concurrency=4,
)
print(report["summary"])

historical_decode_return_u64(result, *, command_index=0, value_index)

Decode a single little-endian u64 return value from historical_view_from_versions output. The decoder accepts either the full result object or result["raw"].

Returns None when execution failed or index is missing.

risk_ratio = sui_sandbox.historical_decode_return_u64(out, value_index=2)
current_px = sui_sandbox.historical_decode_return_u64(out, value_index=11)

historical_decode_return_u64s(result, *, command_index=0)

Decode all command return values into u64 slots where possible. The decoder accepts either the full result object or result["raw"].

Returns None when execution failed or no command return values are available.

vals = sui_sandbox.historical_decode_return_u64s(out) or []
print(vals[2], vals[11])  # risk_ratio, current_price

historical_decode_returns_typed(result, *, command_index=0)

Decode command return values into typed JSON using return_type_tags when available. The decoder accepts either the full result object or result["raw"].

Returns None when execution failed or no command return values are available.

typed = sui_sandbox.historical_decode_returns_typed(out) or []
for item in typed:
    print(item["index"], item["type_tag"], item["value"])

historical_decode_with_schema(result, schema, *, command_index=0)

Decode command return values into a named object using a field schema:

  • index: return tuple index
  • name: output key
  • type_hint: optional decode override (u64, address, vector<u8>, utf8, hex, base64, ...)
  • scale: optional numeric divisor

Returns None when execution failed or no command return values are available. The decoder accepts either the full result object or result["raw"].

schema = [
    {"index": 2, "name": "risk_ratio_pct", "type_hint": "u64", "scale": 1e7},
    {"index": 11, "name": "current_price", "type_hint": "u64", "scale": 1e6},
]
decoded = sui_sandbox.historical_decode_with_schema(out, schema) or {}
print(decoded.get("risk_ratio_pct"), decoded.get("current_price"))

fuzz_function(package_id, module, function, *, iterations=100, seed=None, sender="0x0", gas_budget=50_000_000_000, type_args=[], fail_fast=False, max_vector_len=32, dry_run=False, fetch_deps=True)

Fuzz a Move function with randomly generated inputs.

Use dry_run=True to check parameter classification without executing.

Returns: dict with target, classification, outcomes (successes/errors), gas_profile.

# Dry run — check if function is fuzzable
info = sui_sandbox.fuzz_function("0x1", "u64", "max", dry_run=True)
print(f"Fuzzable: {info['classification']['is_fully_fuzzable']}")

# Full fuzz run
report = sui_sandbox.fuzz_function("0x1", "u64", "max", iterations=50, seed=42)
print(f"Successes: {report['outcomes']['successes']}")

import_state(*, state=None, transactions=None, objects=None, packages=None, cache_dir=None)

Import replay data from JSON/JSONL/CSV into a local replay cache.

sui_sandbox.import_state(
    transactions="exports/transactions.csv",
    objects="exports/objects.jsonl",
    packages="exports/packages.csv",
    cache_dir=".sui-cache",
)

deserialize_transaction(raw_bcs) / deserialize_package(bcs)

Decode raw BCS blobs into structured JSON for debugging or preprocessing.

replay(digest=None, *, rpc_url=..., source="hybrid", checkpoint=None, state_file=None, context_path=None, cache_dir=None, profile=None, fetch_strategy=None, vm_only=False, allow_fallback=True, prefetch_depth=3, prefetch_limit=200, auto_system_objects=True, no_prefetch=False, compare=False, analyze_only=False, synthesize_missing=False, self_heal_dynamic_fields=False, analyze_mm2=False, verbose=False)

Replay a historical Sui transaction locally with the Move VM.

Replay source modes:

  • checkpoint=... uses Walrus (no API key needed)
  • state_file=... replays from a local exported state file
  • source="local" (or cache_dir=...) replays from imported local cache
  • otherwise uses gRPC/hybrid (requires SUI_GRPC_API_KEY)

Use analyze_only=True to inspect state hydration without executing the transaction. Use analyze_mm2=True with analyze_only=True to include MM2 model diagnostics. Use profile="safe"|"balanced"|"fast" to tune runtime env defaults. Use fetch_strategy="eager"|"full" (eager implies no_prefetch=True). Use vm_only=True to force direct VM-path behavior (disables fallback).

Use compare=True to compare local execution results with on-chain effects. Use synthesize_missing=True to retry replay with synthetic bytes for missing object inputs. Use self_heal_dynamic_fields=True to enable dynamic field child fetchers during VM execution.

Returns: dict — replay envelope with:

  • local_success, execution_path, commands_executed
  • full replay fields (effects, optional comparison) when analyze_only=False
  • analysis summary when analyze_only=True

For backwards compatibility, analyze summary keys (commands, inputs, objects, packages, etc.) are also exposed at top level in analyze-only mode.

# Analyze state hydration only (no VM execution)
analysis = sui_sandbox.replay(
    "At8M8D7QoW3HHXUBHHvrsdhko8hEDdLAeqkZBjNSKFk2",
    checkpoint=239615926,
    analyze_only=True,
    analyze_mm2=True,
)
print(f"Commands: {analysis['analysis']['commands']}, Objects: {analysis['analysis']['objects']}")
print(f"MM2 ok: {analysis['analysis'].get('mm2_model_ok')}")

# Full replay via Walrus (no API key needed)
result = sui_sandbox.replay(
    "At8M8D7QoW3HHXUBHHvrsdhko8hEDdLAeqkZBjNSKFk2",
    checkpoint=239615926,
)
print(f"Success: {result['local_success']}")

# Full replay via local state file
result = sui_sandbox.replay(state_file="exports/replay_state.json")

# Full replay via local cache import
sui_sandbox.import_state(state="exports/replay_state.json", cache_dir=".sui-cache")
result = sui_sandbox.replay(digest="DigestHere...", source="local", cache_dir=".sui-cache")

# Full replay via gRPC with comparison
import os
os.environ["SUI_GRPC_API_KEY"] = "your-key"
result = sui_sandbox.replay("DigestHere...", compare=True)
if result.get("comparison"):
    print(f"Status match: {result['comparison']['status_match']}")

analyze_replay(...) (alias: replay_analyze(...))

First-class hydration/readiness analysis wrapper (equivalent to replay_transaction(..., analyze_only=True)).

analysis = sui_sandbox.analyze_replay(
    "At8M8D7QoW3HHXUBHHvrsdhko8hEDdLAeqkZBjNSKFk2",
    checkpoint=239615926,
    analyze_mm2=True,
)
print(analysis["analysis"]["missing_inputs"])
print(analysis["analysis"]["suggestions"])

replay_effects(...)

Execution-focused replay wrapper that returns effects/comparison/diagnostics plus a classification summary.

out = sui_sandbox.replay_effects(
    "At8M8D7QoW3HHXUBHHvrsdhko8hEDdLAeqkZBjNSKFk2",
    checkpoint=239615926,
    compare=True,
)
print(out["local_success"], out["effects"]["gas_used"])
print(out["classification"]["category"])

classify_replay_result(result)

Classify replay output into structured categories (missing_input_objects, archive_data_gap, move_abort, ...).

result = sui_sandbox.replay("DigestHere...", checkpoint=239615926)
classification = sui_sandbox.classify_replay_result(result)
print(classification["category"], classification["retryable"])

dynamic_field_diagnostics(...)

Analyze hydration-only replay twice (baseline no_prefetch=True vs prefetch-enabled) for the same digest/checkpoint and report dynamic-field related deltas.

diag = sui_sandbox.dynamic_field_diagnostics(
    "At8M8D7QoW3HHXUBHHvrsdhko8hEDdLAeqkZBjNSKFk2",
    checkpoint=239615926,
    prefetch_depth=3,
    prefetch_limit=200,
)
print(diag["likely_dynamic_field_dependency"])
print(diag["delta"]["objects_added_by_prefetch"])
print(diag["recommendations"])

context_replay(digest=None, *, checkpoint=None, discover_latest=None, discover_package_id=None, source=None, state_file=None, context_path=None, cache_dir=None, walrus_network="mainnet", ..., profile=None, fetch_strategy=None, vm_only=False, analyze_only=False, synthesize_missing=False, self_heal_dynamic_fields=False, analyze_mm2=False, rpc_url=...) (alias: replay_transaction)

Compact replay helper with source inference:

  • if checkpoint is set and source omitted, defaults to walrus
  • if cache_dir is set and source omitted, defaults to local
  • otherwise defaults to hybrid
  • if discover_latest is set, auto-discovers a digest/checkpoint for discover_package_id
out = sui_sandbox.context_replay(
    digest="At8M8D7QoW3HHXUBHHvrsdhko8hEDdLAeqkZBjNSKFk2",
    checkpoint=239615926,
    context_path="flow_context.json",
)
print(out["local_success"])

# Auto-discover a replay target from latest checkpoints
out = sui_sandbox.context_replay(
    discover_latest=5,
    discover_package_id="0x2",
    context_path="flow_context.json",
)
print(out["digest"], out["local_success"])

adapter_run(digest=None, *, protocol="generic", package_id=None, resolve_deps=True, context_path=None, checkpoint=None, discover_latest=None, source=None, state_file=None, cache_dir=None, walrus_network="mainnet", ..., profile=None, fetch_strategy=None, vm_only=False, analyze_only=False, synthesize_missing=False, self_heal_dynamic_fields=False, analyze_mm2=False, rpc_url=...) (alias: protocol_run)

One-call protocol flow: prepare context + replay.

out = sui_sandbox.adapter_run(
    digest="At8M8D7QoW3HHXUBHHvrsdhko8hEDdLAeqkZBjNSKFk2",
    protocol="deepbook",
    package_id="0x97d9473771b01f77b0940c589484184b49f6444627ec121314fae6a6d36fb86b",
    checkpoint=239615926,
    analyze_only=True,
)
print(out["local_success"], out["analysis"]["commands"])

# Protocol-first auto-discovery + replay
out = sui_sandbox.adapter_run(
    protocol="deepbook",
    package_id="0x97d9473771b01f77b0940c589484184b49f6444627ec121314fae6a6d36fb86b",
    discover_latest=5,
    analyze_only=True,
)
print(out["digest"], out["analysis"]["commands"])

OrchestrationSession (aliases: FlowSession, ContextSession)

In-memory two-step context helper for interactive usage:

  • prepare(...)
  • replay(...)
  • load_context(...) / save_context(...)
session = sui_sandbox.OrchestrationSession()
session.prepare("0x2")
out = session.replay(
    "At8M8D7QoW3HHXUBHHvrsdhko8hEDdLAeqkZBjNSKFk2",
    checkpoint=239615926,
)
print(out["local_success"])

# Auto-discover digest/checkpoint using prepared package context
out = session.replay(discover_latest=5, analyze_only=True)
print(out["digest"], out["analysis"]["commands"])

Platform Support

Pre-built wheels are available for:

  • Linux x86_64 (glibc 2.17+)
  • Linux aarch64 (glibc 2.17+)
  • macOS x86_64 (10.12+)
  • macOS aarch64 (11.0+)
  • Windows x86_64 (MSVC)

Building from source requires Rust 1.80+ and Python 3.9+.

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sui_sandbox-0.22.0.tar.gz (811.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

sui_sandbox-0.22.0-cp313-cp313-manylinux_2_28_x86_64.whl (9.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

sui_sandbox-0.22.0-cp313-cp313-manylinux_2_28_aarch64.whl (8.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

sui_sandbox-0.22.0-cp313-cp313-macosx_11_0_arm64.whl (8.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

sui_sandbox-0.22.0-cp313-cp313-macosx_10_12_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

sui_sandbox-0.22.0-cp312-cp312-manylinux_2_28_x86_64.whl (9.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

sui_sandbox-0.22.0-cp312-cp312-manylinux_2_28_aarch64.whl (8.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

sui_sandbox-0.22.0-cp312-cp312-macosx_11_0_arm64.whl (8.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

sui_sandbox-0.22.0-cp312-cp312-macosx_10_12_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

sui_sandbox-0.22.0-cp311-cp311-manylinux_2_28_x86_64.whl (9.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

sui_sandbox-0.22.0-cp311-cp311-manylinux_2_28_aarch64.whl (8.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

sui_sandbox-0.22.0-cp311-cp311-macosx_11_0_arm64.whl (8.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

sui_sandbox-0.22.0-cp311-cp311-macosx_10_12_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

sui_sandbox-0.22.0-cp310-cp310-manylinux_2_28_x86_64.whl (9.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

sui_sandbox-0.22.0-cp310-cp310-manylinux_2_28_aarch64.whl (8.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

sui_sandbox-0.22.0-cp310-cp310-macosx_11_0_arm64.whl (8.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

sui_sandbox-0.22.0-cp310-cp310-macosx_10_12_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

sui_sandbox-0.22.0-cp39-cp39-manylinux_2_28_x86_64.whl (9.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

sui_sandbox-0.22.0-cp39-cp39-manylinux_2_28_aarch64.whl (8.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

sui_sandbox-0.22.0-cp39-cp39-macosx_11_0_arm64.whl (8.3 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

sui_sandbox-0.22.0-cp39-cp39-macosx_10_12_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.9macOS 10.12+ x86-64

File details

Details for the file sui_sandbox-0.22.0.tar.gz.

File metadata

  • Download URL: sui_sandbox-0.22.0.tar.gz
  • Upload date:
  • Size: 811.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.15

File hashes

Hashes for sui_sandbox-0.22.0.tar.gz
Algorithm Hash digest
SHA256 dfbf79ff3f0ed451ec715968e81365ce5a96daa74dae25f2d3abbe2c7735f29d
MD5 2d14205490413f06a677b58e2df34b1d
BLAKE2b-256 b86f6f3c9228113c7bd9ff7ce6f1fff88ad6df495c2a650342d0e525919c604a

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 82cc4d8b9e114f09d6f7ee9f771a97d3151bdc18a3383b7fcdc3a4e0175ea27e
MD5 034d17bcaab02ef1a72949e5a2b40f96
BLAKE2b-256 132fa6fbad39a057fa4e573a874328f248ae33ca380724b0f067cfac02114f56

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 097c6a45846f2219d6d17ef7bdd1048f822ade63f4eddc746122a45bc730f7df
MD5 b0593b02103edc46737f2eaf27b5fab3
BLAKE2b-256 b2f29c99b38e475cdd2d924d75105533918c4db80e0dbeac71c4003fb4186a66

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 188d677db0f803535c7688f9d794b4127a03793bc5d74c2fd3c7245a72e1053b
MD5 6a8fbda729a21eac6cfe57aa2b7130e9
BLAKE2b-256 0a9cd0d9640023663f7f06ad441513eb71165a906e6a7a1f555c97e21ecb173e

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 be29e5ef2308e907b937ef361563360715e90f6a93a2562e6d34bfeccc26f66e
MD5 bf6107ebb10f30da5eee0524344e7267
BLAKE2b-256 b4f98c90b1019c63d444685efda65b8285ac931fe94ad196ca98fbc1a11f719d

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d04a42128e66f23f95c568ef4dd9bb14a8960f2727b51cfd73154ff54dac527e
MD5 65f8756669423cdbccad893a9728dda5
BLAKE2b-256 ac547e1a085bb13fb86ceb406412f25e14e4f0773e58304890b6effa01d8c3e7

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fa29c415942b877ea09a68e4c8ee1431b7a81ae8ee6b8e21b175f22a92157d9f
MD5 0ddc650ffd61cf1a56386ce4a40796ba
BLAKE2b-256 c7bdeb25d64f7de7006ba5f694b2e56e3506b56a20a70d62814c6fbcadc4e265

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ab8f3b8cd18cfb1d3a635a290c562abd9b92a93e91728d60e63a7ecfc660fa4
MD5 3b72c1620f1233e18df95c66cb316f8c
BLAKE2b-256 da0c8668c9116ebc05756a2521847b98a546860781c2149de79d90d87b47d23d

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9d352114038323c75070151b0552c88b8319eed9a11326208c9ea3269a5a0e8a
MD5 39d67ae06b5fef60d895a26e6cc2870d
BLAKE2b-256 431e024e38e889b55c0c5e3acb10bca604dd1a99940fbd7786f1f29759c55113

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2bb6aec48a18473a18c59fa101ecc58e8bd8664e52dc8032c92e8807e3f9af98
MD5 e99d51d1de97faffc764bbe9ea9fd42e
BLAKE2b-256 6e0b6829fce5993b239f3c6b7c37fd5b74415d25eb2a20cdf2c4bfd34350fad5

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 113c55954f512ea88a1c6749a53061361f38b46a82286469d53e52aff661c701
MD5 e6a6f513b5a72d86a6324a77f4afa2b8
BLAKE2b-256 80b9a43061d50c885a01b836691ee26ec77638d068b001ea3cb4fe98e8d01c3c

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a0ba23965a6ad556599599e0424e88ba5bfb7521682290bf84737c1fdf31864a
MD5 b6f379d4a5ac92ded3e179bf6c372321
BLAKE2b-256 991a059040bb1bf61e77aaaf97465b1b3140761469d1af8f4617a45035575f27

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5ae13756e9ca58b113fff4bccfa3cd0b3c18c886b8f53c8db90e55d9d19ea954
MD5 9ead787db9e99bde0df1784a3de963a9
BLAKE2b-256 aa90308ee572d4795d19ffe8522e66502e3a4d1a545ef78a91acc84597304884

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f79f2e05d38d3d92fcdf1b567efde1a5433b0dea131410cb3449990f8f2592f7
MD5 7adfe102d6d5eeaefedb84568b45d0c2
BLAKE2b-256 a7fc477e1f08c8977bd049aca2f2bc00496af0fae07e4b1ba660af41a1b3c935

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 36c11ddf58ab66c592005ffd09997f01763c344858b057dd1d5be55998a4d8a8
MD5 d72fe1b36718ff45b45f7000039f1382
BLAKE2b-256 e91bd79306852e704fa3911d3eb5aff3cf3cad322be8476a574d57f9d26013d9

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 15eeb03bf97b4eac8a175102e927e8e32b258772b5bcc46ded7540760e23766d
MD5 0415c3aae9a0c8d557775328688d8d62
BLAKE2b-256 be83b8177367343c20dc4d44152f93cb883e52fb89bc9d7d807417c26e6697de

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8311dfa1a2906bffeb4c8acfd67ec1d812c764f176d3826d4410072f7dac4d80
MD5 e83a2f969032b494d6b2db60de961391
BLAKE2b-256 89ef35c0f790df049d7636414d0c8939dcb0f85a2c2437ad4c5dc2b4e82b5795

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 05bf101391effb733b2875b650add7d0c445f8ee98ed3a1e1a6eae10cae0e194
MD5 a0dcd193b825cbd4935d2bfeb8f7967f
BLAKE2b-256 1a3f7ce3a0a3bbd4b5fbca61e2e98120a9afb4753eab212f7311a6ff61447051

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 66941f8abc7548735af08f2afd260a707501cc21debdf01cc2740462b63581af
MD5 646ba4ba031951aabe9a5142fbd579a4
BLAKE2b-256 d9ad5ba15169194bcf165f9c482a6fe8cb3e06e588cfa96b59612bdf9e71b455

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 625bc8f77c83b751649b984ff2643e65e388e7b7dde6696b2f00ade0aa8c5677
MD5 6bd3a1b8ac3efdb5816f51ea8326f379
BLAKE2b-256 9a979baa66d55b75718d5de527ffaa2fd49226ca9cfcf3258dc0e97c4eb8d862

See more details on using hashes here.

File details

Details for the file sui_sandbox-0.22.0-cp39-cp39-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for sui_sandbox-0.22.0-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4b5bc2ae9425375d6b73355e0ff53b9771e81c5197f0d23e751e592289960500
MD5 5f912bb065ab7e9b208bc9e2855cf3be
BLAKE2b-256 ae15017cc871d05eba0031277644c170bf11fbdc0522af21af17e2b5ae7303fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page