@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.
Files changed (34) hide show
  1. package/README.md +101 -0
  2. package/dist/cjs/api/quoter/quote/quote.js +2 -2
  3. package/dist/cjs/fusion-order/fusion-order.js +10 -31
  4. package/dist/cjs/fusion-order/fusion-order.spec.js +3 -4
  5. package/dist/cjs/index.js +9 -1
  6. package/dist/esm/api/quoter/quote/quote.js +2 -2
  7. package/dist/esm/fusion-order/fusion-order.js +8 -29
  8. package/dist/esm/fusion-order/fusion-order.spec.js +1 -2
  9. package/dist/esm/index.js +1 -2
  10. package/dist/esm/package.json +1 -1
  11. package/dist/types/src/api/quoter/quote/quote.d.ts +1 -2
  12. package/dist/types/src/fusion-order/fusion-order.d.ts +2 -3
  13. package/dist/types/src/index.d.ts +1 -2
  14. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  15. package/package.json +3 -3
  16. package/dist/cjs/abi/NativeOrderFactory.abi.json +0 -217
  17. package/dist/cjs/abi/NativeOrderImpl.abi.json +0 -286
  18. package/dist/cjs/contracts/index.js +0 -21
  19. package/dist/cjs/contracts/native-order-factory.js +0 -115
  20. package/dist/cjs/contracts/native-order-impl.js +0 -130
  21. package/dist/cjs/contracts/proxy-factory.js +0 -87
  22. package/dist/cjs/contracts/types.js +0 -4
  23. package/dist/esm/abi/NativeOrderFactory.abi.json +0 -217
  24. package/dist/esm/abi/NativeOrderImpl.abi.json +0 -286
  25. package/dist/esm/contracts/index.js +0 -4
  26. package/dist/esm/contracts/native-order-factory.js +0 -100
  27. package/dist/esm/contracts/native-order-impl.js +0 -115
  28. package/dist/esm/contracts/proxy-factory.js +0 -72
  29. package/dist/esm/contracts/types.js +0 -1
  30. package/dist/types/src/contracts/index.d.ts +0 -4
  31. package/dist/types/src/contracts/native-order-factory.d.ts +0 -9
  32. package/dist/types/src/contracts/native-order-impl.d.ts +0 -9
  33. package/dist/types/src/contracts/proxy-factory.d.ts +0 -8
  34. package/dist/types/src/contracts/types.d.ts +0 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1inch/fusion-sdk",
3
- "version": "2.3.9-rc.9",
3
+ "version": "2.4.0",
4
4
  "description": "1inch Fusion SDK",
5
5
  "author": "@1inch",
