@toon-protocol/client 0.14.12 → 0.15.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 +30 -401
- package/dist/index.js +1 -437
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -508,6 +508,35 @@ interface RequestBlobStorageResult {
|
|
|
508
508
|
* @returns `{ success, txId?, eventId?, error? }`.
|
|
509
509
|
*/
|
|
510
510
|
declare function requestBlobStorage(client: ToonClient, secretKey: Uint8Array, params: RequestBlobStorageParams): Promise<RequestBlobStorageResult>;
|
|
511
|
+
/**
|
|
512
|
+
* Extract the Arweave tx ID from the FULFILL `data` of a successful blob upload.
|
|
513
|
+
*
|
|
514
|
+
* The deployed payment-proxy returns the DVM's verbatim HTTP/1.1 response inside
|
|
515
|
+
* the FULFILL `data`. For a successful single-packet upload that response is:
|
|
516
|
+
*
|
|
517
|
+
* HTTP/1.1 200 OK\r\n
|
|
518
|
+
* content-length: 189\r\n
|
|
519
|
+
* \r\n
|
|
520
|
+
* {"accept":true,"txId":"<43-char base64url>","data":"<base64 of txId>",...}
|
|
521
|
+
*
|
|
522
|
+
* We parse the HTTP envelope, fail on a non-2xx status or `accept:false`, then
|
|
523
|
+
* read `txId` (preferred) from the JSON body — falling back to base64-decoding
|
|
524
|
+
* the `data` field when `txId` is absent.
|
|
525
|
+
*
|
|
526
|
+
* LEGACY FALLBACK: older / non-proxy providers returned the bare tx ID as
|
|
527
|
+
* `base64(utf8(txId))` directly in the FULFILL data (no HTTP envelope). When the
|
|
528
|
+
* payload is not HTTP-enveloped we preserve that original decode so non-HTTP
|
|
529
|
+
* FULFILLs do not regress.
|
|
530
|
+
*
|
|
531
|
+
* Exported for callers that drive `publishEvent` directly with a hand-built
|
|
532
|
+
* kind:5094 event (e.g. git-object uploads carrying Git-SHA/Git-Type/Repo
|
|
533
|
+
* tags, toon-client#227) and need the same FULFILL→txId decode this helper
|
|
534
|
+
* applies.
|
|
535
|
+
*
|
|
536
|
+
* @throws {Error} If the response is non-2xx, `accept:false`, the body is not
|
|
537
|
+
* parseable JSON, or no valid Arweave tx ID can be extracted.
|
|
538
|
+
*/
|
|
539
|
+
declare function extractArweaveTxId(base64Data: string): string;
|
|
511
540
|
|
|
512
541
|
interface BtpRuntimeClientConfig {
|
|
513
542
|
btpUrl: string;
|
|
@@ -2770,406 +2799,6 @@ declare function applyDefaults(rawConfig: ToonClientConfig): ResolvedConfig;
|
|
|
2770
2799
|
*/
|
|
2771
2800
|
declare function buildSettlementInfo(rawConfig: ToonClientConfig): ClientSettlementInfo | undefined;
|
|
2772
2801
|
|
|
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
2802
|
/**
|
|
3174
2803
|
* Devnet faucet helper.
|
|
3175
2804
|
*
|
|
@@ -3579,4 +3208,4 @@ declare function loadKeystore(path: string, password: string): string;
|
|
|
3579
3208
|
*/
|
|
3580
3209
|
declare function writeKeystoreFile(path: string, keystore: EncryptedKeystore): void;
|
|
3581
3210
|
|
|
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,
|
|
3211
|
+
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, 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, readMinaDepositTotal, requestBlobStorage, selectIlpTransport, serializeHttpRequest, validateConfig, validateMnemonic, withRetry, writeKeystoreFile };
|