@1inch/fusion-sdk 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/README.md +4 -0
  2. package/api/fusion-api.d.ts +16 -25
  3. package/api/fusion-api.js +26 -36
  4. package/api/index.d.ts +4 -4
  5. package/api/index.js +8 -8
  6. package/api/orders/index.d.ts +3 -3
  7. package/api/orders/index.js +7 -7
  8. package/api/orders/order-api.spec.d.ts +1 -1
  9. package/api/orders/order-api.spec.js +397 -479
  10. package/api/orders/orders.api.d.ts +10 -24
  11. package/api/orders/orders.api.js +28 -30
  12. package/api/orders/orders.request.d.ts +18 -22
  13. package/api/orders/orders.request.js +31 -40
  14. package/api/orders/types.d.ts +58 -59
  15. package/api/orders/types.js +16 -17
  16. package/api/pagination.d.ts +7 -7
  17. package/api/pagination.js +10 -10
  18. package/api/pagination.spec.d.ts +1 -1
  19. package/api/pagination.spec.js +21 -28
  20. package/api/params.d.ts +1 -3
  21. package/api/params.js +19 -25
  22. package/api/quoter/index.d.ts +5 -5
  23. package/api/quoter/index.js +9 -9
  24. package/api/quoter/preset.d.ts +13 -13
  25. package/api/quoter/preset.js +17 -19
  26. package/api/quoter/quote/index.d.ts +3 -3
  27. package/api/quoter/quote/index.js +7 -7
  28. package/api/quoter/quote/order-params.d.ts +7 -6
  29. package/api/quoter/quote/order-params.js +13 -12
  30. package/api/quoter/quote/order-params.js.map +1 -1
  31. package/api/quoter/quote/quote.d.ts +22 -26
  32. package/api/quoter/quote/quote.js +59 -84
  33. package/api/quoter/quote/quote.js.map +1 -1
  34. package/api/quoter/quote/types.d.ts +5 -4
  35. package/api/quoter/quote/types.js +3 -3
  36. package/api/quoter/quoter.api.d.ts +9 -12
  37. package/api/quoter/quoter.api.js +19 -19
  38. package/api/quoter/quoter.api.spec.d.ts +1 -1
  39. package/api/quoter/quoter.api.spec.js +24 -30
  40. package/api/quoter/quoter.api.spec.js.map +1 -1
  41. package/api/quoter/quoter.request.d.ts +11 -11
  42. package/api/quoter/quoter.request.js +26 -28
  43. package/api/quoter/types.d.ts +45 -45
  44. package/api/quoter/types.js +10 -10
  45. package/api/relayer/index.d.ts +3 -3
  46. package/api/relayer/index.js +7 -7
  47. package/api/relayer/relayer.api.d.ts +9 -12
  48. package/api/relayer/relayer.api.js +13 -13
  49. package/api/relayer/relayer.api.spec.d.ts +1 -1
  50. package/api/relayer/relayer.api.spec.js +79 -96
  51. package/api/relayer/relayer.request.d.ts +8 -8
  52. package/api/relayer/relayer.request.js +10 -10
  53. package/api/relayer/types.d.ts +9 -9
  54. package/api/relayer/types.js +3 -3
  55. package/api/types.d.ts +15 -17
  56. package/api/types.js +3 -3
  57. package/auction-calculator/auction-calculator.d.ts +13 -22
  58. package/auction-calculator/auction-calculator.js +45 -70
  59. package/auction-calculator/auction-calculator.spec.d.ts +1 -1
  60. package/auction-calculator/auction-calculator.spec.js +32 -45
  61. package/auction-calculator/calc.d.ts +2 -8
  62. package/auction-calculator/calc.js +12 -12
  63. package/auction-calculator/constants.d.ts +1 -1
  64. package/auction-calculator/constants.js +5 -5
  65. package/auction-calculator/index.d.ts +3 -3
  66. package/auction-calculator/index.js +7 -7
  67. package/auction-salt/auction-salt.d.ts +9 -9
  68. package/auction-salt/auction-salt.js +23 -34
  69. package/auction-salt/auction.salt.spec.d.ts +1 -1
  70. package/auction-salt/auction.salt.spec.js +27 -38
  71. package/auction-salt/index.d.ts +3 -3
  72. package/auction-salt/index.js +7 -7
  73. package/auction-salt/parser/constants.d.ts +9 -9
  74. package/auction-salt/parser/constants.js +14 -33
  75. package/auction-salt/parser/index.d.ts +2 -2
  76. package/auction-salt/parser/index.js +6 -6
  77. package/auction-salt/parser/parser.d.ts +6 -6
  78. package/auction-salt/parser/parser.js +22 -33
  79. package/auction-salt/types.d.ts +6 -6
  80. package/auction-salt/types.js +3 -3
  81. package/auction-suffix/auction-suffix.d.ts +9 -9
  82. package/auction-suffix/auction-suffix.js +23 -36
  83. package/auction-suffix/auction-suffix.spec.d.ts +1 -1
  84. package/auction-suffix/auction-suffix.spec.js +15 -20
  85. package/auction-suffix/constants.d.ts +1 -1
  86. package/auction-suffix/constants.js +5 -5
  87. package/auction-suffix/encoder.d.ts +6 -15
  88. package/auction-suffix/encoder.js +28 -45
  89. package/auction-suffix/index.d.ts +5 -5
  90. package/auction-suffix/index.js +9 -9
  91. package/auction-suffix/parser/constants.d.ts +13 -13
  92. package/auction-suffix/parser/constants.js +17 -30
  93. package/auction-suffix/parser/errors.d.ts +2 -1
  94. package/auction-suffix/parser/errors.js +7 -6
  95. package/auction-suffix/parser/index.d.ts +4 -4
  96. package/auction-suffix/parser/index.js +8 -8
  97. package/auction-suffix/parser/parser.d.ts +8 -28
  98. package/auction-suffix/parser/parser.js +81 -162
  99. package/auction-suffix/parser/types.d.ts +22 -22
  100. package/auction-suffix/parser/types.js +3 -3
  101. package/auction-suffix/types.d.ts +12 -12
  102. package/auction-suffix/types.js +3 -3
  103. package/connector/blockchain/blockchain-provider.connector.d.ts +3 -6
  104. package/connector/blockchain/blockchain-provider.connector.js +3 -3
  105. package/connector/blockchain/index.d.ts +3 -3
  106. package/connector/blockchain/index.js +7 -7
  107. package/connector/blockchain/private-key-provider.connector.d.ts +10 -15
  108. package/connector/blockchain/private-key-provider.connector.js +12 -12
  109. package/connector/blockchain/private-key-provider.connector.spec.d.ts +1 -1
  110. package/connector/blockchain/private-key-provider.connector.spec.js +23 -36
  111. package/connector/blockchain/web3-provider-connector.d.ts +8 -13
  112. package/connector/blockchain/web3-provider-connector.js +9 -12
  113. package/connector/blockchain/web3-provider.connector.spec.d.ts +1 -1
  114. package/connector/blockchain/web3-provider.connector.spec.js +26 -37
  115. package/connector/http/axios-provider.connector.d.ts +3 -3
  116. package/connector/http/axios-provider.connector.js +13 -13
  117. package/connector/http/axios-provider.connector.spec.d.ts +1 -1
  118. package/connector/http/axios-provider.connector.spec.js +31 -37
  119. package/connector/http/http-provider.connector.d.ts +2 -2
  120. package/connector/http/http-provider.connector.js +3 -3
  121. package/connector/http/index.d.ts +2 -2
  122. package/connector/http/index.js +6 -6
  123. package/connector/index.d.ts +2 -2
  124. package/connector/index.js +6 -6
  125. package/constants.d.ts +6 -10
  126. package/constants.js +16 -23
  127. package/fusion-order/fusion-order.d.ts +7 -17
  128. package/fusion-order/fusion-order.js +12 -14
  129. package/fusion-order/fusion-order.spec.d.ts +1 -1
  130. package/fusion-order/fusion-order.spec.js +22 -27
  131. package/fusion-order/index.d.ts +1 -1
  132. package/fusion-order/index.js +5 -5
  133. package/index.d.ts +11 -11
  134. package/index.js +15 -15
  135. package/limit-order/eip712/domain.d.ts +9 -10
  136. package/limit-order/eip712/domain.js +23 -28
  137. package/limit-order/eip712/eip712.types.d.ts +15 -19
  138. package/limit-order/eip712/eip712.types.js +3 -3
  139. package/limit-order/eip712/index.d.ts +3 -3
  140. package/limit-order/eip712/index.js +7 -7
  141. package/limit-order/eip712/order-typed-data-builder.d.ts +6 -17
  142. package/limit-order/eip712/order-typed-data-builder.js +19 -34
  143. package/limit-order/index.d.ts +4 -4
  144. package/limit-order/index.js +8 -8
  145. package/limit-order/interactions-factory.d.ts +1 -1
  146. package/limit-order/interactions-factory.js +6 -6
  147. package/limit-order/limit-order.d.ts +25 -31
  148. package/limit-order/limit-order.js +50 -103
  149. package/limit-order/limit-order.spec.d.ts +1 -1
  150. package/limit-order/limit-order.spec.js +51 -75
  151. package/limit-order/parser/constants.d.ts +9 -9
  152. package/limit-order/parser/constants.js +5 -5
  153. package/limit-order/parser/index.d.ts +3 -3
  154. package/limit-order/parser/index.js +7 -7
  155. package/limit-order/parser/parser.d.ts +2 -5
  156. package/limit-order/parser/parser.js +18 -23
  157. package/limit-order/parser/types.d.ts +3 -3
  158. package/limit-order/parser/types.js +3 -3
  159. package/limit-order/predicate-factory.d.ts +5 -9
  160. package/limit-order/predicate-factory.js +24 -40
  161. package/limit-order/predicate-factory.spec.d.ts +1 -1
  162. package/limit-order/predicate-factory.spec.js +29 -44
  163. package/limit-order/types.d.ts +29 -29
  164. package/limit-order/types.js +3 -3
  165. package/limit-order/utils.d.ts +1 -1
  166. package/limit-order/utils.js +6 -6
  167. package/package.json +1 -1
  168. package/sdk/index.d.ts +2 -2
  169. package/sdk/index.js +6 -6
  170. package/sdk/sdk.d.ts +11 -29
  171. package/sdk/sdk.js +40 -49
  172. package/sdk/sdk.js.map +1 -1
  173. package/sdk/types.d.ts +27 -27
  174. package/sdk/types.js +3 -3
  175. package/settlement/encoders/constants.d.ts +1 -1
  176. package/settlement/encoders/constants.js +5 -5
  177. package/settlement/encoders/fill-order.encoder.d.ts +2 -2
  178. package/settlement/encoders/fill-order.encoder.js +12 -26
  179. package/settlement/encoders/index.d.ts +3 -3
  180. package/settlement/encoders/index.js +7 -7
  181. package/settlement/encoders/settlement.encoder.d.ts +5 -13
  182. package/settlement/encoders/settlement.encoder.js +38 -42
  183. package/settlement/encoders/settlement.encoder.js.map +1 -1
  184. package/settlement/index.d.ts +4 -4
  185. package/settlement/index.js +8 -8
  186. package/settlement/settlement.d.ts +6 -8
  187. package/settlement/settlement.js +20 -28
  188. package/settlement/settlement.js.map +1 -1
  189. package/settlement/settlement.spec.d.ts +1 -1
  190. package/settlement/settlement.spec.js +41 -45
  191. package/settlement/settlement.spec.js.map +1 -1
  192. package/settlement/signature-patcher.d.ts +1 -1
  193. package/settlement/signature-patcher.js +16 -19
  194. package/settlement/types.d.ts +13 -13
  195. package/settlement/types.js +3 -3
  196. package/utils.d.ts +6 -6
  197. package/utils.js +23 -29
  198. package/validations.d.ts +2 -2
  199. package/validations.js +15 -14
@@ -1,33 +1,14 @@
1
- 'use strict'
2
- Object.defineProperty(exports, '__esModule', {value: true})
3
- exports.FEE_SHIFT =
4
- exports.INITIAL_RATE_BUMP_SHIFT =
5
- exports.DURATION_SHIFT =
6
- exports.TIME_START_SHIFT =
7
- exports.SALT_MASK =
8
- exports.FEE_MASK =
9
- exports.INITIAL_RATE_BUMP_MASK =
10
- exports.DURATION_MASK =
11
- exports.TIME_START_MASK =
12
- void 0
13
- const utils_1 = require('../../utils')
14
- exports.TIME_START_MASK = (0, utils_1.toBN)(
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
- '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
+ "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
- 'use strict'
2
- Object.defineProperty(exports, '__esModule', {value: true})
3
- exports.getSalt =
4
- exports.getFee =
5
- exports.getInitialRateBump =
6
- exports.getDuration =
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
- .and(constants_1.TIME_START_MASK)
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
- .and(constants_1.DURATION_MASK)
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
- .and(constants_1.FEE_MASK)
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
@@ -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
+ };
@@ -1,3 +1,3 @@
1
- 'use strict'
2
- Object.defineProperty(exports, '__esModule', {value: true})
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
- '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')
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
- (0, utils_1.toSec)(constants_2.NoPublicResolvingDeadline)
16
- this.takerFeeReceiver =
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
- this.publicResolvingDeadline
35
- )
36
- const takingFeeData = (0, encoder_1.encodeTakingFeeData)(
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
- 'use strict'
2
- Object.defineProperty(exports, '__esModule', {value: true})
3
- const auction_suffix_1 = require('./auction-suffix')
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
- '000c004e200000000000000000219ab540356cbb839cbe05303d7705faf486570009'
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
- '000c004e200000000000000000219ab540356cbb839cbe05303d7705fa63c0566a09'
42
- )
43
- })
37
+ });
38
+ expect(suffix.build()).toBe('000c004e200000000000000000219ab540356cbb839cbe05303d7705fa63c0566a09');
39
+ });
44
40
  it('should decode auction suffix', () => {
45
- const encodedSuffix =
46
- '000c004e200000000000000000219ab540356cbb839cbe05303d7705fa63c0566a09'
47
- const suffix = auction_suffix_1.AuctionSuffix.decode(encodedSuffix)
48
- expect(suffix.build()).toBe(encodedSuffix)
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
- '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
+ "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
- whitelist: AuctionWhitelistItem[]
5
- ): string
6
- export declare function encodePublicResolvingDeadline(deadline: number): string
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
- 'use strict'
2
- Object.defineProperty(exports, '__esModule', {value: true})
3
- exports.encodeFlags =
4
- exports.encodeTakingFeeData =
5
- exports.encodePublicResolvingDeadline =
6
- exports.encodeWhitelist =
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
- ({delay, coefficient}) =>
16
- delay.toString(16).padStart(4, '0') +
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
- ({address, allowance}) =>
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
- takerFeeReceiver === constants_1.ZERO_ADDRESS ||
39
- takerFeeRatio === '0'
40
- ) {
41
- return ''
25
+ if (takerFeeReceiver === constants_1.ZERO_ADDRESS || takerFeeRatio === '0') {
26
+ return '';
42
27
  }
43
- return (
44
- bignumber_1.BigNumber.from(takerFeeRatio)
45
- .toHexString()
46
- .substring(2)
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';
@@ -1,9 +1,9 @@
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
+ "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
- 'use strict'
2
- Object.defineProperty(exports, '__esModule', {value: true})
3
- exports.CONTRACT_TAKER_FEE_PRECISION =
4
- exports.POINTS_LENGTH_MASK =
5
- exports.RESOLVERS_LENGTH_OFFSET =
6
- exports.RESOLVERS_LENGTH_MASK =
7
- exports.HAS_TAKING_FEE_FLAG =
8
- exports.FLAGS_LENGTH =
9
- exports.TAKER_FEE_RATIO_LENGTH =
10
- exports.TAKER_FEE_RECEIVER_LENGTH =
11
- exports.PRIVATE_AUCTION_DEADLINE_LENGTH =
12
- exports.ALLOWED_TIMESTAMP_LENGTH =
13
- exports.ADDRESS_LENGTH =
14
- exports.AUCTION_DELAY_LENGTH =
15
- exports.AUCTION_BUMP_LENGTH =
16
- void 0
17
- exports.AUCTION_BUMP_LENGTH = 6
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
- 'use strict'
2
- Object.defineProperty(exports, '__esModule', {value: true})
3
- exports.BadOrderSuffixError = void 0
4
- class BadOrderSuffixError extends Error {}
5
- exports.BadOrderSuffixError = BadOrderSuffixError
6
- //# sourceMappingURL=errors.js.map
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
- '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
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