@opensea/seaport-js 2.0.3 → 2.0.5

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 (215) hide show
  1. package/README.md +4 -4
  2. package/lib/bundle.js +34 -12
  3. package/lib/constants.js +4 -4
  4. package/lib/constants.js.map +1 -1
  5. package/lib/seaport.js +3 -3
  6. package/lib/seaport.js.map +1 -1
  7. package/lib/typechain-types/factories/@rari-capital/solmate/src/tokens/ERC1155.sol/ERC1155TokenReceiver__factory.js +1 -1
  8. package/lib/typechain-types/factories/@rari-capital/solmate/src/tokens/ERC1155.sol/ERC1155TokenReceiver__factory.js.map +1 -1
  9. package/lib/typechain-types/factories/@rari-capital/solmate/src/tokens/ERC1155.sol/ERC1155__factory.js +1 -1
  10. package/lib/typechain-types/factories/@rari-capital/solmate/src/tokens/ERC1155.sol/ERC1155__factory.js.map +1 -1
  11. package/lib/typechain-types/factories/@rari-capital/solmate/src/tokens/ERC20__factory.js +1 -1
  12. package/lib/typechain-types/factories/@rari-capital/solmate/src/tokens/ERC20__factory.js.map +1 -1
  13. package/lib/typechain-types/factories/@rari-capital/solmate/src/tokens/ERC721.sol/ERC721TokenReceiver__factory.js +1 -1
  14. package/lib/typechain-types/factories/@rari-capital/solmate/src/tokens/ERC721.sol/ERC721TokenReceiver__factory.js.map +1 -1
  15. package/lib/typechain-types/factories/@rari-capital/solmate/src/tokens/ERC721.sol/ERC721__factory.js +1 -1
  16. package/lib/typechain-types/factories/@rari-capital/solmate/src/tokens/ERC721.sol/ERC721__factory.js.map +1 -1
  17. package/lib/typechain-types/factories/domain-registry/contracts/DomainRegistry__factory.js +1 -1
  18. package/lib/typechain-types/factories/domain-registry/contracts/DomainRegistry__factory.js.map +1 -1
  19. package/lib/typechain-types/factories/domain-registry/contracts/interfaces/DomainRegistryInterface__factory.js +1 -1
  20. package/lib/typechain-types/factories/domain-registry/contracts/interfaces/DomainRegistryInterface__factory.js.map +1 -1
  21. package/lib/typechain-types/factories/seaport-core/src/conduit/ConduitController__factory.js +1 -1
  22. package/lib/typechain-types/factories/seaport-core/src/conduit/ConduitController__factory.js.map +1 -1
  23. package/lib/typechain-types/factories/seaport-core/src/conduit/Conduit__factory.js +1 -1
  24. package/lib/typechain-types/factories/seaport-core/src/conduit/Conduit__factory.js.map +1 -1
  25. package/lib/typechain-types/factories/seaport-core/src/lib/AmountDeriver__factory.js +1 -1
  26. package/lib/typechain-types/factories/seaport-core/src/lib/AmountDeriver__factory.js.map +1 -1
  27. package/lib/typechain-types/factories/seaport-core/src/lib/Assertions__factory.js +1 -1
  28. package/lib/typechain-types/factories/seaport-core/src/lib/Assertions__factory.js.map +1 -1
  29. package/lib/typechain-types/factories/seaport-core/src/lib/BasicOrderFulfiller__factory.js +1 -1
  30. package/lib/typechain-types/factories/seaport-core/src/lib/BasicOrderFulfiller__factory.js.map +1 -1
  31. package/lib/typechain-types/factories/seaport-core/src/lib/ConsiderationBase__factory.js +1 -1
  32. package/lib/typechain-types/factories/seaport-core/src/lib/ConsiderationBase__factory.js.map +1 -1
  33. package/lib/typechain-types/factories/seaport-core/src/lib/Consideration__factory.js +1 -1
  34. package/lib/typechain-types/factories/seaport-core/src/lib/Consideration__factory.js.map +1 -1
  35. package/lib/typechain-types/factories/seaport-core/src/lib/CounterManager__factory.js +1 -1
  36. package/lib/typechain-types/factories/seaport-core/src/lib/CounterManager__factory.js.map +1 -1
  37. package/lib/typechain-types/factories/seaport-core/src/lib/CriteriaResolution__factory.js +1 -1
  38. package/lib/typechain-types/factories/seaport-core/src/lib/CriteriaResolution__factory.js.map +1 -1
  39. package/lib/typechain-types/factories/seaport-core/src/lib/Executor__factory.js +1 -1
  40. package/lib/typechain-types/factories/seaport-core/src/lib/Executor__factory.js.map +1 -1
  41. package/lib/typechain-types/factories/seaport-core/src/lib/FulfillmentApplier__factory.js +1 -1
  42. package/lib/typechain-types/factories/seaport-core/src/lib/FulfillmentApplier__factory.js.map +1 -1
  43. package/lib/typechain-types/factories/seaport-core/src/lib/GettersAndDerivers__factory.js +1 -1
  44. package/lib/typechain-types/factories/seaport-core/src/lib/GettersAndDerivers__factory.js.map +1 -1
  45. package/lib/typechain-types/factories/seaport-core/src/lib/OrderCombiner__factory.js +1 -1
  46. package/lib/typechain-types/factories/seaport-core/src/lib/OrderCombiner__factory.js.map +1 -1
  47. package/lib/typechain-types/factories/seaport-core/src/lib/OrderFulfiller__factory.js +1 -1
  48. package/lib/typechain-types/factories/seaport-core/src/lib/OrderFulfiller__factory.js.map +1 -1
  49. package/lib/typechain-types/factories/seaport-core/src/lib/OrderValidator__factory.js +1 -1
  50. package/lib/typechain-types/factories/seaport-core/src/lib/OrderValidator__factory.js.map +1 -1
  51. package/lib/typechain-types/factories/seaport-core/src/lib/ReentrancyGuard__factory.js +1 -1
  52. package/lib/typechain-types/factories/seaport-core/src/lib/ReentrancyGuard__factory.js.map +1 -1
  53. package/lib/typechain-types/factories/seaport-core/src/lib/SignatureVerification__factory.js +1 -1
  54. package/lib/typechain-types/factories/seaport-core/src/lib/SignatureVerification__factory.js.map +1 -1
  55. package/lib/typechain-types/factories/seaport-core/src/lib/TokenTransferrer__factory.js +1 -1
  56. package/lib/typechain-types/factories/seaport-core/src/lib/TokenTransferrer__factory.js.map +1 -1
  57. package/lib/typechain-types/factories/seaport-core/src/lib/Verifiers__factory.js +1 -1
  58. package/lib/typechain-types/factories/seaport-core/src/lib/Verifiers__factory.js.map +1 -1
  59. package/lib/typechain-types/factories/seaport-core/src/lib/ZoneInteraction__factory.js +1 -1
  60. package/lib/typechain-types/factories/seaport-core/src/lib/ZoneInteraction__factory.js.map +1 -1
  61. package/lib/typechain-types/factories/seaport-types/src/interfaces/AmountDerivationErrors__factory.js +1 -1
  62. package/lib/typechain-types/factories/seaport-types/src/interfaces/AmountDerivationErrors__factory.js.map +1 -1
  63. package/lib/typechain-types/factories/seaport-types/src/interfaces/ConduitControllerInterface__factory.js +1 -1
  64. package/lib/typechain-types/factories/seaport-types/src/interfaces/ConduitControllerInterface__factory.js.map +1 -1
  65. package/lib/typechain-types/factories/seaport-types/src/interfaces/ConduitInterface__factory.js +1 -1
  66. package/lib/typechain-types/factories/seaport-types/src/interfaces/ConduitInterface__factory.js.map +1 -1
  67. package/lib/typechain-types/factories/seaport-types/src/interfaces/ConsiderationEventsAndErrors__factory.js +1 -1
  68. package/lib/typechain-types/factories/seaport-types/src/interfaces/ConsiderationEventsAndErrors__factory.js.map +1 -1
  69. package/lib/typechain-types/factories/seaport-types/src/interfaces/ConsiderationInterface__factory.js +1 -1
  70. package/lib/typechain-types/factories/seaport-types/src/interfaces/ConsiderationInterface__factory.js.map +1 -1
  71. package/lib/typechain-types/factories/seaport-types/src/interfaces/CriteriaResolutionErrors__factory.js +1 -1
  72. package/lib/typechain-types/factories/seaport-types/src/interfaces/CriteriaResolutionErrors__factory.js.map +1 -1
  73. package/lib/typechain-types/factories/seaport-types/src/interfaces/FulfillmentApplicationErrors__factory.js +1 -1
  74. package/lib/typechain-types/factories/seaport-types/src/interfaces/FulfillmentApplicationErrors__factory.js.map +1 -1
  75. package/lib/typechain-types/factories/seaport-types/src/interfaces/ReentrancyErrors__factory.js +1 -1
  76. package/lib/typechain-types/factories/seaport-types/src/interfaces/ReentrancyErrors__factory.js.map +1 -1
  77. package/lib/typechain-types/factories/seaport-types/src/interfaces/SignatureVerificationErrors__factory.js +1 -1
  78. package/lib/typechain-types/factories/seaport-types/src/interfaces/SignatureVerificationErrors__factory.js.map +1 -1
  79. package/lib/typechain-types/factories/seaport-types/src/interfaces/TokenTransferrerErrors__factory.js +1 -1
  80. package/lib/typechain-types/factories/seaport-types/src/interfaces/TokenTransferrerErrors__factory.js.map +1 -1
  81. package/lib/typechain-types/factories/seaport-types/src/interfaces/ZoneInteractionErrors__factory.js +1 -1
  82. package/lib/typechain-types/factories/seaport-types/src/interfaces/ZoneInteractionErrors__factory.js.map +1 -1
  83. package/lib/typechain-types/factories/seaport_v1_4/contracts/Seaport__factory.js +1 -1
  84. package/lib/typechain-types/factories/seaport_v1_4/contracts/Seaport__factory.js.map +1 -1
  85. package/lib/typechain-types/factories/seaport_v1_4/contracts/conduit/Conduit.sol/LocalConduit__factory.js +1 -1
  86. package/lib/typechain-types/factories/seaport_v1_4/contracts/conduit/Conduit.sol/LocalConduit__factory.js.map +1 -1
  87. package/lib/typechain-types/factories/seaport_v1_4/contracts/conduit/ConduitController.sol/LocalConduitController__factory.js +1 -1
  88. package/lib/typechain-types/factories/seaport_v1_4/contracts/conduit/ConduitController.sol/LocalConduitController__factory.js.map +1 -1
  89. package/lib/typechain-types/factories/seaport_v1_5/contracts/Seaport__factory.js +1 -1
  90. package/lib/typechain-types/factories/seaport_v1_5/contracts/Seaport__factory.js.map +1 -1
  91. package/lib/typechain-types/factories/src/contracts/test/TestERC1155__factory.js +1 -1
  92. package/lib/typechain-types/factories/src/contracts/test/TestERC1155__factory.js.map +1 -1
  93. package/lib/typechain-types/factories/src/contracts/test/TestERC1271Wallet.sol/IERC20Approve__factory.d.ts +26 -0
  94. package/lib/typechain-types/factories/src/contracts/test/TestERC1271Wallet.sol/IERC20Approve__factory.js +44 -0
  95. package/lib/typechain-types/factories/src/contracts/test/TestERC1271Wallet.sol/IERC20Approve__factory.js.map +1 -0
  96. package/lib/typechain-types/factories/src/contracts/test/TestERC1271Wallet.sol/TestERC1271Wallet__factory.d.ts +96 -0
  97. package/lib/typechain-types/factories/src/contracts/test/TestERC1271Wallet.sol/TestERC1271Wallet__factory.js +142 -0
  98. package/lib/typechain-types/factories/src/contracts/test/TestERC1271Wallet.sol/TestERC1271Wallet__factory.js.map +1 -0
  99. package/lib/typechain-types/factories/src/contracts/test/TestERC1271Wallet.sol/index.d.ts +2 -0
  100. package/lib/typechain-types/factories/src/contracts/test/TestERC1271Wallet.sol/index.js +11 -0
  101. package/lib/typechain-types/factories/src/contracts/test/TestERC1271Wallet.sol/index.js.map +1 -0
  102. package/lib/typechain-types/factories/src/contracts/test/TestERC20USDC__factory.js +1 -1
  103. package/lib/typechain-types/factories/src/contracts/test/TestERC20USDC__factory.js.map +1 -1
  104. package/lib/typechain-types/factories/src/contracts/test/TestERC20__factory.js +1 -1
  105. package/lib/typechain-types/factories/src/contracts/test/TestERC20__factory.js.map +1 -1
  106. package/lib/typechain-types/factories/src/contracts/test/TestERC721__factory.js +1 -1
  107. package/lib/typechain-types/factories/src/contracts/test/TestERC721__factory.js.map +1 -1
  108. package/lib/typechain-types/factories/src/contracts/test/index.d.ts +1 -0
  109. package/lib/typechain-types/factories/src/contracts/test/index.js +2 -1
  110. package/lib/typechain-types/factories/src/contracts/test/index.js.map +1 -1
  111. package/lib/typechain-types/index.d.ts +4 -0
  112. package/lib/typechain-types/index.js +5 -1
  113. package/lib/typechain-types/index.js.map +1 -1
  114. package/lib/typechain-types/src/contracts/test/TestERC1271Wallet.sol/IERC20Approve.d.ts +50 -0
  115. package/lib/typechain-types/src/contracts/test/TestERC1271Wallet.sol/IERC20Approve.js +3 -0
  116. package/lib/typechain-types/src/contracts/test/TestERC1271Wallet.sol/IERC20Approve.js.map +1 -0
  117. package/lib/typechain-types/src/contracts/test/TestERC1271Wallet.sol/TestERC1271Wallet.d.ts +82 -0
  118. package/lib/typechain-types/src/contracts/test/TestERC1271Wallet.sol/TestERC1271Wallet.js +3 -0
  119. package/lib/typechain-types/src/contracts/test/TestERC1271Wallet.sol/TestERC1271Wallet.js.map +1 -0
  120. package/lib/typechain-types/src/contracts/test/TestERC1271Wallet.sol/index.d.ts +2 -0
  121. package/lib/typechain-types/src/contracts/test/TestERC1271Wallet.sol/index.js +3 -0
  122. package/lib/typechain-types/src/contracts/test/TestERC1271Wallet.sol/index.js.map +1 -0
  123. package/lib/typechain-types/src/contracts/test/index.d.ts +2 -0
  124. package/lib/types.d.ts +1 -0
  125. package/lib/utils/criteria.js.map +1 -1
  126. package/package.json +4 -4
  127. package/src/artifacts/@rari-capital/solmate/src/tokens/ERC1155.sol/ERC1155.dbg.json +1 -1
  128. package/src/artifacts/@rari-capital/solmate/src/tokens/ERC1155.sol/ERC1155TokenReceiver.dbg.json +1 -1
  129. package/src/artifacts/@rari-capital/solmate/src/tokens/ERC20.sol/ERC20.dbg.json +1 -1
  130. package/src/artifacts/@rari-capital/solmate/src/tokens/ERC721.sol/ERC721.dbg.json +1 -1
  131. package/src/artifacts/@rari-capital/solmate/src/tokens/ERC721.sol/ERC721TokenReceiver.dbg.json +1 -1
  132. package/src/artifacts/build-info/{9bdb09ed3cce3558b76665325e604aed.json → d74aedd79bfea1f175b8b4ef785e53de.json} +1 -1
  133. package/src/artifacts/domain-registry/contracts/DomainRegistry.sol/DomainRegistry.dbg.json +1 -1
  134. package/src/artifacts/domain-registry/contracts/interfaces/DomainRegistryInterface.sol/DomainRegistryInterface.dbg.json +1 -1
  135. package/src/artifacts/seaport-core/src/conduit/Conduit.sol/Conduit.dbg.json +1 -1
  136. package/src/artifacts/seaport-core/src/conduit/ConduitController.sol/ConduitController.dbg.json +1 -1
  137. package/src/artifacts/seaport-core/src/lib/AmountDeriver.sol/AmountDeriver.dbg.json +1 -1
  138. package/src/artifacts/seaport-core/src/lib/Assertions.sol/Assertions.dbg.json +1 -1
  139. package/src/artifacts/seaport-core/src/lib/BasicOrderFulfiller.sol/BasicOrderFulfiller.dbg.json +1 -1
  140. package/src/artifacts/seaport-core/src/lib/Consideration.sol/Consideration.dbg.json +1 -1
  141. package/src/artifacts/seaport-core/src/lib/ConsiderationBase.sol/ConsiderationBase.dbg.json +1 -1
  142. package/src/artifacts/seaport-core/src/lib/ConsiderationDecoder.sol/ConsiderationDecoder.dbg.json +1 -1
  143. package/src/artifacts/seaport-core/src/lib/ConsiderationEncoder.sol/ConsiderationEncoder.dbg.json +1 -1
  144. package/src/artifacts/seaport-core/src/lib/CounterManager.sol/CounterManager.dbg.json +1 -1
  145. package/src/artifacts/seaport-core/src/lib/CriteriaResolution.sol/CriteriaResolution.dbg.json +1 -1
  146. package/src/artifacts/seaport-core/src/lib/Executor.sol/Executor.dbg.json +1 -1
  147. package/src/artifacts/seaport-core/src/lib/FulfillmentApplier.sol/FulfillmentApplier.dbg.json +1 -1
  148. package/src/artifacts/seaport-core/src/lib/GettersAndDerivers.sol/GettersAndDerivers.dbg.json +1 -1
  149. package/src/artifacts/seaport-core/src/lib/LowLevelHelpers.sol/LowLevelHelpers.dbg.json +1 -1
  150. package/src/artifacts/seaport-core/src/lib/OrderCombiner.sol/OrderCombiner.dbg.json +1 -1
  151. package/src/artifacts/seaport-core/src/lib/OrderFulfiller.sol/OrderFulfiller.dbg.json +1 -1
  152. package/src/artifacts/seaport-core/src/lib/OrderValidator.sol/OrderValidator.dbg.json +1 -1
  153. package/src/artifacts/seaport-core/src/lib/ReentrancyGuard.sol/ReentrancyGuard.dbg.json +1 -1
  154. package/src/artifacts/seaport-core/src/lib/SignatureVerification.sol/SignatureVerification.dbg.json +1 -1
  155. package/src/artifacts/seaport-core/src/lib/TokenTransferrer.sol/TokenTransferrer.dbg.json +1 -1
  156. package/src/artifacts/seaport-core/src/lib/Verifiers.sol/Verifiers.dbg.json +1 -1
  157. package/src/artifacts/seaport-core/src/lib/ZoneInteraction.sol/ZoneInteraction.dbg.json +1 -1
  158. package/src/artifacts/seaport-types/src/helpers/PointerLibraries.sol/CalldataPointerLib.dbg.json +1 -1
  159. package/src/artifacts/seaport-types/src/helpers/PointerLibraries.sol/CalldataReaders.dbg.json +1 -1
  160. package/src/artifacts/seaport-types/src/helpers/PointerLibraries.sol/MemoryPointerLib.dbg.json +1 -1
  161. package/src/artifacts/seaport-types/src/helpers/PointerLibraries.sol/MemoryReaders.dbg.json +1 -1
  162. package/src/artifacts/seaport-types/src/helpers/PointerLibraries.sol/MemoryWriters.dbg.json +1 -1
  163. package/src/artifacts/seaport-types/src/helpers/PointerLibraries.sol/ReturndataPointerLib.dbg.json +1 -1
  164. package/src/artifacts/seaport-types/src/helpers/PointerLibraries.sol/ReturndataReaders.dbg.json +1 -1
  165. package/src/artifacts/seaport-types/src/interfaces/AmountDerivationErrors.sol/AmountDerivationErrors.dbg.json +1 -1
  166. package/src/artifacts/seaport-types/src/interfaces/ConduitControllerInterface.sol/ConduitControllerInterface.dbg.json +1 -1
  167. package/src/artifacts/seaport-types/src/interfaces/ConduitInterface.sol/ConduitInterface.dbg.json +1 -1
  168. package/src/artifacts/seaport-types/src/interfaces/ConsiderationEventsAndErrors.sol/ConsiderationEventsAndErrors.dbg.json +1 -1
  169. package/src/artifacts/seaport-types/src/interfaces/ConsiderationInterface.sol/ConsiderationInterface.dbg.json +1 -1
  170. package/src/artifacts/seaport-types/src/interfaces/CriteriaResolutionErrors.sol/CriteriaResolutionErrors.dbg.json +1 -1
  171. package/src/artifacts/seaport-types/src/interfaces/FulfillmentApplicationErrors.sol/FulfillmentApplicationErrors.dbg.json +1 -1
  172. package/src/artifacts/seaport-types/src/interfaces/ReentrancyErrors.sol/ReentrancyErrors.dbg.json +1 -1
  173. package/src/artifacts/seaport-types/src/interfaces/SignatureVerificationErrors.sol/SignatureVerificationErrors.dbg.json +1 -1
  174. package/src/artifacts/seaport-types/src/interfaces/TokenTransferrerErrors.sol/TokenTransferrerErrors.dbg.json +1 -1
  175. package/src/artifacts/seaport-types/src/interfaces/ZoneInteractionErrors.sol/ZoneInteractionErrors.dbg.json +1 -1
  176. package/src/artifacts/seaport-types/src/lib/ConsiderationStructs.sol/StructPointers.dbg.json +1 -1
  177. package/src/artifacts/seaport_v1_4/contracts/Seaport.sol/Seaport.dbg.json +1 -1
  178. package/src/artifacts/seaport_v1_4/contracts/conduit/Conduit.sol/LocalConduit.dbg.json +1 -1
  179. package/src/artifacts/seaport_v1_4/contracts/conduit/ConduitController.sol/LocalConduitController.dbg.json +1 -1
  180. package/src/artifacts/seaport_v1_5/contracts/Seaport.sol/Seaport.dbg.json +1 -1
  181. package/src/artifacts/src/contracts/test/TestERC1155.sol/TestERC1155.dbg.json +1 -1
  182. package/src/artifacts/src/contracts/test/TestERC1271Wallet.sol/IERC20Approve.dbg.json +4 -0
  183. package/src/artifacts/src/contracts/test/TestERC1271Wallet.sol/IERC20Approve.json +35 -0
  184. package/src/artifacts/src/contracts/test/TestERC1271Wallet.sol/TestERC1271Wallet.dbg.json +4 -0
  185. package/src/artifacts/src/contracts/test/TestERC1271Wallet.sol/TestERC1271Wallet.json +110 -0
  186. package/src/artifacts/src/contracts/test/TestERC20.sol/TestERC20.dbg.json +1 -1
  187. package/src/artifacts/src/contracts/test/TestERC20USDC.sol/TestERC20USDC.dbg.json +1 -1
  188. package/src/artifacts/src/contracts/test/TestERC721.sol/TestERC721.dbg.json +1 -1
  189. package/src/constants.ts +1 -1
  190. package/src/contracts/test/TestERC1271Wallet.sol +89 -0
  191. package/src/seaport.ts +58 -57
  192. package/src/typechain-types/factories/src/contracts/test/TestERC1271Wallet.sol/IERC20Approve__factory.ts +50 -0
  193. package/src/typechain-types/factories/src/contracts/test/TestERC1271Wallet.sol/TestERC1271Wallet__factory.ts +161 -0
  194. package/src/typechain-types/factories/src/contracts/test/TestERC1271Wallet.sol/index.ts +5 -0
  195. package/src/typechain-types/factories/src/contracts/test/index.ts +1 -0
  196. package/src/typechain-types/hardhat.d.ts +18 -0
  197. package/src/typechain-types/index.ts +4 -0
  198. package/src/typechain-types/src/contracts/test/TestERC1271Wallet.sol/IERC20Approve.ts +107 -0
  199. package/src/typechain-types/src/contracts/test/TestERC1271Wallet.sol/TestERC1271Wallet.ts +228 -0
  200. package/src/typechain-types/src/contracts/test/TestERC1271Wallet.sol/index.ts +5 -0
  201. package/src/typechain-types/src/contracts/test/index.ts +2 -0
  202. package/src/types.ts +13 -12
  203. package/src/utils/approval.ts +9 -9
  204. package/src/utils/balance.ts +7 -7
  205. package/src/utils/balanceAndApprovalCheck.ts +22 -22
  206. package/src/utils/criteria.ts +7 -7
  207. package/src/utils/eip712/Eip712MerkleTree.ts +2 -2
  208. package/src/utils/eip712/bulk-orders.ts +2 -2
  209. package/src/utils/eip712/defaults.ts +5 -5
  210. package/src/utils/eip712/utils.ts +1 -1
  211. package/src/utils/fulfill.ts +44 -44
  212. package/src/utils/item.ts +3 -3
  213. package/src/utils/merkletree.ts +2 -2
  214. package/src/utils/order.ts +15 -15
  215. package/src/utils/usecase.ts +8 -8
