@eternl/cardano-dapp-connector-bridge
Version:
A postMessage bridge to connect dApps to the Eternl DApp Browser loading apps into an iframe.
32 lines (31 loc) • 670 B
TypeScript
declare global {
interface Window {
cardano: any;
}
}
export interface IBridge {
type: string;
source: Window | null;
origin: string | null;
}
export interface IBridgeRequestPayload {
type: string;
to: string;
uid: string;
method: string;
args: any[];
walletNamespace?: string;
initialApi?: any;
response?: any;
error?: any;
}
export interface IBridgeRequestEvent extends MessageEvent {
data: IBridgeRequestPayload;
source: Window;
origin: string;
}
export interface IBridgeRequest {
payload: IBridgeRequestPayload;
resolve: (value?: any) => void;
reject: (reason?: any) => void;
}