@1inch/fusion-sdk 0.0.4 → 0.0.6
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/api/fusion-api.d.ts +25 -16
- package/api/fusion-api.js +36 -26
- package/api/index.d.ts +4 -4
- package/api/index.js +8 -8
- package/api/orders/index.d.ts +3 -3
- package/api/orders/index.js +7 -7
- package/api/orders/order-api.spec.d.ts +1 -1
- package/api/orders/order-api.spec.js +479 -395
- package/api/orders/order-api.spec.js.map +1 -1
- package/api/orders/orders.api.d.ts +24 -10
- package/api/orders/orders.api.js +30 -28
- package/api/orders/orders.request.d.ts +22 -18
- package/api/orders/orders.request.js +40 -31
- package/api/orders/types.d.ts +59 -57
- package/api/orders/types.js +17 -16
- package/api/orders/types.js.map +1 -1
- package/api/pagination.d.ts +7 -7
- package/api/pagination.js +10 -10
- package/api/pagination.spec.d.ts +1 -1
- package/api/pagination.spec.js +28 -21
- package/api/params.d.ts +3 -1
- package/api/params.js +25 -19
- package/api/quoter/index.d.ts +5 -5
- package/api/quoter/index.js +9 -9
- package/api/quoter/preset.d.ts +13 -13
- package/api/quoter/preset.js +19 -17
- package/api/quoter/quote/index.d.ts +3 -3
- package/api/quoter/quote/index.js +7 -7
- package/api/quoter/quote/order-params.d.ts +6 -6
- package/api/quoter/quote/order-params.js +12 -12
- package/api/quoter/quote/quote.d.ts +26 -21
- package/api/quoter/quote/quote.js +85 -52
- package/api/quoter/quote/quote.js.map +1 -1
- package/api/quoter/quote/types.d.ts +4 -4
- package/api/quoter/quote/types.js +3 -3
- package/api/quoter/quoter.api.d.ts +12 -9
- package/api/quoter/quoter.api.js +19 -19
- package/api/quoter/quoter.api.spec.d.ts +1 -1
- package/api/quoter/quoter.api.spec.js +32 -23
- package/api/quoter/quoter.api.spec.js.map +1 -1
- package/api/quoter/quoter.request.d.ts +11 -11
- package/api/quoter/quoter.request.js +28 -26
- package/api/quoter/types.d.ts +45 -44
- package/api/quoter/types.js +10 -10
- package/api/quoter/types.js.map +1 -1
- package/api/relayer/index.d.ts +3 -3
- package/api/relayer/index.js +7 -7
- package/api/relayer/relayer.api.d.ts +12 -9
- package/api/relayer/relayer.api.js +13 -13
- package/api/relayer/relayer.api.spec.d.ts +1 -1
- package/api/relayer/relayer.api.spec.js +96 -79
- package/api/relayer/relayer.request.d.ts +8 -8
- package/api/relayer/relayer.request.js +10 -10
- package/api/relayer/types.d.ts +9 -9
- package/api/relayer/types.js +3 -3
- package/api/types.d.ts +17 -15
- package/api/types.js +3 -3
- package/auction-calculator/auction-calculator.d.ts +22 -13
- package/auction-calculator/auction-calculator.js +70 -45
- package/auction-calculator/auction-calculator.spec.d.ts +1 -1
- package/auction-calculator/auction-calculator.spec.js +45 -32
- package/auction-calculator/calc.d.ts +8 -2
- package/auction-calculator/calc.js +12 -12
- package/auction-calculator/constants.d.ts +1 -1
- package/auction-calculator/constants.js +5 -5
- package/auction-calculator/index.d.ts +3 -3
- package/auction-calculator/index.js +7 -7
- package/auction-salt/auction-salt.d.ts +9 -9
- package/auction-salt/auction-salt.js +34 -23
- package/auction-salt/auction.salt.spec.d.ts +1 -1
- package/auction-salt/auction.salt.spec.js +38 -27
- package/auction-salt/index.d.ts +3 -3
- package/auction-salt/index.js +7 -7
- package/auction-salt/parser/constants.d.ts +9 -9
- package/auction-salt/parser/constants.js +33 -14
- package/auction-salt/parser/index.d.ts +2 -2
- package/auction-salt/parser/index.js +6 -6
- package/auction-salt/parser/parser.d.ts +6 -6
- package/auction-salt/parser/parser.js +33 -22
- package/auction-salt/types.d.ts +6 -6
- package/auction-salt/types.js +3 -3
- package/auction-suffix/auction-suffix.d.ts +9 -9
- package/auction-suffix/auction-suffix.js +36 -23
- package/auction-suffix/auction-suffix.spec.d.ts +1 -1
- package/auction-suffix/auction-suffix.spec.js +20 -15
- package/auction-suffix/constants.d.ts +1 -1
- package/auction-suffix/constants.js +5 -5
- package/auction-suffix/encoder.d.ts +15 -6
- package/auction-suffix/encoder.js +45 -28
- package/auction-suffix/index.d.ts +5 -5
- package/auction-suffix/index.js +9 -9
- package/auction-suffix/parser/constants.d.ts +13 -13
- package/auction-suffix/parser/constants.js +30 -17
- package/auction-suffix/parser/errors.d.ts +1 -2
- package/auction-suffix/parser/errors.js +6 -7
- package/auction-suffix/parser/index.d.ts +4 -4
- package/auction-suffix/parser/index.js +8 -8
- package/auction-suffix/parser/parser.d.ts +28 -8
- package/auction-suffix/parser/parser.js +162 -81
- package/auction-suffix/parser/types.d.ts +22 -22
- package/auction-suffix/parser/types.js +3 -3
- package/auction-suffix/types.d.ts +12 -12
- package/auction-suffix/types.js +3 -3
- package/connector/blockchain/blockchain-provider.connector.d.ts +6 -3
- package/connector/blockchain/blockchain-provider.connector.js +3 -3
- package/connector/blockchain/index.d.ts +3 -3
- package/connector/blockchain/index.js +7 -7
- package/connector/blockchain/private-key-provider.connector.d.ts +15 -10
- package/connector/blockchain/private-key-provider.connector.js +12 -12
- package/connector/blockchain/private-key-provider.connector.spec.d.ts +1 -1
- package/connector/blockchain/private-key-provider.connector.spec.js +36 -23
- package/connector/blockchain/web3-provider-connector.d.ts +13 -8
- package/connector/blockchain/web3-provider-connector.js +12 -9
- package/connector/blockchain/web3-provider.connector.spec.d.ts +1 -1
- package/connector/blockchain/web3-provider.connector.spec.js +37 -26
- package/connector/http/axios-provider.connector.d.ts +3 -3
- package/connector/http/axios-provider.connector.js +13 -13
- package/connector/http/axios-provider.connector.spec.d.ts +1 -1
- package/connector/http/axios-provider.connector.spec.js +37 -31
- package/connector/http/http-provider.connector.d.ts +2 -2
- package/connector/http/http-provider.connector.js +3 -3
- package/connector/http/index.d.ts +2 -2
- package/connector/http/index.js +6 -6
- package/connector/index.d.ts +2 -2
- package/connector/index.js +6 -6
- package/constants.d.ts +10 -6
- package/constants.js +23 -16
- package/fusion-order/fusion-order.d.ts +17 -7
- package/fusion-order/fusion-order.js +14 -12
- package/fusion-order/fusion-order.spec.d.ts +1 -1
- package/fusion-order/fusion-order.spec.js +27 -22
- package/fusion-order/index.d.ts +1 -1
- package/fusion-order/index.js +5 -5
- package/index.d.ts +11 -11
- package/index.js +15 -15
- package/limit-order/eip712/domain.d.ts +10 -9
- package/limit-order/eip712/domain.js +28 -23
- package/limit-order/eip712/eip712.types.d.ts +19 -15
- package/limit-order/eip712/eip712.types.js +3 -3
- package/limit-order/eip712/index.d.ts +3 -3
- package/limit-order/eip712/index.js +7 -7
- package/limit-order/eip712/order-typed-data-builder.d.ts +17 -6
- package/limit-order/eip712/order-typed-data-builder.js +34 -19
- package/limit-order/index.d.ts +4 -4
- package/limit-order/index.js +8 -8
- package/limit-order/interactions-factory.d.ts +1 -1
- package/limit-order/interactions-factory.js +6 -6
- package/limit-order/limit-order.d.ts +31 -25
- package/limit-order/limit-order.js +103 -50
- package/limit-order/limit-order.spec.d.ts +1 -1
- package/limit-order/limit-order.spec.js +75 -51
- package/limit-order/parser/constants.d.ts +9 -9
- package/limit-order/parser/constants.js +5 -5
- package/limit-order/parser/index.d.ts +3 -3
- package/limit-order/parser/index.js +7 -7
- package/limit-order/parser/parser.d.ts +5 -2
- package/limit-order/parser/parser.js +23 -18
- package/limit-order/parser/types.d.ts +3 -3
- package/limit-order/parser/types.js +3 -3
- package/limit-order/predicate-factory.d.ts +9 -5
- package/limit-order/predicate-factory.js +40 -24
- package/limit-order/predicate-factory.spec.d.ts +1 -1
- package/limit-order/predicate-factory.spec.js +44 -29
- package/limit-order/types.d.ts +29 -29
- package/limit-order/types.js +3 -3
- package/limit-order/utils.d.ts +1 -1
- package/limit-order/utils.js +6 -6
- package/package.json +2 -3
- package/sdk/index.d.ts +2 -2
- package/sdk/index.js +6 -6
- package/sdk/sdk.d.ts +29 -11
- package/sdk/sdk.js +48 -38
- package/sdk/types.d.ts +27 -27
- package/sdk/types.js +3 -3
- package/settlement/encoders/constants.d.ts +1 -1
- package/settlement/encoders/constants.js +5 -5
- package/settlement/encoders/fill-order.encoder.d.ts +2 -2
- package/settlement/encoders/fill-order.encoder.js +26 -12
- package/settlement/encoders/index.d.ts +3 -3
- package/settlement/encoders/index.js +7 -7
- package/settlement/encoders/settlement.encoder.d.ts +13 -4
- package/settlement/encoders/settlement.encoder.js +41 -19
- package/settlement/index.d.ts +4 -4
- package/settlement/index.js +8 -8
- package/settlement/settlement.d.ts +8 -5
- package/settlement/settlement.js +28 -14
- package/settlement/settlement.spec.d.ts +1 -1
- package/settlement/settlement.spec.js +45 -35
- package/settlement/signature-patcher.d.ts +1 -1
- package/settlement/signature-patcher.js +19 -16
- package/settlement/types.d.ts +13 -13
- package/settlement/types.js +3 -3
- package/utils.d.ts +6 -6
- package/utils.js +29 -23
- package/validations.d.ts +2 -2
- package/validations.js +14 -15
package/api/fusion-api.d.ts
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import {FusionApiConfig} from './types'
|
|
2
|
+
import {QuoterRequest} from './quoter'
|
|
3
|
+
import {RelayerRequest} from './relayer'
|
|
4
|
+
import {Quote} from './quoter/quote/quote'
|
|
5
|
+
import {
|
|
6
|
+
ActiveOrdersRequest,
|
|
7
|
+
ActiveOrdersResponse,
|
|
8
|
+
OrdersByMakerRequest,
|
|
9
|
+
OrderStatusRequest,
|
|
10
|
+
OrderStatusResponse,
|
|
11
|
+
OrdersByMakerResponse
|
|
12
|
+
} from './orders'
|
|
6
13
|
export declare class FusionApi {
|
|
7
|
-
private readonly quoterApi
|
|
8
|
-
private readonly relayerApi
|
|
9
|
-
private readonly ordersApi
|
|
10
|
-
constructor(config: FusionApiConfig)
|
|
11
|
-
static new(config: FusionApiConfig): FusionApi
|
|
12
|
-
getQuote(params: QuoterRequest): Promise<Quote
|
|
13
|
-
getActiveOrders(params?: ActiveOrdersRequest): Promise<ActiveOrdersResponse
|
|
14
|
-
getOrderStatus(params: OrderStatusRequest): Promise<OrderStatusResponse
|
|
15
|
-
getOrdersByMaker(
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
private readonly quoterApi
|
|
15
|
+
private readonly relayerApi
|
|
16
|
+
private readonly ordersApi
|
|
17
|
+
constructor(config: FusionApiConfig)
|
|
18
|
+
static new(config: FusionApiConfig): FusionApi
|
|
19
|
+
getQuote(params: QuoterRequest): Promise<Quote>
|
|
20
|
+
getActiveOrders(params?: ActiveOrdersRequest): Promise<ActiveOrdersResponse>
|
|
21
|
+
getOrderStatus(params: OrderStatusRequest): Promise<OrderStatusResponse>
|
|
22
|
+
getOrdersByMaker(
|
|
23
|
+
params: OrdersByMakerRequest
|
|
24
|
+
): Promise<OrdersByMakerResponse>
|
|
25
|
+
submitOrder(params: RelayerRequest): Promise<void>
|
|
26
|
+
submitOrderBatch(params: RelayerRequest[]): Promise<void>
|
|
18
27
|
}
|
package/api/fusion-api.js
CHANGED
|
@@ -1,47 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.FusionApi = void 0
|
|
4
|
-
const quoter_1 = require(
|
|
5
|
-
const relayer_1 = require(
|
|
6
|
-
const connector_1 = require(
|
|
7
|
-
const orders_1 = require(
|
|
1
|
+
'use strict'
|
|
2
|
+
Object.defineProperty(exports, '__esModule', {value: true})
|
|
3
|
+
exports.FusionApi = void 0
|
|
4
|
+
const quoter_1 = require('./quoter')
|
|
5
|
+
const relayer_1 = require('./relayer')
|
|
6
|
+
const connector_1 = require('../connector')
|
|
7
|
+
const orders_1 = require('./orders')
|
|
8
8
|
class FusionApi {
|
|
9
9
|
constructor(config) {
|
|
10
|
-
this.quoterApi = quoter_1.QuoterApi.new(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
this.quoterApi = quoter_1.QuoterApi.new(
|
|
11
|
+
{
|
|
12
|
+
url: `${config.url}/quoter`,
|
|
13
|
+
network: config.network
|
|
14
|
+
},
|
|
15
|
+
config.httpProvider
|
|
16
|
+
)
|
|
17
|
+
this.relayerApi = relayer_1.RelayerApi.new(
|
|
18
|
+
{
|
|
19
|
+
url: `${config.url}/relayer`,
|
|
20
|
+
network: config.network
|
|
21
|
+
},
|
|
22
|
+
config.httpProvider
|
|
23
|
+
)
|
|
24
|
+
this.ordersApi = orders_1.OrdersApi.new(
|
|
25
|
+
{url: `${config.url}/orders`, network: config.network},
|
|
26
|
+
config.httpProvider
|
|
27
|
+
)
|
|
19
28
|
}
|
|
20
29
|
static new(config) {
|
|
21
30
|
return new FusionApi({
|
|
22
31
|
network: config.network,
|
|
23
32
|
url: config.url,
|
|
24
|
-
httpProvider:
|
|
25
|
-
|
|
33
|
+
httpProvider:
|
|
34
|
+
config.httpProvider || new connector_1.AxiosProviderConnector()
|
|
35
|
+
})
|
|
26
36
|
}
|
|
27
37
|
getQuote(params) {
|
|
28
|
-
return this.quoterApi.getQuote(params)
|
|
38
|
+
return this.quoterApi.getQuote(params)
|
|
29
39
|
}
|
|
30
40
|
getActiveOrders(params = orders_1.ActiveOrdersRequest.new()) {
|
|
31
|
-
return this.ordersApi.getActiveOrders(params)
|
|
41
|
+
return this.ordersApi.getActiveOrders(params)
|
|
32
42
|
}
|
|
33
43
|
getOrderStatus(params) {
|
|
34
|
-
return this.ordersApi.getOrderStatus(params)
|
|
44
|
+
return this.ordersApi.getOrderStatus(params)
|
|
35
45
|
}
|
|
36
46
|
getOrdersByMaker(params) {
|
|
37
|
-
return this.ordersApi.getOrdersByMaker(params)
|
|
47
|
+
return this.ordersApi.getOrdersByMaker(params)
|
|
38
48
|
}
|
|
39
49
|
submitOrder(params) {
|
|
40
|
-
return this.relayerApi.submit(params)
|
|
50
|
+
return this.relayerApi.submit(params)
|
|
41
51
|
}
|
|
42
52
|
submitOrderBatch(params) {
|
|
43
|
-
return this.relayerApi.submitBatch(params)
|
|
53
|
+
return this.relayerApi.submitBatch(params)
|
|
44
54
|
}
|
|
45
55
|
}
|
|
46
|
-
exports.FusionApi = FusionApi
|
|
47
|
-
//# sourceMappingURL=fusion-api.js.map
|
|
56
|
+
exports.FusionApi = FusionApi
|
|
57
|
+
//# sourceMappingURL=fusion-api.js.map
|
package/api/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './params'
|
|
2
|
-
export * from './quoter/index'
|
|
3
|
-
export * from './relayer/index'
|
|
4
|
-
export * from './fusion-api'
|
|
1
|
+
export * from './params'
|
|
2
|
+
export * from './quoter/index'
|
|
3
|
+
export * from './relayer/index'
|
|
4
|
+
export * from './fusion-api'
|
package/api/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
const tslib_1 = require(
|
|
4
|
-
tslib_1.__exportStar(require(
|
|
5
|
-
tslib_1.__exportStar(require(
|
|
6
|
-
tslib_1.__exportStar(require(
|
|
7
|
-
tslib_1.__exportStar(require(
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict'
|
|
2
|
+
Object.defineProperty(exports, '__esModule', {value: true})
|
|
3
|
+
const tslib_1 = require('tslib')
|
|
4
|
+
tslib_1.__exportStar(require('./params'), exports)
|
|
5
|
+
tslib_1.__exportStar(require('./quoter/index'), exports)
|
|
6
|
+
tslib_1.__exportStar(require('./relayer/index'), exports)
|
|
7
|
+
tslib_1.__exportStar(require('./fusion-api'), exports)
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
package/api/orders/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './orders.api'
|
|
2
|
-
export * from './orders.request'
|
|
3
|
-
export * from './types'
|
|
1
|
+
export * from './orders.api'
|
|
2
|
+
export * from './orders.request'
|
|
3
|
+
export * from './types'
|
package/api/orders/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
const tslib_1 = require(
|
|
4
|
-
tslib_1.__exportStar(require(
|
|
5
|
-
tslib_1.__exportStar(require(
|
|
6
|
-
tslib_1.__exportStar(require(
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict'
|
|
2
|
+
Object.defineProperty(exports, '__esModule', {value: true})
|
|
3
|
+
const tslib_1 = require('tslib')
|
|
4
|
+
tslib_1.__exportStar(require('./orders.api'), exports)
|
|
5
|
+
tslib_1.__exportStar(require('./orders.request'), exports)
|
|
6
|
+
tslib_1.__exportStar(require('./types'), exports)
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export {}
|