@1inch/fusion-sdk 0.0.6 → 0.0.7
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 +4 -0
- package/api/fusion-api.d.ts +16 -25
- package/api/fusion-api.js +26 -36
- 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 +397 -479
- package/api/orders/orders.api.d.ts +10 -24
- package/api/orders/orders.api.js +28 -30
- package/api/orders/orders.request.d.ts +18 -22
- package/api/orders/orders.request.js +31 -40
- package/api/orders/types.d.ts +58 -59
- package/api/orders/types.js +16 -17
- 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 +21 -28
- package/api/params.d.ts +1 -3
- package/api/params.js +19 -25
- 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 +17 -19
- 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 +7 -6
- package/api/quoter/quote/order-params.js +13 -12
- package/api/quoter/quote/order-params.js.map +1 -1
- package/api/quoter/quote/quote.d.ts +22 -26
- package/api/quoter/quote/quote.js +59 -84
- package/api/quoter/quote/quote.js.map +1 -1
- package/api/quoter/quote/types.d.ts +5 -4
- package/api/quoter/quote/types.js +3 -3
- package/api/quoter/quoter.api.d.ts +9 -12
- 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 +24 -30
- 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 +26 -28
- package/api/quoter/types.d.ts +45 -45
- package/api/quoter/types.js +10 -10
- package/api/relayer/index.d.ts +3 -3
- package/api/relayer/index.js +7 -7
- package/api/relayer/relayer.api.d.ts +9 -12
- 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 +79 -96
- 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 +15 -17
- package/api/types.js +3 -3
- package/auction-calculator/auction-calculator.d.ts +13 -22
- package/auction-calculator/auction-calculator.js +45 -70
- package/auction-calculator/auction-calculator.spec.d.ts +1 -1
- package/auction-calculator/auction-calculator.spec.js +32 -45
- package/auction-calculator/calc.d.ts +2 -8
- 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 +23 -34
- package/auction-salt/auction.salt.spec.d.ts +1 -1
- package/auction-salt/auction.salt.spec.js +27 -38
- 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 +14 -33
- 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 +22 -33
- 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 +23 -36
- package/auction-suffix/auction-suffix.spec.d.ts +1 -1
- package/auction-suffix/auction-suffix.spec.js +15 -20
- package/auction-suffix/constants.d.ts +1 -1
- package/auction-suffix/constants.js +5 -5
- package/auction-suffix/encoder.d.ts +6 -15
- package/auction-suffix/encoder.js +28 -45
- 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 +17 -30
- package/auction-suffix/parser/errors.d.ts +2 -1
- package/auction-suffix/parser/errors.js +7 -6
- package/auction-suffix/parser/index.d.ts +4 -4
- package/auction-suffix/parser/index.js +8 -8
- package/auction-suffix/parser/parser.d.ts +8 -28
- package/auction-suffix/parser/parser.js +81 -162
- 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 +3 -6
- 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 +10 -15
- 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 +23 -36
- package/connector/blockchain/web3-provider-connector.d.ts +8 -13
- package/connector/blockchain/web3-provider-connector.js +9 -12
- package/connector/blockchain/web3-provider.connector.spec.d.ts +1 -1
- package/connector/blockchain/web3-provider.connector.spec.js +26 -37
- 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 +31 -37
- 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 +6 -10
- package/constants.js +16 -23
- package/fusion-order/fusion-order.d.ts +7 -17
- package/fusion-order/fusion-order.js +12 -14
- package/fusion-order/fusion-order.spec.d.ts +1 -1
- package/fusion-order/fusion-order.spec.js +22 -27
- 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 +9 -10
- package/limit-order/eip712/domain.js +23 -28
- package/limit-order/eip712/eip712.types.d.ts +15 -19
- 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 +6 -17
- package/limit-order/eip712/order-typed-data-builder.js +19 -34
- 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 +25 -31
- package/limit-order/limit-order.js +50 -103
- package/limit-order/limit-order.spec.d.ts +1 -1
- package/limit-order/limit-order.spec.js +51 -75
- 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 +2 -5
- package/limit-order/parser/parser.js +18 -23
- package/limit-order/parser/types.d.ts +3 -3
- package/limit-order/parser/types.js +3 -3
- package/limit-order/predicate-factory.d.ts +5 -9
- package/limit-order/predicate-factory.js +24 -40
- package/limit-order/predicate-factory.spec.d.ts +1 -1
- package/limit-order/predicate-factory.spec.js +29 -44
- 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 +11 -29
- package/sdk/sdk.js +40 -49
- package/sdk/sdk.js.map +1 -1
- 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 +12 -26
- package/settlement/encoders/index.d.ts +3 -3
- package/settlement/encoders/index.js +7 -7
- package/settlement/encoders/settlement.encoder.d.ts +4 -13
- package/settlement/encoders/settlement.encoder.js +19 -41
- package/settlement/index.d.ts +4 -4
- package/settlement/index.js +8 -8
- package/settlement/settlement.d.ts +5 -8
- package/settlement/settlement.js +14 -28
- package/settlement/settlement.spec.d.ts +1 -1
- package/settlement/settlement.spec.js +35 -45
- package/settlement/signature-patcher.d.ts +1 -1
- package/settlement/signature-patcher.js +16 -19
- package/settlement/types.d.ts +13 -13
- package/settlement/types.js +3 -3
- package/utils.d.ts +6 -6
- package/utils.js +23 -29
- package/validations.d.ts +2 -2
- package/validations.js +15 -14
|
@@ -1,33 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.FEE_SHIFT =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
'0xFFFFFFFF00000000000000000000000000000000000000000000000000000000'
|
|
16
|
-
)
|
|
17
|
-
exports.DURATION_MASK = (0, utils_1.toBN)(
|
|
18
|
-
'0x00000000FFFFFF00000000000000000000000000000000000000000000000000'
|
|
19
|
-
)
|
|
20
|
-
exports.INITIAL_RATE_BUMP_MASK = (0, utils_1.toBN)(
|
|
21
|
-
'0x00000000000000FFFFFF00000000000000000000000000000000000000000000'
|
|
22
|
-
)
|
|
23
|
-
exports.FEE_MASK = (0, utils_1.toBN)(
|
|
24
|
-
'0x00000000000000000000FFFFFFFF000000000000000000000000000000000000'
|
|
25
|
-
)
|
|
26
|
-
exports.SALT_MASK = (0, utils_1.toBN)(
|
|
27
|
-
'0x0000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'
|
|
28
|
-
)
|
|
29
|
-
exports.TIME_START_SHIFT = 224 // orderTimeMask 224-255
|
|
30
|
-
exports.DURATION_SHIFT = 200 // durationMask 200-223
|
|
31
|
-
exports.INITIAL_RATE_BUMP_SHIFT = 176 // initialRateMask 176-200
|
|
32
|
-
exports.FEE_SHIFT = 144 // orderFee 144-175
|
|
33
|
-
//# sourceMappingURL=constants.js.map
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FEE_SHIFT = exports.INITIAL_RATE_BUMP_SHIFT = exports.DURATION_SHIFT = exports.TIME_START_SHIFT = exports.SALT_MASK = exports.FEE_MASK = exports.INITIAL_RATE_BUMP_MASK = exports.DURATION_MASK = exports.TIME_START_MASK = void 0;
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
5
|
+
exports.TIME_START_MASK = (0, utils_1.toBN)('0xFFFFFFFF00000000000000000000000000000000000000000000000000000000');
|
|
6
|
+
exports.DURATION_MASK = (0, utils_1.toBN)('0x00000000FFFFFF00000000000000000000000000000000000000000000000000');
|
|
7
|
+
exports.INITIAL_RATE_BUMP_MASK = (0, utils_1.toBN)('0x00000000000000FFFFFF00000000000000000000000000000000000000000000');
|
|
8
|
+
exports.FEE_MASK = (0, utils_1.toBN)('0x00000000000000000000FFFFFFFF000000000000000000000000000000000000');
|
|
9
|
+
exports.SALT_MASK = (0, utils_1.toBN)('0x0000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF');
|
|
10
|
+
exports.TIME_START_SHIFT = 224; // orderTimeMask 224-255
|
|
11
|
+
exports.DURATION_SHIFT = 200; // durationMask 200-223
|
|
12
|
+
exports.INITIAL_RATE_BUMP_SHIFT = 176; // initialRateMask 176-200
|
|
13
|
+
exports.FEE_SHIFT = 144; // orderFee 144-175
|
|
14
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './parser'
|
|
2
|
-
export * from './constants'
|
|
1
|
+
export * from './parser';
|
|
2
|
+
export * from './constants';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
const tslib_1 = require(
|
|
4
|
-
tslib_1.__exportStar(require(
|
|
5
|
-
tslib_1.__exportStar(require(
|
|
6
|
-
//# 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("./parser"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./constants"), exports);
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {BigNumber} from '@ethersproject/bignumber'
|
|
2
|
-
export declare function getStartTime(salt: string): BigNumber
|
|
3
|
-
export declare function getDuration(salt: string): BigNumber
|
|
4
|
-
export declare function getInitialRateBump(salt: string): BigNumber
|
|
5
|
-
export declare function getFee(salt: string): BigNumber
|
|
6
|
-
export declare function getSalt(salt: string): BigNumber
|
|
1
|
+
import { BigNumber } from '@ethersproject/bignumber';
|
|
2
|
+
export declare function getStartTime(salt: string): BigNumber;
|
|
3
|
+
export declare function getDuration(salt: string): BigNumber;
|
|
4
|
+
export declare function getInitialRateBump(salt: string): BigNumber;
|
|
5
|
+
export declare function getFee(salt: string): BigNumber;
|
|
6
|
+
export declare function getSalt(salt: string): BigNumber;
|
|
@@ -1,45 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.getSalt =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.getStartTime =
|
|
8
|
-
void 0
|
|
9
|
-
const utils_1 = require('../../utils')
|
|
10
|
-
const bignumber_1 = require('@ethersproject/bignumber')
|
|
11
|
-
const constants_1 = require('./constants')
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSalt = exports.getFee = exports.getInitialRateBump = exports.getDuration = exports.getStartTime = void 0;
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
5
|
+
const bignumber_1 = require("@ethersproject/bignumber");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
12
7
|
function getStartTime(salt) {
|
|
13
|
-
const val = (0, utils_1.toBN)(salt)
|
|
14
|
-
|
|
15
|
-
.shrn(constants_1.TIME_START_SHIFT)
|
|
16
|
-
return bignumber_1.BigNumber.from(val.toString())
|
|
8
|
+
const val = (0, utils_1.toBN)(salt).and(constants_1.TIME_START_MASK).shrn(constants_1.TIME_START_SHIFT);
|
|
9
|
+
return bignumber_1.BigNumber.from(val.toString());
|
|
17
10
|
}
|
|
18
|
-
exports.getStartTime = getStartTime
|
|
11
|
+
exports.getStartTime = getStartTime;
|
|
19
12
|
function getDuration(salt) {
|
|
20
|
-
const val = (0, utils_1.toBN)(salt)
|
|
21
|
-
|
|
22
|
-
.shrn(constants_1.DURATION_SHIFT)
|
|
23
|
-
return bignumber_1.BigNumber.from(val.toString())
|
|
13
|
+
const val = (0, utils_1.toBN)(salt).and(constants_1.DURATION_MASK).shrn(constants_1.DURATION_SHIFT);
|
|
14
|
+
return bignumber_1.BigNumber.from(val.toString());
|
|
24
15
|
}
|
|
25
|
-
exports.getDuration = getDuration
|
|
16
|
+
exports.getDuration = getDuration;
|
|
26
17
|
function getInitialRateBump(salt) {
|
|
27
18
|
const val = (0, utils_1.toBN)(salt)
|
|
28
19
|
.and(constants_1.INITIAL_RATE_BUMP_MASK)
|
|
29
|
-
.shrn(constants_1.INITIAL_RATE_BUMP_SHIFT)
|
|
30
|
-
return bignumber_1.BigNumber.from(val.toString())
|
|
20
|
+
.shrn(constants_1.INITIAL_RATE_BUMP_SHIFT);
|
|
21
|
+
return bignumber_1.BigNumber.from(val.toString());
|
|
31
22
|
}
|
|
32
|
-
exports.getInitialRateBump = getInitialRateBump
|
|
23
|
+
exports.getInitialRateBump = getInitialRateBump;
|
|
33
24
|
function getFee(salt) {
|
|
34
|
-
const val = (0, utils_1.toBN)(salt)
|
|
35
|
-
|
|
36
|
-
.shrn(constants_1.FEE_SHIFT)
|
|
37
|
-
return bignumber_1.BigNumber.from(val.toString())
|
|
25
|
+
const val = (0, utils_1.toBN)(salt).and(constants_1.FEE_MASK).shrn(constants_1.FEE_SHIFT);
|
|
26
|
+
return bignumber_1.BigNumber.from(val.toString());
|
|
38
27
|
}
|
|
39
|
-
exports.getFee = getFee
|
|
28
|
+
exports.getFee = getFee;
|
|
40
29
|
function getSalt(salt) {
|
|
41
|
-
const val = (0, utils_1.toBN)(salt).and(constants_1.SALT_MASK)
|
|
42
|
-
return bignumber_1.BigNumber.from(val.toString())
|
|
30
|
+
const val = (0, utils_1.toBN)(salt).and(constants_1.SALT_MASK);
|
|
31
|
+
return bignumber_1.BigNumber.from(val.toString());
|
|
43
32
|
}
|
|
44
|
-
exports.getSalt = getSalt
|
|
45
|
-
//# sourceMappingURL=parser.js.map
|
|
33
|
+
exports.getSalt = getSalt;
|
|
34
|
+
//# sourceMappingURL=parser.js.map
|
package/auction-salt/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare type AuctionSaltData = {
|
|
2
|
-
auctionStartTime: number
|
|
3
|
-
initialRateBump: number
|
|
4
|
-
duration: number
|
|
5
|
-
bankFee: string
|
|
6
|
-
salt?: string
|
|
7
|
-
}
|
|
2
|
+
auctionStartTime: number;
|
|
3
|
+
initialRateBump: number;
|
|
4
|
+
duration: number;
|
|
5
|
+
bankFee: string;
|
|
6
|
+
salt?: string;
|
|
7
|
+
};
|
package/auction-salt/types.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
//# sourceMappingURL=types.js.map
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {AuctionPoint, AuctionWhitelistItem, SettlementSuffixData} from './types'
|
|
1
|
+
import { AuctionPoint, AuctionWhitelistItem, SettlementSuffixData } from './types';
|
|
2
2
|
export declare class AuctionSuffix {
|
|
3
|
-
readonly points: AuctionPoint[]
|
|
4
|
-
readonly whitelist: AuctionWhitelistItem[]
|
|
5
|
-
readonly publicResolvingDeadline: number
|
|
6
|
-
readonly takerFeeReceiver: string
|
|
7
|
-
readonly takerFeeRatio: string
|
|
8
|
-
constructor(suffix: SettlementSuffixData)
|
|
9
|
-
static decode(interactions: string): AuctionSuffix
|
|
10
|
-
build(): string
|
|
3
|
+
readonly points: AuctionPoint[];
|
|
4
|
+
readonly whitelist: AuctionWhitelistItem[];
|
|
5
|
+
readonly publicResolvingDeadline: number;
|
|
6
|
+
readonly takerFeeReceiver: string;
|
|
7
|
+
readonly takerFeeRatio: string;
|
|
8
|
+
constructor(suffix: SettlementSuffixData);
|
|
9
|
+
static decode(interactions: string): AuctionSuffix;
|
|
10
|
+
build(): string;
|
|
11
11
|
}
|
|
@@ -1,51 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.AuctionSuffix = void 0
|
|
4
|
-
const utils_1 = require(
|
|
5
|
-
const constants_1 = require(
|
|
6
|
-
const encoder_1 = require(
|
|
7
|
-
const constants_2 = require(
|
|
8
|
-
const parser_1 = require(
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuctionSuffix = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const encoder_1 = require("./encoder");
|
|
7
|
+
const constants_2 = require("./constants");
|
|
8
|
+
const parser_1 = require("./parser");
|
|
9
9
|
class AuctionSuffix {
|
|
10
10
|
constructor(suffix) {
|
|
11
|
-
this.points = suffix.points
|
|
12
|
-
this.whitelist = suffix.whitelist
|
|
11
|
+
this.points = suffix.points;
|
|
12
|
+
this.whitelist = suffix.whitelist;
|
|
13
13
|
this.publicResolvingDeadline =
|
|
14
|
-
suffix.publicResolvingDeadline ||
|
|
15
|
-
|
|
16
|
-
this.
|
|
17
|
-
suffix.takerFeeReceiver || constants_1.ZERO_ADDRESS
|
|
18
|
-
this.takerFeeRatio = suffix.takerFeeRatio || '0'
|
|
14
|
+
suffix.publicResolvingDeadline || (0, utils_1.toSec)(constants_2.NoPublicResolvingDeadline);
|
|
15
|
+
this.takerFeeReceiver = suffix.takerFeeReceiver || constants_1.ZERO_ADDRESS;
|
|
16
|
+
this.takerFeeRatio = suffix.takerFeeRatio || '0';
|
|
19
17
|
}
|
|
20
18
|
static decode(interactions) {
|
|
21
|
-
const suffix = (0, parser_1.parseInteractionsSuffix)(interactions)
|
|
19
|
+
const suffix = (0, parser_1.parseInteractionsSuffix)(interactions);
|
|
22
20
|
return new AuctionSuffix({
|
|
23
21
|
publicResolvingDeadline: suffix.publicResolvingDeadline,
|
|
24
22
|
points: suffix.points,
|
|
25
23
|
takerFeeRatio: suffix.takerFeeRatio,
|
|
26
24
|
takerFeeReceiver: suffix.takerFeeReceiver,
|
|
27
25
|
whitelist: suffix.whitelist
|
|
28
|
-
})
|
|
26
|
+
});
|
|
29
27
|
}
|
|
30
28
|
build() {
|
|
31
|
-
const auctionParams = (0, encoder_1.encodeAuctionParams)(this.points)
|
|
32
|
-
const whitelist = (0, encoder_1.encodeWhitelist)(this.whitelist)
|
|
33
|
-
const publicResolving = (0, encoder_1.encodePublicResolvingDeadline)(
|
|
34
|
-
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
this.takerFeeReceiver,
|
|
38
|
-
this.takerFeeRatio
|
|
39
|
-
)
|
|
40
|
-
const flags = (0, encoder_1.encodeFlags)(
|
|
41
|
-
this.whitelist,
|
|
42
|
-
this.points,
|
|
43
|
-
takingFeeData
|
|
44
|
-
)
|
|
45
|
-
return (
|
|
46
|
-
auctionParams + whitelist + publicResolving + takingFeeData + flags
|
|
47
|
-
)
|
|
29
|
+
const auctionParams = (0, encoder_1.encodeAuctionParams)(this.points);
|
|
30
|
+
const whitelist = (0, encoder_1.encodeWhitelist)(this.whitelist);
|
|
31
|
+
const publicResolving = (0, encoder_1.encodePublicResolvingDeadline)(this.publicResolvingDeadline);
|
|
32
|
+
const takingFeeData = (0, encoder_1.encodeTakingFeeData)(this.takerFeeReceiver, this.takerFeeRatio);
|
|
33
|
+
const flags = (0, encoder_1.encodeFlags)(this.whitelist, this.points, takingFeeData);
|
|
34
|
+
return (auctionParams + whitelist + publicResolving + takingFeeData + flags);
|
|
48
35
|
}
|
|
49
36
|
}
|
|
50
|
-
exports.AuctionSuffix = AuctionSuffix
|
|
51
|
-
//# sourceMappingURL=auction-suffix.js.map
|
|
37
|
+
exports.AuctionSuffix = AuctionSuffix;
|
|
38
|
+
//# sourceMappingURL=auction-suffix.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
const auction_suffix_1 = require(
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const auction_suffix_1 = require("./auction-suffix");
|
|
4
4
|
describe('Auction Suffix', () => {
|
|
5
5
|
it('should create suffix with required params', () => {
|
|
6
6
|
const suffix = new auction_suffix_1.AuctionSuffix({
|
|
@@ -16,11 +16,9 @@ describe('Auction Suffix', () => {
|
|
|
16
16
|
allowance: 0
|
|
17
17
|
}
|
|
18
18
|
]
|
|
19
|
-
})
|
|
20
|
-
expect(suffix.build()).toBe(
|
|
21
|
-
|
|
22
|
-
)
|
|
23
|
-
})
|
|
19
|
+
});
|
|
20
|
+
expect(suffix.build()).toBe('000c004e200000000000000000219ab540356cbb839cbe05303d7705faf486570009');
|
|
21
|
+
});
|
|
24
22
|
it('should create suffix with specified public resolving deadline', () => {
|
|
25
23
|
const suffix = new auction_suffix_1.AuctionSuffix({
|
|
26
24
|
points: [
|
|
@@ -36,16 +34,13 @@ describe('Auction Suffix', () => {
|
|
|
36
34
|
}
|
|
37
35
|
],
|
|
38
36
|
publicResolvingDeadline: 1673549418
|
|
39
|
-
})
|
|
40
|
-
expect(suffix.build()).toBe(
|
|
41
|
-
|
|
42
|
-
)
|
|
43
|
-
})
|
|
37
|
+
});
|
|
38
|
+
expect(suffix.build()).toBe('000c004e200000000000000000219ab540356cbb839cbe05303d7705fa63c0566a09');
|
|
39
|
+
});
|
|
44
40
|
it('should decode auction suffix', () => {
|
|
45
|
-
const encodedSuffix =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
//# sourceMappingURL=auction-suffix.spec.js.map
|
|
41
|
+
const encodedSuffix = '000c004e200000000000000000219ab540356cbb839cbe05303d7705fa63c0566a09';
|
|
42
|
+
const suffix = auction_suffix_1.AuctionSuffix.decode(encodedSuffix);
|
|
43
|
+
expect(suffix.build()).toBe(encodedSuffix);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=auction-suffix.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const NoPublicResolvingDeadline: Date
|
|
1
|
+
export declare const NoPublicResolvingDeadline: Date;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.NoPublicResolvingDeadline = void 0
|
|
4
|
-
exports.NoPublicResolvingDeadline = new Date(4102444800000)
|
|
5
|
-
//# sourceMappingURL=constants.js.map
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NoPublicResolvingDeadline = void 0;
|
|
4
|
+
exports.NoPublicResolvingDeadline = new Date(4102444800000);
|
|
5
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import {AuctionPoint, AuctionWhitelistItem} from './types'
|
|
2
|
-
export declare function encodeAuctionParams(points: AuctionPoint[]): string
|
|
3
|
-
export declare function encodeWhitelist(
|
|
4
|
-
|
|
5
|
-
): string
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function encodeTakingFeeData(
|
|
8
|
-
takerFeeReceiver: string,
|
|
9
|
-
takerFeeRatio: string
|
|
10
|
-
): string
|
|
11
|
-
export declare function encodeFlags(
|
|
12
|
-
whitelist: AuctionWhitelistItem[],
|
|
13
|
-
points: AuctionPoint[],
|
|
14
|
-
takingFeeData: string
|
|
15
|
-
): string
|
|
1
|
+
import { AuctionPoint, AuctionWhitelistItem } from './types';
|
|
2
|
+
export declare function encodeAuctionParams(points: AuctionPoint[]): string;
|
|
3
|
+
export declare function encodeWhitelist(whitelist: AuctionWhitelistItem[]): string;
|
|
4
|
+
export declare function encodePublicResolvingDeadline(deadline: number): string;
|
|
5
|
+
export declare function encodeTakingFeeData(takerFeeReceiver: string, takerFeeRatio: string): string;
|
|
6
|
+
export declare function encodeFlags(whitelist: AuctionWhitelistItem[], points: AuctionPoint[], takingFeeData: string): string;
|
|
@@ -1,62 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.encodeFlags =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.encodeAuctionParams =
|
|
8
|
-
void 0
|
|
9
|
-
const bignumber_1 = require('@ethersproject/bignumber')
|
|
10
|
-
const utils_1 = require('../utils')
|
|
11
|
-
const constants_1 = require('../constants')
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.encodeFlags = exports.encodeTakingFeeData = exports.encodePublicResolvingDeadline = exports.encodeWhitelist = exports.encodeAuctionParams = void 0;
|
|
4
|
+
const bignumber_1 = require("@ethersproject/bignumber");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const constants_1 = require("../constants");
|
|
12
7
|
function encodeAuctionParams(points) {
|
|
13
8
|
return points
|
|
14
|
-
.map(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
coefficient.toString(16).padStart(6, '0')
|
|
18
|
-
)
|
|
19
|
-
.join('')
|
|
9
|
+
.map(({ delay, coefficient }) => delay.toString(16).padStart(4, '0') +
|
|
10
|
+
coefficient.toString(16).padStart(6, '0'))
|
|
11
|
+
.join('');
|
|
20
12
|
}
|
|
21
|
-
exports.encodeAuctionParams = encodeAuctionParams
|
|
13
|
+
exports.encodeAuctionParams = encodeAuctionParams;
|
|
22
14
|
function encodeWhitelist(whitelist) {
|
|
23
15
|
return whitelist
|
|
24
|
-
.map(
|
|
25
|
-
|
|
26
|
-
allowance.toString(16).padStart(8, '0') +
|
|
27
|
-
(0, utils_1.trim0x)(address)
|
|
28
|
-
)
|
|
29
|
-
.join('')
|
|
16
|
+
.map(({ address, allowance }) => allowance.toString(16).padStart(8, '0') + (0, utils_1.trim0x)(address))
|
|
17
|
+
.join('');
|
|
30
18
|
}
|
|
31
|
-
exports.encodeWhitelist = encodeWhitelist
|
|
19
|
+
exports.encodeWhitelist = encodeWhitelist;
|
|
32
20
|
function encodePublicResolvingDeadline(deadline) {
|
|
33
|
-
return deadline.toString(16).padStart(8, '0')
|
|
21
|
+
return deadline.toString(16).padStart(8, '0');
|
|
34
22
|
}
|
|
35
|
-
exports.encodePublicResolvingDeadline = encodePublicResolvingDeadline
|
|
23
|
+
exports.encodePublicResolvingDeadline = encodePublicResolvingDeadline;
|
|
36
24
|
function encodeTakingFeeData(takerFeeReceiver, takerFeeRatio) {
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
takerFeeRatio === '0'
|
|
40
|
-
) {
|
|
41
|
-
return ''
|
|
25
|
+
if (takerFeeReceiver === constants_1.ZERO_ADDRESS || takerFeeRatio === '0') {
|
|
26
|
+
return '';
|
|
42
27
|
}
|
|
43
|
-
return (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
.padStart(24, '0') + (0, utils_1.trim0x)(takerFeeReceiver)
|
|
48
|
-
)
|
|
28
|
+
return (bignumber_1.BigNumber.from(takerFeeRatio)
|
|
29
|
+
.toHexString()
|
|
30
|
+
.substring(2)
|
|
31
|
+
.padStart(24, '0') + (0, utils_1.trim0x)(takerFeeReceiver));
|
|
49
32
|
}
|
|
50
|
-
exports.encodeTakingFeeData = encodeTakingFeeData
|
|
33
|
+
exports.encodeTakingFeeData = encodeTakingFeeData;
|
|
51
34
|
function encodeFlags(whitelist, points, takingFeeData) {
|
|
52
35
|
if (points.length > 8) {
|
|
53
|
-
throw new Error('max points count = 8')
|
|
36
|
+
throw new Error('max points count = 8');
|
|
54
37
|
}
|
|
55
|
-
let flags = (whitelist.length << 3) | points.length
|
|
38
|
+
let flags = (whitelist.length << 3) | points.length;
|
|
56
39
|
if (takingFeeData !== '') {
|
|
57
|
-
flags |= 0x80
|
|
40
|
+
flags |= 0x80;
|
|
58
41
|
}
|
|
59
|
-
return flags.toString(16).padStart(2, '0')
|
|
42
|
+
return flags.toString(16).padStart(2, '0');
|
|
60
43
|
}
|
|
61
|
-
exports.encodeFlags = encodeFlags
|
|
62
|
-
//# sourceMappingURL=encoder.js.map
|
|
44
|
+
exports.encodeFlags = encodeFlags;
|
|
45
|
+
//# sourceMappingURL=encoder.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './auction-suffix'
|
|
2
|
-
export * from './constants'
|
|
3
|
-
export * from './encoder'
|
|
4
|
-
export * from './types'
|
|
5
|
-
export * from './parser/index'
|
|
1
|
+
export * from './auction-suffix';
|
|
2
|
+
export * from './constants';
|
|
3
|
+
export * from './encoder';
|
|
4
|
+
export * from './types';
|
|
5
|
+
export * from './parser/index';
|
package/auction-suffix/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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
|
-
//# 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"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./constants"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./encoder"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./parser/index"), exports);
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export declare const AUCTION_BUMP_LENGTH = 6
|
|
2
|
-
export declare const AUCTION_DELAY_LENGTH = 4
|
|
3
|
-
export declare const ADDRESS_LENGTH = 40
|
|
4
|
-
export declare const ALLOWED_TIMESTAMP_LENGTH = 8
|
|
5
|
-
export declare const PRIVATE_AUCTION_DEADLINE_LENGTH = 8
|
|
6
|
-
export declare const TAKER_FEE_RECEIVER_LENGTH = 40
|
|
7
|
-
export declare const TAKER_FEE_RATIO_LENGTH = 24
|
|
8
|
-
export declare const FLAGS_LENGTH = 2
|
|
9
|
-
export declare const HAS_TAKING_FEE_FLAG = 128
|
|
10
|
-
export declare const RESOLVERS_LENGTH_MASK = 120
|
|
11
|
-
export declare const RESOLVERS_LENGTH_OFFSET = 3
|
|
12
|
-
export declare const POINTS_LENGTH_MASK = 7
|
|
13
|
-
export declare const CONTRACT_TAKER_FEE_PRECISION = 1000000000
|
|
1
|
+
export declare const AUCTION_BUMP_LENGTH = 6;
|
|
2
|
+
export declare const AUCTION_DELAY_LENGTH = 4;
|
|
3
|
+
export declare const ADDRESS_LENGTH = 40;
|
|
4
|
+
export declare const ALLOWED_TIMESTAMP_LENGTH = 8;
|
|
5
|
+
export declare const PRIVATE_AUCTION_DEADLINE_LENGTH = 8;
|
|
6
|
+
export declare const TAKER_FEE_RECEIVER_LENGTH = 40;
|
|
7
|
+
export declare const TAKER_FEE_RATIO_LENGTH = 24;
|
|
8
|
+
export declare const FLAGS_LENGTH = 2;
|
|
9
|
+
export declare const HAS_TAKING_FEE_FLAG = 128;
|
|
10
|
+
export declare const RESOLVERS_LENGTH_MASK = 120;
|
|
11
|
+
export declare const RESOLVERS_LENGTH_OFFSET = 3;
|
|
12
|
+
export declare const POINTS_LENGTH_MASK = 7;
|
|
13
|
+
export declare const CONTRACT_TAKER_FEE_PRECISION = 1000000000;
|
|
@@ -1,30 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.CONTRACT_TAKER_FEE_PRECISION =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
exports.AUCTION_DELAY_LENGTH = 4
|
|
19
|
-
exports.ADDRESS_LENGTH = 40
|
|
20
|
-
exports.ALLOWED_TIMESTAMP_LENGTH = 8
|
|
21
|
-
exports.PRIVATE_AUCTION_DEADLINE_LENGTH = 8
|
|
22
|
-
exports.TAKER_FEE_RECEIVER_LENGTH = 40
|
|
23
|
-
exports.TAKER_FEE_RATIO_LENGTH = 24
|
|
24
|
-
exports.FLAGS_LENGTH = 2
|
|
25
|
-
exports.HAS_TAKING_FEE_FLAG = 0x80
|
|
26
|
-
exports.RESOLVERS_LENGTH_MASK = 0x78
|
|
27
|
-
exports.RESOLVERS_LENGTH_OFFSET = 3
|
|
28
|
-
exports.POINTS_LENGTH_MASK = 0x07
|
|
29
|
-
exports.CONTRACT_TAKER_FEE_PRECISION = 1e9
|
|
30
|
-
//# sourceMappingURL=constants.js.map
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONTRACT_TAKER_FEE_PRECISION = exports.POINTS_LENGTH_MASK = exports.RESOLVERS_LENGTH_OFFSET = exports.RESOLVERS_LENGTH_MASK = exports.HAS_TAKING_FEE_FLAG = exports.FLAGS_LENGTH = exports.TAKER_FEE_RATIO_LENGTH = exports.TAKER_FEE_RECEIVER_LENGTH = exports.PRIVATE_AUCTION_DEADLINE_LENGTH = exports.ALLOWED_TIMESTAMP_LENGTH = exports.ADDRESS_LENGTH = exports.AUCTION_DELAY_LENGTH = exports.AUCTION_BUMP_LENGTH = void 0;
|
|
4
|
+
exports.AUCTION_BUMP_LENGTH = 6;
|
|
5
|
+
exports.AUCTION_DELAY_LENGTH = 4;
|
|
6
|
+
exports.ADDRESS_LENGTH = 40;
|
|
7
|
+
exports.ALLOWED_TIMESTAMP_LENGTH = 8;
|
|
8
|
+
exports.PRIVATE_AUCTION_DEADLINE_LENGTH = 8;
|
|
9
|
+
exports.TAKER_FEE_RECEIVER_LENGTH = 40;
|
|
10
|
+
exports.TAKER_FEE_RATIO_LENGTH = 24;
|
|
11
|
+
exports.FLAGS_LENGTH = 2;
|
|
12
|
+
exports.HAS_TAKING_FEE_FLAG = 0x80;
|
|
13
|
+
exports.RESOLVERS_LENGTH_MASK = 0x78;
|
|
14
|
+
exports.RESOLVERS_LENGTH_OFFSET = 3;
|
|
15
|
+
exports.POINTS_LENGTH_MASK = 0x07;
|
|
16
|
+
exports.CONTRACT_TAKER_FEE_PRECISION = 1e9;
|
|
17
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare class BadOrderSuffixError extends Error {
|
|
1
|
+
export declare class BadOrderSuffixError extends Error {
|
|
2
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
3
|
-
exports.BadOrderSuffixError = void 0
|
|
4
|
-
class BadOrderSuffixError extends Error {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BadOrderSuffixError = void 0;
|
|
4
|
+
class BadOrderSuffixError extends Error {
|
|
5
|
+
}
|
|
6
|
+
exports.BadOrderSuffixError = BadOrderSuffixError;
|
|
7
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './constants'
|
|
2
|
-
export * from './parser'
|
|
3
|
-
export * from './types'
|
|
4
|
-
export * from './errors'
|
|
1
|
+
export * from './constants';
|
|
2
|
+
export * from './parser';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './errors';
|
|
@@ -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("./constants"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./parser"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./errors"), exports);
|
|
8
|
+
//# sourceMappingURL=index.js.map
|