diff --git a/docs/superpowers/plans/2026-06-18-tracker-anchor-gate-matching.md b/docs/superpowers/plans/2026-06-18-tracker-anchor-gate-matching.md new file mode 100644 index 0000000..9b430b8 --- /dev/null +++ b/docs/superpowers/plans/2026-06-18-tracker-anchor-gate-matching.md @@ -0,0 +1,297 @@ +# Tracker Anchor-Gate Matching + Resilience Port — Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Port tx3-lift's anchor-gate matching + scoring/ranking (`7e8bc32`), the bundled upstream resilience, and the `utxorpc-spec 0.19.2` bump into the registry's Postgres tracker fork, fixing transaction over-matching. + +**Architecture:** The registry tracker is a Postgres fork of `tx3-lift/bin/tracker`. The matching *library* (`tx3-lift`, `tx3-lift-cardano`) arrives via a git `rev` bump; the tracker-level logic (gating, scoring, selection, config, schema, store, reconnect loop) is ported by hand against the registry's async `sqlx` store and OCI discovery startup. + +**Tech Stack:** Rust, `sqlx` (Postgres), `tonic`/`prost` (gRPC utxorpc), `tokio`. Tests via `#[sqlx::test]` (ephemeral Postgres) + Cargo unit tests. + +## Reference + +The canonical source for every port is the `tx3-lift` repository +(`https://github.com/tx3-lang/tx3-lift`) at commit +`7e8bc320a7b9680eb4e1cfbdf8efd5b8ec152938` (`7e8bc32`), with the +`utxorpc-spec 0.19.2` predicate fix at `842df42`. Read the referenced upstream +file for each task (from a local `tx3-lift` checkout) and adapt it to the +registry types noted in the task. + +## Global Constraints + +- Pin `tx3-lift` and `tx3-lift-cardano` to `rev = "827b499d6f790b19b235b4ed370d9343a226fedd"` (HEAD of tx3-lift `main`; library bytes identical to `7e8bc32`/`842df42`). +- `utxorpc-spec = "0.19.2"` exactly; `Cargo.lock` must resolve `0.19.2`. +- All work happens in the `tracker/` crate. Do not touch `backend/`, `frontend/`, or the registry's `discovery.rs`. +- Library symbols available after Task 1: `tx3_lift::ProtocolAnchors`, `tx3_lift::AnchorHits`, `tx3_lift::fingerprint::Fingerprint::information_score(&self) -> usize`. +- `MatchMode` default is `All` (preserves current persistence behavior; over-matching is suppressed by opting into `"best"`). +- DB-backed tests require `DATABASE_URL` pointing at a reachable Postgres; `#[sqlx::test(migrations = "./migrations")]` provisions an ephemeral DB per test. +- Branch: `feat/tracker-anchor-gate-matching` (already created; the design spec is committed there). +- Per project preference, do **not** run `lint`/`lint:fix`; use `cargo build` / `cargo test` / `cargo clippy` as gates. Use the existing toolchain; this is a Cargo crate (no pnpm here). + +## File map + +| File | Action | Responsibility | +|---|---|---| +| `tracker/Cargo.toml` | modify | bump revs + `utxorpc-spec` | +| `tracker/Cargo.lock` | modify | resolve `0.19.2` | +| `tracker/src/upstream/predicate.rs` | modify | `Option` pattern fields | +| `tracker/src/config.rs` | modify | `[matching]` block, `MatchMode` | +| `tracker/src/specialization.rs` | modify | `anchors` field + empty-anchor exclusion | +| `tracker/migrations/20260618000001_add_score_rank.sql` | create | `score` / `match_rank` columns | +| `tracker/src/store.rs` | modify | persist `score` / `match_rank` | +| `tracker/src/process.rs` | modify | gate + score + `select_matches` | +| `tracker/src/upstream/retry.rs` | create | `is_transient`, `Backoff` | +| `tracker/src/upstream/mod.rs` | modify | `pub mod retry` + keepalives | +| `tracker/src/lib.rs` | modify | reconnect loop, `SessionOutcome`, pass `mode` | +| `tracker/tests/source_anchors.rs` | create | anchor extraction + exclusion | +| `tracker/tests/over_matching_regression.rs` | create | regression on real CBOR | +| `tracker/tests/gating_real_txs.rs` | create | anchor-strength gating | +| `tracker/tests/store_idempotency.rs` | modify | cover `score` / `match_rank` | +| `tracker/tests/fixtures/*.cbor.hex` | create | copied from tx3-lift | + +--- + +### Task 1: Dependency + utxorpc 0.19.2 bump + predicate fix + +**Files:** +- Modify: `tracker/Cargo.toml` (lines 18–19 revs; line 24 `utxorpc-spec`) +- Modify: `tracker/Cargo.lock` +- Modify: `tracker/src/upstream/predicate.rs:24,35,45` + +**Interfaces:** +- Produces: library symbols `tx3_lift::{ProtocolAnchors, AnchorHits}` and `Fingerprint::information_score(&self) -> usize` become available to later tasks; build resolves `utxorpc-spec 0.19.2`. + +- [ ] **Step 1: Bump dependencies.** In `tracker/Cargo.toml`, set both `tx3-lift` and `tx3-lift-cardano` `rev` to `827b499d6f790b19b235b4ed370d9343a226fedd`, and `utxorpc-spec` from `"0.19"` to `"0.19.2"`. + +- [ ] **Step 2: Verify the bump breaks the build (the failing state).** + Run: `cd tracker && cargo update -p utxorpc-spec --precise 0.19.2 && cargo build` + Expected: FAIL — `predicate.rs` errors because `exact_address` / `policy_id` are now `Option` (mismatched types: expected `Option<_>`, found `Bytes`). + +- [ ] **Step 3: Apply the predicate fix.** In `tracker/src/upstream/predicate.rs`, wrap the three pattern byte fields in `Some(...)`: `exact_address: Some(Bytes::from(bytes))` (line ~24), and both `policy_id: Some(Bytes::from(bytes))` (lines ~35 and ~45). This mirrors `842df42` exactly. + +- [ ] **Step 4: Verify build + existing tests pass.** + Run: `cd tracker && cargo build && cargo test` + Expected: PASS — build clean; all pre-existing tests green (no behavior change yet). Confirm `cargo tree -p utxorpc-spec` shows `0.19.2`. + +- [ ] **Step 5: Commit.** + `git add tracker/Cargo.toml tracker/Cargo.lock tracker/src/upstream/predicate.rs` + `git commit -m "chore(tracker): bump tx3-lift rev + utxorpc-spec 0.19.2"` + +--- + +### Task 2: `[matching]` config + `MatchMode` + +**Files:** +- Modify: `tracker/src/config.rs` (add `MatchingConfig`, `MatchMode`, `Config.matching` field; add `#[cfg(test)] mod tests`) + +**Interfaces:** +- Produces: + - `pub enum MatchMode { All, Best }` — `#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Deserialize, Serialize)]`, `#[serde(rename_all = "lowercase")]`, `#[default] All`. + - `pub struct MatchingConfig { pub mode: MatchMode }` — `#[derive(Default, ...)]`, `mode` is `#[serde(default)]`. + - `Config` gains `#[serde(default)] pub matching: MatchingConfig`. +- Consumed by: Task 5 (`process::apply_tx` takes `MatchMode`) and Task 6 (`lib.rs` reads `cfg.matching.mode`). + +- [ ] **Step 1: Write the failing tests.** In `tracker/src/config.rs` add a `#[cfg(test)] mod tests` with four cases (adapt the upstream `config.rs` tests at `7e8bc32` to the registry's minimal config shape — use the registry's required keys, e.g. `[storage] database_url`, `[upstream] endpoint`, and the registry's `[oci]`/profile keys as needed): + - `matching_defaults_to_all_when_block_omitted` — config without `[matching]` → `cfg.matching.mode == MatchMode::All`. + - `matching_mode_best_is_parsed` — `[matching]\nmode = "best"` → `MatchMode::Best`. + - `matching_mode_all_is_parsed` — `mode = "all"` → `MatchMode::All`. + - `matching_mode_unknown_value_fails` — `mode = "bogus"` → parse `Result` is `Err`. + +- [ ] **Step 2: Run tests to verify they fail.** + Run: `cd tracker && cargo test --lib config::tests` + Expected: FAIL to compile — `MatchMode` / `matching` not defined. + +- [ ] **Step 3: Implement `MatchMode`, `MatchingConfig`, and the `Config.matching` field** as specified in the Interfaces block. Reference: `git show 7e8bc32 -- bin/tracker/src/config.rs`. + +- [ ] **Step 4: Run tests to verify they pass.** + Run: `cd tracker && cargo test --lib config::tests` + Expected: PASS — all four cases. + +- [ ] **Step 5: Commit.** + `git add tracker/src/config.rs` + `git commit -m "feat(tracker): add [matching] config with MatchMode"` + +--- + +### Task 3: Specialization anchors + empty-anchor exclusion + +**Files:** +- Modify: `tracker/src/specialization.rs` +- Test: `tracker/tests/source_anchors.rs` (create) + +**Interfaces:** +- Consumes: `tx3_lift::ProtocolAnchors` (Task 1). +- Produces: `SpecializedTii` gains `pub anchors: ProtocolAnchors`. `specialize_all` returns only sources with non-empty anchors. + +- [ ] **Step 1: Write the failing integration test.** In `tracker/tests/source_anchors.rs`, build `DiscoveredSource`s from TII fixtures (reuse the registry's existing discovery test helpers / a TII the registry already tests against) and assert: + - a source whose profile has party addresses / policy ids / utxo refs yields `specialized.anchors.is_empty() == false` and is **present** in `specialize_all`'s output; + - a source whose profile yields zero anchors is **absent** from the output (excluded). + Reference for the anchor extraction expectations: `git show 7e8bc32 -- bin/tracker/tests/source_anchors.rs` and `crates/tx3-lift/src/anchors.rs`. + +- [ ] **Step 2: Run test to verify it fails.** + Run: `cd tracker && cargo test --test source_anchors` + Expected: FAIL to compile — `SpecializedTii` has no `anchors` field. + +- [ ] **Step 3: Implement.** In `specialize_one`, after `lookup_profile`, compute `let anchors = ProtocolAnchors::from_profile(profile)?;` and set it on the returned `SpecializedTii`. In `specialize_all`, skip any source where `specialized.anchors.is_empty()` with a `warn!(source=…, profile=…, "profile has no parties or recognizable environment anchors; matching disabled for this source")` and `continue`. Keep the registry's `DiscoveredSource` input and `repo_scope`/`repo_name`/`repo_version` fields. Reference: `bin/tracker/src/specialization.rs` at `7e8bc32`. + +- [ ] **Step 4: Run test to verify it passes.** + Run: `cd tracker && cargo test --test source_anchors` + Expected: PASS. + +- [ ] **Step 5: Commit.** + `git add tracker/src/specialization.rs tracker/tests/source_anchors.rs` + `git commit -m "feat(tracker): derive protocol anchors per source, exclude anchorless sources"` + +--- + +### Task 4: Store `score` / `match_rank` + migration + +**Files:** +- Create: `tracker/migrations/20260618000001_add_score_rank.sql` +- Modify: `tracker/src/store.rs` (`OwnedMatchRow` struct + the `INSERT INTO matches` statement and its binds) +- Test: `tracker/tests/store_idempotency.rs` (modify) + +**Interfaces:** +- Produces: `OwnedMatchRow` gains `pub score: u32` and `pub match_rank: u32`. `apply_block` persists both (bound as `i64`). +- Consumed by: Task 5 (constructs `OwnedMatchRow` with `score` / `match_rank`). + +- [ ] **Step 1: Create the migration.** `tracker/migrations/20260618000001_add_score_rank.sql`: + ```sql + ALTER TABLE matches ADD COLUMN score INTEGER NOT NULL DEFAULT 0; + ALTER TABLE matches ADD COLUMN match_rank INTEGER NOT NULL DEFAULT 1; + ``` + +- [ ] **Step 2: Write/extend the failing test.** In `tracker/tests/store_idempotency.rs`, extend `sample_match_row()` to set `score` and `match_rank`, and add a `#[sqlx::test(migrations = "./migrations")]` test `apply_block_persists_score_and_rank` that inserts a row then `SELECT score, match_rank FROM matches WHERE tx_hash = $1` and asserts the persisted values match. Keep the existing idempotency assertions. + +- [ ] **Step 3: Run test to verify it fails.** + Run: `cd tracker && cargo test --test store_idempotency` + Expected: FAIL to compile — `OwnedMatchRow` has no `score` / `match_rank` fields. + +- [ ] **Step 4: Implement.** Add `score: u32` and `match_rank: u32` to `OwnedMatchRow`; extend the `INSERT INTO matches (… , score, match_rank)` column list and `VALUES (… , $12, $13)`; add `.bind(row.score as i64).bind(row.match_rank as i64)`. Reference: `git show 7e8bc32 -- bin/tracker/src/store.rs` (adapt SQLite→sqlx; the sqlx migration runner needs no transaction wrapper). + +- [ ] **Step 5: Run test to verify it passes.** + Run: `cd tracker && cargo test --test store_idempotency` + Expected: PASS (requires `DATABASE_URL`). + +- [ ] **Step 6: Commit.** + `git add tracker/migrations/20260618000001_add_score_rank.sql tracker/src/store.rs tracker/tests/store_idempotency.rs` + `git commit -m "feat(tracker): persist match score and rank"` + +--- + +### Task 5: Gate + score + `select_matches` in `process.rs` + +**Files:** +- Modify: `tracker/src/process.rs` (rewrite `run_specializations`; thread `mode` through `apply_tx`; add `#[cfg(test)] mod tests`) + +**Interfaces:** +- Consumes: `config::MatchMode` (Task 2), `SpecializedTii.anchors` (Task 3), `OwnedMatchRow { score, match_rank }` (Task 4), `AnchorHits::{gating, total, gates}` + `Fingerprint::information_score` (Task 1). +- Produces: + - `pub async fn apply_tx(any_tx, specialized, lifter, store, mode: MatchMode) -> Result<()>` (new trailing `mode` param). + - private `fn select_matches(candidates: Vec>, mode: MatchMode) -> Vec>` (pure). + - Persisted `OwnedMatchRow.score = hits.total + fp.information_score()`, `match_rank` = dense 1-based rank. + +- [ ] **Step 1: Write the failing pure-selection tests.** Port the 8 `select_matches` unit tests verbatim from `bin/tracker/src/process.rs` at `7e8bc32` into a `#[cfg(test)] mod tests` in `tracker/src/process.rs` (they are chain-agnostic and depend only on `Candidate`/`Ranked`/`MatchMode`): `within_source_keeps_higher_score`, `within_source_tie_breaks_alphabetically`, `within_source_keeps_exactly_one_per_source`, `cross_source_assigns_dense_ranks`, `single_candidate_ranks_one`, `mode_best_keeps_all_rank_one_rows`, `mode_all_keeps_every_row`, `empty_candidates_yield_empty_result`. + +- [ ] **Step 2: Run tests to verify they fail.** + Run: `cd tracker && cargo test --lib process::tests` + Expected: FAIL to compile — `select_matches`, `Candidate`, `Ranked` not defined. + +- [ ] **Step 3: Implement the gate + score + selection.** Rewrite `run_specializations` per the spec §"Matching port": summarize once; per source apply the anchor gate `if !spec.anchors.hits(&summary).gates() { continue; }`; per matching `tx_name` compute `score = u32::try_from(hits.total + fp.information_score()).unwrap_or(u32::MAX)` and collect a `Candidate` (defer lifting); run `select_matches(candidates, mode)`; lift only survivors; build `OwnedMatchRow` with `score` + `match_rank`. Add the `Candidate`/`Ranked`/`LiftInputs` structs and the pure `select_matches`. Thread `mode: MatchMode` through `run_specializations` and `apply_tx`. Reference: `bin/tracker/src/process.rs` at `7e8bc32` (adapt to the registry's async `Store`, `OwnedMatchRow` repo fields, and registry imports). + +- [ ] **Step 4: Run tests + full build.** + Run: `cd tracker && cargo test --lib process::tests && cargo build` + Expected: PASS — 8 selection tests green; crate builds (note `apply_tx`'s new `mode` arg will make `lib.rs` fail to build until Task 6 — acceptable here only if `lib.rs` is updated in the same step; otherwise build `--lib` excludes the bin... see Step 5). + +- [ ] **Step 5: Keep the crate compiling.** Update the single `process::apply_tx(...)` call site in `tracker/src/lib.rs` to pass `cfg.matching.mode` (minimal change; the full reconnect restructure is Task 6). + Run: `cd tracker && cargo build && cargo test` + Expected: PASS. + +- [ ] **Step 6: Commit.** + `git add tracker/src/process.rs tracker/src/lib.rs` + `git commit -m "feat(tracker): anchor-gate matches, score and rank candidates"` + +--- + +### Task 6: Upstream resilience — retry module, keepalives, reconnect loop + +**Files:** +- Create: `tracker/src/upstream/retry.rs` +- Modify: `tracker/src/upstream/mod.rs` (`pub mod retry;` + `connect()` keepalives) +- Modify: `tracker/src/lib.rs` (`run()` reconnect loop, `SessionOutcome`, `Backoff`) + +**Interfaces:** +- Consumes: `process::apply_tx(..., mode)` (Task 5), `cfg.matching.mode` (Task 2). +- Produces: + - `pub fn upstream::retry::is_transient(code: tonic::Code) -> bool`. + - `pub struct upstream::retry::Backoff` with `new(initial: Duration, max: Duration)`, `next_delay(&mut self) -> Duration`, `reset(&mut self)`. + - private `enum SessionOutcome { Shutdown, Reconnect }` + `async fn stream_session(...) -> Result` in `lib.rs`. + +- [ ] **Step 1: Write the failing retry tests.** Create `tracker/src/upstream/retry.rs` test module by porting the 4 tests verbatim from `bin/tracker/src/upstream/retry.rs` at `7e8bc32`: `transport_codes_reconnect`, `config_and_auth_codes_are_fatal`, `backoff_doubles_and_caps`, `backoff_reset_returns_to_initial`. + +- [ ] **Step 2: Run tests to verify they fail.** + Run: `cd tracker && cargo test --lib upstream::retry` + Expected: FAIL to compile — `is_transient` / `Backoff` not defined. + +- [ ] **Step 3: Implement `retry.rs`** (`is_transient` + `Backoff`) verbatim from the reference, and add `pub mod retry;` to `tracker/src/upstream/mod.rs`. + Run: `cd tracker && cargo test --lib upstream::retry` + Expected: PASS. + +- [ ] **Step 4: Add channel keepalives.** In `tracker/src/upstream/mod.rs` `connect()`, chain `.http2_keep_alive_interval(Duration::from_secs(20)).keep_alive_timeout(Duration::from_secs(20)).keep_alive_while_idle(true).tcp_keepalive(Some(Duration::from_secs(60)))` onto the `Channel::from_shared(...)` builder (before the TLS branch). Reference: `git show 7e8bc32 -- bin/tracker/src/upstream/mod.rs`. + +- [ ] **Step 5: Restructure `run()` into a reconnect loop.** In `tracker/src/lib.rs`: extract `stream_session(...) -> Result`; add `enum SessionOutcome { Shutdown, Reconnect }`; in `run()` create `Backoff::new(Duration::from_secs(1), Duration::from_secs(30))`, loop: recompute `intersect` from the persisted cursor each iteration (fallback to configured intersect), call `stream_session`, on `Reconnect` `warn!` + interruptible `sleep(backoff.next_delay())`, on `Shutdown` break. In `stream_session`: a `connect()` `Error::TonicTransport` → `Reconnect`, other `connect()` errors fatal; `watch_tx`/stream status → `Reconnect` iff `is_transient`, else fatal; `backoff.reset()` on first healthy message; pass `cfg.matching.mode` to `apply_tx`. Reference: `git show 7e8bc32 -- bin/tracker/src/main.rs` (the registry's loop lives in `lib.rs::run`; keep the registry startup — Postgres `Store`, `fetch_catalog`, `specialize_all` — intact). + Note: confirm the registry `Error` enum has a transport variant matching tonic transport errors (the upstream uses `Error::TonicTransport`); if the registry names it differently, match `connect()`'s actual error type. Adjust the variant name to whatever `connect()` already returns. + +- [ ] **Step 6: Build + full test.** + Run: `cd tracker && cargo build && cargo test` + Expected: PASS — crate builds; retry unit tests + all prior tests green. + +- [ ] **Step 7: Commit.** + `git add tracker/src/upstream/retry.rs tracker/src/upstream/mod.rs tracker/src/lib.rs` + `git commit -m "feat(tracker): reconnect with backoff and http2 keepalives"` + +--- + +### Task 7: Ported regression tests + fixtures + +**Files:** +- Create: `tracker/tests/over_matching_regression.rs` +- Create: `tracker/tests/gating_real_txs.rs` +- Create: `tracker/tests/fixtures/*.cbor.hex` (copy from tx3-lift) + +**Interfaces:** +- Consumes: the full matching pipeline (`apply_tx`, `run_specializations`, store) from Tasks 3–6. + +- [ ] **Step 1: Copy fixtures.** Copy the `.cbor.hex` fixtures used by the upstream tests into `tracker/tests/fixtures/` (`dex_swap_iusd_06a73a03.cbor.hex`, `indigo_create_staking_c54778b4.cbor.hex`, `sp_deposit_71e89010.cbor.hex`, and any others referenced by `bin/tracker/tests/over_matching_regression.rs` / `gating_real_txs.rs` / `source_anchors.rs` at `7e8bc32`). + +- [ ] **Step 2: Write `gating_real_txs.rs`.** `#[sqlx::test]` tests asserting anchor-strength gating on real txs: a tx with only a *soft* presence for a source does not gate (no row); a tx that forces a source's script (spend-from-script / mint / script-ref / datum output) gates and produces a row. Port the assertions from `bin/tracker/tests/gating_real_txs.rs` at `7e8bc32`, adapting the store/lookup to the registry's Postgres `Store`. + +- [ ] **Step 3: Write `over_matching_regression.rs`.** `#[sqlx::test]` test(s) that drive a known-ambiguous transaction through the pipeline against multiple specialized sources and assert: + - under `MatchMode::Best`, exactly the intended source(s) survive (rank-1), and the previously-spurious cross-protocol matches are absent; + - under `MatchMode::All`, every gated candidate persists with a dense `match_rank`; + - persisted `score` ordering matches expectation. + Port the scenario + fixtures from `bin/tracker/tests/over_matching_regression.rs` at `7e8bc32`, adapting persistence assertions to `SELECT … FROM matches`. + +- [ ] **Step 4: Run the full integration suite.** + Run: `cd tracker && cargo test` + Expected: PASS — all unit + integration tests green (requires `DATABASE_URL`). + +- [ ] **Step 5: Commit.** + `git add tracker/tests/over_matching_regression.rs tracker/tests/gating_real_txs.rs tracker/tests/fixtures` + `git commit -m "test(tracker): regression for anchor-gate over-matching"` + +--- + +## Final verification (after Task 7) + +- [ ] `cd tracker && cargo build && cargo clippy && cargo test` all green with `DATABASE_URL` set. +- [ ] `cargo tree -p utxorpc-spec` resolves `0.19.2`. +- [ ] Acceptance criteria 1–6 from the spec hold (see `docs/superpowers/specs/2026-06-18-tracker-anchor-gate-matching-design.md`). +- [ ] Open the PR from `feat/tracker-anchor-gate-matching` referencing the spec. + +## Notes / risks (verify during implementation) + +- Library crates are expected to compile against `utxorpc-spec 0.19.2` unchanged (pattern construction is tracker-only). If not, the predicate fix scope widens — surface it. +- The exact transport-error variant returned by the registry's `connect()` may differ from upstream's `Error::TonicTransport`; match the registry's actual `Error` enum (Task 6, Step 5). +- The reconnect loop itself has no unit test (it needs a mock gRPC server); it is covered by the `retry.rs` unit tests plus the spec's manual acceptance criterion (simulated transient interruption resumes from cursor). Note this gap honestly in the PR. +- Confirm the registry's minimal valid config shape when writing the `config.rs` parsing tests (Task 2) — use the registry's actual required keys, not the upstream SQLite `database_path` shape. diff --git a/docs/superpowers/specs/2026-06-18-tracker-anchor-gate-matching-design.md b/docs/superpowers/specs/2026-06-18-tracker-anchor-gate-matching-design.md new file mode 100644 index 0000000..e827e3e --- /dev/null +++ b/docs/superpowers/specs/2026-06-18-tracker-anchor-gate-matching-design.md @@ -0,0 +1,250 @@ +# Tracker — anchor-gate matching, scoring & resilience port — design + +Status: approved (2026-06-18) +Scope: bring the `tx3-lift` "anchor gate matching and improvements" change +(`7e8bc32`) into the registry's Postgres tracker, plus the bundled upstream +resilience (reconnect/backoff) and the `utxorpc-spec 0.19.2` bump. Library +improvements arrive via a git `rev` bump; the tracker-level logic is ported +by hand because the registry tracker is a Postgres fork of `tx3-lift/bin/tracker`. +Out of scope: tx3-lift's Docker/CI changes (`#15`/`#17`) and its SQLite tracker. +The registry's OCI `discovery.rs` is untouched. + +## Motivation + +The registry tracker currently matches "loosely": for every specialized TII it +runs `lifter.match_tx` (fingerprint-based) and persists every hit. A single +on-chain transaction therefore lands under multiple protocols — the +**over-matching** problem we observed in production. + +Upstream `tx3-lift` fixed this in commit `7e8bc32` ("anchor gate matching and +improvements") by deriving discriminating on-chain **anchors** from each TII +profile and using them to (a) **gate** a source out unless the transaction +actually forces one of its scripts to run, and (b) **score/rank** the surviving +candidates so a transaction resolves to its strongest match. The same commit +bundles upstream-stream **resilience** (HTTP/2 keepalives + reconnect with +capped backoff) and is followed by `842df42`, which adapts the tracker to +`utxorpc-spec 0.19.2`'s `Option` pattern fields. + +Because the registry tracker is a **Postgres fork** of the upstream SQLite +tracker (it adds `discovery.rs`, `lib.rs`, repo columns, and uses `sqlx` instead +of `rusqlite`), a `rev` bump alone only pulls in the **library** crates +(`tx3-lift`, `tx3-lift-cardano`). The matching logic, config, schema, store, and +the resilience loop must be ported into the registry tracker by hand. + +## What arrives for free (library `rev` bump) + +Bumping the `tx3-lift` / `tx3-lift-cardano` git `rev` pulls in everything in +`crates/` at `7e8bc32` — confirmed to be the **only** library-touching commit in +the range `e8c91bf..origin/main`: + +- `tx3_lift::anchors` → `ProtocolAnchors`, `AnchorHits` (re-exported from the + crate root: `tx3_lift::{ProtocolAnchors, AnchorHits}`). +- `tx3_lift::fingerprint::Fingerprint::information_score()` — used by the score. +- `tx3-lift-cardano` lifting / datum-summarize improvements. + +The library does **not** construct utxorpc `*Pattern` types, so it compiles +unchanged against `utxorpc-spec 0.19.2`. (Acceptance criterion below verifies.) + +## Dependency changes — `tracker/Cargo.toml` + +| Dependency | From | To | +|---|---|---| +| `tx3-lift` (git `rev`) | `e8c91bf652fe8558eae761c2d9509d518b952b89` | `827b499d6f790b19b235b4ed370d9343a226fedd` | +| `tx3-lift-cardano` (git `rev`) | `e8c91bf652fe8558eae761c2d9509d518b952b89` | `827b499d6f790b19b235b4ed370d9343a226fedd` | +| `utxorpc-spec` | `"0.19"` | `"0.19.2"` | + +`827b499` is the current HEAD of `tx3-lift` `main`; it is a strict superset of +`842df42` with byte-identical library crates. `Cargo.lock` is updated to resolve +`utxorpc-spec 0.19.2`. Both rev commits are already pushed to +`origin/main` of `github.com/tx3-lang/tx3-lift`, so the pinned `rev` is +reachable in CI. + +## Coupled change — `src/upstream/predicate.rs` + +`utxorpc-spec 0.19.2` makes the pattern byte fields `Option`. The +registry `predicate.rs` is byte-identical to the upstream pre-fix version, so +the `842df42` change applies verbatim: wrap three field assignments in `Some(…)`: + +- `AddressPattern.exact_address`: `Bytes::from(bytes)` → `Some(Bytes::from(bytes))` +- `AssetPattern.policy_id` (moves): same +- `AssetPattern.policy_id` (mints): same + +Without this the 0.19.2 bump does not compile. This is the only code coupled to +the version bump. + +## 1 — Matching port + +### `specialization.rs` + +- Add `anchors: ProtocolAnchors` to `SpecializedTii`. +- Compute it in `specialize_one` via `ProtocolAnchors::from_profile(profile)?` + (the `profile` is already in scope from `lookup_profile`). +- In `specialize_all`, **exclude** any source whose `anchors.is_empty()` is true, + emitting a `warn!` per skipped source (no parties / recognizable environment + anchors → matching disabled for that source). The registry variant keeps its + existing `DiscoveredSource` input and `repo_scope` / `repo_name` / + `repo_version` fields. + +### `process.rs` — rewrite `run_specializations` + +Behaviour to reproduce from the upstream reference, adapted to the registry's +async Postgres `Store` and its `OwnedMatchRow` shape: + +1. `let summary = lifter.matcher.summarize(payload)?;` once per tx. +2. **Gate + collect (defer lifting).** For each source: + - `let hits = spec.anchors.hits(&summary);` then `if !hits.gates() { continue; }`. + Gating presence = spend-from-script, mint/burn under an anchor policy, + script-ref in use, or a datum-bearing output at an anchor address. Soft + hits (bare payment to a script address, anchor asset merely circulating) + raise `total` but never gate. + - For each `(tx_name, (tir, fp))` whose `fp.matches(&summary)` and whose + `lifter.match_tx(tir, payload)?` yields an assignment: compute + `score = u32::try_from(hits.total + fp.information_score()).unwrap_or(u32::MAX)` + and push a candidate carrying the borrow needed to lift later. +3. **Pure selection** — port `select_matches(candidates, mode)` verbatim: + - within-source dedup: keep the best-scoring `tx_name` per source; tie-break + ascending `tx_name`; + - cross-source dense ranking by score descending (equal scores share a rank: + 5,5,3 → 1,1,2); + - mode filter: `Best` keeps only rank-1 rows (all of them when tied); `All` + keeps everything. +4. **Lift only survivors**, persisting each as an `OwnedMatchRow` extended with + `score` and `match_rank`. + +`select_matches`, `Candidate`, and `Ranked` are pure and chain-agnostic; they +port unchanged. + +### `config.rs` + +Add a `[matching]` block: + +```toml +[matching] +mode = "all" # or "best"; default "all" +``` + +- `MatchingConfig { mode: MatchMode }` with `#[serde(default)]`. +- `enum MatchMode { All, Best }`, `#[serde(rename_all = "lowercase")]`, default + `All`. Unknown values must fail to parse. + +### `store.rs` + migration + +- `OwnedMatchRow` gains `score: u32` and `match_rank: u32`. +- The `INSERT INTO matches …` statement adds the two columns; the bound + parameter list extends to `$12, $13` (bound as `i64`). +- New migration `migrations/20260618HHMMSS_add_score_rank.sql`: + + ```sql + ALTER TABLE matches ADD COLUMN score INTEGER NOT NULL DEFAULT 0; + ALTER TABLE matches ADD COLUMN match_rank INTEGER NOT NULL DEFAULT 1; + ``` + + `sqlx` owns migration bookkeeping, so the SQLite-specific + unchecked-transaction wrapper from the upstream `002_score_rank` is not + needed. `#[sqlx::test(migrations = "./migrations")]` picks the new migration + up automatically. + +## 2 — Resilience port + +### `upstream/retry.rs` (new, ported verbatim) + +- `pub fn is_transient(code: tonic::Code) -> bool` — `Unknown | Unavailable | + Aborted | Cancelled | DeadlineExceeded | Internal | ResourceExhausted` are + transient (reconnect); config/auth/bad-request codes stay fatal. +- `pub struct Backoff` — capped exponential delay with `next_delay()` and + `reset()`. +- Ships its 4 unit tests. + +### `upstream/mod.rs` — `connect()` + +Add HTTP/2 keepalives to the channel builder so an idle intermediary does not +silently drop the long-lived stream: +`http2_keep_alive_interval(20s)`, `keep_alive_timeout(20s)`, +`keep_alive_while_idle(true)`, `tcp_keepalive(Some(60s))`. + +### `lib.rs` — `run()` + +Restructure the single streaming loop into a reconnect loop (port of the +upstream `main.rs` change, applied to the registry's `run()` which lives in +`lib.rs`): + +- Extract `stream_session(...) -> Result` where + `enum SessionOutcome { Shutdown, Reconnect }`. +- `Backoff::new(1s, 30s)`; on `Reconnect`, `warn!` and sleep `backoff.next_delay()` + (interruptible by shutdown), then loop. +- Resume `intersect` from the **persisted cursor** on every (re)connect; fall + back to the configured intersect only when no cursor is stored. +- `backoff.reset()` on the first healthy message. +- Classification: a `connect()` transport error → `Reconnect`; an + `Error::Config` from `connect()` → fatal; a `watch_tx` / mid-stream status → + `Reconnect` iff `is_transient`, else fatal; any processing error → fatal. +- Pass `cfg.matching.mode` into `process::apply_tx(...)`. + +The registry-specific startup (load Postgres `Store`, OCI `fetch_catalog`, +`specialize_all`) is unchanged; only the stream loop is restructured. + +## 3 — Test plan + +All DB-backed tests use the registry's existing `#[sqlx::test(migrations = +"./migrations")]` harness (ephemeral per-test Postgres; needs `DATABASE_URL`). + +**Pure / no-DB:** +- `select_matches` — the 8 ported unit tests in `process.rs` (within-source + higher-score wins, tie-break alphabetical, exactly-one-per-source, dense + cross-source ranks, single-candidate, `Best` keeps all rank-1, `All` keeps + all, empty input). +- `config.rs` — `[matching]` parsing: default `All` when block/mode omitted, + `"best"`/`"all"` parsed, unknown value errors. +- `retry.rs` — the 4 ported tests (transient codes reconnect, fatal codes fatal, + backoff doubles+caps, reset returns to initial). + +**Ported integration tests (adapted to Postgres):** +- `tests/source_anchors.rs` — `ProtocolAnchors::from_profile` extraction over + real profiles (addresses, UTxO refs, policy ids; empty-anchor exclusion). +- `tests/over_matching_regression.rs` — using real CBOR fixtures + (`dex_swap_iusd`, `indigo_create_staking`, `sp_deposit`, reusable from + tx3-lift), assert that a transaction which previously matched multiple + protocols now gates/ranks to the intended single (or correctly tied) result; + assert persisted `score` / `match_rank`. +- `tests/gating_real_txs.rs` — anchor-strength gating: a soft-only presence does + not gate; a script-exec / stateful-output presence does. +- `tests/store_idempotency.rs` — extend to cover `score` / `match_rank` + round-trip and idempotent re-insert. + +Fixtures: copy the `.cbor.hex` fixtures referenced by the upstream tests into +`tracker/tests/fixtures/`. + +## Acceptance criteria + +1. `cargo build` and `cargo test` (with `DATABASE_URL`) pass in `tracker/`. +2. `cargo tree -p utxorpc-spec` resolves `0.19.2`; the library crates compile + against it without the predicate fix (the fix is tracker-only). +3. A transaction exercising a known protocol's script produces exactly the + intended match(es); the prior over-matching fixture no longer yields spurious + cross-protocol rows under `mode = "best"`. +4. With `mode = "all"`, every gated candidate is persisted with a dense + `match_rank`; with `mode = "best"`, only rank-1 rows persist. +5. A simulated transient upstream interruption reconnects and resumes from the + persisted cursor; a fatal (auth/config) error exits non-zero. +6. Sources whose profile yields zero anchors are skipped with a logged warning. + +## Notes / risks to verify during implementation + +- Confirm the library crates compile against `utxorpc-spec 0.19.2` (expected: + yes — pattern construction is tracker-only). +- Confirm `tx3_sdk::tii::spec::Profile` is reachable where the registry + `specialization.rs` builds `SpecializedTii` (it already calls + `lookup_profile`, so yes). +- The over-matching regression test needs the resolved-input CBOR carried in the + WatchTx envelope; reuse the upstream fixtures' envelope shape. + +## Landing order + +1. Dependency + `utxorpc-spec` bump + `predicate.rs` fix (compiles, existing + tests green). +2. `config.rs` `[matching]` + tests. +3. `specialization.rs` anchors + exclusion. +4. `store.rs` + migration (`score` / `match_rank`). +5. `process.rs` gate + score + `select_matches` + its unit tests. +6. Resilience: `retry.rs`, `connect()` keepalives, `lib.rs` reconnect loop. +7. Ported integration tests + fixtures. diff --git a/tracker/Cargo.lock b/tracker/Cargo.lock index b1e9dd2..3ae7202 100644 --- a/tracker/Cargo.lock +++ b/tracker/Cargo.lock @@ -3671,7 +3671,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tx3-lift" version = "0.1.0" -source = "git+https://github.com/tx3-lang/tx3-lift?rev=e8c91bf652fe8558eae761c2d9509d518b952b89#e8c91bf652fe8558eae761c2d9509d518b952b89" +source = "git+https://github.com/tx3-lang/tx3-lift?rev=827b499d6f790b19b235b4ed370d9343a226fedd#827b499d6f790b19b235b4ed370d9343a226fedd" dependencies = [ "bech32 0.11.1", "hex", @@ -3686,7 +3686,7 @@ dependencies = [ [[package]] name = "tx3-lift-cardano" version = "0.1.0" -source = "git+https://github.com/tx3-lang/tx3-lift?rev=e8c91bf652fe8558eae761c2d9509d518b952b89#e8c91bf652fe8558eae761c2d9509d518b952b89" +source = "git+https://github.com/tx3-lang/tx3-lift?rev=827b499d6f790b19b235b4ed370d9343a226fedd#827b499d6f790b19b235b4ed370d9343a226fedd" dependencies = [ "hex", "pallas", @@ -3842,9 +3842,9 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "utxorpc-spec" -version = "0.19.0" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53c5b06a64d715d79a25bebafacd4c24bfed6fd1e9725fab03e02fb67db08663" +checksum = "aa35373e6fbf0ea73651328aecd1641f92684de54bd908e3aa9855866b1c9875" dependencies = [ "bytes", "futures-core", diff --git a/tracker/Cargo.toml b/tracker/Cargo.toml index c3842e7..b1e0663 100644 --- a/tracker/Cargo.toml +++ b/tracker/Cargo.toml @@ -15,13 +15,13 @@ name = "tracker" path = "src/main.rs" [dependencies] -tx3-lift = { git = "https://github.com/tx3-lang/tx3-lift", rev = "e8c91bf652fe8558eae761c2d9509d518b952b89" } -tx3-lift-cardano = { git = "https://github.com/tx3-lang/tx3-lift", rev = "e8c91bf652fe8558eae761c2d9509d518b952b89" } +tx3-lift = { git = "https://github.com/tx3-lang/tx3-lift", rev = "827b499d6f790b19b235b4ed370d9343a226fedd" } +tx3-lift-cardano = { git = "https://github.com/tx3-lang/tx3-lift", rev = "827b499d6f790b19b235b4ed370d9343a226fedd" } tx3-tir = "0.18.0" tx3-sdk = "0.11.0" pallas = "1.0.0" -utxorpc-spec = "0.19" +utxorpc-spec = "0.19.2" tonic = { version = "0.12", features = ["tls", "tls-roots"] } prost = "0.13" prost-types = "0.13" diff --git a/tracker/migrations/20260618000001_add_score_rank.sql b/tracker/migrations/20260618000001_add_score_rank.sql new file mode 100644 index 0000000..ea002b3 --- /dev/null +++ b/tracker/migrations/20260618000001_add_score_rank.sql @@ -0,0 +1,2 @@ +ALTER TABLE matches ADD COLUMN score INTEGER NOT NULL DEFAULT 0; +ALTER TABLE matches ADD COLUMN match_rank INTEGER NOT NULL DEFAULT 1; diff --git a/tracker/src/config.rs b/tracker/src/config.rs index 25463b3..e439fb6 100644 --- a/tracker/src/config.rs +++ b/tracker/src/config.rs @@ -9,6 +9,8 @@ pub struct Config { pub upstream: UpstreamConfig, pub storage: StorageConfig, pub oci: OciConfig, + #[serde(default)] + pub matching: MatchingConfig, } /// Where the tracker pulls chain data from. @@ -108,6 +110,63 @@ pub struct ProfileOverride { pub profile: String, } +#[cfg(test)] +mod tests { + use super::*; + + const BASE: &str = r#" +[upstream] +endpoint = "http://localhost:50051" +profile = "mainnet" + +[storage] +database_url = "postgres://localhost/test" + +[oci] +registry_url = "http://localhost:5000" +"#; + + #[test] + fn matching_defaults_to_all_when_block_omitted() { + let cfg: Config = toml::from_str(BASE).unwrap(); + assert_eq!(cfg.matching.mode, MatchMode::All); + } + + #[test] + fn matching_mode_best_is_parsed() { + let s = format!("{}\n[matching]\nmode = \"best\"\n", BASE); + let cfg: Config = toml::from_str(&s).unwrap(); + assert_eq!(cfg.matching.mode, MatchMode::Best); + } + + #[test] + fn matching_mode_all_is_parsed() { + let s = format!("{}\n[matching]\nmode = \"all\"\n", BASE); + let cfg: Config = toml::from_str(&s).unwrap(); + assert_eq!(cfg.matching.mode, MatchMode::All); + } + + #[test] + fn matching_mode_unknown_value_fails() { + let s = format!("{}\n[matching]\nmode = \"bogus\"\n", BASE); + assert!(toml::from_str::(&s).is_err()); + } +} + +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Deserialize, Serialize)] +#[serde(rename_all = "lowercase")] +pub enum MatchMode { + #[default] + All, + Best, +} + +#[derive(Debug, Clone, Default, Deserialize, Serialize)] +pub struct MatchingConfig { + #[serde(default)] + pub mode: MatchMode, +} + pub fn load(path: impl AsRef) -> Result { let contents = std::fs::read_to_string(path.as_ref())?; let mut cfg: Config = toml::from_str(&contents)?; diff --git a/tracker/src/discovery.rs b/tracker/src/discovery.rs index 6422043..6ffd528 100644 --- a/tracker/src/discovery.rs +++ b/tracker/src/discovery.rs @@ -119,12 +119,6 @@ struct NewestImage { const LIMIT: i64 = 100; const TII_MEDIA_TYPE: &str = "application/tii+json"; -// Layer media types `trix publish` may produce alongside the TII. We don't -// consume the protocol source or README, but oci-client's `pull` validates -// every layer against `accepted_media_types` before returning, so they must -// all be listed or the whole pull errors with `IncompatibleLayerMediaType`. -const PROTOCOL_MEDIA_TYPE: &str = "application/tx3"; -const MARKDOWN_MEDIA_TYPE: &str = "text/markdown"; /// Derive the `oci_client::client::ClientProtocol` from a registry URL string. fn oci_protocol(registry_url: &str) -> oci_client::client::ClientProtocol { @@ -237,15 +231,18 @@ async fn pull_tii( Reference::try_from(format!("{registry_host_str}/{scope}/{name}:{version}")) .map_err(|e| Error::Config(format!("invalid OCI reference: {e}")))?; - let image = oci - .pull( - &reference, - &RegistryAuth::Anonymous, - vec![TII_MEDIA_TYPE, PROTOCOL_MEDIA_TYPE, MARKDOWN_MEDIA_TYPE], - ) + // Fetch the manifest, then pull only the `application/tii+json` layer's + // blob by digest. `oci-client`'s high-level `pull` validates *every* layer + // against an accepted-media-type allowlist and errors the whole pull on any + // unlisted layer — but `trix publish` attaches extra layers the tracker + // neither needs nor wants to enumerate (a README markdown, a logo PNG). + // Pulling by digest ignores those layers entirely, so a new layer type on + // the publisher side can never break discovery. + let (manifest, _digest) = oci + .pull_image_manifest(&reference, &RegistryAuth::Anonymous) .await?; - let layer = image + let tii_layer = manifest .layers .iter() .find(|l| l.media_type == TII_MEDIA_TYPE) @@ -255,7 +252,10 @@ async fn pull_tii( )) })?; - let tii = serde_json::from_slice::(&layer.data).map_err(|e| { + let mut data: Vec = Vec::new(); + oci.pull_blob(&reference, tii_layer, &mut data).await?; + + let tii = serde_json::from_slice::(&data).map_err(|e| { crate::error::Error::Config(format!( "failed to decode tii+json layer for {scope}/{name}:{version}: {e}" )) diff --git a/tracker/src/lib.rs b/tracker/src/lib.rs index 37db226..2f63ccd 100644 --- a/tracker/src/lib.rs +++ b/tracker/src/lib.rs @@ -7,12 +7,14 @@ pub mod store; pub mod upstream; use std::path::PathBuf; +use std::time::Duration; -use tracing::info; +use tracing::{info, warn}; use tx3_lift_cardano::CardanoLifter; -use utxorpc_spec::utxorpc::v1beta::watch::{watch_tx_response, WatchTxRequest}; +use utxorpc_spec::utxorpc::v1beta::watch::{watch_tx_response, BlockRef, WatchTxRequest}; -use crate::error::Result; +use crate::error::{Error, Result}; +use crate::upstream::retry::Backoff; pub async fn run(config_path: PathBuf) -> Result<()> { info!(config = %config_path.display(), "starting tracker"); @@ -27,65 +29,151 @@ pub async fn run(config_path: PathBuf) -> Result<()> { "specialized discovered sources" ); - let intersect = match store.cursor().await? { - Some(point) => { - info!(slot = point.slot, "resuming from stored cursor"); - vec![utxorpc_spec::utxorpc::v1beta::watch::BlockRef { - slot: point.slot, - hash: prost::bytes::Bytes::copy_from_slice(&point.hash), - height: 0, - }] - } - None => upstream::intersect_block_refs(&cfg.upstream.intersect)?, - }; - let predicate = upstream::predicate::compile(&cfg.upstream.filter)?; - let mut watch = upstream::connect(&cfg.upstream).await?; let lifter = CardanoLifter::new(); - let request = WatchTxRequest { - predicate, - field_mask: None, - intersect, + let mut shutdown = signal_listener(); + let mut backoff = Backoff::new(Duration::from_secs(1), Duration::from_secs(30)); + + // A long-lived gRPC stream against a managed endpoint will be interrupted + // periodically (idle drop, GOAWAY/connection recycling, brief provider + // restarts). Each interruption is recoverable: reconnect and resume from + // the persisted cursor. Only fatal errors (config/auth/bad-request, or a + // processing failure) break out and propagate. + loop { + // Resume from the latest persisted cursor on every (re)connect; fall + // back to the configured intersect only when nothing has been stored. + let intersect = match store.cursor().await? { + Some(point) => { + info!(slot = point.slot, "resuming from stored cursor"); + vec![BlockRef { + slot: point.slot, + hash: prost::bytes::Bytes::copy_from_slice(&point.hash), + height: 0, + }] + } + None => upstream::intersect_block_refs(&cfg.upstream.intersect)?, + }; + + let request = WatchTxRequest { + predicate: predicate.clone(), + field_mask: None, + intersect, + }; + + match stream_session( + &cfg, + request, + &specialized, + &lifter, + &store, + &mut shutdown, + &mut backoff, + ) + .await? + { + SessionOutcome::Shutdown => break, + SessionOutcome::Reconnect => { + let delay = backoff.next_delay(); + warn!(?delay, "stream interrupted; reconnecting after backoff"); + tokio::select! { + biased; + _ = &mut shutdown => break, + _ = tokio::time::sleep(delay) => {} + } + } + } + } + Ok(()) +} + +/// Why a streaming session ended. +enum SessionOutcome { + /// The shutdown signal fired; the tracker should exit cleanly. + Shutdown, + /// The connection or stream failed transiently; the caller should back off + /// and reconnect, resuming from the persisted cursor. + Reconnect, +} + +/// Connect, subscribe to `WatchTx`, and consume the stream until it ends. +/// +/// Transport-level failures (connect, subscribe, or mid-stream) resolve to +/// [`SessionOutcome::Reconnect`] so the caller can retry. Config/auth/bad-request +/// failures and any processing error propagate as fatal `Err`. +#[allow(clippy::too_many_arguments)] +async fn stream_session( + cfg: &config::Config, + request: WatchTxRequest, + specialized: &[specialization::SpecializedTii], + lifter: &CardanoLifter, + store: &store::Store, + shutdown: &mut tokio::task::JoinHandle<()>, + backoff: &mut Backoff, +) -> Result { + let mut watch = match upstream::connect(&cfg.upstream).await { + Ok(w) => w, + // A bad URI/api_key surfaces as Error::Config from connect() and is + // fatal; an unreachable server surfaces as a transport error and is + // worth retrying. + Err(Error::TonicTransport(e)) => { + warn!(error = %e, "connect failed; will reconnect"); + return Ok(SessionOutcome::Reconnect); + } + Err(e) => return Err(e), }; info!(endpoint = %cfg.upstream.endpoint, "subscribing to WatchTx"); - let mut stream = watch.watch_tx(request).await?.into_inner(); - - let mut shutdown = signal_listener(); + let mut stream = match watch.watch_tx(request).await { + Ok(r) => r.into_inner(), + Err(status) if upstream::retry::is_transient(status.code()) => { + warn!(code = ?status.code(), error = %status, "subscribe failed; will reconnect"); + return Ok(SessionOutcome::Reconnect); + } + Err(status) => return Err(status.into()), + }; loop { tokio::select! { biased; - _ = &mut shutdown => { + _ = &mut *shutdown => { info!("shutdown signal received"); - break; + return Ok(SessionOutcome::Shutdown); } msg = stream.message() => { - let response = match msg? { - Some(r) => r, - None => { - info!("stream closed by server"); - break; + let response = match msg { + Ok(Some(r)) => { + // The connection proved healthy; clear any backoff so + // the next interruption retries promptly. + backoff.reset(); + r } + Ok(None) => { + info!("stream closed by server; will reconnect"); + return Ok(SessionOutcome::Reconnect); + } + Err(status) if upstream::retry::is_transient(status.code()) => { + warn!(code = ?status.code(), error = %status, "stream error; will reconnect"); + return Ok(SessionOutcome::Reconnect); + } + Err(status) => return Err(status.into()), }; match response.action { Some(watch_tx_response::Action::Apply(any_tx)) => { - process::apply_tx(any_tx, &specialized, &lifter, &store).await?; + process::apply_tx(any_tx, specialized, lifter, store, cfg.matching.mode) + .await?; } Some(watch_tx_response::Action::Undo(any_tx)) => { - process::undo_tx(any_tx, &store).await?; + process::undo_tx(any_tx, store).await?; } Some(watch_tx_response::Action::Idle(b)) => { tracing::debug!(slot = b.slot, "idle"); - continue; } - None => continue, + None => {} } } } } - Ok(()) } fn signal_listener() -> tokio::task::JoinHandle<()> { diff --git a/tracker/src/process.rs b/tracker/src/process.rs index 6ef34a9..22af776 100644 --- a/tracker/src/process.rs +++ b/tracker/src/process.rs @@ -4,12 +4,14 @@ use pallas::ledger::traverse::{Era, MultiEraBlock}; use serde_bytes::ByteBuf; use tracing::{debug, info, warn}; use tx3_lift::lift::Lifter; -use tx3_lift::match_::Matcher; +use tx3_lift::match_::{MatchAssignment, Matcher}; use tx3_lift::payload::UtxoRef; use tx3_lift_cardano::{CardanoLifter, CardanoPayload, ResolvedOutput}; +use tx3_tir::model::v1beta0::Tx; use utxorpc_spec::utxorpc::v1beta::cardano as u5c_cardano; use utxorpc_spec::utxorpc::v1beta::watch::AnyChainTx; +use crate::config::MatchMode; use crate::error::{Error, Result}; use crate::specialization::SpecializedTii; use crate::store::{ChainPoint, OwnedMatchRow, Store}; @@ -22,6 +24,7 @@ pub async fn apply_tx( specialized: &[SpecializedTii], lifter: &CardanoLifter, store: &Store, + mode: MatchMode, ) -> Result<()> { let Some(cardano_tx) = any_tx.chain.and_then(|c| match c { utxorpc_spec::utxorpc::v1beta::watch::any_chain_tx::Chain::Cardano(t) => Some(t), @@ -76,7 +79,15 @@ pub async fn apply_tx( hash: block_hash_bytes, }; - let rows = run_specializations(specialized, lifter, &cardano_tx, &payload, block_slot, &block_hash_bytes)?; + let rows = run_specializations( + specialized, + lifter, + &cardano_tx, + &payload, + block_slot, + &block_hash_bytes, + mode, + )?; if !rows.is_empty() { info!( tx = %hex::encode(target_hash), @@ -117,6 +128,15 @@ pub async fn undo_tx(any_tx: AnyChainTx, store: &Store) -> Result<()> { Ok(()) } +/// What a surviving candidate needs in order to be lifted. Borrows into +/// `specialized` (which nothing mutates), so lifting can be deferred until +/// after selection without cloning any TIRs. +struct LiftInputs<'a> { + spec: &'a SpecializedTii, + tir: &'a Tx, + assignment: MatchAssignment, +} + fn run_specializations( specialized: &[SpecializedTii], lifter: &CardanoLifter, @@ -124,10 +144,22 @@ fn run_specializations( payload: &CardanoPayload, block_slot: u64, block_hash: &[u8], + mode: MatchMode, ) -> Result> { let summary = lifter.matcher.summarize(payload)?; - let mut out = Vec::new(); + + // 1. Gate + collect candidates (no lifting yet). + let mut candidates: Vec>> = Vec::new(); for spec in specialized { + // Anchor gate: skip a source unless the tx forces one of its scripts to + // run (spend-from-script, mint/burn, script-ref, or a datum-bearing + // output at its address). Soft hits (bare output / value-policy) do not + // gate on their own. Computed once per source, before any per-tx-name + // fingerprint/match work. + let hits = spec.anchors.hits(&summary); + if !hits.gates() { + continue; + } for (tx_name, (tir, fp)) in &spec.txs { if !fp.matches(&summary) { continue; @@ -136,33 +168,143 @@ fn run_specializations( Some(a) => a, None => continue, }; - let lifted = lifter.lift( - &spec.tii, + // `total` reproduces the old flat anchor count, so persisted scores + // are unchanged for genuinely-strong matches. + let score = u32::try_from(hits.total + fp.information_score()).unwrap_or(u32::MAX); + candidates.push(Candidate { + source_name: &spec.name, tx_name, - &spec.profile_name, - tir, - payload, - &assignment, - )?; - let lifted_json = serde_json::to_string(&lifted)?; - out.push(OwnedMatchRow { - tx_hash: lifted.tx_id.to_vec(), - block_slot, - block_hash: block_hash.to_vec(), - source_name: spec.name.clone(), - repo_scope: spec.repo_scope.clone(), - repo_name: spec.repo_name.clone(), - repo_version: spec.repo_version.clone(), - protocol_name: lifted.protocol_name.clone(), - tx_name: lifted.tx_name.clone(), - profile_name: lifted.profile_name.clone(), - lifted_json, + score, + payload: LiftInputs { + spec, + tir, + assignment, + }, }); } } + + // 2. Pure selection: within-source dedup, cross-source rank, mode filter. + let survivors = select_matches(candidates, mode); + + // 3. Lift only the survivors. + let mut out = Vec::with_capacity(survivors.len()); + for Ranked { + candidate, + match_rank, + } in survivors + { + let LiftInputs { + spec, + tir, + assignment, + } = candidate.payload; + let lifted = lifter.lift( + &spec.tii, + candidate.tx_name, + &spec.profile_name, + tir, + payload, + &assignment, + )?; + let lifted_json = serde_json::to_string(&lifted)?; + out.push(OwnedMatchRow { + tx_hash: lifted.tx_id.to_vec(), + block_slot, + block_hash: block_hash.to_vec(), + source_name: spec.name.clone(), + repo_scope: spec.repo_scope.clone(), + repo_name: spec.repo_name.clone(), + repo_version: spec.repo_version.clone(), + protocol_name: lifted.protocol_name.clone(), + tx_name: lifted.tx_name.clone(), + profile_name: lifted.profile_name.clone(), + lifted_json, + score: candidate.score, + match_rank, + }); + } Ok(out) } +/// A match candidate collected before lifting: the keys the selection logic +/// ranks on (`source_name`, `tx_name`, `score`) plus an opaque `payload` +/// carrying whatever the lift step needs (references into `specialized`). +struct Candidate<'a, T> { + source_name: &'a str, + tx_name: &'a str, + score: u32, + payload: T, +} + +/// A surviving candidate with its assigned dense, 1-based `match_rank`. +struct Ranked<'a, T> { + candidate: Candidate<'a, T>, + match_rank: u32, +} + +/// Pure selection over collected match candidates. +/// +/// 1. Within-source dedup: keep only the best-scoring `tx_name` per source; +/// ties break alphabetically by `tx_name` (ascending). +/// 2. Cross-source rank: sort survivors by score descending and assign dense +/// 1-based ranks (equal scores share a rank: 5,5,3 -> 1,1,2). +/// 3. Mode filter: `Best` keeps only rank-1 rows (all of them when tied); +/// `All` keeps everything. +fn select_matches(candidates: Vec>, mode: MatchMode) -> Vec> { + // (1) Within-source dedup. Keep the best (source, tx_name) per source. + // Higher score wins; on a tie, the alphabetically-first tx_name wins. + let mut best_per_source: BTreeMap<&str, Candidate<'_, T>> = BTreeMap::new(); + for cand in candidates { + // The new candidate replaces the incumbent when it scores strictly + // higher, or ties on score with an alphabetically-earlier tx_name. + // (Kept as an explicit boolean for readability over a + // `(Reverse(score), tx_name)` tuple compare.) + let replace = match best_per_source.get(cand.source_name) { + None => true, + Some(existing) => { + cand.score > existing.score + || (cand.score == existing.score && cand.tx_name < existing.tx_name) + } + }; + if replace { + best_per_source.insert(cand.source_name, cand); + } + } + + // (2) Cross-source rank: sort by score descending; assign dense 1-based + // ranks, with equal scores sharing a rank. + let mut survivors: Vec> = best_per_source.into_values().collect(); + survivors.sort_by(|a, b| { + b.score + .cmp(&a.score) + .then_with(|| a.source_name.cmp(b.source_name)) + }); + + let mut ranked = Vec::with_capacity(survivors.len()); + let mut rank = 0u32; + let mut prev_score: Option = None; + for cand in survivors { + if prev_score != Some(cand.score) { + rank += 1; + prev_score = Some(cand.score); + } + ranked.push(Ranked { + candidate: cand, + match_rank: rank, + }); + } + + // (3) Mode filter. + match mode { + MatchMode::All => ranked, + MatchMode::Best => { + ranked.retain(|r| r.match_rank == 1); + ranked + } + } +} + /// Walk every input + reference_input on the WatchTx-delivered cardano Tx and /// pull the resolved-output CBOR from `as_output.original_cbor`. This is what /// the v1beta spec carries for free, removing the need for a follow-up @@ -196,3 +338,142 @@ fn collect_resolved_inputs( } out } + +#[cfg(test)] +mod tests { + use super::*; + + /// Build a candidate whose opaque payload is just its `(source, tx_name)` + /// pair, so assertions can identify which candidate survived. + fn cand<'a>( + source_name: &'a str, + tx_name: &'a str, + score: u32, + ) -> Candidate<'a, (&'a str, &'a str)> { + Candidate { + source_name, + tx_name, + score, + payload: (source_name, tx_name), + } + } + + /// Collapse the ranked result to `(source, tx_name, rank)` triples for + /// readable assertions. + fn triples<'a>(ranked: &[Ranked<'a, (&'a str, &'a str)>]) -> Vec<(&'a str, &'a str, u32)> { + ranked + .iter() + .map(|r| (r.candidate.payload.0, r.candidate.payload.1, r.match_rank)) + .collect() + } + + #[test] + fn within_source_keeps_higher_score() { + let candidates = vec![ + cand("indigo", "unstake", 2), + cand("indigo", "create_cdp", 5), + ]; + let ranked = select_matches(candidates, MatchMode::All); + assert_eq!( + triples(&ranked), + vec![("indigo", "create_cdp", 1)], + "higher-scoring tx_name must win within a source" + ); + } + + #[test] + fn within_source_tie_breaks_alphabetically() { + // Equal scores: "adjust_cdp" must beat "unstake" (ascending tx_name). + // Feed in non-alphabetical order to prove the tie-break does not rely + // on input ordering. + let candidates = vec![ + cand("indigo", "unstake", 4), + cand("indigo", "adjust_cdp", 4), + ]; + let ranked = select_matches(candidates, MatchMode::All); + assert_eq!( + triples(&ranked), + vec![("indigo", "adjust_cdp", 1)], + "on equal score the alphabetically-first tx_name must win" + ); + } + + #[test] + fn within_source_keeps_exactly_one_per_source() { + let candidates = vec![ + cand("a", "x", 1), + cand("a", "y", 3), + cand("a", "z", 3), + cand("b", "p", 2), + cand("b", "q", 2), + ]; + let ranked = select_matches(candidates, MatchMode::All); + // One survivor per source: a/y (score 3, beats a/z on tie-break), + // b/p (score 2, beats b/q on tie-break). + let mut got: Vec<&str> = ranked.iter().map(|r| r.candidate.source_name).collect(); + got.sort_unstable(); + assert_eq!(got, vec!["a", "b"], "exactly one survivor per source"); + let triples = triples(&ranked); + assert!( + triples.contains(&("a", "y", 1)), + "a/y (score 3) should survive and rank 1, got {triples:?}" + ); + assert!( + triples.contains(&("b", "p", 2)), + "b/p (score 2) should survive and rank 2, got {triples:?}" + ); + } + + #[test] + fn cross_source_assigns_dense_ranks() { + // Scores 5/5/3 across three sources -> dense ranks 1/1/2. + let candidates = vec![cand("s1", "t", 5), cand("s2", "t", 5), cand("s3", "t", 3)]; + let ranked = select_matches(candidates, MatchMode::All); + let mut ranks: Vec = ranked.iter().map(|r| r.match_rank).collect(); + ranks.sort_unstable(); + assert_eq!( + ranks, + vec![1, 1, 2], + "scores 5/5/3 must produce dense ranks 1/1/2" + ); + } + + #[test] + fn single_candidate_ranks_one() { + let candidates = vec![cand("only", "tx", 7)]; + let ranked = select_matches(candidates, MatchMode::All); + assert_eq!(triples(&ranked), vec![("only", "tx", 1)]); + } + + #[test] + fn mode_best_keeps_all_rank_one_rows() { + // Ranks 1/1/2: Best keeps both rank-1 rows, drops the rank-2 row. + let candidates = vec![cand("s1", "t", 5), cand("s2", "t", 5), cand("s3", "t", 3)]; + let ranked = select_matches(candidates, MatchMode::Best); + assert_eq!(ranked.len(), 2, "Best keeps both tied rank-1 rows"); + assert!( + ranked.iter().all(|r| r.match_rank == 1), + "Best keeps only rank-1 rows" + ); + let mut sources: Vec<&str> = ranked.iter().map(|r| r.candidate.source_name).collect(); + sources.sort_unstable(); + assert_eq!(sources, vec!["s1", "s2"]); + } + + #[test] + fn mode_all_keeps_every_row() { + let candidates = vec![cand("s1", "t", 5), cand("s2", "t", 5), cand("s3", "t", 3)]; + let ranked = select_matches(candidates, MatchMode::All); + assert_eq!(ranked.len(), 3, "All keeps every ranked row"); + } + + #[test] + fn empty_candidates_yield_empty_result() { + let candidates: Vec> = Vec::new(); + let ranked = select_matches(candidates, MatchMode::All); + assert!(ranked.is_empty()); + let candidates: Vec> = Vec::new(); + let ranked = select_matches(candidates, MatchMode::Best); + assert!(ranked.is_empty()); + } +} diff --git a/tracker/src/specialization.rs b/tracker/src/specialization.rs index 75c2825..54063de 100644 --- a/tracker/src/specialization.rs +++ b/tracker/src/specialization.rs @@ -11,8 +11,10 @@ use std::collections::BTreeMap; +use tracing::warn; use tx3_lift::fingerprint::{extract, Fingerprint}; use tx3_lift::specialize::{args_from_profile, decode_tir, lookup_profile, lookup_tx}; +use tx3_lift::ProtocolAnchors; use tx3_sdk::tii::spec::TiiFile; use tx3_tir::model::v1beta0::Tx; use tx3_tir::reduce::{apply_args, ArgMap}; @@ -30,20 +32,42 @@ pub struct SpecializedTii { pub repo_version: String, pub tii: TiiFile, pub profile_name: String, + /// Protocol-level anchors derived from the profile (addresses, UTxO refs, + /// policy ids). Always non-empty: sources with zero anchors are excluded + /// from the active list by [`specialize_all`]. + pub anchors: ProtocolAnchors, /// Per-tx-name pre-specialized TIR + fingerprint. pub txs: BTreeMap, } -/// Specialize every discovered TII source. Returns one -/// `SpecializedTii` per source, in the same order. +/// Specialize every discovered TII source. Returns one `SpecializedTii` per +/// source in the same order as `sources`, **excluding** sources whose profile +/// yields zero anchors (no known party addresses, script-reference UTxOs, or +/// policy ids). A warning is emitted for each excluded source so the omission +/// is visible in logs. pub fn specialize_all(sources: &[DiscoveredSource]) -> Result> { - sources.iter().map(specialize_one).collect() + let mut out = Vec::with_capacity(sources.len()); + for src in sources { + let specialized = specialize_one(src)?; + if specialized.anchors.is_empty() { + warn!( + source = %src.source_name, + profile = %src.profile_name, + "profile has no parties or recognizable environment anchors; \ + matching disabled for this source" + ); + continue; + } + out.push(specialized); + } + Ok(out) } fn specialize_one(src: &DiscoveredSource) -> Result { let tii = src.tii.clone(); let profile = lookup_profile(&tii, &src.profile_name)?; + let anchors = ProtocolAnchors::from_profile(profile)?; let args: ArgMap = args_from_profile(profile, &ArgMap::new())?; let mut txs = BTreeMap::new(); @@ -69,6 +93,7 @@ fn specialize_one(src: &DiscoveredSource) -> Result { repo_version: src.version.clone(), tii, profile_name: src.profile_name.clone(), + anchors, txs, }) } diff --git a/tracker/src/store.rs b/tracker/src/store.rs index 20ecba6..6e8c5e1 100644 --- a/tracker/src/store.rs +++ b/tracker/src/store.rs @@ -29,6 +29,8 @@ pub struct OwnedMatchRow { pub tx_name: String, pub profile_name: String, pub lifted_json: String, + pub score: u32, + pub match_rank: u32, } /// Postgres-backed persistence for the tracker daemon. @@ -101,8 +103,9 @@ impl Store { "INSERT INTO matches \ (tx_hash, block_slot, block_hash, source_name, \ repo_scope, repo_name, repo_version, \ - protocol_name, tx_name, profile_name, lifted) \ - VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11::jsonb) \ + protocol_name, tx_name, profile_name, lifted, \ + score, match_rank) \ + VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11::jsonb, $12, $13) \ ON CONFLICT (tx_hash, source_name) DO NOTHING", ) .bind(&row.tx_hash) @@ -116,6 +119,8 @@ impl Store { .bind(&row.tx_name) .bind(&row.profile_name) .bind(&row.lifted_json) // bound as String; cast ::jsonb in SQL + .bind(row.score as i32) + .bind(row.match_rank as i32) .execute(&mut *tx) .await? .rows_affected(); diff --git a/tracker/src/upstream/mod.rs b/tracker/src/upstream/mod.rs index d360600..13f6f5c 100644 --- a/tracker/src/upstream/mod.rs +++ b/tracker/src/upstream/mod.rs @@ -6,6 +6,9 @@ //! `WatchTx` predicate that narrows what gets forwarded to us. pub mod predicate; +pub mod retry; + +use std::time::Duration; use prost::bytes::Bytes; use tonic::codegen::InterceptedService; @@ -39,7 +42,16 @@ impl Interceptor for ApiKeyInterceptor { pub async fn connect(cfg: &UpstreamConfig) -> Result> { let mut endpoint = Channel::from_shared(cfg.endpoint.clone()) - .map_err(|e| Error::Config(format!("invalid endpoint {:?}: {e}", cfg.endpoint)))?; + .map_err(|e| Error::Config(format!("invalid endpoint {:?}: {e}", cfg.endpoint)))? + // Keep the long-lived stream's HTTP/2 connection warm. Without these, + // an idle intermediary (NAT/LB/proxy) silently drops the connection + // during inter-block gaps, surfacing later as an h2 body-read error. + // The keepalive PINGs also let us detect a dead connection promptly + // instead of blocking forever on a half-open socket. + .http2_keep_alive_interval(Duration::from_secs(20)) + .keep_alive_timeout(Duration::from_secs(20)) + .keep_alive_while_idle(true) + .tcp_keepalive(Some(Duration::from_secs(60))); if cfg.endpoint.starts_with("https://") { endpoint = endpoint.tls_config(ClientTlsConfig::new().with_native_roots())?; } diff --git a/tracker/src/upstream/predicate.rs b/tracker/src/upstream/predicate.rs index 4051a21..744155a 100644 --- a/tracker/src/upstream/predicate.rs +++ b/tracker/src/upstream/predicate.rs @@ -21,7 +21,7 @@ pub fn compile(cfg: &UpstreamFilter) -> Result> { let bytes = decode_bech32_address(addr).map_err(Error::Lift)?; alternatives.push(predicate_from_pattern(TxPattern { has_address: Some(AddressPattern { - exact_address: Bytes::from(bytes), + exact_address: Some(Bytes::from(bytes)), ..Default::default() }), ..Default::default() @@ -32,7 +32,7 @@ pub fn compile(cfg: &UpstreamFilter) -> Result> { let bytes = hex::decode(policy_hex)?; alternatives.push(predicate_from_pattern(TxPattern { moves_asset: Some(AssetPattern { - policy_id: Bytes::from(bytes), + policy_id: Some(Bytes::from(bytes)), ..Default::default() }), ..Default::default() @@ -43,7 +43,7 @@ pub fn compile(cfg: &UpstreamFilter) -> Result> { let bytes = hex::decode(policy_hex)?; alternatives.push(predicate_from_pattern(TxPattern { mints_asset: Some(AssetPattern { - policy_id: Bytes::from(bytes), + policy_id: Some(Bytes::from(bytes)), ..Default::default() }), ..Default::default() diff --git a/tracker/src/upstream/retry.rs b/tracker/src/upstream/retry.rs new file mode 100644 index 0000000..c8c78f1 --- /dev/null +++ b/tracker/src/upstream/retry.rs @@ -0,0 +1,120 @@ +//! Transient-error classification and reconnect backoff for the WatchTx stream. +//! +//! A long-lived gRPC stream against a managed endpoint is interrupted +//! periodically: idle drop, GOAWAY/connection recycling, brief provider +//! restarts. Those interruptions are recoverable — reconnect and resume from +//! the persisted cursor. Auth/argument failures are not (retrying just loops on +//! the same rejection), so they stay fatal. + +use std::time::Duration; + +/// Whether a stream/subscribe failure with this gRPC code is worth a reconnect. +/// Transport-level interruptions are transient; configuration, auth, and +/// bad-request failures are permanent and must surface as fatal. +pub fn is_transient(code: tonic::Code) -> bool { + use tonic::Code::*; + matches!( + code, + Unknown + | Unavailable + | Aborted + | Cancelled + | DeadlineExceeded + | Internal + | ResourceExhausted + ) +} + +/// Capped exponential backoff between reconnect attempts. Reset after a +/// connection proves healthy (yields at least one message) so an occasional +/// blip doesn't permanently inflate the delay. +#[derive(Debug, Clone)] +pub struct Backoff { + current: Duration, + initial: Duration, + max: Duration, +} + +impl Backoff { + pub fn new(initial: Duration, max: Duration) -> Self { + Self { + current: initial, + initial, + max, + } + } + + /// Return the delay to wait before the next attempt, then advance the + /// schedule (double, capped at `max`). + pub fn next_delay(&mut self) -> Duration { + let delay = self.current; + self.current = self + .current + .checked_mul(2) + .unwrap_or(self.max) + .min(self.max); + delay + } + + /// Return to the initial delay after a healthy connection. + pub fn reset(&mut self) { + self.current = self.initial; + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn transport_codes_reconnect() { + // The h2 "error reading a body from connection" surfaces as Unknown; a + // recycled or unreachable upstream as Unavailable. All of these must + // reconnect rather than kill the process. + for code in [ + tonic::Code::Unknown, + tonic::Code::Unavailable, + tonic::Code::Aborted, + tonic::Code::Cancelled, + tonic::Code::DeadlineExceeded, + tonic::Code::Internal, + tonic::Code::ResourceExhausted, + ] { + assert!(is_transient(code), "{code:?} should reconnect"); + } + } + + #[test] + fn config_and_auth_codes_are_fatal() { + // Retrying these would loop forever on the same rejection. + for code in [ + tonic::Code::InvalidArgument, + tonic::Code::Unauthenticated, + tonic::Code::PermissionDenied, + tonic::Code::NotFound, + tonic::Code::Unimplemented, + tonic::Code::FailedPrecondition, + ] { + assert!(!is_transient(code), "{code:?} should be fatal"); + } + } + + #[test] + fn backoff_doubles_and_caps() { + let mut b = Backoff::new(Duration::from_secs(1), Duration::from_secs(8)); + assert_eq!(b.next_delay(), Duration::from_secs(1)); + assert_eq!(b.next_delay(), Duration::from_secs(2)); + assert_eq!(b.next_delay(), Duration::from_secs(4)); + assert_eq!(b.next_delay(), Duration::from_secs(8)); + assert_eq!(b.next_delay(), Duration::from_secs(8), "must cap at max"); + } + + #[test] + fn backoff_reset_returns_to_initial() { + let mut b = Backoff::new(Duration::from_secs(1), Duration::from_secs(8)); + b.next_delay(); + b.next_delay(); + b.reset(); + assert_eq!(b.next_delay(), Duration::from_secs(1)); + } +} diff --git a/tracker/tests/discovery.rs b/tracker/tests/discovery.rs index 41c805c..4a73db9 100644 --- a/tracker/tests/discovery.rs +++ b/tracker/tests/discovery.rs @@ -123,6 +123,49 @@ fn manifest_json_no_tii_layer() -> Vec { json.into_bytes() } +/// OCI manifest JSON with a TII layer AND a non-TII `image/png` logo layer — +/// the shape `trix publish` produces when `[protocol].logo` is set. The tracker +/// must pull only the TII blob by digest and ignore the logo layer entirely. +fn manifest_json_with_logo(tii_bytes: &[u8]) -> Vec { + let tii_digest = sha256_hex(tii_bytes); + let tii_size = tii_bytes.len(); + + let config_bytes = dummy_config_bytes(); + let config_digest = sha256_hex(&config_bytes); + let config_size = config_bytes.len(); + + // A fake PNG logo layer. Its blob is deliberately NOT stubbed by the test, + // so a regression that pulls every layer would 404 here and fail. + let logo_bytes: &[u8] = b"\x89PNG\r\n\x1a\nfake-logo-bytes"; + let logo_digest = sha256_hex(logo_bytes); + let logo_size = logo_bytes.len(); + + let json = format!( + r#"{{ + "schemaVersion": 2, + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "config": {{ + "mediaType": "application/vnd.oci.image.config.v1+json", + "digest": "{config_digest}", + "size": {config_size} + }}, + "layers": [ + {{ + "mediaType": "application/tii+json", + "digest": "{tii_digest}", + "size": {tii_size} + }}, + {{ + "mediaType": "image/png", + "digest": "{logo_digest}", + "size": {logo_size} + }} + ] +}}"# + ); + json.into_bytes() +} + /// Returns a bare `OciConfig` pointing at `registry_url` with no filters. fn oci_config(registry_url: &str) -> OciConfig { OciConfig { @@ -488,3 +531,98 @@ async fn fetch_catalog_errors_on_missing_tii_layer() { "error message should indicate missing tii+json layer, got: {msg}" ); } + +// --------------------------------------------------------------------------- +// Test 6: a logo (image/png) layer must not break discovery +// --------------------------------------------------------------------------- + +/// Regression: `trix publish` attaches a `[protocol].logo` as an `image/png` +/// layer. The tracker must pull only the `application/tii+json` blob by digest +/// and ignore the logo, instead of erroring the whole pull on the unlisted +/// media type. The logo blob is deliberately NOT stubbed, so a regression that +/// pulls every layer would fail trying to fetch it. +#[tokio::test] +async fn fetch_catalog_ignores_logo_png_layer() { + let server = MockServer::start().await; + + let tii_bytes = FIXTURE_TII; + let tii_digest = sha256_hex(tii_bytes); + let manifest = manifest_json_with_logo(tii_bytes); + let manifest_digest = sha256_hex(&manifest); + + // Auth ping + Mock::given(method("GET")) + .and(path("/v2/")) + .respond_with(ResponseTemplate::new(200)) + .mount(&server) + .await; + + // Single-page catalog with one repo + let single_page = serde_json::json!({ + "data": { + "RepoListWithNewestImage": { + "Page": { "TotalCount": 1, "ItemCount": 0 }, + "Results": [ + { + "Name": "txpipe/orcfax-burn", + "NewestImage": { "Tag": "1.0.0", "Vendor": null } + } + ] + } + } + }); + Mock::given(method("GET")) + .and(path("/v2/_zot/ext/search")) + .respond_with(ResponseTemplate::new(200).set_body_json(single_page)) + .mount(&server) + .await; + + // Manifest carrying a TII layer + a logo (image/png) layer. + Mock::given(method("GET")) + .and(path("/v2/txpipe/orcfax-burn/manifests/1.0.0")) + .respond_with( + ResponseTemplate::new(200) + .insert_header("Content-Type", "application/vnd.oci.image.manifest.v1+json") + .insert_header("Docker-Content-Digest", manifest_digest.as_str()) + .set_body_bytes(manifest), + ) + .mount(&server) + .await; + + // Config blob — stubbed so the pre-fix code path (`oci-client`'s high-level + // `pull`, which fetches manifest+config *then* validates layer media types) + // reaches the validation step and fails with the real production error + // (`IncompatibleLayerMediaType: image/png`) rather than a config 404. The + // fixed code pulls the manifest only, so this stub is simply unused. + let config_bytes = dummy_config_bytes(); + let config_digest = sha256_hex(&config_bytes); + Mock::given(method("GET")) + .and(path(format!("/v2/txpipe/orcfax-burn/blobs/{config_digest}"))) + .respond_with( + ResponseTemplate::new(200) + .insert_header("Docker-Content-Digest", config_digest.as_str()) + .set_body_bytes(config_bytes), + ) + .mount(&server) + .await; + + // Only the TII blob is stubbed — NOT the logo blob. If discovery tried to + // pull every layer, the logo fetch would 404 and fail this test. + Mock::given(method("GET")) + .and(path(format!("/v2/txpipe/orcfax-burn/blobs/{tii_digest}"))) + .respond_with( + ResponseTemplate::new(200) + .insert_header("Docker-Content-Digest", tii_digest.as_str()) + .set_body_bytes(tii_bytes), + ) + .mount(&server) + .await; + + let oci = oci_config(&server.uri()); + let result = fetch_catalog(&oci, DEFAULT_PROFILE) + .await + .expect("fetch_catalog must ignore the logo layer and succeed"); + + assert_eq!(result.len(), 1, "should return the single protocol"); + assert_eq!(result[0].source_name, "txpipe/orcfax-burn:1.0.0"); +} diff --git a/tracker/tests/fixtures/dex_swap_iusd_06a73a03.cbor.hex b/tracker/tests/fixtures/dex_swap_iusd_06a73a03.cbor.hex new file mode 100644 index 0000000..aad790d --- /dev/null +++ b/tracker/tests/fixtures/dex_swap_iusd_06a73a03.cbor.hex @@ -0,0 +1 @@ +84ad00d90102838258201e0eed66ab260180876384e2b81bbc96a3ecbf48a1f259282616aaaf48f468920082582022fb4f92869b42db304ea0204746903e4cc7ace533408066cba1f97fb20234920082582022fb4f92869b42db304ea0204746903e4cc7ace533408066cba1f97fb2023492020183a300581d7168a7a481d2221939af26d24ab146b7695cdb5cfb2b73b319a544922701821a001b1868a3581c96402c6f5e7a04f16b4d6f500ab039ff5eac5d0226d4f88bf5523ce8a14d5553444d2d695553442d534c5001581cc48cbb3d5e57ed56e276bc45f99ab39abe94e6cd7ac39fb402da47ada1480014df105553444d1b00000046d9c15c80581cf66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b69880a144695553441b00000038c2c50e0e028201d8185840d8799f9f1b00000046d9a26a561b00000038c2942408ff1b0000007f30c9fa000a581c96c2d95fc73740ef18abb95af68be279f80bb711eb69a527f3b1d713ff82583901c5c88840c8d5c3808e8f8439a75470aaf5a8e1736a72fabc1d2b420d43eb3a44848524726f7c2d32ce934583089d3d3b76587325cbc7a13b821a001e8480a1581cc48cbb3d5e57ed56e276bc45f99ab39abe94e6cd7ac39fb402da47ada1480014df105553444d1a1297441782583901b356502c5a69ce5110a8d43021fbc261f78059ee9f710ecb6eb18a6c52563c5410bff6a0d43ccebb7c37e1f69f5eb260552521adff33b9c2821a180ee7dea1581c53299e1f266eec1030b07866b3c4c4824c8bb4097ccd3d5765204d64a14d3137383535353436303137333901021a000791cb031a0b53f76f05a1581df14df9a962519ab9e3258e46e86ae781f5d0eb853939c84e655c637c55000758205160f88b929bf8a6c57c285b889488f9137c0ef3cfd0bcf408a10020e69146d5081a0b53f3870b58209f0c0404dd9d6cafdf1bd35dd61650723be0932068338b4022f05f7fae4f012f0dd901028182582022fb4f92869b42db304ea0204746903e4cc7ace533408066cba1f97fb2023492020ed9010281581cb356502c5a69ce5110a8d43021fbc261f78059ee9f710ecb6eb18a6c1082583901b356502c5a69ce5110a8d43021fbc261f78059ee9f710ecb6eb18a6c52563c5410bff6a0d43ccebb7c37e1f69f5eb260552521adff33b9c2821a17aba9e9a1581c53299e1f266eec1030b07866b3c4c4824c8bb4097ccd3d5765204d64a14d3137383535353436303137333901111a004c4b4012d901028382582048019a931af442e1eedab6c5b52b3069cf6eadb2483a2131f517e62fddfd56620082582048019a931af442e1eedab6c5b52b3069cf6eadb2483a2131f517e62fddfd56620182582048019a931af442e1eedab6c5b52b3069cf6eadb2483a2131f517e62fddfd566203a200d901028182582040b84cc9214696679e9668f901aec44063fd9b50fb0cdcd90c103900f17c14915840e8872b0d30f81eac44fba69738471ea492e73c1f7c2f060c04267ce509f58a794777924148684fdb53943e391e897c073da1c89f4cd584a886de3a5d09edaf080583840000d8798082196a211a0083b747840001d8799f9f00ff02ff821a0014bc7c1a18c144ed840300d8799f01ff82199bf81a00a4088ff5a11902a2a1636d736781774d696e737761703a204f72646572204578656375746564 diff --git a/tracker/tests/fixtures/indigo_create_staking_c54778b4.cbor.hex b/tracker/tests/fixtures/indigo_create_staking_c54778b4.cbor.hex new file mode 100644 index 0000000..060277e --- /dev/null +++ b/tracker/tests/fixtures/indigo_create_staking_c54778b4.cbor.hex @@ -0,0 +1 @@ +84a900d9010283825820b63c74c2a339fc26113f6499f8c48e67a1d364096aabf82384220018152814c60082582018a7756163eadd506dbe166245ba2ff1170766b43ea90df908c36994063c11b702825820d093b152aae4bdccdd6e81bed1d946446103a011b7a0a238e40da6725abd4bc4010183a300581d71a23793f529179e09cefb3c37fc6ae081e0e99e99be5cdb55a00941a501821b00000022cac7a0e2a1581c24b458412c2a7f9acb9c53c7ec4325b36806912ed56d2f91bfcf4d26a1535354414b494e475f4d414e414745525f4e465401028201d818581bd87981d879821b00000bc4d5256e46d879811b0000014b36cf2183a300581d71a23793f529179e09cefb3c37fc6ae081e0e99e99be5cdb55a00941a501821a0016d212a2581c533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0a144494e44591a004c4b40581cfd0d72fafee1d230a74c31ac503a192abd5b71888ae3f94128c1e634a1505354414b494e475f504f534954494f4e01028201d8185831d87a81d87983581c27a1233dbb7fba96a53d82e9373d6a187f504fc34d210302b9def086a0d879811b0000014b36cf2183a20058390127a1233dbb7fba96a53d82e9373d6a187f504fc34d210302b9def0867beef42339b93ab270f214070955a730cc269f1a435858b9915a157b01821a00295e7da1581c533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0a144494e445919921d021a000e64a109a1581cfd0d72fafee1d230a74c31ac503a192abd5b71888ae3f94128c1e634a1505354414b494e475f504f534954494f4e010b582019224a92bda2a5efe50832de42584ebbd3492d0bc8a8075c5149f963937a67f80dd901028182582058be633a981fa88f2b2c722f30cc6897dd17ccc662f9930ac2ceb001b6f13acf040ed9010281581c27a1233dbb7fba96a53d82e9373d6a187f504fc34d210302b9def0860f0112d9010282825820b54cb6d920a3fe7cf59a562d3184688ad6a7cbd11b1e9dfdf13f8804541e11a10082582071dc6b81e8832192bb28ecbc6a4f71b6e0dc0407c708f169020804371450b4e700a200d9010281825820a0514ce3fd525f565a8c721ad1ad3fbf194d74d4023cdfcbc96ce26342c6208658405de185391bf70f215559b44aace6e327b1f00600a0845366f1bf6282d5c962168453ea833af8277ec1ca72de51768c3db602740804d08d3f830ec5c96011fc0405a282000182d87981581c27a1233dbb7fba96a53d82e9373d6a187f504fc34d210302b9def086821a001e84801a7735940082010082d87980821a001e84801a77359400f5f6 diff --git a/tracker/tests/fixtures/orcfax_burn_anchored.tii b/tracker/tests/fixtures/orcfax_burn_anchored.tii new file mode 100644 index 0000000..31ceba1 --- /dev/null +++ b/tracker/tests/fixtures/orcfax_burn_anchored.tii @@ -0,0 +1,32 @@ +{ + "tii": { "version": "1.0.0" }, + "protocol": { + "name": "orcfax-burn", + "version": "1.0.0", + "scope": "txpipe" + }, + "transactions": { + "burn": { + "tir": { + "content": "ab6466656573644e6f6e656a7265666572656e6365738066696e7075747380676f757470757473806876616c6964697479f6656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c80677369676e657273f6686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + }, + "params": { + "type": "object", + "properties": { + "amount": { "type": "integer" } + }, + "required": ["amount"] + } + } + }, + "profiles": { + "mainnet": { + "environment": { + "anchor_policy": "00112233445566778899aabbccddeeff00112233445566778899aabb" + }, + "parties": {} + } + } +} diff --git a/tracker/tests/fixtures/orcfax_burn_anchorless.tii b/tracker/tests/fixtures/orcfax_burn_anchorless.tii new file mode 100644 index 0000000..e296935 --- /dev/null +++ b/tracker/tests/fixtures/orcfax_burn_anchorless.tii @@ -0,0 +1,30 @@ +{ + "tii": { "version": "1.0.0" }, + "protocol": { + "name": "orcfax-burn", + "version": "1.0.0", + "scope": "txpipe" + }, + "transactions": { + "burn": { + "tir": { + "content": "ab6466656573644e6f6e656a7265666572656e6365738066696e7075747380676f757470757473806876616c6964697479f6656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c80677369676e657273f6686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + }, + "params": { + "type": "object", + "properties": { + "amount": { "type": "integer" } + }, + "required": ["amount"] + } + } + }, + "profiles": { + "mainnet": { + "environment": {}, + "parties": {} + } + } +} diff --git a/tracker/tests/fixtures/protocols/bodega_market.tii b/tracker/tests/fixtures/protocols/bodega_market.tii new file mode 100644 index 0000000..c6f5d37 --- /dev/null +++ b/tracker/tests/fixtures/protocols/bodega_market.tii @@ -0,0 +1,523 @@ +{ + "environment": { + "properties": { + "batcher_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "bodega_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "bodega_token_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "position_script_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "prediction_script_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "project_info_nft_tn": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "project_prediction_nft_tn": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "protocol_settings_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "psettings_nft_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "psettings_nft_tn": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + } + }, + "required": [ + "project_info_nft_tn", + "project_prediction_nft_tn", + "bodega_policy_id", + "bodega_token_name", + "psettings_nft_policy_id", + "psettings_nft_tn", + "position_script_ref", + "prediction_script_ref", + "protocol_settings_ref", + "batcher_policy_id" + ], + "type": "object" + }, + "parties": { + "batcher": {}, + "positionscript": {}, + "predictionscript": {}, + "projectinfoscript": {}, + "protocoltreasury": {}, + "user": {} + }, + "profiles": { + "local": { + "environment": {}, + "parties": {} + }, + "mainnet": { + "environment": { + "batcher_policy_id": "c7c7af0f5c08a8b9398d78f50ba24ff76ead5d19c62b1c092c534196", + "bodega_policy_id": "5deab590a137066fef0e56f06ef1b830f21bc5d544661ba570bdd2ae", + "bodega_token_name": "424f44454741", + "position_script_ref": "73cc84de3e1b056abb3e004bdc25dd2ee49f4435ba4319f1faefe2ced843e894#2", + "prediction_script_ref": "73cc84de3e1b056abb3e004bdc25dd2ee49f4435ba4319f1faefe2ced843e894#2", + "project_info_nft_tn": "50524f4a4543545f494e464f5f4e4654", + "project_prediction_nft_tn": "50524f4a4543545f50524544494354494f4e5f4e4654", + "protocol_settings_ref": "73cc84de3e1b056abb3e004bdc25dd2ee49f4435ba4319f1faefe2ced843e894#0", + "psettings_nft_policy_id": "d2e8f0bab4bc0e62ebe9abf79b7a13280229ad60ca8e329892cb71a7", + "psettings_nft_tn": "50524f544f434f4c5f53455454494e47535f4e4654" + }, + "parties": { + "batcher": "addr1w9puyxdnzn3upaj73mk8lq0cq85jwrlu0kt62dw8dhka4lgjvdkjs", + "predictionscript": "addr1xx25vyyteavkeddsueufzr4ahgsa987fafvhv032tnmvg0dgl7dv5f8n43cyguzxv2xu3vnqdynvj5nxu2yere25k4kqf0df9x", + "projectinfoscript": "addr1x8x7nn5lch2uawxct2hjr06kgsplxu9rpm8gg9tyffv4u8agl7dv5f8n43cyguzxv2xu3vnqdynvj5nxu2yere25k4kqt4qep6", + "protocoltreasury": "addr1x8ru0tc0tsy23wfe34u02zazflmkat2ar8rzk8qf93f5r94gl7dv5f8n43cyguzxv2xu3vnqdynvj5nxu2yere25k4kqpuwsp0" + } + }, + "preprod": { + "environment": {}, + "parties": {} + }, + "preview": { + "environment": {}, + "parties": {} + } + }, + "protocol": { + "name": "bodega_market", + "scope": "bodega-market", + "version": "0.1.0" + }, + "tii": { + "version": "v1beta0" + }, + "transactions": { + "buy_position_no": { + "params": { + "properties": { + "admin_fee_percent": { + "type": "integer" + }, + "batcher_fee_amount": { + "type": "integer" + }, + "buy_amount": { + "type": "integer" + }, + "project_info_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "total_lovelace": { + "type": "integer" + }, + "unit_price": { + "type": "integer" + }, + "user_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "user_stake_key": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + } + }, + "required": [ + "user_pkh", + "user_stake_key", + "project_info_ref", + "buy_amount", + "batcher_fee_amount", + "admin_fee_percent", + "unit_price", + "total_lovelace" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657381a1694576616c506172616da16b45787065637456616c7565827070726f6a6563745f696e666f5f726566675574786f52656666696e7075747381a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826e746f74616c5f6c6f76656c61636563496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747382a46761646472657373a1694576616c506172616da16b45787065637456616c7565826e706f736974696f6e736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647389a16b4576616c4275696c74496ea16850726f706572747982a16a4576616c436f65726365a169496e746f446174756da1694576616c506172616da16b457870656374496e707574826c70726f6a6563745f696e666fa56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565827070726f6a6563745f696e666f5f726566675574786f526566646d616e79f46a636f6c6c61746572616cf4a1664e756d62657200a1694576616c506172616da16b45787065637456616c75658268757365725f706b68654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c7565826e757365725f7374616b655f6b6579654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647380a1694576616c506172616da16b45787065637456616c7565826a6275795f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c7565827161646d696e5f6665655f70657263656e7463496e74a1694576616c506172616da16b45787065637456616c7565826a756e69745f707269636563496e74a166537472756374a26b636f6e7374727563746f7201666669656c64738066616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826e746f74616c5f6c6f76656c61636563496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826e746f74616c5f6c6f76656c61636563496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826e746f74616c5f6c6f76656c61636563496e74a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479a26573696e6365644e6f6e6565756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d626572190258656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c80677369676e657273f6686d6574616461746181a2636b6579a1664e756d6265721902a26576616c7565a166537472696e67781f426f64656761204d61726b6574202d2042757920506f736974696f6e204e6f", + "encoding": "hex", + "version": "v1beta0" + } + }, + "buy_position_yes": { + "params": { + "properties": { + "admin_fee_percent": { + "type": "integer" + }, + "batcher_fee_amount": { + "type": "integer" + }, + "buy_amount": { + "type": "integer" + }, + "project_info_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "total_lovelace": { + "type": "integer" + }, + "unit_price": { + "type": "integer" + }, + "user_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "user_stake_key": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + } + }, + "required": [ + "user_pkh", + "user_stake_key", + "project_info_ref", + "buy_amount", + "batcher_fee_amount", + "admin_fee_percent", + "unit_price", + "total_lovelace" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657381a1694576616c506172616da16b45787065637456616c7565827070726f6a6563745f696e666f5f726566675574786f52656666696e7075747381a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826e746f74616c5f6c6f76656c61636563496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747382a46761646472657373a1694576616c506172616da16b45787065637456616c7565826e706f736974696f6e736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647389a16b4576616c4275696c74496ea16850726f706572747982a16a4576616c436f65726365a169496e746f446174756da1694576616c506172616da16b457870656374496e707574826c70726f6a6563745f696e666fa56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565827070726f6a6563745f696e666f5f726566675574786f526566646d616e79f46a636f6c6c61746572616cf4a1664e756d62657200a1694576616c506172616da16b45787065637456616c75658268757365725f706b68654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c7565826e757365725f7374616b655f6b6579654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647380a1694576616c506172616da16b45787065637456616c7565826a6275795f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c7565827161646d696e5f6665655f70657263656e7463496e74a1694576616c506172616da16b45787065637456616c7565826a756e69745f707269636563496e74a166537472756374a26b636f6e7374727563746f7200666669656c64738066616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826e746f74616c5f6c6f76656c61636563496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826e746f74616c5f6c6f76656c61636563496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826e746f74616c5f6c6f76656c61636563496e74a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479a26573696e6365644e6f6e6565756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d626572190258656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c80677369676e657273f6686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "create_market": { + "params": { + "properties": { + "cm_admin_fee_percent": { + "type": "integer" + }, + "cm_amm_param": { + "type": "integer" + }, + "cm_authtoken_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cm_authtoken_script": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cm_batcher_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cm_candidate_no_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cm_candidate_yes_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cm_deadline": { + "type": "integer" + }, + "cm_envelope_amount": { + "type": "integer" + }, + "cm_info_lovelace": { + "type": "integer" + }, + "cm_info_out_idx": { + "type": "integer" + }, + "cm_initial_no_price": { + "type": "integer" + }, + "cm_initial_pool": { + "type": "integer" + }, + "cm_initial_yes_price": { + "type": "integer" + }, + "cm_open_fee": { + "type": "integer" + }, + "cm_oracle_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cm_oracle_token_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cm_outref_idx": { + "type": "integer" + }, + "cm_outref_tx": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cm_owner_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cm_owner_stake_key": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cm_payment_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cm_payment_token_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cm_pledge_amount": { + "type": "integer" + }, + "cm_position_script_hash": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cm_pred_out_idx": { + "type": "integer" + }, + "cm_prediction_total_lovelace": { + "type": "integer" + }, + "cm_project_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cm_seed_outref_idx": { + "type": "integer" + }, + "cm_seed_outref_tx": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cm_settings_ref_idx": { + "type": "integer" + }, + "cm_share_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cm_treasury_out_idx": { + "type": "integer" + } + }, + "required": [ + "cm_authtoken_policy_id", + "cm_authtoken_script", + "cm_pledge_amount", + "cm_open_fee", + "cm_seed_outref_tx", + "cm_seed_outref_idx", + "cm_info_out_idx", + "cm_pred_out_idx", + "cm_settings_ref_idx", + "cm_treasury_out_idx", + "cm_outref_tx", + "cm_outref_idx", + "cm_owner_pkh", + "cm_owner_stake_key", + "cm_project_name", + "cm_deadline", + "cm_payment_policy_id", + "cm_payment_token_name", + "cm_batcher_policy_id", + "cm_position_script_hash", + "cm_share_policy_id", + "cm_oracle_policy_id", + "cm_oracle_token_name", + "cm_admin_fee_percent", + "cm_envelope_amount", + "cm_amm_param", + "cm_candidate_yes_name", + "cm_candidate_no_name", + "cm_prediction_total_lovelace", + "cm_initial_pool", + "cm_initial_yes_price", + "cm_initial_no_price", + "cm_info_lovelace" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657381a1694576616c506172616da16b45787065637456616c7565827570726f746f636f6c5f73657474696e67735f726566675574786f52656666696e7075747381a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c75658270636d5f696e666f5f6c6f76656c61636563496e74a1694576616c506172616da16b45787065637456616c756582781c636d5f70726564696374696f6e5f746f74616c5f6c6f76656c61636563496e74a1694576616c506172616da16b45787065637456616c7565826b636d5f6f70656e5f66656563496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c75658270626f646567615f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c75658271626f646567615f746f6b656e5f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c75658270636d5f706c656467655f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747384a46761646472657373a1694576616c506172616da16b45787065637456616c7565827170726f6a656374696e666f736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647391a166537472756374a26b636f6e7374727563746f7200666669656c647382a1694576616c506172616da16b45787065637456616c7565826c636d5f6f75747265665f7478654279746573a1694576616c506172616da16b45787065637456616c7565826d636d5f6f75747265665f69647863496e74a1694576616c506172616da16b45787065637456616c7565826c636d5f6f776e65725f706b68654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c75658272636d5f6f776e65725f7374616b655f6b6579654279746573a1694576616c506172616da16b45787065637456616c7565826f636d5f70726f6a6563745f6e616d65654279746573a1694576616c506172616da16b45787065637456616c7565826b636d5f646561646c696e6563496e74a1694576616c506172616da16b45787065637456616c75658274636d5f7061796d656e745f706f6c6963795f6964654279746573a1694576616c506172616da16b45787065637456616c75658275636d5f7061796d656e745f746f6b656e5f6e616d65654279746573a1694576616c506172616da16b45787065637456616c75658274636d5f626174636865725f706f6c6963795f6964654279746573a1694576616c506172616da16b45787065637456616c75658277636d5f706f736974696f6e5f7363726970745f68617368654279746573a1694576616c506172616da16b45787065637456616c75658272636d5f73686172655f706f6c6963795f6964654279746573a1694576616c506172616da16b45787065637456616c75658273636d5f6f7261636c655f706f6c6963795f6964654279746573a1694576616c506172616da16b45787065637456616c75658274636d5f6f7261636c655f746f6b656e5f6e616d65654279746573a1694576616c506172616da16b45787065637456616c75658274636d5f61646d696e5f6665655f70657263656e7463496e74a1694576616c506172616da16b45787065637456616c75658272636d5f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c7565826c636d5f616d6d5f706172616d63496e74a1694576616c506172616da16b45787065637456616c75658275636d5f63616e6469646174655f7965735f6e616d65654279746573a1694576616c506172616da16b45787065637456616c75658274636d5f63616e6469646174655f6e6f5f6e616d6565427974657366616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c75658270636d5f696e666f5f6c6f76656c61636563496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c75658276636d5f61757468746f6b656e5f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565827370726f6a6563745f696e666f5f6e66745f746e65427974657366616d6f756e74a1664e756d62657201a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c75658270626f646567615f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c75658271626f646567615f746f6b656e5f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c75658270636d5f706c656467655f616d6f756e7463496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565827070726564696374696f6e736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647387a166537472756374a26b636f6e7374727563746f7200666669656c647382a1694576616c506172616da16b45787065637456616c7565826c636d5f6f75747265665f7478654279746573a1694576616c506172616da16b45787065637456616c7565826d636d5f6f75747265665f69647863496e74a1664e756d62657200a1694576616c506172616da16b45787065637456616c7565826f636d5f696e697469616c5f706f6f6c63496e74a1664e756d62657200a1664e756d62657200a1694576616c506172616da16b45787065637456616c75658274636d5f696e697469616c5f7965735f707269636563496e74a1694576616c506172616da16b45787065637456616c75658273636d5f696e697469616c5f6e6f5f707269636563496e7466616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c756582781c636d5f70726564696374696f6e5f746f74616c5f6c6f76656c61636563496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c75658276636d5f61757468746f6b656e5f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582781970726f6a6563745f70726564696374696f6e5f6e66745f746e65427974657366616d6f756e74a1664e756d62657201686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565827070726f746f636f6c7472656173757279674164647265737365646174756d644e6f6e6566616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b636d5f6f70656e5f66656563496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c75658270636d5f696e666f5f6c6f76656c61636563496e74a1694576616c506172616da16b45787065637456616c756582781c636d5f70726564696374696f6e5f746f74616c5f6c6f76656c61636563496e74a1694576616c506172616da16b45787065637456616c7565826b636d5f6f70656e5f66656563496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c75658270626f646567615f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c75658271626f646567615f746f6b656e5f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c75658270636d5f706c656467655f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c75658270636d5f696e666f5f6c6f76656c61636563496e74a1694576616c506172616da16b45787065637456616c756582781c636d5f70726564696374696f6e5f746f74616c5f6c6f76656c61636563496e74a1694576616c506172616da16b45787065637456616c7565826b636d5f6f70656e5f66656563496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c75658270626f646567615f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c75658271626f646567615f746f6b656e5f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c75658270636d5f706c656467655f616d6f756e7463496e74a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479f6656d696e747381a266616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c75658276636d5f61757468746f6b656e5f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565827370726f6a6563745f696e666f5f6e66745f746e65427974657366616d6f756e74a1664e756d62657201a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c75658276636d5f61757468746f6b656e5f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582781970726f6a6563745f70726564696374696f6e5f6e66745f746e65427974657366616d6f756e74a1664e756d626572016872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647385a166537472756374a26b636f6e7374727563746f7200666669656c647382a1694576616c506172616da16b45787065637456616c75658271636d5f736565645f6f75747265665f7478654279746573a1694576616c506172616da16b45787065637456616c75658272636d5f736565645f6f75747265665f69647863496e74a1694576616c506172616da16b45787065637456616c7565826f636d5f696e666f5f6f75745f69647863496e74a1694576616c506172616da16b45787065637456616c7565826f636d5f707265645f6f75745f69647863496e74a1694576616c506172616da16b45787065637456616c75658273636d5f73657474696e67735f7265665f69647863496e74a1694576616c506172616da16b45787065637456616c75658273636d5f74726561737572795f6f75745f69647863496e74656275726e7380656164686f6381a2646e616d656e706c757475735f7769746e6573736464617461a26776657273696f6ea1664e756d6265720366736372697074a1694576616c506172616da16b45787065637456616c75658273636d5f61757468746f6b656e5f7363726970746542797465736a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273f6686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "sell_position_no": { + "params": { + "properties": { + "admin_fee_percent": { + "type": "integer" + }, + "batcher_fee_amount": { + "type": "integer" + }, + "envelope_amount": { + "type": "integer" + }, + "project_info_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "share_amount": { + "type": "integer" + }, + "unit_price": { + "type": "integer" + }, + "user_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "user_stake_key": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + } + }, + "required": [ + "user_pkh", + "user_stake_key", + "project_info_ref", + "envelope_amount", + "share_amount", + "batcher_fee_amount", + "admin_fee_percent", + "unit_price" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657381a1694576616c506172616da16b45787065637456616c7565827070726f6a6563745f696e666f5f726566675574786f52656666696e7075747381a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747382a46761646472657373a1694576616c506172616da16b45787065637456616c7565826e706f736974696f6e736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647389a16b4576616c4275696c74496ea16850726f706572747982a16a4576616c436f65726365a169496e746f446174756da1694576616c506172616da16b457870656374496e707574826c70726f6a6563745f696e666fa56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565827070726f6a6563745f696e666f5f726566675574786f526566646d616e79f46a636f6c6c61746572616cf4a1664e756d62657200a1694576616c506172616da16b45787065637456616c75658268757365725f706b68654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c7565826e757365725f7374616b655f6b6579654279746573a166537472756374a26b636f6e7374727563746f7201666669656c647380a1694576616c506172616da16b45787065637456616c7565826c73686172655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c7565827161646d696e5f6665655f70657263656e7463496e74a1694576616c506172616da16b45787065637456616c7565826a756e69745f707269636563496e74a166537472756374a26b636f6e7374727563746f7201666669656c64738066616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479a26573696e6365644e6f6e6565756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d626572190258656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c80677369676e657273f6686d6574616461746181a2636b6579a1664e756d6265721902a26576616c7565a166537472696e677820426f64656761204d61726b6574202d2053656c6c20506f736974696f6e204e6f", + "encoding": "hex", + "version": "v1beta0" + } + }, + "sell_position_yes": { + "params": { + "properties": { + "admin_fee_percent": { + "type": "integer" + }, + "batcher_fee_amount": { + "type": "integer" + }, + "envelope_amount": { + "type": "integer" + }, + "project_info_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "share_amount": { + "type": "integer" + }, + "unit_price": { + "type": "integer" + }, + "user_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "user_stake_key": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + } + }, + "required": [ + "user_pkh", + "user_stake_key", + "project_info_ref", + "envelope_amount", + "share_amount", + "batcher_fee_amount", + "admin_fee_percent", + "unit_price" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657381a1694576616c506172616da16b45787065637456616c7565827070726f6a6563745f696e666f5f726566675574786f52656666696e7075747381a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747382a46761646472657373a1694576616c506172616da16b45787065637456616c7565826e706f736974696f6e736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647389a16b4576616c4275696c74496ea16850726f706572747982a16a4576616c436f65726365a169496e746f446174756da1694576616c506172616da16b457870656374496e707574826c70726f6a6563745f696e666fa56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565827070726f6a6563745f696e666f5f726566675574786f526566646d616e79f46a636f6c6c61746572616cf4a1664e756d62657200a1694576616c506172616da16b45787065637456616c75658268757365725f706b68654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c7565826e757365725f7374616b655f6b6579654279746573a166537472756374a26b636f6e7374727563746f7201666669656c647380a1694576616c506172616da16b45787065637456616c7565826c73686172655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c7565827161646d696e5f6665655f70657263656e7463496e74a1694576616c506172616da16b45787065637456616c7565826a756e69745f707269636563496e74a166537472756374a26b636f6e7374727563746f7200666669656c64738066616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479a26573696e6365644e6f6e6565756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d626572190258656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c80677369676e657273f6686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "submit_reward_no": { + "params": { + "properties": { + "batcher_fee_amount": { + "type": "integer" + }, + "candidate_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "envelope_amount": { + "type": "integer" + }, + "project_info_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "share_amount": { + "type": "integer" + }, + "share_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "user_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "user_stake_key": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + } + }, + "required": [ + "user_pkh", + "user_stake_key", + "project_info_ref", + "share_policy_id", + "candidate_name", + "envelope_amount", + "share_amount", + "batcher_fee_amount" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657381a1694576616c506172616da16b45787065637456616c7565827070726f6a6563745f696e666f5f726566675574786f52656666696e7075747381a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826f73686172655f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826e63616e6469646174655f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c73686172655f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747382a46761646472657373a1694576616c506172616da16b45787065637456616c7565826e706f736974696f6e736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647389a16b4576616c4275696c74496ea16850726f706572747982a16a4576616c436f65726365a169496e746f446174756da1694576616c506172616da16b457870656374496e707574826c70726f6a6563745f696e666fa56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565827070726f6a6563745f696e666f5f726566675574786f526566646d616e79f46a636f6c6c61746572616cf4a1664e756d62657200a1694576616c506172616da16b45787065637456616c75658268757365725f706b68654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c7565826e757365725f7374616b655f6b6579654279746573a166537472756374a26b636f6e7374727563746f7202666669656c647380a1694576616c506172616da16b45787065637456616c7565826c73686172655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a1664e756d62657200a1664e756d62657200a166537472756374a26b636f6e7374727563746f7201666669656c64738066616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826f73686172655f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826e63616e6469646174655f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c73686172655f616d6f756e7463496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826f73686172655f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826e63616e6469646174655f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c73686172655f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826f73686172655f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826e63616e6469646174655f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c73686172655f616d6f756e7463496e74a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479a26573696e6365644e6f6e6565756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d626572190258656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c80677369676e657273f6686d6574616461746181a2636b6579a1664e756d6265721902a26576616c7565a166537472696e677820426f64656761204d61726b6574202d205375626d697420526577617264204e6f", + "encoding": "hex", + "version": "v1beta0" + } + }, + "submit_reward_yes": { + "params": { + "properties": { + "batcher_fee_amount": { + "type": "integer" + }, + "candidate_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "envelope_amount": { + "type": "integer" + }, + "project_info_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "share_amount": { + "type": "integer" + }, + "share_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "user_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "user_stake_key": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + } + }, + "required": [ + "user_pkh", + "user_stake_key", + "project_info_ref", + "share_policy_id", + "candidate_name", + "envelope_amount", + "share_amount", + "batcher_fee_amount" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657381a1694576616c506172616da16b45787065637456616c7565827070726f6a6563745f696e666f5f726566675574786f52656666696e7075747381a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826f73686172655f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826e63616e6469646174655f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c73686172655f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747382a46761646472657373a1694576616c506172616da16b45787065637456616c7565826e706f736974696f6e736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647389a16b4576616c4275696c74496ea16850726f706572747982a16a4576616c436f65726365a169496e746f446174756da1694576616c506172616da16b457870656374496e707574826c70726f6a6563745f696e666fa56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565827070726f6a6563745f696e666f5f726566675574786f526566646d616e79f46a636f6c6c61746572616cf4a1664e756d62657200a1694576616c506172616da16b45787065637456616c75658268757365725f706b68654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c7565826e757365725f7374616b655f6b6579654279746573a166537472756374a26b636f6e7374727563746f7202666669656c647380a1694576616c506172616da16b45787065637456616c7565826c73686172655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a1664e756d62657200a1664e756d62657200a166537472756374a26b636f6e7374727563746f7200666669656c64738066616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826f73686172655f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826e63616e6469646174655f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c73686172655f616d6f756e7463496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826f73686172655f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826e63616e6469646174655f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c73686172655f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f656e76656c6f70655f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658272626174636865725f6665655f616d6f756e7463496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826f73686172655f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826e63616e6469646174655f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c73686172655f616d6f756e7463496e74a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479a26573696e6365644e6f6e6565756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d626572190258656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c80677369676e657273f6686d6574616461746181a2636b6579a1664e756d6265721902a26576616c7565a166537472696e677821426f64656761204d61726b6574202d205375626d69742052657761726420596573", + "encoding": "hex", + "version": "v1beta0" + } + } + } +} \ No newline at end of file diff --git a/tracker/tests/fixtures/protocols/fluid-aquarium.tii b/tracker/tests/fixtures/protocols/fluid-aquarium.tii new file mode 100644 index 0000000..41a19e5 --- /dev/null +++ b/tracker/tests/fixtures/protocols/fluid-aquarium.tii @@ -0,0 +1,349 @@ +{ + "environment": { + "properties": { + "fldt_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "fldt_policy": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "oracle_contract_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "oracle_feed_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "oracle_script_hash": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "params_nft_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "params_policy": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "params_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "staker_policy": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "tank_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + } + }, + "required": [ + "tank_ref", + "params_ref", + "oracle_script_hash", + "fldt_policy", + "fldt_name", + "staker_policy", + "params_policy", + "params_nft_name", + "oracle_feed_ref", + "oracle_contract_ref" + ], + "type": "object" + }, + "parties": { + "batcher": {}, + "oraclescript": {}, + "rewardsaddr": {}, + "tankscript": {}, + "tankuseraddr": {}, + "user": {} + }, + "profiles": { + "local": { + "environment": {}, + "parties": {} + }, + "mainnet": { + "environment": { + "fldt_name": "0014df10464c4454", + "fldt_policy": "577f0b1342f8f8f4aed3388b80a8535812950c7a892495c0ecdf0f1e", + "oracle_contract_ref": "fef0fcfc38cace7e8aac85ddc6fad895ca4e7e80a0c01a5836094e387d38f591#0", + "oracle_feed_ref": "7f3bb225b601685e5212935db87b509f7c00fcbb05c36126eb16be1e98aedcc2#0", + "oracle_script_hash": "1d36e2cb1ad625908e3784eb8bceeebab531fad4f390791e184cd408", + "params_nft_name": "706172616d6574657273", + "params_policy": "f0e403df77b2bfee7c0799ef927b3763165033cbe38bddc802934883", + "params_ref": "b79f33b820dd572394cf93e8a4ad1a67ee2d46dbf69ac6ceca33de0d6ff56476#0", + "staker_policy": "bae773ecdbabb746d2dcd7d1630a5761180b19766803b8a65fa52901", + "tank_ref": "354ffe7958d62a8a2bf0b0bd97a06694d59dc49b6d02f1ab40165a3955257168#0" + }, + "parties": { + "batcher": "addr1q94pdst75jp2p7juf3hl0mk8nsa27uxrhyc9ya64ercy5tdvq0yl4h4tcndgdtd5j3eqp6sezqu4s8xxh779axr5c5eq77jk26", + "oraclescript": "stake17ywndcktrttztyywx7zwhz7wa6at2v066neeq7g7rpxdgzqdv8vq6", + "rewardsaddr": "addr1z82egrwz4k0r7s65f7cz52pypus4vqnq8f63jky9x2mjc56lfhq9y589598hgu6nwqf5440e2p477trfuz72995ktu7sx5rxem", + "tankscript": "addr1w8uhynz89x08gh95758e6dkthtwdlplqzk5an8vj0hzwsesq3894w" + } + }, + "preprod": { + "environment": {}, + "parties": {} + }, + "preview": { + "environment": {}, + "parties": {} + } + }, + "protocol": { + "name": "fluid-aquarium", + "scope": "fluidtokens", + "version": "0.1.0" + }, + "tii": { + "version": "v1beta0" + }, + "transactions": { + "consume_oracle": { + "params": { + "properties": { + "dest_ada": { + "type": "integer" + }, + "input_tank_idx": { + "type": "integer" + }, + "oracle_denominator": { + "type": "integer" + }, + "oracle_idx": { + "type": "integer" + }, + "oracle_price": { + "type": "integer" + }, + "oracle_provider_idx": { + "type": "integer" + }, + "oracle_provider_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "oracle_valid_from": { + "type": "integer" + }, + "oracle_valid_to": { + "type": "integer" + }, + "paying_token_idx": { + "type": "integer" + }, + "payment_ada": { + "type": "integer" + }, + "payment_token_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "payment_token_policy": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "payment_token_qty": { + "type": "integer" + }, + "ref_params_idx": { + "type": "integer" + }, + "tank_return_ada": { + "type": "integer" + }, + "tank_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + } + }, + "required": [ + "tank_utxo", + "oracle_provider_ref", + "paying_token_idx", + "input_tank_idx", + "oracle_idx", + "ref_params_idx", + "tank_return_ada", + "payment_ada", + "payment_token_policy", + "payment_token_name", + "payment_token_qty", + "dest_ada", + "oracle_provider_idx", + "oracle_valid_from", + "oracle_valid_to", + "oracle_price", + "oracle_denominator" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657385a1694576616c506172616da16b45787065637456616c7565826874616e6b5f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826a706172616d735f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826f6f7261636c655f666565645f726566675574786f526566a1694576616c506172616da16b45787065637456616c756582736f7261636c655f70726f76696465725f726566675574786f526566a1694576616c506172616da16b45787065637456616c756582736f7261636c655f636f6e74726163745f726566675574786f52656666696e7075747382a3646e616d656a74616e6b5f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826a74616e6b5f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826974616e6b5f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7204666669656c647386a1694576616c506172616da16b45787065637456616c75658270706179696e675f746f6b656e5f69647863496e74a1694576616c506172616da16b45787065637456616c7565826e696e7075745f74616e6b5f69647863496e74a1664e756d62657200a1694576616c506172616da16b45787065637456616c7565826a6f7261636c655f69647863496e74a1694576616c506172616da16b45787065637456616c7565826e7265665f706172616d735f69647863496e74a1664e756d62657200a3646e616d656a757365725f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826a757365725f696e707574a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c75658268646573745f61646163496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582747061796d656e745f746f6b656e5f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582727061796d656e745f746f6b656e5f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c756582717061796d656e745f746f6b656e5f71747963496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747384a46761646472657373a1694576616c506172616da16b45787065637456616c7565826c74616e6b7573657261646472674164647265737365646174756da16a4576616c436f65726365a169496e746f446174756da1694576616c506172616da16b457870656374496e707574826a74616e6b5f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826974616e6b5f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf466616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826f74616e6b5f72657475726e5f61646163496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b7061796d656e745f61646163496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582747061796d656e745f746f6b656e5f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582727061796d656e745f746f6b656e5f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c756582717061796d656e745f746f6b656e5f71747963496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c75658268646573745f61646163496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826a757365725f696e707574a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c75658268646573745f61646163496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582747061796d656e745f746f6b656e5f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582727061796d656e745f746f6b656e5f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c756582717061796d656e745f746f6b656e5f71747963496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c75658268646573745f61646163496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582747061796d656e745f746f6b656e5f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582727061796d656e745f746f6b656e5f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c756582717061796d656e745f746f6b656e5f71747963496e74a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479a26573696e6365a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f7465756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d62657219012c656d696e747380656275726e7380656164686f6381a2646e616d656a7769746864726177616c6464617461a366616d6f756e74a1664e756d626572006a63726564656e7469616ca1694576616c506172616da16b45787065637456616c7565826c6f7261636c6573637269707467416464726573736872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647382a166537472756374a26b636f6e7374727563746f7203666669656c647384a1694576616c506172616da16b45787065637456616c756582736f7261636c655f70726f76696465725f69647863496e74a166537472756374a26b636f6e7374727563746f7200666669656c647383a1694576616c506172616da16b45787065637456616c756582716f7261636c655f76616c69645f66726f6d63496e74a1694576616c506172616da16b45787065637456616c7565826f6f7261636c655f76616c69645f746f63496e74a166537472756374a26b636f6e7374727563746f7200666669656c647382a1694576616c506172616da16b45787065637456616c756582747061796d656e745f746f6b656e5f706f6c696379654279746573a1694576616c506172616da16b45787065637456616c756582727061796d656e745f746f6b656e5f6e616d65654279746573a1694576616c506172616da16b45787065637456616c7565826c6f7261636c655f707269636563496e74a1694576616c506172616da16b45787065637456616c756582726f7261636c655f64656e6f6d696e61746f7263496e74a1644c697374806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c75658264757365726741646472657373686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "create_babel_tank": { + "params": { + "properties": { + "empty_bytes": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "owner_payment_hash": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "owner_stake_hash": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "tank_ada": { + "type": "integer" + } + }, + "required": [ + "tank_ada", + "owner_payment_hash", + "owner_stake_hash", + "empty_bytes" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e6365738066696e7075747381a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826874616e6b5f61646163496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747382a46761646472657373a1694576616c506172616da16b45787065637456616c7565826c74616e6b7573657261646472674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647387a1644c69737480a166537472756374a26b636f6e7374727563746f7200666669656c647382a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c756582726f776e65725f7061796d656e745f68617368654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c756582706f776e65725f7374616b655f68617368654279746573a1644c69737480a1664e756d62657200a166537472756374a26b636f6e7374727563746f7200666669656c647382a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c756582726f776e65725f7061796d656e745f68617368654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c756582706f776e65725f7374616b655f68617368654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647385a1694576616c506172616da16b45787065637456616c7565826b656d7074795f6279746573654279746573a1694576616c506172616da16b45787065637456616c7565826b656d7074795f6279746573654279746573a1664e756d62657200a1664e756d6265721a000f4240a166537472756374a26b636f6e7374727563746f7201666669656c647380a166537472756374a26b636f6e7374727563746f7200666669656c647385a1694576616c506172616da16b45787065637456616c7565826b656d7074795f6279746573654279746573a1694576616c506172616da16b45787065637456616c7565826b656d7074795f6279746573654279746573a1664e756d62657200a1664e756d6265721a000f4240a166537472756374a26b636f6e7374727563746f7201666669656c64738066616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826874616e6b5f61646163496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826874616e6b5f61646163496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826874616e6b5f61646163496e74a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479f6656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c80677369676e657273f6686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "create_scheduled_tank": { + "params": { + "properties": { + "empty_bytes": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "execution_time": { + "type": "integer" + }, + "owner_payment_hash": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "owner_stake_hash": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "reward_ada": { + "type": "integer" + }, + "scheduled_ada": { + "type": "integer" + }, + "tank_ada": { + "type": "integer" + } + }, + "required": [ + "tank_ada", + "owner_payment_hash", + "owner_stake_hash", + "empty_bytes", + "execution_time", + "scheduled_ada", + "reward_ada" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e6365738066696e7075747381a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826874616e6b5f61646163496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747382a46761646472657373a1694576616c506172616da16b45787065637456616c7565826c74616e6b7573657261646472674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647387a1644c69737480a166537472756374a26b636f6e7374727563746f7200666669656c647382a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c756582726f776e65725f7061796d656e745f68617368654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c756582706f776e65725f7374616b655f68617368654279746573a1644c69737480a1694576616c506172616da16b45787065637456616c7565826e657865637574696f6e5f74696d6563496e74a166537472756374a26b636f6e7374727563746f7200666669656c647382a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c756582726f776e65725f7061796d656e745f68617368654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c756582706f776e65725f7374616b655f68617368654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647385a1694576616c506172616da16b45787065637456616c7565826b656d7074795f6279746573654279746573a1694576616c506172616da16b45787065637456616c7565826b656d7074795f6279746573654279746573a1694576616c506172616da16b45787065637456616c7565826d7363686564756c65645f61646163496e74a1664e756d6265721a000f4240a166537472756374a26b636f6e7374727563746f7201666669656c647380a166537472756374a26b636f6e7374727563746f7200666669656c647385a1694576616c506172616da16b45787065637456616c7565826b656d7074795f6279746573654279746573a1694576616c506172616da16b45787065637456616c7565826b656d7074795f6279746573654279746573a1694576616c506172616da16b45787065637456616c7565826a7265776172645f61646163496e74a1664e756d6265721a000f4240a166537472756374a26b636f6e7374727563746f7201666669656c64738066616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826874616e6b5f61646163496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826874616e6b5f61646163496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826874616e6b5f61646163496e74a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479f6656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c80677369676e657273f6686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "execute_scheduled": { + "params": { + "properties": { + "batcher_addr_cbor": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "batcher_signer_hash": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "dest_ada": { + "type": "integer" + }, + "ref_params_idx": { + "type": "integer" + }, + "ref_staking_idx": { + "type": "integer" + }, + "reward_ada": { + "type": "integer" + }, + "staker_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "tank_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + } + }, + "required": [ + "tank_utxo", + "staker_ref", + "batcher_addr_cbor", + "batcher_signer_hash", + "ref_staking_idx", + "ref_params_idx", + "dest_ada", + "reward_ada" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657383a1694576616c506172616da16b45787065637456616c7565826874616e6b5f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826a706172616d735f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826a7374616b65725f726566675574786f52656666696e7075747382a3646e616d656a74616e6b5f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826a74616e6b5f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826974616e6b5f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7203666669656c647385a1664e756d62657200a1694576616c506172616da16b45787065637456616c75658271626174636865725f616464725f63626f72654279746573a1694576616c506172616da16b45787065637456616c7565826f7265665f7374616b696e675f69647863496e74a1694576616c506172616da16b45787065637456616c7565826e7265665f706172616d735f69647863496e74a1664e756d62657200a3646e616d656d626174636865725f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826d626174636865725f696e707574a56761646472657373a1694576616c506172616da16b45787065637456616c756582676261746368657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b40a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747383a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c75658268646573745f61646163496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826b7265776172647361646472674164647265737365646174756d644e6f6e6566616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826a7265776172645f61646163496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826762617463686572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826d626174636865725f696e707574a56761646472657373a1694576616c506172616da16b45787065637456616c756582676261746368657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b40a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf4a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479a26573696e6365a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f7465756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d62657219012c656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582676261746368657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c75658273626174636865725f7369676e65725f68617368654279746573686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "stake_fldt": { + "params": { + "properties": { + "signer_hash": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "stake_amount": { + "type": "integer" + }, + "staker_nft_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "staker_redeemer_cbor": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + } + }, + "required": [ + "stake_amount", + "staker_nft_name", + "staker_redeemer_cbor", + "signer_hash" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657381a1694576616c506172616da16b45787065637456616c7565826a706172616d735f726566675574786f52656666696e7075747381a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a001e8480a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826b666c64745f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c75658269666c64745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c7374616b655f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747382a46761646472657373a1694576616c506172616da16b45787065637456616c7565826c74616e6b7573657261646472674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a00163a8ca16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826b666c64745f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c75658269666c64745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c7374616b655f616d6f756e7463496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826d7374616b65725f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826f7374616b65725f6e66745f6e616d6565427974657366616d6f756e74a1664e756d62657201686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a001e8480a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826b666c64745f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c75658269666c64745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c7374616b655f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a00163a8ca16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826b666c64745f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c75658269666c64745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c7374616b655f616d6f756e7463496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826d7374616b65725f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826f7374616b65725f6e66745f6e616d6565427974657366616d6f756e74a1664e756d62657201a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479f6656d696e747381a266616d6f756e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826d7374616b65725f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826f7374616b65725f6e66745f6e616d6565427974657366616d6f756e74a1664e756d626572016872656465656d6572a1694576616c506172616da16b45787065637456616c756582747374616b65725f72656465656d65725f63626f72654279746573656275726e7380656164686f63806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c7565826b7369676e65725f68617368654279746573686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "withdraw_tank": { + "params": { + "properties": { + "tank_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + } + }, + "required": [ + "tank_utxo" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657382a1694576616c506172616da16b45787065637456616c7565826874616e6b5f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826a706172616d735f726566675574786f52656666696e7075747382a3646e616d656a74616e6b5f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826a74616e6b5f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826974616e6b5f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7202666669656c647380a3646e616d656b6f776e65725f70726f6f66657574786f73a1694576616c506172616da16b457870656374496e707574826b6f776e65725f70726f6f66a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b40a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747381a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16341646482a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826a74616e6b5f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826974616e6b5f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826b6f776e65725f70726f6f66a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b40a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf4a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479f6656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c75658264757365726741646472657373686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + } + } +} \ No newline at end of file diff --git a/tracker/tests/fixtures/protocols/indigo.tii b/tracker/tests/fixtures/protocols/indigo.tii new file mode 100644 index 0000000..8173853 --- /dev/null +++ b/tracker/tests/fixtures/protocols/indigo.tii @@ -0,0 +1,680 @@ +{ + "environment": { + "properties": { + "cdp_creator_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cdp_creator_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cdp_creator_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "cdp_nft_mint_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "cdp_nft_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cdp_nft_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "cdp_spend_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "collector_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "iasset_mint_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "iasset_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "indy_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "indy_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "stability_pool_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "staking_manager_nft_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "staking_manager_nft_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "staking_position_mint_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "staking_position_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "staking_position_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "staking_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + } + }, + "required": [ + "iasset_policy_id", + "cdp_nft_policy_id", + "cdp_creator_policy_id", + "staking_manager_nft_policy_id", + "staking_position_policy_id", + "indy_policy_id", + "cdp_nft_name", + "cdp_creator_name", + "staking_manager_nft_name", + "staking_position_name", + "indy_name", + "cdp_spend_ref", + "cdp_creator_ref", + "collector_ref", + "iasset_mint_ref", + "cdp_nft_mint_ref", + "stability_pool_ref", + "staking_ref", + "staking_position_mint_ref" + ], + "type": "object" + }, + "parties": { + "cdpcreatorscript": {}, + "cdpscript": {}, + "cdpuseraddr": {}, + "collectorscript": {}, + "stabilitypoolscript": {}, + "stakingscript": {}, + "user": {} + }, + "profiles": { + "local": { + "environment": {}, + "parties": {} + }, + "mainnet": { + "environment": { + "cdp_creator_name": "4344505f43524541544f52", + "cdp_creator_policy_id": "735b37149eb0c2a5fb590bd60e39fe90ae3a96b6065b05d7aca99ebb", + "cdp_creator_ref": "b30b10cee01675b02a269c66fa9a420f4766a71b0ebbdd87c6eefbe22b48c59b#0", + "cdp_nft_mint_ref": "c0a4c2ad340da8686c723a21b0a029aefee650fcaf5ef964742f499efb7c21f8#0", + "cdp_nft_name": "434450", + "cdp_nft_policy_id": "708f5e6d597fc038d09a738d7be32edd6ea779d6feb32a53668d9050", + "cdp_spend_ref": "00430c1c2d2c57974069db6597184c8129a934ef0de6c701178bda822fd25a8a#0", + "collector_ref": "f0b4faf71b4ea83fa1a41eadd97d060863576adfc026b11e1fff106ca79e9956#0", + "iasset_mint_ref": "99329591f444f68ed4a33ed664c146fbf278cf9202067974cfa1a26d09a34107#0", + "iasset_policy_id": "f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b69880", + "indy_name": "494e4459", + "indy_policy_id": "533bb94a8850ee3ccbe483106489399112b74c905342cb1792a797a0", + "stability_pool_ref": "3356e6602d13e4fcc6563ca2c664b054d528cfe899f32258935d3e886f0d52a4#0", + "staking_manager_nft_name": "5354414b494e475f4d414e414745525f4e4654", + "staking_manager_nft_policy_id": "24b458412c2a7f9acb9c53c7ec4325b36806912ed56d2f91bfcf4d26", + "staking_position_mint_ref": "71dc6b81e8832192bb28ecbc6a4f71b6e0dc0407c708f169020804371450b4e7#0", + "staking_position_name": "5354414b494e475f504f534954494f4e", + "staking_position_policy_id": "fd0d72fafee1d230a74c31ac503a192abd5b71888ae3f94128c1e634", + "staking_ref": "b54cb6d920a3fe7cf59a562d3184688ad6a7cbd11b1e9dfdf13f8804541e11a1#0" + }, + "parties": { + "cdpcreatorscript": "addr1wyy3pau5vxn37arc9hx52rezkrpv4sc6kqmtvmyjry64mxgefqrn0", + "cdpscript": "addr1wyyqtkz5rken7jzptp076np606r79lmsrqjrqw8sdn4kvrqewrkdg", + "collectorscript": "addr1wyr4927ktgxfswlmrjwr3qxvvvkqnxar4ke0uvr6ld9mm8qrzhplw", + "stabilitypoolscript": "addr1wxywq2vsrptrm5gvfpsdnu6wmft0mdmlxqk6pcucqcs9xhqxh5ct9", + "stakingscript": "addr1wx3r0yl49yteuzwwlv7r0lr2uzq7p6v7nxl9ek645qy5rfgwwzxw6" + } + }, + "preprod": { + "environment": {}, + "parties": {} + }, + "preview": { + "environment": {}, + "parties": {} + } + }, + "protocol": { + "name": "indigo", + "scope": "indigoprotocol", + "version": "2.0.0" + }, + "tii": { + "version": "v1beta0" + }, + "transactions": { + "adjust_cdp_burn": { + "params": { + "properties": { + "accumulator": { + "type": "integer" + }, + "burn_amount": { + "type": "integer" + }, + "cdp_manager_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "cdp_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "collateral_change": { + "type": "integer" + }, + "collector_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "iasset_config_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "iasset_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "new_collateral": { + "type": "integer" + }, + "new_minted_total": { + "type": "integer" + }, + "oracle_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "owner_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "staking_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "timestamp_ms": { + "type": "integer" + } + }, + "required": [ + "owner_pkh", + "iasset_name", + "cdp_utxo", + "collector_utxo", + "staking_utxo", + "burn_amount", + "new_minted_total", + "new_collateral", + "timestamp_ms", + "accumulator", + "collateral_change", + "oracle_utxo", + "iasset_config_utxo", + "cdp_manager_utxo" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657387a1694576616c506172616da16b45787065637456616c7565826d6364705f7370656e645f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826b7374616b696e675f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826b6f7261636c655f7574786f675574786f526566a1694576616c506172616da16b45787065637456616c756582726961737365745f636f6e6669675f7574786f675574786f526566a1694576616c506172616da16b45787065637456616c756582706364705f6d616e616765725f7574786f675574786f526566a1694576616c506172616da16b45787065637456616c7565826d636f6c6c6563746f725f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826f6961737365745f6d696e745f726566675574786f52656666696e7075747384a3646e616d65696364705f696e707574657574786f73a1694576616c506172616da16b457870656374496e70757482696364705f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c756582686364705f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647383a1694576616c506172616da16b45787065637456616c7565826c74696d657374616d705f6d7363496e74a16b4576616c4275696c74496ea16353756282a1664e756d62657200a1694576616c506172616da16b45787065637456616c7565826b6275726e5f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658271636f6c6c61746572616c5f6368616e676563496e74a3646e616d656d7374616b696e675f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826d7374616b696e675f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c7374616b696e675f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7204666669656c647380a3646e616d656f636f6c6c6563746f725f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826f636f6c6c6563746f725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826e636f6c6c6563746f725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647380a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b6275726e5f616d6f756e7463496e7463726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747384a46761646472657373a1694576616c506172616da16b45787065637456616c7565826b6364707573657261646472674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647384a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d65654279746573a1694576616c506172616da16b45787065637456616c756582706e65775f6d696e7465645f746f74616c63496e74a166537472756374a26b636f6e7374727563746f7200666669656c647382a1694576616c506172616da16b45787065637456616c7565826c74696d657374616d705f6d7363496e74a1694576616c506172616da16b45787065637456616c7565826b616363756d756c61746f7263496e7466616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826e6e65775f636f6c6c61746572616c63496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582716364705f6e66745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826c6364705f6e66745f6e616d6565427974657366616d6f756e74a1664e756d62657201686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826d7374616b696e67736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c64738066616d6f756e74a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826d7374616b696e675f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c7374616b696e675f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826f636f6c6c6563746f72736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c64738066616d6f756e74a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826f636f6c6c6563746f725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826e636f6c6c6563746f725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16341646482a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b6275726e5f616d6f756e7463496e7463726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e70757482696364705f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c756582686364705f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826e6e65775f636f6c6c61746572616c63496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582716364705f6e66745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826c6364705f6e66745f6e616d6565427974657366616d6f756e74a1664e756d62657201a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b6275726e5f616d6f756e7463496e74686f7074696f6e616cf46876616c6964697479a26573696e6365a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f7465756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d626572190258656d696e747380656275726e7381a266616d6f756e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b6275726e5f616d6f756e7463496e746872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647380656164686f63806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "adjust_cdp_mint": { + "params": { + "properties": { + "accumulator": { + "type": "integer" + }, + "additional_mint": { + "type": "integer" + }, + "cdp_manager_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "cdp_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "collector_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "iasset_config_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "iasset_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "new_collateral": { + "type": "integer" + }, + "new_minted_total": { + "type": "integer" + }, + "oracle_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "owner_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "staking_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "timestamp_ms": { + "type": "integer" + } + }, + "required": [ + "owner_pkh", + "iasset_name", + "cdp_utxo", + "collector_utxo", + "staking_utxo", + "additional_mint", + "new_minted_total", + "new_collateral", + "timestamp_ms", + "accumulator", + "oracle_utxo", + "iasset_config_utxo", + "cdp_manager_utxo" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657387a1694576616c506172616da16b45787065637456616c7565826d6364705f7370656e645f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826b7374616b696e675f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826b6f7261636c655f7574786f675574786f526566a1694576616c506172616da16b45787065637456616c756582726961737365745f636f6e6669675f7574786f675574786f526566a1694576616c506172616da16b45787065637456616c756582706364705f6d616e616765725f7574786f675574786f526566a1694576616c506172616da16b45787065637456616c7565826d636f6c6c6563746f725f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826f6961737365745f6d696e745f726566675574786f52656666696e7075747384a3646e616d65696364705f696e707574657574786f73a1694576616c506172616da16b457870656374496e70757482696364705f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c756582686364705f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647383a1694576616c506172616da16b45787065637456616c7565826c74696d657374616d705f6d7363496e74a1694576616c506172616da16b45787065637456616c7565826f6164646974696f6e616c5f6d696e7463496e74a1664e756d62657200a3646e616d656d7374616b696e675f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826d7374616b696e675f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c7374616b696e675f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7204666669656c647380a3646e616d656f636f6c6c6563746f725f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826f636f6c6c6563746f725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826e636f6c6c6563746f725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647380a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747384a46761646472657373a1694576616c506172616da16b45787065637456616c7565826b6364707573657261646472674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647384a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d65654279746573a1694576616c506172616da16b45787065637456616c756582706e65775f6d696e7465645f746f74616c63496e74a166537472756374a26b636f6e7374727563746f7200666669656c647382a1694576616c506172616da16b45787065637456616c7565826c74696d657374616d705f6d7363496e74a1694576616c506172616da16b45787065637456616c7565826b616363756d756c61746f7263496e7466616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826e6e65775f636f6c6c61746572616c63496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582716364705f6e66745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826c6364705f6e66745f6e616d6565427974657366616d6f756e74a1664e756d62657201686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826d7374616b696e67736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c64738066616d6f756e74a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826d7374616b696e675f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c7374616b696e675f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826f636f6c6c6563746f72736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c64738066616d6f756e74a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826f636f6c6c6563746f725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826e636f6c6c6563746f725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16341646482a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e70757482696364705f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c756582686364705f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c7565826e6e65775f636f6c6c61746572616c63496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582716364705f6e66745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826c6364705f6e66745f6e616d6565427974657366616d6f756e74a1664e756d62657201a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826f6164646974696f6e616c5f6d696e7463496e74686f7074696f6e616cf46876616c6964697479a26573696e6365a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f7465756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d626572190258656d696e747381a266616d6f756e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826f6164646974696f6e616c5f6d696e7463496e746872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647380656275726e7380656164686f63806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "adjust_sp_account": { + "params": { + "properties": { + "acc_snapshot_d": { + "type": "integer" + }, + "acc_snapshot_epoch": { + "type": "integer" + }, + "acc_snapshot_p": { + "type": "integer" + }, + "acc_snapshot_s": { + "type": "integer" + }, + "acc_snapshot_scale": { + "type": "integer" + }, + "account_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "collector_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "deposit_change": { + "type": "integer" + }, + "iasset_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "output_addr": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "owner_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + } + }, + "required": [ + "owner_pkh", + "iasset_name", + "deposit_change", + "output_addr", + "collector_utxo", + "account_utxo", + "acc_snapshot_p", + "acc_snapshot_d", + "acc_snapshot_s", + "acc_snapshot_epoch", + "acc_snapshot_scale" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657382a1694576616c506172616da16b45787065637456616c7565827273746162696c6974795f706f6f6c5f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826d636f6c6c6563746f725f726566675574786f52656666696e7075747383a3646e616d656d6163636f756e745f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826d6163636f756e745f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c6163636f756e745f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7201666669656c647382a1694576616c506172616da16b45787065637456616c7565826e6465706f7369745f6368616e676563496e74a1694576616c506172616da16b45787065637456616c7565826b6f75747075745f61646472654279746573a3646e616d656f636f6c6c6563746f725f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826f636f6c6c6563746f725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826e636f6c6c6563746f725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647380a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747383a46761646472657373a1694576616c506172616da16b45787065637456616c7565827373746162696c697479706f6f6c736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7201666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647384a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d65654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647385a1694576616c506172616da16b45787065637456616c7565826e6163635f736e617073686f745f7063496e74a1694576616c506172616da16b45787065637456616c7565826e6163635f736e617073686f745f6463496e74a1694576616c506172616da16b45787065637456616c7565826e6163635f736e617073686f745f7363496e74a1694576616c506172616da16b45787065637456616c756582726163635f736e617073686f745f65706f636863496e74a1694576616c506172616da16b45787065637456616c756582726163635f736e617073686f745f7363616c6563496e74a166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7201666669656c647382a1694576616c506172616da16b45787065637456616c7565826e6465706f7369745f6368616e676563496e74a1694576616c506172616da16b45787065637456616c7565826b6f75747075745f6164647265427974657366616d6f756e74a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826d6163636f756e745f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c6163636f756e745f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826f636f6c6c6563746f72736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c64738066616d6f756e74a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826f636f6c6c6563746f725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826e636f6c6c6563746f725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479a26573696e6365a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f7465756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d626572190258656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "adjust_staking": { + "params": { + "properties": { + "adjust_amount": { + "type": "integer" + }, + "indy_asset_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "indy_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "owner_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "position_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + } + }, + "required": [ + "owner_pkh", + "indy_policy_id", + "indy_asset_name", + "adjust_amount", + "position_utxo" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657381a1694576616c506172616da16b45787065637456616c7565826b7374616b696e675f726566675574786f52656666696e7075747382a3646e616d656e706f736974696f6e5f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826e706f736974696f6e5f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826d706f736974696f6e5f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7203666669656c647381a1694576616c506172616da16b45787065637456616c7565826d61646a7573745f616d6f756e7463496e74a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826e696e64795f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826f696e64795f61737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826d61646a7573745f616d6f756e7463496e7463726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747382a46761646472657373a1694576616c506172616da16b45787065637456616c7565826d7374616b696e67736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c64738066616d6f756e74a16b4576616c4275696c74496ea16341646482a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826e706f736974696f6e5f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826d706f736974696f6e5f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826e696e64795f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826f696e64795f61737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826d61646a7573745f616d6f756e7463496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826e696e64795f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826f696e64795f61737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826d61646a7573745f616d6f756e7463496e7463726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826e696e64795f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826f696e64795f61737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826d61646a7573745f616d6f756e7463496e74686f7074696f6e616cf46876616c6964697479a26573696e6365a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f7465756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d626572190258656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "close_cdp": { + "params": { + "properties": { + "burn_amount": { + "type": "integer" + }, + "cdp_manager_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "cdp_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "collector_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "iasset_config_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "iasset_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "oracle_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "owner_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "pool_iasset": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "sp_snapshot_d": { + "type": "integer" + }, + "sp_snapshot_epoch": { + "type": "integer" + }, + "sp_snapshot_p": { + "type": "integer" + }, + "sp_snapshot_s": { + "type": "integer" + }, + "sp_snapshot_scale": { + "type": "integer" + }, + "stability_pool_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "staking_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "timestamp_ms": { + "type": "integer" + } + }, + "required": [ + "owner_pkh", + "iasset_name", + "cdp_utxo", + "collector_utxo", + "stability_pool_utxo", + "staking_utxo", + "burn_amount", + "timestamp_ms", + "pool_iasset", + "sp_snapshot_p", + "sp_snapshot_d", + "sp_snapshot_s", + "sp_snapshot_epoch", + "sp_snapshot_scale", + "oracle_utxo", + "iasset_config_utxo", + "cdp_manager_utxo" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657389a1694576616c506172616da16b45787065637456616c7565826d6364705f7370656e645f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826d636f6c6c6563746f725f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826f6961737365745f6d696e745f726566675574786f526566a1694576616c506172616da16b45787065637456616c756582706364705f6e66745f6d696e745f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565827273746162696c6974795f706f6f6c5f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826b7374616b696e675f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826b6f7261636c655f7574786f675574786f526566a1694576616c506172616da16b45787065637456616c756582726961737365745f636f6e6669675f7574786f675574786f526566a1694576616c506172616da16b45787065637456616c756582706364705f6d616e616765725f7574786f675574786f52656666696e7075747385a3646e616d65696364705f696e707574657574786f73a1694576616c506172616da16b457870656374496e70757482696364705f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c756582686364705f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7201666669656c647381a1694576616c506172616da16b45787065637456616c7565826c74696d657374616d705f6d7363496e74a3646e616d656f636f6c6c6563746f725f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826f636f6c6c6563746f725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826e636f6c6c6563746f725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647380a3646e616d656873705f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826873705f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565827373746162696c6974795f706f6f6c5f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7203666669656c647380a3646e616d656d7374616b696e675f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826d7374616b696e675f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c7374616b696e675f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7204666669656c647380a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b6275726e5f616d6f756e7463496e7463726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747384a46761646472657373a1694576616c506172616da16b45787065637456616c7565826d7374616b696e67736372697074674164647265737365646174756d644e6f6e6566616d6f756e74a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826d7374616b696e675f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c7374616b696e675f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826f636f6c6c6563746f72736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c64738066616d6f756e74a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826f636f6c6c6563746f725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826e636f6c6c6563746f725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565827373746162696c697479706f6f6c736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647382a1694576616c506172616da16b45787065637456616c7565826b706f6f6c5f696173736574654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647385a1694576616c506172616da16b45787065637456616c7565826d73705f736e617073686f745f7063496e74a1694576616c506172616da16b45787065637456616c7565826d73705f736e617073686f745f6463496e74a1694576616c506172616da16b45787065637456616c7565826d73705f736e617073686f745f7363496e74a1694576616c506172616da16b45787065637456616c7565827173705f736e617073686f745f65706f636863496e74a1694576616c506172616da16b45787065637456616c7565827173705f736e617073686f745f7363616c6563496e7466616d6f756e74a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826873705f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565827373746162696c6974795f706f6f6c5f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b6275726e5f616d6f756e7463496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16341646482a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b6275726e5f616d6f756e7463496e7463726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e70757482696364705f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c756582686364705f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582716364705f6e66745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826c6364705f6e66745f6e616d6565427974657366616d6f756e74a1664e756d62657201a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b6275726e5f616d6f756e7463496e74686f7074696f6e616cf46876616c6964697479a26573696e6365a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f7465756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d626572190258656d696e747380656275726e7382a266616d6f756e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582716364705f6e66745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826c6364705f6e66745f6e616d6565427974657366616d6f756e74a1664e756d626572016872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647380a266616d6f756e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b6275726e5f616d6f756e7463496e746872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647380656164686f63806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "close_sp_account": { + "params": { + "properties": { + "acc_snapshot_d": { + "type": "integer" + }, + "acc_snapshot_epoch": { + "type": "integer" + }, + "acc_snapshot_p": { + "type": "integer" + }, + "acc_snapshot_s": { + "type": "integer" + }, + "acc_snapshot_scale": { + "type": "integer" + }, + "account_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "collector_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "iasset_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "output_addr": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "owner_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + } + }, + "required": [ + "owner_pkh", + "iasset_name", + "output_addr", + "collector_utxo", + "account_utxo", + "acc_snapshot_p", + "acc_snapshot_d", + "acc_snapshot_s", + "acc_snapshot_epoch", + "acc_snapshot_scale" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657382a1694576616c506172616da16b45787065637456616c7565827273746162696c6974795f706f6f6c5f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826d636f6c6c6563746f725f726566675574786f52656666696e7075747383a3646e616d656d6163636f756e745f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826d6163636f756e745f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c6163636f756e745f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7202666669656c647381a1694576616c506172616da16b45787065637456616c7565826b6f75747075745f61646472654279746573a3646e616d656f636f6c6c6563746f725f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826f636f6c6c6563746f725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826e636f6c6c6563746f725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647380a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747383a46761646472657373a1694576616c506172616da16b45787065637456616c7565827373746162696c697479706f6f6c736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7201666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647384a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d65654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647385a1694576616c506172616da16b45787065637456616c7565826e6163635f736e617073686f745f7063496e74a1694576616c506172616da16b45787065637456616c7565826e6163635f736e617073686f745f6463496e74a1694576616c506172616da16b45787065637456616c7565826e6163635f736e617073686f745f7363496e74a1694576616c506172616da16b45787065637456616c756582726163635f736e617073686f745f65706f636863496e74a1694576616c506172616da16b45787065637456616c756582726163635f736e617073686f745f7363616c6563496e74a166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7202666669656c647381a1694576616c506172616da16b45787065637456616c7565826b6f75747075745f6164647265427974657366616d6f756e74a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826d6163636f756e745f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c6163636f756e745f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826f636f6c6c6563746f72736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c64738066616d6f756e74a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826f636f6c6c6563746f725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826e636f6c6c6563746f725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479a26573696e6365a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f7465756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d626572190258656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "create_cdp": { + "params": { + "properties": { + "cdp_manager_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "collateral_lovelace": { + "type": "integer" + }, + "collector_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "creator_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "iasset_config_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "iasset_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "interest_accumulator": { + "type": "integer" + }, + "mint_amount": { + "type": "integer" + }, + "oracle_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "owner_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "timestamp_ms": { + "type": "integer" + } + }, + "required": [ + "owner_pkh", + "iasset_name", + "mint_amount", + "collateral_lovelace", + "timestamp_ms", + "interest_accumulator", + "collector_utxo", + "creator_utxo", + "oracle_utxo", + "iasset_config_utxo", + "cdp_manager_utxo" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657387a1694576616c506172616da16b45787065637456616c7565826f6364705f63726561746f725f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826d636f6c6c6563746f725f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826f6961737365745f6d696e745f726566675574786f526566a1694576616c506172616da16b45787065637456616c756582706364705f6e66745f6d696e745f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826b6f7261636c655f7574786f675574786f526566a1694576616c506172616da16b45787065637456616c756582726961737365745f636f6e6669675f7574786f675574786f526566a1694576616c506172616da16b45787065637456616c756582706364705f6d616e616765725f7574786f675574786f52656666696e7075747383a3646e616d656f636f6c6c6563746f725f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826f636f6c6c6563746f725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826e636f6c6c6563746f725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647380a3646e616d656d63726561746f725f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826d63726561746f725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c63726561746f725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647384a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573a1694576616c506172616da16b45787065637456616c7565826b6d696e745f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c75658273636f6c6c61746572616c5f6c6f76656c61636563496e74a1694576616c506172616da16b45787065637456616c7565826c74696d657374616d705f6d7363496e74a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c75658273636f6c6c61746572616c5f6c6f76656c61636563496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747384a46761646472657373a1694576616c506172616da16b45787065637456616c7565826b6364707573657261646472674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647384a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d65654279746573a1694576616c506172616da16b45787065637456616c7565826b6d696e745f616d6f756e7463496e74a166537472756374a26b636f6e7374727563746f7200666669656c647382a1694576616c506172616da16b45787065637456616c7565826c74696d657374616d705f6d7363496e74a1694576616c506172616da16b45787065637456616c75658274696e7465726573745f616363756d756c61746f7263496e7466616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c75658273636f6c6c61746572616c5f6c6f76656c61636563496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582716364705f6e66745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826c6364705f6e66745f6e616d6565427974657366616d6f756e74a1664e756d62657201686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565827063647063726561746f72736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c64738066616d6f756e74a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826d63726561746f725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c63726561746f725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826f636f6c6c6563746f72736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c64738066616d6f756e74a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826f636f6c6c6563746f725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826e636f6c6c6563746f725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c75658273636f6c6c61746572616c5f6c6f76656c61636563496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c75658273636f6c6c61746572616c5f6c6f76656c61636563496e74a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b6d696e745f616d6f756e7463496e74686f7074696f6e616cf46876616c6964697479a26573696e6365a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f7465756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d626572190258656d696e747382a266616d6f756e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582716364705f6e66745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826c6364705f6e66745f6e616d6565427974657366616d6f756e74a1664e756d626572016872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647380a266616d6f756e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b6d696e745f616d6f756e7463496e746872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647380656275726e7380656164686f63806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "create_sp_account": { + "params": { + "properties": { + "collector_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "deposit_amount": { + "type": "integer" + }, + "iasset_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "owner_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "sp_snapshot_d": { + "type": "integer" + }, + "sp_snapshot_epoch": { + "type": "integer" + }, + "sp_snapshot_p": { + "type": "integer" + }, + "sp_snapshot_s": { + "type": "integer" + }, + "sp_snapshot_scale": { + "type": "integer" + }, + "sp_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + } + }, + "required": [ + "owner_pkh", + "iasset_name", + "deposit_amount", + "collector_utxo", + "sp_utxo", + "sp_snapshot_p", + "sp_snapshot_d", + "sp_snapshot_s", + "sp_snapshot_epoch", + "sp_snapshot_scale" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657382a1694576616c506172616da16b45787065637456616c7565827273746162696c6974795f706f6f6c5f726566675574786f526566a1694576616c506172616da16b45787065637456616c7565826d636f6c6c6563746f725f726566675574786f52656666696e7075747383a3646e616d656873705f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826873705f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826773705f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647380a3646e616d656f636f6c6c6563746f725f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826f636f6c6c6563746f725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826e636f6c6c6563746f725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647380a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826e6465706f7369745f616d6f756e7463496e7463726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747383a46761646472657373a1694576616c506172616da16b45787065637456616c7565827373746162696c697479706f6f6c736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647382a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d65654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647385a1694576616c506172616da16b45787065637456616c7565826d73705f736e617073686f745f7063496e74a1694576616c506172616da16b45787065637456616c7565826d73705f736e617073686f745f6463496e74a1694576616c506172616da16b45787065637456616c7565826d73705f736e617073686f745f7363496e74a1694576616c506172616da16b45787065637456616c7565827173705f736e617073686f745f65706f636863496e74a1694576616c506172616da16b45787065637456616c7565827173705f736e617073686f745f7363616c6563496e7466616d6f756e74a16b4576616c4275696c74496ea16341646482a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826873705f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826773705f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826e6465706f7369745f616d6f756e7463496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826f636f6c6c6563746f72736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c64738066616d6f756e74a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826f636f6c6c6563746f725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826e636f6c6c6563746f725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826e6465706f7369745f616d6f756e7463496e7463726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582706961737365745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826b6961737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826e6465706f7369745f616d6f756e7463496e74686f7074696f6e616cf46876616c6964697479a26573696e6365a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f7465756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d626572190258656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "create_staking": { + "params": { + "properties": { + "current_snapshot_ada": { + "type": "integer" + }, + "indy_amount": { + "type": "integer" + }, + "manager_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "old_total_stake": { + "type": "integer" + }, + "owner_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + } + }, + "required": [ + "owner_pkh", + "indy_amount", + "manager_utxo", + "old_total_stake", + "current_snapshot_ada" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657382a1694576616c506172616da16b45787065637456616c7565826b7374616b696e675f726566675574786f526566a1694576616c506172616da16b45787065637456616c75658278197374616b696e675f706f736974696f6e5f6d696e745f726566675574786f52656666696e7075747382a3646e616d656d6d616e616765725f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826d6d616e616765725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c6d616e616765725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826e696e64795f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c75658269696e64795f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b696e64795f616d6f756e7463496e74a16c4576616c436f6d70696c6572a16e436f6d707574654d696e5574786fa1664e756d62657201a16c4576616c436f6d70696c6572a16e436f6d707574654d696e5574786fa1664e756d6265720263726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747383a46761646472657373a1694576616c506172616da16b45787065637456616c7565826d7374616b696e67736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647382a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826f6f6c645f746f74616c5f7374616b6563496e74a1694576616c506172616da16b45787065637456616c7565826b696e64795f616d6f756e7463496e74a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c7565827463757272656e745f736e617073686f745f61646163496e7466616d6f756e74a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826d6d616e616765725f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c6d616e616765725f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826d7374616b696e67736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7201666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647383a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573a1634d617080a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c7565827463757272656e745f736e617073686f745f61646163496e7466616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c6572a16e436f6d707574654d696e5574786fa1664e756d62657201a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826e696e64795f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c75658269696e64795f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b696e64795f616d6f756e7463496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582781a7374616b696e675f706f736974696f6e5f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582757374616b696e675f706f736974696f6e5f6e616d6565427974657366616d6f756e74a1664e756d62657201686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826e696e64795f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c75658269696e64795f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b696e64795f616d6f756e7463496e74a16c4576616c436f6d70696c6572a16e436f6d707574654d696e5574786fa1664e756d62657201a16c4576616c436f6d70696c6572a16e436f6d707574654d696e5574786fa1664e756d6265720263726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826e696e64795f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c75658269696e64795f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826b696e64795f616d6f756e7463496e74a16c4576616c436f6d70696c6572a16e436f6d707574654d696e5574786fa1664e756d62657201686f7074696f6e616cf46876616c6964697479f6656d696e747381a266616d6f756e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582781a7374616b696e675f706f736974696f6e5f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582757374616b696e675f706f736974696f6e5f6e616d6565427974657366616d6f756e74a1664e756d626572016872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647380656275726e7380656164686f63806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "unstake": { + "params": { + "properties": { + "owner_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "position_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + } + }, + "required": [ + "owner_pkh", + "position_utxo" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657381a1694576616c506172616da16b45787065637456616c7565826b7374616b696e675f726566675574786f52656666696e7075747382a3646e616d656e706f736974696f6e5f696e707574657574786f73a1694576616c506172616da16b457870656374496e707574826e706f736974696f6e5f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826d706f736974696f6e5f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7204666669656c647380a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747381a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16341646482a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826e706f736974696f6e5f696e707574a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826d706f736974696f6e5f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479a26573696e6365a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f7465756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d626572190258656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + } + } +} \ No newline at end of file diff --git a/tracker/tests/fixtures/protocols/strike-staking.tii b/tracker/tests/fixtures/protocols/strike-staking.tii new file mode 100644 index 0000000..acf45fb --- /dev/null +++ b/tracker/tests/fixtures/protocols/strike-staking.tii @@ -0,0 +1,143 @@ +{ + "environment": { + "properties": { + "mint_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "staking_asset_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "staking_policy_id": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "strike_script_ref": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + }, + "tracker_asset_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + } + }, + "required": [ + "staking_policy_id", + "staking_asset_name", + "mint_policy_id", + "tracker_asset_name", + "strike_script_ref" + ], + "type": "object" + }, + "parties": { + "staker": {}, + "stakingscript": {} + }, + "profiles": { + "local": { + "environment": {}, + "parties": {} + }, + "mainnet": { + "environment": { + "mint_policy_id": "497a8b0085517f1c9065cf3006af4c266454b39c6fa32a9d116c75ee", + "staking_asset_name": "535452494b45", + "staking_policy_id": "f13ac4d66b3ee19a6aa0f2a22298737bd907cc95121662fc971b5275", + "strike_script_ref": "486c6c010d1518b1e032d2a288483fba55cee4f054b6e97f4e7eadeccb173768#0", + "tracker_asset_name": "535452494b45" + }, + "parties": { + "stakingscript": "addr1z9yh4zcqs4gh78ysvh8nqp40fsnxg49nn3h6x25az9k8tms6409492020k6xml8uvwn34wrexagjh5fsk5xk96jyxk2qf3a7kj" + } + }, + "preprod": { + "environment": {}, + "parties": {} + }, + "preview": { + "environment": {}, + "parties": {} + } + }, + "protocol": { + "name": "strike-staking", + "scope": "strike-finance", + "version": "0.1.0" + }, + "tii": { + "version": "v1beta0" + }, + "transactions": { + "add_stake": { + "params": { + "properties": { + "additional_amount": { + "type": "integer" + }, + "owner_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "staking_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + } + }, + "required": [ + "owner_pkh", + "staking_utxo", + "additional_amount" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657381a1694576616c506172616da16b45787065637456616c75658271737472696b655f7363726970745f726566675574786f52656666696e7075747382a3646e616d656d63757272656e745f7374616b65657574786f73a1694576616c506172616da16b457870656374496e707574826d63757272656e745f7374616b65a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c7374616b696e675f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647380a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582667374616b657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582717374616b696e675f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582727374616b696e675f61737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c756582716164646974696f6e616c5f616d6f756e7463496e7463726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747382a46761646472657373a1694576616c506172616da16b45787065637456616c7565826d7374616b696e67736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647383a16b4576616c4275696c74496ea16850726f706572747982a16a4576616c436f65726365a169496e746f446174756da1694576616c506172616da16b457870656374496e707574826d63757272656e745f7374616b65a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c7374616b696e675f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4a1664e756d62657200a16b4576616c4275696c74496ea16850726f706572747982a16a4576616c436f65726365a169496e746f446174756da1694576616c506172616da16b457870656374496e707574826d63757272656e745f7374616b65a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c7374616b696e675f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4a1664e756d62657201a16b4576616c4275696c74496ea16850726f706572747982a16a4576616c436f65726365a169496e746f446174756da1694576616c506172616da16b457870656374496e707574826d63757272656e745f7374616b65a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c7374616b696e675f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4a1664e756d6265720266616d6f756e74a16b4576616c4275696c74496ea16341646482a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826d63757272656e745f7374616b65a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c7374616b696e675f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582717374616b696e675f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582727374616b696e675f61737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c756582716164646974696f6e616c5f616d6f756e7463496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c756582667374616b6572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582667374616b657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582717374616b696e675f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582727374616b696e675f61737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c756582716164646974696f6e616c5f616d6f756e7463496e7463726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582717374616b696e675f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582727374616b696e675f61737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c756582716164646974696f6e616c5f616d6f756e7463496e74686f7074696f6e616cf46876616c6964697479f6656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582667374616b657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "stake": { + "params": { + "properties": { + "amount": { + "type": "integer" + }, + "owner_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "staked_at": { + "type": "integer" + } + }, + "required": [ + "owner_pkh", + "amount", + "staked_at" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657381a1694576616c506172616da16b45787065637456616c75658271737472696b655f7363726970745f726566675574786f52656666696e7075747381a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582667374616b657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a002625a0a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582717374616b696e675f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582727374616b696e675f61737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c75658266616d6f756e7463496e7463726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747382a46761646472657373a1694576616c506172616da16b45787065637456616c7565826d7374616b696e67736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647383a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573a1694576616c506172616da16b45787065637456616c756582697374616b65645f617463496e74a1694576616c506172616da16b45787065637456616c7565826e6d696e745f706f6c6963795f696465427974657366616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a002625a0a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582717374616b696e675f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582727374616b696e675f61737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c75658266616d6f756e7463496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826e6d696e745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c75658272747261636b65725f61737365745f6e616d6565427974657366616d6f756e74a1664e756d62657201a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826e6d696e745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b6865427974657366616d6f756e74a1664e756d62657201686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c756582667374616b6572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582667374616b657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a002625a0a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582717374616b696e675f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582727374616b696e675f61737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c75658266616d6f756e7463496e7463726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a002625a0a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582717374616b696e675f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582727374616b696e675f61737365745f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c75658266616d6f756e7463496e74686f7074696f6e616cf46876616c6964697479a26573696e6365644e6f6e6565756e74696ca16b4576616c4275696c74496ea16341646482a16c4576616c436f6d70696c65726e436f6d70757465546970536c6f74a1664e756d62657218c8656d696e747381a266616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826e6d696e745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c75658272747261636b65725f61737365745f6e616d6565427974657366616d6f756e74a1664e756d62657201a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826e6d696e745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b6865427974657366616d6f756e74a1664e756d626572016872656465656d6572a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c75658266616d6f756e7463496e74656275726e7380656164686f63806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582667374616b657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "withdraw_stake": { + "params": { + "properties": { + "owner_pkh": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "staking_utxo": { + "$ref": "https://tx3.land/specs/v1beta0/core#UtxoRef" + } + }, + "required": [ + "owner_pkh", + "staking_utxo" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e63657381a1694576616c506172616da16b45787065637456616c75658271737472696b655f7363726970745f726566675574786f52656666696e7075747382a3646e616d656d63757272656e745f7374616b65657574786f73a1694576616c506172616da16b457870656374496e707574826d63757272656e745f7374616b65a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c7374616b696e675f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf46872656465656d6572a166537472756374a26b636f6e7374727563746f7201666669656c647380a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582667374616b657267416464726573736a6d696e5f616d6f756e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747381a46761646472657373a1694576616c506172616da16b45787065637456616c756582667374616b6572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16341646482a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e707574826d63757272656e745f7374616b65a56761646472657373644e6f6e656a6d696e5f616d6f756e74644e6f6e6563726566a1694576616c506172616da16b45787065637456616c7565826c7374616b696e675f7574786f675574786f526566646d616e79f46a636f6c6c61746572616cf4a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582667374616b657267416464726573736a6d696e5f616d6f756e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f56a636f6c6c61746572616cf4a1694576616c506172616d6a45787065637446656573a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826e6d696e745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c75658272747261636b65725f61737365745f6e616d6565427974657366616d6f756e74a1664e756d62657201a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826e6d696e745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b6865427974657366616d6f756e74a1664e756d62657201686f7074696f6e616cf46876616c6964697479f6656d696e747380656275726e7381a266616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826e6d696e745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c75658272747261636b65725f61737365745f6e616d6565427974657366616d6f756e74a1664e756d62657201a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826e6d696e745f706f6c6963795f69646542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b6865427974657366616d6f756e74a1664e756d626572016872656465656d6572a166537472756374a26b636f6e7374727563746f7201666669656c647381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573656164686f63806a636f6c6c61746572616c81a1657574786f73a1694576616c506172616da16b457870656374496e707574826a636f6c6c61746572616ca56761646472657373a1694576616c506172616da16b45787065637456616c756582667374616b657267416464726573736a6d696e5f616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1664e756d6265721a004c4b4063726566644e6f6e65646d616e79f46a636f6c6c61746572616cf5677369676e657273a1677369676e65727381a1694576616c506172616da16b45787065637456616c756582696f776e65725f706b68654279746573686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + } + } +} \ No newline at end of file diff --git a/tracker/tests/fixtures/protocols/vyfi.tii b/tracker/tests/fixtures/protocols/vyfi.tii new file mode 100644 index 0000000..3880915 --- /dev/null +++ b/tracker/tests/fixtures/protocols/vyfi.tii @@ -0,0 +1,191 @@ +{ + "environment": { + "properties": { + "process_fee": { + "type": "integer" + } + }, + "required": [ + "process_fee" + ], + "type": "object" + }, + "parties": { + "orderscript": {}, + "user": {} + }, + "profiles": { + "local": { + "environment": {}, + "parties": {} + }, + "mainnet": { + "environment": { + "process_fee": 1900000 + }, + "parties": {} + }, + "preprod": { + "environment": {}, + "parties": {} + }, + "preview": { + "environment": {}, + "parties": {} + } + }, + "protocol": { + "name": "vyfi", + "scope": "vyfi", + "version": "0.1.0" + }, + "tii": { + "version": "v1beta0" + }, + "transactions": { + "add_liquidity": { + "params": { + "properties": { + "ada_amount": { + "type": "integer" + }, + "desired_lp": { + "type": "integer" + }, + "token_amount": { + "type": "integer" + }, + "token_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "token_policy": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "user_creds": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + } + }, + "required": [ + "user_creds", + "ada_amount", + "token_policy", + "token_name", + "token_amount", + "desired_lp" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e6365738066696e7075747381a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826a6164615f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c7565826b70726f636573735f66656563496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826c746f6b656e5f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826a746f6b656e5f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c746f6b656e5f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747382a46761646472657373a1694576616c506172616da16b45787065637456616c7565826b6f72646572736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647382a1694576616c506172616da16b45787065637456616c7565826a757365725f6372656473654279746573a166537472756374a26b636f6e7374727563746f7200666669656c647381a1694576616c506172616da16b45787065637456616c7565826a646573697265645f6c7063496e7466616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826a6164615f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c7565826b70726f636573735f66656563496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826c746f6b656e5f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826a746f6b656e5f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c746f6b656e5f616d6f756e7463496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826a6164615f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c7565826b70726f636573735f66656563496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826c746f6b656e5f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826a746f6b656e5f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c746f6b656e5f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826a6164615f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c7565826b70726f636573735f66656563496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826c746f6b656e5f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826a746f6b656e5f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c746f6b656e5f616d6f756e7463496e74a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479f6656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c80677369676e657273f6686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "remove_liquidity": { + "params": { + "properties": { + "lp_amount": { + "type": "integer" + }, + "lp_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "lp_policy": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "min_out_ada": { + "type": "integer" + }, + "min_out_token": { + "type": "integer" + }, + "order_ada": { + "type": "integer" + }, + "user_creds": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + } + }, + "required": [ + "user_creds", + "lp_policy", + "lp_name", + "lp_amount", + "min_out_ada", + "min_out_token", + "order_ada" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e6365738066696e7075747381a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c756582696f726465725f61646163496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582696c705f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582676c705f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c756582696c705f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747382a46761646472657373a1694576616c506172616da16b45787065637456616c7565826b6f72646572736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647382a1694576616c506172616da16b45787065637456616c7565826a757365725f6372656473654279746573a166537472756374a26b636f6e7374727563746f7201666669656c647381a166537472756374a26b636f6e7374727563746f7200666669656c647382a1694576616c506172616da16b45787065637456616c7565826b6d696e5f6f75745f61646163496e74a1694576616c506172616da16b45787065637456616c7565826d6d696e5f6f75745f746f6b656e63496e7466616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c756582696f726465725f61646163496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582696c705f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582676c705f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c756582696c705f616d6f756e7463496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c756582696f726465725f61646163496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582696c705f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582676c705f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c756582696c705f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c756582696f726465725f61646163496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c756582696c705f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c756582676c705f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c756582696c705f616d6f756e7463496e74a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479f6656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c80677369676e657273f6686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "swap_a_to_b": { + "params": { + "properties": { + "min_out": { + "type": "integer" + }, + "swap_amount": { + "type": "integer" + }, + "user_creds": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + } + }, + "required": [ + "user_creds", + "swap_amount", + "min_out" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e6365738066696e7075747381a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826b737761705f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c7565826b70726f636573735f66656563496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747382a46761646472657373a1694576616c506172616da16b45787065637456616c7565826b6f72646572736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647382a1694576616c506172616da16b45787065637456616c7565826a757365725f6372656473654279746573a166537472756374a26b636f6e7374727563746f7203666669656c647381a1694576616c506172616da16b45787065637456616c756582676d696e5f6f757463496e7466616d6f756e74a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826b737761705f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c7565826b70726f636573735f66656563496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826b737761705f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c7565826b70726f636573735f66656563496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16341646482a1694576616c506172616da16b45787065637456616c7565826b737761705f616d6f756e7463496e74a1694576616c506172616da16b45787065637456616c7565826b70726f636573735f66656563496e74a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479f6656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c80677369676e657273f6686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + }, + "swap_b_to_a": { + "params": { + "properties": { + "min_out": { + "type": "integer" + }, + "order_ada": { + "type": "integer" + }, + "token_amount": { + "type": "integer" + }, + "token_name": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "token_policy": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + }, + "user_creds": { + "$ref": "https://tx3.land/specs/v1beta0/core#Bytes" + } + }, + "required": [ + "user_creds", + "token_policy", + "token_name", + "token_amount", + "min_out", + "order_ada" + ], + "type": "object" + }, + "tir": { + "content": "ab6466656573a1694576616c506172616d6a457870656374466565736a7265666572656e6365738066696e7075747381a3646e616d6566736f75726365657574786f73a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c756582696f726465725f61646163496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826c746f6b656e5f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826a746f6b656e5f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c746f6b656e5f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf46872656465656d6572644e6f6e65676f75747075747382a46761646472657373a1694576616c506172616da16b45787065637456616c7565826b6f72646572736372697074674164647265737365646174756da166537472756374a26b636f6e7374727563746f7200666669656c647382a1694576616c506172616da16b45787065637456616c7565826a757365725f6372656473654279746573a166537472756374a26b636f6e7374727563746f7204666669656c647381a1694576616c506172616da16b45787065637456616c756582676d696e5f6f757463496e7466616d6f756e74a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c756582696f726465725f61646163496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826c746f6b656e5f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826a746f6b656e5f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c746f6b656e5f616d6f756e7463496e74686f7074696f6e616cf4a46761646472657373a1694576616c506172616da16b45787065637456616c7565826475736572674164647265737365646174756d644e6f6e6566616d6f756e74a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16b4576616c4275696c74496ea16353756282a16a4576616c436f65726365a16a496e746f417373657473a1694576616c506172616da16b457870656374496e7075748266736f75726365a56761646472657373a1694576616c506172616da16b45787065637456616c756582647573657267416464726573736a6d696e5f616d6f756e74a16b4576616c4275696c74496ea16341646482a16b4576616c4275696c74496ea16341646482a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c756582696f726465725f61646163496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826c746f6b656e5f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826a746f6b656e5f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c746f6b656e5f616d6f756e7463496e74a1694576616c506172616d6a4578706563744665657363726566644e6f6e65646d616e79f46a636f6c6c61746572616cf4a16641737365747381a366706f6c696379644e6f6e656a61737365745f6e616d65644e6f6e6566616d6f756e74a1694576616c506172616da16b45787065637456616c756582696f726465725f61646163496e74a16641737365747381a366706f6c696379a1694576616c506172616da16b45787065637456616c7565826c746f6b656e5f706f6c6963796542797465736a61737365745f6e616d65a1694576616c506172616da16b45787065637456616c7565826a746f6b656e5f6e616d6565427974657366616d6f756e74a1694576616c506172616da16b45787065637456616c7565826c746f6b656e5f616d6f756e7463496e74a1694576616c506172616d6a45787065637446656573686f7074696f6e616cf46876616c6964697479f6656d696e747380656275726e7380656164686f63806a636f6c6c61746572616c80677369676e657273f6686d6574616461746180", + "encoding": "hex", + "version": "v1beta0" + } + } + } +} \ No newline at end of file diff --git a/tracker/tests/gating_real_txs.rs b/tracker/tests/gating_real_txs.rs new file mode 100644 index 0000000..23d8b86 --- /dev/null +++ b/tracker/tests/gating_real_txs.rs @@ -0,0 +1,98 @@ +// `tii` / `txs` fields of SpecializedTii are constructed but never read here. +#![allow(dead_code)] + +use std::path::PathBuf; + +use tx3_registry_tracker::discovery::DiscoveredSource; +use tx3_registry_tracker::specialization::specialize_all; +use tx3_sdk::tii::spec::TiiFile; + +/// Build a `DiscoveredSource` from `tests/fixtures/protocols/.tii`. +fn source(name: &str) -> DiscoveredSource { + let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("tests/fixtures/protocols") + .join(format!("{name}.tii")); + let raw = std::fs::read_to_string(&path) + .unwrap_or_else(|e| panic!("failed to read {}: {}", path.display(), e)); + let tii: TiiFile = serde_json::from_str(&raw) + .unwrap_or_else(|e| panic!("failed to parse {}: {}", path.display(), e)); + + DiscoveredSource { + source_name: name.to_string(), + scope: "test".to_string(), + name: name.to_string(), + version: "0.0.0".to_string(), + tii, + profile_name: "mainnet".to_string(), + } +} + +// ── negative: DEX swap — only carries iUSD (soft anchor) ──────────────────── + +/// Real mainnet tx 06a73a03f46b4c79137c76880257e6789316ddcba27705e556f0d8e940f0788f +/// was the live-run false positive that motivated the anchor-strength gating +/// change. It is a DEX iUSD swap: the tx carries the iAsset policy +/// `f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b69880` in its output +/// value, which is an indigo anchor — but only as circulating value (soft). +/// No indigo script was executed and no indigo stateful output was created, so +/// the anchor must NOT gate. The only intersection is that single value-policy +/// → `total == 1`, `gates() == false`. +#[test] +fn dex_swap_iusd_does_not_gate_indigo() { + let active = specialize_all(&[source("indigo")]) + .expect("specialize_all on indigo/mainnet must succeed"); + assert_eq!(active.len(), 1, "indigo/mainnet must survive the filter"); + let anchors = &active[0].anchors; + + let bytes = + hex::decode(include_str!("fixtures/dex_swap_iusd_06a73a03.cbor.hex").trim()).unwrap(); + let payload = tx3_lift_cardano::payload::CardanoPayload::from_cbor(bytes).unwrap(); + let summary = tx3_lift_cardano::summarize::summarize(&payload).unwrap(); + + let hits = anchors.hits(&summary); + assert_eq!( + hits.total, 1, + "DEX swap carries iAsset value-policy (one soft anchor); expected total == 1, got {}", + hits.total + ); + assert!( + !hits.gates(), + "DEX swap must NOT gate indigo (value-policy-only is soft); got gating={}", + hits.gating + ); +} + +// ── positive: indigo create_staking — runs scripts / creates stateful outputs ─ + +/// Real mainnet tx c54778b4fcb6741eed0d96763328673b4fa9947e0c6e5f29a735197fa94c7279 +/// is a genuine indigo `create_staking` interaction. It creates a +/// datum-bearing output at an indigo staking script address, mints a +/// control-NFT under an indigo anchor policy, and references at least two +/// indigo deployed-script UTxOs — all gating-tier signals. The tx must gate +/// the indigo/mainnet anchor set: `gates() == true` and `gating >= 1`. +#[test] +fn indigo_create_staking_gates_indigo() { + let active = specialize_all(&[source("indigo")]) + .expect("specialize_all on indigo/mainnet must succeed"); + assert_eq!(active.len(), 1, "indigo/mainnet must survive the filter"); + let anchors = &active[0].anchors; + + let bytes = + hex::decode(include_str!("fixtures/indigo_create_staking_c54778b4.cbor.hex").trim()) + .unwrap(); + let payload = tx3_lift_cardano::payload::CardanoPayload::from_cbor(bytes).unwrap(); + let summary = tx3_lift_cardano::summarize::summarize(&payload).unwrap(); + + let hits = anchors.hits(&summary); + assert!( + hits.gating >= 1, + "indigo create_staking must have at least one gating anchor hit; got gating={}", + hits.gating + ); + assert!( + hits.gates(), + "indigo create_staking must gate indigo; got gating={}, total={}", + hits.gating, + hits.total + ); +} diff --git a/tracker/tests/over_matching_regression.rs b/tracker/tests/over_matching_regression.rs new file mode 100644 index 0000000..aab80a9 --- /dev/null +++ b/tracker/tests/over_matching_regression.rs @@ -0,0 +1,244 @@ +// `tii` / `txs` fields of SpecializedTii are constructed but never read here. +#![allow(dead_code)] + +use std::collections::BTreeSet; +use std::path::PathBuf; + +use serde_bytes::ByteBuf; +use tx3_lift::payload::PayloadSummary; +use tx3_lift::specialize::decode_bech32_address; +use tx3_registry_tracker::discovery::DiscoveredSource; +use tx3_registry_tracker::specialization::specialize_all; +use tx3_sdk::tii::spec::TiiFile; + +/// Build a `DiscoveredSource` from `tests/fixtures/protocols/.tii`. +fn source(name: &str) -> DiscoveredSource { + let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("tests/fixtures/protocols") + .join(format!("{name}.tii")); + let raw = std::fs::read_to_string(&path) + .unwrap_or_else(|e| panic!("failed to read {}: {}", path.display(), e)); + let tii: TiiFile = serde_json::from_str(&raw) + .unwrap_or_else(|e| panic!("failed to parse {}: {}", path.display(), e)); + + DiscoveredSource { + source_name: name.to_string(), + scope: "test".to_string(), + name: name.to_string(), + version: "0.0.0".to_string(), + tii, + profile_name: "mainnet".to_string(), + } +} + +/// Build a `PayloadSummary` shaped like mainnet tx `5cfda5da…f440` (slot +/// 187665793) — the tx that triggered the over-matching incident. The key +/// property is that **none** of the addresses or input refs belong to any of +/// the five configured protocols. +/// +/// Prefixes from the issue doc (truncated there with `…`; padded to full +/// length below with filler bytes — the padding provably matches no anchor): +/// input[0] 0x31 c727443d77df6cff 95dca383994f4c30 24d03ff56b02ecc2 2b0f3f65 … (script-like) +/// input[1] 0x01 5090306a888fde7e 4500aefd4ccd9605 5043de31e56ef28d c27dd4d8 … (payment) +/// output[*] 0x01 5090306a888fde7e 4500aefd4ccd9605 5043de31e56ef28d c27dd4d8 … (payment) +/// +/// The txids used in `input_refs` are synthetic — just random-looking 32-byte +/// values that are NOT present in any protocol's profile. +fn incident_summary() -> PayloadSummary { + // Script-like input address (header byte 0x31 + payload from issue doc) + let script_addr = ByteBuf::from( + hex::decode("31c727443d77df6cff95dca383994f4c3024d03ff56b02ecc22b0f3f65aabbcc") + .expect("hex decode script addr"), + ); + // Payment input/output address (header byte 0x01 + payload from issue doc) + let payment_addr = ByteBuf::from( + hex::decode("015090306a888fde7e4500aefd4ccd96055043de31e56ef28dc27dd4d8112233") + .expect("hex decode payment addr"), + ); + + // Synthetic input refs — 32-byte txids NOT in any protocol profile + let txid1 = ByteBuf::from( + hex::decode("deadbeef00000000000000000000000000000000000000000000000000000001") + .expect("hex decode txid1"), + ); + let txid2 = ByteBuf::from( + hex::decode("deadbeef00000000000000000000000000000000000000000000000000000002") + .expect("hex decode txid2"), + ); + + PayloadSummary { + input_addresses: BTreeSet::from([script_addr, payment_addr.clone()]), + output_addresses: BTreeSet::from([payment_addr]), + input_refs: BTreeSet::from([(txid1, 0u32), (txid2, 1u32)]), + input_count: 2, + output_count: 3, + ..PayloadSummary::default() + } +} + +// ── negative control: incident tx hits zero anchors for all active sources ─── + +/// Regression test for the over-matching incident. +/// +/// Five mainnet sources are loaded; vyfi is dropped (zero anchors); four +/// survive. For the incident summary each survivor must have `total == 0` and +/// `gates() == false` — it intersects no anchor at all, so the gate would have +/// blocked every false-positive match. +#[test] +fn incident_tx_hits_no_anchors_for_any_active_source() { + let sources = vec![ + source("indigo"), + source("vyfi"), + source("bodega_market"), + source("fluid-aquarium"), + source("strike-staking"), + ]; + + let active = specialize_all(&sources).expect("specialize_all must succeed"); + + // Honest accounting: the test covers exactly the four survivors. + assert_eq!( + active.len(), + 4, + "expected 4 active sources after vyfi is dropped; got {}", + active.len() + ); + + let summary = incident_summary(); + + for spec in &active { + let hits = spec.anchors.hits(&summary); + assert_eq!( + hits.total, 0, + "source {:?}: expected 0 total anchor hits for the incident tx, got {}", + spec.name, hits.total + ); + assert!( + !hits.gates(), + "source {:?}: incident tx must not gate, got gating={}", + spec.name, + hits.gating + ); + } +} + +// ── positive control: a gating indigo anchor IS detected ───────────────────── + +/// Positive control so the test can't pass vacuously. +/// +/// When the summary spends from the indigo `cdpscript` address (the address in +/// `input_addresses` — a script execution), the indigo source's anchors must +/// gate. +#[test] +fn incident_tx_with_indigo_gating_anchor_gates_indigo() { + let sources = vec![source("indigo")]; + let active = specialize_all(&sources).expect("specialize_all on indigo/mainnet must succeed"); + assert_eq!(active.len(), 1, "indigo/mainnet must survive the filter"); + + let indigo_spec = &active[0]; + + // cdpscript bech32 from the indigo mainnet profile + let cdpscript_bytes = + decode_bech32_address("addr1wyyqtkz5rken7jzptp076np606r79lmsrqjrqw8sdn4kvrqewrkdg") + .expect("cdpscript bech32 decode must succeed"); + let cdpscript_buf = ByteBuf::from(cdpscript_bytes); + + // Build a summary that otherwise looks like the incident tx, but spending + // FROM the cdpscript address (gating: the validator executed). + let mut summary = incident_summary(); + summary.input_addresses.insert(cdpscript_buf); + + let hits = indigo_spec.anchors.hits(&summary); + assert!( + hits.gates(), + "spending from the indigo cdpscript address must gate; got gating={}", + hits.gating + ); + assert_eq!( + hits.gating, 1, + "exactly the cdpscript address gates; got gating={}", + hits.gating + ); +} + +// ── soft-hit companion: bare output / value-policy does NOT gate ───────────── + +/// Pins the live-run false-positive class: a tx that merely pays bare ADA to +/// the indigo `cdpscript` address (no datum) and/or holds the iAsset policy in +/// value must register `total >= 1` but **not** gate. This is exactly the shape +/// of the 14 `score == 1` value-policy rows the gate is meant to drop. +#[test] +fn indigo_soft_hits_do_not_gate() { + let sources = vec![source("indigo")]; + let active = specialize_all(&sources).expect("specialize_all on indigo/mainnet must succeed"); + assert_eq!(active.len(), 1, "indigo/mainnet must survive the filter"); + + let indigo_spec = &active[0]; + + // cdpscript bech32 from the indigo mainnet profile — placed as a BARE output + // (no datum), the soft tier. + let cdpscript_buf = ByteBuf::from( + decode_bech32_address("addr1wyyqtkz5rken7jzptp076np606r79lmsrqjrqw8sdn4kvrqewrkdg") + .expect("cdpscript bech32 decode must succeed"), + ); + + // iasset_policy_id from the indigo mainnet profile — merely present in value. + let iasset_policy = ByteBuf::from( + hex::decode("f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b69880") + .expect("iasset policy hex decode"), + ); + + let mut summary = incident_summary(); + summary.output_addresses.insert(cdpscript_buf); + summary.value_policies.insert(iasset_policy); + + let hits = indigo_spec.anchors.hits(&summary); + assert_eq!( + hits.total, 2, + "both soft hits (bare cdpscript output + iAsset value-policy) must register in total; got total={}", + hits.total + ); + assert!( + !hits.gates(), + "bare output + value-policy must NOT gate (this is the live false-positive class); got gating={}", + hits.gating + ); +} + +// ── datum-output gating: a stateful output at a script address DOES gate ────── + +/// Companion to the spend-from-script control: an output to the indigo +/// `cdpscript` address that carries a datum (a stateful position output — the +/// "open a CDP" flow) gates via the datum-corroboration tier, exercising the +/// `output_addresses_with_datum` path end to end through the anchor logic. +#[test] +fn indigo_datum_output_gates() { + let sources = vec![source("indigo")]; + let active = specialize_all(&sources).expect("specialize_all on indigo/mainnet must succeed"); + assert_eq!(active.len(), 1, "indigo/mainnet must survive the filter"); + + let indigo_spec = &active[0]; + + let cdpscript_buf = ByteBuf::from( + decode_bech32_address("addr1wyyqtkz5rken7jzptp076np606r79lmsrqjrqw8sdn4kvrqewrkdg") + .expect("cdpscript bech32 decode must succeed"), + ); + + // A datum-bearing output at the script address: present in output_addresses + // AND in the datum subset (the gating tier). + let mut summary = incident_summary(); + summary.output_addresses.insert(cdpscript_buf.clone()); + summary.output_addresses_with_datum.insert(cdpscript_buf); + + let hits = indigo_spec.anchors.hits(&summary); + assert!( + hits.gates(), + "a datum-bearing output at the cdpscript address must gate; got gating={}", + hits.gating + ); + assert_eq!( + hits.gating, 1, + "exactly the cdpscript datum-output gates; got gating={}", + hits.gating + ); +} diff --git a/tracker/tests/source_anchors.rs b/tracker/tests/source_anchors.rs new file mode 100644 index 0000000..1d3bfcd --- /dev/null +++ b/tracker/tests/source_anchors.rs @@ -0,0 +1,95 @@ +use tx3_registry_tracker::discovery::DiscoveredSource; +use tx3_registry_tracker::specialization::{specialize_all, SpecializedTii}; +use tx3_sdk::tii::spec::TiiFile; + +fn anchored_source() -> DiscoveredSource { + let tii: TiiFile = serde_json::from_str(include_str!( + "fixtures/orcfax_burn_anchored.tii" + )) + .expect("failed to parse orcfax_burn_anchored.tii"); + + DiscoveredSource { + source_name: "txpipe/orcfax-burn-anchored:1.0.0".to_string(), + scope: "txpipe".to_string(), + name: "orcfax-burn-anchored".to_string(), + version: "1.0.0".to_string(), + tii, + profile_name: "mainnet".to_string(), + } +} + +fn anchorless_source() -> DiscoveredSource { + let tii: TiiFile = + serde_json::from_str(include_str!("fixtures/orcfax_burn_anchorless.tii")) + .expect("failed to parse orcfax_burn_anchorless.tii"); + + DiscoveredSource { + source_name: "txpipe/orcfax-burn:1.0.0".to_string(), + scope: "txpipe".to_string(), + name: "orcfax-burn".to_string(), + version: "1.0.0".to_string(), + tii, + profile_name: "mainnet".to_string(), + } +} + +/// specialize_all with one anchored + one anchorless source must return exactly +/// one SpecializedTii (the anchored one); the anchorless source is excluded. +#[test] +fn anchorless_source_is_excluded_and_anchored_is_retained() { + let sources = vec![anchored_source(), anchorless_source()]; + + let active: Vec = + specialize_all(&sources).expect("specialize_all must succeed"); + + assert_eq!( + active.len(), + 1, + "expected exactly 1 active source (anchorless excluded); got {}", + active.len() + ); + + let retained = &active[0]; + + // The retained source is the anchored one. + assert_eq!( + retained.name, "txpipe/orcfax-burn-anchored:1.0.0", + "retained source must be the anchored one" + ); + + // Its anchors must be non-empty. + assert!( + !retained.anchors.is_empty(), + "retained source must have non-empty anchors" + ); +} + +/// The anchorless source (orcfax_burn mainnet: no parties, empty environment) +/// must be absent from specialize_all's output when passed alone. +#[test] +fn anchorless_source_alone_yields_empty_result() { + let sources = vec![anchorless_source()]; + + let active: Vec = + specialize_all(&sources).expect("specialize_all on anchorless source must succeed"); + + assert!( + active.is_empty(), + "anchorless-only input must yield an empty result" + ); +} + +/// The anchored source must survive specialize_all when passed alone. +#[test] +fn anchored_source_alone_is_retained() { + let sources = vec![anchored_source()]; + + let active: Vec = + specialize_all(&sources).expect("specialize_all on anchored source must succeed"); + + assert_eq!(active.len(), 1, "anchored source must survive the filter"); + assert!( + !active[0].anchors.is_empty(), + "anchors must be non-empty" + ); +} diff --git a/tracker/tests/store_idempotency.rs b/tracker/tests/store_idempotency.rs index ddc112b..f608809 100644 --- a/tracker/tests/store_idempotency.rs +++ b/tracker/tests/store_idempotency.rs @@ -1,4 +1,5 @@ use sqlx::postgres::PgPool; +use sqlx::Row; use tx3_registry_tracker::store::{ChainPoint, OwnedMatchRow, Store}; fn sample_match_row() -> OwnedMatchRow { @@ -14,6 +15,8 @@ fn sample_match_row() -> OwnedMatchRow { tx_name: "test-tx".to_string(), profile_name: "test-profile".to_string(), lifted_json: r#"{"tx_id":"aa","protocol_name":"test-protocol"}"#.to_string(), + score: 7, + match_rank: 2, } } @@ -42,3 +45,27 @@ async fn reinserting_same_match_is_noop(pool: PgPool) { assert_eq!(n1, 1, "first apply_block should insert exactly one row"); assert_eq!(n2, 0, "second apply_block must be a no-op: UNIQUE(tx_hash, source_name) + ON CONFLICT DO NOTHING"); } + +#[sqlx::test(migrations = "./migrations")] +async fn apply_block_persists_score_and_rank(pool: PgPool) { + let store = Store::from_pool(pool.clone()); + let row = sample_match_row(); + let cursor = sample_cursor(); + + store + .apply_block(cursor, vec![row.clone()]) + .await + .expect("apply_block failed"); + + let result = sqlx::query("SELECT score, match_rank FROM matches WHERE tx_hash = $1") + .bind(&row.tx_hash) + .fetch_one(&pool) + .await + .expect("SELECT failed"); + + let db_score: i32 = result.get(0); + let db_rank: i32 = result.get(1); + + assert_eq!(db_score, row.score as i32, "score must be persisted"); + assert_eq!(db_rank, row.match_rank as i32, "match_rank must be persisted"); +} diff --git a/tracker/tests/store_repo_columns.rs b/tracker/tests/store_repo_columns.rs index 614e14b..00ce299 100644 --- a/tracker/tests/store_repo_columns.rs +++ b/tracker/tests/store_repo_columns.rs @@ -26,6 +26,8 @@ async fn apply_block_persists_repo_columns(pool: PgPool) { tx_name: "burn".to_string(), profile_name: "mainnet".to_string(), lifted_json: r#"{"tx_id":"10","protocol_name":"orcfax-burn"}"#.to_string(), + score: 0, + match_rank: 1, }; store @@ -75,6 +77,8 @@ async fn apply_block_handles_multiple_versions_distinctly(pool: PgPool) { tx_name: "burn".to_string(), profile_name: "mainnet".to_string(), lifted_json: r#"{"tx_id":"20","protocol_name":"orcfax-burn"}"#.to_string(), + score: 0, + match_rank: 1, }; let row_b = OwnedMatchRow { @@ -89,6 +93,8 @@ async fn apply_block_handles_multiple_versions_distinctly(pool: PgPool) { tx_name: "burn".to_string(), profile_name: "mainnet".to_string(), lifted_json: r#"{"tx_id":"21","protocol_name":"orcfax-burn"}"#.to_string(), + score: 0, + match_rank: 1, }; store