@1delta/abis 0.0.16 → 0.0.18
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/dist/dolomite/borrowPositionProxy.d.ts +77 -0
- package/dist/dolomite/borrowPositionProxy.d.ts.map +1 -0
- package/dist/dolomite/borrowPositionProxy.js +61 -0
- package/dist/dolomite/depositWithdrawalProxy.d.ts +164 -0
- package/dist/dolomite/depositWithdrawalProxy.d.ts.map +1 -0
- package/dist/dolomite/depositWithdrawalProxy.js +141 -0
- package/dist/dolomite/dolomiteMargin.d.ts +271 -0
- package/dist/dolomite/dolomiteMargin.d.ts.map +1 -0
- package/dist/dolomite/dolomiteMargin.js +185 -0
- package/dist/dolomite/dolomiteMarginOperate.d.ts +75 -0
- package/dist/dolomite/dolomiteMarginOperate.d.ts.map +1 -0
- package/dist/dolomite/dolomiteMarginOperate.js +71 -0
- package/dist/dolomite/genericTraderProxy.d.ts +146 -0
- package/dist/dolomite/genericTraderProxy.d.ts.map +1 -0
- package/dist/dolomite/genericTraderProxy.js +99 -0
- package/dist/dolomite/index.d.ts +6 -0
- package/dist/dolomite/index.d.ts.map +1 -0
- package/dist/dolomite/index.js +5 -0
- package/dist/fluid/index.d.ts +1 -0
- package/dist/fluid/index.d.ts.map +1 -1
- package/dist/fluid/index.js +1 -0
- package/dist/fluid/vaultFactory.d.ts +14 -0
- package/dist/fluid/vaultFactory.d.ts.map +1 -0
- package/dist/fluid/vaultFactory.js +17 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
export declare const DolomiteMarginAbi: readonly [{
|
|
2
|
+
readonly inputs: readonly [];
|
|
3
|
+
readonly name: "getNumMarkets";
|
|
4
|
+
readonly outputs: readonly [{
|
|
5
|
+
readonly name: "";
|
|
6
|
+
readonly type: "uint256";
|
|
7
|
+
}];
|
|
8
|
+
readonly stateMutability: "view";
|
|
9
|
+
readonly type: "function";
|
|
10
|
+
}, {
|
|
11
|
+
readonly inputs: readonly [];
|
|
12
|
+
readonly name: "getMarginRatio";
|
|
13
|
+
readonly outputs: readonly [{
|
|
14
|
+
readonly components: readonly [{
|
|
15
|
+
readonly name: "value";
|
|
16
|
+
readonly type: "uint256";
|
|
17
|
+
}];
|
|
18
|
+
readonly name: "";
|
|
19
|
+
readonly type: "tuple";
|
|
20
|
+
}];
|
|
21
|
+
readonly stateMutability: "view";
|
|
22
|
+
readonly type: "function";
|
|
23
|
+
}, {
|
|
24
|
+
readonly inputs: readonly [];
|
|
25
|
+
readonly name: "getEarningsRate";
|
|
26
|
+
readonly outputs: readonly [{
|
|
27
|
+
readonly components: readonly [{
|
|
28
|
+
readonly name: "value";
|
|
29
|
+
readonly type: "uint256";
|
|
30
|
+
}];
|
|
31
|
+
readonly name: "";
|
|
32
|
+
readonly type: "tuple";
|
|
33
|
+
}];
|
|
34
|
+
readonly stateMutability: "view";
|
|
35
|
+
readonly type: "function";
|
|
36
|
+
}, {
|
|
37
|
+
readonly inputs: readonly [{
|
|
38
|
+
readonly name: "marketId";
|
|
39
|
+
readonly type: "uint256";
|
|
40
|
+
}];
|
|
41
|
+
readonly name: "getMarketTokenAddress";
|
|
42
|
+
readonly outputs: readonly [{
|
|
43
|
+
readonly name: "";
|
|
44
|
+
readonly type: "address";
|
|
45
|
+
}];
|
|
46
|
+
readonly stateMutability: "view";
|
|
47
|
+
readonly type: "function";
|
|
48
|
+
}, {
|
|
49
|
+
readonly inputs: readonly [{
|
|
50
|
+
readonly name: "marketId";
|
|
51
|
+
readonly type: "uint256";
|
|
52
|
+
}];
|
|
53
|
+
readonly name: "getMarketIsClosing";
|
|
54
|
+
readonly outputs: readonly [{
|
|
55
|
+
readonly name: "";
|
|
56
|
+
readonly type: "bool";
|
|
57
|
+
}];
|
|
58
|
+
readonly stateMutability: "view";
|
|
59
|
+
readonly type: "function";
|
|
60
|
+
}, {
|
|
61
|
+
readonly inputs: readonly [{
|
|
62
|
+
readonly name: "marketId";
|
|
63
|
+
readonly type: "uint256";
|
|
64
|
+
}];
|
|
65
|
+
readonly name: "getMarketTotalPar";
|
|
66
|
+
readonly outputs: readonly [{
|
|
67
|
+
readonly components: readonly [{
|
|
68
|
+
readonly name: "borrow";
|
|
69
|
+
readonly type: "uint128";
|
|
70
|
+
}, {
|
|
71
|
+
readonly name: "supply";
|
|
72
|
+
readonly type: "uint128";
|
|
73
|
+
}];
|
|
74
|
+
readonly name: "";
|
|
75
|
+
readonly type: "tuple";
|
|
76
|
+
}];
|
|
77
|
+
readonly stateMutability: "view";
|
|
78
|
+
readonly type: "function";
|
|
79
|
+
}, {
|
|
80
|
+
readonly inputs: readonly [{
|
|
81
|
+
readonly name: "marketId";
|
|
82
|
+
readonly type: "uint256";
|
|
83
|
+
}];
|
|
84
|
+
readonly name: "getMarketCurrentIndex";
|
|
85
|
+
readonly outputs: readonly [{
|
|
86
|
+
readonly components: readonly [{
|
|
87
|
+
readonly name: "borrow";
|
|
88
|
+
readonly type: "uint112";
|
|
89
|
+
}, {
|
|
90
|
+
readonly name: "supply";
|
|
91
|
+
readonly type: "uint112";
|
|
92
|
+
}, {
|
|
93
|
+
readonly name: "lastUpdate";
|
|
94
|
+
readonly type: "uint32";
|
|
95
|
+
}];
|
|
96
|
+
readonly name: "";
|
|
97
|
+
readonly type: "tuple";
|
|
98
|
+
}];
|
|
99
|
+
readonly stateMutability: "view";
|
|
100
|
+
readonly type: "function";
|
|
101
|
+
}, {
|
|
102
|
+
readonly inputs: readonly [{
|
|
103
|
+
readonly name: "marketId";
|
|
104
|
+
readonly type: "uint256";
|
|
105
|
+
}];
|
|
106
|
+
readonly name: "getMarketPrice";
|
|
107
|
+
readonly outputs: readonly [{
|
|
108
|
+
readonly components: readonly [{
|
|
109
|
+
readonly name: "value";
|
|
110
|
+
readonly type: "uint256";
|
|
111
|
+
}];
|
|
112
|
+
readonly name: "";
|
|
113
|
+
readonly type: "tuple";
|
|
114
|
+
}];
|
|
115
|
+
readonly stateMutability: "view";
|
|
116
|
+
readonly type: "function";
|
|
117
|
+
}, {
|
|
118
|
+
readonly inputs: readonly [{
|
|
119
|
+
readonly name: "marketId";
|
|
120
|
+
readonly type: "uint256";
|
|
121
|
+
}];
|
|
122
|
+
readonly name: "getMarketMarginPremium";
|
|
123
|
+
readonly outputs: readonly [{
|
|
124
|
+
readonly components: readonly [{
|
|
125
|
+
readonly name: "value";
|
|
126
|
+
readonly type: "uint256";
|
|
127
|
+
}];
|
|
128
|
+
readonly name: "";
|
|
129
|
+
readonly type: "tuple";
|
|
130
|
+
}];
|
|
131
|
+
readonly stateMutability: "view";
|
|
132
|
+
readonly type: "function";
|
|
133
|
+
}, {
|
|
134
|
+
readonly inputs: readonly [{
|
|
135
|
+
readonly name: "marketId";
|
|
136
|
+
readonly type: "uint256";
|
|
137
|
+
}];
|
|
138
|
+
readonly name: "getMarketInterestRate";
|
|
139
|
+
readonly outputs: readonly [{
|
|
140
|
+
readonly components: readonly [{
|
|
141
|
+
readonly name: "value";
|
|
142
|
+
readonly type: "uint256";
|
|
143
|
+
}];
|
|
144
|
+
readonly name: "";
|
|
145
|
+
readonly type: "tuple";
|
|
146
|
+
}];
|
|
147
|
+
readonly stateMutability: "view";
|
|
148
|
+
readonly type: "function";
|
|
149
|
+
}, {
|
|
150
|
+
readonly inputs: readonly [{
|
|
151
|
+
readonly components: readonly [{
|
|
152
|
+
readonly name: "owner";
|
|
153
|
+
readonly type: "address";
|
|
154
|
+
}, {
|
|
155
|
+
readonly name: "number";
|
|
156
|
+
readonly type: "uint256";
|
|
157
|
+
}];
|
|
158
|
+
readonly name: "account";
|
|
159
|
+
readonly type: "tuple";
|
|
160
|
+
}];
|
|
161
|
+
readonly name: "getAccountBalances";
|
|
162
|
+
readonly outputs: readonly [{
|
|
163
|
+
readonly name: "markets";
|
|
164
|
+
readonly type: "uint256[]";
|
|
165
|
+
}, {
|
|
166
|
+
readonly name: "tokens";
|
|
167
|
+
readonly type: "address[]";
|
|
168
|
+
}, {
|
|
169
|
+
readonly components: readonly [{
|
|
170
|
+
readonly name: "sign";
|
|
171
|
+
readonly type: "bool";
|
|
172
|
+
}, {
|
|
173
|
+
readonly name: "value";
|
|
174
|
+
readonly type: "uint128";
|
|
175
|
+
}];
|
|
176
|
+
readonly name: "pars";
|
|
177
|
+
readonly type: "tuple[]";
|
|
178
|
+
}, {
|
|
179
|
+
readonly components: readonly [{
|
|
180
|
+
readonly name: "sign";
|
|
181
|
+
readonly type: "bool";
|
|
182
|
+
}, {
|
|
183
|
+
readonly name: "value";
|
|
184
|
+
readonly type: "uint256";
|
|
185
|
+
}];
|
|
186
|
+
readonly name: "weis";
|
|
187
|
+
readonly type: "tuple[]";
|
|
188
|
+
}];
|
|
189
|
+
readonly stateMutability: "view";
|
|
190
|
+
readonly type: "function";
|
|
191
|
+
}, {
|
|
192
|
+
readonly inputs: readonly [{
|
|
193
|
+
readonly components: readonly [{
|
|
194
|
+
readonly name: "owner";
|
|
195
|
+
readonly type: "address";
|
|
196
|
+
}, {
|
|
197
|
+
readonly name: "number";
|
|
198
|
+
readonly type: "uint256";
|
|
199
|
+
}];
|
|
200
|
+
readonly name: "account";
|
|
201
|
+
readonly type: "tuple";
|
|
202
|
+
}];
|
|
203
|
+
readonly name: "getAccountStatus";
|
|
204
|
+
readonly outputs: readonly [{
|
|
205
|
+
readonly name: "";
|
|
206
|
+
readonly type: "uint8";
|
|
207
|
+
}];
|
|
208
|
+
readonly stateMutability: "view";
|
|
209
|
+
readonly type: "function";
|
|
210
|
+
}, {
|
|
211
|
+
readonly inputs: readonly [{
|
|
212
|
+
readonly components: readonly [{
|
|
213
|
+
readonly name: "owner";
|
|
214
|
+
readonly type: "address";
|
|
215
|
+
}, {
|
|
216
|
+
readonly name: "number";
|
|
217
|
+
readonly type: "uint256";
|
|
218
|
+
}];
|
|
219
|
+
readonly name: "account";
|
|
220
|
+
readonly type: "tuple";
|
|
221
|
+
}];
|
|
222
|
+
readonly name: "getAdjustedAccountValues";
|
|
223
|
+
readonly outputs: readonly [{
|
|
224
|
+
readonly components: readonly [{
|
|
225
|
+
readonly name: "value";
|
|
226
|
+
readonly type: "uint256";
|
|
227
|
+
}];
|
|
228
|
+
readonly name: "supplyValue";
|
|
229
|
+
readonly type: "tuple";
|
|
230
|
+
}, {
|
|
231
|
+
readonly components: readonly [{
|
|
232
|
+
readonly name: "value";
|
|
233
|
+
readonly type: "uint256";
|
|
234
|
+
}];
|
|
235
|
+
readonly name: "borrowValue";
|
|
236
|
+
readonly type: "tuple";
|
|
237
|
+
}];
|
|
238
|
+
readonly stateMutability: "view";
|
|
239
|
+
readonly type: "function";
|
|
240
|
+
}, {
|
|
241
|
+
readonly inputs: readonly [{
|
|
242
|
+
readonly components: readonly [{
|
|
243
|
+
readonly name: "owner";
|
|
244
|
+
readonly type: "address";
|
|
245
|
+
}, {
|
|
246
|
+
readonly name: "number";
|
|
247
|
+
readonly type: "uint256";
|
|
248
|
+
}];
|
|
249
|
+
readonly name: "account";
|
|
250
|
+
readonly type: "tuple";
|
|
251
|
+
}];
|
|
252
|
+
readonly name: "getAccountRiskOverrideByAccount";
|
|
253
|
+
readonly outputs: readonly [{
|
|
254
|
+
readonly components: readonly [{
|
|
255
|
+
readonly name: "value";
|
|
256
|
+
readonly type: "uint256";
|
|
257
|
+
}];
|
|
258
|
+
readonly name: "marginRatioOverride";
|
|
259
|
+
readonly type: "tuple";
|
|
260
|
+
}, {
|
|
261
|
+
readonly components: readonly [{
|
|
262
|
+
readonly name: "value";
|
|
263
|
+
readonly type: "uint256";
|
|
264
|
+
}];
|
|
265
|
+
readonly name: "liquidationSpreadOverride";
|
|
266
|
+
readonly type: "tuple";
|
|
267
|
+
}];
|
|
268
|
+
readonly stateMutability: "view";
|
|
269
|
+
readonly type: "function";
|
|
270
|
+
}];
|
|
271
|
+
//# sourceMappingURL=dolomiteMargin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dolomiteMargin.d.ts","sourceRoot":"","sources":["../../src/dolomite/dolomiteMargin.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0JpB,CAAA"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
// DolomiteMargin core ABI — the single cross-margin pool contract per chain
|
|
2
|
+
// (e.g. Arbitrum 0x6Bd780E7fDf01D77e4d475c821f1e7AE05409072).
|
|
3
|
+
//
|
|
4
|
+
// IMPORTANT — validated against the live Arbitrum deployment (June 2026):
|
|
5
|
+
// the deployed contract is OLDER than this monorepo's Solidity source. The
|
|
6
|
+
// `getMarketWithInfo` mega-struct and the `getMarket*InterestRateApr` getters
|
|
7
|
+
// are NOT present (they revert / mis-decode). Use the GRANULAR getters below —
|
|
8
|
+
// they decode cleanly and are stable across versions. The per-market data is
|
|
9
|
+
// assembled from individual getters; the supply APR is DERIVED from the
|
|
10
|
+
// per-second borrow rate (`getMarketInterestRate`), utilization, and the
|
|
11
|
+
// global `getEarningsRate` (Dolomite has no on-chain supply-rate getter on the
|
|
12
|
+
// deployed version).
|
|
13
|
+
//
|
|
14
|
+
// Sub-struct layouts (confirmed live):
|
|
15
|
+
// Types.TotalPar { borrow:uint128, supply:uint128 }
|
|
16
|
+
// Interest.Index { borrow:uint112, supply:uint112, lastUpdate:uint32 }
|
|
17
|
+
// Types.Par { sign:bool, value:uint128 }
|
|
18
|
+
// Types.Wei { sign:bool, value:uint256 } (true sign = supply, false = borrow)
|
|
19
|
+
// Decimal.D256 / Monetary.Price / Monetary.Value / Interest.Rate { value:uint256 }
|
|
20
|
+
// Account.Info { owner:address, number:uint256 }
|
|
21
|
+
const AccountInfo = {
|
|
22
|
+
components: [
|
|
23
|
+
{ name: 'owner', type: 'address' },
|
|
24
|
+
{ name: 'number', type: 'uint256' },
|
|
25
|
+
],
|
|
26
|
+
name: 'account',
|
|
27
|
+
type: 'tuple',
|
|
28
|
+
};
|
|
29
|
+
// shorthand for the many `{ value: uint256 }` wrapper structs
|
|
30
|
+
const D256 = [{ components: [{ name: 'value', type: 'uint256' }], name: '', type: 'tuple' }];
|
|
31
|
+
export const DolomiteMarginAbi = [
|
|
32
|
+
// ── global ──
|
|
33
|
+
{
|
|
34
|
+
inputs: [],
|
|
35
|
+
name: 'getNumMarkets',
|
|
36
|
+
outputs: [{ name: '', type: 'uint256' }],
|
|
37
|
+
stateMutability: 'view',
|
|
38
|
+
type: 'function',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
inputs: [],
|
|
42
|
+
name: 'getMarginRatio',
|
|
43
|
+
outputs: D256,
|
|
44
|
+
stateMutability: 'view',
|
|
45
|
+
type: 'function',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
inputs: [],
|
|
49
|
+
name: 'getEarningsRate',
|
|
50
|
+
outputs: D256,
|
|
51
|
+
stateMutability: 'view',
|
|
52
|
+
type: 'function',
|
|
53
|
+
},
|
|
54
|
+
// ── per-market granular getters ──
|
|
55
|
+
{
|
|
56
|
+
inputs: [{ name: 'marketId', type: 'uint256' }],
|
|
57
|
+
name: 'getMarketTokenAddress',
|
|
58
|
+
outputs: [{ name: '', type: 'address' }],
|
|
59
|
+
stateMutability: 'view',
|
|
60
|
+
type: 'function',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
inputs: [{ name: 'marketId', type: 'uint256' }],
|
|
64
|
+
name: 'getMarketIsClosing',
|
|
65
|
+
outputs: [{ name: '', type: 'bool' }],
|
|
66
|
+
stateMutability: 'view',
|
|
67
|
+
type: 'function',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
inputs: [{ name: 'marketId', type: 'uint256' }],
|
|
71
|
+
name: 'getMarketTotalPar',
|
|
72
|
+
outputs: [
|
|
73
|
+
{
|
|
74
|
+
components: [
|
|
75
|
+
{ name: 'borrow', type: 'uint128' },
|
|
76
|
+
{ name: 'supply', type: 'uint128' },
|
|
77
|
+
],
|
|
78
|
+
name: '',
|
|
79
|
+
type: 'tuple',
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
stateMutability: 'view',
|
|
83
|
+
type: 'function',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
inputs: [{ name: 'marketId', type: 'uint256' }],
|
|
87
|
+
name: 'getMarketCurrentIndex',
|
|
88
|
+
outputs: [
|
|
89
|
+
{
|
|
90
|
+
components: [
|
|
91
|
+
{ name: 'borrow', type: 'uint112' },
|
|
92
|
+
{ name: 'supply', type: 'uint112' },
|
|
93
|
+
{ name: 'lastUpdate', type: 'uint32' },
|
|
94
|
+
],
|
|
95
|
+
name: '',
|
|
96
|
+
type: 'tuple',
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
stateMutability: 'view',
|
|
100
|
+
type: 'function',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
inputs: [{ name: 'marketId', type: 'uint256' }],
|
|
104
|
+
name: 'getMarketPrice',
|
|
105
|
+
outputs: D256,
|
|
106
|
+
stateMutability: 'view',
|
|
107
|
+
type: 'function',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
inputs: [{ name: 'marketId', type: 'uint256' }],
|
|
111
|
+
name: 'getMarketMarginPremium',
|
|
112
|
+
outputs: D256,
|
|
113
|
+
stateMutability: 'view',
|
|
114
|
+
type: 'function',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
// per-second BORROW rate (Interest.Rate, 1e18-scaled). Annualize with
|
|
118
|
+
// SECONDS_PER_YEAR. (Alias of getMarketBorrowInterestRatePerSecond on newer
|
|
119
|
+
// versions; this name is the one present on the deployed contract.)
|
|
120
|
+
inputs: [{ name: 'marketId', type: 'uint256' }],
|
|
121
|
+
name: 'getMarketInterestRate',
|
|
122
|
+
outputs: D256,
|
|
123
|
+
stateMutability: 'view',
|
|
124
|
+
type: 'function',
|
|
125
|
+
},
|
|
126
|
+
// ── accounts ──
|
|
127
|
+
{
|
|
128
|
+
inputs: [AccountInfo],
|
|
129
|
+
name: 'getAccountBalances',
|
|
130
|
+
outputs: [
|
|
131
|
+
{ name: 'markets', type: 'uint256[]' },
|
|
132
|
+
{ name: 'tokens', type: 'address[]' },
|
|
133
|
+
{
|
|
134
|
+
components: [
|
|
135
|
+
{ name: 'sign', type: 'bool' },
|
|
136
|
+
{ name: 'value', type: 'uint128' },
|
|
137
|
+
],
|
|
138
|
+
name: 'pars',
|
|
139
|
+
type: 'tuple[]',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
components: [
|
|
143
|
+
{ name: 'sign', type: 'bool' },
|
|
144
|
+
{ name: 'value', type: 'uint256' },
|
|
145
|
+
],
|
|
146
|
+
name: 'weis',
|
|
147
|
+
type: 'tuple[]',
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
stateMutability: 'view',
|
|
151
|
+
type: 'function',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
inputs: [AccountInfo],
|
|
155
|
+
name: 'getAccountStatus',
|
|
156
|
+
outputs: [{ name: '', type: 'uint8' }],
|
|
157
|
+
stateMutability: 'view',
|
|
158
|
+
type: 'function',
|
|
159
|
+
},
|
|
160
|
+
// ── future / newer-deployment only ──
|
|
161
|
+
// `getAdjustedAccountValues` and `getAccountRiskOverrideByAccount` exist in
|
|
162
|
+
// newer DolomiteMargin versions but REVERT on the current Arbitrum deploy.
|
|
163
|
+
// Kept here for Model-B (per-account margin-ratio override) e-mode once the
|
|
164
|
+
// target chain runs a version that exposes them — do not call unconditionally.
|
|
165
|
+
{
|
|
166
|
+
inputs: [AccountInfo],
|
|
167
|
+
name: 'getAdjustedAccountValues',
|
|
168
|
+
outputs: [
|
|
169
|
+
{ components: [{ name: 'value', type: 'uint256' }], name: 'supplyValue', type: 'tuple' },
|
|
170
|
+
{ components: [{ name: 'value', type: 'uint256' }], name: 'borrowValue', type: 'tuple' },
|
|
171
|
+
],
|
|
172
|
+
stateMutability: 'view',
|
|
173
|
+
type: 'function',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
inputs: [AccountInfo],
|
|
177
|
+
name: 'getAccountRiskOverrideByAccount',
|
|
178
|
+
outputs: [
|
|
179
|
+
{ components: [{ name: 'value', type: 'uint256' }], name: 'marginRatioOverride', type: 'tuple' },
|
|
180
|
+
{ components: [{ name: 'value', type: 'uint256' }], name: 'liquidationSpreadOverride', type: 'tuple' },
|
|
181
|
+
],
|
|
182
|
+
stateMutability: 'view',
|
|
183
|
+
type: 'function',
|
|
184
|
+
},
|
|
185
|
+
];
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export declare const DolomiteMarginOperateAbi: readonly [{
|
|
2
|
+
readonly inputs: readonly [{
|
|
3
|
+
readonly components: readonly [{
|
|
4
|
+
readonly name: "owner";
|
|
5
|
+
readonly type: "address";
|
|
6
|
+
}, {
|
|
7
|
+
readonly name: "number";
|
|
8
|
+
readonly type: "uint256";
|
|
9
|
+
}];
|
|
10
|
+
readonly name: "accounts";
|
|
11
|
+
readonly type: "tuple[]";
|
|
12
|
+
}, {
|
|
13
|
+
readonly components: readonly [{
|
|
14
|
+
readonly name: "actionType";
|
|
15
|
+
readonly type: "uint8";
|
|
16
|
+
}, {
|
|
17
|
+
readonly name: "accountId";
|
|
18
|
+
readonly type: "uint256";
|
|
19
|
+
}, {
|
|
20
|
+
readonly components: readonly [{
|
|
21
|
+
readonly name: "sign";
|
|
22
|
+
readonly type: "bool";
|
|
23
|
+
}, {
|
|
24
|
+
readonly name: "denomination";
|
|
25
|
+
readonly type: "uint8";
|
|
26
|
+
}, {
|
|
27
|
+
readonly name: "ref";
|
|
28
|
+
readonly type: "uint8";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "value";
|
|
31
|
+
readonly type: "uint256";
|
|
32
|
+
}];
|
|
33
|
+
readonly name: "amount";
|
|
34
|
+
readonly type: "tuple";
|
|
35
|
+
}, {
|
|
36
|
+
readonly name: "primaryMarketId";
|
|
37
|
+
readonly type: "uint256";
|
|
38
|
+
}, {
|
|
39
|
+
readonly name: "secondaryMarketId";
|
|
40
|
+
readonly type: "uint256";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "otherAddress";
|
|
43
|
+
readonly type: "address";
|
|
44
|
+
}, {
|
|
45
|
+
readonly name: "otherAccountId";
|
|
46
|
+
readonly type: "uint256";
|
|
47
|
+
}, {
|
|
48
|
+
readonly name: "data";
|
|
49
|
+
readonly type: "bytes";
|
|
50
|
+
}];
|
|
51
|
+
readonly name: "actions";
|
|
52
|
+
readonly type: "tuple[]";
|
|
53
|
+
}];
|
|
54
|
+
readonly name: "operate";
|
|
55
|
+
readonly outputs: readonly [];
|
|
56
|
+
readonly stateMutability: "nonpayable";
|
|
57
|
+
readonly type: "function";
|
|
58
|
+
}, {
|
|
59
|
+
readonly inputs: readonly [{
|
|
60
|
+
readonly components: readonly [{
|
|
61
|
+
readonly name: "operator";
|
|
62
|
+
readonly type: "address";
|
|
63
|
+
}, {
|
|
64
|
+
readonly name: "trusted";
|
|
65
|
+
readonly type: "bool";
|
|
66
|
+
}];
|
|
67
|
+
readonly name: "args";
|
|
68
|
+
readonly type: "tuple[]";
|
|
69
|
+
}];
|
|
70
|
+
readonly name: "setOperators";
|
|
71
|
+
readonly outputs: readonly [];
|
|
72
|
+
readonly stateMutability: "nonpayable";
|
|
73
|
+
readonly type: "function";
|
|
74
|
+
}];
|
|
75
|
+
//# sourceMappingURL=dolomiteMarginOperate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dolomiteMarginOperate.d.ts","sourceRoot":"","sources":["../../src/dolomite/dolomiteMarginOperate.ts"],"names":[],"mappings":"AAgDA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwB3B,CAAA"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// DolomiteMargin core write functions: `operate` (the atomic multi-action batch
|
|
2
|
+
// primitive) and `setOperators` (user-level local-operator authorization).
|
|
3
|
+
//
|
|
4
|
+
// `operate` runs an ordered list of actions, each referencing an account by
|
|
5
|
+
// index into `accounts`, with a single collateralization check at the end.
|
|
6
|
+
// msg.sender must be an operator of every touched account (it always is for its
|
|
7
|
+
// own accounts). Use it to batch base ops across sub-accounts, or to deposit
|
|
8
|
+
// into an account owned by a different address (requires being that owner's
|
|
9
|
+
// operator + the funder being msg.sender or the owner).
|
|
10
|
+
//
|
|
11
|
+
// Enums (uint8):
|
|
12
|
+
// ActionType: Deposit=0, Withdraw=1, Transfer=2, Buy=3, Sell=4,
|
|
13
|
+
// Trade=5, Liquidate=6, Vaporize=7, Call=8
|
|
14
|
+
// AssetDenomination: Wei=0, Par=1
|
|
15
|
+
// AssetReference: Delta=0, Target=1
|
|
16
|
+
const AccountInfo = {
|
|
17
|
+
components: [
|
|
18
|
+
{ name: 'owner', type: 'address' },
|
|
19
|
+
{ name: 'number', type: 'uint256' },
|
|
20
|
+
],
|
|
21
|
+
name: 'accounts',
|
|
22
|
+
type: 'tuple[]',
|
|
23
|
+
};
|
|
24
|
+
const ActionArgs = {
|
|
25
|
+
components: [
|
|
26
|
+
{ name: 'actionType', type: 'uint8' },
|
|
27
|
+
{ name: 'accountId', type: 'uint256' },
|
|
28
|
+
{
|
|
29
|
+
components: [
|
|
30
|
+
{ name: 'sign', type: 'bool' },
|
|
31
|
+
{ name: 'denomination', type: 'uint8' },
|
|
32
|
+
{ name: 'ref', type: 'uint8' },
|
|
33
|
+
{ name: 'value', type: 'uint256' },
|
|
34
|
+
],
|
|
35
|
+
name: 'amount',
|
|
36
|
+
type: 'tuple',
|
|
37
|
+
},
|
|
38
|
+
{ name: 'primaryMarketId', type: 'uint256' },
|
|
39
|
+
{ name: 'secondaryMarketId', type: 'uint256' },
|
|
40
|
+
{ name: 'otherAddress', type: 'address' },
|
|
41
|
+
{ name: 'otherAccountId', type: 'uint256' },
|
|
42
|
+
{ name: 'data', type: 'bytes' },
|
|
43
|
+
],
|
|
44
|
+
name: 'actions',
|
|
45
|
+
type: 'tuple[]',
|
|
46
|
+
};
|
|
47
|
+
export const DolomiteMarginOperateAbi = [
|
|
48
|
+
{
|
|
49
|
+
inputs: [AccountInfo, ActionArgs],
|
|
50
|
+
name: 'operate',
|
|
51
|
+
outputs: [],
|
|
52
|
+
stateMutability: 'nonpayable',
|
|
53
|
+
type: 'function',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
inputs: [
|
|
57
|
+
{
|
|
58
|
+
components: [
|
|
59
|
+
{ name: 'operator', type: 'address' },
|
|
60
|
+
{ name: 'trusted', type: 'bool' },
|
|
61
|
+
],
|
|
62
|
+
name: 'args',
|
|
63
|
+
type: 'tuple[]',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
name: 'setOperators',
|
|
67
|
+
outputs: [],
|
|
68
|
+
stateMutability: 'nonpayable',
|
|
69
|
+
type: 'function',
|
|
70
|
+
},
|
|
71
|
+
];
|