-
Notifications
You must be signed in to change notification settings - Fork 3
/
global.d.ts
38 lines (36 loc) · 1.1 KB
/
global.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// CIP-0030
export type WalletApi = {
getNetworkId(): Promise<number>;
getUtxos(): Promise<string[] | undefined>;
getBalance(): Promise<string>;
getUsedAddresses(): Promise<string[]>;
getUnusedAddresses(): Promise<string[]>;
getChangeAddress(): Promise<string>;
getRewardAddresses(): Promise<string[]>;
signTx(tx: string, partialSign: boolean): Promise<string>;
signData(
address: string,
payload: string,
): Promise<{ signature: string; key: string }>;
submitTx(tx: string): Promise<string>;
getCollateral(): Promise<string[]>;
experimental: {
getCollateral(): Promise<string[]>;
on(eventName: string, callback: (...args: unknown[]) => void): void;
off(eventName: string, callback: (...args: unknown[]) => void): void;
};
};
export type Cardano = {
[key: string]: {
name: string;
icon: string;
version: string;
enable(): Promise<WalletApi>;
isEnabled(): Promise<boolean>;
};
};
declare global {
interface Window {
cardano: Cardano;
}
}