@@ -68,7 +68,7 @@ import { executeAllActions, getTransactionMethods } from "./usecase";
68
68
  */
69
69
  export const shouldUseBasicFulfill = (
70
70
  { offer, consideration, offerer }: OrderParameters,
71
- totalFilled: OrderStatus["totalFilled"]
71
+ totalFilled: OrderStatus["totalFilled"],
72
72
  ) => {
73
73
  // 1. The order must not be partially filled
74
74
  if (!totalFilled.eq(0)) {
@@ -83,11 +83,11 @@ export const shouldUseBasicFulfill = (
83
83
  const allItems = [...offer, ...consideration];
84
84
 
85
85
  const nfts = allItems.filter(({ itemType }) =>
86
- [ItemType.ERC721, ItemType.ERC1155].includes(itemType)
86
+ [ItemType.ERC721, ItemType.ERC1155].includes(itemType),
87
87
  );
88
88
 
89
89
  const nftsWithCriteria = allItems.filter(({ itemType }) =>
90
- isCriteriaItem(itemType)
90
+ isCriteriaItem(itemType),
91
91
  );
92
92
 
93
93
  const offersNativeCurrency = isNativeCurrencyItem(offer[0]);
@@ -109,7 +109,7 @@ export const shouldUseBasicFulfill = (
109
109
 
110
110
  // 6. All individual items need to have the same startAmount and endAmount
111
111
  const differentStartAndEndAmount = allItems.some(
112
- ({ startAmount, endAmount }) => startAmount !== endAmount
112
+ ({ startAmount, endAmount }) => startAmount !== endAmount,
113
113
  );
114
114
 
115
115
  if (differentStartAndEndAmount) {
@@ -147,7 +147,7 @@ export const shouldUseBasicFulfill = (
147
147
  .every(({ token }) => token === ethers.constants.AddressZero);
148
148
 
149
149
  const currencyIdentifiersAreZero = currencies.every(
150
- ({ identifierOrCriteria }) => BigNumber.from(identifierOrCriteria).eq(0)
150
+ ({ identifierOrCriteria }) => BigNumber.from(identifierOrCriteria).eq(0),
151
151
  );
152
152
 
153
153
  const erc721sAreSingleAmount = nfts
@@ -204,7 +204,7 @@ export function fulfillBasicOrder(
204
204
  conduitKey: string;
205
205
  domain?: string;
206
206
  },
207
- exactApproval: boolean
207
+ exactApproval: boolean,
208
208
  ): OrderUseCase<
209
209
  ExchangeAction<ContractMethodReturnType<SeaportContract, "fulfillBasicOrder">>
210
210
  > {
@@ -221,7 +221,7 @@ export function fulfillBasicOrder(
221
221
 
222
222
  if (basicOrderRouteType === undefined) {
223
223
  throw new Error(
224
- "Order parameters did not result in a valid basic fulfillment"
224
+ "Order parameters did not result in a valid basic fulfillment",
225
225
  );
226
226
  }
227
227
 
@@ -229,11 +229,11 @@ export function fulfillBasicOrder(
229
229
  ({ startAmount, recipient }) => ({
230
230
  amount: startAmount,
231
231
  recipient,
232
- })
232
+ }),
233
233
  );
234
234
 
235
235
  const considerationWithoutOfferItemType = considerationIncludingTips.filter(
236
- (item) => item.itemType !== offer[0].itemType
236
+ (item) => item.itemType !== offer[0].itemType,
237
237
  );
238
238
 
239
239
  const totalNativeAmount = getSummedTokenAndIdentifierAmounts({
@@ -286,7 +286,7 @@ export function fulfillBasicOrder(
286
286
  const approvalActions = getApprovalActions(
287
287
  insufficientApprovals,
288
288
  exactApproval,
289
- signer
289
+ signer,
290
290
  );
291
291
 
292
292
  const exchangeAction = {
@@ -295,7 +295,7 @@ export function fulfillBasicOrder(
295
295
  seaportContract.connect(signer),
296
296
  "fulfillBasicOrder",
297
297
  [basicOrderParameters, payableOverrides],
298
- domain
298
+ domain,
299
299
  ),
300
300
  } as const;
301
301
 
@@ -348,7 +348,7 @@ export function fulfillStandardOrder(
348
348
  signer: Signer;
349
349
  domain?: string;
350
350
  },
351
- exactApproval: boolean
351
+ exactApproval: boolean,
352
352
  ): OrderUseCase<
353
353
  ExchangeAction<
354
354
  ContractMethodReturnType<
@@ -377,11 +377,11 @@ export function fulfillStandardOrder(
377
377
  const considerationIncludingTips = [...consideration, ...tips];
378
378
 
379
379
  const offerCriteriaItems = offer.filter(({ itemType }) =>
380
- isCriteriaItem(itemType)
380
+ isCriteriaItem(itemType),
381
381
  );
382
382
 
383
383
  const considerationCriteriaItems = considerationIncludingTips.filter(
384
- ({ itemType }) => isCriteriaItem(itemType)
384
+ ({ itemType }) => isCriteriaItem(itemType),
385
385
  );
386
386
 
387
387
  const hasCriteriaItems =
@@ -392,7 +392,7 @@ export function fulfillStandardOrder(
392
392
  considerationCriteriaItems.length !== considerationCriteria.length
393
393
  ) {
394
394
  throw new Error(
395
- "You must supply the appropriate criterias for criteria based items"
395
+ "You must supply the appropriate criterias for criteria based items",
396
396
  );
397
397
  }
398
398
 
@@ -422,7 +422,7 @@ export function fulfillStandardOrder(
422
422
  const approvalActions = getApprovalActions(
423
423
  insufficientApprovals,
424
424
  exactApproval,
425
- signer
425
+ signer,
426
426
  );
427
427
 
428
428
  const isGift = recipientAddress !== ethers.constants.AddressZero;
@@ -440,7 +440,7 @@ export function fulfillStandardOrder(
440
440
 
441
441
  const { numerator, denominator } = getAdvancedOrderNumeratorDenominator(
442
442
  order,
443
- unitsToFill
443
+ unitsToFill,
444
444
  );
445
445
 
446
446
  const exchangeAction = {
@@ -467,13 +467,13 @@ export function fulfillStandardOrder(
467
467
  recipientAddress,
468
468
  payableOverrides,
469
469
  ],
470
- domain
470
+ domain,
471
471
  )
472
472
  : getTransactionMethods(
473
473
  seaportContract.connect(signer),
474
474
  "fulfillOrder",
475
475
  [orderAccountingForTips, conduitKey, payableOverrides],
476
- domain
476
+ domain,
477
477
  ),
478
478
  } as const;
479
479
 
@@ -488,7 +488,7 @@ export function fulfillStandardOrder(
488
488
 
489
489
  export function validateAndSanitizeFromOrderStatus(
490
490
  order: Order,
491
- orderStatus: OrderStatus
491
+ orderStatus: OrderStatus,
492
492
  ): Order {
493
493
  const { isValidated, isCancelled, totalFilled, totalSize } = orderStatus;
494
494
 
@@ -553,7 +553,7 @@ export function fulfillAvailableOrders({
553
553
  ...orderMetadata,
554
554
  order: validateAndSanitizeFromOrderStatus(
555
555
  orderMetadata.order,
556
- orderMetadata.orderStatus
556
+ orderMetadata.orderStatus,
557
557
  ),
558
558
  }));
559
559
 
@@ -572,7 +572,7 @@ export function fulfillAvailableOrders({
572
572
  totalFilled: orderMetadata.orderStatus.totalFilled,
573
573
  totalSize: orderMetadata.orderStatus.totalSize,
574
574
  }),
575
- })
575
+ }),
576
576
  );
577
577
 
578
578
  let totalNativeAmount = BigNumber.from(0);
@@ -588,12 +588,12 @@ export function fulfillAvailableOrders({
588
588
  const hasCriteriaItems = criteriaOffersAndConsiderations.length > 0;
589
589
 
590
590
  const addApprovalIfNeeded = (
591
- orderInsufficientApprovals: InsufficientApprovals
591
+ orderInsufficientApprovals: InsufficientApprovals,
592
592
  ) => {
593
593
  orderInsufficientApprovals.forEach((insufficientApproval) => {
594
594
  if (
595
595
  !totalInsufficientApprovals.find(
596
- (approval) => approval.token === insufficientApproval.token
596
+ (approval) => approval.token === insufficientApproval.token,
597
597
  )
598
598
  ) {
599
599
  totalInsufficientApprovals.push(insufficientApproval);
@@ -628,7 +628,7 @@ export function fulfillAvailableOrders({
628
628
  items: considerationIncludingTips,
629
629
  criterias: considerationCriteria,
630
630
  timeBasedItemParams,
631
- })[ethers.constants.AddressZero]?.["0"] ?? BigNumber.from(0)
631
+ })[ethers.constants.AddressZero]?.["0"] ?? BigNumber.from(0),
632
632
  );
633
633
 
634
634
  const insufficientApprovals = validateStandardFulfillBalancesAndApprovals(
@@ -642,15 +642,15 @@ export function fulfillAvailableOrders({
642
642
  timeBasedItemParams,
643
643
  offererOperator,
644
644
  fulfillerOperator,
645
- }
645
+ },
646
646
  );
647
647
 
648
648
  const offerCriteriaItems = order.parameters.offer.filter(({ itemType }) =>
649
- isCriteriaItem(itemType)
649
+ isCriteriaItem(itemType),
650
650
  );
651
651
 
652
652
  const considerationCriteriaItems = considerationIncludingTips.filter(
653
- ({ itemType }) => isCriteriaItem(itemType)
653
+ ({ itemType }) => isCriteriaItem(itemType),
654
654
  );
655
655
 
656
656
  if (
@@ -658,12 +658,12 @@ export function fulfillAvailableOrders({
658
658
  considerationCriteriaItems.length !== considerationCriteria.length
659
659
  ) {
660
660
  throw new Error(
661
- "You must supply the appropriate criterias for criteria based items"
661
+ "You must supply the appropriate criterias for criteria based items",
662
662
  );
663
663
  }
664
664
 
665
665
  addApprovalIfNeeded(insufficientApprovals);
666
- }
666
+ },
667
667
  );
668
668
 
669
669
  const payableOverrides = { value: totalNativeAmount };
@@ -671,14 +671,14 @@ export function fulfillAvailableOrders({
671
671
  const approvalActions = getApprovalActions(
672
672
  totalInsufficientApprovals,
673
673
  exactApproval,
674
- signer
674
+ signer,
675
675
  );
676
676
 
677
677
  const advancedOrdersWithTips: AdvancedOrder[] = sanitizedOrdersMetadata.map(
678
678
  ({ order, unitsToFill = 0, tips, extraData }) => {
679
679
  const { numerator, denominator } = getAdvancedOrderNumeratorDenominator(
680
680
  order,
681
- unitsToFill
681
+ unitsToFill,
682
682
  );
683
683
 
684
684
  const considerationIncludingTips = [
@@ -697,7 +697,7 @@ export function fulfillAvailableOrders({
697
697
  denominator,
698
698
  extraData,
699
699
  };
700
- }
700
+ },
701
701
  );
702
702
 
703
703
  const { offerFulfillments, considerationFulfillments } =
@@ -714,10 +714,10 @@ export function fulfillAvailableOrders({
714
714
  ? generateCriteriaResolvers({
715
715
  orders: ordersMetadata.map(({ order }) => order),
716
716
  offerCriterias: ordersMetadata.map(
717
- ({ offerCriteria }) => offerCriteria
717
+ ({ offerCriteria }) => offerCriteria,
718
718
  ),
719
719
  considerationCriterias: ordersMetadata.map(
720
- ({ considerationCriteria }) => considerationCriteria
720
+ ({ considerationCriteria }) => considerationCriteria,
721
721
  ),
722
722
  })
723
723
  : [],
@@ -728,7 +728,7 @@ export function fulfillAvailableOrders({
728
728
  advancedOrdersWithTips.length,
729
729
  payableOverrides,
730
730
  ],
731
- domain
731
+ domain,
732
732
  ),
733
733
  } as const;
734
734
 
@@ -742,7 +742,7 @@ export function fulfillAvailableOrders({
742
742
  }
743
743
 
744
744
  export function generateFulfillOrdersFulfillments(
745
- ordersMetadata: FulfillOrdersMetadata
745
+ ordersMetadata: FulfillOrdersMetadata,
746
746
  ): {
747
747
  offerFulfillments: FulfillmentComponentStruct[];
748
748
  considerationFulfillments: FulfillmentComponentStruct[];
@@ -773,7 +773,7 @@ export function generateFulfillOrdersFulfillments(
773
773
  ({ order, offererOperator, offerCriteria }, orderIndex) => {
774
774
  const itemToCriteria = getItemToCriteriaMap(
775
775
  order.parameters.offer,
776
- offerCriteria
776
+ offerCriteria,
777
777
  );
778
778
 
779
779
  return order.parameters.offer.forEach((item, itemIndex) => {
@@ -791,14 +791,14 @@ export function generateFulfillOrdersFulfillments(
791
791
  { orderIndex, itemIndex },
792
792
  ] as any;
793
793
  });
794
- }
794
+ },
795
795
  );
796
796
 
797
797
  ordersMetadata.forEach(
798
798
  ({ order, considerationCriteria, tips }, orderIndex) => {
799
799
  const itemToCriteria = getItemToCriteriaMap(
800
800
  order.parameters.consideration,
801
- considerationCriteria
801
+ considerationCriteria,
802
802
  );
803
803
  return [...order.parameters.consideration, ...tips].forEach(
804
804
  (item, itemIndex) => {
@@ -815,22 +815,22 @@ export function generateFulfillOrdersFulfillments(
815
815
  []) as any),
816
816
  { orderIndex, itemIndex },
817
817
  ] as any;
818
- }
818
+ },
819
819
  );
820
- }
820
+ },
821
821
  );
822
822
 
823
823
  return {
824
824
  offerFulfillments: Object.values(offerAggregatedFulfillments),
825
825
  considerationFulfillments: Object.values(
826
- considerationAggregatedFulfillments
826
+ considerationAggregatedFulfillments,
827
827
  ),
828
828
  };
829
829
  }
830
830
 
831
831
  export const getAdvancedOrderNumeratorDenominator = (
832
832
  order: Order,
833
- unitsToFill?: BigNumberish
833
+ unitsToFill?: BigNumberish,
834
834
  ) => {
835
835
  // Used for advanced order cases
836
836
  const maxUnits = getMaximumSizeForOrder(order);
package/src/utils/item.ts CHANGED
@@ -21,7 +21,7 @@ export const isErc1155Item = (itemType: Item["itemType"]) =>
21
21
 
22
22
  export const isCriteriaItem = (itemType: Item["itemType"]) =>
23
23
  [ItemType.ERC721_WITH_CRITERIA, ItemType.ERC1155_WITH_CRITERIA].includes(
24
- itemType
24
+ itemType,
25
25
  );
26
26
 
27
27
  export type TimeBasedItemParams = {
@@ -57,7 +57,7 @@ export const getPresentItemAmount = ({
57
57
  const adjustedBlockTimestamp = BigNumber.from(
58
58
  isAscending
59
59
  ? currentBlockTimestamp + ascendingAmountTimestampBuffer
60
- : currentBlockTimestamp
60
+ : currentBlockTimestamp,
61
61
  );
62
62
 
63
63
  if (adjustedBlockTimestamp.lt(startTime)) {
@@ -112,7 +112,7 @@ export const getSummedTokenAndIdentifierAmounts = ({
112
112
  startAmount: item.startAmount,
113
113
  endAmount: item.endAmount,
114
114
  timeBasedItemParams,
115
- })
115
+ }),
116
116
  ),
117
117
  },
118
118
  };
@@ -6,8 +6,8 @@ const hashIdentifier = (identifier: string) =>
6
6
  keccak256(
7
7
  Buffer.from(
8
8
  BigNumber.from(identifier).toHexString().slice(2).padStart(64, "0"),
9
- "hex"
10
- )
9
+ "hex",
10
+ ),
11
11
  );
12
12
 
13
13
  /**
@@ -42,7 +42,7 @@ export const feeToConsiderationItem = ({
42
42
 
43
43
  export const deductFees = <T extends Item>(
44
44
  items: T[],
45
- fees?: readonly Fee[]
45
+ fees?: readonly Fee[],
46
46
  ): T[] => {
47
47
  if (!fees) {
48
48
  return items;
@@ -50,7 +50,7 @@ export const deductFees = <T extends Item>(
50
50
 
51
51
  const totalBasisPoints = fees.reduce(
52
52
  (accBasisPoints, fee) => accBasisPoints + fee.basisPoints,
53
- 0
53
+ 0,
54
54
  );
55
55
 
56
56
  return items.map((item) => ({
@@ -134,7 +134,7 @@ export const areAllCurrenciesSame = ({
134
134
  return currencies.every(
135
135
  ({ itemType, token }) =>
136
136
  itemType === currencies[0].itemType &&
137
- token.toLowerCase() === currencies[0].token.toLowerCase()
137
+ token.toLowerCase() === currencies[0].token.toLowerCase(),
138
138
  );
139
139
  };
140
140
 
@@ -152,7 +152,7 @@ export const totalItemsAmount = <T extends OfferItem>(items: T[]) => {
152
152
  .reduce<typeof initialValues>(
153
153
  (
154
154
  { startAmount: totalStartAmount, endAmount: totalEndAmount },
155
- { startAmount, endAmount }
155
+ { startAmount, endAmount },
156
156
  ) => ({
157
157
  startAmount: totalStartAmount.add(startAmount),
158
158
  endAmount: totalEndAmount.add(endAmount),
@@ -160,7 +160,7 @@ export const totalItemsAmount = <T extends OfferItem>(items: T[]) => {
160
160
  {
161
161
  startAmount: BigNumber.from(0),
162
162
  endAmount: BigNumber.from(0),
163
- }
163
+ },
164
164
  );
165
165
  };
166
166
 
@@ -171,7 +171,7 @@ export const totalItemsAmount = <T extends OfferItem>(items: T[]) => {
171
171
  */
172
172
  export const mapOrderAmountsFromFilledStatus = (
173
173
  order: Order,
174
- { totalFilled, totalSize }: { totalFilled: BigNumber; totalSize: BigNumber }
174
+ { totalFilled, totalSize }: { totalFilled: BigNumber; totalSize: BigNumber },
175
175
  ): Order => {
176
176
  if (totalFilled.eq(0) || totalSize.eq(0)) {
177
177
  return order;
@@ -190,7 +190,7 @@ export const mapOrderAmountsFromFilledStatus = (
190
190
  ...item,
191
191
  startAmount: multiplyBasisPoints(
192
192
  item.startAmount,
193
- basisPoints
193
+ basisPoints,
194
194
  ).toString(),
195
195
  endAmount: multiplyBasisPoints(item.endAmount, basisPoints).toString(),
196
196
  })),
@@ -198,7 +198,7 @@ export const mapOrderAmountsFromFilledStatus = (
198
198
  ...item,
199
199
  startAmount: multiplyBasisPoints(
200
200
  item.startAmount,
201
- basisPoints
201
+ basisPoints,
202
202
  ).toString(),
203
203
  endAmount: multiplyBasisPoints(item.endAmount, basisPoints).toString(),
204
204
  })),
@@ -210,7 +210,7 @@ export const mapOrderAmountsFromFilledStatus = (
210
210
  const multiplyDivision = (
211
211
  amount: BigNumberish,
212
212
  numerator: BigNumberish,
213
- denominator: BigNumberish
213
+ denominator: BigNumberish,
214
214
  ) => BigNumber.from(amount).mul(BigNumber.from(numerator)).div(denominator);
215
215
 
216
216
  /**
@@ -224,7 +224,7 @@ export const mapOrderAmountsFromUnitsToFill = (
224
224
  {
225
225
  unitsToFill,
226
226
  totalSize,
227
- }: { unitsToFill: BigNumberish; totalSize: BigNumber }
227
+ }: { unitsToFill: BigNumberish; totalSize: BigNumber },
228
228
  ): Order => {
229
229
  const unitsToFillBn = BigNumber.from(unitsToFill);
230
230
 
@@ -246,12 +246,12 @@ export const mapOrderAmountsFromUnitsToFill = (
246
246
  startAmount: multiplyDivision(
247
247
  item.startAmount,
248
248
  unitsToFillBn,
249
- totalSize
249
+ totalSize,
250
250
  ).toString(),
251
251
  endAmount: multiplyDivision(
252
252
  item.endAmount,
253
253
  unitsToFillBn,
254
- totalSize
254
+ totalSize,
255
255
  ).toString(),
256
256
  })),
257
257
  consideration: order.parameters.consideration.map((item) => ({
@@ -259,12 +259,12 @@ export const mapOrderAmountsFromUnitsToFill = (
259
259
  startAmount: multiplyDivision(
260
260
  item.startAmount,
261
261
  unitsToFillBn,
262
- totalSize
262
+ totalSize,
263
263
  ).toString(),
264
264
  endAmount: multiplyDivision(
265
265
  item.endAmount,
266
266
  unitsToFillBn,
267
- totalSize
267
+ totalSize,
268
268
  ).toString(),
269
269
  })),
270
270
  },
@@ -279,7 +279,7 @@ export const generateRandomSalt = (domain?: string) => {
279
279
  keccak256(toUtf8Bytes(domain)).slice(0, 10),
280
280
  Uint8Array.from(Array(20).fill(0)),
281
281
  randomBytes(8),
282
- ])
282
+ ]),
283
283
  ).toString("hex")}`;
284
284
  }
285
285
  return `0x${Buffer.from(randomBytes(8)).toString("hex").padStart(64, "0")}`;
@@ -11,9 +11,9 @@ import {
11
11
  } from "../types";
12
12
 
13
13
  export const executeAllActions = async <
14
- T extends CreateOrderAction | CreateBulkOrdersAction | ExchangeAction
14
+ T extends CreateOrderAction | CreateBulkOrdersAction | ExchangeAction,
15
15
  >(
16
- actions: OrderUseCase<T>["actions"]
16
+ actions: OrderUseCase<T>["actions"],
17
17
  ) => {
18
18
  for (let i = 0; i < actions.length - 1; i++) {
19
19
  const action = actions[i];
@@ -36,9 +36,9 @@ export const executeAllActions = async <
36
36
  };
37
37
 
38
38
  const instanceOfOverrides = <
39
- T extends Overrides | PayableOverrides | CallOverrides
39
+ T extends Overrides | PayableOverrides | CallOverrides,
40
40
  >(
41
- obj: Object | undefined
41
+ obj: Object | undefined,
42
42
  ): obj is T => {
43
43
  const validKeys = [
44
44
  "gasLimit",
@@ -63,12 +63,12 @@ const instanceOfOverrides = <
63
63
 
64
64
  export const getTransactionMethods = <
65
65
  T extends Contract,
66
- U extends keyof T["functions"]
66
+ U extends keyof T["functions"],
67
67
  >(
68
68
  contract: T,
69
69
  method: U,
70
70
  args: Parameters<T["functions"][U]>,
71
- domain?: string
71
+ domain?: string,
72
72
  ): TransactionMethods<ContractMethodReturnType<T, U>> => {
73
73
  const lastArg = args[args.length - 1];
74
74
 
@@ -98,14 +98,14 @@ export const getTransactionMethods = <
98
98
  const mergedOverrides = { ...initialOverrides, ...overrides };
99
99
 
100
100
  return contract.callStatic[method as string](
101
- ...[...args, mergedOverrides]
101
+ ...[...args, mergedOverrides],
102
102
  );
103
103
  },
104
104
  estimateGas: (overrides?: Overrides) => {
105
105
  const mergedOverrides = { ...initialOverrides, ...overrides };
106
106
 
107
107
  return contract.estimateGas[method as string](
108
- ...[...args, mergedOverrides]
108
+ ...[...args, mergedOverrides],
109
109
  );
110
110
  },
111
111
  transact: async (overrides?: Overrides) => {