Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
AdmittanceInstructions |
LookupQuestion |
LookupResolverConfig |
OverlayBroadcastFacilitator |
OverlayLookupFacilitator |
SHIPBroadcasterConfig |
TaggedBEEF |
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Instructs the Overlay Services Engine about which outputs to admit and which previous outputs to retain. Returned by a Topic Manager.
export interface AdmittanceInstructions {
outputsToAdmit: number[];
coinsToRetain: number[];
coinsRemoved?: number[];
}
The indices of all inputs from the provided transaction which reference previously-admitted outputs, which are now considered spent and have been removed from the managed topic.
coinsRemoved?: number[]
The indices of all inputs from the provided transaction which spend previously-admitted outputs that should be retained for historical record-keeping.
coinsToRetain: number[]
The indices of all admissible outputs into the managed topic from the provided transaction.
outputsToAdmit: number[]
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
The question asked to the Overlay Services Engine when a consumer of state wishes to look up information.
export interface LookupQuestion {
service: string;
query: unknown;
}
The query which will be forwarded to the Lookup Service. Its type depends on that prescribed by the Lookup Service employed.
query: unknown
The identifier for a Lookup Service which the person asking the question wishes to use.
service: string
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Configuration options for the Lookup resolver.
export interface LookupResolverConfig {
facilitator?: OverlayLookupFacilitator;
slapTrackers?: string[];
hostOverrides?: Record<string, string[]>;
additionalHosts?: Record<string, string[]>;
}
See also: OverlayLookupFacilitator
Map of lookup service names to arrays of hosts to use in addition to resolving via SLAP.
additionalHosts?: Record<string, string[]>
The facilitator used to make requests to Overlay Services hosts.
facilitator?: OverlayLookupFacilitator
See also: OverlayLookupFacilitator
Map of lookup service names to arrays of hosts to use in place of resolving via SLAP.
hostOverrides?: Record<string, string[]>
The list of SLAP trackers queried to resolve Overlay Services hosts for a given lookup service.
slapTrackers?: string[]
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Facilitates transaction broadcasts that return STEAK.
export interface OverlayBroadcastFacilitator {
send: (url: string, taggedBEEF: TaggedBEEF) => Promise<STEAK>;
}
See also: STEAK, TaggedBEEF
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Facilitates lookups to URLs that return answers.
export interface OverlayLookupFacilitator {
lookup: (url: string, question: LookupQuestion, timeout?: number) => Promise<LookupAnswer>;
}
See also: LookupAnswer, LookupQuestion
Returns a lookup answer for a lookup question
lookup: (url: string, question: LookupQuestion, timeout?: number) => Promise<LookupAnswer>
See also: LookupAnswer, LookupQuestion
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Configuration options for the SHIP broadcaster.
export interface SHIPBroadcasterConfig {
facilitator?: OverlayBroadcastFacilitator;
resolver: LookupResolver;
requireAcknowledgmentFromAllHostsForTopics?: "all" | "any" | string[];
requireAcknowledgmentFromAnyHostForTopics?: "all" | "any" | string[];
requireAcknowledgmentFromSpecificHostsForTopics?: Record<string, "all" | "any" | string[]>;
}
See also: LookupResolver, OverlayBroadcastFacilitator
The facilitator used to make requests to Overlay Services hosts.
facilitator?: OverlayBroadcastFacilitator
See also: OverlayBroadcastFacilitator
Determines which topics (all, any, or a specific list) must be present within all STEAKs received from every host for the broadcast to be considered a success. By default, all hosts must acknowledge all topics.
requireAcknowledgmentFromAllHostsForTopics?: "all" | "any" | string[]
Determines which topics (all, any, or a specific list) must be present within STEAK received from at least one host for the broadcast to be considered a success.
requireAcknowledgmentFromAnyHostForTopics?: "all" | "any" | string[]
Determines a mapping whose keys are specific hosts and whose values are the topics (all, any, or a specific list) that must be present within the STEAK received by the given hosts, in order for the broadcast to be considered a success.
requireAcknowledgmentFromSpecificHostsForTopics?: Record<string, "all" | "any" | string[]>
The resolver used to locate suitable hosts with SHIP
resolver: LookupResolver
See also: LookupResolver
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Tagged BEEF
export interface TaggedBEEF {
beef: number[];
topics: string[];
}
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
HTTPSOverlayBroadcastFacilitator |
HTTPSOverlayLookupFacilitator |
LookupResolver |
OverlayAdminTokenTemplate |
SHIPCast |
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
export class HTTPSOverlayBroadcastFacilitator implements OverlayBroadcastFacilitator {
httpClient: typeof fetch;
constructor(httpClient = fetch)
async send(url: string, taggedBEEF: TaggedBEEF): Promise<STEAK>
}
See also: OverlayBroadcastFacilitator, STEAK, TaggedBEEF
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
export class HTTPSOverlayLookupFacilitator implements OverlayLookupFacilitator {
fetchClient: typeof fetch;
constructor(httpClient = fetch)
async lookup(url: string, question: LookupQuestion, timeout: number = 5000): Promise<LookupAnswer>
}
See also: LookupAnswer, LookupQuestion, OverlayLookupFacilitator
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Represents an SHIP transaction broadcaster.
export default class LookupResolver {
constructor(config?: LookupResolverConfig)
async query(question: LookupQuestion, timeout?: number): Promise<LookupAnswer>
}
See also: LookupAnswer, LookupQuestion, LookupResolverConfig
Given a LookupQuestion, returns a LookupAnswer. Aggregates across multiple services and supports resiliency.
async query(question: LookupQuestion, timeout?: number): Promise<LookupAnswer>
See also: LookupAnswer, LookupQuestion
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Script template enabling the creation, unlocking, and decoding of SHIP and SLAP advertisements.
export default class OverlayAdminTokenTemplate implements ScriptTemplate {
pushDrop: PushDrop;
static decode(script: LockingScript): {
protocol: "SHIP" | "SLAP";
identityKey: string;
domain: string;
topicOrService: string;
}
constructor(wallet: WalletInterface)
async lock(protocol: "SHIP" | "SLAP", domain: string, topicOrService: string): Promise<LockingScript>
unlock(protocol: "SHIP" | "SLAP"): {
sign: (tx: Transaction, inputIndex: number) => Promise<UnlockingScript>;
estimateLength: (tx: Transaction, inputIndex: number) => Promise<number>;
}
}
See also: LockingScript, PushDrop, ScriptTemplate, Transaction, UnlockingScript, WalletInterface, sign
Constructs a new Overlay Admin template instance
constructor(wallet: WalletInterface)
See also: WalletInterface
Argument Details
Decodes a SHIP or SLAP advertisement from a given locking script.
static decode(script: LockingScript): {
protocol: "SHIP" | "SLAP";
identityKey: string;
domain: string;
topicOrService: string;
}
See also: LockingScript
Returns
Decoded SHIP or SLAP advertisement
Argument Details
Creates a new advertisement locking script
async lock(protocol: "SHIP" | "SLAP", domain: string, topicOrService: string): Promise<LockingScript>
See also: LockingScript
Returns
Locking script comprising the advertisement token
Argument Details
Unlocks an advertisement token as part of a transaction.
unlock(protocol: "SHIP" | "SLAP"): {
sign: (tx: Transaction, inputIndex: number) => Promise<UnlockingScript>;
estimateLength: (tx: Transaction, inputIndex: number) => Promise<number>;
}
See also: Transaction, UnlockingScript, sign
Returns
Script unlocker capable of unlocking the advertisement token
Argument Details
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Represents a SHIP transaction broadcaster.
export default class SHIPCast implements Broadcaster {
constructor(topics: string[], config?: SHIPBroadcasterConfig)
async broadcast(tx: Transaction): Promise<BroadcastResponse | BroadcastFailure>
}
See also: BroadcastFailure, BroadcastResponse, Broadcaster, SHIPBroadcasterConfig, Transaction
Constructs an instance of the SHIP broadcaster.
constructor(topics: string[], config?: SHIPBroadcasterConfig)
See also: SHIPBroadcasterConfig
Argument Details
Broadcasts a transaction to Overlay Services via SHIP.
async broadcast(tx: Transaction): Promise<BroadcastResponse | BroadcastFailure>
See also: BroadcastFailure, BroadcastResponse, Transaction
Returns
A promise that resolves to either a success or failure response.
Argument Details
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
LookupAnswer |
STEAK |
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
How the Overlay Services Engine responds to a Lookup Question. It may comprise either an output list or a freeform response from the Lookup Service.
export type LookupAnswer = {
type: "output-list";
outputs: Array<{
beef: number[];
outputIndex: number;
}>;
} | {
type: "freeform";
result: unknown;
}
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Submitted Transaction Execution AcKnowledgment
export type STEAK = Record<string, AdmittanceInstructions>
See also: AdmittanceInstructions
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
DEFAULT_SLAP_TRACKERS: string[] = [
"https://overlay.babbage.systems",
"https://overlay-example.babbage.systems",
"https://office.babbage.systems"
]
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables