From a6b813650554c07cd44514d2802f1257904ace24 Mon Sep 17 00:00:00 2001 From: Filippo Vecchiato Date: Thu, 23 Apr 2026 12:57:44 +0200 Subject: [PATCH 1/5] RFC-0013: Favourites API --- docs/rfcs/0013-favourites-api.md | 115 +++++++++++++++++++++++++++++++ docs/rfcs/_index.md | 1 + 2 files changed, 116 insertions(+) create mode 100644 docs/rfcs/0013-favourites-api.md diff --git a/docs/rfcs/0013-favourites-api.md b/docs/rfcs/0013-favourites-api.md new file mode 100644 index 00000000..c1620e11 --- /dev/null +++ b/docs/rfcs/0013-favourites-api.md @@ -0,0 +1,115 @@ +# RFC-0013: Favourites API + +| | | +| --------------- | --------------------------------------------------------------- | +| **Start Date** | 2026-04-21 | +| **Description** | Let products read and manage the user's bookmarked apps | +| **Authors** | Filippo Vecchiato | + +## Summary + +Products can query, add and remove bookmarked apps from the host's local product catalogue. The host exposes a subscription for the installed-product list and two mutations for adding/removing entries. Browse (the on-chain discovery product) receives privileged access without an explicit permission prompt. + +## Motivation + +The host maintains a local catalogue of products the user has bookmarked (starred). Today this data lives in the host's IndexedDB and is inaccessible to products. Browse — the primary discovery surface — cannot show which apps are already installed or let the user bookmark new ones without direct database access. + +Exposing this catalogue: + +1. **Enables discovery UIs** — Browse can render install/uninstall affordances inline. +2. **Keeps the host authoritative** — mutations go through the host, which owns the storage schema and can enforce invariants. +3. **Supports other products** — any product with permission can read the installed list (e.g. a dashboard, launcher, or analytics tool). + +## Detailed Design + +### Data Model + +```rust +struct FavouriteProduct { + product_id: DotNsIdentifier, + installed: bool, + source: ProductSource, + created_at: Timestamp, + updated_at: Timestamp +} + +enum ProductSource { + Remote, // discovered via on-chain registry + Local // sideloaded or manually added +} +``` + +This mirrors the existing `ProductRecord` in the host's `products` table, exposing only the fields relevant to products. + +### API + +```rust +enum FavouritesErr { + NotConnected, + Rejected, + Unknown(GenericErr) +} + +fn host_favourites_subscribe( + callback: fn(Vec) +) -> Result; + +fn host_favourites_add( + product_id: DotNsIdentifier +) -> Result; + +fn host_favourites_forget( + product_id: DotNsIdentifier +) -> Result; +``` + +- `host_favourites_subscribe` delivers the full list on each callback; hosts MAY debounce. +- `host_favourites_add` upserts a `FavouriteProduct` with `source: Remote`, setting `created_at` on first install and `updated_at` on every call. Returns the resulting record. +- `host_favourites_forget` removes the product from the catalogue entirely. + +All methods require authentication (RFC-0009). + +### Permission Model + +Extends `DevicePermission` from RFC-0002: + +```rust +enum DevicePermission { + // ... existing variants ... + Favourites +} +``` + +| Permission | Grants | +|-----------|--------| +| `Favourites` | Read, add, and forget bookmarked products | + +**Browse privilege:** The host MAY grant implicit `Favourites` to Browse (the built-in discovery product) without prompting. This is analogous to how Browse currently writes directly to the products table. + +### Host Behaviour + +On `host_favourites_add`: +1. Upsert row in the products table with `installed: true`, `source: 'remote'`. +2. Set `created_at` if new, `updated_at` on every call. +3. Notify all active subscribers. + +On `host_favourites_forget`: +1. Delete the row from the products table. +2. Notify all active subscribers. + +The host SHOULD display a brief confirmation toast on install/forget for products other than Browse. + +Favourites are local to the host instance. Cross-host sync is out of scope for this RFC. + +## Drawbacks + +- **Full-list delivery.** No pagination or filtered subscriptions. Acceptable for typical catalogue sizes (tens to low hundreds). +- **Browse coupling.** Implicit privilege for Browse assumes a well-known product identity. If Browse's DotNS identifier changes, the host must update its allowlist. + +## Alternatives + +- + +## Unresolved Questions + +1. **Batch operations.** Should `host_favourites_add` accept multiple product IDs? diff --git a/docs/rfcs/_index.md b/docs/rfcs/_index.md index 2e478a63..c64b2355 100644 --- a/docs/rfcs/_index.md +++ b/docs/rfcs/_index.md @@ -17,3 +17,4 @@ created: 2026-03-13 | 0008 | [Statement Store Host API v0.2](0008-statement-store.md) | accepted | @johnthecat | [#118](https://github.com/paritytech/triangle-js-sdks/pull/118) | | 0009 | [Unauthenticated Product Access](0009-unauthenticated-product-access.md) | accepted | @filvecchiato | [#128](https://github.com/paritytech/triangle-js-sdks/pull/128) | | 0010 | [Root account access Host API](0010-get-root-account.md) | accepted | @johnthecat | [#126](https://github.com/paritytech/triangle-js-sdks/pull/126) | +| 0013 | [Favourites API](0013-favourites-api.md) | draft | @filvecchiato | [#141](https://github.com/paritytech/triangle-js-sdks/pull/141) | From fb07a476e0c0969f4a031347c37a5f3fc901b4ce Mon Sep 17 00:00:00 2001 From: Filippo Vecchiato Date: Wed, 29 Apr 2026 10:32:31 +0200 Subject: [PATCH 2/5] Address review feedback on RFC-0013 Favourites API - Explain why Browse gets implicit privilege (default discovery product) - Rephrase motivation: hosts store data products can't access, bookmarks are one example; tie to DotNS being permissionless - Improve discovery UI bullet with concrete details - Lead Data Model section with the ProductRecord reference - Add NotSupported error variant for hosts without a favourites table - Remove empty Alternatives section --- docs/rfcs/0013-favourites-api.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/rfcs/0013-favourites-api.md b/docs/rfcs/0013-favourites-api.md index c1620e11..fc0a4b37 100644 --- a/docs/rfcs/0013-favourites-api.md +++ b/docs/rfcs/0013-favourites-api.md @@ -8,17 +8,19 @@ ## Summary -Products can query, add and remove bookmarked apps from the host's local product catalogue. The host exposes a subscription for the installed-product list and two mutations for adding/removing entries. Browse (the on-chain discovery product) receives privileged access without an explicit permission prompt. +Products can query, add and remove bookmarked apps from the host's local product catalogue. The host exposes a subscription for the installed-product list and two mutations for adding/removing entries. Browse (the on-chain discovery product) receives privileged access without an explicit permission prompt, because it is the default discovery surface for users to find and manage products. ## Motivation -The host maintains a local catalogue of products the user has bookmarked (starred). Today this data lives in the host's IndexedDB and is inaccessible to products. Browse — the primary discovery surface — cannot show which apps are already installed or let the user bookmark new ones without direct database access. +Hosts store data that products don't have access to but would benefit from. Bookmarked apps are one such example — some hosts maintain a local catalogue of products the user has bookmarked (starred), but this data is inaccessible to products. Browse — the primary discovery surface — cannot show which apps are already installed or let the user bookmark new ones without direct database access. + +Since DotNS is permissionless and anyone can publish a product, discovery is essential. Browse and other products should be able to help users find and keep track of apps that solve their problems. Exposing this catalogue: -1. **Enables discovery UIs** — Browse can render install/uninstall affordances inline. +1. **Enables discovery UIs** — Browse can render install/uninstall affordances inline, showing which apps are already bookmarked and letting users add or remove them directly from the discovery surface. 2. **Keeps the host authoritative** — mutations go through the host, which owns the storage schema and can enforce invariants. -3. **Supports other products** — any product with permission can read the installed list (e.g. a dashboard, launcher, or analytics tool). +3. **Supports other products** — any product with permission can read the installed list (e.g. a dashboard, launcher, or analytics tool). Because DotNS is permissionless and anyone can publish a product, discovery tools beyond Browse may emerge and benefit from the same API. ## Detailed Design @@ -39,7 +41,7 @@ enum ProductSource { } ``` -This mirrors the existing `ProductRecord` in the host's `products` table, exposing only the fields relevant to products. +Exposing only the fields relevant to products, this mirrors the existing `ProductRecord` in the host's `products` table (see e.g. [polkadot-desktop products table](https://github.com/nickvdao/polkadot-desktop)). ### API @@ -47,6 +49,7 @@ This mirrors the existing `ProductRecord` in the host's `products` table, exposi enum FavouritesErr { NotConnected, Rejected, + NotSupported, // host does not implement a favourites catalogue Unknown(GenericErr) } @@ -106,10 +109,6 @@ Favourites are local to the host instance. Cross-host sync is out of scope for t - **Full-list delivery.** No pagination or filtered subscriptions. Acceptable for typical catalogue sizes (tens to low hundreds). - **Browse coupling.** Implicit privilege for Browse assumes a well-known product identity. If Browse's DotNS identifier changes, the host must update its allowlist. -## Alternatives - -- - ## Unresolved Questions 1. **Batch operations.** Should `host_favourites_add` accept multiple product IDs? From 97cdbd2ec4ba4f4bb0ef14dcbfe675f23efbf538 Mon Sep 17 00:00:00 2001 From: Filippo Vecchiato Date: Fri, 5 Jun 2026 21:27:39 +0200 Subject: [PATCH 3/5] Add v0.3 to protocol versions in README Co-Authored-By: Claude Opus 4.6 --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a7a206b9..1d5b9bad 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,8 @@ This repopulates the ignored generated TS under `js/packages/truapi/`, including ## Protocol versions - **v0.1**: initial protocol version. -- **v0.2**: current protocol version. See [`docs/design/v02-changes.md`](docs/design/v02-changes.md) for the rationale behind each change. +- **v0.2**: See [`docs/design/v02-changes.md`](docs/design/v02-changes.md) for the rationale behind each change. +- **v0.3**: current protocol version. Adds the Favourites API ([RFC 0013](docs/rfcs/0013-favourites-api.md)). ## Deploy From 555deabe01d9f3250f3a1192625d42fd804100ca Mon Sep 17 00:00:00 2001 From: Filippo Vecchiato Date: Fri, 5 Jun 2026 21:30:24 +0200 Subject: [PATCH 4/5] Revert "Add v0.3 to protocol versions in README" This reverts commit 97cdbd2ec4ba4f4bb0ef14dcbfe675f23efbf538. --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 1d5b9bad..a7a206b9 100644 --- a/README.md +++ b/README.md @@ -106,8 +106,7 @@ This repopulates the ignored generated TS under `js/packages/truapi/`, including ## Protocol versions - **v0.1**: initial protocol version. -- **v0.2**: See [`docs/design/v02-changes.md`](docs/design/v02-changes.md) for the rationale behind each change. -- **v0.3**: current protocol version. Adds the Favourites API ([RFC 0013](docs/rfcs/0013-favourites-api.md)). +- **v0.2**: current protocol version. See [`docs/design/v02-changes.md`](docs/design/v02-changes.md) for the rationale behind each change. ## Deploy From c842c66d481d8adb154f38033d1afe370420b370 Mon Sep 17 00:00:00 2001 From: Filippo Vecchiato Date: Fri, 5 Jun 2026 21:33:38 +0200 Subject: [PATCH 5/5] Add Favourites API trait, types, and RFC Introduce the `Favourites` trait with subscribe, add, and forget methods for managing the host's bookmarked-product catalogue. --- docs/rfcs/0013-favourites-api.md | 110 ++++++------------ rust/crates/truapi/src/api/favourites.rs | 73 ++++++++++++ rust/crates/truapi/src/api/mod.rs | 4 + rust/crates/truapi/src/v01/favourites.rs | 70 +++++++++++ rust/crates/truapi/src/v01/mod.rs | 2 + .../crates/truapi/src/versioned/favourites.rs | 31 +++++ rust/crates/truapi/src/versioned/mod.rs | 1 + 7 files changed, 218 insertions(+), 73 deletions(-) create mode 100644 rust/crates/truapi/src/api/favourites.rs create mode 100644 rust/crates/truapi/src/v01/favourites.rs create mode 100644 rust/crates/truapi/src/versioned/favourites.rs diff --git a/docs/rfcs/0013-favourites-api.md b/docs/rfcs/0013-favourites-api.md index fc0a4b37..8ffad800 100644 --- a/docs/rfcs/0013-favourites-api.md +++ b/docs/rfcs/0013-favourites-api.md @@ -1,26 +1,17 @@ -# RFC-0013: Favourites API +--- +title: "Favourites API" +owner: "@filippovecchiato" +--- -| | | -| --------------- | --------------------------------------------------------------- | -| **Start Date** | 2026-04-21 | -| **Description** | Let products read and manage the user's bookmarked apps | -| **Authors** | Filippo Vecchiato | +# RFC 0013 — Favourites API ## Summary -Products can query, add and remove bookmarked apps from the host's local product catalogue. The host exposes a subscription for the installed-product list and two mutations for adding/removing entries. Browse (the on-chain discovery product) receives privileged access without an explicit permission prompt, because it is the default discovery surface for users to find and manage products. +Products can query, add, and remove bookmarked apps from the host's local product catalogue. The host exposes a subscription for the bookmarked-product list and two mutations for adding/removing entries. ## Motivation -Hosts store data that products don't have access to but would benefit from. Bookmarked apps are one such example — some hosts maintain a local catalogue of products the user has bookmarked (starred), but this data is inaccessible to products. Browse — the primary discovery surface — cannot show which apps are already installed or let the user bookmark new ones without direct database access. - -Since DotNS is permissionless and anyone can publish a product, discovery is essential. Browse and other products should be able to help users find and keep track of apps that solve their problems. - -Exposing this catalogue: - -1. **Enables discovery UIs** — Browse can render install/uninstall affordances inline, showing which apps are already bookmarked and letting users add or remove them directly from the discovery surface. -2. **Keeps the host authoritative** — mutations go through the host, which owns the storage schema and can enforce invariants. -3. **Supports other products** — any product with permission can read the installed list (e.g. a dashboard, launcher, or analytics tool). Because DotNS is permissionless and anyone can publish a product, discovery tools beyond Browse may emerge and benefit from the same API. +Hosts maintain a local catalogue of products the user has bookmarked, but this data is inaccessible to products. Discovery surfaces like Browse cannot show which apps are already bookmarked or let the user add new ones without this API. ## Detailed Design @@ -28,87 +19,60 @@ Exposing this catalogue: ```rust struct FavouriteProduct { - product_id: DotNsIdentifier, - installed: bool, - source: ProductSource, - created_at: Timestamp, - updated_at: Timestamp + product_id: String, + source: FavouriteProductSource, + created_at: u64, + updated_at: u64, } -enum ProductSource { - Remote, // discovered via on-chain registry - Local // sideloaded or manually added +enum FavouriteProductSource { + Remote, + Local, } ``` -Exposing only the fields relevant to products, this mirrors the existing `ProductRecord` in the host's `products` table (see e.g. [polkadot-desktop products table](https://github.com/nickvdao/polkadot-desktop)). +`product_id` is a DotNS identifier. `source` distinguishes on-chain registry discoveries (`Remote`) from sideloaded entries (`Local`). Timestamps are Unix seconds. ### API -```rust -enum FavouritesErr { - NotConnected, - Rejected, - NotSupported, // host does not implement a favourites catalogue - Unknown(GenericErr) -} +Three methods on a `Favourites` trait: -fn host_favourites_subscribe( - callback: fn(Vec) -) -> Result; +**`subscribe`** — streams the full bookmarked-product list on each change. Hosts MAY debounce. -fn host_favourites_add( - product_id: DotNsIdentifier -) -> Result; +**`add`** — upserts a product with `source: Remote`, setting `created_at` on first add and `updated_at` on every call. Returns the resulting record. -fn host_favourites_forget( - product_id: DotNsIdentifier -) -> Result; -``` - -- `host_favourites_subscribe` delivers the full list on each callback; hosts MAY debounce. -- `host_favourites_add` upserts a `FavouriteProduct` with `source: Remote`, setting `created_at` on first install and `updated_at` on every call. Returns the resulting record. -- `host_favourites_forget` removes the product from the catalogue entirely. +**`forget`** — removes the product from the catalogue. -All methods require authentication (RFC-0009). - -### Permission Model +### Error Handling -Extends `DevicePermission` from RFC-0002: +Subscription errors and mutation errors use `CallError` with a domain enum: ```rust -enum DevicePermission { - // ... existing variants ... - Favourites +enum HostFavouritesSubscribeError { + Unknown { reason: String }, } -``` -| Permission | Grants | -|-----------|--------| -| `Favourites` | Read, add, and forget bookmarked products | +enum HostFavouritesAddError { + Unknown { reason: String }, +} -**Browse privilege:** The host MAY grant implicit `Favourites` to Browse (the built-in discovery product) without prompting. This is analogous to how Browse currently writes directly to the products table. +enum HostFavouritesForgetError { + NotFound, + Unknown { reason: String }, +} +``` -### Host Behaviour +Permission denial and unsupported-host cases are handled by `CallError::Denied` and `CallError::Unsupported`. -On `host_favourites_add`: -1. Upsert row in the products table with `installed: true`, `source: 'remote'`. -2. Set `created_at` if new, `updated_at` on every call. -3. Notify all active subscribers. +### Permission Model -On `host_favourites_forget`: -1. Delete the row from the products table. -2. Notify all active subscribers. +The host SHOULD prompt the user before granting a product access to the favourites catalogue. The host MAY grant implicit access to Browse (the built-in discovery product) without prompting. -The host SHOULD display a brief confirmation toast on install/forget for products other than Browse. +### Host Behaviour -Favourites are local to the host instance. Cross-host sync is out of scope for this RFC. +Favourites are local to the host instance. Cross-host sync is out of scope. ## Drawbacks - **Full-list delivery.** No pagination or filtered subscriptions. Acceptable for typical catalogue sizes (tens to low hundreds). -- **Browse coupling.** Implicit privilege for Browse assumes a well-known product identity. If Browse's DotNS identifier changes, the host must update its allowlist. - -## Unresolved Questions - -1. **Batch operations.** Should `host_favourites_add` accept multiple product IDs? +- **Browse coupling.** Implicit privilege for Browse assumes a well-known product identity. diff --git a/rust/crates/truapi/src/api/favourites.rs b/rust/crates/truapi/src/api/favourites.rs new file mode 100644 index 00000000..da8ff787 --- /dev/null +++ b/rust/crates/truapi/src/api/favourites.rs @@ -0,0 +1,73 @@ +//! Unified [`Favourites`] trait. + +use crate::versioned::favourites::{ + HostFavouritesAddError, HostFavouritesAddRequest, HostFavouritesAddResponse, + HostFavouritesForgetError, HostFavouritesForgetRequest, HostFavouritesSubscribeError, + HostFavouritesSubscribeItem, +}; +use crate::wire; +use crate::{CallContext, CallError, Subscription}; + +/// Bookmarked-product catalogue methods. +pub trait Favourites: Send + Sync { + /// Subscribe to the user's bookmarked products. + /// + /// ```ts + /// import { firstValueFrom, from } from "rxjs"; + /// + /// const favourites = await firstValueFrom( + /// from(truapi.favourites.subscribe()), + /// ); + /// console.log("favourites:", favourites); + /// ``` + #[wire(start_id = 164)] + async fn subscribe( + &self, + _cx: &CallContext, + ) -> Result< + Subscription, + CallError, + > { + Err(CallError::unavailable()) + } + + /// Add a product to the favourites catalogue. + /// + /// ```ts + /// const result = await truapi.favourites.add({ + /// productId: "some-product.dot", + /// }); + /// result.match( + /// (value) => console.log("added:", value), + /// (error) => console.error("add failed:", error), + /// ); + /// ``` + #[wire(request_id = 168)] + async fn add( + &self, + _cx: &CallContext, + _request: HostFavouritesAddRequest, + ) -> Result> { + Err(CallError::unavailable()) + } + + /// Remove a product from the favourites catalogue. + /// + /// ```ts + /// const result = await truapi.favourites.forget({ + /// productId: "some-product.dot", + /// }); + /// result.match( + /// () => console.log("forgotten"), + /// (error) => console.error("forget failed:", error), + /// ); + /// ``` + #[wire(request_id = 170)] + async fn forget( + &self, + _cx: &CallContext, + _request: HostFavouritesForgetRequest, + ) -> Result<(), CallError> { + Err(CallError::unavailable()) + } +} diff --git a/rust/crates/truapi/src/api/mod.rs b/rust/crates/truapi/src/api/mod.rs index 957509e4..b0c2040c 100644 --- a/rust/crates/truapi/src/api/mod.rs +++ b/rust/crates/truapi/src/api/mod.rs @@ -5,6 +5,7 @@ pub mod chain; pub mod chat; pub mod coin_payment; pub mod entropy; +pub mod favourites; pub mod local_storage; pub mod notifications; pub mod payment; @@ -21,6 +22,7 @@ pub use chain::Chain; pub use chat::Chat; pub use coin_payment::CoinPayment; pub use entropy::Entropy; +pub use favourites::Favourites; pub use local_storage::LocalStorage; pub use notifications::Notifications; pub use payment::Payment; @@ -39,6 +41,7 @@ pub trait TrUApi: + Chat + CoinPayment + Entropy + + Favourites + LocalStorage + Notifications + Payment @@ -60,6 +63,7 @@ impl TrUApi for T where + Chat + CoinPayment + Entropy + + Favourites + LocalStorage + Notifications + Payment diff --git a/rust/crates/truapi/src/v01/favourites.rs b/rust/crates/truapi/src/v01/favourites.rs new file mode 100644 index 00000000..97786a40 --- /dev/null +++ b/rust/crates/truapi/src/v01/favourites.rs @@ -0,0 +1,70 @@ +use parity_scale_codec::{Decode, Encode}; + +/// How a product entered the favourites catalogue. +#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode)] +pub enum FavouriteProductSource { + /// Discovered via the on-chain registry. + Remote, + /// Sideloaded or manually added. + Local, +} + +/// A bookmarked product in the host's local catalogue. +#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode)] +pub struct FavouriteProduct { + /// DotNS identifier of the product. + pub product_id: String, + /// How the product was added. + pub source: FavouriteProductSource, + /// Unix timestamp (seconds) when first bookmarked. + pub created_at: u64, + /// Unix timestamp (seconds) of the most recent update. + pub updated_at: u64, +} + +/// Request to add a product to the favourites catalogue. +#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode)] +pub struct HostFavouritesAddRequest { + /// DotNS identifier of the product to add. + pub product_id: String, +} + +/// Response after adding a product to favourites. +#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode)] +pub struct HostFavouritesAddResponse { + /// The resulting catalogue entry. + pub product: FavouriteProduct, +} + +/// Request to remove a product from the favourites catalogue. +#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode)] +pub struct HostFavouritesForgetRequest { + /// DotNS identifier of the product to remove. + pub product_id: String, +} + +/// Error from [`crate::api::Favourites::subscribe`]. +#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode)] +pub enum HostFavouritesSubscribeError { + /// Catch-all. + Unknown { reason: String }, +} + +/// Error from [`crate::api::Favourites::add`]. +#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode)] +pub enum HostFavouritesAddError { + /// Catch-all. + Unknown { reason: String }, +} + +/// Error from [`crate::api::Favourites::forget`]. +#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode)] +pub enum HostFavouritesForgetError { + /// The product was not in the catalogue. + NotFound, + /// Catch-all. + Unknown { reason: String }, +} + +/// Item pushed to favourites subscribers: the full list of bookmarked products. +pub type HostFavouritesSubscribeItem = Vec; diff --git a/rust/crates/truapi/src/v01/mod.rs b/rust/crates/truapi/src/v01/mod.rs index 8b34df5a..9150a8ea 100644 --- a/rust/crates/truapi/src/v01/mod.rs +++ b/rust/crates/truapi/src/v01/mod.rs @@ -6,6 +6,7 @@ mod chat; mod coin_payment; mod common; mod entropy; +mod favourites; mod local_storage; mod notifications; mod payment; @@ -24,6 +25,7 @@ pub use chat::*; pub use coin_payment::*; pub use common::*; pub use entropy::*; +pub use favourites::*; pub use local_storage::*; pub use notifications::*; pub use payment::*; diff --git a/rust/crates/truapi/src/versioned/favourites.rs b/rust/crates/truapi/src/versioned/favourites.rs new file mode 100644 index 00000000..28bd37d6 --- /dev/null +++ b/rust/crates/truapi/src/versioned/favourites.rs @@ -0,0 +1,31 @@ +//! Versioned wrappers for [`Favourites`](crate::api::Favourites) methods. + +use crate::v01; + +truapi_macros::versioned_type! { + pub enum HostFavouritesSubscribeItem { V1 => v01::HostFavouritesSubscribeItem } +} + +truapi_macros::versioned_type! { + pub enum HostFavouritesSubscribeError { V1 => v01::HostFavouritesSubscribeError } +} + +truapi_macros::versioned_type! { + pub enum HostFavouritesAddRequest { V1 => v01::HostFavouritesAddRequest } +} + +truapi_macros::versioned_type! { + pub enum HostFavouritesAddResponse { V1 => v01::HostFavouritesAddResponse } +} + +truapi_macros::versioned_type! { + pub enum HostFavouritesAddError { V1 => v01::HostFavouritesAddError } +} + +truapi_macros::versioned_type! { + pub enum HostFavouritesForgetRequest { V1 => v01::HostFavouritesForgetRequest } +} + +truapi_macros::versioned_type! { + pub enum HostFavouritesForgetError { V1 => v01::HostFavouritesForgetError } +} diff --git a/rust/crates/truapi/src/versioned/mod.rs b/rust/crates/truapi/src/versioned/mod.rs index 9da72067..ff0e4569 100644 --- a/rust/crates/truapi/src/versioned/mod.rs +++ b/rust/crates/truapi/src/versioned/mod.rs @@ -35,6 +35,7 @@ pub mod chain; pub mod chat; pub mod coin_payment; pub mod entropy; +pub mod favourites; pub mod local_storage; pub mod notifications; pub mod payment;