@rubanrubi/hardhat-dashboard 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +173 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +10 -0
- package/dist/plugin.js +123 -0
- package/dist/plugin.js.map +1 -0
- package/dist/server/artifacts.d.ts +10 -0
- package/dist/server/artifacts.js +191 -0
- package/dist/server/artifacts.js.map +1 -0
- package/dist/server/proxy.d.ts +15 -0
- package/dist/server/proxy.js +306 -0
- package/dist/server/proxy.js.map +1 -0
- package/dist/server/queue.d.ts +50 -0
- package/dist/server/queue.js +179 -0
- package/dist/server/queue.js.map +1 -0
- package/dist/types/config.d.ts +21 -0
- package/dist/types/config.js +14 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/rpc.d.ts +113 -0
- package/dist/types/rpc.js +10 -0
- package/dist/types/rpc.js.map +1 -0
- package/dist/ui/app.js +25008 -0
- package/dist/ui/app.js.map +7 -0
- package/dist/ui/index.html +13 -0
- package/dist/ui/styles.css +371 -0
- package/package.json +60 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export type JsonRpcId = string | number | null;
|
|
2
|
+
export interface JsonRpcRequest {
|
|
3
|
+
jsonrpc: '2.0';
|
|
4
|
+
id: JsonRpcId;
|
|
5
|
+
method: string;
|
|
6
|
+
params?: unknown[] | Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
export interface JsonRpcErrorObject {
|
|
9
|
+
code: number;
|
|
10
|
+
message: string;
|
|
11
|
+
data?: unknown;
|
|
12
|
+
}
|
|
13
|
+
export interface JsonRpcSuccessResponse {
|
|
14
|
+
jsonrpc: '2.0';
|
|
15
|
+
id: JsonRpcId;
|
|
16
|
+
result: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface JsonRpcErrorResponse {
|
|
19
|
+
jsonrpc: '2.0';
|
|
20
|
+
id: JsonRpcId;
|
|
21
|
+
error: JsonRpcErrorObject;
|
|
22
|
+
}
|
|
23
|
+
export type JsonRpcResponse = JsonRpcSuccessResponse | JsonRpcErrorResponse;
|
|
24
|
+
export interface DecodedContractCall {
|
|
25
|
+
matched: boolean;
|
|
26
|
+
selector?: string;
|
|
27
|
+
contractName?: string;
|
|
28
|
+
functionName?: string;
|
|
29
|
+
signature?: string;
|
|
30
|
+
args: string[];
|
|
31
|
+
}
|
|
32
|
+
export interface PendingRpcRequest {
|
|
33
|
+
queueId: string;
|
|
34
|
+
rpcId: JsonRpcId;
|
|
35
|
+
method: string;
|
|
36
|
+
params: unknown[] | Record<string, unknown> | undefined;
|
|
37
|
+
requiresApproval: boolean;
|
|
38
|
+
status: 'pending' | 'processing';
|
|
39
|
+
createdAt: string;
|
|
40
|
+
timeoutAt: string;
|
|
41
|
+
decodedCall?: DecodedContractCall;
|
|
42
|
+
}
|
|
43
|
+
export interface HistoryRpcEntry {
|
|
44
|
+
queueId: string;
|
|
45
|
+
rpcId: JsonRpcId;
|
|
46
|
+
method: string;
|
|
47
|
+
createdAt: string;
|
|
48
|
+
completedAt: string;
|
|
49
|
+
status: 'confirmed' | 'rejected' | 'failed' | 'expired';
|
|
50
|
+
decodedCall?: DecodedContractCall;
|
|
51
|
+
result?: unknown;
|
|
52
|
+
error?: JsonRpcErrorObject;
|
|
53
|
+
}
|
|
54
|
+
export interface WalletConnectionState {
|
|
55
|
+
available: boolean;
|
|
56
|
+
connected: boolean;
|
|
57
|
+
locked: boolean;
|
|
58
|
+
walletName: string;
|
|
59
|
+
account?: string;
|
|
60
|
+
chainId?: string;
|
|
61
|
+
networkName?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface DashboardSnapshot {
|
|
64
|
+
pending: PendingRpcRequest[];
|
|
65
|
+
history: HistoryRpcEntry[];
|
|
66
|
+
wallet: WalletConnectionState;
|
|
67
|
+
browserConnected: boolean;
|
|
68
|
+
updatedAt: string;
|
|
69
|
+
}
|
|
70
|
+
export interface ArtifactPayload {
|
|
71
|
+
contractName: string;
|
|
72
|
+
sourceName?: string;
|
|
73
|
+
abi: readonly unknown[];
|
|
74
|
+
bytecode?: string;
|
|
75
|
+
deployedBytecode?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface ArtifactUploadRequest {
|
|
78
|
+
artifacts: ArtifactPayload[];
|
|
79
|
+
}
|
|
80
|
+
export type DashboardClientMessage = {
|
|
81
|
+
type: 'hello';
|
|
82
|
+
} | {
|
|
83
|
+
type: 'wallet_status';
|
|
84
|
+
payload: WalletConnectionState;
|
|
85
|
+
} | {
|
|
86
|
+
type: 'request_processing';
|
|
87
|
+
payload: {
|
|
88
|
+
queueId: string;
|
|
89
|
+
};
|
|
90
|
+
} | {
|
|
91
|
+
type: 'rpc_result';
|
|
92
|
+
payload: {
|
|
93
|
+
queueId: string;
|
|
94
|
+
result: unknown;
|
|
95
|
+
};
|
|
96
|
+
} | {
|
|
97
|
+
type: 'rpc_error';
|
|
98
|
+
payload: {
|
|
99
|
+
queueId: string;
|
|
100
|
+
error: JsonRpcErrorObject;
|
|
101
|
+
};
|
|
102
|
+
} | {
|
|
103
|
+
type: 'reject_request';
|
|
104
|
+
payload: {
|
|
105
|
+
queueId: string;
|
|
106
|
+
error?: JsonRpcErrorObject;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
export type DashboardServerMessage = {
|
|
110
|
+
type: 'snapshot';
|
|
111
|
+
payload: DashboardSnapshot;
|
|
112
|
+
};
|
|
113
|
+
export declare const EMPTY_WALLET_STATE: WalletConnectionState;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EMPTY_WALLET_STATE = void 0;
|
|
4
|
+
exports.EMPTY_WALLET_STATE = {
|
|
5
|
+
available: false,
|
|
6
|
+
connected: false,
|
|
7
|
+
locked: false,
|
|
8
|
+
walletName: 'MetaMask',
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=rpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.js","sourceRoot":"","sources":["../../src/types/rpc.ts"],"names":[],"mappings":";;;AAyGa,QAAA,kBAAkB,GAA0B;IACvD,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,UAAU;CACvB,CAAC"}
|