@toon-protocol/client 0.14.12 → 0.16.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/dist/index.d.ts CHANGED
@@ -15,6 +15,108 @@ interface WalletBalance {
15
15
  /** Token decimals, when resolved. */
16
16
  assetScale?: number;
17
17
  }
18
+ /**
19
+ * One asset amount within a chain's wallet view — the native coin or one token.
20
+ * `amount` is a base-unit integer, decimal string.
21
+ */
22
+ interface WalletTokenAmount {
23
+ /** Asset symbol (e.g. `'ETH'`, `'SOL'`, `'MINA'`, `'USDC'`), when known. */
24
+ symbol?: string;
25
+ /** Base-unit integer, decimal string. */
26
+ amount: string;
27
+ /** Decimals for formatting (ETH 18, SOL 9, MINA 9, USDC 6). */
28
+ decimals?: number;
29
+ /** Token contract / SPL mint address. Absent for the native coin. */
30
+ address?: string;
31
+ }
32
+ /**
33
+ * The full wallet view for ONE chain the identity is configured for: the native
34
+ * coin plus every configured token, keyed by the chain's full key (e.g.
35
+ * `'evm:31337'`). `unreadable` marks a chain whose RPC could not be reached at
36
+ * all — the caller renders a per-chain notice rather than crashing.
37
+ */
38
+ interface WalletChainBalances {
39
+ chain: 'evm' | 'solana' | 'mina';
40
+ /** Full chain key, e.g. `'evm:31337'`, `'solana'`, `'mina'`. */
41
+ chainKey: string;
42
+ address: string;
43
+ /** Native-coin balance, when readable. */
44
+ native?: WalletTokenAmount;
45
+ /** Configured token balances (e.g. USDC), each best-effort. */
46
+ tokens: WalletTokenAmount[];
47
+ /** True when nothing on this chain could be read (RPC unreachable). */
48
+ unreadable?: boolean;
49
+ /** First read error, when any read failed (for diagnostics). */
50
+ error?: string;
51
+ }
52
+ /** Read an ERC-20 token balance (balance + decimals + symbol) for `owner`. */
53
+ declare function readEvmTokenBalance(opts: {
54
+ rpcUrl: string;
55
+ chainKey: string;
56
+ tokenAddress: string;
57
+ owner: string;
58
+ }): Promise<WalletBalance>;
59
+ /** Read the native ETH balance (wei) for `owner` via `eth_getBalance`. */
60
+ declare function readEvmNativeBalance(opts: {
61
+ rpcUrl: string;
62
+ chainKey: string;
63
+ owner: string;
64
+ }): Promise<WalletTokenAmount>;
65
+ /** Read the native SOL balance (lamports) for `owner` via the `getBalance` RPC. */
66
+ declare function readSolanaNativeBalance(opts: {
67
+ rpcUrl: string;
68
+ owner: string;
69
+ fetchImpl?: typeof fetch;
70
+ }): Promise<WalletTokenAmount>;
71
+ /** Read the SPL-token balance for `owner`'s token account(s) of `mint`. */
72
+ declare function readSolanaTokenBalance(opts: {
73
+ rpcUrl: string;
74
+ mint: string;
75
+ owner: string;
76
+ fetchImpl?: typeof fetch;
77
+ }): Promise<WalletBalance>;
78
+ /** Read the native MINA balance (nanomina) for `owner` via the Mina GraphQL API. */
79
+ declare function readMinaBalance(opts: {
80
+ graphqlUrl: string;
81
+ owner: string;
82
+ fetchImpl?: typeof fetch;
83
+ }): Promise<WalletBalance>;
84
+ /**
85
+ * Per-chain inputs for {@link readWalletBalances}: the resolved RPC URL, the
86
+ * identity's address on that chain, and the configured token (USDC) — sourced by
87
+ * the caller from the network topology / presets, never hardcoded here. A chain
88
+ * key absent from the object is simply not read.
89
+ */
90
+ interface WalletBalanceSources {
91
+ evm?: {
92
+ chainKey: string;
93
+ rpcUrl: string;
94
+ owner: string;
95
+ tokenAddress?: string;
96
+ };
97
+ solana?: {
98
+ chainKey?: string;
99
+ rpcUrl: string;
100
+ owner: string;
101
+ tokenMint?: string;
102
+ };
103
+ mina?: {
104
+ chainKey?: string;
105
+ graphqlUrl: string;
106
+ owner: string;
107
+ };
108
+ /** Injectable fetch (Solana/Mina JSON-RPC & GraphQL) for tests. */
109
+ fetchImpl?: typeof fetch;
110
+ }
111
+ /**
112
+ * Read the full wallet view — native coin + configured tokens — for every chain
113
+ * in `sources`, keyed per chain. FREE: read-only RPC, no signing. Each chain is
114
+ * read independently and in parallel; a chain whose RPC is unreachable degrades
115
+ * to `{ unreadable: true, error }` instead of failing the others. Within a chain
116
+ * the native and token reads are independent, so a native read can succeed even
117
+ * if the token read fails (and vice versa).
118
+ */
119
+ declare function readWalletBalances(sources: WalletBalanceSources): Promise<WalletChainBalances[]>;
18
120
 
