Skip to main content

Crate host_extensions

Crate host_extensions 

Source
Expand description

host-extensions — extension framework for the Polkadot app host bridge.

Extensions live under window.host.ext.<namespace> in the SPA WebView. First-party extensions reuse the core hostBridge channel and __hostCall / __hostResolve / __hostPush plumbing — they only contribute a JS injection script that populates window.host.ext.*.

§Implementing an extension

  1. Implement HostExtension — provide a namespace, a channel name, a JS injection script, and a message handler.
  2. Register the extension with an ExtensionRegistry.
  3. Call ExtensionRegistry::combined_inject_script and inject the result after HOST_API_BRIDGE_SCRIPT.

See the extensions guide for the full lifecycle, the JS contract, and the graduation path from ext.* to core.

Re-exports§

pub use first_party::crdt::CrdtExtension;
pub use first_party::crdt_runtime::CrdtRuntime;
pub use first_party::crdt_runtime::CrdtRuntimeError;
pub use first_party::crdt_runtime::InMemoryCrdtRuntime;
pub use first_party::data::DataExtension;
pub use first_party::media::MediaExtension;
pub use first_party::mesh::MeshExtension;
pub use first_party::mesh_runtime::current_time_ms;
pub use first_party::mesh_runtime::generate_session_nonce;
pub use first_party::mesh_runtime::private_object_result;
pub use first_party::mesh_runtime::InMemoryMeshConfig;
pub use first_party::mesh_runtime::InMemoryMeshRuntime;
pub use first_party::mesh_runtime::MeshPrivateControlWireMessage;
pub use first_party::mesh_runtime::MeshPrivateReceiptWireMessage;
pub use first_party::mesh_runtime::MeshPrivateWireQuery;
pub use first_party::mesh_runtime::MeshRuntime;
pub use first_party::mesh_runtime::MeshWireQuery;
pub use first_party::mesh_runtime::MeshWireReply;
pub use first_party::mesh_runtime::StoredMeshObject;
pub use first_party::mesh_runtime::StoredPrivateMeshObject;
pub use first_party::mesh_runtime::MESH_PRIVATE_CONTROL_CHANNEL;
pub use first_party::mesh_runtime::MESH_PRIVATE_QUERY_CHANNEL;
pub use first_party::mesh_runtime::MESH_PRIVATE_RECEIPT_CHANNEL;
pub use first_party::mesh_runtime::MESH_QUERY_CHANNEL;
pub use first_party::mesh_runtime::MESH_REPLY_CHANNEL;
pub use registry::ExtensionRegistry;

Modules§

events
Canonical event names and payload types for __hostPush events.
executor_contract
Executor contract — canonical response types and error constants for window.host.* bridge calls.
first_party
First-party extensions shipped with host-sdk.
manifest
protocol
Media & data signaling protocol constants.
registry
trait_def

Structs§

FilesExtension
HostPushEvent

Traits§

HostExtension
A host extension contributes a JS injection script and a message handler.