@near-intents-agent-api/sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +330 -0
- package/dist/index.d.mts +3984 -0
- package/dist/index.mjs +613 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/errors.ts","../src/generated/routes.ts","../src/grants.ts","../src/idempotency.ts","../src/response-utils.ts","../src/client.ts"],"sourcesContent":["import type { ApiErrorObject, ErrorDocument } from \"./types.js\";\n\n/** A transport, cancellation or parsing failure carrying the key of the original request. */\nexport class AgentApiRequestError extends Error {\n readonly idempotencyKey: string;\n\n constructor(cause: unknown, idempotencyKey: string) {\n super(cause instanceof Error ? cause.message : String(cause), { cause });\n this.name = cause instanceof Error ? cause.name : \"AgentApiRequestError\";\n this.idempotencyKey = idempotencyKey;\n }\n}\n\n/** Preserve SDK error classes and unkeyed failures; wrap other keyed failures for safe retry. */\nexport function requestError(error: unknown, idempotencyKey: string | undefined): unknown {\n if (\n idempotencyKey === undefined ||\n error instanceof AgentApiError ||\n error instanceof AgentApiResponseTooLargeError\n )\n return error;\n return new AgentApiRequestError(error, idempotencyKey);\n}\n\n/** A success or error body exceeded the client's byte budget before JSON parsing. */\nexport class AgentApiResponseTooLargeError extends Error {\n readonly code = \"response_too_large\";\n readonly status: number;\n readonly maxResponseBytes: number;\n readonly idempotencyKey: string | undefined;\n\n constructor(status: number, maxResponseBytes: number, idempotencyKey?: string) {\n super(`Response exceeds ${maxResponseBytes} bytes`);\n this.name = \"AgentApiResponseTooLargeError\";\n this.status = status;\n this.maxResponseBytes = maxResponseBytes;\n this.idempotencyKey = idempotencyKey;\n }\n}\n\n/**\n * A non-2xx response. `code` is the first error's stable snake_case code; branch on it, never on\n * `title` or `detail`. `errors` holds every entry (validation failures return one per field).\n */\nexport class AgentApiError extends Error {\n readonly status: number;\n readonly code: string;\n readonly title: string;\n readonly detail: string | undefined;\n readonly retryable: boolean;\n readonly availableAt: string | undefined;\n readonly requestId: string | undefined;\n readonly errors: ApiErrorObject[];\n readonly idempotencyKey: string | undefined;\n\n constructor(status: number, document: ErrorDocument | undefined, idempotencyKey?: string) {\n const first = document?.errors?.[0];\n super(first?.detail ?? first?.title ?? `HTTP ${status}`);\n this.name = \"AgentApiError\";\n this.status = status;\n this.code = first?.code ?? \"http_error\";\n this.title = first?.title ?? `HTTP ${status}`;\n this.detail = first?.detail;\n this.retryable = first?.meta?.retryable ?? false;\n this.availableAt = first?.meta?.available_at;\n this.requestId = document?.meta?.request_id;\n this.errors = document?.errors ?? [];\n this.idempotencyKey = idempotencyKey;\n }\n}\n","// GENERATED by packages/contracts/tools/generate-sdk.ts. Do not edit.\n\nexport type EndpointDefinition = {\n readonly operationId: string;\n readonly method: \"get\" | \"post\" | \"put\" | \"delete\";\n /** OpenAPI path template, e.g. `/v1/agents/{agent_id}/swap`. */\n readonly path: string;\n /** Delegated work: also needs `X-Grant-Token`. */\n readonly grant?: true;\n /** `Idempotency-Key` header: required for writes that create work, optional otherwise. */\n readonly idempotency?: \"required\" | \"optional\";\n};\n\nexport const endpoints = {\n generateIntent: { operationId: \"generateIntent\", method: \"post\", path: \"/v1/generate-intent\", idempotency: \"optional\" },\n submitIntent: { operationId: \"submitIntent\", method: \"post\", path: \"/v1/submit-intent\" },\n getStatus: { operationId: \"getStatus\", method: \"get\", path: \"/v1/status\" },\n getHistory: { operationId: \"getHistory\", method: \"get\", path: \"/v1/agents/{agent_id}/history\" },\n listAgents: { operationId: \"listAgents\", method: \"get\", path: \"/v1/agents\" },\n getAgent: { operationId: \"getAgent\", method: \"get\", path: \"/v1/agents/{agent_id}\" },\n getWallet: { operationId: \"getWallet\", method: \"get\", path: \"/v1/agents/{agent_id}/wallet\" },\n getBalances: { operationId: \"getBalances\", method: \"get\", path: \"/v1/agents/{agent_id}/balances\" },\n getPolicy: { operationId: \"getPolicy\", method: \"get\", path: \"/v1/agents/{agent_id}/policy\" },\n getPolicyHistory: { operationId: \"getPolicyHistory\", method: \"get\", path: \"/v1/agents/{agent_id}/policy/history\" },\n listGrants: { operationId: \"listGrants\", method: \"get\", path: \"/v1/agents/{agent_id}/grants\" },\n listScheduledExecutions: { operationId: \"listScheduledExecutions\", method: \"get\", path: \"/v1/agents/{agent_id}/executions/scheduled\" },\n getContainment: { operationId: \"getContainment\", method: \"get\", path: \"/v1/agents/{agent_id}/containment\" },\n listApprovals: { operationId: \"listApprovals\", method: \"get\", path: \"/v1/agents/{agent_id}/approvals\" },\n getApproval: { operationId: \"getApproval\", method: \"get\", path: \"/v1/agents/{agent_id}/approvals/{approval_id}\" },\n getAddress: { operationId: \"getAddress\", method: \"get\", path: \"/v1/agents/{agent_id}/addresses/{chain}\" },\n listProviderRecords: { operationId: \"listProviderRecords\", method: \"get\", path: \"/v1/agents/{agent_id}/provider/{kind}\" },\n swap: { operationId: \"swap\", method: \"post\", path: \"/v1/agents/{agent_id}/swap\", grant: true, idempotency: \"required\" },\n withdraw: { operationId: \"withdraw\", method: \"post\", path: \"/v1/agents/{agent_id}/withdraw\", grant: true, idempotency: \"required\" },\n transfer: { operationId: \"transfer\", method: \"post\", path: \"/v1/agents/{agent_id}/transfer\", grant: true, idempotency: \"required\" },\n shield: { operationId: \"shield\", method: \"post\", path: \"/v1/agents/{agent_id}/shield\", grant: true, idempotency: \"required\" },\n unshield: { operationId: \"unshield\", method: \"post\", path: \"/v1/agents/{agent_id}/unshield\", grant: true, idempotency: \"required\" },\n deposit: { operationId: \"deposit\", method: \"post\", path: \"/v1/agents/{agent_id}/deposit\", idempotency: \"required\" },\n recover: { operationId: \"recover\", method: \"post\", path: \"/v1/agents/{agent_id}/recover\", grant: true, idempotency: \"required\" },\n signMessage: { operationId: \"signMessage\", method: \"post\", path: \"/v1/agents/{agent_id}/sign-message\", grant: true },\n getTokens: { operationId: \"getTokens\", method: \"get\", path: \"/v1/tokens\" },\n getNetwork: { operationId: \"getNetwork\", method: \"get\", path: \"/v1/network\" },\n whoami: { operationId: \"whoami\", method: \"get\", path: \"/v1/whoami\" },\n getPartnerQuota: { operationId: \"getPartnerQuota\", method: \"get\", path: \"/v1/quotas\" },\n} as const satisfies Record<string, EndpointDefinition>;\n","import { sha256 } from \"@noble/hashes/sha2.js\";\nimport { bytesToHex, utf8ToBytes } from \"@noble/hashes/utils.js\";\nimport { base64urlnopad } from \"@scure/base\";\n\n/** Shape of a grant token: `ngt_` plus 32 random bytes in unpadded base64url. */\nexport const grantTokenPattern = /^ngt_[A-Za-z0-9_-]{43}$/;\n\n/** A new grant token and the commitment the owner signs for it. */\nexport type GrantCredential = {\n /** `ngt_…`. Store it on your backend (encrypted); it is shown nowhere else. */\n token: string;\n /** SHA-256 hex of the token: the `credential` of a `grant_issue` intent. */\n commitment: string;\n};\n\n/** The commitment of an existing grant token. */\nexport function grantCommitment(token: string): string {\n return bytesToHex(sha256(utf8ToBytes(token)));\n}\n\n/**\n * Creates the token for one new grant. Send only `commitment` in `grant_issue`; the owner signs\n * it, and afterwards `api.forGrant(token)` runs calls under that grant. Use a new token for every\n * grant.\n */\nexport function createGrantCredential(): GrantCredential {\n const token = `ngt_${base64urlnopad.encode(crypto.getRandomValues(new Uint8Array(32)))}`;\n return { token, commitment: grantCommitment(token) };\n}\n","import { type EndpointDefinition, endpoints } from \"./generated/routes.js\";\n\n/** Creates a key for one logical request. Save it before sending when recovery must survive a restart. */\nexport function createIdempotencyKey(): string {\n return crypto.randomUUID();\n}\n\n/** The API response plus the SDK's effective request key. Reuse this key for retries. */\nexport type IdempotentResult<T> = T & { idempotencyKey: string };\n\n/** Resolve one request's identity before dispatch; recovery must use its existing key. */\nexport function requestIdempotency(\n endpoint: EndpointDefinition,\n call: { body?: unknown; idempotencyKey?: string },\n) {\n const dry =\n (endpoint === endpoints.swap || endpoint === endpoints.withdraw) &&\n (call.body as { dry?: boolean } | undefined)?.dry === true;\n const keyed = Boolean(endpoint.idempotency) && !dry;\n const idempotencyKey =\n keyed && endpoint !== endpoints.recover && call.idempotencyKey === undefined\n ? createIdempotencyKey()\n : call.idempotencyKey;\n return { dry, keyed, idempotencyKey };\n}\n","import { AgentApiError, AgentApiResponseTooLargeError } from \"./errors.js\";\nimport type { ErrorDocument } from \"./types.js\";\n\n/** Parse a bounded response, preserving HTTP errors even when their body is not JSON. */\nexport async function readResponseJson(\n response: Response,\n maxResponseBytes: number,\n idempotencyKey?: string,\n): Promise<unknown> {\n const text = await readResponseText(response, maxResponseBytes, idempotencyKey);\n let json: unknown;\n try {\n json = text ? JSON.parse(text) : undefined;\n } catch (error) {\n if (response.ok) throw error;\n }\n if (!response.ok)\n throw new AgentApiError(response.status, json as ErrorDocument | undefined, idempotencyKey);\n return json;\n}\n\n/** Count bytes before retaining chunks; decode once to preserve Fetch's UTF-8 behavior. */\nexport async function readResponseText(\n response: Response,\n maxResponseBytes: number,\n idempotencyKey?: string,\n): Promise<string> {\n const reader = response.body?.getReader();\n if (!reader) return \"\";\n const chunks: Uint8Array[] = [];\n let size = 0;\n try {\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n size += value.byteLength;\n if (size > maxResponseBytes)\n throw new AgentApiResponseTooLargeError(response.status, maxResponseBytes, idempotencyKey);\n chunks.push(value);\n }\n return new TextDecoder().decode(Buffer.concat(chunks, size));\n } finally {\n // Cleanup must not replace the original error or wait for the underlying source to stop.\n void reader.cancel().catch(() => undefined);\n reader.releaseLock();\n }\n}\n","import { requestError } from \"./errors.js\";\nimport type { EndpointDefinition } from \"./generated/routes.js\";\nimport { endpoints } from \"./generated/routes.js\";\nimport { grantTokenPattern } from \"./grants.js\";\nimport { type IdempotentResult, requestIdempotency } from \"./idempotency.js\";\nimport { readResponseJson } from \"./response-utils.js\";\nimport type {\n AgentPage,\n AgentView,\n ApprovalView,\n BalanceMoveRequest,\n BalanceSource,\n BalancesView,\n ContainmentView,\n DepositRequest,\n GenerateIntentRequest,\n GenerateIntentResponseOf,\n GrantView,\n HistoryPage,\n IntentType,\n NetworkView,\n PartnerQuotaView,\n PolicyHistoryView,\n PolicyView,\n QuoteResponse,\n RecoverRequest,\n ScheduledPage,\n Signature,\n SignMessageRequest,\n StatusResponse,\n StatusResponseOf,\n SubmitIntentRequest,\n SwapRequest,\n TokenView,\n TransferRequest,\n WalletView,\n WhoamiView,\n WithdrawRequest,\n} from \"./types.js\";\n\n/** The hosted API. Pass `baseUrl` only for a self-hosted or local deployment. */\nexport const DEFAULT_BASE_URL = \"https://api.agentsonintents.com\";\n\nexport type AgentApiOptions = {\n /** Partner API key (`naa_…`). Server-side only: never ship it to a browser. */\n apiKey: string;\n /** API origin. Defaults to {@link DEFAULT_BASE_URL}; HTTP is accepted for localhost only. */\n baseUrl?: string;\n /** Per-request timeout. Defaults to 150 s for settlement writes, 65 s otherwise. */\n timeoutMs?: number;\n /** Maximum response body bytes before parsing, including errors. Defaults to 8 MiB. */\n maxResponseBytes?: number;\n /** Custom fetch, e.g. for tests or instrumentation. */\n fetch?: typeof fetch;\n /**\n * Grant token (`ngt_…`) sent as `X-Grant-Token` on delegated calls (swap, withdraw, transfer,\n * shield, …). Prefer `api.forGrant(token)`, which returns a separate client per grant.\n */\n grantToken?: string;\n};\n\nexport type RequestOptions = {\n /** Cancels this request. */\n signal?: AbortSignal;\n};\n\nexport type IdempotentOptions = RequestOptions & {\n /** Stable key for one logical request. Omission generates a new key; retries must reuse it. */\n idempotencyKey?: string;\n};\n\ntype Call = {\n params?: Record<string, string>;\n query?: Record<string, string | number | boolean | undefined>;\n body?: unknown;\n idempotencyKey?: string;\n signal?: AbortSignal;\n};\n\nconst settlementEndpoints = new Set<EndpointDefinition>([\n endpoints.swap,\n endpoints.withdraw,\n endpoints.transfer,\n endpoints.shield,\n endpoints.unshield,\n]);\n\n/** `{agent_id}` path segments filled from `params`, each URI-encoded. */\nfunction fillPath(template: string, params: Record<string, string> = {}) {\n return template.replace(/\\{([^}]+)\\}/g, (_, name: string) => {\n const value = params[name];\n if (value === undefined) throw new Error(`missing path parameter ${name}`);\n return encodeURIComponent(value);\n });\n}\n\n/**\n * Typed client for the NEAR Intents Agent API. One method per endpoint; paths and methods come\n * from the shared endpoint registry, so the client cannot drift from the server.\n *\n * Owner actions follow a generate/submit shape: `generateIntent` returns\n * `intent: { standard, payload }`, your frontend has the owner's wallet sign `payload`\n * unchanged, and `submitIntent` sends the wallet's output back. `getStatus` tracks the result.\n */\nexport class AgentApi {\n private readonly origin: string;\n private readonly fetcher: typeof fetch;\n private readonly maxResponseBytes: number;\n\n constructor(private readonly options: AgentApiOptions) {\n const url = new URL(options.baseUrl ?? DEFAULT_BASE_URL);\n const local = [\"localhost\", \"127.0.0.1\", \"[::1]\"].includes(url.hostname);\n if (url.protocol !== \"https:\" && !(url.protocol === \"http:\" && local))\n throw new Error(\"baseUrl must use HTTPS\");\n if (url.username || url.password || url.search || url.hash || url.pathname !== \"/\")\n throw new Error(\"baseUrl must be a plain origin\");\n if (!/^naa_[A-Za-z0-9_-]{43}$/.test(options.apiKey))\n throw new Error(\"apiKey is not a naa_ key\");\n if (options.grantToken !== undefined && !grantTokenPattern.test(options.grantToken))\n throw new Error(\"grantToken is not an ngt_ token\");\n const maxResponseBytes =\n options.maxResponseBytes === undefined ? 8 * 1_048_576 : options.maxResponseBytes;\n if (!Number.isSafeInteger(maxResponseBytes) || maxResponseBytes <= 0)\n throw new RangeError(\"maxResponseBytes must be a positive safe integer\");\n this.origin = url.href.replace(/\\/$/, \"\");\n this.fetcher = options.fetch ?? fetch;\n this.maxResponseBytes = maxResponseBytes;\n }\n\n getPartnerQuota(options: RequestOptions = {}): Promise<PartnerQuotaView> {\n return this.call(endpoints.getPartnerQuota, options);\n }\n\n private headers(endpoint: EndpointDefinition, call: Call): Record<string, string> {\n const headers: Record<string, string> = {\n accept: \"application/json\",\n \"x-api-key\": this.options.apiKey,\n };\n if (call.body !== undefined) headers[\"content-type\"] = \"application/json\";\n if (call.idempotencyKey !== undefined) headers[\"idempotency-key\"] = call.idempotencyKey;\n // Only delegated endpoints receive the grant token; nothing else needs it.\n if (endpoint.grant && this.options.grantToken)\n headers[\"x-grant-token\"] = this.options.grantToken;\n return headers;\n }\n\n private async call<T>(endpoint: EndpointDefinition, call: Call = {}): Promise<T> {\n const { dry, keyed, idempotencyKey } = requestIdempotency(endpoint, call);\n try {\n const url = new URL(`${this.origin}${fillPath(endpoint.path, call.params)}`);\n for (const [key, value] of Object.entries(call.query ?? {}))\n if (value !== undefined) url.searchParams.set(key, String(value));\n const headers = this.headers(endpoint, { ...call, idempotencyKey });\n const settlement = settlementEndpoints.has(endpoint) && !dry;\n const signals = [\n AbortSignal.timeout(this.options.timeoutMs ?? (settlement ? 150_000 : 65_000)),\n ];\n if (call.signal) signals.push(call.signal);\n const response = await this.fetcher(url, {\n method: endpoint.method.toUpperCase(),\n headers,\n body: call.body === undefined ? undefined : JSON.stringify(call.body),\n signal: AbortSignal.any(signals),\n redirect: \"error\",\n credentials: \"omit\",\n });\n const json = await readResponseJson(response, this.maxResponseBytes, idempotencyKey);\n return keyed && idempotencyKey !== undefined\n ? { ...(json as T), idempotencyKey }\n : (json as T);\n } catch (error) {\n throw requestError(error, idempotencyKey);\n }\n }\n\n /**\n * A client that runs delegated calls under one owner grant. Keep one per session, assistant or\n * bot: each carries its own token, so concurrent calls never borrow another grant.\n */\n forGrant(grantToken: string): AgentApi {\n return new AgentApi({ ...this.options, grantToken, maxResponseBytes: this.maxResponseBytes });\n }\n\n // ------------------------------------------------------------------------------ owner intents\n\n /**\n * Builds the payload the owner's wallet must sign for one owner action. Omission generates\n * a new `idempotencyKey`; reuse the response/error key to retry the same intent.\n * Interrupted generation returns\n * `intent_generation_recovery_required` unless a saved payload or complete preparation can\n * recover the original request; the key never\n * starts another builder. Keep that key for recovery.\n */\n generateIntent<T extends IntentType>(\n request: Extract<GenerateIntentRequest, { type: T }>,\n options: IdempotentOptions = {},\n ): Promise<IdempotentResult<GenerateIntentResponseOf<T>>> {\n return this.call(endpoints.generateIntent, { body: request, ...options });\n }\n\n /** Sends the wallet's output for a generated intent. Resubmitting the same signature is safe. */\n submitIntent<T extends IntentType>(\n request: SubmitIntentRequest & { type: T },\n options: RequestOptions = {},\n ): Promise<StatusResponseOf<T>> {\n return this.call(endpoints.submitIntent, { body: request, ...options });\n }\n\n /**\n * Status of an intent or execution. `waitMs` (≤ 30 000) long-polls until the status is\n * terminal, needs a signature, or the wait ends.\n */\n getStatus(\n correlationId: string,\n options: RequestOptions & { waitMs?: number; refresh?: boolean } = {},\n ): Promise<StatusResponse> {\n return this.call(endpoints.getStatus, {\n query: { correlation_id: correlationId, wait_ms: options.waitMs, refresh: options.refresh },\n signal: options.signal,\n });\n }\n\n /** An agent's intents and executions, newest first. */\n getHistory(\n agentId: string,\n query: { cursor?: string; limit?: number } = {},\n options: RequestOptions = {},\n ): Promise<HistoryPage> {\n return this.call(endpoints.getHistory, { params: { agent_id: agentId }, query, ...options });\n }\n\n // ------------------------------------------------------------------------------------ agents\n\n listAgents(\n query: { external_user_id?: string; cursor?: string } = {},\n options: RequestOptions = {},\n ): Promise<AgentPage> {\n return this.call(endpoints.listAgents, { query, ...options });\n }\n\n getAgent(agentId: string, options: RequestOptions = {}): Promise<AgentView> {\n return this.call(endpoints.getAgent, { params: { agent_id: agentId }, ...options });\n }\n\n getWallet(agentId: string, options: RequestOptions = {}): Promise<WalletView> {\n return this.call(endpoints.getWallet, { params: { agent_id: agentId }, ...options });\n }\n\n getBalances(\n agentId: string,\n query: { source?: BalanceSource; asset?: string } = {},\n options: RequestOptions = {},\n ): Promise<BalancesView> {\n return this.call(endpoints.getBalances, { params: { agent_id: agentId }, query, ...options });\n }\n\n /** Public: every asset agents can use, with chain and USD price. Needs no API key. */\n async getTokens(options: RequestOptions = {}): Promise<TokenView[]> {\n return (await this.call<{ data: TokenView[] }>(endpoints.getTokens, options)).data;\n }\n\n getPolicy(agentId: string, options: RequestOptions = {}): Promise<PolicyView> {\n return this.call(endpoints.getPolicy, { params: { agent_id: agentId }, ...options });\n }\n\n getPolicyHistory(\n agentId: string,\n query: { cursor?: number; limit?: number } = {},\n options: RequestOptions = {},\n ): Promise<PolicyHistoryView> {\n return this.call(endpoints.getPolicyHistory, {\n params: { agent_id: agentId },\n query,\n ...options,\n });\n }\n\n async listGrants(agentId: string, options: RequestOptions = {}): Promise<GrantView[]> {\n return (\n await this.call<{ data: GrantView[] }>(endpoints.listGrants, {\n params: { agent_id: agentId },\n ...options,\n })\n ).data;\n }\n\n /** Executions the timelock holds, earliest release first; follow `next_cursor` for more. */\n listScheduledExecutions(\n agentId: string,\n query: { cursor?: string; limit?: number } = {},\n options: RequestOptions = {},\n ): Promise<ScheduledPage> {\n return this.call(endpoints.listScheduledExecutions, {\n params: { agent_id: agentId },\n query,\n ...options,\n });\n }\n\n getContainment(\n agentId: string,\n query: { grants_cursor?: string; operations_cursor?: string } = {},\n options: RequestOptions = {},\n ): Promise<ContainmentView> {\n return this.call(endpoints.getContainment, {\n params: { agent_id: agentId },\n query,\n ...options,\n });\n }\n\n async listApprovals(agentId: string, options: RequestOptions = {}): Promise<ApprovalView[]> {\n return (\n await this.call<{ data: ApprovalView[] }>(endpoints.listApprovals, {\n params: { agent_id: agentId },\n ...options,\n })\n ).data;\n }\n\n getApproval(\n agentId: string,\n approvalId: string,\n options: RequestOptions = {},\n ): Promise<ApprovalView> {\n return this.call(endpoints.getApproval, {\n params: { agent_id: agentId, approval_id: approvalId },\n ...options,\n });\n }\n\n getAddress(\n agentId: string,\n chain: \"near\",\n options: RequestOptions = {},\n ): Promise<{ chain: \"near\"; address: string; [key: string]: unknown }> {\n return this.call(endpoints.getAddress, { params: { agent_id: agentId, chain }, ...options });\n }\n\n listProviderRecords(\n agentId: string,\n kind: \"requests\" | \"audit\" | \"deposits\" | \"deposit_history\",\n query: { limit?: number; offset?: number; type?: string } = {},\n options: RequestOptions = {},\n ): Promise<{ data: unknown }> {\n return this.call(endpoints.listProviderRecords, {\n params: { agent_id: agentId, kind },\n query,\n ...options,\n });\n }\n\n // -------------------------------------------------------------------------------- executions\n\n /** Swap assets. `dry: true` returns a quote and needs no idempotency key. */\n swap(\n agentId: string,\n request: SwapRequest & { dry: true },\n options?: RequestOptions,\n ): Promise<QuoteResponse>;\n swap(\n agentId: string,\n request: SwapRequest,\n options?: IdempotentOptions,\n ): Promise<IdempotentResult<StatusResponseOf<\"swap\">>>;\n swap(\n agentId: string,\n request: SwapRequest,\n options: IdempotentOptions = {},\n ): Promise<QuoteResponse | IdempotentResult<StatusResponseOf<\"swap\">>> {\n return this.call(endpoints.swap, { params: { agent_id: agentId }, body: request, ...options });\n }\n\n /** Withdraw to any supported chain. `dry: true` previews and needs no idempotency key. */\n withdraw(\n agentId: string,\n request: WithdrawRequest & { dry: true },\n options?: RequestOptions,\n ): Promise<QuoteResponse>;\n withdraw(\n agentId: string,\n request: WithdrawRequest,\n options?: IdempotentOptions,\n ): Promise<IdempotentResult<StatusResponseOf<\"withdraw\">>>;\n withdraw(\n agentId: string,\n request: WithdrawRequest,\n options: IdempotentOptions = {},\n ): Promise<QuoteResponse | IdempotentResult<StatusResponseOf<\"withdraw\">>> {\n return this.call(endpoints.withdraw, {\n params: { agent_id: agentId },\n body: request,\n ...options,\n });\n }\n\n transfer(\n agentId: string,\n request: TransferRequest,\n options: IdempotentOptions = {},\n ): Promise<IdempotentResult<StatusResponseOf<\"transfer\">>> {\n return this.call(endpoints.transfer, {\n params: { agent_id: agentId },\n body: request,\n ...options,\n });\n }\n\n shield(\n agentId: string,\n request: BalanceMoveRequest,\n options: IdempotentOptions = {},\n ): Promise<IdempotentResult<StatusResponseOf<\"shield\">>> {\n return this.call(endpoints.shield, {\n params: { agent_id: agentId },\n body: request,\n ...options,\n });\n }\n\n unshield(\n agentId: string,\n request: BalanceMoveRequest,\n options: IdempotentOptions = {},\n ): Promise<IdempotentResult<StatusResponseOf<\"unshield\">>> {\n return this.call(endpoints.unshield, {\n params: { agent_id: agentId },\n body: request,\n ...options,\n });\n }\n\n /** Creates an inbound public or confidential deposit address; no grant token is needed. */\n deposit(\n agentId: string,\n request: DepositRequest,\n options: IdempotentOptions = {},\n ): Promise<IdempotentResult<StatusResponseOf<\"deposit\">>> {\n return this.call(endpoints.deposit, {\n params: { agent_id: agentId },\n body: request,\n ...options,\n });\n }\n\n /** First dispatch of an UNCERTAIN execution that provably never reached the provider. Requires its original key. */\n recover(\n agentId: string,\n request: RecoverRequest,\n options: IdempotentOptions & { idempotencyKey: string },\n ): Promise<IdempotentResult<StatusResponse>> {\n return this.call(endpoints.recover, {\n params: { agent_id: agentId },\n body: request,\n ...options,\n });\n }\n\n /**\n * Signs a canonical identity challenge with the agent's NEAR key (NEP-413). Needs a grant token,\n * a policy listing the recipient, and a server with NEAR message signing enabled.\n */\n signMessage(\n agentId: string,\n request: SignMessageRequest,\n options: RequestOptions = {},\n ): Promise<Signature> {\n return this.call(endpoints.signMessage, {\n params: { agent_id: agentId },\n body: request,\n ...options,\n });\n }\n\n // -------------------------------------------------------------------------------------- meta\n\n getNetwork(options: RequestOptions = {}): Promise<NetworkView> {\n return this.call(endpoints.getNetwork, options);\n }\n\n whoami(options: RequestOptions = {}): Promise<WhoamiView> {\n return this.call(endpoints.whoami, options);\n }\n}\n\n/** Creates a client. Keep the API key on your backend. */\nexport function createAgentApi(options: AgentApiOptions): AgentApi {\n return new AgentApi(options);\n}\n"],"mappings":";;;;;AAGA,IAAa,uBAAb,cAA0C,MAAM;CAC9C;CAEA,YAAY,OAAgB,gBAAwB;AAClD,QAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,EAAE,EAAE,OAAO,CAAC;AACxE,OAAK,OAAO,iBAAiB,QAAQ,MAAM,OAAO;AAClD,OAAK,iBAAiB;;;;AAK1B,SAAgB,aAAa,OAAgB,gBAA6C;AACxF,KACE,mBAAmB,KAAA,KACnB,iBAAiB,iBACjB,iBAAiB,8BAEjB,QAAO;AACT,QAAO,IAAI,qBAAqB,OAAO,eAAe;;;AAIxD,IA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,KAAK,UAAU,UAAU;GACnC,QAAQ,EAAE,UAAU,SAAS;GAC7B,MAAM;GACN,GAAG;GACJ,CAAC;;;CAIJ,QACE,SACA,SACA,UAA6B,EAAE,EACyB;AACxD,SAAO,KAAK,KAAK,UAAU,SAAS;GAClC,QAAQ,EAAE,UAAU,SAAS;GAC7B,MAAM;GACN,GAAG;GACJ,CAAC;;;CAIJ,QACE,SACA,SACA,SAC2C;AAC3C,SAAO,KAAK,KAAK,UAAU,SAAS;GAClC,QAAQ,EAAE,UAAU,SAAS;GAC7B,MAAM;GACN,GAAG;GACJ,CAAC;;;;;;CAOJ,YACE,SACA,SACA,UAA0B,EAAE,EACR;AACpB,SAAO,KAAK,KAAK,UAAU,aAAa;GACtC,QAAQ,EAAE,UAAU,SAAS;GAC7B,MAAM;GACN,GAAG;GACJ,CAAC;;CAKJ,WAAW,UAA0B,EAAE,EAAwB;AAC7D,SAAO,KAAK,KAAK,UAAU,YAAY,QAAQ;;CAGjD,OAAO,UAA0B,EAAE,EAAuB;AACxD,SAAO,KAAK,KAAK,UAAU,QAAQ,QAAQ;;;;AAK/C,SAAgB,eAAe,SAAoC;AACjE,QAAO,IAAI,SAAS,QAAQ"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@near-intents-agent-api/sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Typed server-side HTTP client for the NEAR Intents Agent API",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/NEAR-Intents-Agent-API/sdk-typescript.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/NEAR-Intents-Agent-API/sdk-typescript#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/NEAR-Intents-Agent-API/sdk-typescript/issues"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"near",
|
|
16
|
+
"near-intents",
|
|
17
|
+
"agents",
|
|
18
|
+
"sdk",
|
|
19
|
+
"1click"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"packageManager": "pnpm@11.9.0",
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "pnpm typecheck && tsdown && node -e \"import('./dist/index.mjs')\"",
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"test": "node --import tsx --test \"tests/**/*.test.ts\"",
|
|
28
|
+
"check": "pnpm lint && pnpm build && pnpm test",
|
|
29
|
+
"lint": "biome check .",
|
|
30
|
+
"format": "biome check --write ."
|
|
31
|
+
},
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.mts",
|
|
35
|
+
"import": "./dist/index.mjs"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@noble/hashes": "^2.4.0",
|
|
40
|
+
"@scure/base": "^2.4.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@biomejs/biome": "2.5.12",
|
|
44
|
+
"@types/node": "^24.12.0",
|
|
45
|
+
"tsdown": "^0.21.10",
|
|
46
|
+
"tsx": "^4.23.13",
|
|
47
|
+
"typescript": "^5.9.3"
|
|
48
|
+
},
|
|
49
|
+
"files": [
|
|
50
|
+
"dist",
|
|
51
|
+
"README.md",
|
|
52
|
+
"LICENSE"
|
|
53
|
+
],
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=24"
|
|
56
|
+
},
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"access": "public"
|
|
59
|
+
}
|
|
60
|
+
}
|