@outlayer/sdk 0.1.0-alpha.1

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.
@@ -0,0 +1,1788 @@
1
+ import { Client } from 'openapi-fetch';
2
+
3
+ /**
4
+ * This file was auto-generated by openapi-typescript.
5
+ * Do not make direct changes to the file.
6
+ */
7
+ interface paths {
8
+ "/register": {
9
+ parameters: {
10
+ query?: never;
11
+ header?: never;
12
+ path?: never;
13
+ cookie?: never;
14
+ };
15
+ get?: never;
16
+ put?: never;
17
+ /**
18
+ * Register a new wallet
19
+ * @description Creates a new multi-chain wallet and returns an API key. For most
20
+ * callers, send `{}` — an anonymous wallet is created and an API key is
21
+ * returned in `api_key` (shown once, not retrievable later).
22
+ *
23
+ * Optional fields enable advanced registration paths:
24
+ * - `account_id` + `pubkey` + `message` + `signature`: bind the wallet to
25
+ * a NEAR account via NEP-413 proof-of-ownership.
26
+ * - `vault_id`: bind to a customer-owned vault for sovereign custody (see
27
+ * vault docs).
28
+ *
29
+ * Rate-limited: 30 requests per minute per IP.
30
+ */
31
+ post: operations["registerWallet"];
32
+ delete?: never;
33
+ options?: never;
34
+ head?: never;
35
+ patch?: never;
36
+ trace?: never;
37
+ };
38
+ "/wallet/v1/address": {
39
+ parameters: {
40
+ query?: never;
41
+ header?: never;
42
+ path?: never;
43
+ cookie?: never;
44
+ };
45
+ /**
46
+ * Derive wallet address for a chain
47
+ * @description Returns the deterministically-derived address for the wallet on the
48
+ * requested chain. Same `wallet_id` always produces the same addresses
49
+ * across chains.
50
+ */
51
+ get: operations["getAddress"];
52
+ put?: never;
53
+ post?: never;
54
+ delete?: never;
55
+ options?: never;
56
+ head?: never;
57
+ patch?: never;
58
+ trace?: never;
59
+ };
60
+ "/wallet/v1/balance": {
61
+ parameters: {
62
+ query?: never;
63
+ header?: never;
64
+ path?: never;
65
+ cookie?: never;
66
+ };
67
+ /**
68
+ * Read balance
69
+ * @description Returns the balance for a token on the requested chain. Currently only
70
+ * `chain=near` is supported for native balance reads; cross-chain balances
71
+ * should be read from the upstream chain directly.
72
+ *
73
+ * Set `source=intents` to read the wallet's intents.near balance
74
+ * (`mt_balance_of`) instead of the on-chain account balance.
75
+ */
76
+ get: operations["getBalance"];
77
+ put?: never;
78
+ post?: never;
79
+ delete?: never;
80
+ options?: never;
81
+ head?: never;
82
+ patch?: never;
83
+ trace?: never;
84
+ };
85
+ "/wallet/v1/tokens": {
86
+ parameters: {
87
+ query?: never;
88
+ header?: never;
89
+ path?: never;
90
+ cookie?: never;
91
+ };
92
+ /**
93
+ * List supported tokens
94
+ * @description Returns the token catalog supported for swaps and cross-chain withdraws
95
+ * via NEAR Intents. Token IDs are typed as `nep141:<contract>` and map to
96
+ * each chain via `defuse_asset_id`.
97
+ */
98
+ get: operations["listTokens"];
99
+ put?: never;
100
+ post?: never;
101
+ delete?: never;
102
+ options?: never;
103
+ head?: never;
104
+ patch?: never;
105
+ trace?: never;
106
+ };
107
+ "/wallet/v1/call": {
108
+ parameters: {
109
+ query?: never;
110
+ header?: never;
111
+ path?: never;
112
+ cookie?: never;
113
+ };
114
+ get?: never;
115
+ put?: never;
116
+ /**
117
+ * Sign and broadcast a NEAR function call
118
+ * @description Native NEAR contract call. Policy is enforced before signing; if the
119
+ * call exceeds limits, the response carries `status=pending_approval`
120
+ * and an `approval_id` for the multisig flow.
121
+ */
122
+ post: operations["call"];
123
+ delete?: never;
124
+ options?: never;
125
+ head?: never;
126
+ patch?: never;
127
+ trace?: never;
128
+ };
129
+ "/wallet/v1/transfer": {
130
+ parameters: {
131
+ query?: never;
132
+ header?: never;
133
+ path?: never;
134
+ cookie?: never;
135
+ };
136
+ get?: never;
137
+ put?: never;
138
+ /**
139
+ * Native chain transfer
140
+ * @description Chain-agnostic native transfer (NEAR yoctoNEAR units). Currently only
141
+ * `chain=near` is supported; other chains return `unsupported_chain`.
142
+ */
143
+ post: operations["transfer"];
144
+ delete?: never;
145
+ options?: never;
146
+ head?: never;
147
+ patch?: never;
148
+ trace?: never;
149
+ };
150
+ "/wallet/v1/intents/deposit": {
151
+ parameters: {
152
+ query?: never;
153
+ header?: never;
154
+ path?: never;
155
+ cookie?: never;
156
+ };
157
+ get?: never;
158
+ put?: never;
159
+ /**
160
+ * Deposit FT into intents.near
161
+ * @description Wraps `ft_transfer_call` to `intents.near`, auto-handling storage
162
+ * deposit if required. After this call, the wallet's intents.near balance
163
+ * increases by `amount` of `token` and is available for swaps and
164
+ * gasless cross-chain withdrawals.
165
+ */
166
+ post: operations["intentsDeposit"];
167
+ delete?: never;
168
+ options?: never;
169
+ head?: never;
170
+ patch?: never;
171
+ trace?: never;
172
+ };
173
+ "/wallet/v1/intents/withdraw": {
174
+ parameters: {
175
+ query?: never;
176
+ header?: never;
177
+ path?: never;
178
+ cookie?: never;
179
+ };
180
+ get?: never;
181
+ put?: never;
182
+ /**
183
+ * Withdraw via NEAR Intents (gasless cross-chain)
184
+ * @description Gasless cross-chain withdrawal through NEAR Intents solver relay. The
185
+ * wallet's intents.near balance is debited; the receiver gets funds on
186
+ * the destination chain (NEAR, Ethereum, Solana, Bitcoin) without paying
187
+ * gas on either side.
188
+ *
189
+ * If the policy requires approval, returns `status=pending_approval` with
190
+ * an `approval_id`.
191
+ */
192
+ post: operations["intentsWithdraw"];
193
+ delete?: never;
194
+ options?: never;
195
+ head?: never;
196
+ patch?: never;
197
+ trace?: never;
198
+ };
199
+ "/wallet/v1/intents/withdraw/dry-run": {
200
+ parameters: {
201
+ query?: never;
202
+ header?: never;
203
+ path?: never;
204
+ cookie?: never;
205
+ };
206
+ get?: never;
207
+ put?: never;
208
+ /**
209
+ * Simulate a withdraw (policy + balance check, no execution)
210
+ * @description Runs the full policy and balance check for a withdraw without signing
211
+ * or broadcasting. Useful for showing the user whether an action would
212
+ * succeed before they confirm.
213
+ */
214
+ post: operations["intentsWithdrawDryRun"];
215
+ delete?: never;
216
+ options?: never;
217
+ head?: never;
218
+ patch?: never;
219
+ trace?: never;
220
+ };
221
+ "/wallet/v1/intents/swap": {
222
+ parameters: {
223
+ query?: never;
224
+ header?: never;
225
+ path?: never;
226
+ cookie?: never;
227
+ };
228
+ get?: never;
229
+ put?: never;
230
+ /**
231
+ * Swap via NEAR Intents (1Click)
232
+ * @description Cross-chain swap via the 1Click solver. Quote → deposit to intents.near
233
+ * → mt_transfer → poll. Returns when the swap settles or fails.
234
+ */
235
+ post: operations["intentsSwap"];
236
+ delete?: never;
237
+ options?: never;
238
+ head?: never;
239
+ patch?: never;
240
+ trace?: never;
241
+ };
242
+ "/wallet/v1/intents/swap/quote": {
243
+ parameters: {
244
+ query?: never;
245
+ header?: never;
246
+ path?: never;
247
+ cookie?: never;
248
+ };
249
+ get?: never;
250
+ put?: never;
251
+ /**
252
+ * Get a swap quote (no execution)
253
+ * @description Returns the indicative output and deadline for a swap without executing
254
+ * it. Use this before calling `/intents/swap` to show the user expected
255
+ * output and allow them to set `min_amount_out`.
256
+ */
257
+ post: operations["intentsSwapQuote"];
258
+ delete?: never;
259
+ options?: never;
260
+ head?: never;
261
+ patch?: never;
262
+ trace?: never;
263
+ };
264
+ "/wallet/v1/sign-message": {
265
+ parameters: {
266
+ query?: never;
267
+ header?: never;
268
+ path?: never;
269
+ cookie?: never;
270
+ };
271
+ get?: never;
272
+ put?: never;
273
+ /**
274
+ * Sign an arbitrary message (NEP-413 or raw)
275
+ * @description Signs a message with the wallet's NEAR key. Use `format=nep413` (default)
276
+ * for the standard NEP-413 signing scheme; use `format=raw` for raw byte
277
+ * signing.
278
+ *
279
+ * Policy and freeze still apply — a frozen wallet cannot sign.
280
+ */
281
+ post: operations["signMessage"];
282
+ delete?: never;
283
+ options?: never;
284
+ head?: never;
285
+ patch?: never;
286
+ trace?: never;
287
+ };
288
+ "/wallet/v1/requests": {
289
+ parameters: {
290
+ query?: never;
291
+ header?: never;
292
+ path?: never;
293
+ cookie?: never;
294
+ };
295
+ /** List async wallet requests */
296
+ get: operations["listRequests"];
297
+ put?: never;
298
+ post?: never;
299
+ delete?: never;
300
+ options?: never;
301
+ head?: never;
302
+ patch?: never;
303
+ trace?: never;
304
+ };
305
+ "/wallet/v1/requests/{id}": {
306
+ parameters: {
307
+ query?: never;
308
+ header?: never;
309
+ path?: never;
310
+ cookie?: never;
311
+ };
312
+ /** Get a single request's status */
313
+ get: operations["getRequest"];
314
+ put?: never;
315
+ post?: never;
316
+ delete?: never;
317
+ options?: never;
318
+ head?: never;
319
+ patch?: never;
320
+ trace?: never;
321
+ };
322
+ "/wallet/v1/policy": {
323
+ parameters: {
324
+ query?: never;
325
+ header?: never;
326
+ path?: never;
327
+ cookie?: never;
328
+ };
329
+ /**
330
+ * Get current decrypted policy
331
+ * @description Returns the wallet's current policy (decrypted by the keystore TEE),
332
+ * plus the current usage counters used by velocity-limit checks.
333
+ */
334
+ get: operations["getPolicy"];
335
+ put?: never;
336
+ post?: never;
337
+ delete?: never;
338
+ options?: never;
339
+ head?: never;
340
+ patch?: never;
341
+ trace?: never;
342
+ };
343
+ "/wallet/v1/encrypt-policy": {
344
+ parameters: {
345
+ query?: never;
346
+ header?: never;
347
+ path?: never;
348
+ cookie?: never;
349
+ };
350
+ get?: never;
351
+ put?: never;
352
+ /**
353
+ * Encrypt a policy for on-chain storage
354
+ * @description Sends a policy JSON to the keystore TEE for encryption. The returned
355
+ * `encrypted_base64` is what gets stored in NEAR via
356
+ * `store_wallet_policy(...)` after the keystore signs it.
357
+ */
358
+ post: operations["encryptPolicy"];
359
+ delete?: never;
360
+ options?: never;
361
+ head?: never;
362
+ patch?: never;
363
+ trace?: never;
364
+ };
365
+ "/wallet/v1/sign-policy": {
366
+ parameters: {
367
+ query?: never;
368
+ header?: never;
369
+ path?: never;
370
+ cookie?: never;
371
+ };
372
+ get?: never;
373
+ put?: never;
374
+ /**
375
+ * Sign an encrypted policy (for on-chain submission)
376
+ * @description The keystore signs `SHA256(encrypted_data)` with the wallet's key. The
377
+ * signature + encrypted data + public key form the payload for the
378
+ * on-chain `store_wallet_policy(...)` call.
379
+ */
380
+ post: operations["signPolicy"];
381
+ delete?: never;
382
+ options?: never;
383
+ head?: never;
384
+ patch?: never;
385
+ trace?: never;
386
+ };
387
+ "/wallet/v1/invalidate-cache": {
388
+ parameters: {
389
+ query?: never;
390
+ header?: never;
391
+ path?: never;
392
+ cookie?: never;
393
+ };
394
+ get?: never;
395
+ put?: never;
396
+ /**
397
+ * Invalidate negative policy cache
398
+ * @description Forces the coordinator to drop its cached `no_policy` flag for a wallet.
399
+ * Call this after submitting `store_wallet_policy(...)` on-chain so that
400
+ * subsequent operations pick up the new policy without waiting for the
401
+ * 5-minute TTL to expire.
402
+ */
403
+ post: operations["invalidatePolicyCache"];
404
+ delete?: never;
405
+ options?: never;
406
+ head?: never;
407
+ patch?: never;
408
+ trace?: never;
409
+ };
410
+ "/wallet/v1/pending_approvals": {
411
+ parameters: {
412
+ query?: never;
413
+ header?: never;
414
+ path?: never;
415
+ cookie?: never;
416
+ };
417
+ /** List pending multisig approvals */
418
+ get: operations["listPendingApprovals"];
419
+ put?: never;
420
+ post?: never;
421
+ delete?: never;
422
+ options?: never;
423
+ head?: never;
424
+ patch?: never;
425
+ trace?: never;
426
+ };
427
+ "/wallet/v1/approve/{id}": {
428
+ parameters: {
429
+ query?: never;
430
+ header?: never;
431
+ path?: never;
432
+ cookie?: never;
433
+ };
434
+ get?: never;
435
+ put?: never;
436
+ /**
437
+ * Approve a pending action (NEP-413 signed)
438
+ * @description Submits an approver's NEP-413 signature for a pending action. When the
439
+ * approval threshold is reached, the action auto-executes. No API key
440
+ * required — auth is established by the NEP-413 signature in the body.
441
+ */
442
+ post: operations["approveRequest"];
443
+ delete?: never;
444
+ options?: never;
445
+ head?: never;
446
+ patch?: never;
447
+ trace?: never;
448
+ };
449
+ "/wallet/v1/reject/{id}": {
450
+ parameters: {
451
+ query?: never;
452
+ header?: never;
453
+ path?: never;
454
+ cookie?: never;
455
+ };
456
+ get?: never;
457
+ put?: never;
458
+ /** Reject a pending action (NEP-413 signed) */
459
+ post: operations["rejectRequest"];
460
+ delete?: never;
461
+ options?: never;
462
+ head?: never;
463
+ patch?: never;
464
+ trace?: never;
465
+ };
466
+ "/wallet/v1/audit": {
467
+ parameters: {
468
+ query?: never;
469
+ header?: never;
470
+ path?: never;
471
+ cookie?: never;
472
+ };
473
+ /** Event history for the wallet */
474
+ get: operations["listAuditEvents"];
475
+ put?: never;
476
+ post?: never;
477
+ delete?: never;
478
+ options?: never;
479
+ head?: never;
480
+ patch?: never;
481
+ trace?: never;
482
+ };
483
+ }
484
+ interface components {
485
+ schemas: {
486
+ /**
487
+ * @description Supported chain identifier.
488
+ * @enum {string}
489
+ */
490
+ Chain: "near" | "ethereum" | "solana" | "bitcoin";
491
+ /** @enum {string} */
492
+ RequestType: "call" | "transfer" | "withdraw" | "deposit" | "swap";
493
+ /** @enum {string} */
494
+ RequestStatus: "processing" | "success" | "failed" | "pending_approval" | "approved" | "rejected";
495
+ /** @enum {string} */
496
+ ErrorCode: "missing_auth" | "invalid_api_key" | "missing_wallet_id" | "missing_signature" | "timestamp_expired" | "wallet_frozen" | "policy_denied" | "not_approver" | "insufficient_balance" | "invalid_address" | "rate_limited" | "unsupported_chain" | "unsupported_token" | "request_not_found" | "approval_not_found" | "bad_request" | "duplicate_idempotency_key" | "internal_error";
497
+ ErrorResponse: {
498
+ error: components["schemas"]["ErrorCode"];
499
+ message?: string;
500
+ details?: {
501
+ [key: string]: unknown;
502
+ };
503
+ };
504
+ /**
505
+ * @description For the common case (anonymous wallet on OutLayer's shared master),
506
+ * send empty `{}`. Optional fields enable advanced flows:
507
+ *
508
+ * - `vault_id`: bind this wallet to an existing customer-owned vault,
509
+ * so the wallet's master is derived through the vault's per-customer
510
+ * MPC-derived master instead of OutLayer's shared default. The vault
511
+ * must already be deployed and verified — **vault deployment is not
512
+ * done through this endpoint**. Use the dashboard
513
+ * (https://outlayer.fastnear.com/vault) or the CLI
514
+ * (`outlayer vault init`) to deploy. Reference:
515
+ * https://outlayer.fastnear.com/docs/vaults
516
+ * - `account_id` + `pubkey` + `message` + `signature`: bind the wallet
517
+ * to a verified NEAR account via NEP-413 proof-of-ownership. Used
518
+ * by clients that want operational keys (`wk_...`) tied to a real
519
+ * NEAR account.
520
+ */
521
+ RegisterRequest: {
522
+ /** @description NEAR account ID to bind the wallet to (requires NEP-413 signature). */
523
+ account_id?: string;
524
+ /** @description Reserved for deterministic-wallet derivation. Most callers leave unset. */
525
+ seed?: string;
526
+ /** @description NEP-413 signer pubkey (paired with `account_id` + `signature`). */
527
+ pubkey?: string;
528
+ /** @description NEP-413 message that was signed. */
529
+ message?: string;
530
+ /** @description NEP-413 signature over `message`. */
531
+ signature?: string;
532
+ /**
533
+ * @description ID of a deployed and verified customer vault (e.g. `vault.alice.near`).
534
+ * Binding is permanent — the resulting API key is tied to this vault
535
+ * for its lifetime. All subsequent operations on the API key
536
+ * automatically derive keys through the per-vault master; you do
537
+ * NOT pass `vault_id` on every call.
538
+ */
539
+ vault_id?: string;
540
+ };
541
+ RegisterResponse: {
542
+ /** Format: uuid */
543
+ wallet_id: string;
544
+ /** @description Shown once. Not retrievable later — save it now. */
545
+ api_key?: string;
546
+ near_account_id: string;
547
+ /**
548
+ * Format: uri
549
+ * @description Dashboard URL where the controller sets policy.
550
+ */
551
+ handoff_url?: string;
552
+ trial?: components["schemas"]["TrialInfo"];
553
+ };
554
+ TrialInfo: {
555
+ calls_remaining?: number;
556
+ /** Format: date-time */
557
+ expires_at?: string;
558
+ limits?: {
559
+ max_instructions?: number;
560
+ max_execution_seconds?: number;
561
+ max_memory_mb?: number;
562
+ };
563
+ };
564
+ AddressResponse: {
565
+ wallet_id: string;
566
+ chain: components["schemas"]["Chain"];
567
+ address: string;
568
+ public_key: string;
569
+ vault_id?: string | null;
570
+ };
571
+ BalanceResponse: {
572
+ /** @description Amount in token's smallest unit. */
573
+ balance: string;
574
+ token: string;
575
+ account_id: string;
576
+ };
577
+ TokenInfo: {
578
+ id: string;
579
+ symbol: string;
580
+ chains: components["schemas"]["Chain"][];
581
+ decimals: number;
582
+ defuse_asset_id?: string;
583
+ };
584
+ TokensResponse: {
585
+ tokens: components["schemas"]["TokenInfo"][];
586
+ };
587
+ CallRequest: {
588
+ receiver_id: string;
589
+ method_name: string;
590
+ /** @description Method arguments as a JSON object. Mutually exclusive with `args_base64`. */
591
+ args?: {
592
+ [key: string]: unknown;
593
+ };
594
+ /** @description Pre-encoded base64 args. Use for non-JSON encodings. */
595
+ args_base64?: string;
596
+ /** @description Gas budget in TGas as a string. Defaults to `30000000000000` (30 TGas) server-side. */
597
+ gas?: string;
598
+ /** @description Attached NEAR deposit in yoctoNEAR. Defaults to `0` server-side. */
599
+ deposit?: string;
600
+ };
601
+ CallResponse: {
602
+ /** Format: uuid */
603
+ request_id: string;
604
+ status: components["schemas"]["RequestStatus"];
605
+ tx_hash?: string | null;
606
+ result?: {
607
+ [key: string]: unknown;
608
+ } | null;
609
+ /** Format: uuid */
610
+ approval_id?: string | null;
611
+ required?: number | null;
612
+ approved?: number | null;
613
+ };
614
+ TransferRequest: {
615
+ /** @description Chain to transfer on. Defaults to `near` server-side. */
616
+ chain?: components["schemas"]["Chain"];
617
+ receiver_id: string;
618
+ amount: string;
619
+ };
620
+ IntentsDepositRequest: {
621
+ token: string;
622
+ amount: string;
623
+ };
624
+ IntentsDepositResponse: {
625
+ /** Format: uuid */
626
+ request_id: string;
627
+ status: components["schemas"]["RequestStatus"];
628
+ tx_hash?: string | null;
629
+ };
630
+ WithdrawRequest: {
631
+ chain: components["schemas"]["Chain"];
632
+ /** @description Destination address on the target chain. */
633
+ to?: string;
634
+ amount: string;
635
+ /** @description Token ID, e.g. `nep141:usdt.tether-token.near`. Omit for native asset. */
636
+ token?: string;
637
+ };
638
+ WithdrawResponse: {
639
+ /** Format: uuid */
640
+ request_id: string;
641
+ status: components["schemas"]["RequestStatus"];
642
+ /** Format: uuid */
643
+ approval_id?: string | null;
644
+ required?: number | null;
645
+ approved?: number | null;
646
+ };
647
+ DryRunResponse: {
648
+ would_succeed?: boolean;
649
+ reason?: string;
650
+ message?: string;
651
+ estimated_fee?: string;
652
+ fee_token?: string;
653
+ policy_check?: {
654
+ /** @enum {string} */
655
+ decision?: "allowed" | "denied" | "requires_approval" | "frozen" | "no_policy_allow";
656
+ reason?: string;
657
+ required_approvals?: number;
658
+ };
659
+ };
660
+ SwapRequest: {
661
+ token_in: string;
662
+ token_out: string;
663
+ amount_in: string;
664
+ min_amount_out?: string;
665
+ };
666
+ SwapResponse: {
667
+ /** Format: uuid */
668
+ request_id: string;
669
+ status: components["schemas"]["RequestStatus"];
670
+ amount_out?: string;
671
+ intent_hash?: string;
672
+ };
673
+ SwapQuoteResponse: {
674
+ amount_out?: string;
675
+ min_amount_out?: string;
676
+ /** Format: date-time */
677
+ deadline?: string;
678
+ time_estimate_seconds?: number;
679
+ };
680
+ SignMessageRequest: {
681
+ message: string;
682
+ recipient: string;
683
+ /** @description Base64-encoded 32-byte nonce. Auto-generated if omitted. */
684
+ nonce?: string;
685
+ /**
686
+ * @default nep413
687
+ * @enum {string}
688
+ */
689
+ format: "nep413" | "raw";
690
+ };
691
+ SignMessageResponse: {
692
+ account_id?: string;
693
+ signature?: string;
694
+ signature_base64?: string;
695
+ public_key?: string;
696
+ nonce?: string;
697
+ };
698
+ PolicyRules: {
699
+ limits?: components["schemas"]["PolicyLimits"];
700
+ addresses?: components["schemas"]["AddressList"];
701
+ transaction_types?: components["schemas"]["RequestType"][];
702
+ time_restrictions?: components["schemas"]["TimeRestrictions"];
703
+ rate_limit?: components["schemas"]["RateLimit"];
704
+ };
705
+ /**
706
+ * @description Per-period spending limits. Each field is a map of `token_id → amount`.
707
+ * Use `"*"` as the key to match all tokens.
708
+ */
709
+ PolicyLimits: {
710
+ per_transaction?: {
711
+ [key: string]: string;
712
+ };
713
+ hourly?: {
714
+ [key: string]: string;
715
+ };
716
+ daily?: {
717
+ [key: string]: string;
718
+ };
719
+ monthly?: {
720
+ [key: string]: string;
721
+ };
722
+ };
723
+ AddressList: {
724
+ /** @enum {string} */
725
+ mode: "whitelist" | "blacklist";
726
+ list: string[];
727
+ };
728
+ TimeRestrictions: {
729
+ /** @description IANA timezone name, e.g. `UTC` or `Europe/Berlin`. */
730
+ timezone?: string;
731
+ allowed_hours?: number[];
732
+ /** @description 0 = Sunday, 6 = Saturday. */
733
+ allowed_days?: number[];
734
+ };
735
+ RateLimit: {
736
+ max_per_hour?: number;
737
+ };
738
+ ApprovalConfig: {
739
+ threshold?: {
740
+ required: number;
741
+ of: number;
742
+ };
743
+ /** @description Approval gate triggers when transaction value exceeds this USD amount. */
744
+ above_usd?: number;
745
+ approvers?: components["schemas"]["Approver"][];
746
+ };
747
+ Approver: {
748
+ /** @description Public key, e.g. `ed25519:...`. */
749
+ id: string;
750
+ /** @enum {string} */
751
+ role: "admin" | "signer";
752
+ };
753
+ AdminQuorum: {
754
+ required: number;
755
+ admins: string[];
756
+ };
757
+ PolicyResponse: {
758
+ wallet_id: string;
759
+ /** @description NEAR account that owns the policy. */
760
+ controller: string;
761
+ frozen: boolean;
762
+ rules?: components["schemas"]["PolicyRules"];
763
+ approval?: components["schemas"]["ApprovalConfig"];
764
+ authorized_key_hashes?: string[];
765
+ /**
766
+ * @description Current accumulated usage per token, per period. Same shape as
767
+ * `PolicyLimits` — used for client-side velocity-limit visualization.
768
+ */
769
+ usage?: {
770
+ [key: string]: unknown;
771
+ };
772
+ };
773
+ EncryptPolicyRequest: {
774
+ wallet_id: string;
775
+ rules: components["schemas"]["PolicyRules"];
776
+ approval?: components["schemas"]["ApprovalConfig"];
777
+ admin_quorum?: components["schemas"]["AdminQuorum"];
778
+ /** Format: uri */
779
+ webhook_url?: string;
780
+ authorized_key_hashes?: string[];
781
+ };
782
+ EncryptPolicyResponse: {
783
+ encrypted_base64: string;
784
+ wallet_pubkey: string;
785
+ };
786
+ SignPolicyRequest: {
787
+ encrypted_data: string;
788
+ };
789
+ SignPolicyResponse: {
790
+ signature_hex: string;
791
+ public_key_hex: string;
792
+ };
793
+ InvalidateCacheRequest: {
794
+ wallet_id: string;
795
+ };
796
+ PendingApproval: {
797
+ /** Format: uuid */
798
+ approval_id: string;
799
+ /** Format: uuid */
800
+ request_id?: string | null;
801
+ type: components["schemas"]["RequestType"];
802
+ request_data: {
803
+ [key: string]: unknown;
804
+ };
805
+ required: number;
806
+ approved: number;
807
+ /** Format: date-time */
808
+ expires_at: string;
809
+ };
810
+ PendingApprovalsResponse: {
811
+ approvals: components["schemas"]["PendingApproval"][];
812
+ };
813
+ /**
814
+ * @description NEP-413 signed authentication payload. The signed message is
815
+ * `approve:{approval_id}:{request_hash}` for approve or
816
+ * `reject:{approval_id}:{request_hash}` for reject.
817
+ */
818
+ Nep413Auth: {
819
+ signature: string;
820
+ public_key: string;
821
+ account_id: string;
822
+ nonce: string;
823
+ };
824
+ RejectRequest: components["schemas"]["Nep413Auth"] & {
825
+ reason?: string;
826
+ };
827
+ ApproveResponse: {
828
+ /** Format: uuid */
829
+ approval_id: string;
830
+ /** @enum {string} */
831
+ status: "pending" | "approved" | "rejected" | "expired";
832
+ approved: number;
833
+ required: number;
834
+ /** Format: uuid */
835
+ request_id?: string | null;
836
+ };
837
+ AuditEvent: {
838
+ type: string;
839
+ request_id?: string | null;
840
+ status?: string | null;
841
+ details: {
842
+ [key: string]: unknown;
843
+ };
844
+ /** Format: date-time */
845
+ at: string;
846
+ };
847
+ AuditResponse: {
848
+ events: components["schemas"]["AuditEvent"][];
849
+ };
850
+ RequestStatusResponse: {
851
+ /** Format: uuid */
852
+ request_id: string;
853
+ type: components["schemas"]["RequestType"];
854
+ status: components["schemas"]["RequestStatus"];
855
+ result?: {
856
+ [key: string]: unknown;
857
+ } | null;
858
+ /** Format: date-time */
859
+ created_at: string;
860
+ /** Format: date-time */
861
+ updated_at?: string | null;
862
+ };
863
+ RequestListResponse: {
864
+ requests: components["schemas"]["RequestStatusResponse"][];
865
+ total: number;
866
+ };
867
+ };
868
+ responses: {
869
+ /** @description Invalid request */
870
+ BadRequest: {
871
+ headers: {
872
+ [name: string]: unknown;
873
+ };
874
+ content: {
875
+ "application/json": components["schemas"]["ErrorResponse"];
876
+ };
877
+ };
878
+ /** @description Missing or invalid credentials */
879
+ Unauthorized: {
880
+ headers: {
881
+ [name: string]: unknown;
882
+ };
883
+ content: {
884
+ "application/json": components["schemas"]["ErrorResponse"];
885
+ };
886
+ };
887
+ /** @description Action blocked by policy or wallet state */
888
+ Forbidden: {
889
+ headers: {
890
+ [name: string]: unknown;
891
+ };
892
+ content: {
893
+ "application/json": components["schemas"]["ErrorResponse"];
894
+ };
895
+ };
896
+ /** @description Resource does not exist */
897
+ NotFound: {
898
+ headers: {
899
+ [name: string]: unknown;
900
+ };
901
+ content: {
902
+ "application/json": components["schemas"]["ErrorResponse"];
903
+ };
904
+ };
905
+ /** @description Too many requests */
906
+ RateLimited: {
907
+ headers: {
908
+ [name: string]: unknown;
909
+ };
910
+ content: {
911
+ "application/json": components["schemas"]["ErrorResponse"];
912
+ };
913
+ };
914
+ /** @description Server error */
915
+ InternalError: {
916
+ headers: {
917
+ [name: string]: unknown;
918
+ };
919
+ content: {
920
+ "application/json": components["schemas"]["ErrorResponse"];
921
+ };
922
+ };
923
+ };
924
+ parameters: {
925
+ /**
926
+ * @description Optional idempotency token. Resubmitting a write request with the same
927
+ * key returns the original result without re-execution. Recommended for
928
+ * clients that retry on network failure.
929
+ */
930
+ IdempotencyKey: string;
931
+ };
932
+ requestBodies: never;
933
+ headers: never;
934
+ pathItems: never;
935
+ }
936
+ interface operations {
937
+ registerWallet: {
938
+ parameters: {
939
+ query?: never;
940
+ header?: never;
941
+ path?: never;
942
+ cookie?: never;
943
+ };
944
+ requestBody?: {
945
+ content: {
946
+ "application/json": components["schemas"]["RegisterRequest"];
947
+ };
948
+ };
949
+ responses: {
950
+ /** @description Wallet created */
951
+ 200: {
952
+ headers: {
953
+ [name: string]: unknown;
954
+ };
955
+ content: {
956
+ "application/json": components["schemas"]["RegisterResponse"];
957
+ };
958
+ };
959
+ 400: components["responses"]["BadRequest"];
960
+ 429: components["responses"]["RateLimited"];
961
+ 500: components["responses"]["InternalError"];
962
+ };
963
+ };
964
+ getAddress: {
965
+ parameters: {
966
+ query: {
967
+ chain: components["schemas"]["Chain"];
968
+ };
969
+ header?: never;
970
+ path?: never;
971
+ cookie?: never;
972
+ };
973
+ requestBody?: never;
974
+ responses: {
975
+ /** @description Address derived */
976
+ 200: {
977
+ headers: {
978
+ [name: string]: unknown;
979
+ };
980
+ content: {
981
+ /**
982
+ * @example {
983
+ * "wallet_id": "9c3c9e10-1c1f-4f5e-9c4a-1d7b9a8f3c20",
984
+ * "chain": "near",
985
+ * "address": "9c3c9e101c1f4f5e9c4a1d7b9a8f3c20",
986
+ * "public_key": "ed25519:7BcBZ9Z...",
987
+ * "vault_id": null
988
+ * }
989
+ */
990
+ "application/json": components["schemas"]["AddressResponse"];
991
+ };
992
+ };
993
+ 400: components["responses"]["BadRequest"];
994
+ 401: components["responses"]["Unauthorized"];
995
+ 500: components["responses"]["InternalError"];
996
+ };
997
+ };
998
+ getBalance: {
999
+ parameters: {
1000
+ query?: {
1001
+ chain?: components["schemas"]["Chain"];
1002
+ /** @description Token ID (`nep141:<contract>` or `native`). */
1003
+ token?: string;
1004
+ source?: "chain" | "intents";
1005
+ };
1006
+ header?: never;
1007
+ path?: never;
1008
+ cookie?: never;
1009
+ };
1010
+ requestBody?: never;
1011
+ responses: {
1012
+ /** @description Balance */
1013
+ 200: {
1014
+ headers: {
1015
+ [name: string]: unknown;
1016
+ };
1017
+ content: {
1018
+ /**
1019
+ * @example {
1020
+ * "balance": "1000000000000000000000000",
1021
+ * "token": "NEAR",
1022
+ * "account_id": "9c3c9e101c1f4f5e9c4a1d7b9a8f3c20"
1023
+ * }
1024
+ */
1025
+ "application/json": components["schemas"]["BalanceResponse"];
1026
+ };
1027
+ };
1028
+ 400: components["responses"]["BadRequest"];
1029
+ 401: components["responses"]["Unauthorized"];
1030
+ 500: components["responses"]["InternalError"];
1031
+ };
1032
+ };
1033
+ listTokens: {
1034
+ parameters: {
1035
+ query?: never;
1036
+ header?: never;
1037
+ path?: never;
1038
+ cookie?: never;
1039
+ };
1040
+ requestBody?: never;
1041
+ responses: {
1042
+ /** @description Token list */
1043
+ 200: {
1044
+ headers: {
1045
+ [name: string]: unknown;
1046
+ };
1047
+ content: {
1048
+ "application/json": components["schemas"]["TokensResponse"];
1049
+ };
1050
+ };
1051
+ 401: components["responses"]["Unauthorized"];
1052
+ 500: components["responses"]["InternalError"];
1053
+ };
1054
+ };
1055
+ call: {
1056
+ parameters: {
1057
+ query?: never;
1058
+ header?: {
1059
+ /**
1060
+ * @description Optional idempotency token. Resubmitting a write request with the same
1061
+ * key returns the original result without re-execution. Recommended for
1062
+ * clients that retry on network failure.
1063
+ */
1064
+ "Idempotency-Key"?: components["parameters"]["IdempotencyKey"];
1065
+ };
1066
+ path?: never;
1067
+ cookie?: never;
1068
+ };
1069
+ requestBody: {
1070
+ content: {
1071
+ /**
1072
+ * @example {
1073
+ * "receiver_id": "usdt.tether-token.near",
1074
+ * "method_name": "ft_transfer",
1075
+ * "args": {
1076
+ * "receiver_id": "bob.near",
1077
+ * "amount": "1000000"
1078
+ * },
1079
+ * "gas": "30000000000000",
1080
+ * "deposit": "1"
1081
+ * }
1082
+ */
1083
+ "application/json": components["schemas"]["CallRequest"];
1084
+ };
1085
+ };
1086
+ responses: {
1087
+ /** @description Call submitted (or queued for approval) */
1088
+ 200: {
1089
+ headers: {
1090
+ [name: string]: unknown;
1091
+ };
1092
+ content: {
1093
+ "application/json": components["schemas"]["CallResponse"];
1094
+ };
1095
+ };
1096
+ 400: components["responses"]["BadRequest"];
1097
+ 401: components["responses"]["Unauthorized"];
1098
+ 403: components["responses"]["Forbidden"];
1099
+ 429: components["responses"]["RateLimited"];
1100
+ 500: components["responses"]["InternalError"];
1101
+ };
1102
+ };
1103
+ transfer: {
1104
+ parameters: {
1105
+ query?: never;
1106
+ header?: {
1107
+ /**
1108
+ * @description Optional idempotency token. Resubmitting a write request with the same
1109
+ * key returns the original result without re-execution. Recommended for
1110
+ * clients that retry on network failure.
1111
+ */
1112
+ "Idempotency-Key"?: components["parameters"]["IdempotencyKey"];
1113
+ };
1114
+ path?: never;
1115
+ cookie?: never;
1116
+ };
1117
+ requestBody: {
1118
+ content: {
1119
+ /**
1120
+ * @example {
1121
+ * "chain": "near",
1122
+ * "receiver_id": "bob.near",
1123
+ * "amount": "1000000000000000000000000"
1124
+ * }
1125
+ */
1126
+ "application/json": components["schemas"]["TransferRequest"];
1127
+ };
1128
+ };
1129
+ responses: {
1130
+ /** @description Transfer submitted */
1131
+ 200: {
1132
+ headers: {
1133
+ [name: string]: unknown;
1134
+ };
1135
+ content: {
1136
+ "application/json": components["schemas"]["CallResponse"];
1137
+ };
1138
+ };
1139
+ 400: components["responses"]["BadRequest"];
1140
+ 401: components["responses"]["Unauthorized"];
1141
+ 403: components["responses"]["Forbidden"];
1142
+ 500: components["responses"]["InternalError"];
1143
+ };
1144
+ };
1145
+ intentsDeposit: {
1146
+ parameters: {
1147
+ query?: never;
1148
+ header?: {
1149
+ /**
1150
+ * @description Optional idempotency token. Resubmitting a write request with the same
1151
+ * key returns the original result without re-execution. Recommended for
1152
+ * clients that retry on network failure.
1153
+ */
1154
+ "Idempotency-Key"?: components["parameters"]["IdempotencyKey"];
1155
+ };
1156
+ path?: never;
1157
+ cookie?: never;
1158
+ };
1159
+ requestBody: {
1160
+ content: {
1161
+ /**
1162
+ * @example {
1163
+ * "token": "wrap.near",
1164
+ * "amount": "5000000000000000000000000"
1165
+ * }
1166
+ */
1167
+ "application/json": components["schemas"]["IntentsDepositRequest"];
1168
+ };
1169
+ };
1170
+ responses: {
1171
+ /** @description Deposit submitted */
1172
+ 200: {
1173
+ headers: {
1174
+ [name: string]: unknown;
1175
+ };
1176
+ content: {
1177
+ "application/json": components["schemas"]["IntentsDepositResponse"];
1178
+ };
1179
+ };
1180
+ 400: components["responses"]["BadRequest"];
1181
+ 401: components["responses"]["Unauthorized"];
1182
+ 403: components["responses"]["Forbidden"];
1183
+ 500: components["responses"]["InternalError"];
1184
+ };
1185
+ };
1186
+ intentsWithdraw: {
1187
+ parameters: {
1188
+ query?: never;
1189
+ header?: {
1190
+ /**
1191
+ * @description Optional idempotency token. Resubmitting a write request with the same
1192
+ * key returns the original result without re-execution. Recommended for
1193
+ * clients that retry on network failure.
1194
+ */
1195
+ "Idempotency-Key"?: components["parameters"]["IdempotencyKey"];
1196
+ };
1197
+ path?: never;
1198
+ cookie?: never;
1199
+ };
1200
+ requestBody: {
1201
+ content: {
1202
+ /**
1203
+ * @example {
1204
+ * "chain": "ethereum",
1205
+ * "to": "0x742d35Cc6634C0532925a3b844Bc9e7595f8b4f5",
1206
+ * "amount": "1000000",
1207
+ * "token": "nep141:usdt.tether-token.near"
1208
+ * }
1209
+ */
1210
+ "application/json": components["schemas"]["WithdrawRequest"];
1211
+ };
1212
+ };
1213
+ responses: {
1214
+ /** @description Withdraw submitted (or queued for approval) */
1215
+ 200: {
1216
+ headers: {
1217
+ [name: string]: unknown;
1218
+ };
1219
+ content: {
1220
+ "application/json": components["schemas"]["WithdrawResponse"];
1221
+ };
1222
+ };
1223
+ 400: components["responses"]["BadRequest"];
1224
+ 401: components["responses"]["Unauthorized"];
1225
+ 403: components["responses"]["Forbidden"];
1226
+ 500: components["responses"]["InternalError"];
1227
+ };
1228
+ };
1229
+ intentsWithdrawDryRun: {
1230
+ parameters: {
1231
+ query?: never;
1232
+ header?: never;
1233
+ path?: never;
1234
+ cookie?: never;
1235
+ };
1236
+ requestBody: {
1237
+ content: {
1238
+ "application/json": components["schemas"]["WithdrawRequest"];
1239
+ };
1240
+ };
1241
+ responses: {
1242
+ /** @description Dry-run result */
1243
+ 200: {
1244
+ headers: {
1245
+ [name: string]: unknown;
1246
+ };
1247
+ content: {
1248
+ "application/json": components["schemas"]["DryRunResponse"];
1249
+ };
1250
+ };
1251
+ 400: components["responses"]["BadRequest"];
1252
+ 401: components["responses"]["Unauthorized"];
1253
+ 500: components["responses"]["InternalError"];
1254
+ };
1255
+ };
1256
+ intentsSwap: {
1257
+ parameters: {
1258
+ query?: never;
1259
+ header?: {
1260
+ /**
1261
+ * @description Optional idempotency token. Resubmitting a write request with the same
1262
+ * key returns the original result without re-execution. Recommended for
1263
+ * clients that retry on network failure.
1264
+ */
1265
+ "Idempotency-Key"?: components["parameters"]["IdempotencyKey"];
1266
+ };
1267
+ path?: never;
1268
+ cookie?: never;
1269
+ };
1270
+ requestBody: {
1271
+ content: {
1272
+ /**
1273
+ * @example {
1274
+ * "token_in": "nep141:wrap.near",
1275
+ * "token_out": "nep141:usdt.tether-token.near",
1276
+ * "amount_in": "5000000000000000000000000",
1277
+ * "min_amount_out": "24000000"
1278
+ * }
1279
+ */
1280
+ "application/json": components["schemas"]["SwapRequest"];
1281
+ };
1282
+ };
1283
+ responses: {
1284
+ /** @description Swap submitted */
1285
+ 200: {
1286
+ headers: {
1287
+ [name: string]: unknown;
1288
+ };
1289
+ content: {
1290
+ "application/json": components["schemas"]["SwapResponse"];
1291
+ };
1292
+ };
1293
+ 400: components["responses"]["BadRequest"];
1294
+ 401: components["responses"]["Unauthorized"];
1295
+ 403: components["responses"]["Forbidden"];
1296
+ 500: components["responses"]["InternalError"];
1297
+ };
1298
+ };
1299
+ intentsSwapQuote: {
1300
+ parameters: {
1301
+ query?: never;
1302
+ header?: never;
1303
+ path?: never;
1304
+ cookie?: never;
1305
+ };
1306
+ requestBody: {
1307
+ content: {
1308
+ "application/json": components["schemas"]["SwapRequest"];
1309
+ };
1310
+ };
1311
+ responses: {
1312
+ /** @description Quote */
1313
+ 200: {
1314
+ headers: {
1315
+ [name: string]: unknown;
1316
+ };
1317
+ content: {
1318
+ "application/json": components["schemas"]["SwapQuoteResponse"];
1319
+ };
1320
+ };
1321
+ 400: components["responses"]["BadRequest"];
1322
+ 401: components["responses"]["Unauthorized"];
1323
+ 500: components["responses"]["InternalError"];
1324
+ };
1325
+ };
1326
+ signMessage: {
1327
+ parameters: {
1328
+ query?: never;
1329
+ header?: never;
1330
+ path?: never;
1331
+ cookie?: never;
1332
+ };
1333
+ requestBody: {
1334
+ content: {
1335
+ /**
1336
+ * @example {
1337
+ * "message": "login:myapp:1716200000",
1338
+ * "recipient": "myapp.example",
1339
+ * "format": "nep413"
1340
+ * }
1341
+ */
1342
+ "application/json": components["schemas"]["SignMessageRequest"];
1343
+ };
1344
+ };
1345
+ responses: {
1346
+ /** @description Signature */
1347
+ 200: {
1348
+ headers: {
1349
+ [name: string]: unknown;
1350
+ };
1351
+ content: {
1352
+ "application/json": components["schemas"]["SignMessageResponse"];
1353
+ };
1354
+ };
1355
+ 400: components["responses"]["BadRequest"];
1356
+ 401: components["responses"]["Unauthorized"];
1357
+ 403: components["responses"]["Forbidden"];
1358
+ 500: components["responses"]["InternalError"];
1359
+ };
1360
+ };
1361
+ listRequests: {
1362
+ parameters: {
1363
+ query?: {
1364
+ type?: components["schemas"]["RequestType"];
1365
+ status?: components["schemas"]["RequestStatus"];
1366
+ limit?: number;
1367
+ offset?: number;
1368
+ };
1369
+ header?: never;
1370
+ path?: never;
1371
+ cookie?: never;
1372
+ };
1373
+ requestBody?: never;
1374
+ responses: {
1375
+ /** @description Request list */
1376
+ 200: {
1377
+ headers: {
1378
+ [name: string]: unknown;
1379
+ };
1380
+ content: {
1381
+ "application/json": components["schemas"]["RequestListResponse"];
1382
+ };
1383
+ };
1384
+ 401: components["responses"]["Unauthorized"];
1385
+ 500: components["responses"]["InternalError"];
1386
+ };
1387
+ };
1388
+ getRequest: {
1389
+ parameters: {
1390
+ query?: never;
1391
+ header?: never;
1392
+ path: {
1393
+ id: string;
1394
+ };
1395
+ cookie?: never;
1396
+ };
1397
+ requestBody?: never;
1398
+ responses: {
1399
+ /** @description Request status */
1400
+ 200: {
1401
+ headers: {
1402
+ [name: string]: unknown;
1403
+ };
1404
+ content: {
1405
+ "application/json": components["schemas"]["RequestStatusResponse"];
1406
+ };
1407
+ };
1408
+ 401: components["responses"]["Unauthorized"];
1409
+ 404: components["responses"]["NotFound"];
1410
+ 500: components["responses"]["InternalError"];
1411
+ };
1412
+ };
1413
+ getPolicy: {
1414
+ parameters: {
1415
+ query?: never;
1416
+ header?: never;
1417
+ path?: never;
1418
+ cookie?: never;
1419
+ };
1420
+ requestBody?: never;
1421
+ responses: {
1422
+ /** @description Current policy + usage */
1423
+ 200: {
1424
+ headers: {
1425
+ [name: string]: unknown;
1426
+ };
1427
+ content: {
1428
+ "application/json": components["schemas"]["PolicyResponse"];
1429
+ };
1430
+ };
1431
+ 401: components["responses"]["Unauthorized"];
1432
+ 500: components["responses"]["InternalError"];
1433
+ };
1434
+ };
1435
+ encryptPolicy: {
1436
+ parameters: {
1437
+ query?: never;
1438
+ header?: never;
1439
+ path?: never;
1440
+ cookie?: never;
1441
+ };
1442
+ requestBody: {
1443
+ content: {
1444
+ "application/json": components["schemas"]["EncryptPolicyRequest"];
1445
+ };
1446
+ };
1447
+ responses: {
1448
+ /** @description Encrypted policy */
1449
+ 200: {
1450
+ headers: {
1451
+ [name: string]: unknown;
1452
+ };
1453
+ content: {
1454
+ "application/json": components["schemas"]["EncryptPolicyResponse"];
1455
+ };
1456
+ };
1457
+ 400: components["responses"]["BadRequest"];
1458
+ 401: components["responses"]["Unauthorized"];
1459
+ 500: components["responses"]["InternalError"];
1460
+ };
1461
+ };
1462
+ signPolicy: {
1463
+ parameters: {
1464
+ query?: never;
1465
+ header?: never;
1466
+ path?: never;
1467
+ cookie?: never;
1468
+ };
1469
+ requestBody: {
1470
+ content: {
1471
+ "application/json": components["schemas"]["SignPolicyRequest"];
1472
+ };
1473
+ };
1474
+ responses: {
1475
+ /** @description Signature */
1476
+ 200: {
1477
+ headers: {
1478
+ [name: string]: unknown;
1479
+ };
1480
+ content: {
1481
+ "application/json": components["schemas"]["SignPolicyResponse"];
1482
+ };
1483
+ };
1484
+ 400: components["responses"]["BadRequest"];
1485
+ 401: components["responses"]["Unauthorized"];
1486
+ 500: components["responses"]["InternalError"];
1487
+ };
1488
+ };
1489
+ invalidatePolicyCache: {
1490
+ parameters: {
1491
+ query?: never;
1492
+ header?: never;
1493
+ path?: never;
1494
+ cookie?: never;
1495
+ };
1496
+ requestBody: {
1497
+ content: {
1498
+ "application/json": components["schemas"]["InvalidateCacheRequest"];
1499
+ };
1500
+ };
1501
+ responses: {
1502
+ /** @description Cache cleared */
1503
+ 200: {
1504
+ headers: {
1505
+ [name: string]: unknown;
1506
+ };
1507
+ content: {
1508
+ "application/json": {
1509
+ ok?: boolean;
1510
+ };
1511
+ };
1512
+ };
1513
+ 400: components["responses"]["BadRequest"];
1514
+ 500: components["responses"]["InternalError"];
1515
+ };
1516
+ };
1517
+ listPendingApprovals: {
1518
+ parameters: {
1519
+ query?: never;
1520
+ header?: never;
1521
+ path?: never;
1522
+ cookie?: never;
1523
+ };
1524
+ requestBody?: never;
1525
+ responses: {
1526
+ /** @description Pending approvals */
1527
+ 200: {
1528
+ headers: {
1529
+ [name: string]: unknown;
1530
+ };
1531
+ content: {
1532
+ "application/json": components["schemas"]["PendingApprovalsResponse"];
1533
+ };
1534
+ };
1535
+ 401: components["responses"]["Unauthorized"];
1536
+ 500: components["responses"]["InternalError"];
1537
+ };
1538
+ };
1539
+ approveRequest: {
1540
+ parameters: {
1541
+ query?: never;
1542
+ header?: never;
1543
+ path: {
1544
+ id: string;
1545
+ };
1546
+ cookie?: never;
1547
+ };
1548
+ requestBody: {
1549
+ content: {
1550
+ "application/json": components["schemas"]["Nep413Auth"];
1551
+ };
1552
+ };
1553
+ responses: {
1554
+ /** @description Approval recorded */
1555
+ 200: {
1556
+ headers: {
1557
+ [name: string]: unknown;
1558
+ };
1559
+ content: {
1560
+ "application/json": components["schemas"]["ApproveResponse"];
1561
+ };
1562
+ };
1563
+ 403: components["responses"]["Forbidden"];
1564
+ 404: components["responses"]["NotFound"];
1565
+ 500: components["responses"]["InternalError"];
1566
+ };
1567
+ };
1568
+ rejectRequest: {
1569
+ parameters: {
1570
+ query?: never;
1571
+ header?: never;
1572
+ path: {
1573
+ id: string;
1574
+ };
1575
+ cookie?: never;
1576
+ };
1577
+ requestBody: {
1578
+ content: {
1579
+ "application/json": components["schemas"]["RejectRequest"];
1580
+ };
1581
+ };
1582
+ responses: {
1583
+ /** @description Rejection recorded */
1584
+ 200: {
1585
+ headers: {
1586
+ [name: string]: unknown;
1587
+ };
1588
+ content: {
1589
+ "application/json": components["schemas"]["ApproveResponse"];
1590
+ };
1591
+ };
1592
+ 403: components["responses"]["Forbidden"];
1593
+ 404: components["responses"]["NotFound"];
1594
+ 500: components["responses"]["InternalError"];
1595
+ };
1596
+ };
1597
+ listAuditEvents: {
1598
+ parameters: {
1599
+ query?: {
1600
+ limit?: number;
1601
+ offset?: number;
1602
+ };
1603
+ header?: never;
1604
+ path?: never;
1605
+ cookie?: never;
1606
+ };
1607
+ requestBody?: never;
1608
+ responses: {
1609
+ /** @description Event list */
1610
+ 200: {
1611
+ headers: {
1612
+ [name: string]: unknown;
1613
+ };
1614
+ content: {
1615
+ "application/json": components["schemas"]["AuditResponse"];
1616
+ };
1617
+ };
1618
+ 401: components["responses"]["Unauthorized"];
1619
+ 500: components["responses"]["InternalError"];
1620
+ };
1621
+ };
1622
+ }
1623
+
1624
+ type RetryConfig = {
1625
+ maxAttempts?: number;
1626
+ initialDelayMs?: number;
1627
+ maxDelayMs?: number;
1628
+ };
1629
+ type ClientOptions = {
1630
+ apiKey: string;
1631
+ baseUrl?: string;
1632
+ fetch?: typeof fetch;
1633
+ retry?: RetryConfig;
1634
+ };
1635
+ type UnauthenticatedOptions = {
1636
+ baseUrl?: string;
1637
+ fetch?: typeof fetch;
1638
+ };
1639
+ type FetchClient = Client<paths, `${string}/${string}`>;
1640
+
1641
+ type Schemas = components['schemas'];
1642
+ type Chain = Schemas['Chain'];
1643
+ type RequestType = Schemas['RequestType'];
1644
+ type RequestStatus = Schemas['RequestStatus'];
1645
+ type RegisterRequest = Schemas['RegisterRequest'];
1646
+ type RegisterResponse = Schemas['RegisterResponse'];
1647
+ type AddressResponse = Schemas['AddressResponse'];
1648
+ type BalanceResponse = Schemas['BalanceResponse'];
1649
+ type TokensResponse = Schemas['TokensResponse'];
1650
+ type CallRequest = Schemas['CallRequest'];
1651
+ type CallResponse = Schemas['CallResponse'];
1652
+ type TransferRequest = Schemas['TransferRequest'];
1653
+ type IntentsDepositRequest = Schemas['IntentsDepositRequest'];
1654
+ type IntentsDepositResponse = Schemas['IntentsDepositResponse'];
1655
+ type WithdrawRequest = Schemas['WithdrawRequest'];
1656
+ type WithdrawResponse = Schemas['WithdrawResponse'];
1657
+ type DryRunResponse = Schemas['DryRunResponse'];
1658
+ type SwapRequest = Schemas['SwapRequest'];
1659
+ type SwapResponse = Schemas['SwapResponse'];
1660
+ type SwapQuoteResponse = Schemas['SwapQuoteResponse'];
1661
+ type SignMessageRequest = Schemas['SignMessageRequest'];
1662
+ type SignMessageResponse = Schemas['SignMessageResponse'];
1663
+ type RequestStatusResponse = Schemas['RequestStatusResponse'];
1664
+ type RequestListResponse = Schemas['RequestListResponse'];
1665
+ type PolicyResponse = Schemas['PolicyResponse'];
1666
+ type PolicyRules = Schemas['PolicyRules'];
1667
+ type ApprovalConfig = Schemas['ApprovalConfig'];
1668
+ type EncryptPolicyRequest = Schemas['EncryptPolicyRequest'];
1669
+ type EncryptPolicyResponse = Schemas['EncryptPolicyResponse'];
1670
+ type SignPolicyResponse = Schemas['SignPolicyResponse'];
1671
+ type PendingApproval = Schemas['PendingApproval'];
1672
+ type PendingApprovalsResponse = Schemas['PendingApprovalsResponse'];
1673
+ type Nep413Auth = Schemas['Nep413Auth'];
1674
+ type ApproveResponse = Schemas['ApproveResponse'];
1675
+ type AuditEvent = Schemas['AuditEvent'];
1676
+ type AuditResponse = Schemas['AuditResponse'];
1677
+ type Idempotent = {
1678
+ idempotencyKey?: string;
1679
+ };
1680
+ declare class PolicyAPI {
1681
+ private readonly client;
1682
+ private readonly retry;
1683
+ constructor(client: FetchClient, retry: Required<RetryConfig>);
1684
+ get(): Promise<PolicyResponse>;
1685
+ encrypt(body: EncryptPolicyRequest): Promise<EncryptPolicyResponse>;
1686
+ sign(encryptedData: string): Promise<SignPolicyResponse>;
1687
+ invalidateCache(walletId: string): Promise<void>;
1688
+ }
1689
+ declare class ApprovalsAPI {
1690
+ private readonly client;
1691
+ private readonly retry;
1692
+ constructor(client: FetchClient, retry: Required<RetryConfig>);
1693
+ listPending(): Promise<PendingApprovalsResponse>;
1694
+ approve(approvalId: string, auth: Nep413Auth): Promise<ApproveResponse>;
1695
+ reject(approvalId: string, auth: Nep413Auth, reason?: string): Promise<ApproveResponse>;
1696
+ }
1697
+ declare class AuditAPI {
1698
+ private readonly client;
1699
+ private readonly retry;
1700
+ constructor(client: FetchClient, retry: Required<RetryConfig>);
1701
+ list(opts?: {
1702
+ limit?: number;
1703
+ offset?: number;
1704
+ }): Promise<AuditResponse>;
1705
+ }
1706
+ declare class OutlayerClient {
1707
+ private readonly client;
1708
+ private readonly retry;
1709
+ readonly policy: PolicyAPI;
1710
+ readonly approvals: ApprovalsAPI;
1711
+ readonly audit: AuditAPI;
1712
+ constructor(opts: ClientOptions);
1713
+ /**
1714
+ * Register a new wallet and obtain an API key.
1715
+ *
1716
+ * - Empty call: anonymous wallet on OutLayer's shared master. Convenient, no setup.
1717
+ * - With `vaultId`: bind to a deployed customer vault so keys derive through
1718
+ * the per-vault master. Vault binding is permanent.
1719
+ * - With `body`: full control — pass any `RegisterRequest` field (e.g., NEP-413
1720
+ * account-binding fields). `vaultId` is merged into `body.vault_id` if not
1721
+ * already set.
1722
+ *
1723
+ * Vault deployment is NOT done here — use the dashboard
1724
+ * (https://outlayer.fastnear.com/vault) or `outlayer vault init` CLI.
1725
+ * See docs/vaults.md for the full flow.
1726
+ */
1727
+ static register(opts?: {
1728
+ vaultId?: string;
1729
+ body?: RegisterRequest;
1730
+ } & UnauthenticatedOptions): Promise<RegisterResponse>;
1731
+ getAddress(chain: Chain): Promise<AddressResponse>;
1732
+ getBalance(opts?: {
1733
+ chain?: Chain;
1734
+ token?: string;
1735
+ source?: 'chain' | 'intents';
1736
+ }): Promise<BalanceResponse>;
1737
+ listTokens(): Promise<TokensResponse>;
1738
+ call(opts: CallRequest & Idempotent): Promise<CallResponse>;
1739
+ transfer(opts: TransferRequest & Idempotent): Promise<CallResponse>;
1740
+ intentsDeposit(opts: IntentsDepositRequest & Idempotent): Promise<IntentsDepositResponse>;
1741
+ withdraw(opts: WithdrawRequest & Idempotent): Promise<WithdrawResponse>;
1742
+ withdrawDryRun(opts: WithdrawRequest): Promise<DryRunResponse>;
1743
+ swap(opts: SwapRequest & Idempotent): Promise<SwapResponse>;
1744
+ swapQuote(opts: SwapRequest): Promise<SwapQuoteResponse>;
1745
+ signMessage(opts: SignMessageRequest): Promise<SignMessageResponse>;
1746
+ getRequest(id: string): Promise<RequestStatusResponse>;
1747
+ listRequests(opts?: {
1748
+ type?: RequestType;
1749
+ status?: RequestStatus;
1750
+ limit?: number;
1751
+ offset?: number;
1752
+ }): Promise<RequestListResponse>;
1753
+ }
1754
+
1755
+ type ApiErrorCode = components['schemas']['ErrorCode'];
1756
+ type ErrorCode = ApiErrorCode | 'network_error' | 'parse_error';
1757
+ interface OutlayerErrorOptions {
1758
+ code: ErrorCode;
1759
+ message: string;
1760
+ status: number;
1761
+ details?: unknown;
1762
+ }
1763
+ declare class OutlayerError extends Error {
1764
+ readonly code: ErrorCode;
1765
+ readonly status: number;
1766
+ readonly details: unknown;
1767
+ constructor(opts: OutlayerErrorOptions);
1768
+ }
1769
+ declare class PolicyDeniedError extends OutlayerError {
1770
+ constructor(opts: OutlayerErrorOptions);
1771
+ }
1772
+ declare class WalletFrozenError extends OutlayerError {
1773
+ constructor(opts: OutlayerErrorOptions);
1774
+ }
1775
+ declare class UnauthorizedError extends OutlayerError {
1776
+ constructor(opts: OutlayerErrorOptions);
1777
+ }
1778
+ declare class RateLimitedError extends OutlayerError {
1779
+ constructor(opts: OutlayerErrorOptions);
1780
+ }
1781
+ declare class NotFoundError extends OutlayerError {
1782
+ constructor(opts: OutlayerErrorOptions);
1783
+ }
1784
+ declare class BadRequestError extends OutlayerError {
1785
+ constructor(opts: OutlayerErrorOptions);
1786
+ }
1787
+
1788
+ export { type AddressResponse, type ApiErrorCode, type ApprovalConfig, ApprovalsAPI, type ApproveResponse, AuditAPI, type AuditEvent, type AuditResponse, BadRequestError, type BalanceResponse, type CallRequest, type CallResponse, type Chain, type ClientOptions, type DryRunResponse, type EncryptPolicyRequest, type EncryptPolicyResponse, type ErrorCode, type IntentsDepositRequest, type IntentsDepositResponse, type Nep413Auth, NotFoundError, OutlayerClient, OutlayerError, type PendingApproval, type PendingApprovalsResponse, PolicyAPI, PolicyDeniedError, type PolicyResponse, type PolicyRules, RateLimitedError, type RegisterRequest, type RegisterResponse, type RequestListResponse, type RequestStatus, type RequestStatusResponse, type RequestType, type RetryConfig, type SignMessageRequest, type SignMessageResponse, type SignPolicyResponse, type SwapQuoteResponse, type SwapRequest, type SwapResponse, type TokensResponse, type TransferRequest, type UnauthenticatedOptions, UnauthorizedError, WalletFrozenError, type WithdrawRequest, type WithdrawResponse };