Skip to main content

Ghost Protocol Python SDK for GhostGate, telemetry, and direct GhostWire escrow.

Project description

GhostGate Python SDK

Python SDK for Ghost Protocol gate access, telemetry, and direct GhostWire helpers.

Install

pip install ghostgate-sdk

Quickstart

import os
from ghostgate import GhostGate

sdk = GhostGate(
    api_key=os.environ["GHOST_API_KEY"],
    private_key=os.environ["GHOST_SIGNER_PRIVATE_KEY"],
    base_url=os.getenv("GHOST_GATE_BASE_URL", "https://ghostprotocol.cc"),
    chain_id=8453,
    service_slug="agent-18755",
    credit_cost=1,
    # Optional x402 compatibility mode:
    # auth_mode="x402",
    # x402_scheme="ghost-eip712-credit-v1",
)

result = sdk.connect()
print(result)

quote = sdk.create_wire_quote(
    client="0xclient...",
    provider="0xprovider...",
    evaluator="0xevaluator...",
    principal_amount="1000000",
    chain_id=8453,
)

prepared = sdk.prepare_wire_job(
    quote_id=quote["quoteId"],
    client="0xclient...",
    provider="0xprovider...",
    evaluator="0xevaluator...",
    spec_hash="0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    metadata_uri="https://merchant.example.com/ghostwire/deliverable?jobId=wj_123",
)

# Client wallet sends prepared["direct"]["createTxRequest"] here, then reports the hash:
after_create = sdk.record_wire_artifacts(
    job_id=prepared["jobId"],
    client_address="0xclient...",
    create_tx_hash="0xcreate...",
)

# Client wallet sends after_create["direct"]["setBudgetTxRequest"] and
# after_create["direct"]["fundTxRequest"] here, then reports the funding hash.
sdk.record_wire_artifacts(
    job_id=prepared["jobId"],
    client_address="0xclient...",
    fund_tx_hash="0xfund...",
)

Canonical methods

  • connect(...)
  • pulse(...)
  • outcome(...)
  • start_heartbeat(...)
  • create_wire_quote(...)
  • prepare_wire_job(...)
  • record_wire_artifacts(...)
  • get_wire_job(...)
  • wait_for_wire_terminal(...)
  • get_wire_deliverable(...)

Backward-compatible aliases are also available:

  • send_pulse(...)
  • report_consumer_outcome(...)

Security note

Use signer private keys only in trusted backend/server/CLI environments. Never expose private keys in frontend code.

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

ghostgate_sdk-0.1.2.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

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

ghostgate_sdk-0.1.2-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file ghostgate_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: ghostgate_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ghostgate_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6b15f72d7b00ee4ff535f56354dfa21f5780917fb834f337288f679d6c6992e7
MD5 0a3540edd4e45031e5eb694cc64d06fe
BLAKE2b-256 4d1a230162b145cbf9ed35b42656bc411e02c5b2bd0b1144ae791154ba33793d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghostgate_sdk-0.1.2.tar.gz:

Publisher: publish-python-sdk.yml on Ghost-Protocol-Infrastructure/GHOST_PROTOCOL

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ghostgate_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ghostgate_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ghostgate_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8ad6fe6c6d5266d022911b5f9b6ab6d53d6428bb030ee26e9fbeecb457c12a07
MD5 da80135e48bd97c3f3066c5e6c574dd4
BLAKE2b-256 55810a4f6fed243e186806fcbbc2dc1e6a7dea51ab5fe2873925d290881e21be

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghostgate_sdk-0.1.2-py3-none-any.whl:

Publisher: publish-python-sdk.yml on Ghost-Protocol-Infrastructure/GHOST_PROTOCOL

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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