sdk

Radroots SDK and bindings
git clone https://radroots.dev/git/sdk.git
Log | Files | Refs | README

types.ts (8372B)


      1 // @generated by cargo xtask generate ts
      2 // Do not edit by hand.
      3 import type {
      4     RadrootsCoreCurrency,
      5     RadrootsCoreDecimal,
      6     RadrootsCoreDiscount,
      7     RadrootsCoreDiscountValue,
      8     RadrootsCoreMoney,
      9     RadrootsCoreQuantity,
     10     RadrootsCoreUnit,
     11 } from "@radroots/core-bindings";
     12 import type {
     13     RadrootsFarmRef,
     14     RadrootsListing,
     15     RadrootsListingAvailability,
     16     RadrootsListingBin,
     17     RadrootsListingDeliveryMethod,
     18     RadrootsListingImage,
     19     RadrootsListingLocation,
     20     RadrootsListingProduct,
     21     RadrootsNostrEventPtr,
     22     RadrootsPlotRef,
     23     RadrootsResourceAreaRef,
     24     RadrootsTradeMessagePayload,
     25     RadrootsTradeMessageType,
     26     RadrootsTradeOrderEconomicLine,
     27     RadrootsTradeOrderItem,
     28     RadrootsTradeOrderStatus,
     29 } from "@radroots/events-bindings";
     30 
     31 export type RadrootsTradeFacetCount = { key: string, count: number, };
     32 
     33 export type RadrootsTradeListing = { listing_id: string, listing_addr: string, seller_pubkey: string, title: string, description: string, product_type: string, primary_bin_id: string, bin_quantity: RadrootsCoreQuantity, unit: RadrootsCoreUnit, unit_price: RadrootsCoreMoney, inventory_available: RadrootsCoreDecimal, availability: RadrootsListingAvailability, location: RadrootsListingLocation, delivery_method: RadrootsListingDeliveryMethod, listing: RadrootsListing, };
     34 
     35 export type RadrootsTradeListingBackofficeOverlay = { listing_addr: string, review_queue?: RadrootsTradeReviewQueueEntry | null, moderation_flags: Array<RadrootsTradeModerationFlag>, };
     36 
     37 export type RadrootsTradeListingBackofficeQuery = { listing: RadrootsTradeListingQuery, requires_review?: boolean | null, has_open_moderation_flags?: boolean | null, };
     38 
     39 export type RadrootsTradeListingBackofficeView = { listing: RadrootsTradeListingProjection, marketplace?: RadrootsTradeMarketplaceListingSummary | null, overlay?: RadrootsTradeListingBackofficeOverlay | null, requires_review: boolean, open_moderation_flag_count: number, };
     40 
     41 export type RadrootsTradeListingBinProjection = { bin: RadrootsListingBin, one_bin_total: RadrootsTradeListingTotal, };
     42 
     43 export type RadrootsTradeListingFacets = { seller_pubkeys: Array<RadrootsTradeFacetCount>, farm_pubkeys: Array<RadrootsTradeFacetCount>, farm_ids: Array<RadrootsTradeFacetCount>, product_keys: Array<RadrootsTradeFacetCount>, product_categories: Array<RadrootsTradeFacetCount>, listing_statuses: Array<RadrootsTradeFacetCount>, };
     44 
     45 export type RadrootsTradeListingMarketStatus = "unknown" | "window" | "active" | "sold" | { other: { value: string, }, };
     46 
     47 export type RadrootsTradeListingProjection = { listing_addr: string, seller_pubkey: string, listing_id: string, farm: RadrootsFarmRef, product: RadrootsListingProduct, primary_bin_id: string, bins: Array<RadrootsTradeListingBinProjection>, resource_area?: RadrootsResourceAreaRef | null, plot?: RadrootsPlotRef | null, discounts?: Array<RadrootsCoreDiscount> | null, inventory_available?: RadrootsCoreDecimal | null, availability?: RadrootsListingAvailability | null, delivery_method?: RadrootsListingDeliveryMethod | null, location?: RadrootsListingLocation | null, images?: Array<RadrootsListingImage> | null, order_count: number, open_order_count: number, terminal_order_count: number, };
     48 
     49 export type RadrootsTradeListingQuery = { seller_pubkey?: string | null, farm_pubkey?: string | null, farm_id?: string | null, product_key?: string | null, product_category?: string | null, listing_status?: RadrootsTradeListingMarketStatus | null, };
     50 
     51 export type RadrootsTradeListingSort = { field: RadrootsTradeListingSortField, direction: RadrootsTradeSortDirection, };
     52 
     53 export type RadrootsTradeListingSortField = "listing_addr" | "product_title" | "product_category" | "seller_pubkey" | "inventory_available" | "open_order_count" | "total_order_count";
     54 
     55 export type RadrootsTradeListingSubtotal = { price_amount: RadrootsCoreMoney, price_currency: RadrootsCoreCurrency, quantity_amount: RadrootsCoreDecimal, quantity_unit: RadrootsCoreUnit, };
     56 
     57 export type RadrootsTradeListingTotal = { price_amount: RadrootsCoreMoney, price_currency: RadrootsCoreCurrency, quantity_amount: RadrootsCoreDecimal, quantity_unit: RadrootsCoreUnit, };
     58 
     59 export type RadrootsTradeMarketplaceListingSummary = { listing_addr: string, seller_pubkey: string, farm_pubkey: string, farm_id: string, product_key: string, product_title: string, product_category: string, product_summary?: string | null, listing_status: RadrootsTradeListingMarketStatus, location_primary?: string | null, inventory_available?: RadrootsCoreDecimal | null, primary_bin_id: string, primary_bin_label?: string | null, primary_bin_total: RadrootsTradeListingTotal, order_count: number, open_order_count: number, terminal_order_count: number, };
     60 
     61 export type RadrootsTradeMarketplaceOrderSummary = { order_id: string, listing_addr: string, buyer_pubkey: string, seller_pubkey: string, status: RadrootsTradeOrderStatus, last_message_type: RadrootsTradeMessageType, item_count: number, total_bin_count: number, has_requested_discounts: boolean, last_reason?: string | null, };
     62 
     63 export type RadrootsTradeModerationFlag = { code: string, severity: RadrootsTradeModerationSeverity, status: RadrootsTradeModerationStatus, source?: string | null, reason?: string | null, };
     64 
     65 export type RadrootsTradeModerationSeverity = "notice" | "warning" | "block";
     66 
     67 export type RadrootsTradeModerationStatus = "open" | "snoozed" | "resolved";
     68 
     69 export type RadrootsTradeOrderBackofficeOverlay = { order_id: string, review_queue?: RadrootsTradeReviewQueueEntry | null, moderation_flags: Array<RadrootsTradeModerationFlag>, };
     70 
     71 export type RadrootsTradeOrderBackofficeQuery = { order: RadrootsTradeOrderQuery, requires_review?: boolean | null, has_open_moderation_flags?: boolean | null, };
     72 
     73 export type RadrootsTradeOrderBackofficeView = { order: RadrootsTradeOrderWorkflowProjection, marketplace: RadrootsTradeMarketplaceOrderSummary, overlay?: RadrootsTradeOrderBackofficeOverlay | null, requires_review: boolean, open_moderation_flag_count: number, };
     74 
     75 export type RadrootsTradeOrderFacets = { buyer_pubkeys: Array<RadrootsTradeFacetCount>, seller_pubkeys: Array<RadrootsTradeFacetCount>, listing_addrs: Array<RadrootsTradeFacetCount>, statuses: Array<RadrootsTradeFacetCount>, };
     76 
     77 export type RadrootsTradeOrderQuery = { listing_addr?: string | null, buyer_pubkey?: string | null, seller_pubkey?: string | null, status?: RadrootsTradeOrderStatus | null, };
     78 
     79 export type RadrootsTradeOrderSort = { field: RadrootsTradeOrderSortField, direction: RadrootsTradeSortDirection, };
     80 
     81 export type RadrootsTradeOrderSortField = "order_id" | "listing_addr" | "buyer_pubkey" | "seller_pubkey" | "status" | "last_message_type" | "total_bin_count";
     82 
     83 export type RadrootsTradeOrderWorkflowMessage = { event_id: string, actor_pubkey: string, counterparty_pubkey: string, listing_addr: string, order_id?: string | null, listing_event?: RadrootsNostrEventPtr | null, root_event_id?: string | null, prev_event_id?: string | null, payload: RadrootsTradeMessagePayload, };
     84 
     85 export type RadrootsTradeOrderWorkflowProjection = { order_id: string, listing_addr: string, buyer_pubkey: string, seller_pubkey: string, items: Array<RadrootsTradeOrderItem>, requested_discounts?: Array<RadrootsTradeOrderEconomicLine> | null, status: RadrootsTradeOrderStatus, listing_snapshot?: RadrootsNostrEventPtr | null, root_event_id: string, last_event_id: string, last_discount_request?: RadrootsCoreDiscountValue | null, last_discount_offer?: RadrootsCoreDiscountValue | null, accepted_discount?: RadrootsCoreDiscountValue | null, last_reason?: string | null, last_discount_decline_reason?: string | null, question_count: number, answer_count: number, revision_count: number, discount_request_count: number, discount_offer_count: number, discount_accept_count: number, discount_decline_count: number, cancellation_count: number, last_message_type: RadrootsTradeMessageType, last_actor_pubkey: string, };
     86 
     87 export type RadrootsTradeReviewPriority = "low" | "normal" | "high" | "critical";
     88 
     89 export type RadrootsTradeReviewQueueEntry = { queue: string, priority: RadrootsTradeReviewPriority, status: RadrootsTradeReviewStatus, assigned_operator?: string | null, reason?: string | null, };
     90 
     91 export type RadrootsTradeReviewStatus = "queued" | "in_progress" | "blocked" | "resolved";
     92 
     93 export type RadrootsTradeSortDirection = "asc" | "desc";