Skip to content

Update indexer provider: GetVtxoChain/GetVirtualTxs auth support (arkd#904) #398

@arkanaai

Description

@arkanaai

Context

arkd#904 merged (aff0d89679) adding optional intent-based auth and token reuse to GetVtxoChain and GetVirtualTxs. The ts-sdk uses the REST API and its indexer provider interface needs updating.

REST API changes

Both endpoints now accept optional query params:

  • intent.proof (string)
  • intent.message (string)
  • token (string) — reusable auth token from a previous call

Both responses now include:

  • authToken (string) — can be recycled for the other endpoint

What needs updating in ts-sdk

In src/providers/indexer.ts:

  1. getVtxoChain(vtxoOutpoint, opts?) — add optional auth params:

    interface VtxoChainOptions extends PaginationOptions {
      intent?: { proof: string; message: string };
      token?: string;
    }
    // response should include authToken?: string
  2. getVirtualTxs(txids, opts?) — same pattern:

    interface VirtualTxsOptions extends PaginationOptions {
      intent?: { proof: string; message: string };
      token?: string;
    }
    // response should include authToken?: string
  3. Wire these through to the underlying HTTP requests as query params.

Behavioral notes

  • Fully additive — no breaking change; existing callers without auth continue to work against public exposure arkd
  • When arkd is withheld or private, callers without valid auth will get errors
  • Tokens can be recycled cross-endpoint: GetVtxoChain token → GetVirtualTxs and vice versa (5 min default TTL)

Reference

[from: cross-repo-impact agent, 2026-04-02]

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions