@1inch/fusion-sdk 2.3.9-rc.0 → 2.3.9-rc.2
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/cjs/abi/NativeOrderFactory.abi.json +217 -0
- package/dist/cjs/abi/NativeOrderImpl.abi.json +281 -0
- package/dist/cjs/api/quoter/quote/quote.js +5 -4
- package/dist/cjs/api/quoter/types.js +0 -2
- package/dist/cjs/contracts/index.js +20 -0
- package/dist/cjs/contracts/native-order-factory.js +115 -0
- package/dist/cjs/contracts/native-order-impl.js +129 -0
- package/dist/cjs/contracts/proxy-factory.js +87 -0
- package/dist/cjs/fusion-order/fusion-order.js +66 -2
- package/dist/cjs/fusion-order/fusion-order.spec.js +73 -0
- package/dist/cjs/fusion-order/index.js +0 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/sdk/sdk.js +76 -38
- package/dist/esm/abi/NativeOrderFactory.abi.json +217 -0
- package/dist/esm/abi/NativeOrderImpl.abi.json +281 -0
- package/dist/esm/api/quoter/quote/quote.js +6 -5
- package/dist/esm/api/quoter/types.js +0 -2
- package/dist/esm/contracts/index.js +3 -0
- package/dist/esm/contracts/native-order-factory.js +100 -0
- package/dist/esm/contracts/native-order-impl.js +114 -0
- package/dist/esm/contracts/proxy-factory.js +72 -0
- package/dist/esm/fusion-order/fusion-order.js +64 -0
- package/dist/esm/fusion-order/fusion-order.spec.js +73 -0
- package/dist/esm/fusion-order/index.js +0 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/package.json +1 -1
- package/dist/esm/sdk/sdk.js +76 -38
- package/dist/types/src/api/quoter/quote/quote.d.ts +4 -3
- package/dist/types/src/api/quoter/types.d.ts +2 -1
- package/dist/types/src/contracts/index.d.ts +3 -0
- package/dist/types/src/contracts/native-order-factory.d.ts +9 -0
- package/dist/types/src/contracts/native-order-impl.d.ts +9 -0
- package/dist/types/src/contracts/proxy-factory.d.ts +8 -0
- package/dist/types/src/fusion-order/fusion-order.d.ts +6 -0
- package/dist/types/src/fusion-order/index.d.ts +0 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/sdk/sdk.d.ts +4 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/cjs/abi/ETHOrders.abi.json +0 -431
- package/dist/cjs/contracts/eth-orders.extension.js +0 -105
- package/dist/cjs/fusion-order/fusion-order-from-native.js +0 -183
- package/dist/esm/abi/ETHOrders.abi.json +0 -431
- package/dist/esm/contracts/eth-orders.extension.js +0 -90
- package/dist/esm/fusion-order/fusion-order-from-native.js +0 -173
- package/dist/types/src/contracts/eth-orders.extension.d.ts +0 -11
- package/dist/types/src/fusion-order/fusion-order-from-native.d.ts +0 -13
|
@@ -0,0 +1,217 @@
|
|
|
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
|
+
]
|
|
@@ -0,0 +1,281 @@
|
|
|
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
|
+
"outputs": [],
|
|
82
|
+
"stateMutability": "nonpayable"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"type": "function",
|
|
86
|
+
"name": "cancelOrder",
|
|
87
|
+
"inputs": [
|
|
88
|
+
{
|
|
89
|
+
"name": "makerOrder",
|
|
90
|
+
"type": "tuple",
|
|
91
|
+
"internalType": "struct IOrderMixin.Order",
|
|
92
|
+
"components": [
|
|
93
|
+
{
|
|
94
|
+
"name": "salt",
|
|
95
|
+
"type": "uint256",
|
|
96
|
+
"internalType": "uint256"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "maker",
|
|
100
|
+
"type": "uint256",
|
|
101
|
+
"internalType": "Address"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "receiver",
|
|
105
|
+
"type": "uint256",
|
|
106
|
+
"internalType": "Address"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "makerAsset",
|
|
110
|
+
"type": "uint256",
|
|
111
|
+
"internalType": "Address"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "takerAsset",
|
|
115
|
+
"type": "uint256",
|
|
116
|
+
"internalType": "Address"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "makingAmount",
|
|
120
|
+
"type": "uint256",
|
|
121
|
+
"internalType": "uint256"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "takingAmount",
|
|
125
|
+
"type": "uint256",
|
|
126
|
+
"internalType": "uint256"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "makerTraits",
|
|
130
|
+
"type": "uint256",
|
|
131
|
+
"internalType": "MakerTraits"
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"outputs": [],
|
|
137
|
+
"stateMutability": "nonpayable"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"type": "function",
|
|
141
|
+
"name": "decimals",
|
|
142
|
+
"inputs": [],
|
|
143
|
+
"outputs": [{"name": "", "type": "uint8", "internalType": "uint8"}],
|
|
144
|
+
"stateMutability": "pure"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"type": "function",
|
|
148
|
+
"name": "depositAndApprove",
|
|
149
|
+
"inputs": [],
|
|
150
|
+
"outputs": [],
|
|
151
|
+
"stateMutability": "payable"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"type": "function",
|
|
155
|
+
"name": "isValidSignature",
|
|
156
|
+
"inputs": [
|
|
157
|
+
{"name": "hash", "type": "bytes32", "internalType": "bytes32"},
|
|
158
|
+
{"name": "signature", "type": "bytes", "internalType": "bytes"}
|
|
159
|
+
],
|
|
160
|
+
"outputs": [{"name": "", "type": "bytes4", "internalType": "bytes4"}],
|
|
161
|
+
"stateMutability": "view"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"type": "function",
|
|
165
|
+
"name": "name",
|
|
166
|
+
"inputs": [],
|
|
167
|
+
"outputs": [{"name": "", "type": "string", "internalType": "string"}],
|
|
168
|
+
"stateMutability": "pure"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"type": "function",
|
|
172
|
+
"name": "rescueFunds",
|
|
173
|
+
"inputs": [
|
|
174
|
+
{"name": "token", "type": "address", "internalType": "address"},
|
|
175
|
+
{"name": "to", "type": "address", "internalType": "address"},
|
|
176
|
+
{"name": "amount", "type": "uint256", "internalType": "uint256"}
|
|
177
|
+
],
|
|
178
|
+
"outputs": [],
|
|
179
|
+
"stateMutability": "nonpayable"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"type": "function",
|
|
183
|
+
"name": "symbol",
|
|
184
|
+
"inputs": [],
|
|
185
|
+
"outputs": [{"name": "", "type": "string", "internalType": "string"}],
|
|
186
|
+
"stateMutability": "pure"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"type": "event",
|
|
190
|
+
"name": "NativeOrderCancelled",
|
|
191
|
+
"inputs": [
|
|
192
|
+
{
|
|
193
|
+
"name": "makerOrderHash",
|
|
194
|
+
"type": "bytes32",
|
|
195
|
+
"indexed": false,
|
|
196
|
+
"internalType": "bytes32"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "balance",
|
|
200
|
+
"type": "uint256",
|
|
201
|
+
"indexed": false,
|
|
202
|
+
"internalType": "uint256"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"name": "resolverReward",
|
|
206
|
+
"type": "uint256",
|
|
207
|
+
"indexed": false,
|
|
208
|
+
"internalType": "uint256"
|
|
209
|
+
}
|
|
210
|
+
],
|
|
211
|
+
"anonymous": false
|
|
212
|
+
},
|
|
213
|
+
{"type": "error", "name": "CanNotCancelForZeroBalance", "inputs": []},
|
|
214
|
+
{"type": "error", "name": "EthDepositRejected", "inputs": []},
|
|
215
|
+
{"type": "error", "name": "ForceApproveFailed", "inputs": []},
|
|
216
|
+
{
|
|
217
|
+
"type": "error",
|
|
218
|
+
"name": "OnlyFactoryViolation",
|
|
219
|
+
"inputs": [
|
|
220
|
+
{"name": "sender", "type": "address", "internalType": "address"},
|
|
221
|
+
{"name": "factory", "type": "address", "internalType": "address"}
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"type": "error",
|
|
226
|
+
"name": "OnlyLimitOrderProtocolViolation",
|
|
227
|
+
"inputs": [
|
|
228
|
+
{"name": "sender", "type": "address", "internalType": "address"},
|
|
229
|
+
{
|
|
230
|
+
"name": "limitOrderProtocol",
|
|
231
|
+
"type": "address",
|
|
232
|
+
"internalType": "address"
|
|
233
|
+
}
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"type": "error",
|
|
238
|
+
"name": "OrderIsIncorrect",
|
|
239
|
+
"inputs": [
|
|
240
|
+
{"name": "expected", "type": "address", "internalType": "address"},
|
|
241
|
+
{"name": "actual", "type": "address", "internalType": "address"}
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"type": "error",
|
|
246
|
+
"name": "OrderShouldBeExpired",
|
|
247
|
+
"inputs": [
|
|
248
|
+
{
|
|
249
|
+
"name": "currentTime",
|
|
250
|
+
"type": "uint256",
|
|
251
|
+
"internalType": "uint256"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"name": "expirationTime",
|
|
255
|
+
"type": "uint256",
|
|
256
|
+
"internalType": "uint256"
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"type": "error",
|
|
262
|
+
"name": "RescueFundsTooMuch",
|
|
263
|
+
"inputs": [
|
|
264
|
+
{"name": "requested", "type": "uint256", "internalType": "uint256"},
|
|
265
|
+
{"name": "available", "type": "uint256", "internalType": "uint256"}
|
|
266
|
+
]
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"type": "error",
|
|
270
|
+
"name": "ResolverAccessTokenMissing",
|
|
271
|
+
"inputs": [
|
|
272
|
+
{"name": "resolver", "type": "address", "internalType": "address"},
|
|
273
|
+
{
|
|
274
|
+
"name": "accessToken",
|
|
275
|
+
"type": "address",
|
|
276
|
+
"internalType": "address"
|
|
277
|
+
}
|
|
278
|
+
]
|
|
279
|
+
},
|
|
280
|
+
{"type": "error", "name": "SafeTransferFailed", "inputs": []}
|
|
281
|
+
]
|
|
@@ -17,6 +17,7 @@ var _preset = require("../preset.js");
|
|
|
17
17
|
var _index = require("../../../fusion-order/index.js");
|
|
18
18
|
var _constants = require("../../../fusion-order/constants.js");
|
|
19
19
|
var _index1 = require("../../../fusion-order/fees/index.js");
|
|
20
|
+
var _index2 = require("../../../index.js");
|
|
20
21
|
function _class_call_check(instance, Constructor) {
|
|
21
22
|
if (!(instance instanceof Constructor)) {
|
|
22
23
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -66,7 +67,7 @@ var Quote = /*#__PURE__*/ function() {
|
|
|
66
67
|
/**
|
|
67
68
|
* Native asset extension address
|
|
68
69
|
* @see https://github.com/1inch/limit-order-settlement todo: update link
|
|
69
|
-
*/ _define_property(this, "
|
|
70
|
+
*/ _define_property(this, "nativeOrderFactory", void 0);
|
|
70
71
|
_define_property(this, "fromTokenAmount", void 0);
|
|
71
72
|
_define_property(this, "presets", void 0);
|
|
72
73
|
_define_property(this, "recommendedPreset", void 0);
|
|
@@ -95,7 +96,7 @@ var Quote = /*#__PURE__*/ function() {
|
|
|
95
96
|
this.recommendedPreset = response.recommended_preset;
|
|
96
97
|
this.slippage = response.autoK;
|
|
97
98
|
this.settlementAddress = new _limitordersdk.Address(response.settlementAddress);
|
|
98
|
-
this.
|
|
99
|
+
this.nativeOrderFactory = response.nativeOrderFactoryAddress && response.nativeOrderImplAddress ? new _index2.ProxyFactory(new _limitordersdk.Address(response.nativeOrderFactoryAddress), new _limitordersdk.Address(response.nativeOrderImplAddress)) : undefined;
|
|
99
100
|
this.resolverFeePreset = {
|
|
100
101
|
receiver: new _limitordersdk.Address(response.fee.receiver),
|
|
101
102
|
whitelistDiscountPercent: _limitordersdk.Bps.fromPercent(response.fee.whitelistDiscountPercent),
|
|
@@ -188,8 +189,8 @@ var Quote = /*#__PURE__*/ function() {
|
|
|
188
189
|
key: "_createOrder",
|
|
189
190
|
value: function _createOrder(chainId, settlementExtension, orderInfo, details, extra) {
|
|
190
191
|
if (this.params.fromTokenAddress.isNative()) {
|
|
191
|
-
(0, _assert.default)(this.
|
|
192
|
-
return _index.
|
|
192
|
+
(0, _assert.default)(this.nativeOrderFactory, 'expected nativeOrderFactory to be set for order from native asset');
|
|
193
|
+
return _index.FusionOrder.fromNative(chainId, this.nativeOrderFactory, settlementExtension, orderInfo, details, extra);
|
|
193
194
|
}
|
|
194
195
|
return _index.FusionOrder.new(settlementExtension, orderInfo, details, extra);
|
|
195
196
|
}
|
|
@@ -14,8 +14,6 @@ Object.defineProperty(exports, "PresetEnum", {
|
|
|
14
14
|
* Optional slippage value in percent (e.g., 1 for 1%, max 50)
|
|
15
15
|
* Must be between 1 and 50 inclusive
|
|
16
16
|
*/ /**
|
|
17
|
-
* Present if src token is native
|
|
18
|
-
*/ /**
|
|
19
17
|
* In bps
|
|
20
18
|
*/ /**
|
|
21
19
|
* Percentage of the integrator fee that will be shared with the integrator.
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
function _export_star(from, to) {
|
|
9
|
+
Object.keys(from).forEach(function(k) {
|
|
10
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
11
|
+
Object.defineProperty(to, k, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function() {
|
|
14
|
+
return from[k];
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return from;
|
|
20
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
}();
|