Reference
Source-accurate API reference for @glyph-oss/connect 4.0.1.
Reference
This section documents the public entry point of @glyph-oss/connect 4.0.1. The package is a framework-agnostic ESM SDK for building Glyph Wallet v2 requests, encoding envelopes, launching the wallet, and validating returned results.
Start here
- Request builders: construct typed
transfer,sc_call,sign_message,verify_message, andconnectrequests. - Envelopes and URLs: bind a request to delivery URLs and a Qubic network, then build a
glyph://v2/requestURL. - Results and callback envelopes: parse result unions and strictly verify signed callback envelopes.
- Relay v2: prepare a registered session and subscribe to its read-only SSE stream.
Public contract
The package exports one module, @glyph-oss/connect. Request and callback objects are plain JSON-compatible values. Browser launch helpers use window, while parsing, hashing, envelope construction, and relay URL helpers can run in Node 18+ or Bun.
For the final dApp-side Qubic callback check, pair the SDK with @qubic.org/crypto@1.0.0. The Wallet signs after user approval; the dApp uses that package's k12 and verify functions to verify the returned proof.
The v2 constants are:
| Constant | Value |
|---|---|
GLYPH_DEEP_LINK_PREFIX | glyph://v2/request |
GLYPH_REQUEST_ENVELOPE_PROTOCOL | glyph-connect-request/2 |
GLYPH_CALLBACK_ENVELOPE_VERSION | glyph-connect-callback-envelope/2 |
GLYPH_CALLBACK_SIGNATURE_ALGORITHM | qubic-schnorrq-sha256 |
DEFAULT_GLYPH_CALLBACK_PATH | /__glyph__ |
DEFAULT_RELAY_URL | https://relay.glyphq.org |
The SDK does not silently accept an unknown request type, callback status, callback type, network binding, or signed payload binding. Treat parser and verifier errors as rejected input.
