{
  "package": "@0xclearinghouse/core",
  "version": "0.1.0",
  "publishedVersion": "0.0.1",
  "ready": false,
  "install": "npm install @0xclearinghouse/core",
  "runtime": {
    "node": ">=22",
    "formats": [
      "esm",
      "cjs"
    ],
    "dependencies": 0
  },
  "import": "import { Clearinghouse, createExecutor } from \"@0xclearinghouse/core\";",
  "exports": [
    {
      "name": "Address",
      "kind": "type",
      "signature": "type Address = `0x${string}`",
      "file": "types.ts"
    },
    {
      "name": "chainConfig",
      "kind": "function",
      "signature": "function chainConfig(chain: ChainName): ChainConfig",
      "file": "chains.ts"
    },
    {
      "name": "ChainConfig",
      "kind": "interface",
      "signature": "interface ChainConfig",
      "file": "chains.ts"
    },
    {
      "name": "ChainName",
      "kind": "type",
      "signature": "type ChainName = \"base\" | \"arbitrum\" | \"optimism\"",
      "file": "types.ts"
    },
    {
      "name": "CHAINS",
      "kind": "const",
      "signature": "const CHAINS: Record<ChainName, ChainConfig>",
      "file": "chains.ts"
    },
    {
      "name": "ChargeInput",
      "kind": "interface",
      "signature": "interface ChargeInput",
      "file": "types.ts"
    },
    {
      "name": "Clearinghouse",
      "kind": "class",
      "signature": "class Clearinghouse",
      "file": "clearinghouse.ts"
    },
    {
      "name": "ClearinghouseOptions",
      "kind": "interface",
      "signature": "interface ClearinghouseOptions",
      "file": "clearinghouse.ts"
    },
    {
      "name": "createExecutor",
      "kind": "function",
      "signature": "function createExecutor(options: ExecutorOptions):",
      "file": "executor.ts"
    },
    {
      "name": "decodeTransferLog",
      "kind": "function",
      "signature": "function decodeTransferLog(log: RawLog): TransferEvent | null",
      "file": "executor.ts"
    },
    {
      "name": "DEFAULT_CHAIN",
      "kind": "const",
      "signature": "const DEFAULT_CHAIN: ChainName = \"base\"",
      "file": "chains.ts"
    },
    {
      "name": "DEFAULT_FEE_BPS",
      "kind": "const",
      "signature": "const DEFAULT_FEE_BPS = 50",
      "file": "settlement.ts"
    },
    {
      "name": "DEFAULT_MAX_AGE_MS",
      "kind": "const",
      "signature": "const DEFAULT_MAX_AGE_MS = 12 * 60 * 60 * 1000",
      "file": "settlement.ts"
    },
    {
      "name": "DEFAULT_THRESHOLD",
      "kind": "const",
      "signature": "const DEFAULT_THRESHOLD = 1_000_000n",
      "file": "settlement.ts"
    },
    {
      "name": "encodeTransfer",
      "kind": "function",
      "signature": "function encodeTransfer(to: Address, amount: bigint): `0x$",
      "file": "executor.ts"
    },
    {
      "name": "ExecutorOptions",
      "kind": "interface",
      "signature": "interface ExecutorOptions",
      "file": "executor.ts"
    },
    {
      "name": "feeFor",
      "kind": "function",
      "signature": "function feeFor(gross: bigint, feeBps: number): bigint",
      "file": "settlement.ts"
    },
    {
      "name": "hasMatchingTransfer",
      "kind": "function",
      "signature": "function hasMatchingTransfer( logs: readonly RawLog[], token: Address, from: Address, to: Address, amount: bigint, ): boolean",
      "file": "executor.ts"
    },
    {
      "name": "isChainName",
      "kind": "function",
      "signature": "function isChainName(value: string): value is ChainName",
      "file": "chains.ts"
    },
    {
      "name": "isDue",
      "kind": "function",
      "signature": "function isDue(tab: Tab, config: ThresholdConfig, now: number): boolean",
      "file": "settlement.ts"
    },
    {
      "name": "MemoryLedger",
      "kind": "class",
      "signature": "class MemoryLedger implements TabLedger",
      "file": "ledger.ts"
    },
    {
      "name": "ONE_USDC",
      "kind": "const",
      "signature": "const ONE_USDC = 1_000_000n",
      "file": "types.ts"
    },
    {
      "name": "planSettlement",
      "kind": "function",
      "signature": "function planSettlement( tabs: readonly Tab[], config: ThresholdConfig, now: number = Date.now(), ): SettlementPlan",
      "file": "settlement.ts"
    },
    {
      "name": "RawLog",
      "kind": "interface",
      "signature": "interface RawLog",
      "file": "executor.ts"
    },
    {
      "name": "SETTLEMENT_ERRORS",
      "kind": "const",
      "signature": "const SETTLEMENT_ERRORS = [ { code: \"broadcast_failed\", outcome: \"unknown\", meaning: \"sendTransaction threw",
      "file": "executor.ts"
    },
    {
      "name": "SettlementError",
      "kind": "class",
      "signature": "class SettlementError extends Error",
      "file": "executor.ts"
    },
    {
      "name": "SettlementErrorCode",
      "kind": "type",
      "signature": "type SettlementErrorCode = (typeof SETTLEMENT_ERRORS)[number][\"code\"]",
      "file": "executor.ts"
    },
    {
      "name": "SettlementExecutor",
      "kind": "interface",
      "signature": "interface SettlementExecutor",
      "file": "types.ts"
    },
    {
      "name": "SettlementOutcome",
      "kind": "type",
      "signature": "type SettlementOutcome = (typeof SETTLEMENT_ERRORS)[number][\"outcome\"]",
      "file": "executor.ts"
    },
    {
      "name": "SettlementPlan",
      "kind": "interface",
      "signature": "interface SettlementPlan",
      "file": "types.ts"
    },
    {
      "name": "SettlementPlanEntry",
      "kind": "interface",
      "signature": "interface SettlementPlanEntry",
      "file": "types.ts"
    },
    {
      "name": "SettlementReceipt",
      "kind": "interface",
      "signature": "interface SettlementReceipt",
      "file": "types.ts"
    },
    {
      "name": "SettlementSigner",
      "kind": "interface",
      "signature": "interface SettlementSigner",
      "file": "executor.ts"
    },
    {
      "name": "Tab",
      "kind": "interface",
      "signature": "interface Tab",
      "file": "types.ts"
    },
    {
      "name": "tabKey",
      "kind": "function",
      "signature": "function tabKey(payer: Address, payee: Address): string",
      "file": "ledger.ts"
    },
    {
      "name": "TabLedger",
      "kind": "interface",
      "signature": "interface TabLedger",
      "file": "ledger.ts"
    },
    {
      "name": "ThresholdConfig",
      "kind": "interface",
      "signature": "interface ThresholdConfig",
      "file": "settlement.ts"
    },
    {
      "name": "TRANSFER_TOPIC",
      "kind": "const",
      "signature": "const TRANSFER_TOPIC = \"0x…\"",
      "file": "executor.ts"
    },
    {
      "name": "TransferEvent",
      "kind": "interface",
      "signature": "interface TransferEvent",
      "file": "executor.ts"
    },
    {
      "name": "USDC_DECIMALS",
      "kind": "const",
      "signature": "const USDC_DECIMALS = 6",
      "file": "types.ts"
    }
  ],
  "errors": {
    "note": "Branch on `outcome`, not on the message. failed = no value moved, re-planning is safe. unknown = reconcile on-chain before retrying, or you can pay twice.",
    "codes": [
      {
        "code": "broadcast_failed",
        "outcome": "unknown",
        "meaning": "sendTransaction threw; the transaction may or may not have reached the network"
      },
      {
        "code": "receipt_unavailable",
        "outcome": "unknown",
        "meaning": "the transaction was broadcast but no receipt arrived; it may still be pending"
      },
      {
        "code": "reverted",
        "outcome": "failed",
        "meaning": "the transaction was mined and reverted; no value moved"
      },
      {
        "code": "transfer_unverified",
        "outcome": "unknown",
        "meaning": "the receipt reported success but contains no matching Transfer log"
      }
    ]
  },
  "docs": {
    "quickstart": "https://0xclearinghouse.xyz/quickstart.html",
    "settlement": "https://github.com/0xclearinghouse/0xclearinghouse-protocol/blob/main/docs/SETTLEMENT.md",
    "testPlan": "https://github.com/0xclearinghouse/0xclearinghouse-protocol/blob/main/docs/TEST-PLAN.md",
    "examples": "https://0xclearinghouse.xyz/examples/"
  }
}
