API
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interfaces
BasketDefinitionData |
BasketQuery |
CertificateDefinitionData |
CertificateFieldDescriptor |
CertificateQuery |
ProtocolDefinitionData |
ProtocolQuery |
RegistryQueryMapping |
TokenData |
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: BasketDefinitionData
Registry data for a Basket-style record.
export interface BasketDefinitionData {
definitionType: "basket";
basketID: string;
name: string;
iconURL: string;
description: string;
documentationURL: string;
registryOperator?: PubKeyHex;
}
See also: PubKeyHex
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: BasketQuery
When searching for basket definitions, we can filter by: - basketID - registryOperators - name
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: CertificateDefinitionData
Registry data for a Certificate-style record.
export interface CertificateDefinitionData {
definitionType: "certificate";
type: string;
name: string;
iconURL: string;
description: string;
documentationURL: string;
fields: Record<string, CertificateFieldDescriptor>;
registryOperator?: PubKeyHex;
}
See also: CertificateFieldDescriptor, PubKeyHex
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: CertificateFieldDescriptor
Describes a re-usable structure for certificate fields (used by CertMap).
export interface CertificateFieldDescriptor {
friendlyName: string;
description: string;
type: "text" | "imageURL" | "other";
fieldIcon: string;
}
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: CertificateQuery
When searching for certificate definitions, we can filter by: - type - name - registryOperators
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: ProtocolDefinitionData
Registry data for a Protocol-style record.
export interface ProtocolDefinitionData {
definitionType: "protocol";
protocolID: WalletProtocol;
name: string;
iconURL: string;
description: string;
documentationURL: string;
registryOperator?: PubKeyHex;
}
See also: PubKeyHex, WalletProtocol
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: ProtocolQuery
When searching for protocol definitions, we can filter by: - name - registryOperators - protocolID
export interface ProtocolQuery {
name?: string;
registryOperators?: string[];
protocolID?: WalletProtocol;
}
See also: WalletProtocol
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: RegistryQueryMapping
A lookup-service mapping of queries by each definition type.
export interface RegistryQueryMapping {
basket: BasketQuery;
protocol: ProtocolQuery;
certificate: CertificateQuery;
}
See also: BasketQuery, CertificateQuery, ProtocolQuery
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: TokenData
Common info for the on-chain token/UTXO that points to a registry entry.
export interface TokenData {
txid: string;
outputIndex: number;
satoshis: number;
lockingScript: string;
beef: BEEF;
}
See also: BEEF
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Classes
Class: RegistryClient
RegistryClient manages on-chain registry definitions for three types: - basket (basket-based items) - protocol (protocol-based items) - certificate (certificate-based items)
It provides methods to: - Register new definitions using pushdrop-based UTXOs. - Resolve existing definitions using a lookup service. - List registry entries associated with the operator's wallet. - Revoke an existing registry entry by spending its UTXO.
Registry operators use this client to establish and manage canonical references for baskets, protocols, and certificate types.
export class RegistryClient {
constructor(private readonly wallet: WalletInterface = new WalletClient())
async registerDefinition(data: DefinitionData): Promise<BroadcastResponse | BroadcastFailure>
async resolve<T extends DefinitionType>(definitionType: T, query: RegistryQueryMapping[T]): Promise<DefinitionData[]>
async listOwnRegistryEntries(definitionType: DefinitionType): Promise<RegistryRecord[]>
async revokeOwnRegistryEntry(registryRecord: RegistryRecord): Promise<BroadcastResponse | BroadcastFailure>
}
See also: BroadcastFailure, BroadcastResponse, DefinitionData, DefinitionType, RegistryQueryMapping, RegistryRecord, WalletClient, WalletInterface
Method listOwnRegistryEntries
Lists the registry operator's published definitions for the given type.
Returns parsed registry records including transaction details such as txid, outputIndex, satoshis, and the locking script.
See also: DefinitionType, RegistryRecordReturns
A promise that resolves to an array of RegistryRecord objects.
Argument Details
- definitionType
- The type of registry definition to list ('basket', 'protocol', or 'certificate').
Method registerDefinition
Publishes a new on-chain definition for baskets, protocols, or certificates. The definition data is encoded in a pushdrop-based UTXO.
Registry operators (i.e., identity key owners) can create these definitions to establish canonical references for basket IDs, protocol specs, or certificate schemas.
See also: BroadcastFailure, BroadcastResponse, DefinitionDataReturns
A promise with the broadcast result or failure.
Argument Details
- data
- Structured information about a 'basket', 'protocol', or 'certificate'.
Method resolve
Resolves registrant tokens of a particular type using a lookup service.
The query object shape depends on the registry type: - For "basket", the query is of type BasketMapQuery: { basketID?: string; name?: string; registryOperators?: string[]; } - For "protocol", the query is of type ProtoMapQuery: { name?: string; registryOperators?: string[]; protocolID?: WalletProtocol; } - For "certificate", the query is of type CertMapQuery: { type?: string; name?: string; registryOperators?: string[]; }
async resolve<T extends DefinitionType>(definitionType: T, query: RegistryQueryMapping[T]): Promise<DefinitionData[]>
Returns
A promise that resolves to an array of matching registry records.
Argument Details
- definitionType
- The registry type, which can be 'basket', 'protocol', or 'certificate'.
- query
- The query object used to filter registry records, whose shape is determined by the registry type.
Method revokeOwnRegistryEntry
Revokes a registry record by spending its associated UTXO.
async revokeOwnRegistryEntry(registryRecord: RegistryRecord): Promise<BroadcastResponse | BroadcastFailure>
Returns
Broadcast success/failure.
Argument Details
- registryRecord
- Must have valid txid, outputIndex, and lockingScript.
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Functions
Function: deserializeWalletProtocol
See also: WalletProtocol
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Types
DefinitionData |
DefinitionType |
RegistryRecord |
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: DefinitionData
Union of all possible definition data objects.
export type DefinitionData = BasketDefinitionData | ProtocolDefinitionData | CertificateDefinitionData
See also: BasketDefinitionData, CertificateDefinitionData, ProtocolDefinitionData
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: DefinitionType
We unify the registry “type” to these three strings everywhere: 'basket' | 'protocol' | 'certificate'
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: RegistryRecord
A registry record is a combination of the typed definition data plus the on-chain token data for the UTXO holding it.
See also: DefinitionData, TokenData
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables