@1inch/fusion-sdk 0.0.5 → 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 +1 -1
- 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
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
const tslib_1 = require(
|
|
4
|
-
const fusion_order_1 = require(
|
|
5
|
-
const auction_salt_1 = require(
|
|
6
|
-
const auction_suffix_1 = require(
|
|
7
|
-
const crypto_1 = tslib_1.__importDefault(require(
|
|
1
|
+
'use strict'
|
|
2
|
+
Object.defineProperty(exports, '__esModule', {value: true})
|
|
3
|
+
const tslib_1 = require('tslib')
|
|
4
|
+
const fusion_order_1 = require('./fusion-order')
|
|
5
|
+
const auction_salt_1 = require('../auction-salt')
|
|
6
|
+
const auction_suffix_1 = require('../auction-suffix')
|
|
7
|
+
const crypto_1 = tslib_1.__importDefault(require('crypto'))
|
|
8
8
|
describe('Fusion Order', () => {
|
|
9
|
-
jest.spyOn(crypto_1.default, 'randomInt').mockImplementation(() => 10000)
|
|
9
|
+
jest.spyOn(crypto_1.default, 'randomInt').mockImplementation(() => 10000)
|
|
10
10
|
it('should create fusion order', () => {
|
|
11
11
|
const salt = new auction_salt_1.AuctionSalt({
|
|
12
12
|
duration: 180,
|
|
13
13
|
auctionStartTime: 1673548149,
|
|
14
14
|
initialRateBump: 50000,
|
|
15
15
|
bankFee: '0'
|
|
16
|
-
})
|
|
16
|
+
})
|
|
17
17
|
const suffix = new auction_suffix_1.AuctionSuffix({
|
|
18
18
|
points: [
|
|
19
19
|
{
|
|
@@ -27,17 +27,22 @@ describe('Fusion Order', () => {
|
|
|
27
27
|
allowance: 0
|
|
28
28
|
}
|
|
29
29
|
]
|
|
30
|
-
})
|
|
31
|
-
const order = new fusion_order_1.FusionOrder(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
})
|
|
31
|
+
const order = new fusion_order_1.FusionOrder(
|
|
32
|
+
{
|
|
33
|
+
makerAsset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
34
|
+
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
35
|
+
makingAmount: '1000000000000000000',
|
|
36
|
+
takingAmount: '1420000000',
|
|
37
|
+
maker: '0x00000000219ab540356cbb839cbe05303d7705fa'
|
|
38
|
+
},
|
|
39
|
+
salt,
|
|
40
|
+
suffix
|
|
41
|
+
)
|
|
38
42
|
expect(order.build()).toStrictEqual({
|
|
39
43
|
allowedSender: '0x0000000000000000000000000000000000000000',
|
|
40
|
-
interactions:
|
|
44
|
+
interactions:
|
|
45
|
+
'0x000c004e200000000000000000219ab540356cbb839cbe05303d7705faf486570009',
|
|
41
46
|
maker: '0x00000000219ab540356cbb839cbe05303d7705fa',
|
|
42
47
|
makerAsset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
43
48
|
makingAmount: '1000000000000000000',
|
|
@@ -46,7 +51,7 @@ describe('Fusion Order', () => {
|
|
|
46
51
|
salt: '45118768841948961586167738353692277076075522015101619148498725069326976558864',
|
|
47
52
|
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
48
53
|
takingAmount: '1420000000'
|
|
49
|
-
})
|
|
50
|
-
})
|
|
51
|
-
})
|
|
52
|
-
//# sourceMappingURL=fusion-order.spec.js.map
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
//# sourceMappingURL=fusion-order.spec.js.map
|
package/fusion-order/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './fusion-order'
|
|
1
|
+
export * from './fusion-order'
|
package/fusion-order/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
const tslib_1 = require(
|
|
4
|
-
tslib_1.__exportStar(require(
|
|
5
|
-
//# 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('./fusion-order'), exports)
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
package/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from './auction-suffix/index'
|
|
2
|
-
export * from './auction-salt/index'
|
|
3
|
-
export * from './fusion-order/index'
|
|
4
|
-
export * from './limit-order/index'
|
|
5
|
-
export * from './auction-calculator/index'
|
|
6
|
-
export * from './connector/index'
|
|
7
|
-
export * from './sdk/index'
|
|
8
|
-
export * from './constants'
|
|
9
|
-
export * from './utils'
|
|
10
|
-
export * from './validations'
|
|
11
|
-
export * from './settlement'
|
|
1
|
+
export * from './auction-suffix/index'
|
|
2
|
+
export * from './auction-salt/index'
|
|
3
|
+
export * from './fusion-order/index'
|
|
4
|
+
export * from './limit-order/index'
|
|
5
|
+
export * from './auction-calculator/index'
|
|
6
|
+
export * from './connector/index'
|
|
7
|
+
export * from './sdk/index'
|
|
8
|
+
export * from './constants'
|
|
9
|
+
export * from './utils'
|
|
10
|
+
export * from './validations'
|
|
11
|
+
export * from './settlement'
|
package/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
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
|
-
tslib_1.__exportStar(require(
|
|
9
|
-
tslib_1.__exportStar(require(
|
|
10
|
-
tslib_1.__exportStar(require(
|
|
11
|
-
tslib_1.__exportStar(require(
|
|
12
|
-
tslib_1.__exportStar(require(
|
|
13
|
-
tslib_1.__exportStar(require(
|
|
14
|
-
tslib_1.__exportStar(require(
|
|
15
|
-
//# 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('./auction-suffix/index'), exports)
|
|
5
|
+
tslib_1.__exportStar(require('./auction-salt/index'), exports)
|
|
6
|
+
tslib_1.__exportStar(require('./fusion-order/index'), exports)
|
|
7
|
+
tslib_1.__exportStar(require('./limit-order/index'), exports)
|
|
8
|
+
tslib_1.__exportStar(require('./auction-calculator/index'), exports)
|
|
9
|
+
tslib_1.__exportStar(require('./connector/index'), exports)
|
|
10
|
+
tslib_1.__exportStar(require('./sdk/index'), exports)
|
|
11
|
+
tslib_1.__exportStar(require('./constants'), exports)
|
|
12
|
+
tslib_1.__exportStar(require('./utils'), exports)
|
|
13
|
+
tslib_1.__exportStar(require('./validations'), exports)
|
|
14
|
+
tslib_1.__exportStar(require('./settlement'), exports)
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export declare const EIP712Domain: {
|
|
2
|
-
name: string
|
|
3
|
-
type: string
|
|
4
|
-
}[]
|
|
2
|
+
name: string
|
|
3
|
+
type: string
|
|
4
|
+
}[]
|
|
5
5
|
export declare const Order: {
|
|
6
|
-
name: string
|
|
7
|
-
type: string
|
|
8
|
-
}[]
|
|
9
|
-
export declare const LimitOrderV3TypeDataName =
|
|
10
|
-
export declare const LimitOrderV3TypeDataVersion =
|
|
11
|
-
export declare const VerifyingContract =
|
|
6
|
+
name: string
|
|
7
|
+
type: string
|
|
8
|
+
}[]
|
|
9
|
+
export declare const LimitOrderV3TypeDataName = '1inch Aggregation Router'
|
|
10
|
+
export declare const LimitOrderV3TypeDataVersion = '5'
|
|
11
|
+
export declare const VerifyingContract =
|
|
12
|
+
'0x1111111254eeb25477b68fb85ed929f73a960582'
|
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.VerifyingContract =
|
|
1
|
+
'use strict'
|
|
2
|
+
Object.defineProperty(exports, '__esModule', {value: true})
|
|
3
|
+
exports.VerifyingContract =
|
|
4
|
+
exports.LimitOrderV3TypeDataVersion =
|
|
5
|
+
exports.LimitOrderV3TypeDataName =
|
|
6
|
+
exports.Order =
|
|
7
|
+
exports.EIP712Domain =
|
|
8
|
+
void 0
|
|
4
9
|
exports.EIP712Domain = [
|
|
5
|
-
{
|
|
6
|
-
{
|
|
7
|
-
{
|
|
8
|
-
{
|
|
9
|
-
]
|
|
10
|
+
{name: 'name', type: 'string'},
|
|
11
|
+
{name: 'version', type: 'string'},
|
|
12
|
+
{name: 'chainId', type: 'uint256'},
|
|
13
|
+
{name: 'verifyingContract', type: 'address'}
|
|
14
|
+
]
|
|
10
15
|
exports.Order = [
|
|
11
|
-
{
|
|
12
|
-
{
|
|
13
|
-
{
|
|
14
|
-
{
|
|
15
|
-
{
|
|
16
|
-
{
|
|
17
|
-
{
|
|
18
|
-
{
|
|
19
|
-
{
|
|
20
|
-
{
|
|
21
|
-
]
|
|
22
|
-
exports.LimitOrderV3TypeDataName = '1inch Aggregation Router'
|
|
23
|
-
exports.LimitOrderV3TypeDataVersion = '5'
|
|
24
|
-
exports.VerifyingContract = '0x1111111254eeb25477b68fb85ed929f73a960582'
|
|
25
|
-
//# sourceMappingURL=domain.js.map
|
|
16
|
+
{name: 'salt', type: 'uint256'},
|
|
17
|
+
{name: 'makerAsset', type: 'address'},
|
|
18
|
+
{name: 'takerAsset', type: 'address'},
|
|
19
|
+
{name: 'maker', type: 'address'},
|
|
20
|
+
{name: 'receiver', type: 'address'},
|
|
21
|
+
{name: 'allowedSender', type: 'address'},
|
|
22
|
+
{name: 'makingAmount', type: 'uint256'},
|
|
23
|
+
{name: 'takingAmount', type: 'uint256'},
|
|
24
|
+
{name: 'offsets', type: 'uint256'},
|
|
25
|
+
{name: 'interactions', type: 'bytes'}
|
|
26
|
+
]
|
|
27
|
+
exports.LimitOrderV3TypeDataName = '1inch Aggregation Router'
|
|
28
|
+
exports.LimitOrderV3TypeDataVersion = '5'
|
|
29
|
+
exports.VerifyingContract = '0x1111111254eeb25477b68fb85ed929f73a960582'
|
|
30
|
+
//# sourceMappingURL=domain.js.map
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {BigNumber} from '@ethersproject/bignumber'
|
|
2
2
|
export interface EIP712TypedData {
|
|
3
|
-
types: EIP712Types
|
|
4
|
-
domain: EIP712Object
|
|
5
|
-
message: EIP712Object
|
|
6
|
-
primaryType: string
|
|
3
|
+
types: EIP712Types
|
|
4
|
+
domain: EIP712Object
|
|
5
|
+
message: EIP712Object
|
|
6
|
+
primaryType: string
|
|
7
7
|
}
|
|
8
8
|
export interface EIP712Types {
|
|
9
|
-
[key: string]: EIP712Parameter[]
|
|
9
|
+
[key: string]: EIP712Parameter[]
|
|
10
10
|
}
|
|
11
11
|
export interface EIP712Parameter {
|
|
12
|
-
name: string
|
|
13
|
-
type: string
|
|
12
|
+
name: string
|
|
13
|
+
type: string
|
|
14
14
|
}
|
|
15
|
-
export declare type EIP712ObjectValue =
|
|
15
|
+
export declare type EIP712ObjectValue =
|
|
16
|
+
| BigNumber
|
|
17
|
+
| string
|
|
18
|
+
| number
|
|
19
|
+
| EIP712Object
|
|
16
20
|
export interface EIP712Object {
|
|
17
|
-
[key: string]: EIP712ObjectValue
|
|
21
|
+
[key: string]: EIP712ObjectValue
|
|
18
22
|
}
|
|
19
23
|
export declare type EIP712DomainType = {
|
|
20
|
-
name: string
|
|
21
|
-
version: string
|
|
22
|
-
chainId: number
|
|
23
|
-
verifyingContract: string
|
|
24
|
-
}
|
|
24
|
+
name: string
|
|
25
|
+
version: string
|
|
26
|
+
chainId: number
|
|
27
|
+
verifyingContract: string
|
|
28
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
//# sourceMappingURL=eip712.types.js.map
|
|
1
|
+
'use strict'
|
|
2
|
+
Object.defineProperty(exports, '__esModule', {value: true})
|
|
3
|
+
//# sourceMappingURL=eip712.types.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './domain'
|
|
2
|
-
export * from './eip712.types'
|
|
3
|
-
export * from './order-typed-data-builder'
|
|
1
|
+
export * from './domain'
|
|
2
|
+
export * from './eip712.types'
|
|
3
|
+
export * from './order-typed-data-builder'
|
|
@@ -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('./domain'), exports)
|
|
5
|
+
tslib_1.__exportStar(require('./eip712.types'), exports)
|
|
6
|
+
tslib_1.__exportStar(require('./order-typed-data-builder'), exports)
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare function getOrderHash(data: EIP712TypedData): string
|
|
4
|
-
export declare function buildOrderData(
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import {EIP712DomainType, EIP712TypedData} from './eip712.types'
|
|
2
|
+
import {LimitOrderV3Struct} from '../types'
|
|
3
|
+
export declare function getOrderHash(data: EIP712TypedData): string
|
|
4
|
+
export declare function buildOrderData(
|
|
5
|
+
chainId: number,
|
|
6
|
+
verifyingContract: string,
|
|
7
|
+
name: string,
|
|
8
|
+
version: string,
|
|
9
|
+
order: LimitOrderV3Struct
|
|
10
|
+
): EIP712TypedData
|
|
11
|
+
export declare function domainSeparator(
|
|
12
|
+
name: string,
|
|
13
|
+
version: string,
|
|
14
|
+
chainId: number,
|
|
15
|
+
verifyingContract: string
|
|
16
|
+
): string
|
|
17
|
+
export declare function getLimitOrderV3Domain(chainId: number): EIP712DomainType
|
|
@@ -1,36 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.getLimitOrderV3Domain =
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
Object.defineProperty(exports, '__esModule', {value: true})
|
|
3
|
+
exports.getLimitOrderV3Domain =
|
|
4
|
+
exports.domainSeparator =
|
|
5
|
+
exports.buildOrderData =
|
|
6
|
+
exports.getOrderHash =
|
|
7
|
+
void 0
|
|
8
|
+
const eth_sig_util_1 = require('@metamask/eth-sig-util')
|
|
9
|
+
const domain_1 = require('./domain')
|
|
6
10
|
function getOrderHash(data) {
|
|
7
|
-
return (
|
|
11
|
+
return (
|
|
12
|
+
'0x' +
|
|
8
13
|
eth_sig_util_1.TypedDataUtils.eip712Hash(
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
+
data,
|
|
16
|
+
eth_sig_util_1.SignTypedDataVersion.V4
|
|
17
|
+
).toString('hex')
|
|
18
|
+
)
|
|
11
19
|
}
|
|
12
|
-
exports.getOrderHash = getOrderHash
|
|
20
|
+
exports.getOrderHash = getOrderHash
|
|
13
21
|
function buildOrderData(chainId, verifyingContract, name, version, order) {
|
|
14
22
|
return {
|
|
15
23
|
primaryType: 'Order',
|
|
16
|
-
types: {
|
|
17
|
-
domain: {
|
|
24
|
+
types: {EIP712Domain: domain_1.EIP712Domain, Order: domain_1.Order},
|
|
25
|
+
domain: {name, version, chainId, verifyingContract},
|
|
18
26
|
message: order
|
|
19
|
-
}
|
|
27
|
+
}
|
|
20
28
|
}
|
|
21
|
-
exports.buildOrderData = buildOrderData
|
|
29
|
+
exports.buildOrderData = buildOrderData
|
|
22
30
|
function domainSeparator(name, version, chainId, verifyingContract) {
|
|
23
|
-
return (
|
|
24
|
-
|
|
31
|
+
return (
|
|
32
|
+
'0x' +
|
|
33
|
+
eth_sig_util_1.TypedDataUtils.hashStruct(
|
|
34
|
+
'EIP712Domain',
|
|
35
|
+
{name, version, chainId, verifyingContract},
|
|
36
|
+
{EIP712Domain: domain_1.EIP712Domain},
|
|
37
|
+
eth_sig_util_1.SignTypedDataVersion.V4
|
|
38
|
+
).toString('hex')
|
|
39
|
+
)
|
|
25
40
|
}
|
|
26
|
-
exports.domainSeparator = domainSeparator
|
|
41
|
+
exports.domainSeparator = domainSeparator
|
|
27
42
|
function getLimitOrderV3Domain(chainId) {
|
|
28
43
|
return {
|
|
29
44
|
name: domain_1.LimitOrderV3TypeDataName,
|
|
30
45
|
version: domain_1.LimitOrderV3TypeDataVersion,
|
|
31
46
|
chainId,
|
|
32
47
|
verifyingContract: domain_1.VerifyingContract
|
|
33
|
-
}
|
|
48
|
+
}
|
|
34
49
|
}
|
|
35
|
-
exports.getLimitOrderV3Domain = getLimitOrderV3Domain
|
|
36
|
-
//# sourceMappingURL=order-typed-data-builder.js.map
|
|
50
|
+
exports.getLimitOrderV3Domain = getLimitOrderV3Domain
|
|
51
|
+
//# sourceMappingURL=order-typed-data-builder.js.map
|
package/limit-order/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './eip712/index'
|
|
2
|
-
export * from './limit-order'
|
|
3
|
-
export * from './types'
|
|
4
|
-
export * from './parser/index'
|
|
1
|
+
export * from './eip712/index'
|
|
2
|
+
export * from './limit-order'
|
|
3
|
+
export * from './types'
|
|
4
|
+
export * from './parser/index'
|
package/limit-order/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('./eip712/index'), exports)
|
|
5
|
+
tslib_1.__exportStar(require('./limit-order'), exports)
|
|
6
|
+
tslib_1.__exportStar(require('./types'), exports)
|
|
7
|
+
tslib_1.__exportStar(require('./parser/index'), exports)
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.InteractionsFactory = void 0
|
|
1
|
+
'use strict'
|
|
2
|
+
Object.defineProperty(exports, '__esModule', {value: true})
|
|
3
|
+
exports.InteractionsFactory = void 0
|
|
4
4
|
class InteractionsFactory {
|
|
5
5
|
static unwrap(wethUnwrapper, receiverAddress) {
|
|
6
|
-
return wethUnwrapper + receiverAddress.substring(2)
|
|
6
|
+
return wethUnwrapper + receiverAddress.substring(2)
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
exports.InteractionsFactory = InteractionsFactory
|
|
10
|
-
//# sourceMappingURL=interactions-factory.js.map
|
|
9
|
+
exports.InteractionsFactory = InteractionsFactory
|
|
10
|
+
//# sourceMappingURL=interactions-factory.js.map
|
|
@@ -1,27 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {EIP712TypedData} from './eip712'
|
|
2
|
+
import {InteractionsData, LimitOrderV3Struct, OrderInfoData} from './types'
|
|
3
3
|
export declare class LimitOrder {
|
|
4
|
-
readonly makerAsset: string
|
|
5
|
-
readonly takerAsset: string
|
|
6
|
-
readonly makingAmount: string
|
|
7
|
-
readonly takingAmount: string
|
|
8
|
-
readonly from: string
|
|
9
|
-
readonly allowedSender: string
|
|
10
|
-
readonly receiver: string
|
|
11
|
-
readonly makerAssetData: string
|
|
12
|
-
readonly takerAssetData: string
|
|
13
|
-
readonly getMakingAmount: string
|
|
14
|
-
readonly getTakingAmount: string
|
|
15
|
-
readonly predicate: string
|
|
16
|
-
readonly permit: string
|
|
17
|
-
readonly preInteraction: string
|
|
18
|
-
readonly postInteraction: string
|
|
19
|
-
protected salt: string
|
|
20
|
-
constructor(orderInfo: OrderInfoData, interactions?: InteractionsData)
|
|
21
|
-
static getOrderHash(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
getTypedData(
|
|
26
|
-
|
|
4
|
+
readonly makerAsset: string
|
|
5
|
+
readonly takerAsset: string
|
|
6
|
+
readonly makingAmount: string
|
|
7
|
+
readonly takingAmount: string
|
|
8
|
+
readonly from: string
|
|
9
|
+
readonly allowedSender: string
|
|
10
|
+
readonly receiver: string
|
|
11
|
+
readonly makerAssetData: string
|
|
12
|
+
readonly takerAssetData: string
|
|
13
|
+
readonly getMakingAmount: string
|
|
14
|
+
readonly getTakingAmount: string
|
|
15
|
+
readonly predicate: string
|
|
16
|
+
readonly permit: string
|
|
17
|
+
readonly preInteraction: string
|
|
18
|
+
readonly postInteraction: string
|
|
19
|
+
protected salt: string
|
|
20
|
+
constructor(orderInfo: OrderInfoData, interactions?: InteractionsData)
|
|
21
|
+
static getOrderHash(
|
|
22
|
+
order: LimitOrderV3Struct,
|
|
23
|
+
domain?: import('./eip712').EIP712DomainType
|
|
24
|
+
): string
|
|
25
|
+
static getTypedData(
|
|
26
|
+
order: LimitOrderV3Struct,
|
|
27
|
+
domain?: import('./eip712').EIP712DomainType
|
|
28
|
+
): EIP712TypedData
|
|
29
|
+
static decode(struct: LimitOrderV3Struct): LimitOrder
|
|
30
|
+
build(): LimitOrderV3Struct
|
|
31
|
+
getTypedData(domain?: import('./eip712').EIP712DomainType): EIP712TypedData
|
|
32
|
+
getOrderHash(domain?: import('./eip712').EIP712DomainType): string
|
|
27
33
|
}
|