@greenlandai/sdk
v0.1.1
Published
Unified SDK for the GreenlandAI ecosystem (ENYAL, JoulePAI, RAREEAI, GreenlandAI)
Readme
greenlandai (JavaScript)
Unified SDK for the GreenlandAI ecosystem — ENYAL, JoulePAI, RAREEAI, GreenlandAI.
Supersedes but does not replace enyal-sdk v2.1.x (permanent coexistence — the
standalone enterprise track stays published and maintained; see design §5).
Install
npm install @greenlandai/sdk # core
pip install "greenlandai[bip39]" # + mnemonic recovery primitives
pip install "greenlandai[otel]" # + OpenTelemetry metrics (opt-in; OFF by default)Auth
import { Client } from "@greenlandai/sdk"; // ESM
const { Client } = require("@greenlandai/sdk"); // CJS
const client = new Client({ apiKey: "eyl_..." }); // or { oauthToken: jwt }
// 401s surface to you (no auto-refresh); hook: onAuthExpiredHello world (one per submodule)
await client.enyal.archive({ agentId: "agent-1", chunkType: "decision_record", chunkKey: "k1", data: { decision: "x" } });
await client.joulepai.transfer("@bob", 1000, { note: "thanks" }); // auto idempotency key
await client.rareeai.createRequest({ resourceType: "gpu" }); // marketplace (flat 0.5%, route-fixed)
await client.gldai.query("lithium deposits greenland");Idempotency promise matrix (auto-retry behavior — design §6, post-G1 2026-06-10)
| Method (py / js) | Wire class | Tier | Auto-retry | |---|---|---|---| | enyal.archive | A body client_chunk_id | ENFORCED | ON | | enyal.timestamp / create_agreement | A body client_chunk_id | ENFORCED | ON | | enyal.compliance_attest | A body client_attestation_id | ENFORCED | ON | | enyal.prove / prove_batch / prove_share_combination | B body idempotency_key | ENFORCED | ON | | enyal.disclose / request_client_disclosure | B | ENFORCED | ON | | enyal.send_message | B | ENFORCED | ON | | enyal.knowledge_upgrade · memory_structured_query · memory_content_query · queue_proof | — | NOT SUPPORTED | OFF (retries may duplicate billed effects) | | joulepai.transfer (pay) | D body idempotency_key (proc-enforced) | ENFORCED | ON | | joulepai.fund | — | NOT SUPPORTED | OFF (duplicate Stripe sessions possible) | | rareeai.create_provider/create_request/deliver/resolve | B | ENFORCED | ON | | rareeai.approve/reject/dispute/extend_dispute | — | NOT SUPPORTED | OFF | | gldai metered queries (companies/deposits/infrastructure/query/projects/mapdata) | C header X-Idempotency-Key | ENFORCED | ON | | all GET reads | — | safe | ON |
Every billed call auto-generates a UUID4 key (stable across retries) unless you pass idempotency_key / idempotencyKey yourself.
Observability (OFF by default)
Client(logger=my_logger, on_retry=..., on_terminal_failure=..., metrics=otel_metrics()) —
DEBUG logs redact Authorization + X-API-Key structurally.
Migration from enyal-sdk 2.1.0: see MIGRATION.md. Changelog: CHANGELOG.md.
