-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSafeTypes.ts
159 lines (145 loc) · 3.25 KB
/
SafeTypes.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
import { SafeMultisigTransactionResponse } from "@safe-global/types-kit";
export interface SafeMultisigConfirmation {
owner: string;
submissionDate: string;
transactionHash?: string;
signature: string;
signatureType?: string;
}
export interface SafeMultisigTransaction {
safe: string;
to: string;
value: string;
data?: string;
nonce: number;
submissionDate: string;
executionDate: string;
safeTxHash: string;
transactionHash: string;
origin: string;
dataDecoded: {
method: string;
parameters: object[];
} | null;
isExecuted: boolean;
confirmations?: SafeMultisigConfirmation[];
}
export interface SafeMultisigTransactionRequest {
address: string;
limit?: number;
offset?: number;
nonceGte?: number;
}
export interface SafeTransactionPartial {
to: string;
value: number;
data: string;
nonce: string;
}
export interface QueueSafeTransaction extends SafeTransactionPartial {
address: string;
safeTxGas: string;
transactionHash: string;
signature: string;
}
export interface SafeBalanceUsdResponseItem {
balance: string;
fiatBalance: string;
fiatConversion: string;
tokenInfo: {
address: string;
decimals: number;
logoUri: string;
name: string;
symbol: string;
type: "NATIVE_TOKEN" | "ERC20";
};
}
export interface SafeBalanceUsdResponse {
fiatTotal: string;
items: SafeBalanceUsdResponseItem[];
}
export interface SafeInfoResponse {
address: {
value: string;
};
nonce: number;
chainId: string;
threshold: number;
owners: { value: string }[];
modules: string[] | null;
fallbackHandler: {
name: string;
value: string;
};
version: string;
}
export interface SafeDelegatesResponse {
count: number;
results: SafeDelegateResponse[];
}
export interface SafeDelegateResponse {
delegate: string;
delegator: string;
safe: string;
label: string;
}
export type RevisedSafeMultisigTransactionResponse = Omit<
SafeMultisigTransactionResponse,
"dataDecoded"
> & {
dataDecoded: {
method: string;
parameters: {
name: string;
type: string;
value: string | string[];
}[];
};
};
export interface SafeTransactionBuilderTxn {
to: string;
value: string;
data: string | null;
contractMethod: {
inputs: {
name: string;
type: string;
internalType: string;
}[];
name: string;
payable: boolean;
};
contractInputsValues: Record<
SafeTransactionBuilderTxn["contractMethod"]["inputs"][number]["name"],
string
>;
}
export interface SafetransactionsResponseResult {
transaction: {
// multisig_0xAF28bcB48C40dBC86f52D459A6562F658fc94B1e
// _0x2b2a3167b4912af385fd1f6096e752e1b6cd91acb2bfb07914851399b03637cd
id: string;
timestamp: number;
txHash: string;
executionInfo: {
nonce: number;
};
txInfo: {
methodName: string;
humanDescription: string | null;
to: {
value: string;
name: string;
};
};
};
}
export interface SafeTransactionsResponse {
// https://safe-client.safe.global/v1/chains/1/safes
// /0xAF28bcB48C40dBC86f52D459A6562F658fc94B1e/multisig-transactions
// /?trusted=true&limit=10&cursor=limit%3D20%26offset%3D20
next: string;
previous: string;
results: SafetransactionsResponseResult[];
}