19
121
  /**
20
122
  * Solana payment-channel parameters supplied via `ToonClientConfig.solanaChannel`.
@@ -508,6 +610,35 @@ interface RequestBlobStorageResult {
508
610
  * @returns `{ success, txId?, eventId?, error? }`.
509
611
  */
510
612
  declare function requestBlobStorage(client: ToonClient, secretKey: Uint8Array, params: RequestBlobStorageParams): Promise<RequestBlobStorageResult>;
613
+ /**
614
+ * Extract the Arweave tx ID from the FULFILL `data` of a successful blob upload.
615
+ *
616
+ * The deployed payment-proxy returns the DVM's verbatim HTTP/1.1 response inside
617
+ * the FULFILL `data`. For a successful single-packet upload that response is:
618
+ *
619
+ * HTTP/1.1 200 OK\r\n
620
+ * content-length: 189\r\n
621
+ * \r\n
622
+ * {"accept":true,"txId":"<43-char base64url>","data":"<base64 of txId>",...}
623
+ *
624
+ * We parse the HTTP envelope, fail on a non-2xx status or `accept:false`, then
625
+ * read `txId` (preferred) from the JSON body — falling back to base64-decoding
626
+ * the `data` field when `txId` is absent.
627
+ *
628
+ * LEGACY FALLBACK: older / non-proxy providers returned the bare tx ID as
629
+ * `base64(utf8(txId))` directly in the FULFILL data (no HTTP envelope). When the
630
+ * payload is not HTTP-enveloped we preserve that original decode so non-HTTP
631
+ * FULFILLs do not regress.
632
+ *
633
+ * Exported for callers that drive `publishEvent` directly with a hand-built
634
+ * kind:5094 event (e.g. git-object uploads carrying Git-SHA/Git-Type/Repo
635
+ * tags, toon-client#227) and need the same FULFILL→txId decode this helper
636
+ * applies.
637
+ *
638
+ * @throws {Error} If the response is non-2xx, `accept:false`, the body is not
639
+ * parseable JSON, or no valid Arweave tx ID can be extracted.
640
+ */
641
+ declare function extractArweaveTxId(base64Data: string): string;
511
642
 
