Interface DefarmConfig

interface DefarmConfig {
    auth?: { apiKey?: string; bearer?: string };
    fetch?: {
        (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
        (input: string | URL | Request, init?: RequestInit): Promise<Response>;
    };
    gateway: string;
    keystore?: Keystore;
    network?: "testnet"
    | "public";
}

Properties

auth?: { apiKey?: string; bearer?: string }
fetch?: {
    (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
    (input: string | URL | Request, init?: RequestInit): Promise<Response>;
}

Type declaration

    • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
    • Parameters

      • input: URL | RequestInfo
      • Optionalinit: RequestInit

      Returns Promise<Response>

    • (input: string | URL | Request, init?: RequestInit): Promise<Response>
    • Parameters

      • input: string | URL | Request
      • Optionalinit: RequestInit

      Returns Promise<Response>

gateway: string

Gateway base URL (e.g. https://gateway.defarm.net). /auth/* lives at the root, everything else under /v1. Swapping this repoints the whole client.

keystore?: Keystore

Where private keys live. Defaults to a chmod-0600 JSON file under ~/.defarm/.

network?: "testnet" | "public"

Which network anchors are expected on. Default testnet; public (mainnet) is explicit opt-in.