@opensea/seaport-js 1.0.7 → 1.0.9

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 (357) hide show
  1. package/lib/abi/DomainRegistry.d.ts +40 -0
  2. package/lib/abi/DomainRegistry.js +145 -0
  3. package/lib/abi/DomainRegistry.js.map +1 -0
  4. package/lib/abi/Seaport_v1_2.d.ts +129 -0
  5. package/lib/{typechain/factories/ConsiderationInterface__factory.js → abi/Seaport_v1_2.js} +774 -20
  6. package/lib/abi/Seaport_v1_2.js.map +1 -0
  7. package/lib/abi/Seaport_v1_4.d.ts +129 -0
  8. package/lib/{typechain/factories/Seaport__factory.js → abi/Seaport_v1_4.js} +259 -111
  9. package/lib/abi/Seaport_v1_4.js.map +1 -0
  10. package/lib/constants.d.ts +22 -1
  11. package/lib/constants.js +35 -1
  12. package/lib/constants.js.map +1 -1
  13. package/lib/seaport.d.ts +59 -25
  14. package/lib/seaport.js +365 -125
  15. package/lib/seaport.js.map +1 -1
  16. package/lib/typechain/DomainRegistry.d.ts +97 -0
  17. package/lib/typechain/{Conduit.js → DomainRegistry.js} +1 -1
  18. package/lib/typechain/DomainRegistry.js.map +1 -0
  19. package/lib/typechain/ERC1155.d.ts +8 -8
  20. package/lib/typechain/ERC20.d.ts +4 -12
  21. package/lib/typechain/ERC721.d.ts +18 -16
  22. package/lib/typechain/Seaport.d.ts +125 -104
  23. package/lib/typechain/common.d.ts +4 -4
  24. package/lib/types.d.ts +58 -45
  25. package/lib/utils/approval.d.ts +1 -1
  26. package/lib/utils/approval.js +11 -7
  27. package/lib/utils/approval.js.map +1 -1
  28. package/lib/utils/balance.d.ts +1 -1
  29. package/lib/utils/balance.js +1 -1
  30. package/lib/utils/balanceAndApprovalCheck.d.ts +3 -3
  31. package/lib/utils/balanceAndApprovalCheck.js +1 -1
  32. package/lib/utils/eip712/Eip712MerkleTree.d.ts +34 -0
  33. package/lib/utils/eip712/Eip712MerkleTree.js +125 -0
  34. package/lib/utils/eip712/Eip712MerkleTree.js.map +1 -0
  35. package/lib/utils/eip712/bulk-orders.d.ts +6 -0
  36. package/lib/utils/eip712/bulk-orders.js +84 -0
  37. package/lib/utils/eip712/bulk-orders.js.map +1 -0
  38. package/lib/utils/eip712/defaults.d.ts +14 -0
  39. package/lib/utils/eip712/defaults.js +114 -0
  40. package/lib/utils/eip712/defaults.js.map +1 -0
  41. package/lib/utils/eip712/utils.d.ts +11 -0
  42. package/lib/utils/eip712/utils.js +78 -0
  43. package/lib/utils/eip712/utils.js.map +1 -0
  44. package/lib/utils/fulfill.d.ts +6 -5
  45. package/lib/utils/fulfill.js +7 -7
  46. package/lib/utils/fulfill.js.map +1 -1
  47. package/lib/utils/item.d.ts +1 -1
  48. package/lib/utils/order.d.ts +1 -1
  49. package/lib/utils/order.js +2 -0
  50. package/lib/utils/order.js.map +1 -1
  51. package/lib/utils/usecase.d.ts +2 -2
  52. package/lib/utils/usecase.js +17 -18
  53. package/lib/utils/usecase.js.map +1 -1
  54. package/package.json +26 -5
  55. package/lib/__tests__/ascending-descending-amounts.spec.d.ts +0 -1
  56. package/lib/__tests__/ascending-descending-amounts.spec.js +0 -1016
  57. package/lib/__tests__/ascending-descending-amounts.spec.js.map +0 -1
  58. package/lib/__tests__/basic-fulfill.spec.d.ts +0 -1
  59. package/lib/__tests__/basic-fulfill.spec.js +0 -914
  60. package/lib/__tests__/basic-fulfill.spec.js.map +0 -1
  61. package/lib/__tests__/bundle.spec.d.ts +0 -1
  62. package/lib/__tests__/bundle.spec.js +0 -1226
  63. package/lib/__tests__/bundle.spec.js.map +0 -1
  64. package/lib/__tests__/cancel.spec.d.ts +0 -1
  65. package/lib/__tests__/cancel.spec.js +0 -194
  66. package/lib/__tests__/cancel.spec.js.map +0 -1
  67. package/lib/__tests__/create-order.spec.d.ts +0 -1
  68. package/lib/__tests__/create-order.spec.js +0 -1043
  69. package/lib/__tests__/create-order.spec.js.map +0 -1
  70. package/lib/__tests__/criteria-based.spec.d.ts +0 -1
  71. package/lib/__tests__/criteria-based.spec.js +0 -1593
  72. package/lib/__tests__/criteria-based.spec.js.map +0 -1
  73. package/lib/__tests__/fulfill-orders.spec.d.ts +0 -1
  74. package/lib/__tests__/fulfill-orders.spec.js +0 -1010
  75. package/lib/__tests__/fulfill-orders.spec.js.map +0 -1
  76. package/lib/__tests__/gifting.spec.d.ts +0 -1
  77. package/lib/__tests__/gifting.spec.js +0 -374
  78. package/lib/__tests__/gifting.spec.js.map +0 -1
  79. package/lib/__tests__/match-orders.spec.d.ts +0 -1
  80. package/lib/__tests__/match-orders.spec.js +0 -425
  81. package/lib/__tests__/match-orders.spec.js.map +0 -1
  82. package/lib/__tests__/partial-fulfill.spec.d.ts +0 -1
  83. package/lib/__tests__/partial-fulfill.spec.js +0 -849
  84. package/lib/__tests__/partial-fulfill.spec.js.map +0 -1
  85. package/lib/__tests__/sign-order.spec.d.ts +0 -1
  86. package/lib/__tests__/sign-order.spec.js +0 -147
  87. package/lib/__tests__/sign-order.spec.js.map +0 -1
  88. package/lib/__tests__/swap.spec.d.ts +0 -1
  89. package/lib/__tests__/swap.spec.js +0 -594
  90. package/lib/__tests__/swap.spec.js.map +0 -1
  91. package/lib/__tests__/utils/balance.d.ts +0 -22
  92. package/lib/__tests__/utils/balance.js +0 -271
  93. package/lib/__tests__/utils/balance.js.map +0 -1
  94. package/lib/__tests__/utils/examples/privateListings.d.ts +0 -3
  95. package/lib/__tests__/utils/examples/privateListings.js +0 -139
  96. package/lib/__tests__/utils/examples/privateListings.js.map +0 -1
  97. package/lib/__tests__/utils/setup.d.ts +0 -11
  98. package/lib/__tests__/utils/setup.js +0 -119
  99. package/lib/__tests__/utils/setup.js.map +0 -1
  100. package/lib/typechain/AmountDerivationErrors.d.ts +0 -29
  101. package/lib/typechain/AmountDerivationErrors.js +0 -3
  102. package/lib/typechain/AmountDerivationErrors.js.map +0 -1
  103. package/lib/typechain/AmountDeriver.d.ts +0 -29
  104. package/lib/typechain/AmountDeriver.js +0 -3
  105. package/lib/typechain/AmountDeriver.js.map +0 -1
  106. package/lib/typechain/Assertions.d.ts +0 -124
  107. package/lib/typechain/Assertions.js +0 -3
  108. package/lib/typechain/Assertions.js.map +0 -1
  109. package/lib/typechain/BasicOrderFulfiller.d.ts +0 -124
  110. package/lib/typechain/BasicOrderFulfiller.js +0 -3
  111. package/lib/typechain/BasicOrderFulfiller.js.map +0 -1
  112. package/lib/typechain/Conduit.d.ts +0 -156
  113. package/lib/typechain/Conduit.js.map +0 -1
  114. package/lib/typechain/ConduitController.d.ts +0 -266
  115. package/lib/typechain/ConduitController.js +0 -3
  116. package/lib/typechain/ConduitController.js.map +0 -1
  117. package/lib/typechain/ConduitControllerInterface.d.ts +0 -266
  118. package/lib/typechain/ConduitControllerInterface.js +0 -3
  119. package/lib/typechain/ConduitControllerInterface.js.map +0 -1
  120. package/lib/typechain/ConduitInterface.d.ts +0 -156
  121. package/lib/typechain/ConduitInterface.js +0 -3
  122. package/lib/typechain/ConduitInterface.js.map +0 -1
  123. package/lib/typechain/Consideration.d.ts +0 -686
  124. package/lib/typechain/Consideration.js +0 -3
  125. package/lib/typechain/Consideration.js.map +0 -1
  126. package/lib/typechain/ConsiderationBase.d.ts +0 -124
  127. package/lib/typechain/ConsiderationBase.js +0 -3
  128. package/lib/typechain/ConsiderationBase.js.map +0 -1
  129. package/lib/typechain/ConsiderationEventsAndErrors.d.ts +0 -124
  130. package/lib/typechain/ConsiderationEventsAndErrors.js +0 -3
  131. package/lib/typechain/ConsiderationEventsAndErrors.js.map +0 -1
  132. package/lib/typechain/ConsiderationInterface.d.ts +0 -612
  133. package/lib/typechain/ConsiderationInterface.js +0 -3
  134. package/lib/typechain/ConsiderationInterface.js.map +0 -1
  135. package/lib/typechain/CounterManager.d.ts +0 -124
  136. package/lib/typechain/CounterManager.js +0 -3
  137. package/lib/typechain/CounterManager.js.map +0 -1
  138. package/lib/typechain/CriteriaResolution.d.ts +0 -29
  139. package/lib/typechain/CriteriaResolution.js +0 -3
  140. package/lib/typechain/CriteriaResolution.js.map +0 -1
  141. package/lib/typechain/CriteriaResolutionErrors.d.ts +0 -29
  142. package/lib/typechain/CriteriaResolutionErrors.js +0 -3
  143. package/lib/typechain/CriteriaResolutionErrors.js.map +0 -1
  144. package/lib/typechain/EIP1271Interface.d.ts +0 -43
  145. package/lib/typechain/EIP1271Interface.js +0 -3
  146. package/lib/typechain/EIP1271Interface.js.map +0 -1
  147. package/lib/typechain/ERC1155Interface.d.ts +0 -67
  148. package/lib/typechain/ERC1155Interface.js +0 -3
  149. package/lib/typechain/ERC1155Interface.js.map +0 -1
  150. package/lib/typechain/ERC1155TokenReceiver.d.ts +0 -67
  151. package/lib/typechain/ERC1155TokenReceiver.js +0 -3
  152. package/lib/typechain/ERC1155TokenReceiver.js.map +0 -1
  153. package/lib/typechain/ERC20Interface.d.ts +0 -51
  154. package/lib/typechain/ERC20Interface.js +0 -3
  155. package/lib/typechain/ERC20Interface.js.map +0 -1
  156. package/lib/typechain/ERC721Interface.d.ts +0 -51
  157. package/lib/typechain/ERC721Interface.js +0 -3
  158. package/lib/typechain/ERC721Interface.js.map +0 -1
  159. package/lib/typechain/ERC721TokenReceiver.d.ts +0 -51
  160. package/lib/typechain/ERC721TokenReceiver.js +0 -3
  161. package/lib/typechain/ERC721TokenReceiver.js.map +0 -1
  162. package/lib/typechain/Executor.d.ts +0 -124
  163. package/lib/typechain/Executor.js +0 -3
  164. package/lib/typechain/Executor.js.map +0 -1
  165. package/lib/typechain/FulfillmentApplicationErrors.d.ts +0 -29
  166. package/lib/typechain/FulfillmentApplicationErrors.js +0 -3
  167. package/lib/typechain/FulfillmentApplicationErrors.js.map +0 -1
  168. package/lib/typechain/FulfillmentApplier.d.ts +0 -29
  169. package/lib/typechain/FulfillmentApplier.js +0 -3
  170. package/lib/typechain/FulfillmentApplier.js.map +0 -1
  171. package/lib/typechain/GettersAndDerivers.d.ts +0 -124
  172. package/lib/typechain/GettersAndDerivers.js +0 -3
  173. package/lib/typechain/GettersAndDerivers.js.map +0 -1
  174. package/lib/typechain/OrderCombiner.d.ts +0 -124
  175. package/lib/typechain/OrderCombiner.js +0 -3
  176. package/lib/typechain/OrderCombiner.js.map +0 -1
  177. package/lib/typechain/OrderFulfiller.d.ts +0 -124
  178. package/lib/typechain/OrderFulfiller.js +0 -3
  179. package/lib/typechain/OrderFulfiller.js.map +0 -1
  180. package/lib/typechain/OrderValidator.d.ts +0 -124
  181. package/lib/typechain/OrderValidator.js +0 -3
  182. package/lib/typechain/OrderValidator.js.map +0 -1
  183. package/lib/typechain/ReentrancyErrors.d.ts +0 -29
  184. package/lib/typechain/ReentrancyErrors.js +0 -3
  185. package/lib/typechain/ReentrancyErrors.js.map +0 -1
  186. package/lib/typechain/ReentrancyGuard.d.ts +0 -29
  187. package/lib/typechain/ReentrancyGuard.js +0 -3
  188. package/lib/typechain/ReentrancyGuard.js.map +0 -1
  189. package/lib/typechain/SignatureVerification.d.ts +0 -29
  190. package/lib/typechain/SignatureVerification.js +0 -3
  191. package/lib/typechain/SignatureVerification.js.map +0 -1
  192. package/lib/typechain/SignatureVerificationErrors.d.ts +0 -29
  193. package/lib/typechain/SignatureVerificationErrors.js +0 -3
  194. package/lib/typechain/SignatureVerificationErrors.js.map +0 -1
  195. package/lib/typechain/TestERC1155.d.ts +0 -205
  196. package/lib/typechain/TestERC1155.js +0 -3
  197. package/lib/typechain/TestERC1155.js.map +0 -1
  198. package/lib/typechain/TestERC20.d.ts +0 -249
  199. package/lib/typechain/TestERC20.js +0 -3
  200. package/lib/typechain/TestERC20.js.map +0 -1
  201. package/lib/typechain/TestERC721.d.ts +0 -236
  202. package/lib/typechain/TestERC721.js +0 -3
  203. package/lib/typechain/TestERC721.js.map +0 -1
  204. package/lib/typechain/TokenTransferrer.d.ts +0 -29
  205. package/lib/typechain/TokenTransferrer.js +0 -3
  206. package/lib/typechain/TokenTransferrer.js.map +0 -1
  207. package/lib/typechain/TokenTransferrerErrors.d.ts +0 -29
  208. package/lib/typechain/TokenTransferrerErrors.js +0 -3
  209. package/lib/typechain/TokenTransferrerErrors.js.map +0 -1
  210. package/lib/typechain/Verifiers.d.ts +0 -124
  211. package/lib/typechain/Verifiers.js +0 -3
  212. package/lib/typechain/Verifiers.js.map +0 -1
  213. package/lib/typechain/ZoneInteraction.d.ts +0 -29
  214. package/lib/typechain/ZoneInteraction.js +0 -3
  215. package/lib/typechain/ZoneInteraction.js.map +0 -1
  216. package/lib/typechain/ZoneInteractionErrors.d.ts +0 -29
  217. package/lib/typechain/ZoneInteractionErrors.js +0 -3
  218. package/lib/typechain/ZoneInteractionErrors.js.map +0 -1
  219. package/lib/typechain/ZoneInterface.d.ts +0 -182
  220. package/lib/typechain/ZoneInterface.js +0 -3
  221. package/lib/typechain/ZoneInterface.js.map +0 -1
  222. package/lib/typechain/factories/AmountDerivationErrors__factory.d.ts +0 -12
  223. package/lib/typechain/factories/AmountDerivationErrors__factory.js +0 -28
  224. package/lib/typechain/factories/AmountDerivationErrors__factory.js.map +0 -1
  225. package/lib/typechain/factories/AmountDeriver__factory.d.ts +0 -26
  226. package/lib/typechain/factories/AmountDeriver__factory.js +0 -97
  227. package/lib/typechain/factories/AmountDeriver__factory.js.map +0 -1
  228. package/lib/typechain/factories/Assertions__factory.d.ts +0 -64
  229. package/lib/typechain/factories/Assertions__factory.js +0 -526
  230. package/lib/typechain/factories/Assertions__factory.js.map +0 -1
  231. package/lib/typechain/factories/BasicOrderFulfiller__factory.d.ts +0 -64
  232. package/lib/typechain/factories/BasicOrderFulfiller__factory.js +0 -563
  233. package/lib/typechain/factories/BasicOrderFulfiller__factory.js.map +0 -1
  234. package/lib/typechain/factories/ConduitControllerInterface__factory.d.ts +0 -46
  235. package/lib/typechain/factories/ConduitControllerInterface__factory.js +0 -453
  236. package/lib/typechain/factories/ConduitControllerInterface__factory.js.map +0 -1
  237. package/lib/typechain/factories/ConduitController__factory.d.ts +0 -67
  238. package/lib/typechain/factories/ConduitController__factory.js +0 -527
  239. package/lib/typechain/factories/ConduitController__factory.js.map +0 -1
  240. package/lib/typechain/factories/ConduitInterface__factory.d.ts +0 -62
  241. package/lib/typechain/factories/ConduitInterface__factory.js +0 -282
  242. package/lib/typechain/factories/ConduitInterface__factory.js.map +0 -1
  243. package/lib/typechain/factories/Conduit__factory.d.ts +0 -83
  244. package/lib/typechain/factories/Conduit__factory.js +0 -465
  245. package/lib/typechain/factories/Conduit__factory.js.map +0 -1
  246. package/lib/typechain/factories/ConsiderationBase__factory.d.ts +0 -64
  247. package/lib/typechain/factories/ConsiderationBase__factory.js +0 -412
  248. package/lib/typechain/factories/ConsiderationBase__factory.js.map +0 -1
  249. package/lib/typechain/factories/ConsiderationEventsAndErrors__factory.d.ts +0 -38
  250. package/lib/typechain/factories/ConsiderationEventsAndErrors__factory.js +0 -332
  251. package/lib/typechain/factories/ConsiderationEventsAndErrors__factory.js.map +0 -1
  252. package/lib/typechain/factories/ConsiderationInterface__factory.d.ts +0 -72
  253. package/lib/typechain/factories/ConsiderationInterface__factory.js.map +0 -1
  254. package/lib/typechain/factories/Consideration__factory.d.ts +0 -132
  255. package/lib/typechain/factories/Consideration__factory.js +0 -2670
  256. package/lib/typechain/factories/Consideration__factory.js.map +0 -1
  257. package/lib/typechain/factories/CounterManager__factory.d.ts +0 -52
  258. package/lib/typechain/factories/CounterManager__factory.js +0 -406
  259. package/lib/typechain/factories/CounterManager__factory.js.map +0 -1
  260. package/lib/typechain/factories/CriteriaResolutionErrors__factory.d.ts +0 -12
  261. package/lib/typechain/factories/CriteriaResolutionErrors__factory.js +0 -58
  262. package/lib/typechain/factories/CriteriaResolutionErrors__factory.js.map +0 -1
  263. package/lib/typechain/factories/CriteriaResolution__factory.d.ts +0 -26
  264. package/lib/typechain/factories/CriteriaResolution__factory.js +0 -127
  265. package/lib/typechain/factories/CriteriaResolution__factory.js.map +0 -1
  266. package/lib/typechain/factories/EIP1271Interface__factory.d.ts +0 -22
  267. package/lib/typechain/factories/EIP1271Interface__factory.js +0 -47
  268. package/lib/typechain/factories/EIP1271Interface__factory.js.map +0 -1
  269. package/lib/typechain/factories/ERC1155Interface__factory.d.ts +0 -18
  270. package/lib/typechain/factories/ERC1155Interface__factory.js +0 -89
  271. package/lib/typechain/factories/ERC1155Interface__factory.js.map +0 -1
  272. package/lib/typechain/factories/ERC1155TokenReceiver__factory.d.ts +0 -22
  273. package/lib/typechain/factories/ERC1155TokenReceiver__factory.js +0 -101
  274. package/lib/typechain/factories/ERC1155TokenReceiver__factory.js.map +0 -1
  275. package/lib/typechain/factories/ERC1155__factory.d.ts +0 -35
  276. package/lib/typechain/factories/ERC1155__factory.js +0 -335
  277. package/lib/typechain/factories/ERC1155__factory.js.map +0 -1
  278. package/lib/typechain/factories/ERC20Interface__factory.d.ts +0 -22
  279. package/lib/typechain/factories/ERC20Interface__factory.js +0 -52
  280. package/lib/typechain/factories/ERC20Interface__factory.js.map +0 -1
  281. package/lib/typechain/factories/ERC20__factory.d.ts +0 -35
  282. package/lib/typechain/factories/ERC20__factory.js +0 -333
  283. package/lib/typechain/factories/ERC20__factory.js.map +0 -1
  284. package/lib/typechain/factories/ERC721Interface__factory.d.ts +0 -18
  285. package/lib/typechain/factories/ERC721Interface__factory.js +0 -46
  286. package/lib/typechain/factories/ERC721Interface__factory.js.map +0 -1
  287. package/lib/typechain/factories/ERC721TokenReceiver__factory.d.ts +0 -22
  288. package/lib/typechain/factories/ERC721TokenReceiver__factory.js +0 -57
  289. package/lib/typechain/factories/ERC721TokenReceiver__factory.js.map +0 -1
  290. package/lib/typechain/factories/ERC721__factory.d.ts +0 -35
  291. package/lib/typechain/factories/ERC721__factory.js +0 -353
  292. package/lib/typechain/factories/ERC721__factory.js.map +0 -1
  293. package/lib/typechain/factories/Executor__factory.d.ts +0 -64
  294. package/lib/typechain/factories/Executor__factory.js +0 -552
  295. package/lib/typechain/factories/Executor__factory.js.map +0 -1
  296. package/lib/typechain/factories/FulfillmentApplicationErrors__factory.d.ts +0 -16
  297. package/lib/typechain/factories/FulfillmentApplicationErrors__factory.js +0 -49
  298. package/lib/typechain/factories/FulfillmentApplicationErrors__factory.js.map +0 -1
  299. package/lib/typechain/factories/FulfillmentApplier__factory.d.ts +0 -30
  300. package/lib/typechain/factories/FulfillmentApplier__factory.js +0 -118
  301. package/lib/typechain/factories/FulfillmentApplier__factory.js.map +0 -1
  302. package/lib/typechain/factories/GettersAndDerivers__factory.d.ts +0 -64
  303. package/lib/typechain/factories/GettersAndDerivers__factory.js +0 -412
  304. package/lib/typechain/factories/GettersAndDerivers__factory.js.map +0 -1
  305. package/lib/typechain/factories/OrderCombiner__factory.d.ts +0 -64
  306. package/lib/typechain/factories/OrderCombiner__factory.js +0 -629
  307. package/lib/typechain/factories/OrderCombiner__factory.js.map +0 -1
  308. package/lib/typechain/factories/OrderFulfiller__factory.d.ts +0 -64
  309. package/lib/typechain/factories/OrderFulfiller__factory.js +0 -603
  310. package/lib/typechain/factories/OrderFulfiller__factory.js.map +0 -1
  311. package/lib/typechain/factories/OrderValidator__factory.d.ts +0 -64
  312. package/lib/typechain/factories/OrderValidator__factory.js +0 -563
  313. package/lib/typechain/factories/OrderValidator__factory.js.map +0 -1
  314. package/lib/typechain/factories/ReentrancyErrors__factory.d.ts +0 -12
  315. package/lib/typechain/factories/ReentrancyErrors__factory.js +0 -28
  316. package/lib/typechain/factories/ReentrancyErrors__factory.js.map +0 -1
  317. package/lib/typechain/factories/ReentrancyGuard__factory.d.ts +0 -32
  318. package/lib/typechain/factories/ReentrancyGuard__factory.js +0 -102
  319. package/lib/typechain/factories/ReentrancyGuard__factory.js.map +0 -1
  320. package/lib/typechain/factories/Seaport__factory.d.ts +0 -132
  321. package/lib/typechain/factories/Seaport__factory.js.map +0 -1
  322. package/lib/typechain/factories/SignatureVerificationErrors__factory.d.ts +0 -16
  323. package/lib/typechain/factories/SignatureVerificationErrors__factory.js +0 -49
  324. package/lib/typechain/factories/SignatureVerificationErrors__factory.js.map +0 -1
  325. package/lib/typechain/factories/SignatureVerification__factory.d.ts +0 -30
  326. package/lib/typechain/factories/SignatureVerification__factory.js +0 -118
  327. package/lib/typechain/factories/SignatureVerification__factory.js.map +0 -1
  328. package/lib/typechain/factories/TestERC1155__factory.d.ts +0 -49
  329. package/lib/typechain/factories/TestERC1155__factory.js +0 -433
  330. package/lib/typechain/factories/TestERC1155__factory.js.map +0 -1
  331. package/lib/typechain/factories/TestERC20__factory.d.ts +0 -56
  332. package/lib/typechain/factories/TestERC20__factory.js +0 -457
  333. package/lib/typechain/factories/TestERC20__factory.js.map +0 -1
  334. package/lib/typechain/factories/TestERC721__factory.d.ts +0 -49
  335. package/lib/typechain/factories/TestERC721__factory.js +0 -446
  336. package/lib/typechain/factories/TestERC721__factory.js.map +0 -1
  337. package/lib/typechain/factories/TokenTransferrerErrors__factory.d.ts +0 -16
  338. package/lib/typechain/factories/TokenTransferrerErrors__factory.js +0 -132
  339. package/lib/typechain/factories/TokenTransferrerErrors__factory.js.map +0 -1
  340. package/lib/typechain/factories/TokenTransferrer__factory.d.ts +0 -30
  341. package/lib/typechain/factories/TokenTransferrer__factory.js +0 -201
  342. package/lib/typechain/factories/TokenTransferrer__factory.js.map +0 -1
  343. package/lib/typechain/factories/Verifiers__factory.d.ts +0 -64
  344. package/lib/typechain/factories/Verifiers__factory.js +0 -552
  345. package/lib/typechain/factories/Verifiers__factory.js.map +0 -1
  346. package/lib/typechain/factories/ZoneInteractionErrors__factory.d.ts +0 -16
  347. package/lib/typechain/factories/ZoneInteractionErrors__factory.js +0 -34
  348. package/lib/typechain/factories/ZoneInteractionErrors__factory.js.map +0 -1
  349. package/lib/typechain/factories/ZoneInteraction__factory.d.ts +0 -30
  350. package/lib/typechain/factories/ZoneInteraction__factory.js +0 -103
  351. package/lib/typechain/factories/ZoneInteraction__factory.js.map +0 -1
  352. package/lib/typechain/factories/ZoneInterface__factory.d.ts +0 -52
  353. package/lib/typechain/factories/ZoneInterface__factory.js +0 -266
  354. package/lib/typechain/factories/ZoneInterface__factory.js.map +0 -1
  355. package/lib/typechain/index.d.ts +0 -90
  356. package/lib/typechain/index.js +0 -94
  357. package/lib/typechain/index.js.map +0 -1