512
643
  interface BtpRuntimeClientConfig {
513
644
  btpUrl: string;
@@ -1288,6 +1419,22 @@ declare class ToonClient {
1288
1419
  * are derived there).
1289
1420
  */
1290
1421
  getBalances(): Promise<WalletBalance[]>;
1422
+ /**
1423
+ * The FULL multi-chain wallet view (#299): for every chain the identity is
1424
+ * configured for, the native coin (ETH / SOL / MINA) AND every configured
1425
+ * token (USDC), grouped per chain with the identity's address on that chain.
1426
+ * A superset of {@link getBalances} — which stays scoped to the channel's
1427
+ * settlement token — kept as a separate reader so channel-settlement callers
1428
+ * are unaffected.
1429
+ *
1430
+ * FREE: read-only RPC, no signing, no payment. Works on an UNSTARTED client:
1431
+ * the Solana/Mina addresses (which the signers only register during
1432
+ * `start()`) are derived on demand from the retained mnemonic — the SAME keys
1433
+ * `start()` would register and that `rig fund` prints — so all configured
1434
+ * chains appear even before a start. Best-effort per chain: an unreachable
1435
+ * RPC yields `{ unreadable: true }` for that chain, never failing the others.
1436
+ */
1437
+ getWalletBalances(): Promise<WalletChainBalances[]>;
1291
1438
  /**
1292
1439
  * Resolves an ILP destination address to a peer ID.
1293
1440
  * Convention: destination "g.toon.peer1" → peerId "peer1" (last segment).
@@ -2770,406 +2917,6 @@ declare function applyDefaults(rawConfig: ToonClientConfig): ResolvedConfig;
2770
2917
  */
2771
2918
  declare function buildSettlementInfo(rawConfig: ToonClientConfig): ClientSettlementInfo | undefined;
2772
2919
 
2773
- /**
2774
- * Pet DVM Client-Side Types
2775
- *
2776
- * Locally defined types for pet DVM interaction utilities.
2777
- * These mirror server-side types but do NOT import from @toon-protocol/pet-dvm,
2778
- * @toon-protocol/pet-circuit, or @toon-protocol/memvid-node.
2779
- *
2780
- * @module pet/types
2781
- */
2782
- /** Plain-number stat values (all clamped to [1, 100]) */
2783
- interface StatValues {
2784
- hunger: number;
2785
- happiness: number;
2786
- health: number;
2787
- hygiene: number;
2788
- energy: number;
2789
- }
2790
- /** Metadata for a pet DVM provider discovered via Kind 10035 events */
2791
- interface PetDvmProvider {
2792
- /** ILP address of the provider's connector */
2793
- ilpAddress: string;
2794
- /** Per-interaction cost from skill.pricing['5900'] */
2795
- pricing: string;
2796
- /** Provider's Nostr pubkey (cryptographically bound from event.pubkey) */
2797
- pubkey: string;
2798
- /** Feature list from skill.features */
2799
- features: string[];
2800
- }
2801
- /** Parameters for building a Kind 5900 pet interaction request */
2802
- interface PetInteractionRequestParams {
2803
- /** Blobbi identifier (non-empty string) */
2804
- blobbiId: string;
2805
- /** Action type (0-10, maps to Feed/Play/Clean/etc.) */
2806
- actionType: number;
2807
- /** Item identifier (>= 0) */
2808
- itemId: number;
2809
- /** Token cost for this interaction (>= 0) */
2810
- tokenCost: number;
2811
- /** Whether the pet is currently sleeping */
2812
- isSleeping: boolean;
2813
- }
2814
- /** Unsigned Nostr event structure compatible with nostr-tools finalizeEvent */
2815
- interface UnsignedNostrEvent {
2816
- kind: number;
2817
- created_at: number;
2818
- tags: string[][];
2819
- content: string;
2820
- }
2821
- /** Parsed result data from Kind 6900 DVM response (base64 JSON in IlpSendResult.data) */
2822
- interface PetInteractionResultData {
2823
- /** Current stat values */
2824
- stats: StatValues;
2825
- /** Current stage (0=Egg, 1=Baby, 2=Adult) */
2826
- stage: number;
2827
- /** Current evolution cycle (>= 0) */
2828
- cycle: number;
2829
- /** Unix timestamp of last interaction */
2830
- lastInteraction: number;
2831
- /** 64-char hex BLAKE3 hash of brain state */
2832
- brainHash: string;
2833
- /** Per-action-type cooldown timestamps */
2834
- cooldownTimestamps: number[];
2835
- }
2836
- /** Stat snapshot used in interaction result content */
2837
- interface InteractionResultContent {
2838
- priorStats: StatValues;
2839
- decayedStats: StatValues;
2840
- finalStats: StatValues;
2841
- cycle: number;
2842
- stage: number;
2843
- tokenCost: number;
2844
- }
2845
- /** Proof status of a Kind 14919 event */
2846
- type ProofStatus = 'optimistic' | 'proven';
2847
- /** Parameters for building a Kind 30402 pet-for-sale classified listing */
2848
- interface PetListingParams {
2849
- /** Blobbi identifier (non-empty string) — used as the 'd' tag */
2850
- blobbiId: string;
2851
- /** Asking price in USDC (> 0) */
2852
- askPriceUsdc: number;
2853
- /** 64-char hex lifecycleHash from on-chain PetZkApp state */
2854
- lifecycleHash: string;
2855
- /** Cumulative PET tokens spent (numeric string, >= "0") */
2856
- totalSpent: string;
2857
- /** Current stage: 0=Egg, 1=Baby, 2=Adult */
2858
- stage: number;
2859
- /** Current pet stats */
2860
- stats: StatValues;
2861
- /** Seller's Nostr pubkey (64-char hex) */
2862
- sellerPubkey: string;
2863
- /** Preferred relay URL for event relay routing */
2864
- relayUrl: string;
2865
- /** Listing expiry as unix timestamp */
2866
- expiresAt: number;
2867
- }
2868
- /** A parsed pet-for-sale listing (extends PetListingParams with event metadata) */
2869
- interface PetListing extends PetListingParams {
2870
- /** Nostr event ID of the kind:30402 listing event */
2871
- eventId: string;
2872
- /** Unix timestamp when the listing event was created */
2873
- createdAt: number;
2874
- }
2875
- /** Filter options for filterPetListings() */
2876
- interface PetListingFilterOptions {
2877
- /** Only include listings for pets at or above this stage */
2878
- minStage?: number;
2879
- /** Only include listings at or below this USDC price */
2880
- maxAskPriceUsdc?: number;
2881
- /** Only include listings where totalSpent >= this value (numeric string comparison) */
2882
- minTotalSpent?: string;
2883
- /** Only include listings from this seller pubkey */
2884
- sellerPubkey?: string;
2885
- }
2886
- /** Parameters for building a Kind 5900 pet purchase request (transfer-ownership) */
2887
- interface PetPurchaseRequestParams {
2888
- /** Blobbi identifier being purchased */
2889
- blobbiId: string;
2890
- /** Nostr event ID of the kind:30402 listing being purchased */
2891
- listingEventId: string;
2892
- /** Buyer's Nostr pubkey (64-char hex) */
2893
- buyerPubkey: string;
2894
- /** Token cost for the purchase (>= 0) */
2895
- tokenCost: number;
2896
- /** Seller's Nostr pubkey — ILP payment routed to this pubkey (64-char hex) */
2897
- sellerPubkey: string;
2898
- }
2899
- /** Parsed data from a Kind 14919 pet interaction event */
2900
- interface PetInteractionEventData {
2901
- /** Blobbi identifier from 'd' tag */
2902
- blobbiId: string;
2903
- /** Action type from 'action' tag */
2904
- actionType: number;
2905
- /** Item identifier from 'item' tag */
2906
- itemId: number;
2907
- /** Token cost from 'cost' tag */
2908
- tokenCost: number;
2909
- /** Evolution cycle from 'cycle' tag */
2910
- cycle: number;
2911
- /** Stage from 'stage' tag */
2912
- stage: number;
2913
- /** Brain hash from 'brain_hash' tag */
2914
- brainHash: string;
2915
- /** Proof status: 'optimistic' (no proof tag) or 'proven' (has proof + mina_tx tags) */
2916
- proofStatus: ProofStatus;
2917
- /** Parsed content JSON (stats before/after) */
2918
- content: InteractionResultContent | null;
2919
- /** Base64 proof data (only present when proven) */
2920
- proof?: string;
2921
- /** Mina transaction hash (only present when proven) */
2922
- minaTx?: string;
2923
- }
2924
-
2925
- /**
2926
- * Pet DVM Provider Discovery
2927
- *
2928
- * Filters Kind 10035 service discovery events to find providers that
2929
- * support Pet DVM interactions (Kind 5900).
2930
- *
2931
- * @module pet/filterPetDvmProviders
2932
- */
2933
-
2934
- /**
2935
- * Minimal Nostr event shape needed for filtering.
2936
- * Using a local interface to avoid importing nostr-tools types.
2937
- */
2938
- interface NostrEventLike$3 {
2939
- kind: number;
2940
- pubkey: string;
2941
- content: string;
2942
- tags: string[][];
2943
- id: string;
2944
- sig: string;
2945
- created_at: number;
2946
- }
2947
- /**
2948
- * Filter Kind 10035 service discovery events to find pet DVM providers.
2949
- *
2950
- * Accepts raw NostrEvent[] and internally parses content via parseServiceDiscovery.
2951
- * Filters events where skill.kinds includes 5900 (PET_INTERACTION_REQUEST_KIND).
2952
- * Returns provider metadata sorted by price ascending (cheapest first).
2953
- *
2954
- * Handles missing/malformed skill descriptors gracefully (returns empty array, no throw).
2955
- *
2956
- * @param events - Array of raw Nostr events (kind:10035)
2957
- * @returns Array of PetDvmProvider metadata, sorted by price ascending
2958
- */
2959
- declare function filterPetDvmProviders(events: NostrEventLike$3[]): PetDvmProvider[];
2960
-
2961
- /**
2962
- * Pet Interaction Request Builder (Kind 5900)
2963
- *
2964
- * Builds unsigned Kind 5900 Nostr events for pet DVM interaction requests.
2965
- * Compatible with nostr-tools/pure finalizeEvent for signing.
2966
- *
2967
- * @module pet/buildPetInteractionRequest
2968
- */
2969
-
2970
- /**
2971
- * Build an unsigned Kind 5900 pet interaction request event.
2972
- *
2973
- * All tag values are stringified per Nostr protocol convention.
2974
- * The returned event is compatible with nostr-tools `finalizeEvent`.
2975
- *
2976
- * @param params - Typed interaction parameters
2977
- * @returns Unsigned Nostr event ready for signing
2978
- * @throws ValidationError for invalid input
2979
- */
2980
- declare function buildPetInteractionRequest(params: PetInteractionRequestParams): UnsignedNostrEvent;
2981
-
2982
- /**
2983
- * Pet Interaction Result Parser (Kind 6900)
2984
- *
2985
- * Decodes base64-encoded JSON from IlpSendResult.data field.
2986
- * Uses browser-safe atob() -- NOT Node.js Buffer -- for ditto React SPA compatibility.
2987
- *
2988
- * @module pet/parsePetInteractionResult
2989
- */
2990
-
2991
- /**
2992
- * Parse base64-encoded JSON result data from a Kind 6900 DVM response.
2993
- *
2994
- * Uses atob() for browser compatibility (ditto React SPA).
2995
- * Returns null for malformed/missing data (no throw).
2996
- *
2997
- * Validates:
2998
- * - brainHash is 64-char hex
2999
- * - stats has all 5 fields
3000
- * - cycle >= 0
3001
- * - stage 0-2
3002
- *
3003
- * @param data - Base64-encoded JSON string from IlpSendResult.data
3004
- * @returns Parsed PetInteractionResultData or null if invalid
3005
- */
3006
- declare function parsePetInteractionResult(data: string): PetInteractionResultData | null;
3007
-
3008
- /**
3009
- * Pet Interaction Event Parser (Kind 14919)
3010
- *
3011
- * Parses Kind 14919 optimistic/proven pet interaction events.
3012
- * Detects proof status from presence of 'proof' + 'mina_tx' tags.
3013
- *
3014
- * @module pet/parsePetInteractionEvent
3015
- */
3016
-
3017
- /**
3018
- * Minimal Nostr event shape needed for parsing.
3019
- */
3020
- interface NostrEventLike$2 {
3021
- kind: number;
3022
- pubkey: string;
3023
- content: string;
3024
- tags: string[][];
3025
- id: string;
3026
- sig: string;
3027
- created_at: number;
3028
- }
3029
- /**
3030
- * Parse a Kind 14919 pet interaction event.
3031
- *
3032
- * Extracts all tag values and detects proof status:
3033
- * - 'optimistic': no 'proof' tag
3034
- * - 'proven': has 'proof' + 'mina_tx' tags
3035
- *
3036
- * Returns null if required tags are missing.
3037
- *
3038
- * @param event - A Nostr event (Kind 14919)
3039
- * @returns Parsed PetInteractionEventData or null if malformed
3040
- */
3041
- declare function parsePetInteractionEvent(event: NostrEventLike$2): PetInteractionEventData | null;
3042
-
3043
- /**
3044
- * Pet Listing Event Builder (Kind 30402)
3045
- *
3046
- * Builds unsigned Kind 30402 (NIP-99 classified listing) Nostr events
3047
- * for pet-for-sale marketplace listings. Every listing includes a
3048
- * verified biography attachment (lifecycleHash + totalSpent) so buyers
3049
- * can verify the listing against on-chain PetZkApp state.
3050
- *
3051
- * Browser-compatible — no Node.js-only imports.
3052
- *
3053
- * @module pet/buildPetListingEvent
3054
- */
3055
-
3056
- /**
3057
- * Build an unsigned Kind 30402 pet-for-sale classified listing event.
3058
- *
3059
- * The listing uses the NIP-99 classified listing format with TOON-specific
3060
- * extension tags for verified biography (lifecycleHash, totalSpent).
3061
- * The `d` tag is set to `blobbiId` for stable parameterized replaceability —
3062
- * republishing with the same `d` tag updates the listing on relays.
3063
- *
3064
- * The returned event is compatible with nostr-tools `finalizeEvent`.
3065
- *
3066
- * @param params - Typed listing parameters
3067
- * @returns Unsigned Nostr event ready for signing and publishing
3068
- */
3069
- declare function buildPetListingEvent(params: PetListingParams): UnsignedNostrEvent;
3070
-
3071
- /**
3072
- * Pet Listing Parser (Kind 30402)
3073
- *
3074
- * Parses Kind 30402 (NIP-99 classified listing) Nostr events into
3075
- * typed PetListing objects. Returns null for invalid or malformed events.
3076
- *
3077
- * Browser-compatible — no Node.js-only imports.
3078
- *
3079
- * @module pet/parsePetListing
3080
- */
3081
-
3082
- /** Minimal Nostr event shape required for parsing */
3083
- interface NostrEventLike$1 {
3084
- id: string;
3085
- kind: number;
3086
- pubkey: string;
3087
- tags: string[][];
3088
- content: string;
3089
- created_at: number;
3090
- }
3091
- /**
3092
- * Parse a Kind 30402 pet classified listing event into a PetListing.
3093
- *
3094
- * Validation rules:
3095
- * - event.kind must be 30402
3096
- * - 'd' tag must be present and non-empty
3097
- * - 'price' tag must be present with a valid positive numeric first element
3098
- * - 'lifecycle_hash' tag must be a 64-char hex string
3099
- * - 'total_spent' tag must be a valid non-negative numeric string
3100
- * - 'stage' tag must be present
3101
- *
3102
- * Stats are parsed from content JSON; unparseable content falls back to DEFAULT_STATS.
3103
- *
3104
- * @param event - A Nostr event (expected Kind 30402)
3105
- * @returns Parsed PetListing or null if invalid
3106
- */
3107
- declare function parsePetListing(event: NostrEventLike$1): PetListing | null;
3108
-
3109
- /**
3110
- * Pet Listing Discovery Filter
3111
- *
3112
- * Filters and sorts Kind 30402 pet marketplace listing events into
3113
- * typed PetListing objects. Handles expiry, stage, price, biography
3114
- * value, and seller filtering. Results sorted by totalSpent descending
3115
- * (highest biography value first) to surface the most battle-hardened pets.
3116
- *
3117
- * Browser-compatible — no Node.js-only imports.
3118
- *
3119
- * @module pet/filterPetListings
3120
- */
3121
-
3122
- /** Minimal Nostr event shape accepted by the filter */
3123
- interface NostrEventLike {
3124
- id: string;
3125
- kind: number;
3126
- pubkey: string;
3127
- tags: string[][];
3128
- content: string;
3129
- created_at: number;
3130
- }
3131
- /**
3132
- * Filter and sort Kind 30402 pet marketplace listing events.
3133
- *
3134
- * Parsing is done via parsePetListing — invalid events are silently dropped.
3135
- * Expired listings (expiration tag < current unix time) are excluded.
3136
- * Options allow additional filtering by stage, price, biography value, and seller.
3137
- * Results are sorted by totalSpent descending (highest biography value first).
3138
- *
3139
- * @param events - Array of raw Nostr events to filter
3140
- * @param options - Optional filter criteria
3141
- * @returns Filtered and sorted array of PetListing objects
3142
- */
3143
- declare function filterPetListings(events: NostrEventLike[], options?: PetListingFilterOptions): PetListing[];
3144
-
3145
- /**
3146
- * Pet Purchase Request Builder (Kind 5900, action type 9)
3147
- *
3148
- * Builds unsigned Kind 5900 Nostr events for pet transfer-ownership
3149
- * purchase requests. Action type 9 is a reserved slot in the pet DVM
3150
- * protocol — this event signals purchase intent and routes ILP payment
3151
- * to the seller. The actual Mina on-chain ownership transfer (PetZkApp
3152
- * .transferOperator) is handled by downstream stories.
3153
- *
3154
- * Browser-compatible — no Node.js-only imports.
3155
- *
3156
- * @module pet/buildPetPurchaseRequest
3157
- */
3158
-
3159
- /**
3160
- * Build an unsigned Kind 5900 pet purchase request event.
3161
- *
3162
- * Reuses the existing pet interaction event kind (5900) with action type 9
3163
- * (transfer-ownership). The `listing` tag references the kind:30402 listing
3164
- * event being purchased. The `p` tag routes ILP payment to the seller.
3165
- *
3166
- * The returned event is compatible with nostr-tools `finalizeEvent`.
3167
- *
3168
- * @param params - Typed purchase request parameters
3169
- * @returns Unsigned Nostr event ready for signing and publishing
3170
- */
3171
- declare function buildPetPurchaseRequest(params: PetPurchaseRequestParams): UnsignedNostrEvent;
3172
-
3173
2920
  /**
3174
2921
  * Devnet faucet helper.
3175
2922
  *
@@ -3579,4 +3326,4 @@ declare function loadKeystore(path: string, password: string): string;
3579
3326
  */
3580
3327
  declare function writeKeystoreFile(path: string, keystore: EncryptedKeystore): void;
3581
3328
 
3582
- export { type BackupPayload, type BalanceProofParams, BtpRuntimeClient, type BtpRuntimeClientConfig, type ChainMetadata, type ChainSigner, ChannelFundingError, ChannelManager, type ClaimMessage, type ClaimResolver, ConnectorError, type DiscoveredIlpPeer, type EVMClaimMessage, type EncryptedKeystore, EvmSigner, type FaucetChain, type FundWalletOptions, type FundWalletResult, type H402FetchOptions, Http402Client, type Http402ClientConfig, HttpConnectorAdmin, type HttpConnectorAdminConfig, HttpIlpClient, type HttpIlpClientConfig, type HttpIlpClientFactory, HttpRuntimeClient, type HttpRuntimeClientConfig, ILP_CLAIM_HEADER, ILP_CLAIM_WRAPPED_HEADER, ILP_PEER_ID_HEADER, type IlpTransportChoice, type InteractionResultContent, KeyManager, type KeyManagerConfig, type MinaClaimMessage, type MinaDepositReader, MinaSigner, type MinaSignerOptions, NetworkError, OnChainChannelClient, type OnChainChannelClientConfig, type ParsedFulfillHttp, type ParsedX402Challenge, type PasskeyInfo, type PetDvmProvider, type PetInteractionEventData, type PetInteractionRequestParams, type PetInteractionResultData, type PetListing, type PetListingFilterOptions, type PetListingParams, type PetPurchaseRequestParams, type ProofStatus, type PublishEventResult, type RequestBlobStorageParams, type RequestBlobStorageResult, type RetryOptions, type SelectIlpTransportOptions, type SignedBalanceProof, type SolanaChannelClientOptions, type SolanaClaimMessage, SolanaSigner, type StatValues, type ToonChannelAccept, ToonClient, type ToonClientConfig, ToonClientError, type ToonIdentity, type ToonSigners, type ToonStartResult, type UnsignedNostrEvent, ValidationError, type VaultData, applyDefaults, applyNetworkPresets, buildBackupEvent, buildBackupFilter, buildPetInteractionRequest, buildPetListingEvent, buildPetPurchaseRequest, buildSettlementInfo, buildStoreWriteEnvelope, decryptMnemonic, defaultFaucetTimeout, deriveFromNsec, deriveFullIdentity, deriveNostrKeyFromMnemonic, encryptMnemonic, filterPetDvmProviders, filterPetListings, fundWallet, generateKeystore, generateMnemonic, generateRandomIdentity, getNetworkStatus, httpEndpointToBtpUrl, importKeystore, isInsufficientGasError, isPrfSupported, loadKeystore, parseBackupPayload, parseFulfillHttp, parseFulfillHttpBytes, parseHttpResponse, parsePetInteractionEvent, parsePetInteractionResult, parsePetListing, parseX402Body, parseX402Challenge, proxyIlpEndpoint, readDiscoveredIlpPeer, readMinaDepositTotal, requestBlobStorage, selectIlpTransport, serializeHttpRequest, validateConfig, validateMnemonic, withRetry, writeKeystoreFile };
3329
+ export { type BackupPayload, type BalanceProofParams, BtpRuntimeClient, type BtpRuntimeClientConfig, type ChainMetadata, type ChainSigner, ChannelFundingError, ChannelManager, type ClaimMessage, type ClaimResolver, ConnectorError, type DiscoveredIlpPeer, type EVMClaimMessage, type EncryptedKeystore, EvmSigner, type FaucetChain, type FundWalletOptions, type FundWalletResult, type H402FetchOptions, Http402Client, type Http402ClientConfig, HttpConnectorAdmin, type HttpConnectorAdminConfig, HttpIlpClient, type HttpIlpClientConfig, type HttpIlpClientFactory, HttpRuntimeClient, type HttpRuntimeClientConfig, ILP_CLAIM_HEADER, ILP_CLAIM_WRAPPED_HEADER, ILP_PEER_ID_HEADER, type IlpTransportChoice, KeyManager, type KeyManagerConfig, type MinaClaimMessage, type MinaDepositReader, MinaSigner, type MinaSignerOptions, NetworkError, OnChainChannelClient, type OnChainChannelClientConfig, type ParsedFulfillHttp, type ParsedX402Challenge, type PasskeyInfo, type PublishEventResult, type RequestBlobStorageParams, type RequestBlobStorageResult, type RetryOptions, type SelectIlpTransportOptions, type SignedBalanceProof, type SolanaChannelClientOptions, type SolanaClaimMessage, SolanaSigner, type ToonChannelAccept, ToonClient, type ToonClientConfig, ToonClientError, type ToonIdentity, type ToonSigners, type ToonStartResult, ValidationError, type VaultData, type WalletBalance, type WalletBalanceSources, type WalletChainBalances, type WalletTokenAmount, applyDefaults, applyNetworkPresets, buildBackupEvent, buildBackupFilter, buildSettlementInfo, buildStoreWriteEnvelope, decryptMnemonic, defaultFaucetTimeout, deriveFromNsec, deriveFullIdentity, deriveNostrKeyFromMnemonic, encryptMnemonic, extractArweaveTxId, fundWallet, generateKeystore, generateMnemonic, generateRandomIdentity, getNetworkStatus, httpEndpointToBtpUrl, importKeystore, isInsufficientGasError, isPrfSupported, loadKeystore, parseBackupPayload, parseFulfillHttp, parseFulfillHttpBytes, parseHttpResponse, parseX402Body, parseX402Challenge, proxyIlpEndpoint, readDiscoveredIlpPeer, readEvmNativeBalance, readEvmTokenBalance, readMinaBalance, readMinaDepositTotal, readSolanaNativeBalance, readSolanaTokenBalance, readWalletBalances, requestBlobStorage, selectIlpTransport, serializeHttpRequest, validateConfig, validateMnemonic, withRetry, writeKeystoreFile };