@elisym/sdk 0.8.0 → 0.9.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/README.md +31 -10
- package/dist/agent-store.cjs +1 -2
- package/dist/agent-store.cjs.map +1 -1
- package/dist/agent-store.d.cts +14 -16
- package/dist/agent-store.d.ts +14 -16
- package/dist/agent-store.js +1 -2
- package/dist/agent-store.js.map +1 -1
- package/dist/assets-CMf-v55Z.d.cts +58 -0
- package/dist/assets-CMf-v55Z.d.ts +58 -0
- package/dist/global-schema-CddHP2nk.d.cts +62 -0
- package/dist/global-schema-CddHP2nk.d.ts +62 -0
- package/dist/index.cjs +394 -137
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +151 -118
- package/dist/index.d.ts +151 -118
- package/dist/index.js +391 -135
- package/dist/index.js.map +1 -1
- package/dist/node.cjs +60 -0
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +21 -1
- package/dist/node.d.ts +21 -1
- package/dist/node.js +55 -1
- package/dist/node.js.map +1 -1
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.d.cts +14 -0
- package/dist/runtime.d.ts +14 -0
- package/dist/runtime.js.map +1 -1
- package/dist/skills.cjs +123 -10
- package/dist/skills.cjs.map +1 -1
- package/dist/skills.d.cts +17 -4
- package/dist/skills.d.ts +17 -4
- package/dist/skills.js +123 -10
- package/dist/skills.js.map +1 -1
- package/package.json +3 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Address, TransactionSigner, Rpc, SolanaRpcApi } from '@solana/kit';
|
|
2
2
|
import { Filter, Event } from 'nostr-tools';
|
|
3
|
+
import { A as Asset } from './assets-CMf-v55Z.cjs';
|
|
4
|
+
export { C as Chain, K as KNOWN_ASSETS, N as NATIVE_SOL, U as USDC_SOLANA_DEVNET, a as assetByKey, b as assetKey, f as formatAssetAmount, p as parseAssetAmount, r as resolveAssetFromPaymentRequest, c as resolveKnownAsset } from './assets-CMf-v55Z.cjs';
|
|
3
5
|
import { z } from 'zod';
|
|
6
|
+
export { G as GlobalConfig, a as GlobalConfigSchema, S as SessionSpendLimitEntry, b as SessionSpendLimitEntrySchema } from './global-schema-CddHP2nk.cjs';
|
|
4
7
|
|
|
5
8
|
declare class ElisymIdentity {
|
|
6
9
|
private _secretKey;
|
|
@@ -36,8 +39,21 @@ interface PaymentInfo {
|
|
|
36
39
|
chain: string;
|
|
37
40
|
network: string;
|
|
38
41
|
address: string;
|
|
39
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Price in subunits of the payment asset (non-negative integer).
|
|
44
|
+
*
|
|
45
|
+
* Subunit = smallest indivisible unit: 1 lamport for SOL, 1 "cent" (1e-6 USDC)
|
|
46
|
+
* for USDC. When `token` is omitted, subunits are lamports (back-compat).
|
|
47
|
+
*/
|
|
40
48
|
job_price?: number;
|
|
49
|
+
/** Lowercase token id (e.g. 'sol', 'usdc'). Absent => native SOL. */
|
|
50
|
+
token?: string;
|
|
51
|
+
/** SPL mint / ERC-20 contract. Undefined for native coin. */
|
|
52
|
+
mint?: string;
|
|
53
|
+
/** Subunits per whole (9 for SOL, 6 for USDC). */
|
|
54
|
+
decimals?: number;
|
|
55
|
+
/** Display symbol (e.g. 'SOL', 'USDC'). */
|
|
56
|
+
symbol?: string;
|
|
41
57
|
}
|
|
42
58
|
/** Agent discovered from the network. */
|
|
43
59
|
interface Agent {
|
|
@@ -102,9 +118,26 @@ interface PingResult {
|
|
|
102
118
|
/** The identity used for the ping session - reuse for job submission so pubkeys match. */
|
|
103
119
|
identity: ElisymIdentity | null;
|
|
104
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Wire-shape reference to an asset inside a payment request.
|
|
123
|
+
*
|
|
124
|
+
* Same shape as `Asset` minus the display-only `symbol` field. Absent = native
|
|
125
|
+
* SOL (back-compat for payment requests published before multi-asset support).
|
|
126
|
+
*/
|
|
127
|
+
interface PaymentAssetRef {
|
|
128
|
+
chain: string;
|
|
129
|
+
token: string;
|
|
130
|
+
mint?: string;
|
|
131
|
+
decimals: number;
|
|
132
|
+
}
|
|
105
133
|
interface PaymentRequestData {
|
|
106
134
|
recipient: string;
|
|
107
|
-
/**
|
|
135
|
+
/**
|
|
136
|
+
* Total amount in subunits of the payment asset (must be positive integer).
|
|
137
|
+
*
|
|
138
|
+
* - For native SOL (asset absent / `token: 'sol'`): lamports (1e-9 SOL).
|
|
139
|
+
* - For SPL USDC: 1e-6 USDC.
|
|
140
|
+
*/
|
|
108
141
|
amount: number;
|
|
109
142
|
reference: string;
|
|
110
143
|
description?: string;
|
|
@@ -114,6 +147,8 @@ interface PaymentRequestData {
|
|
|
114
147
|
created_at: number;
|
|
115
148
|
/** Expiry duration in seconds. */
|
|
116
149
|
expiry_secs: number;
|
|
150
|
+
/** Optional asset identifier. Absent => native SOL (back-compat). */
|
|
151
|
+
asset?: PaymentAssetRef;
|
|
117
152
|
}
|
|
118
153
|
interface VerifyResult {
|
|
119
154
|
verified: boolean;
|
|
@@ -125,7 +160,7 @@ interface VerifyOptions {
|
|
|
125
160
|
intervalMs?: number;
|
|
126
161
|
txSignature?: string;
|
|
127
162
|
}
|
|
128
|
-
type PaymentValidationCode = 'invalid_json' | 'invalid_amount' | 'missing_recipient' | 'invalid_recipient_address' | 'missing_reference' | 'invalid_reference_address' | 'recipient_mismatch' | 'expired' | 'future_timestamp' | 'fee_address_mismatch' | 'fee_amount_mismatch' | 'missing_fee' | 'invalid_fee_params';
|
|
163
|
+
type PaymentValidationCode = 'invalid_json' | 'invalid_amount' | 'missing_recipient' | 'invalid_recipient_address' | 'missing_reference' | 'invalid_reference_address' | 'recipient_mismatch' | 'expired' | 'future_timestamp' | 'fee_address_mismatch' | 'fee_amount_mismatch' | 'missing_fee' | 'invalid_fee_params' | 'invalid_asset';
|
|
129
164
|
interface PaymentValidationError {
|
|
130
165
|
code: PaymentValidationCode;
|
|
131
166
|
message: string;
|
|
@@ -472,6 +507,7 @@ declare class SolanaPaymentStrategy implements PaymentStrategy {
|
|
|
472
507
|
calculateFee(amount: number, config: ProtocolConfigInput): number;
|
|
473
508
|
createPaymentRequest(recipientAddress: string, amount: number, config: ProtocolConfigInput, options?: {
|
|
474
509
|
expirySecs?: number;
|
|
510
|
+
asset?: Asset;
|
|
475
511
|
}): PaymentRequestData;
|
|
476
512
|
validatePaymentRequest(requestJson: string, config: ProtocolConfigInput, expectedRecipient?: string, options?: {
|
|
477
513
|
maxAmountLamports?: bigint;
|
|
@@ -490,16 +526,26 @@ declare class SolanaPaymentStrategy implements PaymentStrategy {
|
|
|
490
526
|
private _verifyByReference;
|
|
491
527
|
}
|
|
492
528
|
/**
|
|
493
|
-
* Build the
|
|
529
|
+
* Build the transfer instructions for a payment request.
|
|
494
530
|
*
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
*
|
|
531
|
+
* For native SOL (no `paymentRequest.asset` or asset=NATIVE_SOL), emits System
|
|
532
|
+
* program `TransferSol` instructions with the payment reference attached as a
|
|
533
|
+
* read-only, non-signer account so providers can detect the payment via
|
|
534
|
+
* `getSignaturesForAddress(reference)`.
|
|
535
|
+
*
|
|
536
|
+
* For SPL assets (USDC on Solana), emits:
|
|
537
|
+
* 1. `CreateAssociatedTokenIdempotent` for the recipient ATA (funded by payer);
|
|
538
|
+
* 2. `CreateAssociatedTokenIdempotent` for the treasury ATA if a protocol fee applies;
|
|
539
|
+
* 3. `TransferChecked` from payer ATA to recipient ATA, with `reference` as an
|
|
540
|
+
* extra read-only account (canonical Solana Pay pattern);
|
|
541
|
+
* 4. `TransferChecked` from payer ATA to treasury ATA if a fee applies.
|
|
542
|
+
*
|
|
543
|
+
* Async because SPL ATAs are PDAs and `findAssociatedTokenPda` is async.
|
|
498
544
|
*
|
|
499
545
|
* Caller is responsible for validating `paymentRequest` upstream;
|
|
500
546
|
* `buildTransaction` already does that before invoking this helper.
|
|
501
547
|
*/
|
|
502
|
-
declare function buildPaymentInstructions(paymentRequest: PaymentRequestData, payerSigner: Signer): readonly unknown[]
|
|
548
|
+
declare function buildPaymentInstructions(paymentRequest: PaymentRequestData, payerSigner: Signer): Promise<readonly unknown[]>;
|
|
503
549
|
/**
|
|
504
550
|
* Convenience wrapper: fetch the on-chain protocol config first, then build a
|
|
505
551
|
* payment request using its current fee/treasury values.
|
|
@@ -565,6 +611,74 @@ interface RecentPrioritizationFeeLike {
|
|
|
565
611
|
}
|
|
566
612
|
declare function pickPercentileFee(samples: readonly RecentPrioritizationFeeLike[], percentile: number): bigint;
|
|
567
613
|
|
|
614
|
+
/**
|
|
615
|
+
* SOL-denominated fee estimator for payment requests.
|
|
616
|
+
*
|
|
617
|
+
* For a USDC payment the user still spends SOL to cover the base signature fee,
|
|
618
|
+
* the priority fee, and (for first-time recipients) the ATA rent-exemption
|
|
619
|
+
* deposit. Before calling `send_payment` the customer wants to know whether
|
|
620
|
+
* their SOL balance is sufficient - that's what this helper answers.
|
|
621
|
+
*
|
|
622
|
+
* Browser-safe: no Node-specific imports. The web dashboard will use the same
|
|
623
|
+
* function.
|
|
624
|
+
*/
|
|
625
|
+
|
|
626
|
+
interface SolFeeEstimate {
|
|
627
|
+
/** Base per-signature fee. Currently 5000 lamports * 1 signature. */
|
|
628
|
+
baseFeeLamports: bigint;
|
|
629
|
+
/**
|
|
630
|
+
* Priority fee in lamports: `ceil(priorityFeeMicroLamports * computeUnitLimit
|
|
631
|
+
* / 1_000_000)`. Rounded up so we don't underestimate.
|
|
632
|
+
*/
|
|
633
|
+
priorityFeeLamports: bigint;
|
|
634
|
+
/**
|
|
635
|
+
* Rent-exemption deposit for ATAs that the tx creates.
|
|
636
|
+
*
|
|
637
|
+
* 0 for native SOL. For SPL, `rentPerAta * (# of missing ATAs)`: recipient
|
|
638
|
+
* ATA is missing iff the recipient has never received this token; treasury
|
|
639
|
+
* ATA is missing only on the first-ever protocol fee into this mint.
|
|
640
|
+
*/
|
|
641
|
+
rentLamports: bigint;
|
|
642
|
+
/** `baseFeeLamports + priorityFeeLamports + rentLamports`. */
|
|
643
|
+
totalLamports: bigint;
|
|
644
|
+
breakdown: {
|
|
645
|
+
numSignatures: number;
|
|
646
|
+
priorityFeeMicroLamports: bigint;
|
|
647
|
+
computeUnitLimit: number;
|
|
648
|
+
rentPerAtaLamports: bigint;
|
|
649
|
+
missingAtaCount: number;
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
interface EstimateSolFeeOptions {
|
|
653
|
+
/** Override the compute-unit limit used by `buildTransaction`. */
|
|
654
|
+
computeUnitLimit?: number;
|
|
655
|
+
/** Override the priority fee directly (skips RPC). */
|
|
656
|
+
priorityFeeMicroLamports?: bigint;
|
|
657
|
+
/**
|
|
658
|
+
* Percentile of the recent priority-fee distribution to charge when
|
|
659
|
+
* `priorityFeeMicroLamports` is not supplied. Defaults to 75.
|
|
660
|
+
*/
|
|
661
|
+
priorityFeePercentile?: number;
|
|
662
|
+
/** Override the number of signatures. Defaults to 1. */
|
|
663
|
+
numSignatures?: number;
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* Estimate the SOL cost (in lamports) to submit the transaction that would pay
|
|
667
|
+
* this payment request from `payerAddress`.
|
|
668
|
+
*
|
|
669
|
+
* Returns a breakdown and a total. Does not submit anything on-chain.
|
|
670
|
+
*/
|
|
671
|
+
declare function estimateSolFeeLamports(rpc: Rpc<SolanaRpcApi>, paymentRequest: PaymentRequestData, _payerAddress: string, options?: EstimateSolFeeOptions): Promise<SolFeeEstimate>;
|
|
672
|
+
/**
|
|
673
|
+
* Multi-line human-readable breakdown. Used by the MCP `estimate_payment_cost`
|
|
674
|
+
* tool and (in a future PR) by the web dashboard's pre-payment panel.
|
|
675
|
+
*
|
|
676
|
+
* We render lamports as raw integers and also show a SOL decimal with 9 places.
|
|
677
|
+
* The `@elisym/sdk` `formatAssetAmount` helper lives in assets.ts, but the
|
|
678
|
+
* formatter does not need to be identical; this stays dependency-free.
|
|
679
|
+
*/
|
|
680
|
+
declare function formatFeeBreakdown(estimate: SolFeeEstimate): string;
|
|
681
|
+
|
|
568
682
|
/**
|
|
569
683
|
* Wire-shape for a NIP-90 payment_request blob, as parsed via JSON.parse.
|
|
570
684
|
*
|
|
@@ -582,6 +696,22 @@ declare const PaymentRequestSchema: z.ZodObject<{
|
|
|
582
696
|
fee_amount: z.ZodOptional<z.ZodNumber>;
|
|
583
697
|
created_at: z.ZodNumber;
|
|
584
698
|
expiry_secs: z.ZodNumber;
|
|
699
|
+
asset: z.ZodOptional<z.ZodObject<{
|
|
700
|
+
chain: z.ZodString;
|
|
701
|
+
token: z.ZodString;
|
|
702
|
+
mint: z.ZodOptional<z.ZodString>;
|
|
703
|
+
decimals: z.ZodNumber;
|
|
704
|
+
}, "strip", z.ZodTypeAny, {
|
|
705
|
+
chain: string;
|
|
706
|
+
token: string;
|
|
707
|
+
decimals: number;
|
|
708
|
+
mint?: string | undefined;
|
|
709
|
+
}, {
|
|
710
|
+
chain: string;
|
|
711
|
+
token: string;
|
|
712
|
+
decimals: number;
|
|
713
|
+
mint?: string | undefined;
|
|
714
|
+
}>>;
|
|
585
715
|
}, "strip", z.ZodTypeAny, {
|
|
586
716
|
recipient: string;
|
|
587
717
|
amount: number;
|
|
@@ -591,6 +721,12 @@ declare const PaymentRequestSchema: z.ZodObject<{
|
|
|
591
721
|
description?: string | undefined;
|
|
592
722
|
fee_address?: string | undefined;
|
|
593
723
|
fee_amount?: number | undefined;
|
|
724
|
+
asset?: {
|
|
725
|
+
chain: string;
|
|
726
|
+
token: string;
|
|
727
|
+
decimals: number;
|
|
728
|
+
mint?: string | undefined;
|
|
729
|
+
} | undefined;
|
|
594
730
|
}, {
|
|
595
731
|
recipient: string;
|
|
596
732
|
amount: number;
|
|
@@ -600,6 +736,12 @@ declare const PaymentRequestSchema: z.ZodObject<{
|
|
|
600
736
|
description?: string | undefined;
|
|
601
737
|
fee_address?: string | undefined;
|
|
602
738
|
fee_amount?: number | undefined;
|
|
739
|
+
asset?: {
|
|
740
|
+
chain: string;
|
|
741
|
+
token: string;
|
|
742
|
+
decimals: number;
|
|
743
|
+
mint?: string | undefined;
|
|
744
|
+
} | undefined;
|
|
603
745
|
}>;
|
|
604
746
|
type ParsedPaymentRequest = z.infer<typeof PaymentRequestSchema>;
|
|
605
747
|
interface ParseOptions {
|
|
@@ -624,48 +766,6 @@ type ParseResult = {
|
|
|
624
766
|
*/
|
|
625
767
|
declare function parsePaymentRequest(input: string, options?: ParseOptions): ParseResult;
|
|
626
768
|
|
|
627
|
-
/**
|
|
628
|
-
* Multi-asset / multi-chain payment model.
|
|
629
|
-
*
|
|
630
|
-
* `Asset` describes a currency a customer can spend: native coins (SOL, ETH, BTC)
|
|
631
|
-
* or tokens (SPL, ERC-20). `assetKey` produces a stable string id for Map lookups.
|
|
632
|
-
*
|
|
633
|
-
* Today only `NATIVE_SOL` is in `KNOWN_ASSETS`. SPL (USDC) and other chains are
|
|
634
|
-
* extended by adding entries to `KNOWN_ASSETS` and, where relevant, to the
|
|
635
|
-
* MCP `DEFAULT_SESSION_LIMITS` catalogue.
|
|
636
|
-
*/
|
|
637
|
-
type Chain = 'solana';
|
|
638
|
-
interface Asset {
|
|
639
|
-
chain: Chain;
|
|
640
|
-
/** Lowercase token id: 'sol', 'usdc', 'btc', 'eth'. */
|
|
641
|
-
token: string;
|
|
642
|
-
/** SPL mint / ERC-20 contract. Undefined for a native coin. */
|
|
643
|
-
mint?: string;
|
|
644
|
-
/** Subunits per whole (9 SOL, 6 USDC, 8 BTC, 18 ETH). */
|
|
645
|
-
decimals: number;
|
|
646
|
-
/** Display symbol: 'SOL', 'USDC'. */
|
|
647
|
-
symbol: string;
|
|
648
|
-
}
|
|
649
|
-
declare const NATIVE_SOL: Asset;
|
|
650
|
-
declare const KNOWN_ASSETS: readonly Asset[];
|
|
651
|
-
/** Stable Map key for `Asset`. Same shape regardless of Asset identity. */
|
|
652
|
-
declare function assetKey(a: Pick<Asset, 'chain' | 'token' | 'mint'>): string;
|
|
653
|
-
/** Find a known asset by (chain, token, mint). Returns undefined if unknown. */
|
|
654
|
-
declare function resolveKnownAsset(chain: string, token: string, mint?: string): Asset | undefined;
|
|
655
|
-
/** Reverse lookup: given an assetKey string, return the known asset or undefined. */
|
|
656
|
-
declare function assetByKey(key: string): Asset | undefined;
|
|
657
|
-
/**
|
|
658
|
-
* Parse a human amount string ("0.5", "1", "0.000001") into raw subunits (BigInt).
|
|
659
|
-
* Uses integer math to avoid float precision issues.
|
|
660
|
-
*
|
|
661
|
-
* Throws on: empty, negative, zero, malformed, too many fractional digits, or
|
|
662
|
-
* a value exceeding `Number.MAX_SAFE_INTEGER` (to keep downstream `Number(...)`
|
|
663
|
-
* call-sites safe).
|
|
664
|
-
*/
|
|
665
|
-
declare function parseAssetAmount(asset: Asset, human: string): bigint;
|
|
666
|
-
/** Format raw subunits back to `"<whole>.<frac> <SYMBOL>"`. Keeps all `decimals` digits. */
|
|
667
|
-
declare function formatAssetAmount(asset: Asset, raw: bigint): string;
|
|
668
|
-
|
|
669
769
|
/**
|
|
670
770
|
* Snapshot of the on-chain elisym-config program state.
|
|
671
771
|
*
|
|
@@ -700,73 +800,6 @@ interface GetProtocolConfigOptions {
|
|
|
700
800
|
*/
|
|
701
801
|
declare function getProtocolConfig(rpc: Rpc<SolanaRpcApi>, programId: Address, options?: GetProtocolConfigOptions): Promise<ProtocolConfig>;
|
|
702
802
|
|
|
703
|
-
/**
|
|
704
|
-
* Global (not per-agent) config stored at `~/.elisym/config.yaml`.
|
|
705
|
-
*
|
|
706
|
-
* Currently holds only session-spend-limit overrides; other top-level fields
|
|
707
|
-
* may be added later. The loader tolerates a missing file (returns `{}`), but
|
|
708
|
-
* fails fast on malformed YAML or schema violations.
|
|
709
|
-
*/
|
|
710
|
-
|
|
711
|
-
declare const SessionSpendLimitEntrySchema: z.ZodObject<{
|
|
712
|
-
chain: z.ZodEnum<["solana"]>;
|
|
713
|
-
token: z.ZodString;
|
|
714
|
-
mint: z.ZodOptional<z.ZodString>;
|
|
715
|
-
amount: z.ZodNumber;
|
|
716
|
-
}, "strict", z.ZodTypeAny, {
|
|
717
|
-
amount: number;
|
|
718
|
-
chain: "solana";
|
|
719
|
-
token: string;
|
|
720
|
-
mint?: string | undefined;
|
|
721
|
-
}, {
|
|
722
|
-
amount: number;
|
|
723
|
-
chain: "solana";
|
|
724
|
-
token: string;
|
|
725
|
-
mint?: string | undefined;
|
|
726
|
-
}>;
|
|
727
|
-
declare const GlobalConfigSchema: z.ZodObject<{
|
|
728
|
-
session_spend_limits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
729
|
-
chain: z.ZodEnum<["solana"]>;
|
|
730
|
-
token: z.ZodString;
|
|
731
|
-
mint: z.ZodOptional<z.ZodString>;
|
|
732
|
-
amount: z.ZodNumber;
|
|
733
|
-
}, "strict", z.ZodTypeAny, {
|
|
734
|
-
amount: number;
|
|
735
|
-
chain: "solana";
|
|
736
|
-
token: string;
|
|
737
|
-
mint?: string | undefined;
|
|
738
|
-
}, {
|
|
739
|
-
amount: number;
|
|
740
|
-
chain: "solana";
|
|
741
|
-
token: string;
|
|
742
|
-
mint?: string | undefined;
|
|
743
|
-
}>, "many">>;
|
|
744
|
-
}, "strict", z.ZodTypeAny, {
|
|
745
|
-
session_spend_limits?: {
|
|
746
|
-
amount: number;
|
|
747
|
-
chain: "solana";
|
|
748
|
-
token: string;
|
|
749
|
-
mint?: string | undefined;
|
|
750
|
-
}[] | undefined;
|
|
751
|
-
}, {
|
|
752
|
-
session_spend_limits?: {
|
|
753
|
-
amount: number;
|
|
754
|
-
chain: "solana";
|
|
755
|
-
token: string;
|
|
756
|
-
mint?: string | undefined;
|
|
757
|
-
}[] | undefined;
|
|
758
|
-
}>;
|
|
759
|
-
type SessionSpendLimitEntry = z.infer<typeof SessionSpendLimitEntrySchema>;
|
|
760
|
-
type GlobalConfig = z.infer<typeof GlobalConfigSchema>;
|
|
761
|
-
/**
|
|
762
|
-
* Read and validate `~/.elisym/config.yaml`. Returns `{}` if missing. Throws
|
|
763
|
-
* on malformed YAML or schema violations — the MCP server treats these as fatal
|
|
764
|
-
* at startup rather than silently ignoring bad overrides.
|
|
765
|
-
*/
|
|
766
|
-
declare function loadGlobalConfig(path: string): Promise<GlobalConfig>;
|
|
767
|
-
/** Write the config YAML atomically. Validates via Zod before writing. */
|
|
768
|
-
declare function writeGlobalConfig(path: string, config: GlobalConfig): Promise<void>;
|
|
769
|
-
|
|
770
803
|
/** Encrypt plaintext using NIP-44 v2 (sender secret key + recipient public key). */
|
|
771
804
|
declare function nip44Encrypt(plaintext: string, senderSk: Uint8Array, recipientPubkey: string): string;
|
|
772
805
|
/** Decrypt ciphertext using NIP-44 v2 (receiver secret key + sender public key). */
|
|
@@ -945,4 +978,4 @@ declare const LIMITS: {
|
|
|
945
978
|
readonly MAX_CAPABILITY_LENGTH: 64;
|
|
946
979
|
};
|
|
947
980
|
|
|
948
|
-
export { type Agent,
|
|
981
|
+
export { type Agent, Asset, BoundedSet, type BuildTransactionOptions, type CapabilityCard, DEFAULTS, DEFAULT_KIND_OFFSET, DEFAULT_REDACT_PATHS, DiscoveryService, ElisymClient, type ElisymClientConfig, type ElisymClientFullConfig, ElisymIdentity, type EstimatePriorityFeeOptions, type EstimateSolFeeOptions, type GetProtocolConfigOptions, INPUT_REDACT_PATHS, type Job, type JobStatus, type JobSubscriptionOptions, type JobUpdateCallbacks, KIND_APP_HANDLER, KIND_JOB_FEEDBACK, KIND_JOB_REQUEST, KIND_JOB_REQUEST_BASE, KIND_JOB_RESULT, KIND_JOB_RESULT_BASE, KIND_PING, KIND_PONG, LAMPORTS_PER_SOL, LIMITS, MarketplaceService, MediaService, type Network, type NetworkStats, NostrPool, PROTOCOL_FEE_BPS, PROTOCOL_PROGRAM_ID_DEVNET, PROTOCOL_TREASURY, type ParseOptions, type ParseResult, type ParsedPaymentRequest, type PaymentAssetRef, type PaymentInfo, type PaymentRequestData, PaymentRequestSchema, type PaymentStrategy, type PaymentValidationCode, type PaymentValidationError, type PingResult, PingService, type ProtocolCluster, type ProtocolConfig, type ProtocolConfigInput, RELAYS, type RateLimitDecision, SECRET_REDACT_PATHS, type Signer, type SlidingWindowLimiter, type SlidingWindowLimiterOptions, type SolFeeEstimate, SolanaPaymentStrategy, type SubCloser, type SubmitJobOptions, type VerifyOptions, type VerifyResult, assertExpiry, assertLamports, buildPaymentInstructions, calculateProtocolFee, clearPriorityFeeCache, clearProtocolConfigCache, createPaymentRequestWithOnchainConfig, createSlidingWindowLimiter, estimatePriorityFeeMicroLamports, estimateSolFeeLamports, formatFeeBreakdown, formatSol, getProtocolConfig, getProtocolProgramId, jobRequestKind, jobResultKind, makeCensor, nip44Decrypt, nip44Encrypt, parsePaymentRequest, pickPercentileFee, timeAgo, toDTag, truncateKey, validateAgentName, validateExpiry };
|