-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
72 lines (64 loc) · 1.96 KB
/
types.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
export type HexString = string;
export interface CIP30Provider {
apiVersion: string;
enable: () => Promise<CIP30Instance | Cip95Instance>;
icon: string;
isEnabled: () => Promise<Boolean>;
name: string;
supportedExtensions: Record<string, number>[];
}
interface DataSignature {
signature: HexString;
key: HexString;
}
export interface CIP30Instance {
submitTx: (tx: string) => Promise<string>;
signTx: (tx: string, partial?: Boolean) => Promise<HexString>;
getChangeAddress: () => Promise<HexString>;
getNetworkId: () => Promise<number>;
getRewardAddresses: () => Promise<HexString[]>;
getUnusedAddresses: () => Promise<HexString[]>;
getUsedAddresses: () => Promise<Array<HexString>>;
getUtxos: (amount?: object, paginate?: any) => Promise<Array<HexString>>;
getCollateral?: () => Promise<Array<HexString>>;
signData: (address: HexString, payload: HexString) => Promise<DataSignature>;
getBalance: () => Promise<string>;
}
export interface Cip95Instance extends CIP30Instance {
cip95: {
getPubDRepKey: () => Promise<HexString>;
getUnregisteredPubStakeKeys: () => Promise<HexString[]>;
getRegisteredPubStakeKeys: () => Promise<HexString[]>;
};
getActivePubStakeKeys: () => Promise<HexString[]>;
getExtensions: () => Record<string, number>[];
}
export type CardanoTestWalletJson = {
payment: {
private: string;
public: string;
pkh: string;
};
stake: {
private: string;
public: string;
pkh: string;
};
};
export type CardanoTestWallet = {
walletName: string;
supportedExtensions?: Record<string, number>[];
wallet?: CardanoTestWalletJson;
config?: CardanoTestWalletConfig;
};
export type CardanoTestWalletConfig = {
networkId?: number;
enableStakeSigning?: boolean;
extraRegisteredPubStakeKeys?: string[];
extraRewardAddresses?: string[];
kuberApiUrl?: string;
kuberApiKey?: string;
};
export type KuberValue = {
[policyId: string]: Record<string, BigInt | number> | BigInt | number;
};