6
6
  "files": [
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@1inch/byte-utils": "^3.1.0",
37
- "@1inch/limit-order-sdk": "5.0.5",
37
+ "@1inch/limit-order-sdk": "5.2.2",
38
38
  "ethers": "^6.14.1",
39
39
  "tslib": "^2.8.1",
40
40
  "ws": "^8.18.2"
@@ -50,7 +50,7 @@
50
50
  "@types/ws": "^8.18.1",
51
51
  "@typescript-eslint/eslint-plugin": "^8.32.1",
52
52
  "@typescript-eslint/parser": "^8.32.1",
53
- "axios": "^1.9.0",
53
+ "axios": "^1.11.0",
54
54
  "eslint": "~9.18.0",
55
55
  "eslint-config-prettier": "^10.1.5",
56
56
  "eslint-config-standard": "^17.1.0",
@@ -1,217 +0,0 @@
1
- [
2
- {
3
- "type": "constructor",
4
- "inputs": [
5
- {
6
- "name": "weth",
7
- "type": "address",
8
- "internalType": "contract IWETH"
9
- },
10
- {
11
- "name": "nativeOrderImplementation",
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
- {
29
- "type": "function",
30
- "name": "create",
31
- "inputs": [
32
- {
33
- "name": "makerOrder",
34
- "type": "tuple",
35
- "internalType": "struct IOrderMixin.Order",
36
- "components": [
37
- {
38
- "name": "salt",
39
- "type": "uint256",
40
- "internalType": "uint256"
41
- },
42
- {
43
- "name": "maker",
44
- "type": "uint256",
45
- "internalType": "Address"
46
- },
47
- {
48
- "name": "receiver",
49
- "type": "uint256",
50
- "internalType": "Address"
51
- },
52
- {
53
- "name": "makerAsset",
54
- "type": "uint256",
55
- "internalType": "Address"
56
- },
57
- {
58
- "name": "takerAsset",
59
- "type": "uint256",
60
- "internalType": "Address"
61
- },
62
- {
63
- "name": "makingAmount",
64
- "type": "uint256",
65
- "internalType": "uint256"
66
- },
67
- {
68
- "name": "takingAmount",
69
- "type": "uint256",
70
- "internalType": "uint256"
71
- },
72
- {
73
- "name": "makerTraits",
74
- "type": "uint256",
75
- "internalType": "MakerTraits"
76
- }
77
- ]
78
- }
79
- ],
80
- "outputs": [
81
- {"name": "clone", "type": "address", "internalType": "address"}
82
- ],
83
- "stateMutability": "payable"
84
- },
85
- {
86
- "type": "function",
87
- "name": "owner",
88
- "inputs": [],
89
- "outputs": [{"name": "", "type": "address", "internalType": "address"}],
90
- "stateMutability": "view"
91
- },
92
- {
93
- "type": "function",
94
- "name": "renounceOwnership",
95
- "inputs": [],
96
- "outputs": [],
97
- "stateMutability": "nonpayable"
98
- },
99
- {
100
- "type": "function",
101
- "name": "rescueFunds",
102
- "inputs": [
103
- {"name": "token", "type": "address", "internalType": "address"},
104
- {"name": "to", "type": "address", "internalType": "address"},
105
- {"name": "amount", "type": "uint256", "internalType": "uint256"}
106
- ],
107
- "outputs": [],
108
- "stateMutability": "nonpayable"
109
- },
110
- {
111
- "type": "function",
112
- "name": "transferOwnership",
113
- "inputs": [
114
- {"name": "newOwner", "type": "address", "internalType": "address"}
115
- ],
116
- "outputs": [],
117
- "stateMutability": "nonpayable"
118
- },
119
- {
120
- "type": "event",
121
- "name": "NativeOrderCreated",
122
- "inputs": [
123
- {
124
- "name": "maker",
125
- "type": "address",
126
- "indexed": false,
127
- "internalType": "address"
128
- },
129
- {
130
- "name": "orderHash",
131
- "type": "bytes32",
132
- "indexed": false,
133
- "internalType": "bytes32"
134
- },
135
- {
136
- "name": "clone",
137
- "type": "address",
138
- "indexed": false,
139
- "internalType": "address"
140
- },
141
- {
142
- "name": "value",
143
- "type": "uint256",
144
- "indexed": false,
145
- "internalType": "uint256"
146
- }
147
- ],
148
- "anonymous": false
149
- },
150
- {
151
- "type": "event",
152
- "name": "OwnershipTransferred",
153
- "inputs": [
154
- {
155
- "name": "previousOwner",
156
- "type": "address",
157
- "indexed": true,
158
- "internalType": "address"
159
- },
160
- {
161
- "name": "newOwner",
162
- "type": "address",
163
- "indexed": true,
164
- "internalType": "address"
165
- }
166
- ],
167
- "anonymous": false
168
- },
169
- {"type": "error", "name": "FailedDeployment", "inputs": []},
170
- {
171
- "type": "error",
172
- "name": "InsufficientBalance",
173
- "inputs": [
174
- {"name": "balance", "type": "uint256", "internalType": "uint256"},
175
- {"name": "needed", "type": "uint256", "internalType": "uint256"}
176
- ]
177
- },
178
- {
179
- "type": "error",
180
- "name": "OrderMakerShouldBeMsgSender",
181
- "inputs": [
182
- {"name": "expected", "type": "address", "internalType": "address"},
183
- {"name": "actual", "type": "address", "internalType": "address"}
184
- ]
185
- },
186
- {
187
- "type": "error",
188
- "name": "OrderMakingAmountShouldBeEqualToMsgValue",
189
- "inputs": [
190
- {"name": "expected", "type": "uint256", "internalType": "uint256"},
191
- {"name": "actual", "type": "uint256", "internalType": "uint256"}
192
- ]
193
- },
194
- {
195
- "type": "error",
196
- "name": "OrderReceiverShouldNotBeThis",
197
- "inputs": [
198
- {"name": "receiver", "type": "address", "internalType": "address"},
199
- {"name": "self", "type": "address", "internalType": "address"}
200
- ]
201
- },
202
- {
203
- "type": "error",
204
- "name": "OwnableInvalidOwner",
205
- "inputs": [
206
- {"name": "owner", "type": "address", "internalType": "address"}
207
- ]
208
- },
209
- {
210
- "type": "error",
211
- "name": "OwnableUnauthorizedAccount",
212
- "inputs": [
213
- {"name": "account", "type": "address", "internalType": "address"}
214
- ]
215
- },
216
- {"type": "error", "name": "SafeTransferFailed", "inputs": []}
217
- ]
@@ -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,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- _export_star(require("./native-order-factory.js"), exports);
6
- _export_star(require("./native-order-impl.js"), exports);
7
- _export_star(require("./proxy-factory.js"), exports);
8
- _export_star(require("./types.js"), exports);
9
- function _export_star(from, to) {
10
- Object.keys(from).forEach(function(k) {
11
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
12
- Object.defineProperty(to, k, {
13
- enumerable: true,
14
- get: function() {
15
- return from[k];
16
- }
17
- });
18
- }
19
- });
20
- return from;
21
- }
@@ -1,115 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "NativeOrdersFactory", {
6
- enumerable: true,
7
- get: function() {
8
- return NativeOrdersFactory;
9
- }
10
- });
11
- var _ethers = require("ethers");
12
- var _NativeOrderFactoryabijson = /*#__PURE__*/ _interop_require_default(require("../abi/NativeOrderFactory.abi.json"));
13
- function _class_call_check(instance, Constructor) {
14
- if (!(instance instanceof Constructor)) {
15
- throw new TypeError("Cannot call a class as a function");
16
- }
17
- }
18
- function _defineProperties(target, props) {
19
- for(var i = 0; i < props.length; i++){
20
- var descriptor = props[i];
21
- descriptor.enumerable = descriptor.enumerable || false;
22
- descriptor.configurable = true;
23
- if ("value" in descriptor) descriptor.writable = true;
24
- Object.defineProperty(target, descriptor.key, descriptor);
25
- }
26
- }
27
- function _create_class(Constructor, protoProps, staticProps) {
28
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
29
- if (staticProps) _defineProperties(Constructor, staticProps);
30
- return Constructor;
31
- }
32
- function _define_property(obj, key, value) {
33
- if (key in obj) {
34
- Object.defineProperty(obj, key, {
35
- value: value,
36
- enumerable: true,
37
- configurable: true,
38
- writable: true
39
- });
40
- } else {
41
- obj[key] = value;
42
- }
43
- return obj;
44
- }
45
- function _interop_require_default(obj) {
46
- return obj && obj.__esModule ? obj : {
47
- default: obj
48
- };
49
- }
50
- function _object_spread(target) {
51
- for(var i = 1; i < arguments.length; i++){
52
- var source = arguments[i] != null ? arguments[i] : {};
53
- var ownKeys = Object.keys(source);
54
- if (typeof Object.getOwnPropertySymbols === "function") {
55
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
56
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
57
- }));
58
- }
59
- ownKeys.forEach(function(key) {
60
- _define_property(target, key, source[key]);
61
- });
62
- }
63
- return target;
64
- }
65
- function ownKeys(object, enumerableOnly) {
66
- var keys = Object.keys(object);
67
- if (Object.getOwnPropertySymbols) {
68
- var symbols = Object.getOwnPropertySymbols(object);
69
- if (enumerableOnly) {
70
- symbols = symbols.filter(function(sym) {
71
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
72
- });
73
- }
74
- keys.push.apply(keys, symbols);
75
- }
76
- return keys;
77
- }
78
- function _object_spread_props(target, source) {
79
- source = source != null ? source : {};
80
- if (Object.getOwnPropertyDescriptors) {
81
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
82
- } else {
83
- ownKeys(Object(source)).forEach(function(key) {
84
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
85
- });
86
- }
87
- return target;
88
- }
89
- var NativeOrdersFactory = /*#__PURE__*/ function() {
90
- "use strict";
91
- function NativeOrdersFactory(address) {
92
- _class_call_check(this, NativeOrdersFactory);
93
- _define_property(this, "address", void 0);
94
- _define_property(this, "iface", void 0);
95
- this.address = address;
96
- this.iface = new _ethers.Interface(_NativeOrderFactoryabijson.default);
97
- }
98
- _create_class(NativeOrdersFactory, [
99
- {
100
- key: "create",
101
- value: function create(maker, order) {
102
- return {
103
- to: this.address,
104
- value: order.makingAmount,
105
- data: this.iface.encodeFunctionData('create', [
106
- _object_spread_props(_object_spread({}, order.build()), {
107
- maker: maker.toString()
108
- })
109
- ])
110
- };
111
- }
112
- }
113
- ]);
114
- return NativeOrdersFactory;
115
- }();