@@ -1,1593 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
36
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
- return new (P || (P = Promise))(function (resolve, reject) {
39
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
- step((generator = generator.apply(thisArg, _arguments || [])).next());
43
- });
44
- };
45
- var __generator = (this && this.__generator) || function (thisArg, body) {
46
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
47
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
48
- function verb(n) { return function (v) { return step([n, v]); }; }
49
- function step(op) {
50
- if (f) throw new TypeError("Generator is already executing.");
51
- while (_) try {
52
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
53
- if (y = 0, t) op = [op[0] & 2, t.value];
54
- switch (op[0]) {
55
- case 0: case 1: t = op; break;
56
- case 4: _.label++; return { value: op[1], done: false };
57
- case 5: _.label++; y = op[1]; op = [0]; continue;
58
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
59
- default:
60
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
61
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
62
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
63
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
64
- if (t[2]) _.ops.pop();
65
- _.trys.pop(); continue;
66
- }
67
- op = body.call(thisArg, _);
68
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
69
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
70
- }
71
- };
72
- var __read = (this && this.__read) || function (o, n) {
73
- var m = typeof Symbol === "function" && o[Symbol.iterator];
74
- if (!m) return o;
75
- var i = m.call(o), r, ar = [], e;
76
- try {
77
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
78
- }
79
- catch (error) { e = { error: error }; }
80
- finally {
81
- try {
82
- if (r && !r.done && (m = i["return"])) m.call(i);
83
- }
84
- finally { if (e) throw e.error; }
85
- }
86
- return ar;
87
- };
88
- var __importDefault = (this && this.__importDefault) || function (mod) {
89
- return (mod && mod.__esModule) ? mod : { "default": mod };
90
- };
91
- Object.defineProperty(exports, "__esModule", { value: true });
92
- var multicall_1 = require("@0xsequence/multicall");
93
- var chai_1 = require("chai");
94
- var ethers_1 = require("ethers");
95
- var utils_1 = require("ethers/lib/utils");
96
- var hardhat_1 = require("hardhat");
97
- var sinon_1 = __importDefault(require("sinon"));
98
- var constants_1 = require("../constants");
99
- var fulfill = __importStar(require("../utils/fulfill"));
100
- var merkletree_1 = require("../utils/merkletree");
101
- var balance_1 = require("./utils/balance");
102
- var setup_1 = require("./utils/setup");
103
- (0, setup_1.describeWithFixture)("As a user I want to buy now or accept an offer for orders with criteria based items", function (fixture) {
104
- var offerer;
105
- var zone;
106
- var fulfiller;
107
- var multicallProvider;
108
- var fulfillStandardOrderSpy;
109
- var standardCreateOrderInput;
110
- var nftId = "1";
111
- var nftId2 = "2";
112
- var nftId3 = "3";
113
- var erc1155Amount = "3";
114
- beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
115
- var _a;
116
- return __generator(this, function (_b) {
117
- switch (_b.label) {
118
- case 0: return [4 /*yield*/, hardhat_1.ethers.getSigners()];
119
- case 1:
120
- _a = __read.apply(void 0, [_b.sent(), 3]), offerer = _a[0], zone = _a[1], fulfiller = _a[2];
121
- multicallProvider = new multicall_1.providers.MulticallProvider(hardhat_1.ethers.provider);
122
- fulfillStandardOrderSpy = sinon_1.default.spy(fulfill, "fulfillStandardOrder");
123
- return [2 /*return*/];
124
- }
125
- });
126
- }); });
127
- afterEach(function () {
128
- fulfillStandardOrderSpy.restore();
129
- });
130
- describe("A criteria based ERC721 is to be transferred", function () { return __awaiter(void 0, void 0, void 0, function () {
131
- return __generator(this, function (_a) {
132
- describe("Collection based trades", function () {
133
- describe("[Buy now] I want to buy a collection based listing", function () {
134
- beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
135
- var testErc721;
136
- return __generator(this, function (_a) {
137
- switch (_a.label) {
138
- case 0:
139
- testErc721 = fixture.testErc721;
140
- return [4 /*yield*/, testErc721.mint(offerer.address, nftId)];
141
- case 1:
142
- _a.sent();
143
- standardCreateOrderInput = {
144
- offer: [
145
- {
146
- itemType: constants_1.ItemType.ERC721,
147
- token: testErc721.address,
148
- identifiers: [],
149
- },
150
- ],
151
- consideration: [
152
- {
153
- amount: (0, utils_1.parseEther)("10").toString(),
154
- recipient: offerer.address,
155
- },
156
- ],
157
- // 2.5% fee
158
- fees: [{ recipient: zone.address, basisPoints: 250 }],
159
- };
160
- return [2 /*return*/];
161
- }
162
- });
163
- }); });
164
- it("ERC721 <=> ETH", function () { return __awaiter(void 0, void 0, void 0, function () {
165
- var seaport, testErc721, executeAllActions, order, ownerToTokenToIdentifierBalances, actions, action, transaction, receipt, ownerOfErc721;
166
- return __generator(this, function (_a) {
167
- switch (_a.label) {
168
- case 0:
169
- seaport = fixture.seaport, testErc721 = fixture.testErc721;
170
- return [4 /*yield*/, seaport.createOrder(standardCreateOrderInput)];
171
- case 1:
172
- executeAllActions = (_a.sent()).executeAllActions;
173
- return [4 /*yield*/, executeAllActions()];
174
- case 2:
175
- order = _a.sent();
176
- return [4 /*yield*/, (0, balance_1.getBalancesForFulfillOrder)(order, fulfiller.address, multicallProvider)];
177
- case 3:
178
- ownerToTokenToIdentifierBalances = _a.sent();
179
- return [4 /*yield*/, seaport.fulfillOrder({
180
- order: order,
181
- offerCriteria: [{ identifier: nftId, proof: [] }],
182
- accountAddress: fulfiller.address,
183
- })];
184
- case 4:
185
- actions = (_a.sent()).actions;
186
- (0, chai_1.expect)(actions.length).to.eq(1);
187
- action = actions[0];
188
- (0, chai_1.expect)(action).to.deep.equal({
189
- type: "exchange",
190
- transactionMethods: action.transactionMethods,
191
- });
192
- return [4 /*yield*/, action.transactionMethods.transact()];
193
- case 5:
194
- transaction = _a.sent();
195
- return [4 /*yield*/, transaction.wait()];
196
- case 6:
197
- receipt = _a.sent();
198
- return [4 /*yield*/, (0, balance_1.verifyBalancesAfterFulfill)({
199
- ownerToTokenToIdentifierBalances: ownerToTokenToIdentifierBalances,
200
- order: order,
201
- fulfillerAddress: fulfiller.address,
202
- multicallProvider: multicallProvider,
203
- fulfillReceipt: receipt,
204
- })];
205
- case 7:
206
- _a.sent();
207
- return [4 /*yield*/, testErc721.ownerOf(nftId)];
208
- case 8:
209
- ownerOfErc721 = _a.sent();
210
- (0, chai_1.expect)(ownerOfErc721).to.eq(fulfiller.address);
211
- (0, chai_1.expect)(fulfillStandardOrderSpy).calledOnce;
212
- return [2 /*return*/];
213
- }
214
- });
215
- }); });
216
- it("ERC721 <=> ERC20", function () { return __awaiter(void 0, void 0, void 0, function () {
217
- var seaport, testErc20, testErc721, executeAllActions, order, orderStatus, ownerToTokenToIdentifierBalances, actions, approvalAction, _a, fulfillAction, transaction, receipt, ownerOfErc721;
218
- return __generator(this, function (_b) {
219
- switch (_b.label) {
220
- case 0:
221
- seaport = fixture.seaport, testErc20 = fixture.testErc20, testErc721 = fixture.testErc721;
222
- // Use ERC20 instead of eth
223
- standardCreateOrderInput = __assign(__assign({}, standardCreateOrderInput), { consideration: standardCreateOrderInput.consideration.map(function (item) { return (__assign(__assign({}, item), { token: testErc20.address })); }) });
224
- return [4 /*yield*/, testErc20.mint(fulfiller.address, ethers_1.BigNumber.from(standardCreateOrderInput.consideration[0]
225
- .amount))];
226
- case 1:
227
- _b.sent();
228
- return [4 /*yield*/, seaport.createOrder(standardCreateOrderInput)];
229
- case 2:
230
- executeAllActions = (_b.sent()).executeAllActions;
231
- return [4 /*yield*/, executeAllActions()];
232
- case 3:
233
- order = _b.sent();
234
- return [4 /*yield*/, seaport.getOrderStatus(seaport.getOrderHash(order.parameters))];
235
- case 4:
236
- orderStatus = _b.sent();
237
- return [4 /*yield*/, (0, balance_1.getBalancesForFulfillOrder)(order, fulfiller.address, multicallProvider)];
238
- case 5:
239
- ownerToTokenToIdentifierBalances = _b.sent();
240
- return [4 /*yield*/, seaport.fulfillOrder({
241
- order: order,
242
- offerCriteria: [{ identifier: nftId, proof: [] }],
243
- accountAddress: fulfiller.address,
244
- })];
245
- case 6:
246
- actions = (_b.sent()).actions;
247
- (0, chai_1.expect)(actions.length).to.eq(2);
248
- approvalAction = actions[0];
249
- (0, chai_1.expect)(approvalAction).to.deep.equal({
250
- type: "approval",
251
- token: testErc20.address,
252
- identifierOrCriteria: "0",
253
- itemType: constants_1.ItemType.ERC20,
254
- transactionMethods: approvalAction.transactionMethods,
255
- operator: seaport.contract.address,
256
- });
257
- return [4 /*yield*/, approvalAction.transactionMethods.transact()];
258
- case 7:
259
- _b.sent();
260
- _a = chai_1.expect;
261
- return [4 /*yield*/, testErc20.allowance(fulfiller.address, seaport.contract.address)];
262
- case 8:
263
- _a.apply(void 0, [_b.sent()]).to.equal(constants_1.MAX_INT);
264
- fulfillAction = actions[1];
265
- (0, chai_1.expect)(fulfillAction).to.be.deep.equal({
266
- type: "exchange",
267
- transactionMethods: fulfillAction.transactionMethods,
268
- });
269
- return [4 /*yield*/, fulfillAction.transactionMethods.transact()];
270
- case 9:
271
- transaction = _b.sent();
272
- return [4 /*yield*/, transaction.wait()];
273
- case 10:
274
- receipt = _b.sent();
275
- return [4 /*yield*/, (0, balance_1.verifyBalancesAfterFulfill)({
276
- ownerToTokenToIdentifierBalances: ownerToTokenToIdentifierBalances,
277
- order: order,
278
- orderStatus: orderStatus,
279
- fulfillerAddress: fulfiller.address,
280
- multicallProvider: multicallProvider,
281
- fulfillReceipt: receipt,
282
- })];
283
- case 11:
284
- _b.sent();
285
- return [4 /*yield*/, testErc721.ownerOf(nftId)];
286
- case 12:
287
- ownerOfErc721 = _b.sent();
288
- (0, chai_1.expect)(ownerOfErc721).to.eq(fulfiller.address);
289
- (0, chai_1.expect)(fulfillStandardOrderSpy).calledOnce;
290
- return [2 /*return*/];
291
- }
292
- });
293
- }); });
294
- });
295
- describe("[Accept offer] I want to accept a collection based offer", function () {
296
- beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
297
- var testErc721, testErc20;
298
- return __generator(this, function (_a) {
299
- switch (_a.label) {
300
- case 0:
301
- testErc721 = fixture.testErc721, testErc20 = fixture.testErc20;
302
- return [4 /*yield*/, testErc721.mint(fulfiller.address, nftId)];
303
- case 1:
304
- _a.sent();
305
- return [4 /*yield*/, testErc20.mint(offerer.address, (0, utils_1.parseEther)("10").toString())];
306
- case 2:
307
- _a.sent();
308
- standardCreateOrderInput = {
309
- allowPartialFills: true,
310
- offer: [
311
- {
312
- amount: (0, utils_1.parseEther)("10").toString(),
313
- token: testErc20.address,
314
- },
315
- ],
316
- consideration: [
317
- {
318
- itemType: constants_1.ItemType.ERC721,
319
- token: testErc721.address,
320
- identifiers: [],
321
- recipient: offerer.address,
322
- },
323
- ],
324
- // 2.5% fee
325
- fees: [{ recipient: zone.address, basisPoints: 250 }],
326
- };
327
- return [2 /*return*/];
328
- }
329
- });
330
- }); });
331
- it("ERC20 <=> ERC721", function () { return __awaiter(void 0, void 0, void 0, function () {
332
- var seaport, testErc721, testErc20, executeAllActions, order, ownerToTokenToIdentifierBalances, actions, approvalAction, _a, secondApprovalAction, _b, fulfillAction, transaction, receipt, ownerOfErc721;
333
- return __generator(this, function (_c) {
334
- switch (_c.label) {
335
- case 0:
336
- seaport = fixture.seaport, testErc721 = fixture.testErc721, testErc20 = fixture.testErc20;
337
- return [4 /*yield*/, seaport.createOrder(standardCreateOrderInput, offerer.address)];
338
- case 1:
339
- executeAllActions = (_c.sent()).executeAllActions;
340
- return [4 /*yield*/, executeAllActions()];
341
- case 2:
342
- order = _c.sent();
343
- return [4 /*yield*/, (0, balance_1.getBalancesForFulfillOrder)(order, fulfiller.address, multicallProvider)];
344
- case 3:
345
- ownerToTokenToIdentifierBalances = _c.sent();
346
- return [4 /*yield*/, seaport.fulfillOrder({
347
- order: order,
348
- considerationCriteria: [{ identifier: nftId, proof: [] }],
349
- accountAddress: fulfiller.address,
350
- })];
351
- case 4:
352
- actions = (_c.sent()).actions;
353
- approvalAction = actions[0];
354
- (0, chai_1.expect)(approvalAction).to.deep.equal({
355
- type: "approval",
356
- token: testErc721.address,
357
- identifierOrCriteria: nftId,
358
- itemType: constants_1.ItemType.ERC721_WITH_CRITERIA,
359
- transactionMethods: approvalAction.transactionMethods,
360
- operator: seaport.contract.address,
361
- });
362
- return [4 /*yield*/, approvalAction.transactionMethods.transact()];
363
- case 5:
364
- _c.sent();
365
- _a = chai_1.expect;
366
- return [4 /*yield*/, testErc721.isApprovedForAll(fulfiller.address, seaport.contract.address)];
367
- case 6:
368
- _a.apply(void 0, [_c.sent()]).to.be.true;
369
- secondApprovalAction = actions[1];
370
- (0, chai_1.expect)(secondApprovalAction).to.deep.equal({
371
- type: "approval",
372
- token: testErc20.address,
373
- identifierOrCriteria: "0",
374
- itemType: constants_1.ItemType.ERC20,
375
- transactionMethods: secondApprovalAction.transactionMethods,
376
- operator: seaport.contract.address,
377
- });
378
- return [4 /*yield*/, secondApprovalAction.transactionMethods.transact()];
379
- case 7:
380
- _c.sent();
381
- _b = chai_1.expect;
382
- return [4 /*yield*/, testErc20.allowance(fulfiller.address, seaport.contract.address)];
383
- case 8:
384
- _b.apply(void 0, [_c.sent()]).to.eq(constants_1.MAX_INT);
385
- fulfillAction = actions[2];
386
- (0, chai_1.expect)(fulfillAction).to.be.deep.equal({
387
- type: "exchange",
388
- transactionMethods: fulfillAction.transactionMethods,
389
- });
390
- return [4 /*yield*/, fulfillAction.transactionMethods.transact()];
391
- case 9:
392
- transaction = _c.sent();
393
- return [4 /*yield*/, transaction.wait()];
394
- case 10:
395
- receipt = _c.sent();
396
- return [4 /*yield*/, (0, balance_1.verifyBalancesAfterFulfill)({
397
- ownerToTokenToIdentifierBalances: ownerToTokenToIdentifierBalances,
398
- order: order,
399
- fulfillerAddress: fulfiller.address,
400
- multicallProvider: multicallProvider,
401
- fulfillReceipt: receipt,
402
- })];
403
- case 11:
404
- _c.sent();
405
- return [4 /*yield*/, testErc721.ownerOf(nftId)];
406
- case 12:
407
- ownerOfErc721 = _c.sent();
408
- (0, chai_1.expect)(ownerOfErc721).to.eq(offerer.address);
409
- (0, chai_1.expect)(fulfillStandardOrderSpy).calledOnce;
410
- return [2 /*return*/];
411
- }
412
- });
413
- }); });
414
- });
415
- });
416
- describe("Trait-based trades", function () {
417
- describe("[Buy now] I want to buy a trait based listing", function () {
418
- beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
419
- var testErc721;
420
- return __generator(this, function (_a) {
421
- switch (_a.label) {
422
- case 0:
423
- testErc721 = fixture.testErc721;
424
- return [4 /*yield*/, testErc721.mint(offerer.address, nftId)];
425
- case 1:
426
- _a.sent();
427
- return [4 /*yield*/, testErc721.mint(offerer.address, nftId2)];
428
- case 2:
429
- _a.sent();
430
- return [4 /*yield*/, testErc721.mint(offerer.address, nftId3)];
431
- case 3:
432
- _a.sent();
433
- standardCreateOrderInput = {
434
- offer: [
435
- {
436
- itemType: constants_1.ItemType.ERC721,
437
- token: testErc721.address,
438
- // The offerer is willing to sell either token ID 1 or 3, but not 2
439
- identifiers: [nftId, nftId3],
440
- },
441
- ],
442
- consideration: [
443
- {
444
- amount: (0, utils_1.parseEther)("10").toString(),
445
- recipient: offerer.address,
446
- },
447
- ],
448
- // 2.5% fee
449
- fees: [{ recipient: zone.address, basisPoints: 250 }],
450
- };
451
- return [2 /*return*/];
452
- }
453
- });
454
- }); });
455
- it("ERC721 <=> ETH", function () { return __awaiter(void 0, void 0, void 0, function () {
456
- var seaport, testErc721, executeAllActions, order, ownerToTokenToIdentifierBalances, revertedActions, revertedFulfill, actions, action, transaction, receipt, ownerOfErc721;
457
- return __generator(this, function (_a) {
458
- switch (_a.label) {
459
- case 0:
460
- seaport = fixture.seaport, testErc721 = fixture.testErc721;
461
- return [4 /*yield*/, seaport.createOrder(standardCreateOrderInput)];
462
- case 1:
463
- executeAllActions = (_a.sent()).executeAllActions;
464
- return [4 /*yield*/, executeAllActions()];
465
- case 2:
466
- order = _a.sent();
467
- return [4 /*yield*/, (0, balance_1.getBalancesForFulfillOrder)(order, fulfiller.address, multicallProvider)];
468
- case 3:
469
- ownerToTokenToIdentifierBalances = _a.sent();
470
- return [4 /*yield*/, seaport.fulfillOrder({
471
- order: order,
472
- offerCriteria: [
473
- {
474
- identifier: nftId2,
475
- proof: new merkletree_1.MerkleTree([nftId2]).getProof(nftId2),
476
- },
477
- ],
478
- accountAddress: fulfiller.address,
479
- })];
480
- case 4:
481
- revertedActions = (_a.sent()).actions;
482
- (0, chai_1.expect)(revertedActions.length).to.eq(1);
483
- revertedFulfill = revertedActions[0];
484
- (0, chai_1.expect)(revertedFulfill).to.deep.equal({
485
- type: "exchange",
486
- transactionMethods: revertedFulfill.transactionMethods,
487
- });
488
- // Nft with ID 2 was not in the initial set of valid identifiers
489
- return [4 /*yield*/, (0, chai_1.expect)(revertedFulfill.transactionMethods.transact()).to.be.revertedWith("InvalidProof()")];
490
- case 5:
491
- // Nft with ID 2 was not in the initial set of valid identifiers
492
- _a.sent();
493
- return [4 /*yield*/, seaport.fulfillOrder({
494
- order: order,
495
- offerCriteria: [
496
- {
497
- identifier: nftId3,
498
- proof: new merkletree_1.MerkleTree([nftId, nftId3]).getProof(nftId3),
499
- },
500
- ],
501
- accountAddress: fulfiller.address,
502
- })];
503
- case 6:
504
- actions = (_a.sent()).actions;
505
- (0, chai_1.expect)(actions.length).to.eq(1);
506
- action = actions[0];
507
- (0, chai_1.expect)(action).to.deep.equal({
508
- type: "exchange",
509
- transactionMethods: action.transactionMethods,
510
- });
511
- return [4 /*yield*/, action.transactionMethods.transact()];
512
- case 7:
513
- transaction = _a.sent();
514
- return [4 /*yield*/, transaction.wait()];
515
- case 8:
516
- receipt = _a.sent();
517
- return [4 /*yield*/, (0, balance_1.verifyBalancesAfterFulfill)({
518
- ownerToTokenToIdentifierBalances: ownerToTokenToIdentifierBalances,
519
- order: order,
520
- fulfillerAddress: fulfiller.address,
521
- multicallProvider: multicallProvider,
522
- fulfillReceipt: receipt,
523
- })];
524
- case 9:
525
- _a.sent();
526
- return [4 /*yield*/, testErc721.ownerOf(nftId3)];
527
- case 10:
528
- ownerOfErc721 = _a.sent();
529
- (0, chai_1.expect)(ownerOfErc721).to.eq(fulfiller.address);
530
- (0, chai_1.expect)(fulfillStandardOrderSpy).calledTwice;
531
- return [2 /*return*/];
532
- }
533
- });
534
- }); });
535
- it("ERC721 <=> ERC20", function () { return __awaiter(void 0, void 0, void 0, function () {
536
- var seaport, testErc20, testErc721, executeAllActions, order, ownerToTokenToIdentifierBalances, revertedActions, approvalAction, _a, revertedFulfill, actions, action, transaction, receipt, ownerOfErc721;
537
- return __generator(this, function (_b) {
538
- switch (_b.label) {
539
- case 0:
540
- seaport = fixture.seaport, testErc20 = fixture.testErc20, testErc721 = fixture.testErc721;
541
- // Use ERC20 instead of eth
542
- standardCreateOrderInput = __assign(__assign({}, standardCreateOrderInput), { consideration: standardCreateOrderInput.consideration.map(function (item) { return (__assign(__assign({}, item), { token: testErc20.address })); }) });
543
- return [4 /*yield*/, testErc20.mint(fulfiller.address, ethers_1.BigNumber.from(standardCreateOrderInput.consideration[0]
544
- .amount))];
545
- case 1:
546
- _b.sent();
547
- return [4 /*yield*/, seaport.createOrder(standardCreateOrderInput)];
548
- case 2:
549
- executeAllActions = (_b.sent()).executeAllActions;
550
- return [4 /*yield*/, executeAllActions()];
551
- case 3:
552
- order = _b.sent();
553
- return [4 /*yield*/, (0, balance_1.getBalancesForFulfillOrder)(order, fulfiller.address, multicallProvider)];
554
- case 4:
555
- ownerToTokenToIdentifierBalances = _b.sent();
556
- return [4 /*yield*/, seaport.fulfillOrder({
557
- order: order,
558
- offerCriteria: [
559
- {
560
- identifier: nftId2,
561
- proof: new merkletree_1.MerkleTree([nftId, nftId3]).getProof(nftId2),
562
- },
563
- ],
564
- accountAddress: fulfiller.address,
565
- })];
566
- case 5:
567
- revertedActions = (_b.sent()).actions;
568
- (0, chai_1.expect)(revertedActions.length).to.eq(2);
569
- approvalAction = revertedActions[0];
570
- (0, chai_1.expect)(approvalAction).to.deep.equal({
571
- type: "approval",
572
- token: testErc20.address,
573
- identifierOrCriteria: "0",
574
- itemType: constants_1.ItemType.ERC20,
575
- transactionMethods: approvalAction.transactionMethods,
576
- operator: seaport.contract.address,
577
- });
578
- return [4 /*yield*/, approvalAction.transactionMethods.transact()];
579
- case 6:
580
- _b.sent();
581
- _a = chai_1.expect;
582
- return [4 /*yield*/, testErc20.allowance(fulfiller.address, seaport.contract.address)];
583
- case 7:
584
- _a.apply(void 0, [_b.sent()]).to.equal(constants_1.MAX_INT);
585
- revertedFulfill = revertedActions[1];
586
- (0, chai_1.expect)(revertedFulfill).to.be.deep.equal({
587
- type: "exchange",
588
- transactionMethods: revertedFulfill.transactionMethods,
589
- });
590
- return [4 /*yield*/, (0, chai_1.expect)(revertedFulfill.transactionMethods.transact()).to.be.revertedWith("InvalidProof()")];
591
- case 8:
592
- _b.sent();
593
- return [4 /*yield*/, seaport.fulfillOrder({
594
- order: order,
595
- offerCriteria: [
596
- {
597
- identifier: nftId3,
598
- proof: new merkletree_1.MerkleTree([nftId, nftId3]).getProof(nftId3),
599
- },
600
- ],
601
- accountAddress: fulfiller.address,
602
- })];
603
- case 9:
604
- actions = (_b.sent()).actions;
605
- (0, chai_1.expect)(actions.length).to.eq(1);
606
- action = actions[0];
607
- (0, chai_1.expect)(action).to.deep.equal({
608
- type: "exchange",
609
- transactionMethods: action.transactionMethods,
610
- });
611
- return [4 /*yield*/, action.transactionMethods.transact()];
612
- case 10:
613
- transaction = _b.sent();
614
- return [4 /*yield*/, transaction.wait()];
615
- case 11:
616
- receipt = _b.sent();
617
- return [4 /*yield*/, (0, balance_1.verifyBalancesAfterFulfill)({
618
- ownerToTokenToIdentifierBalances: ownerToTokenToIdentifierBalances,
619
- order: order,
620
- fulfillerAddress: fulfiller.address,
621
- multicallProvider: multicallProvider,
622
- fulfillReceipt: receipt,
623
- })];
624
- case 12:
625
- _b.sent();
626
- return [4 /*yield*/, testErc721.ownerOf(nftId3)];
627
- case 13:
628
- ownerOfErc721 = _b.sent();
629
- (0, chai_1.expect)(ownerOfErc721).to.eq(fulfiller.address);
630
- (0, chai_1.expect)(fulfillStandardOrderSpy).calledTwice;
631
- return [2 /*return*/];
632
- }
633
- });
634
- }); });
635
- });
636
- describe("[Accept offer] I want to accept a trait based offer", function () {
637
- beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
638
- var testErc721, testErc20;
639
- return __generator(this, function (_a) {
640
- switch (_a.label) {
641
- case 0:
642
- testErc721 = fixture.testErc721, testErc20 = fixture.testErc20;
643
- return [4 /*yield*/, testErc721.mint(fulfiller.address, nftId)];
644
- case 1:
645
- _a.sent();
646
- return [4 /*yield*/, testErc721.mint(fulfiller.address, nftId2)];
647
- case 2:
648
- _a.sent();
649
- return [4 /*yield*/, testErc721.mint(fulfiller.address, nftId3)];
650
- case 3:
651
- _a.sent();
652
- return [4 /*yield*/, testErc20.mint(offerer.address, (0, utils_1.parseEther)("10").toString())];
653
- case 4:
654
- _a.sent();
655
- standardCreateOrderInput = {
656
- allowPartialFills: true,
657
- offer: [
658
- {
659
- amount: (0, utils_1.parseEther)("10").toString(),
660
- token: testErc20.address,
661
- },
662
- ],
663
- consideration: [
664
- {
665
- itemType: constants_1.ItemType.ERC721,
666
- token: testErc721.address,
667
- identifiers: [nftId, nftId3],
668
- recipient: offerer.address,
669
- },
670
- ],
671
- // 2.5% fee
672
- fees: [{ recipient: zone.address, basisPoints: 250 }],
673
- };
674
- return [2 /*return*/];
675
- }
676
- });
677
- }); });
678
- it("ERC20 <=> ERC721", function () { return __awaiter(void 0, void 0, void 0, function () {
679
- var seaport, testErc721, testErc20, executeAllActions, order, ownerToTokenToIdentifierBalances, revertedActions, approvalAction, _a, secondApprovalAction, _b, revertedFulfillAction, actions, fulfillAction, transaction, receipt, ownerOfErc721;
680
- return __generator(this, function (_c) {
681
- switch (_c.label) {
682
- case 0:
683
- seaport = fixture.seaport, testErc721 = fixture.testErc721, testErc20 = fixture.testErc20;
684
- return [4 /*yield*/, seaport.createOrder(standardCreateOrderInput, offerer.address)];
685
- case 1:
686
- executeAllActions = (_c.sent()).executeAllActions;
687
- return [4 /*yield*/, executeAllActions()];
688
- case 2:
689
- order = _c.sent();
690
- return [4 /*yield*/, (0, balance_1.getBalancesForFulfillOrder)(order, fulfiller.address, multicallProvider)];
691
- case 3:
692
- ownerToTokenToIdentifierBalances = _c.sent();
693
- return [4 /*yield*/, seaport.fulfillOrder({
694
- order: order,
695
- considerationCriteria: [
696
- {
697
- identifier: nftId2,
698
- proof: new merkletree_1.MerkleTree([nftId, nftId3]).getProof(nftId2),
699
- },
700
- ],
701
- accountAddress: fulfiller.address,
702
- })];
703
- case 4:
704
- revertedActions = (_c.sent()).actions;
705
- approvalAction = revertedActions[0];
706
- (0, chai_1.expect)(approvalAction).to.deep.equal({
707
- type: "approval",
708
- token: testErc721.address,
709
- identifierOrCriteria: nftId2,
710
- itemType: constants_1.ItemType.ERC721_WITH_CRITERIA,
711
- transactionMethods: approvalAction.transactionMethods,
712
- operator: seaport.contract.address,
713
- });
714
- return [4 /*yield*/, approvalAction.transactionMethods.transact()];
715
- case 5:
716
- _c.sent();
717
- _a = chai_1.expect;
718
- return [4 /*yield*/, testErc721.isApprovedForAll(fulfiller.address, seaport.contract.address)];
719
- case 6:
720
- _a.apply(void 0, [_c.sent()]).to.be.true;
721
- secondApprovalAction = revertedActions[1];
722
- (0, chai_1.expect)(secondApprovalAction).to.deep.equal({
723
- type: "approval",
724
- token: testErc20.address,
725
- identifierOrCriteria: "0",
726
- itemType: constants_1.ItemType.ERC20,
727
- transactionMethods: secondApprovalAction.transactionMethods,
728
- operator: seaport.contract.address,
729
- });
730
- return [4 /*yield*/, secondApprovalAction.transactionMethods.transact()];
731
- case 7:
732
- _c.sent();
733
- _b = chai_1.expect;
734
- return [4 /*yield*/, testErc20.allowance(fulfiller.address, seaport.contract.address)];
735
- case 8:
736
- _b.apply(void 0, [_c.sent()]).to.eq(constants_1.MAX_INT);
737
- revertedFulfillAction = revertedActions[2];
738
- (0, chai_1.expect)(revertedFulfillAction).to.be.deep.equal({
739
- type: "exchange",
740
- transactionMethods: revertedFulfillAction.transactionMethods,
741
- });
742
- return [4 /*yield*/, (0, chai_1.expect)(revertedFulfillAction.transactionMethods.transact()).to.be.revertedWith("InvalidProof()")];
743
- case 9:
744
- _c.sent();
745
- return [4 /*yield*/, seaport.fulfillOrder({
746
- order: order,
747
- considerationCriteria: [
748
- {
749
- identifier: nftId3,
750
- proof: new merkletree_1.MerkleTree([nftId, nftId3]).getProof(nftId3),
751
- },
752
- ],
753
- accountAddress: fulfiller.address,
754
- })];
755
- case 10:
756
- actions = (_c.sent()).actions;
757
- fulfillAction = actions[0];
758
- return [4 /*yield*/, fulfillAction.transactionMethods.transact()];
759
- case 11:
760
- transaction = _c.sent();
761
- return [4 /*yield*/, transaction.wait()];
762
- case 12:
763
- receipt = _c.sent();
764
- return [4 /*yield*/, (0, balance_1.verifyBalancesAfterFulfill)({
765
- ownerToTokenToIdentifierBalances: ownerToTokenToIdentifierBalances,
766
- order: order,
767
- fulfillerAddress: fulfiller.address,
768
- multicallProvider: multicallProvider,
769
- fulfillReceipt: receipt,
770
- })];
771
- case 13:
772
- _c.sent();
773
- return [4 /*yield*/, testErc721.ownerOf(nftId3)];
774
- case 14:
775
- ownerOfErc721 = _c.sent();
776
- (0, chai_1.expect)(ownerOfErc721).to.eq(offerer.address);
777
- (0, chai_1.expect)(fulfillStandardOrderSpy).calledTwice;
778
- return [2 /*return*/];
779
- }
780
- });
781
- }); });
782
- });
783
- });
784
- return [2 /*return*/];
785
- });
786
- }); });
787
- describe("A criteria based ERC1155 is to be transferred", function () { return __awaiter(void 0, void 0, void 0, function () {
788
- return __generator(this, function (_a) {
789
- describe("Collection based trades", function () {
790
- describe("[Buy now] I want to buy a collection based listing", function () {
791
- beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
792
- var testErc1155;
793
- return __generator(this, function (_a) {
794
- switch (_a.label) {
795
- case 0:
796
- testErc1155 = fixture.testErc1155;
797
- return [4 /*yield*/, testErc1155.mint(offerer.address, nftId, erc1155Amount)];
798
- case 1:
799
- _a.sent();
800
- standardCreateOrderInput = {
801
- offer: [
802
- {
803
- itemType: constants_1.ItemType.ERC1155,
804
- token: testErc1155.address,
805
- amount: erc1155Amount,
806
- identifiers: [],
807
- },
808
- ],
809
- consideration: [
810
- {
811
- amount: (0, utils_1.parseEther)("10").toString(),
812
- recipient: offerer.address,
813
- },
814
- ],
815
- // 2.5% fee
816
- fees: [{ recipient: zone.address, basisPoints: 250 }],
817
- };
818
- return [2 /*return*/];
819
- }
820
- });
821
- }); });
822
- it("ERC1155 <=> ETH", function () { return __awaiter(void 0, void 0, void 0, function () {
823
- var seaport, testErc1155, executeAllActions, order, actions, action, balanceOfErc1155;
824
- return __generator(this, function (_a) {
825
- switch (_a.label) {
826
- case 0:
827
- seaport = fixture.seaport, testErc1155 = fixture.testErc1155;
828
- return [4 /*yield*/, seaport.createOrder(standardCreateOrderInput)];
829
- case 1:
830
- executeAllActions = (_a.sent()).executeAllActions;
831
- return [4 /*yield*/, executeAllActions()];
832
- case 2:
833
- order = _a.sent();
834
- return [4 /*yield*/, seaport.fulfillOrder({
835
- order: order,
836
- offerCriteria: [{ identifier: nftId, proof: [] }],
837
- accountAddress: fulfiller.address,
838
- })];
839
- case 3:
840
- actions = (_a.sent()).actions;
841
- (0, chai_1.expect)(actions.length).to.eq(1);
842
- action = actions[0];
843
- (0, chai_1.expect)(action).to.deep.equal({
844
- type: "exchange",
845
- transactionMethods: action.transactionMethods,
846
- });
847
- return [4 /*yield*/, action.transactionMethods.transact()];
848
- case 4:
849
- _a.sent();
850
- return [4 /*yield*/, testErc1155.balanceOf(fulfiller.address, nftId)];
851
- case 5:
852
- balanceOfErc1155 = _a.sent();
853
- (0, chai_1.expect)(balanceOfErc1155).to.eq(erc1155Amount);
854
- (0, chai_1.expect)(fulfillStandardOrderSpy).calledOnce;
855
- return [2 /*return*/];
856
- }
857
- });
858
- }); });
859
- it("ERC1155 <=> ERC20", function () { return __awaiter(void 0, void 0, void 0, function () {
860
- var seaport, testErc20, testErc1155, executeAllActions, order, actions, approvalAction, _a, fulfillAction, balanceOfErc1155;
861
- return __generator(this, function (_b) {
862
- switch (_b.label) {
863
- case 0:
864
- seaport = fixture.seaport, testErc20 = fixture.testErc20, testErc1155 = fixture.testErc1155;
865
- // Use ERC20 instead of eth
866
- standardCreateOrderInput = __assign(__assign({}, standardCreateOrderInput), { consideration: standardCreateOrderInput.consideration.map(function (item) { return (__assign(__assign({}, item), { token: testErc20.address })); }) });
867
- return [4 /*yield*/, testErc20.mint(fulfiller.address, ethers_1.BigNumber.from(standardCreateOrderInput.consideration[0]
868
- .amount))];
869
- case 1:
870
- _b.sent();
871
- return [4 /*yield*/, seaport.createOrder(standardCreateOrderInput)];
872
- case 2:
873
- executeAllActions = (_b.sent()).executeAllActions;
874
- return [4 /*yield*/, executeAllActions()];
875
- case 3:
876
- order = _b.sent();
877
- return [4 /*yield*/, seaport.fulfillOrder({
878
- order: order,
879
- offerCriteria: [{ identifier: nftId, proof: [] }],
880
- accountAddress: fulfiller.address,
881
- })];
882
- case 4:
883
- actions = (_b.sent()).actions;
884
- (0, chai_1.expect)(actions.length).to.eq(2);
885
- approvalAction = actions[0];
886
- (0, chai_1.expect)(approvalAction).to.deep.equal({
887
- type: "approval",
888
- token: testErc20.address,
889
- identifierOrCriteria: "0",
890
- itemType: constants_1.ItemType.ERC20,
891
- transactionMethods: approvalAction.transactionMethods,
892
- operator: seaport.contract.address,
893
- });
894
- return [4 /*yield*/, approvalAction.transactionMethods.transact()];
895
- case 5:
896
- _b.sent();
897
- _a = chai_1.expect;
898
- return [4 /*yield*/, testErc20.allowance(fulfiller.address, seaport.contract.address)];
899
- case 6:
900
- _a.apply(void 0, [_b.sent()]).to.equal(constants_1.MAX_INT);
901
- fulfillAction = actions[1];
902
- (0, chai_1.expect)(fulfillAction).to.be.deep.equal({
903
- type: "exchange",
904
- transactionMethods: fulfillAction.transactionMethods,
905
- });
906
- return [4 /*yield*/, fulfillAction.transactionMethods.transact()];
907
- case 7:
908
- _b.sent();
909
- return [4 /*yield*/, testErc1155.balanceOf(fulfiller.address, nftId)];
910
- case 8:
911
- balanceOfErc1155 = _b.sent();
912
- (0, chai_1.expect)(balanceOfErc1155).to.eq(erc1155Amount);
913
- (0, chai_1.expect)(fulfillStandardOrderSpy).calledOnce;
914
- return [2 /*return*/];
915
- }
916
- });
917
- }); });
918
- });
919
- describe("[Accept offer] I want to accept a collection based offer", function () {
920
- beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
921
- var testErc1155, testErc20;
922
- return __generator(this, function (_a) {
923
- switch (_a.label) {
924
- case 0:
925
- testErc1155 = fixture.testErc1155, testErc20 = fixture.testErc20;
926
- return [4 /*yield*/, testErc1155.mint(fulfiller.address, nftId, erc1155Amount)];
927
- case 1:
928
- _a.sent();
929
- return [4 /*yield*/, testErc20.mint(offerer.address, (0, utils_1.parseEther)("10").toString())];
930
- case 2:
931
- _a.sent();
932
- standardCreateOrderInput = {
933
- allowPartialFills: true,
934
- offer: [
935
- {
936
- amount: (0, utils_1.parseEther)("10").toString(),
937
- token: testErc20.address,
938
- },
939
- ],
940
- consideration: [
941
- {
942
- itemType: constants_1.ItemType.ERC1155,
943
- amount: erc1155Amount,
944
- token: testErc1155.address,
945
- identifiers: [],
946
- recipient: offerer.address,
947
- },
948
- ],
949
- // 2.5% fee
950
- fees: [{ recipient: zone.address, basisPoints: 250 }],
951
- };
952
- return [2 /*return*/];
953
- }
954
- });
955
- }); });
956
- it("ERC20 <=> ERC721", function () { return __awaiter(void 0, void 0, void 0, function () {
957
- var seaport, testErc1155, testErc20, executeAllActions, order, actions, approvalAction, _a, secondApprovalAction, _b, fulfillAction, balanceOfErc1155;
958
- return __generator(this, function (_c) {
959
- switch (_c.label) {
960
- case 0:
961
- seaport = fixture.seaport, testErc1155 = fixture.testErc1155, testErc20 = fixture.testErc20;
962
- return [4 /*yield*/, seaport.createOrder(standardCreateOrderInput, offerer.address)];
963
- case 1:
964
- executeAllActions = (_c.sent()).executeAllActions;
965
- return [4 /*yield*/, executeAllActions()];
966
- case 2:
967
- order = _c.sent();
968
- return [4 /*yield*/, seaport.fulfillOrder({
969
- order: order,
970
- considerationCriteria: [{ identifier: nftId, proof: [] }],
971
- accountAddress: fulfiller.address,
972
- })];
973
- case 3:
974
- actions = (_c.sent()).actions;
975
- approvalAction = actions[0];
976
- (0, chai_1.expect)(approvalAction).to.deep.equal({
977
- type: "approval",
978
- token: testErc1155.address,
979
- identifierOrCriteria: nftId,
980
- itemType: constants_1.ItemType.ERC1155_WITH_CRITERIA,
981
- transactionMethods: approvalAction.transactionMethods,
982
- operator: seaport.contract.address,
983
- });
984
- return [4 /*yield*/, approvalAction.transactionMethods.transact()];
985
- case 4:
986
- _c.sent();
987
- _a = chai_1.expect;
988
- return [4 /*yield*/, testErc1155.isApprovedForAll(fulfiller.address, seaport.contract.address)];
989
- case 5:
990
- _a.apply(void 0, [_c.sent()]).to.be.true;
991
- secondApprovalAction = actions[1];
992
- (0, chai_1.expect)(secondApprovalAction).to.deep.equal({
993
- type: "approval",
994
- token: testErc20.address,
995
- identifierOrCriteria: "0",
996
- itemType: constants_1.ItemType.ERC20,
997
- transactionMethods: secondApprovalAction.transactionMethods,
998
- operator: seaport.contract.address,
999
- });
1000
- return [4 /*yield*/, secondApprovalAction.transactionMethods.transact()];
1001
- case 6:
1002
- _c.sent();
1003
- _b = chai_1.expect;
1004
- return [4 /*yield*/, testErc20.allowance(fulfiller.address, seaport.contract.address)];
1005
- case 7:
1006
- _b.apply(void 0, [_c.sent()]).to.eq(constants_1.MAX_INT);
1007
- fulfillAction = actions[2];
1008
- (0, chai_1.expect)(fulfillAction).to.be.deep.equal({
1009
- type: "exchange",
1010
- transactionMethods: fulfillAction.transactionMethods,
1011
- });
1012
- return [4 /*yield*/, fulfillAction.transactionMethods.transact()];
1013
- case 8:
1014
- _c.sent();
1015
- return [4 /*yield*/, testErc1155.balanceOf(offerer.address, nftId)];
1016
- case 9:
1017
- balanceOfErc1155 = _c.sent();
1018
- (0, chai_1.expect)(balanceOfErc1155).to.eq(erc1155Amount);
1019
- (0, chai_1.expect)(fulfillStandardOrderSpy).calledOnce;
1020
- return [2 /*return*/];
1021
- }
1022
- });
1023
- }); });
1024
- });
1025
- });
1026
- describe("Trait-based trades", function () {
1027
- describe("[Buy now] I want to buy a trait based listing", function () {
1028
- beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
1029
- var testErc1155;
1030
- return __generator(this, function (_a) {
1031
- switch (_a.label) {
1032
- case 0:
1033
- testErc1155 = fixture.testErc1155;
1034
- return [4 /*yield*/, testErc1155.mint(offerer.address, nftId, erc1155Amount)];
1035
- case 1:
1036
- _a.sent();
1037
- return [4 /*yield*/, testErc1155.mint(offerer.address, nftId2, erc1155Amount)];
1038
- case 2:
1039
- _a.sent();
1040
- return [4 /*yield*/, testErc1155.mint(offerer.address, nftId3, erc1155Amount)];
1041
- case 3:
1042
- _a.sent();
1043
- standardCreateOrderInput = {
1044
- offer: [
1045
- {
1046
- itemType: constants_1.ItemType.ERC1155,
1047
- token: testErc1155.address,
1048
- // The offerer is willing to sell either token ID 1 or 3, but not 2
1049
- identifiers: [nftId, nftId3],
1050
- amount: erc1155Amount,
1051
- },
1052
- ],
1053
- consideration: [
1054
- {
1055
- amount: (0, utils_1.parseEther)("10").toString(),
1056
- recipient: offerer.address,
1057
- },
1058
- ],
1059
- // 2.5% fee
1060
- fees: [{ recipient: zone.address, basisPoints: 250 }],
1061
- };
1062
- return [2 /*return*/];
1063
- }
1064
- });
1065
- }); });
1066
- it("ERC1155 <=> ETH", function () { return __awaiter(void 0, void 0, void 0, function () {
1067
- var seaport, testErc1155, executeAllActions, order, revertedActions, revertedFulfill, actions, action, balanceOfErc1155;
1068
- return __generator(this, function (_a) {
1069
- switch (_a.label) {
1070
- case 0:
1071
- seaport = fixture.seaport, testErc1155 = fixture.testErc1155;
1072
- return [4 /*yield*/, seaport.createOrder(standardCreateOrderInput)];
1073
- case 1:
1074
- executeAllActions = (_a.sent()).executeAllActions;
1075
- return [4 /*yield*/, executeAllActions()];
1076
- case 2:
1077
- order = _a.sent();
1078
- return [4 /*yield*/, seaport.fulfillOrder({
1079
- order: order,
1080
- offerCriteria: [
1081
- {
1082
- identifier: nftId2,
1083
- proof: new merkletree_1.MerkleTree([nftId2]).getProof(nftId2),
1084
- },
1085
- ],
1086
- accountAddress: fulfiller.address,
1087
- })];
1088
- case 3:
1089
- revertedActions = (_a.sent()).actions;
1090
- (0, chai_1.expect)(revertedActions.length).to.eq(1);
1091
- revertedFulfill = revertedActions[0];
1092
- (0, chai_1.expect)(revertedFulfill).to.deep.equal({
1093
- type: "exchange",
1094
- transactionMethods: revertedFulfill.transactionMethods,
1095
- });
1096
- // Nft with ID 2 was not in the initial set of valid identifiers
1097
- return [4 /*yield*/, (0, chai_1.expect)(revertedFulfill.transactionMethods.transact()).to.be.revertedWith("InvalidProof()")];
1098
- case 4:
1099
- // Nft with ID 2 was not in the initial set of valid identifiers
1100
- _a.sent();
1101
- return [4 /*yield*/, seaport.fulfillOrder({
1102
- order: order,
1103
- offerCriteria: [
1104
- {
1105
- identifier: nftId3,
1106
- proof: new merkletree_1.MerkleTree([nftId, nftId3]).getProof(nftId3),
1107
- },
1108
- ],
1109
- accountAddress: fulfiller.address,
1110
- })];
1111
- case 5:
1112
- actions = (_a.sent()).actions;
1113
- (0, chai_1.expect)(actions.length).to.eq(1);
1114
- action = actions[0];
1115
- (0, chai_1.expect)(action).to.deep.equal({
1116
- type: "exchange",
1117
- transactionMethods: action.transactionMethods,
1118
- });
1119
- return [4 /*yield*/, action.transactionMethods.transact()];
1120
- case 6:
1121
- _a.sent();
1122
- return [4 /*yield*/, testErc1155.balanceOf(fulfiller.address, nftId3)];
1123
- case 7:
1124
- balanceOfErc1155 = _a.sent();
1125
- (0, chai_1.expect)(balanceOfErc1155).to.eq(erc1155Amount);
1126
- (0, chai_1.expect)(fulfillStandardOrderSpy).calledTwice;
1127
- return [2 /*return*/];
1128
- }
1129
- });
1130
- }); });
1131
- it("ERC1155 <=> ERC20", function () { return __awaiter(void 0, void 0, void 0, function () {
1132
- var seaport, testErc20, testErc1155, executeAllActions, order, revertedActions, approvalAction, _a, revertedFulfill, actions, action, balanceOfErc1155;
1133
- return __generator(this, function (_b) {
1134
- switch (_b.label) {
1135
- case 0:
1136
- seaport = fixture.seaport, testErc20 = fixture.testErc20, testErc1155 = fixture.testErc1155;
1137
- // Use ERC20 instead of eth
1138
- standardCreateOrderInput = __assign(__assign({}, standardCreateOrderInput), { consideration: standardCreateOrderInput.consideration.map(function (item) { return (__assign(__assign({}, item), { token: testErc20.address })); }) });
1139
- return [4 /*yield*/, testErc20.mint(fulfiller.address, ethers_1.BigNumber.from(standardCreateOrderInput.consideration[0]
1140
- .amount))];
1141
- case 1:
1142
- _b.sent();
1143
- return [4 /*yield*/, seaport.createOrder(standardCreateOrderInput)];
1144
- case 2:
1145
- executeAllActions = (_b.sent()).executeAllActions;
1146
- return [4 /*yield*/, executeAllActions()];
1147
- case 3:
1148
- order = _b.sent();
1149
- return [4 /*yield*/, seaport.fulfillOrder({
1150
- order: order,
1151
- offerCriteria: [
1152
- {
1153
- identifier: nftId2,
1154
- proof: new merkletree_1.MerkleTree([nftId, nftId3]).getProof(nftId2),
1155
- },
1156
- ],
1157
- accountAddress: fulfiller.address,
1158
- })];
1159
- case 4:
1160
- revertedActions = (_b.sent()).actions;
1161
- (0, chai_1.expect)(revertedActions.length).to.eq(2);
1162
- approvalAction = revertedActions[0];
1163
- (0, chai_1.expect)(approvalAction).to.deep.equal({
1164
- type: "approval",
1165
- token: testErc20.address,
1166
- identifierOrCriteria: "0",
1167
- itemType: constants_1.ItemType.ERC20,
1168
- transactionMethods: approvalAction.transactionMethods,
1169
- operator: seaport.contract.address,
1170
- });
1171
- return [4 /*yield*/, approvalAction.transactionMethods.transact()];
1172
- case 5:
1173
- _b.sent();
1174
- _a = chai_1.expect;
1175
- return [4 /*yield*/, testErc20.allowance(fulfiller.address, seaport.contract.address)];
1176
- case 6:
1177
- _a.apply(void 0, [_b.sent()]).to.equal(constants_1.MAX_INT);
1178
- revertedFulfill = revertedActions[1];
1179
- (0, chai_1.expect)(revertedFulfill).to.be.deep.equal({
1180
- type: "exchange",
1181
- transactionMethods: revertedFulfill.transactionMethods,
1182
- });
1183
- return [4 /*yield*/, (0, chai_1.expect)(revertedFulfill.transactionMethods.transact()).to.be.revertedWith("InvalidProof()")];
1184
- case 7:
1185
- _b.sent();
1186
- return [4 /*yield*/, seaport.fulfillOrder({
1187
- order: order,
1188
- offerCriteria: [
1189
- {
1190
- identifier: nftId3,
1191
- proof: new merkletree_1.MerkleTree([nftId, nftId3]).getProof(nftId3),
1192
- },
1193
- ],
1194
- accountAddress: fulfiller.address,
1195
- })];
1196
- case 8:
1197
- actions = (_b.sent()).actions;
1198
- (0, chai_1.expect)(actions.length).to.eq(1);
1199
- action = actions[0];
1200
- (0, chai_1.expect)(action).to.deep.equal({
1201
- type: "exchange",
1202
- transactionMethods: action.transactionMethods,
1203
- });
1204
- return [4 /*yield*/, action.transactionMethods.transact()];
1205
- case 9:
1206
- _b.sent();
1207
- return [4 /*yield*/, testErc1155.balanceOf(fulfiller.address, nftId3)];
1208
- case 10:
1209
- balanceOfErc1155 = _b.sent();
1210
- (0, chai_1.expect)(balanceOfErc1155).to.eq(erc1155Amount);
1211
- (0, chai_1.expect)(fulfillStandardOrderSpy).calledTwice;
1212
- return [2 /*return*/];
1213
- }
1214
- });
1215
- }); });
1216
- });
1217
- describe("[Accept offer] I want to accept a trait based offer", function () {
1218
- beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
1219
- var testErc1155, testErc20;
1220
- return __generator(this, function (_a) {
1221
- switch (_a.label) {
1222
- case 0:
1223
- testErc1155 = fixture.testErc1155, testErc20 = fixture.testErc20;
1224
- return [4 /*yield*/, testErc1155.mint(fulfiller.address, nftId, erc1155Amount)];
1225
- case 1:
1226
- _a.sent();
1227
- return [4 /*yield*/, testErc1155.mint(fulfiller.address, nftId2, erc1155Amount)];
1228
- case 2:
1229
- _a.sent();
1230
- return [4 /*yield*/, testErc1155.mint(fulfiller.address, nftId3, erc1155Amount)];
1231
- case 3:
1232
- _a.sent();
1233
- return [4 /*yield*/, testErc20.mint(offerer.address, (0, utils_1.parseEther)("10").toString())];
1234
- case 4:
1235
- _a.sent();
1236
- standardCreateOrderInput = {
1237
- allowPartialFills: true,
1238
- offer: [
1239
- {
1240
- amount: (0, utils_1.parseEther)("10").toString(),
1241
- token: testErc20.address,
1242
- },
1243
- ],
1244
- consideration: [
1245
- {
1246
- itemType: constants_1.ItemType.ERC1155,
1247
- token: testErc1155.address,
1248
- identifiers: [nftId, nftId3],
1249
- recipient: offerer.address,
1250
- amount: erc1155Amount,
1251
- },
1252
- ],
1253
- // 2.5% fee
1254
- fees: [{ recipient: zone.address, basisPoints: 250 }],
1255
- };
1256
- return [2 /*return*/];
1257
- }
1258
- });
1259
- }); });
1260
- it("ERC20 <=> ERC1155", function () { return __awaiter(void 0, void 0, void 0, function () {
1261
- var seaport, testErc1155, testErc20, executeAllActions, order, revertedActions, approvalAction, _a, secondApprovalAction, _b, revertedFulfillAction, actions, fulfillAction, balanceOfErc1155;
1262
- return __generator(this, function (_c) {
1263
- switch (_c.label) {
1264
- case 0:
1265
- seaport = fixture.seaport, testErc1155 = fixture.testErc1155, testErc20 = fixture.testErc20;
1266
- return [4 /*yield*/, seaport.createOrder(standardCreateOrderInput, offerer.address)];
1267
- case 1:
1268
- executeAllActions = (_c.sent()).executeAllActions;
1269
- return [4 /*yield*/, executeAllActions()];
1270
- case 2:
1271
- order = _c.sent();
1272
- return [4 /*yield*/, seaport.fulfillOrder({
1273
- order: order,
1274
- considerationCriteria: [
1275
- {
1276
- identifier: nftId2,
1277
- proof: new merkletree_1.MerkleTree([nftId, nftId3]).getProof(nftId2),
1278
- },
1279
- ],
1280
- accountAddress: fulfiller.address,
1281
- })];
1282
- case 3:
1283
- revertedActions = (_c.sent()).actions;
1284
- approvalAction = revertedActions[0];
1285
- (0, chai_1.expect)(approvalAction).to.deep.equal({
1286
- type: "approval",
1287
- token: testErc1155.address,
1288
- identifierOrCriteria: nftId2,
1289
- itemType: constants_1.ItemType.ERC1155_WITH_CRITERIA,
1290
- transactionMethods: approvalAction.transactionMethods,
1291
- operator: seaport.contract.address,
1292
- });
1293
- return [4 /*yield*/, approvalAction.transactionMethods.transact()];
1294
- case 4:
1295
- _c.sent();
1296
- _a = chai_1.expect;
1297
- return [4 /*yield*/, testErc1155.isApprovedForAll(fulfiller.address, seaport.contract.address)];
1298
- case 5:
1299
- _a.apply(void 0, [_c.sent()]).to.be.true;
1300
- secondApprovalAction = revertedActions[1];
1301
- (0, chai_1.expect)(secondApprovalAction).to.deep.equal({
1302
- type: "approval",
1303
- token: testErc20.address,
1304
- identifierOrCriteria: "0",
1305
- itemType: constants_1.ItemType.ERC20,
1306
- transactionMethods: secondApprovalAction.transactionMethods,
1307
- operator: seaport.contract.address,
1308
- });
1309
- return [4 /*yield*/, secondApprovalAction.transactionMethods.transact()];
1310
- case 6:
1311
- _c.sent();
1312
- _b = chai_1.expect;
1313
- return [4 /*yield*/, testErc20.allowance(fulfiller.address, seaport.contract.address)];
1314
- case 7:
1315
- _b.apply(void 0, [_c.sent()]).to.eq(constants_1.MAX_INT);
1316
- revertedFulfillAction = revertedActions[2];
1317
- (0, chai_1.expect)(revertedFulfillAction).to.be.deep.equal({
1318
- type: "exchange",
1319
- transactionMethods: revertedFulfillAction.transactionMethods,
1320
- });
1321
- return [4 /*yield*/, (0, chai_1.expect)(revertedFulfillAction.transactionMethods.transact()).to.be.revertedWith("InvalidProof()")];
1322
- case 8:
1323
- _c.sent();
1324
- return [4 /*yield*/, seaport.fulfillOrder({
1325
- order: order,
1326
- considerationCriteria: [
1327
- {
1328
- identifier: nftId3,
1329
- proof: new merkletree_1.MerkleTree([nftId, nftId3]).getProof(nftId3),
1330
- },
1331
- ],
1332
- accountAddress: fulfiller.address,
1333
- })];
1334
- case 9:
1335
- actions = (_c.sent()).actions;
1336
- fulfillAction = actions[0];
1337
- return [4 /*yield*/, fulfillAction.transactionMethods.transact()];
1338
- case 10:
1339
- _c.sent();
1340
- return [4 /*yield*/, testErc1155.balanceOf(offerer.address, nftId3)];
1341
- case 11:
1342
- balanceOfErc1155 = _c.sent();
1343
- (0, chai_1.expect)(balanceOfErc1155).to.eq(erc1155Amount);
1344
- (0, chai_1.expect)(fulfillStandardOrderSpy).calledTwice;
1345
- return [2 /*return*/];
1346
- }
1347
- });
1348
- }); });
1349
- });
1350
- });
1351
- return [2 /*return*/];
1352
- });
1353
- }); });
1354
- describe("A criteria based ERC721 to criteria based ERC1155 swap", function () { return __awaiter(void 0, void 0, void 0, function () {
1355
- return __generator(this, function (_a) {
1356
- describe("Collection based swaps", function () {
1357
- beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
1358
- var testErc721, testErc1155;
1359
- return __generator(this, function (_a) {
1360
- switch (_a.label) {
1361
- case 0:
1362
- testErc721 = fixture.testErc721, testErc1155 = fixture.testErc1155;
1363
- return [4 /*yield*/, testErc721.mint(offerer.address, nftId)];
1364
- case 1:
1365
- _a.sent();
1366
- return [4 /*yield*/, testErc1155.mint(fulfiller.address, nftId2, erc1155Amount)];
1367
- case 2:
1368
- _a.sent();
1369
- standardCreateOrderInput = {
1370
- offer: [
1371
- {
1372
- itemType: constants_1.ItemType.ERC721,
1373
- token: testErc721.address,
1374
- identifiers: [],
1375
- },
1376
- ],
1377
- consideration: [
1378
- {
1379
- itemType: constants_1.ItemType.ERC1155,
1380
- token: testErc1155.address,
1381
- amount: erc1155Amount,
1382
- identifiers: [],
1383
- },
1384
- ],
1385
- // 2.5% fee
1386
- fees: [{ recipient: zone.address, basisPoints: 250 }],
1387
- };
1388
- return [2 /*return*/];
1389
- }
1390
- });
1391
- }); });
1392
- it("ERC721 <=> ERC1155", function () { return __awaiter(void 0, void 0, void 0, function () {
1393
- var seaport, testErc721, testErc1155, executeAllActions, order, actions, approvalAction, fulfillAction, balanceOfErc1155, ownerOfErc721;
1394
- return __generator(this, function (_a) {
1395
- switch (_a.label) {
1396
- case 0:
1397
- seaport = fixture.seaport, testErc721 = fixture.testErc721, testErc1155 = fixture.testErc1155;
1398
- return [4 /*yield*/, seaport.createOrder(standardCreateOrderInput)];
1399
- case 1:
1400
- executeAllActions = (_a.sent()).executeAllActions;
1401
- return [4 /*yield*/, executeAllActions()];
1402
- case 2:
1403
- order = _a.sent();
1404
- return [4 /*yield*/, seaport.fulfillOrder({
1405
- order: order,
1406
- offerCriteria: [{ identifier: nftId, proof: [] }],
1407
- considerationCriteria: [{ identifier: nftId2, proof: [] }],
1408
- accountAddress: fulfiller.address,
1409
- })];
1410
- case 3:
1411
- actions = (_a.sent()).actions;
1412
- (0, chai_1.expect)(actions.length).to.eq(2);
1413
- approvalAction = actions[0];
1414
- (0, chai_1.expect)(approvalAction).to.deep.equal({
1415
- type: "approval",
1416
- token: testErc1155.address,
1417
- identifierOrCriteria: nftId2,
1418
- itemType: constants_1.ItemType.ERC1155_WITH_CRITERIA,
1419
- transactionMethods: approvalAction.transactionMethods,
1420
- operator: seaport.contract.address,
1421
- });
1422
- return [4 /*yield*/, approvalAction.transactionMethods.transact()];
1423
- case 4:
1424
- _a.sent();
1425
- fulfillAction = actions[1];
1426
- (0, chai_1.expect)(fulfillAction).to.deep.equal({
1427
- type: "exchange",
1428
- transactionMethods: fulfillAction.transactionMethods,
1429
- });
1430
- return [4 /*yield*/, fulfillAction.transactionMethods.transact()];
1431
- case 5:
1432
- _a.sent();
1433
- return [4 /*yield*/, testErc1155.balanceOf(offerer.address, nftId2)];
1434
- case 6:
1435
- balanceOfErc1155 = _a.sent();
1436
- (0, chai_1.expect)(balanceOfErc1155).to.eq(erc1155Amount);
1437
- return [4 /*yield*/, testErc721.ownerOf(nftId)];
1438
- case 7:
1439
- ownerOfErc721 = _a.sent();
1440
- (0, chai_1.expect)(ownerOfErc721).to.eq(fulfiller.address);
1441
- (0, chai_1.expect)(fulfillStandardOrderSpy).calledOnce;
1442
- return [2 /*return*/];
1443
- }
1444
- });
1445
- }); });
1446
- });
1447
- describe("Trait-based swaps", function () {
1448
- beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
1449
- var testErc721, testErc1155;
1450
- return __generator(this, function (_a) {
1451
- switch (_a.label) {
1452
- case 0:
1453
- testErc721 = fixture.testErc721, testErc1155 = fixture.testErc1155;
1454
- return [4 /*yield*/, testErc721.mint(fulfiller.address, nftId)];
1455
- case 1:
1456
- _a.sent();
1457
- return [4 /*yield*/, testErc721.mint(fulfiller.address, nftId2)];
1458
- case 2:
1459
- _a.sent();
1460
- return [4 /*yield*/, testErc721.mint(fulfiller.address, nftId3)];
1461
- case 3:
1462
- _a.sent();
1463
- return [4 /*yield*/, testErc1155.mint(offerer.address, nftId, erc1155Amount)];
1464
- case 4:
1465
- _a.sent();
1466
- return [4 /*yield*/, testErc1155.mint(offerer.address, nftId2, erc1155Amount)];
1467
- case 5:
1468
- _a.sent();
1469
- return [4 /*yield*/, testErc1155.mint(offerer.address, nftId3, erc1155Amount)];
1470
- case 6:
1471
- _a.sent();
1472
- standardCreateOrderInput = {
1473
- offer: [
1474
- {
1475
- itemType: constants_1.ItemType.ERC1155,
1476
- token: testErc1155.address,
1477
- identifiers: [nftId, nftId3],
1478
- amount: erc1155Amount,
1479
- },
1480
- ],
1481
- consideration: [
1482
- {
1483
- itemType: constants_1.ItemType.ERC721,
1484
- token: testErc721.address,
1485
- identifiers: [nftId2, nftId3],
1486
- },
1487
- ],
1488
- // 2.5% fee
1489
- fees: [{ recipient: zone.address, basisPoints: 250 }],
1490
- };
1491
- return [2 /*return*/];
1492
- }
1493
- });
1494
- }); });
1495
- it("ERC1155 <=> ERC721", function () { return __awaiter(void 0, void 0, void 0, function () {
1496
- var seaport, testErc721, testErc1155, executeAllActions, order, revertedActions, approvalAction, revertedFulfill, actions, action, balanceOfErc1155, ownerOfErc721;
1497
- return __generator(this, function (_a) {
1498
- switch (_a.label) {
1499
- case 0:
1500
- seaport = fixture.seaport, testErc721 = fixture.testErc721, testErc1155 = fixture.testErc1155;
1501
- return [4 /*yield*/, seaport.createOrder(standardCreateOrderInput)];
1502
- case 1:
1503
- executeAllActions = (_a.sent()).executeAllActions;
1504
- return [4 /*yield*/, executeAllActions()];
1505
- case 2:
1506
- order = _a.sent();
1507
- return [4 /*yield*/, seaport.fulfillOrder({
1508
- order: order,
1509
- offerCriteria: [
1510
- {
1511
- identifier: nftId2,
1512
- proof: new merkletree_1.MerkleTree([nftId2]).getProof(nftId2),
1513
- },
1514
- ],
1515
- considerationCriteria: [
1516
- {
1517
- identifier: nftId2,
1518
- proof: new merkletree_1.MerkleTree([nftId2, nftId3]).getProof(nftId2),
1519
- },
1520
- ],
1521
- accountAddress: fulfiller.address,
1522
- })];
1523
- case 3:
1524
- revertedActions = (_a.sent()).actions;
1525
- (0, chai_1.expect)(revertedActions.length).to.eq(2);
1526
- approvalAction = revertedActions[0];
1527
- (0, chai_1.expect)(approvalAction).to.deep.equal({
1528
- type: "approval",
1529
- token: testErc721.address,
1530
- identifierOrCriteria: nftId2,
1531
- itemType: constants_1.ItemType.ERC721_WITH_CRITERIA,
1532
- transactionMethods: approvalAction.transactionMethods,
1533
- operator: seaport.contract.address,
1534
- });
1535
- return [4 /*yield*/, approvalAction.transactionMethods.transact()];
1536
- case 4:
1537
- _a.sent();
1538
- revertedFulfill = revertedActions[1];
1539
- (0, chai_1.expect)(revertedFulfill).to.deep.equal({
1540
- type: "exchange",
1541
- transactionMethods: revertedFulfill.transactionMethods,
1542
- });
1543
- // Nft with ID 2 was not in the initial set of valid identifiers in the offer
1544
- return [4 /*yield*/, (0, chai_1.expect)(revertedFulfill.transactionMethods.transact()).to.be.revertedWith("InvalidProof()")];
1545
- case 5:
1546
- // Nft with ID 2 was not in the initial set of valid identifiers in the offer
1547
- _a.sent();
1548
- return [4 /*yield*/, seaport.fulfillOrder({
1549
- order: order,
1550
- offerCriteria: [
1551
- {
1552
- identifier: nftId,
1553
- proof: new merkletree_1.MerkleTree([nftId, nftId3]).getProof(nftId),
1554
- },
1555
- ],
1556
- considerationCriteria: [
1557
- {
1558
- identifier: nftId2,
1559
- proof: new merkletree_1.MerkleTree([nftId2, nftId3]).getProof(nftId2),
1560
- },
1561
- ],
1562
- accountAddress: fulfiller.address,
1563
- })];
1564
- case 6:
1565
- actions = (_a.sent()).actions;
1566
- (0, chai_1.expect)(actions.length).to.eq(1);
1567
- action = actions[0];
1568
- (0, chai_1.expect)(action).to.deep.equal({
1569
- type: "exchange",
1570
- transactionMethods: action.transactionMethods,
1571
- });
1572
- return [4 /*yield*/, action.transactionMethods.transact()];
1573
- case 7:
1574
- _a.sent();
1575
- return [4 /*yield*/, testErc1155.balanceOf(fulfiller.address, nftId)];
1576
- case 8:
1577
- balanceOfErc1155 = _a.sent();
1578
- (0, chai_1.expect)(balanceOfErc1155).to.eq(erc1155Amount);
1579
- return [4 /*yield*/, testErc721.ownerOf(nftId2)];
1580
- case 9:
1581
- ownerOfErc721 = _a.sent();
1582
- (0, chai_1.expect)(ownerOfErc721).to.eq(offerer.address);
1583
- (0, chai_1.expect)(fulfillStandardOrderSpy).calledTwice;
1584
- return [2 /*return*/];
1585
- }
1586
- });
1587
- }); });
1588
- });
1589
- return [2 /*return*/];
1590
- });
1591
- }); });
1592
- });
1593
- //# sourceMappingURL=criteria-based.spec.js.map