@1inch/fusion-sdk 2.3.9-rc.9 → 2.4.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/README.md +101 -0
- package/dist/cjs/api/quoter/quote/quote.js +2 -2
- package/dist/cjs/fusion-order/fusion-order.js +10 -31
- package/dist/cjs/fusion-order/fusion-order.spec.js +3 -4
- package/dist/cjs/index.js +9 -1
- package/dist/esm/api/quoter/quote/quote.js +2 -2
- package/dist/esm/fusion-order/fusion-order.js +8 -29
- package/dist/esm/fusion-order/fusion-order.spec.js +1 -2
- package/dist/esm/index.js +1 -2
- package/dist/esm/package.json +1 -1
- package/dist/types/src/api/quoter/quote/quote.d.ts +1 -2
- package/dist/types/src/fusion-order/fusion-order.d.ts +2 -3
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/cjs/abi/NativeOrderFactory.abi.json +0 -217
- package/dist/cjs/abi/NativeOrderImpl.abi.json +0 -286
- package/dist/cjs/contracts/index.js +0 -21
- package/dist/cjs/contracts/native-order-factory.js +0 -115
- package/dist/cjs/contracts/native-order-impl.js +0 -130
- package/dist/cjs/contracts/proxy-factory.js +0 -87
- package/dist/cjs/contracts/types.js +0 -4
- package/dist/esm/abi/NativeOrderFactory.abi.json +0 -217
- package/dist/esm/abi/NativeOrderImpl.abi.json +0 -286
- package/dist/esm/contracts/index.js +0 -4
- package/dist/esm/contracts/native-order-factory.js +0 -100
- package/dist/esm/contracts/native-order-impl.js +0 -115
- package/dist/esm/contracts/proxy-factory.js +0 -72
- package/dist/esm/contracts/types.js +0 -1
- package/dist/types/src/contracts/index.d.ts +0 -4
- package/dist/types/src/contracts/native-order-factory.d.ts +0 -9
- package/dist/types/src/contracts/native-order-impl.d.ts +0 -9
- package/dist/types/src/contracts/proxy-factory.d.ts +0 -8
- package/dist/types/src/contracts/types.d.ts +0 -6
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"type": "constructor",
|
|
4
|
-
"inputs": [
|
|
5
|
-
{
|
|
6
|
-
"name": "weth",
|
|
7
|
-
"type": "address",
|
|
8
|
-
"internalType": "contract IWETH"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"name": "nativeOrderFactory",
|
|
12
|
-
"type": "address",
|
|
13
|
-
"internalType": "address"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"name": "limitOrderProtocol",
|
|
17
|
-
"type": "address",
|
|
18
|
-
"internalType": "address"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"name": "accessToken",
|
|
22
|
-
"type": "address",
|
|
23
|
-
"internalType": "contract IERC20"
|
|
24
|
-
}
|
|
25
|
-
],
|
|
26
|
-
"stateMutability": "nonpayable"
|
|
27
|
-
},
|
|
28
|
-
{"type": "receive", "stateMutability": "payable"},
|
|
29
|
-
{
|
|
30
|
-
"type": "function",
|
|
31
|
-
"name": "cancelExpiredOrderByResolver",
|
|
32
|
-
"inputs": [
|
|
33
|
-
{
|
|
34
|
-
"name": "makerOrder",
|
|
35
|
-
"type": "tuple",
|
|
36
|
-
"internalType": "struct IOrderMixin.Order",
|
|
37
|
-
"components": [
|
|
38
|
-
{
|
|
39
|
-
"name": "salt",
|
|
40
|
-
"type": "uint256",
|
|
41
|
-
"internalType": "uint256"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"name": "maker",
|
|
45
|
-
"type": "uint256",
|
|
46
|
-
"internalType": "Address"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"name": "receiver",
|
|
50
|
-
"type": "uint256",
|
|
51
|
-
"internalType": "Address"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"name": "makerAsset",
|
|
55
|
-
"type": "uint256",
|
|
56
|
-
"internalType": "Address"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"name": "takerAsset",
|
|
60
|
-
"type": "uint256",
|
|
61
|
-
"internalType": "Address"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"name": "makingAmount",
|
|
65
|
-
"type": "uint256",
|
|
66
|
-
"internalType": "uint256"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"name": "takingAmount",
|
|
70
|
-
"type": "uint256",
|
|
71
|
-
"internalType": "uint256"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"name": "makerTraits",
|
|
75
|
-
"type": "uint256",
|
|
76
|
-
"internalType": "MakerTraits"
|
|
77
|
-
}
|
|
78
|
-
]
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"name": "rewardLimit",
|
|
82
|
-
"type": "uint256",
|
|
83
|
-
"internalType": "uint256"
|
|
84
|
-
}
|
|
85
|
-
],
|
|
86
|
-
"outputs": [],
|
|
87
|
-
"stateMutability": "nonpayable"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"type": "function",
|
|
91
|
-
"name": "cancelOrder",
|
|
92
|
-
"inputs": [
|
|
93
|
-
{
|
|
94
|
-
"name": "makerOrder",
|
|
95
|
-
"type": "tuple",
|
|
96
|
-
"internalType": "struct IOrderMixin.Order",
|
|
97
|
-
"components": [
|
|
98
|
-
{
|
|
99
|
-
"name": "salt",
|
|
100
|
-
"type": "uint256",
|
|
101
|
-
"internalType": "uint256"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"name": "maker",
|
|
105
|
-
"type": "uint256",
|
|
106
|
-
"internalType": "Address"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"name": "receiver",
|
|
110
|
-
"type": "uint256",
|
|
111
|
-
"internalType": "Address"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"name": "makerAsset",
|
|
115
|
-
"type": "uint256",
|
|
116
|
-
"internalType": "Address"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"name": "takerAsset",
|
|
120
|
-
"type": "uint256",
|
|
121
|
-
"internalType": "Address"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"name": "makingAmount",
|
|
125
|
-
"type": "uint256",
|
|
126
|
-
"internalType": "uint256"
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"name": "takingAmount",
|
|
130
|
-
"type": "uint256",
|
|
131
|
-
"internalType": "uint256"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"name": "makerTraits",
|
|
135
|
-
"type": "uint256",
|
|
136
|
-
"internalType": "MakerTraits"
|
|
137
|
-
}
|
|
138
|
-
]
|
|
139
|
-
}
|
|
140
|
-
],
|
|
141
|
-
"outputs": [],
|
|
142
|
-
"stateMutability": "nonpayable"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"type": "function",
|
|
146
|
-
"name": "decimals",
|
|
147
|
-
"inputs": [],
|
|
148
|
-
"outputs": [{"name": "", "type": "uint8", "internalType": "uint8"}],
|
|
149
|
-
"stateMutability": "pure"
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"type": "function",
|
|
153
|
-
"name": "depositAndApprove",
|
|
154
|
-
"inputs": [],
|
|
155
|
-
"outputs": [],
|
|
156
|
-
"stateMutability": "payable"
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"type": "function",
|
|
160
|
-
"name": "isValidSignature",
|
|
161
|
-
"inputs": [
|
|
162
|
-
{"name": "hash", "type": "bytes32", "internalType": "bytes32"},
|
|
163
|
-
{"name": "signature", "type": "bytes", "internalType": "bytes"}
|
|
164
|
-
],
|
|
165
|
-
"outputs": [{"name": "", "type": "bytes4", "internalType": "bytes4"}],
|
|
166
|
-
"stateMutability": "view"
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
"type": "function",
|
|
170
|
-
"name": "name",
|
|
171
|
-
"inputs": [],
|
|
172
|
-
"outputs": [{"name": "", "type": "string", "internalType": "string"}],
|
|
173
|
-
"stateMutability": "pure"
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
"type": "function",
|
|
177
|
-
"name": "rescueFunds",
|
|
178
|
-
"inputs": [
|
|
179
|
-
{"name": "token", "type": "address", "internalType": "address"},
|
|
180
|
-
{"name": "to", "type": "address", "internalType": "address"},
|
|
181
|
-
{"name": "amount", "type": "uint256", "internalType": "uint256"}
|
|
182
|
-
],
|
|
183
|
-
"outputs": [],
|
|
184
|
-
"stateMutability": "nonpayable"
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
"type": "function",
|
|
188
|
-
"name": "symbol",
|
|
189
|
-
"inputs": [],
|
|
190
|
-
"outputs": [{"name": "", "type": "string", "internalType": "string"}],
|
|
191
|
-
"stateMutability": "pure"
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
"type": "event",
|
|
195
|
-
"name": "NativeOrderCancelled",
|
|
196
|
-
"inputs": [
|
|
197
|
-
{
|
|
198
|
-
"name": "makerOrderHash",
|
|
199
|
-
"type": "bytes32",
|
|
200
|
-
"indexed": false,
|
|
201
|
-
"internalType": "bytes32"
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
"name": "balance",
|
|
205
|
-
"type": "uint256",
|
|
206
|
-
"indexed": false,
|
|
207
|
-
"internalType": "uint256"
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
"name": "resolverReward",
|
|
211
|
-
"type": "uint256",
|
|
212
|
-
"indexed": false,
|
|
213
|
-
"internalType": "uint256"
|
|
214
|
-
}
|
|
215
|
-
],
|
|
216
|
-
"anonymous": false
|
|
217
|
-
},
|
|
218
|
-
{"type": "error", "name": "CanNotCancelForZeroBalance", "inputs": []},
|
|
219
|
-
{"type": "error", "name": "EthDepositRejected", "inputs": []},
|
|
220
|
-
{"type": "error", "name": "ForceApproveFailed", "inputs": []},
|
|
221
|
-
{
|
|
222
|
-
"type": "error",
|
|
223
|
-
"name": "OnlyFactoryViolation",
|
|
224
|
-
"inputs": [
|
|
225
|
-
{"name": "sender", "type": "address", "internalType": "address"},
|
|
226
|
-
{"name": "factory", "type": "address", "internalType": "address"}
|
|
227
|
-
]
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
"type": "error",
|
|
231
|
-
"name": "OnlyLimitOrderProtocolViolation",
|
|
232
|
-
"inputs": [
|
|
233
|
-
{"name": "sender", "type": "address", "internalType": "address"},
|
|
234
|
-
{
|
|
235
|
-
"name": "limitOrderProtocol",
|
|
236
|
-
"type": "address",
|
|
237
|
-
"internalType": "address"
|
|
238
|
-
}
|
|
239
|
-
]
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
"type": "error",
|
|
243
|
-
"name": "OrderIsIncorrect",
|
|
244
|
-
"inputs": [
|
|
245
|
-
{"name": "expected", "type": "address", "internalType": "address"},
|
|
246
|
-
{"name": "actual", "type": "address", "internalType": "address"}
|
|
247
|
-
]
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
"type": "error",
|
|
251
|
-
"name": "OrderShouldBeExpired",
|
|
252
|
-
"inputs": [
|
|
253
|
-
{
|
|
254
|
-
"name": "currentTime",
|
|
255
|
-
"type": "uint256",
|
|
256
|
-
"internalType": "uint256"
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
"name": "expirationTime",
|
|
260
|
-
"type": "uint256",
|
|
261
|
-
"internalType": "uint256"
|
|
262
|
-
}
|
|
263
|
-
]
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
"type": "error",
|
|
267
|
-
"name": "RescueFundsTooMuch",
|
|
268
|
-
"inputs": [
|
|
269
|
-
{"name": "requested", "type": "uint256", "internalType": "uint256"},
|
|
270
|
-
{"name": "available", "type": "uint256", "internalType": "uint256"}
|
|
271
|
-
]
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
"type": "error",
|
|
275
|
-
"name": "ResolverAccessTokenMissing",
|
|
276
|
-
"inputs": [
|
|
277
|
-
{"name": "resolver", "type": "address", "internalType": "address"},
|
|
278
|
-
{
|
|
279
|
-
"name": "accessToken",
|
|
280
|
-
"type": "address",
|
|
281
|
-
"internalType": "address"
|
|
282
|
-
}
|
|
283
|
-
]
|
|
284
|
-
},
|
|
285
|
-
{"type": "error", "name": "SafeTransferFailed", "inputs": []}
|
|
286
|
-
]
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
function _class_call_check(instance, Constructor) {
|
|
2
|
-
if (!(instance instanceof Constructor)) {
|
|
3
|
-
throw new TypeError("Cannot call a class as a function");
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
function _defineProperties(target, props) {
|
|
7
|
-
for(var i = 0; i < props.length; i++){
|
|
8
|
-
var descriptor = props[i];
|
|
9
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
10
|
-
descriptor.configurable = true;
|
|
11
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
12
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
16
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
|
-
return Constructor;
|
|
19
|
-
}
|
|
20
|
-
function _define_property(obj, key, value) {
|
|
21
|
-
if (key in obj) {
|
|
22
|
-
Object.defineProperty(obj, key, {
|
|
23
|
-
value: value,
|
|
24
|
-
enumerable: true,
|
|
25
|
-
configurable: true,
|
|
26
|
-
writable: true
|
|
27
|
-
});
|
|
28
|
-
} else {
|
|
29
|
-
obj[key] = value;
|
|
30
|
-
}
|
|
31
|
-
return obj;
|
|
32
|
-
}
|
|
33
|
-
function _object_spread(target) {
|
|
34
|
-
for(var i = 1; i < arguments.length; i++){
|
|
35
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
36
|
-
var ownKeys = Object.keys(source);
|
|
37
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
38
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
39
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
ownKeys.forEach(function(key) {
|
|
43
|
-
_define_property(target, key, source[key]);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return target;
|
|
47
|
-
}
|
|
48
|
-
function ownKeys(object, enumerableOnly) {
|
|
49
|
-
var keys = Object.keys(object);
|
|
50
|
-
if (Object.getOwnPropertySymbols) {
|
|
51
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
52
|
-
if (enumerableOnly) {
|
|
53
|
-
symbols = symbols.filter(function(sym) {
|
|
54
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
keys.push.apply(keys, symbols);
|
|
58
|
-
}
|
|
59
|
-
return keys;
|
|
60
|
-
}
|
|
61
|
-
function _object_spread_props(target, source) {
|
|
62
|
-
source = source != null ? source : {};
|
|
63
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
64
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
65
|
-
} else {
|
|
66
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
67
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
return target;
|
|
71
|
-
}
|
|
72
|
-
import { Interface } from 'ethers';
|
|
73
|
-
import ABI from '../abi/NativeOrderFactory.abi.json';
|
|
74
|
-
export var NativeOrdersFactory = /*#__PURE__*/ function() {
|
|
75
|
-
"use strict";
|
|
76
|
-
function NativeOrdersFactory(address) {
|
|
77
|
-
_class_call_check(this, NativeOrdersFactory);
|
|
78
|
-
_define_property(this, "address", void 0);
|
|
79
|
-
_define_property(this, "iface", void 0);
|
|
80
|
-
this.address = address;
|
|
81
|
-
this.iface = new Interface(ABI);
|
|
82
|
-
}
|
|
83
|
-
_create_class(NativeOrdersFactory, [
|
|
84
|
-
{
|
|
85
|
-
key: "create",
|
|
86
|
-
value: function create(maker, order) {
|
|
87
|
-
return {
|
|
88
|
-
to: this.address,
|
|
89
|
-
value: order.makingAmount,
|
|
90
|
-
data: this.iface.encodeFunctionData('create', [
|
|
91
|
-
_object_spread_props(_object_spread({}, order.build()), {
|
|
92
|
-
maker: maker.toString()
|
|
93
|
-
})
|
|
94
|
-
])
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
]);
|
|
99
|
-
return NativeOrdersFactory;
|
|
100
|
-
}();
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
function _class_call_check(instance, Constructor) {
|
|
2
|
-
if (!(instance instanceof Constructor)) {
|
|
3
|
-
throw new TypeError("Cannot call a class as a function");
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
function _defineProperties(target, props) {
|
|
7
|
-
for(var i = 0; i < props.length; i++){
|
|
8
|
-
var descriptor = props[i];
|
|
9
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
10
|
-
descriptor.configurable = true;
|
|
11
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
12
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
16
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
|
-
return Constructor;
|
|
19
|
-
}
|
|
20
|
-
function _define_property(obj, key, value) {
|
|
21
|
-
if (key in obj) {
|
|
22
|
-
Object.defineProperty(obj, key, {
|
|
23
|
-
value: value,
|
|
24
|
-
enumerable: true,
|
|
25
|
-
configurable: true,
|
|
26
|
-
writable: true
|
|
27
|
-
});
|
|
28
|
-
} else {
|
|
29
|
-
obj[key] = value;
|
|
30
|
-
}
|
|
31
|
-
return obj;
|
|
32
|
-
}
|
|
33
|
-
function _object_spread(target) {
|
|
34
|
-
for(var i = 1; i < arguments.length; i++){
|
|
35
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
36
|
-
var ownKeys = Object.keys(source);
|
|
37
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
38
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
39
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
ownKeys.forEach(function(key) {
|
|
43
|
-
_define_property(target, key, source[key]);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return target;
|
|
47
|
-
}
|
|
48
|
-
function ownKeys(object, enumerableOnly) {
|
|
49
|
-
var keys = Object.keys(object);
|
|
50
|
-
if (Object.getOwnPropertySymbols) {
|
|
51
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
52
|
-
if (enumerableOnly) {
|
|
53
|
-
symbols = symbols.filter(function(sym) {
|
|
54
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
keys.push.apply(keys, symbols);
|
|
58
|
-
}
|
|
59
|
-
return keys;
|
|
60
|
-
}
|
|
61
|
-
function _object_spread_props(target, source) {
|
|
62
|
-
source = source != null ? source : {};
|
|
63
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
64
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
65
|
-
} else {
|
|
66
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
67
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
return target;
|
|
71
|
-
}
|
|
72
|
-
import { Interface } from 'ethers';
|
|
73
|
-
import ABI from '../abi/NativeOrderImpl.abi.json';
|
|
74
|
-
export var NativeOrdersImpl = /*#__PURE__*/ function() {
|
|
75
|
-
"use strict";
|
|
76
|
-
function NativeOrdersImpl(address) {
|
|
77
|
-
_class_call_check(this, NativeOrdersImpl);
|
|
78
|
-
_define_property(this, "address", void 0);
|
|
79
|
-
_define_property(this, "iface", void 0);
|
|
80
|
-
this.address = address;
|
|
81
|
-
this.iface = new Interface(ABI);
|
|
82
|
-
}
|
|
83
|
-
_create_class(NativeOrdersImpl, [
|
|
84
|
-
{
|
|
85
|
-
key: "cancel",
|
|
86
|
-
value: function cancel(maker, order) {
|
|
87
|
-
return {
|
|
88
|
-
to: this.address,
|
|
89
|
-
value: 0n,
|
|
90
|
-
data: this.iface.encodeFunctionData('cancelOrder', [
|
|
91
|
-
_object_spread_props(_object_spread({}, order), {
|
|
92
|
-
maker: maker.toString()
|
|
93
|
-
})
|
|
94
|
-
])
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
key: "cancelExpiredOrderByResolver",
|
|
100
|
-
value: function cancelExpiredOrderByResolver(maker, order, rewardLimit) {
|
|
101
|
-
return {
|
|
102
|
-
to: this.address,
|
|
103
|
-
value: 0n,
|
|
104
|
-
data: this.iface.encodeFunctionData('cancelExpiredOrderByResolver', [
|
|
105
|
-
_object_spread_props(_object_spread({}, order), {
|
|
106
|
-
maker: maker.toString()
|
|
107
|
-
}),
|
|
108
|
-
rewardLimit
|
|
109
|
-
])
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
]);
|
|
114
|
-
return NativeOrdersImpl;
|
|
115
|
-
}();
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
function _class_call_check(instance, Constructor) {
|
|
2
|
-
if (!(instance instanceof Constructor)) {
|
|
3
|
-
throw new TypeError("Cannot call a class as a function");
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
function _defineProperties(target, props) {
|
|
7
|
-
for(var i = 0; i < props.length; i++){
|
|
8
|
-
var descriptor = props[i];
|
|
9
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
10
|
-
descriptor.configurable = true;
|
|
11
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
12
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
16
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
|
-
return Constructor;
|
|
19
|
-
}
|
|
20
|
-
function _define_property(obj, key, value) {
|
|
21
|
-
if (key in obj) {
|
|
22
|
-
Object.defineProperty(obj, key, {
|
|
23
|
-
value: value,
|
|
24
|
-
enumerable: true,
|
|
25
|
-
configurable: true,
|
|
26
|
-
writable: true
|
|
27
|
-
});
|
|
28
|
-
} else {
|
|
29
|
-
obj[key] = value;
|
|
30
|
-
}
|
|
31
|
-
return obj;
|
|
32
|
-
}
|
|
33
|
-
import { isHexBytes, trim0x } from '@1inch/byte-utils';
|
|
34
|
-
import { Address } from '@1inch/limit-order-sdk';
|
|
35
|
-
import { getCreate2Address, keccak256 } from 'ethers';
|
|
36
|
-
import assert from 'assert';
|
|
37
|
-
export var ProxyFactory = /*#__PURE__*/ function() {
|
|
38
|
-
"use strict";
|
|
39
|
-
function ProxyFactory(factory, implementation) {
|
|
40
|
-
_class_call_check(this, ProxyFactory);
|
|
41
|
-
_define_property(this, "factory", void 0);
|
|
42
|
-
_define_property(this, "implementation", void 0);
|
|
43
|
-
this.factory = factory;
|
|
44
|
-
this.implementation = implementation;
|
|
45
|
-
}
|
|
46
|
-
_create_class(ProxyFactory, [
|
|
47
|
-
{
|
|
48
|
-
key: "getProxyAddress",
|
|
49
|
-
value: /**
|
|
50
|
-
* Calculates deterministic address of proxy contract
|
|
51
|
-
*
|
|
52
|
-
* @see https://github.com/OpenZeppelin/openzeppelin-contracts/blob/69c8def5f222ff96f2b5beff05dfba996368aa79/contracts/proxy/Clones.sol#L60
|
|
53
|
-
*
|
|
54
|
-
* @param salt must be valid hex string
|
|
55
|
-
* @returns address of proxy contract
|
|
56
|
-
*/ function getProxyAddress(salt) {
|
|
57
|
-
assert(isHexBytes(salt), 'invalid salt');
|
|
58
|
-
return new Address(getCreate2Address(this.factory.toString(), salt, ProxyFactory.calcProxyBytecodeHash(this.implementation)));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
], [
|
|
62
|
-
{
|
|
63
|
-
key: "calcProxyBytecodeHash",
|
|
64
|
-
value: /**
|
|
65
|
-
* See https://github.com/1inch/cross-chain-swap/blob/03d99b9604d8f7a5a396720fbe1059f7d94db762/contracts/libraries/ProxyHashLib.sol#L14
|
|
66
|
-
*/ function calcProxyBytecodeHash(impl) {
|
|
67
|
-
return keccak256("0x3d602d80600a3d3981f3363d3d373d3d3d363d73".concat(trim0x(impl.toString()), "5af43d82803e903d91602b57fd5bf3"));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
]);
|
|
71
|
-
return ProxyFactory;
|
|
72
|
-
}();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Address } from '@1inch/limit-order-sdk';
|
|
2
|
-
import { CallInfo } from './types.js';
|
|
3
|
-
import { FusionOrder } from '../fusion-order/index.js';
|
|
4
|
-
export declare class NativeOrdersFactory {
|
|
5
|
-
address: Address;
|
|
6
|
-
private readonly iface;
|
|
7
|
-
constructor(address: Address);
|
|
8
|
-
create(maker: Address, order: FusionOrder): CallInfo;
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Address, LimitOrderV4Struct } from '@1inch/limit-order-sdk';
|
|
2
|
-
import { CallInfo } from './types.js';
|
|
3
|
-
export declare class NativeOrdersImpl {
|
|
4
|
-
address: Address;
|
|
5
|
-
private readonly iface;
|
|
6
|
-
constructor(address: Address);
|
|
7
|
-
cancel(maker: Address, order: LimitOrderV4Struct): CallInfo;
|
|
8
|
-
cancelExpiredOrderByResolver(maker: Address, order: LimitOrderV4Struct, rewardLimit: bigint): CallInfo;
|
|
9
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Address } from '@1inch/limit-order-sdk';
|
|
2
|
-
export declare class ProxyFactory {
|
|
3
|
-
readonly factory: Address;
|
|
4
|
-
readonly implementation: Address;
|
|
5
|
-
constructor(factory: Address, implementation: Address);
|
|
6
|
-
static calcProxyBytecodeHash(impl: Address): string;
|
|
7
|
-
getProxyAddress(salt: string): Address;
|
|
8
|
-
}
|