@0xsequence/marketplace-sdk 0.3.4 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/{chunk-PMDJARYX.js → chunk-F42XMKDS.js} +438 -382
  2. package/dist/chunk-F42XMKDS.js.map +1 -0
  3. package/dist/{chunk-Q57TEA3Z.js → chunk-NMCGA2TB.js} +4 -2
  4. package/dist/chunk-NMCGA2TB.js.map +1 -0
  5. package/dist/{chunk-L6GSYPCR.js → chunk-RZSZNVEH.js} +5 -5
  6. package/dist/{chunk-L6GSYPCR.js.map → chunk-RZSZNVEH.js.map} +1 -1
  7. package/dist/{chunk-6LQST3KZ.js → chunk-Z3VR2KMP.js} +30 -18
  8. package/dist/chunk-Z3VR2KMP.js.map +1 -0
  9. package/dist/index.js +72 -172
  10. package/dist/react/hooks/index.d.ts +3 -1
  11. package/dist/react/hooks/index.js +5 -5
  12. package/dist/react/index.js +8 -8
  13. package/dist/react/ui/components/index.js +8 -8
  14. package/dist/react/ui/index.d.ts +4 -21
  15. package/dist/react/ui/index.js +8 -8
  16. package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +1 -1
  17. package/dist/react/ui/modals/_internal/components/actionModal/index.js +1 -1
  18. package/dist/react/ui/styles/index.d.ts +1 -1
  19. package/dist/styles/index.d.ts +1 -1
  20. package/dist/styles/index.js +1 -1
  21. package/dist/utils/index.js +1 -1
  22. package/package.json +1 -1
  23. package/src/react/_internal/transaction-machine/execute-transaction.ts +10 -3
  24. package/src/react/_internal/transaction-machine/useTransactionMachine.ts +18 -5
  25. package/src/react/ui/components/_internals/action-button/ActionButton.tsx +1 -1
  26. package/src/react/ui/modals/BuyModal/index.tsx +42 -10
  27. package/src/react/ui/modals/CreateListingModal/index.tsx +9 -16
  28. package/src/react/ui/modals/MakeOfferModal/_store.ts +1 -1
  29. package/src/react/ui/modals/MakeOfferModal/index.tsx +9 -12
  30. package/src/react/ui/modals/SellModal/index.tsx +10 -10
  31. package/src/react/ui/modals/TransferModal/_store.ts +12 -10
  32. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +2 -2
  33. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/useHandleTransfer.tsx +16 -38
  34. package/src/react/ui/modals/TransferModal/index.tsx +7 -9
  35. package/src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx +4 -2
  36. package/src/react/ui/modals/_internal/components/quantityInput/index.tsx +25 -3
  37. package/src/react/ui/modals/_internal/components/switchChainModal/index.tsx +2 -0
  38. package/src/react/ui/modals/_internal/components/switchChainModal/store.ts +4 -4
  39. package/src/react/ui/modals/_internal/components/transaction-footer/index.tsx +7 -4
  40. package/src/react/ui/modals/_internal/components/transactionPreview/consts.ts +10 -5
  41. package/src/react/ui/modals/_internal/components/transactionPreview/index.tsx +27 -8
  42. package/src/react/ui/modals/_internal/components/transactionPreview/useTransactionPreviewTitle.tsx +3 -5
  43. package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +80 -62
  44. package/src/react/ui/modals/_internal/components/transactionStatusModal/store.ts +21 -29
  45. package/src/react/ui/modals/_internal/components/transactionStatusModal/util/getFormattedType.ts +23 -0
  46. package/src/react/ui/modals/_internal/components/transactionStatusModal/util/getMessage.ts +29 -0
  47. package/src/react/ui/modals/_internal/components/transactionStatusModal/util/getTitle.ts +43 -0
  48. package/tsconfig.tsbuildinfo +1 -1
  49. package/dist/chunk-6LQST3KZ.js.map +0 -1
  50. package/dist/chunk-PMDJARYX.js.map +0 -1
  51. package/dist/chunk-Q57TEA3Z.js.map +0 -1
  52. package/src/react/ui/modals/CreateListingModal/_utils/getCreateListingTransactionTitleMessage.ts +0 -30
  53. package/src/react/ui/modals/MakeOfferModal/_utils/getMakeOfferTransactionTitleMessage.ts +0 -28
  54. package/src/react/ui/modals/SellModal/_utils/getSellTransactionTitleMessage.ts +0 -28
  55. package/src/react/ui/modals/TransferModal/_utils/getTransferTransactionTitleMessage.ts +0 -28
  56. package/src/types/callbacks.ts +0 -51
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/react/ui/modals/_internal/components/quantityInput/styles.css.ts","../src/react/ui/modals/_internal/components/calendarPopover/styles.css.ts","../src/react/ui/modals/_internal/components/priceInput/styles.css.ts","../src/react/ui/modals/_internal/components/tokenPreview/styles.css.ts","../src/react/ui/modals/SuccessfulPurchaseModal/styles.css.ts","../src/react/ui/modals/TransferModal/styles.css.ts","../src/react/ui/components/collectible-card/styles.css.ts"],"sourcesContent":["import 'src/react/ui/modals/_internal/components/quantityInput/styles.css.ts.vanilla.css?source=LnN0eWxlc19xdWFudGl0eUlucHV0V3JhcHBlcl9fNTBnNG05MCB7CiAgZGlzcGxheTogZmxleDsKICBmbGV4LWRpcmVjdGlvbjogY29sdW1uOwogIHdpZHRoOiAxMDAlOwp9Ci5zdHlsZXNfcXVhbnRpdHlJbnB1dFdyYXBwZXJfXzUwZzRtOTAgPiBsYWJlbCB7CiAgZ2FwOiAycHg7Cn0KLnN0eWxlc19xdWFudGl0eUlucHV0V3JhcHBlcl9fNTBnNG05MCA+IGxhYmVsID4gZGl2ID4gZGl2IHsKICBoZWlnaHQ6IDM2cHg7CiAgZm9udC1zaXplOiAxMnB4OwogIGJvcmRlci1yYWRpdXM6IDRweDsKICBwYWRkaW5nLWxlZnQ6IDEycHg7CiAgcGFkZGluZy1yaWdodDogMDsKfQouc3R5bGVzX3F1YW50aXR5SW5wdXRXcmFwcGVyX181MGc0bTkwID4gbGFiZWwgPiBkaXYgPiBkaXY6aGFzKDpkaXNhYmxlZCkgLCAuc3R5bGVzX3F1YW50aXR5SW5wdXRXcmFwcGVyX181MGc0bTkwID4gbGFiZWwgPiBkaXYgPiBkaXY6aGFzKDpkaXNhYmxlZCk6aG92ZXIgewogIG9wYWNpdHk6IDE7Cn0KLnN0eWxlc19xdWFudGl0eUlucHV0V3JhcHBlcl9fNTBnNG05MCA+IGxhYmVsID4gZGl2ID4gZGl2ID4gaW5wdXQgewogIGZvbnQtc2l6ZTogMTJweDsKfQ==';\nexport var quantityInputWrapper = 'styles_quantityInputWrapper__50g4m90';","import 'src/react/ui/modals/_internal/components/calendarPopover/styles.css.ts.vanilla.css?source=LnN0eWxlc19kYXRlU2VsZWN0QnV0dG9uX18xamM2cDhqMCB7CiAgZmxleDogMyAhaW1wb3J0YW50OwogIHBhZGRpbmc6IDEwcHggOHB4ICFpbXBvcnRhbnQ7CiAgaGVpZ2h0OiAzNnB4ICFpbXBvcnRhbnQ7CiAgYm9yZGVyOiAxcHggc29saWQgIzRGNEY0RiAhaW1wb3J0YW50OwogIGJvcmRlci1yYWRpdXM6IDRweCAhaW1wb3J0YW50OwogIGZvbnQtd2VpZ2h0OiA0MDAgIWltcG9ydGFudDsKICBmb250LXNpemU6IDEycHggIWltcG9ydGFudDsKfQ==';\nexport var dateSelectButton = 'styles_dateSelectButton__1jc6p8j0';\nexport var dateSelectPopoverContent = 'fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr11rs fyvr130l fyvr11xx fyvr11r0';","import 'src/react/ui/modals/_internal/components/priceInput/styles.css.ts.vanilla.css?source=LnN0eWxlc19wcmljZUlucHV0V3JhcHBlcl9fNmpqejh0MCB7CiAgZGlzcGxheTogZmxleDsKICBmbGV4LWRpcmVjdGlvbjogY29sdW1uOwogIHdpZHRoOiAxMDAlOwp9Ci5zdHlsZXNfcHJpY2VJbnB1dEN1cnJlbmN5SW1hZ2VfXzZqano4dDEgewogIHRvcDogMjlweDsKfQouc3R5bGVzX3ByaWNlSW5wdXRXcmFwcGVyX182amp6OHQwID4gbGFiZWwgewogIGdhcDogMnB4Owp9Ci5zdHlsZXNfcHJpY2VJbnB1dFdyYXBwZXJfXzZqano4dDAgPiBsYWJlbCA+IGRpdiA+IGRpdiB7CiAgaGVpZ2h0OiAzNnB4OwogIGZvbnQtc2l6ZTogMTJweDsKICBib3JkZXItcmFkaXVzOiA0cHg7CiAgcGFkZGluZy1sZWZ0OiAyOHB4OwogIHBhZGRpbmctcmlnaHQ6IDA7Cn0KLnN0eWxlc19wcmljZUlucHV0V3JhcHBlcl9fNmpqejh0MCA+IGxhYmVsID4gZGl2ID4gZGl2ID4gaW5wdXQgewogIGZvbnQtc2l6ZTogMTJweDsKfQ==';\nexport var priceInputCurrencyImage = 'styles_priceInputCurrencyImage__6jjz8t1';\nexport var priceInputWrapper = 'styles_priceInputWrapper__6jjz8t0';","export var tokenPreview = 'fyvr1188 fyvr11ag fyvr11l8 fyvr11ow fyvr12g';","import 'src/react/ui/styles/modal.css.ts.vanilla.css?source=Lm1vZGFsX2RpYWxvZ0NvbnRlbnRCYXNlX18xeXBsNm50MSB7CiAgdG9wOiA1MCU7CiAgbGVmdDogNTAlOwogIHRyYW5zZm9ybTogdHJhbnNsYXRlKC01MCUsIC01MCUpOwogIHBhZGRpbmc6IDI0cHg7Cn0KLm1vZGFsX2RpYWxvZ0NvbnRlbnRfbmFycm93X18xeXBsNm50MiB7CiAgd2lkdGg6IDM2MHB4Owp9Ci5tb2RhbF9kaWFsb2dDb250ZW50X3dpZGVfXzF5cGw2bnQzIHsKICB3aWR0aDogNTQwcHg7Cn0KQG1lZGlhIHNjcmVlbiBhbmQgKG1heC13aWR0aDogMzYwcHgpIHsKICAubW9kYWxfZGlhbG9nQ29udGVudF9uYXJyb3dfXzF5cGw2bnQyIHsKICAgIHdpZHRoOiAxMDAlOwogICAgYm90dG9tOiAwOwogICAgdHJhbnNmb3JtOiB1bnNldDsKICAgIHRvcDogdW5zZXQ7CiAgICBsZWZ0OiB1bnNldDsKICAgIGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDAgIWltcG9ydGFudDsKICAgIGJvcmRlci1ib3R0b20tcmlnaHQtcmFkaXVzOiAwICFpbXBvcnRhbnQ7CiAgfQp9CkBtZWRpYSBzY3JlZW4gYW5kIChtYXgtd2lkdGg6IDU0MHB4KSB7CiAgLm1vZGFsX2RpYWxvZ0NvbnRlbnRfd2lkZV9fMXlwbDZudDMgewogIC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ZXNHcmlkSXRlbV9fMW5qa3dmZTEgewogIGdyaWQtY29sdW1uOiB1bnNldDsKfQouc3R5bGVzX2NvbGxlY3RpYmxlc0dyaWRJbWFnZV9fMW5qa3dmZTIgewogIHdpZHRoOiAxMDAlOwogIGhlaWdodDogMTAwJTsKICBvYmplY3QtZml0OiBjb250YWluOwp9Ci5zdHlsZXNfY29sbGVjdGlibGVzR3JpZEltYWdlUGFsZV9fMW5qa3dmZTMgewogIG9wYWNpdHk6IDAuNCAhaW1wb3J0YW50Owp9';\nexport var closeButton = 'fyvr11lw fyvr1tc fyvr1mo';\nexport var collectiblesGrid = 'styles_collectiblesGrid__1njkwfe0';\nexport var collectiblesGridImage = 'styles_collectiblesGridImage__1njkwfe2';\nexport var collectiblesGridImagePale = 'styles_collectiblesGridImagePale__1njkwfe3 styles_collectiblesGridImage__1njkwfe2';\nexport var collectiblesGridItem = 'styles_collectiblesGridItem__1njkwfe1';\nexport var dialogContent = {narrow:'modal_dialogContent_narrow__1ypl6nt2 modal_dialogContentBase__1ypl6nt1 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr11l8 fyvr11wl fyvr11m0 fyvr11rs',wide:'modal_dialogContent_wide__1ypl6nt3 modal_dialogContentBase__1ypl6nt1 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr11l8 fyvr11wl fyvr11m0 fyvr11rs'};\nexport var dialogOverlay = 'fyvr1m0 fyvr1o8 fyvr1qg fyvr1so fyvr11xl fyvr11m0 fyvr11rs';","import 'src/react/ui/styles/modal.css.ts.vanilla.css?source=Lm1vZGFsX2RpYWxvZ0NvbnRlbnRCYXNlX18xeXBsNm50MSB7CiAgdG9wOiA1MCU7CiAgbGVmdDogNTAlOwogIHRyYW5zZm9ybTogdHJhbnNsYXRlKC01MCUsIC01MCUpOwogIHBhZGRpbmc6IDI0cHg7Cn0KLm1vZGFsX2RpYWxvZ0NvbnRlbnRfbmFycm93X18xeXBsNm50MiB7CiAgd2lkdGg6IDM2MHB4Owp9Ci5tb2RhbF9kaWFsb2dDb250ZW50X3dpZGVfXzF5cGw2bnQzIHsKICB3aWR0aDogNTQwcHg7Cn0KQG1lZGlhIHNjcmVlbiBhbmQgKG1heC13aWR0aDogMzYwcHgpIHsKICAubW9kYWxfZGlhbG9nQ29udGVudF9uYXJyb3dfXzF5cGw2bnQyIHsKICAgIHdpZHRoOiAxMDAlOwogICAgYm90dG9tOiAwOwogICAgdHJhbnNmb3JtOiB1bnNldDsKICAgIHRvcDogdW5zZXQ7CiAgICBsZWZ0OiB1bnNldDsKICAgIGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDAgIWltcG9ydGFudDsKICAgIGJvcmRlci1ib3R0b20tcmlnaHQtcmFkaXVzOiAwICFpbXBvcnRhbnQ7CiAgfQp9CkBtZWRpYSBzY3JlZW4gYW5kIChtYXgtd2lkdGg6IDU0MHB4KSB7CiAgLm1vZGFsX2RpYWxvZ0NvbnRlbnRfd2lkZV9fMXlwbDZudDMgewogICAgd2lkdGg6IDEwMCU7CiAgICBib3R0b206IDA7CiAgICB0cmFuc2Zvcm06IHVuc2V0OwogICAgdG9wOiB1bnNldDsKICAgIGxlZnQ6IHVuc2V0OwogICAgYm9yZGVyLWJvdHRvbS1sZWZ0LXJhZGl1czogMCAhaW1wb3J0YW50OwogICAgYm9yZGVyLWJvdHRvbS1yaWdodC1yYWRpdXM6IDAgIWltcG9ydGFudDsKICB9Cn0=';\nimport 'src/react/ui/modals/TransferModal/styles.css.ts.vanilla.css?source=LnN0eWxlc190cmFuc2Zlck1vZGFsQ29udGVudF9faTFxejlnMCB7CiAgd2lkdGg6IDU0MHB4Owp9CkBtZWRpYSBzY3JlZW4gYW5kIChtYXgtd2lkdGg6IDU0MHB4KSB7CiAgLnN0eWxlc190cmFuc2Zlck1vZGFsQ29udGVudF9faTFxejlnMCB7CiAgICB3aWR0aDogMTAwJTsKICB9Cn0=';\nexport var closeButton = 'fyvr11lw fyvr1tc fyvr1mo';\nexport var dialogOverlay = 'fyvr1m0 fyvr1o8 fyvr1qg fyvr1so fyvr11xl fyvr11m0 fyvr11rs';\nexport var transferModalContent = 'styles_transferModalContent__i1qz9g0 modal_dialogContent_wide__1ypl6nt3 modal_dialogContentBase__1ypl6nt1 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr11l8 fyvr11wl fyvr11m0 fyvr11rs fyvr1vo fyvr1xs fyvr1zw fyvr1120';","import 'src/react/ui/components/collectible-card/styles.css.ts.vanilla.css?source=LnN0eWxlc19jb2xsZWN0aWJsZUNhcmRfX2JpZXA3YTAgewogIHdpZHRoOiAxNzVweDsKICBib3JkZXI6IDFweCBzb2xpZCBoc2xhKDAsIDAlLCAzMSUsIDEpOwp9Ci5zdHlsZXNfY29sbGVjdGlibGVJbWFnZV9fYmllcDdhMSB7CiAgd2lkdGg6IDE3NXB4OwogIGhlaWdodDogMTc1cHg7CiAgb2JqZWN0LWZpdDogY292ZXI7Cn0KLnN0eWxlc19jb2xsZWN0aWJsZVRpbGVXcmFwcGVyX19iaWVwN2EyIHsKICBwYWRkaW5nOiAwOwogIGJvcmRlcjogbm9uZTsKICBib3JkZXItcmFkaXVzOiAwOwogIGJhY2tncm91bmQ6IG5vbmU7CiAgcG9zaXRpb246IHJlbGF0aXZlOwp9Ci5zdHlsZXNfY29sbGVjdGlibGVUaWxlV3JhcHBlcl9fYmllcDdhMjpmb2N1cyB7CiAgb3V0bGluZTogbm9uZTsKfQouc3R5bGVzX29mZmVyQmVsbEJ1dHRvbl9fYmllcDdhMyB7CiAgd2lkdGg6IDIycHg7CiAgaGVpZ2h0OiAyMnB4Owp9Ci5zdHlsZXNfZm9vdGVyX2FuaW1hdGVkX19iaWVwN2E1IHsKICB0cmFuc2l0aW9uOiB0cmFuc2Zvcm0gMC4ycyBlYXNlLWluLW91dDsKfQouc3R5bGVzX2NvbGxlY3RpYmxlVGlsZVdyYXBwZXJfX2JpZXA3YTI6aG92ZXIgLnN0eWxlc19mb290ZXJfYW5pbWF0ZWRfX2JpZXA3YTUgewogIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgtMzBweCk7Cn0KLnN0eWxlc19hY3Rpb25XcmFwcGVyX19iaWVwN2E3IHsKICB0cmFuc2l0aW9uOiB0cmFuc2Zvcm0gMC4ycyBlYXNlLWluLW91dDsKICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgd2lkdGg6IDEwMCU7CiAgYm90dG9tOiAtMzZweDsKfQouc3R5bGVzX2NvbGxlY3RpYmxlVGlsZVdyYXBwZXJfX2JpZXA3YTI6aG92ZXIgLnN0eWxlc19hY3Rpb25XcmFwcGVyX19iaWVwN2E3IHsKICB0cmFuc2Zvcm06IHRyYW5zbGF0ZVkoLTM2cHgpOwp9';\nexport var actionWrapper = 'styles_actionWrapper__biep7a7';\nexport var collectibleCard = 'styles_collectibleCard__biep7a0';\nexport var collectibleImage = 'styles_collectibleImage__biep7a1';\nexport var collectibleTileWrapper = 'styles_collectibleTileWrapper__biep7a2';\nexport var footer = {animated:'styles_footer_animated__biep7a5 fyvr11wl','static':'fyvr11wl'};\nexport var offerBellButton = 'styles_offerBellButton__biep7a3';"],"mappings":";;;AACO,IAAI,uBAAuB;;;ACA3B,IAAI,mBAAmB;AACvB,IAAI,2BAA2B;;;ACD/B,IAAI,0BAA0B;AAC9B,IAAI,oBAAoB;;;ACFxB,IAAI,eAAe;;;ACEnB,IAAI,cAAc;AAClB,IAAI,mBAAmB;AACvB,IAAI,wBAAwB;AAC5B,IAAI,4BAA4B;AAChC,IAAI,uBAAuB;AAC3B,IAAI,gBAAgB,EAAC,QAAO,kJAAiJ,MAAK,+IAA8I;AAChU,IAAI,gBAAgB;;;ACNpB,IAAIA,eAAc;AAClB,IAAIC,iBAAgB;AACpB,IAAI,uBAAuB;;;ACH3B,IAAI,gBAAgB;AACpB,IAAI,kBAAkB;AACtB,IAAI,mBAAmB;AACvB,IAAI,yBAAyB;AAC7B,IAAI,SAAS,EAAC,UAAS,4CAA2C,UAAS,WAAU;AACrF,IAAI,kBAAkB;","names":["closeButton","dialogOverlay"]}
1
+ {"version":3,"sources":["../src/react/ui/modals/_internal/components/calendarPopover/styles.css.ts","../src/react/ui/modals/_internal/components/priceInput/styles.css.ts","../src/react/ui/modals/_internal/components/quantityInput/styles.css.ts","../src/react/ui/modals/_internal/components/tokenPreview/styles.css.ts","../src/react/ui/modals/SuccessfulPurchaseModal/styles.css.ts","../src/react/ui/modals/TransferModal/styles.css.ts","../src/react/ui/components/collectible-card/styles.css.ts"],"sourcesContent":["import 'src/react/ui/modals/_internal/components/calendarPopover/styles.css.ts.vanilla.css?source=LnN0eWxlc19kYXRlU2VsZWN0QnV0dG9uX18xamM2cDhqMCB7CiAgZmxleDogMyAhaW1wb3J0YW50OwogIHBhZGRpbmc6IDEwcHggOHB4ICFpbXBvcnRhbnQ7CiAgaGVpZ2h0OiAzNnB4ICFpbXBvcnRhbnQ7CiAgYm9yZGVyOiAxcHggc29saWQgIzRGNEY0RiAhaW1wb3J0YW50OwogIGJvcmRlci1yYWRpdXM6IDRweCAhaW1wb3J0YW50OwogIGZvbnQtd2VpZ2h0OiA0MDAgIWltcG9ydGFudDsKICBmb250LXNpemU6IDEycHggIWltcG9ydGFudDsKfQ==';\nexport var dateSelectButton = 'styles_dateSelectButton__1jc6p8j0';\nexport var dateSelectPopoverContent = 'fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr11rs fyvr130l fyvr11xx fyvr11r0';","import 'src/react/ui/modals/_internal/components/priceInput/styles.css.ts.vanilla.css?source=LnN0eWxlc19wcmljZUlucHV0V3JhcHBlcl9fNmpqejh0MCB7CiAgZGlzcGxheTogZmxleDsKICBmbGV4LWRpcmVjdGlvbjogY29sdW1uOwogIHdpZHRoOiAxMDAlOwp9Ci5zdHlsZXNfcHJpY2VJbnB1dEN1cnJlbmN5SW1hZ2VfXzZqano4dDEgewogIHRvcDogMjlweDsKfQouc3R5bGVzX3ByaWNlSW5wdXRXcmFwcGVyX182amp6OHQwID4gbGFiZWwgewogIGdhcDogMnB4Owp9Ci5zdHlsZXNfcHJpY2VJbnB1dFdyYXBwZXJfXzZqano4dDAgPiBsYWJlbCA+IGRpdiA+IGRpdiB7CiAgaGVpZ2h0OiAzNnB4OwogIGZvbnQtc2l6ZTogMTJweDsKICBib3JkZXItcmFkaXVzOiA0cHg7CiAgcGFkZGluZy1sZWZ0OiAyOHB4OwogIHBhZGRpbmctcmlnaHQ6IDA7Cn0KLnN0eWxlc19wcmljZUlucHV0V3JhcHBlcl9fNmpqejh0MCA+IGxhYmVsID4gZGl2ID4gZGl2ID4gaW5wdXQgewogIGZvbnQtc2l6ZTogMTJweDsKfQ==';\nexport var priceInputCurrencyImage = 'styles_priceInputCurrencyImage__6jjz8t1';\nexport var priceInputWrapper = 'styles_priceInputWrapper__6jjz8t0';","import 'src/react/ui/modals/_internal/components/quantityInput/styles.css.ts.vanilla.css?source=LnN0eWxlc19xdWFudGl0eUlucHV0V3JhcHBlcl9fNTBnNG05MCB7CiAgZGlzcGxheTogZmxleDsKICBmbGV4LWRpcmVjdGlvbjogY29sdW1uOwogIHdpZHRoOiAxMDAlOwp9Ci5zdHlsZXNfcXVhbnRpdHlJbnB1dFdyYXBwZXJfXzUwZzRtOTAgPiBsYWJlbCB7CiAgZ2FwOiAycHg7Cn0KLnN0eWxlc19xdWFudGl0eUlucHV0V3JhcHBlcl9fNTBnNG05MCA+IGxhYmVsID4gZGl2ID4gZGl2IHsKICBoZWlnaHQ6IDM2cHg7CiAgZm9udC1zaXplOiAxMnB4OwogIGJvcmRlci1yYWRpdXM6IDRweDsKICBwYWRkaW5nLWxlZnQ6IDEycHg7CiAgcGFkZGluZy1yaWdodDogMDsKfQouc3R5bGVzX3F1YW50aXR5SW5wdXRXcmFwcGVyX181MGc0bTkwID4gbGFiZWwgPiBkaXYgPiBkaXY6aGFzKDpkaXNhYmxlZCkgLCAuc3R5bGVzX3F1YW50aXR5SW5wdXRXcmFwcGVyX181MGc0bTkwID4gbGFiZWwgPiBkaXYgPiBkaXY6aGFzKDpkaXNhYmxlZCk6aG92ZXIgewogIG9wYWNpdHk6IDE7Cn0KLnN0eWxlc19xdWFudGl0eUlucHV0V3JhcHBlcl9fNTBnNG05MCA+IGxhYmVsID4gZGl2ID4gZGl2ID4gaW5wdXQgewogIGZvbnQtc2l6ZTogMTJweDsKfQ==';\nexport var quantityInputWrapper = 'styles_quantityInputWrapper__50g4m90';","export var tokenPreview = 'fyvr1188 fyvr11ag fyvr11l8 fyvr11ow fyvr12g';","import 'src/react/ui/styles/modal.css.ts.vanilla.css?source=Lm1vZGFsX2RpYWxvZ0NvbnRlbnRCYXNlX18xeXBsNm50MSB7CiAgdG9wOiA1MCU7CiAgbGVmdDogNTAlOwogIHRyYW5zZm9ybTogdHJhbnNsYXRlKC01MCUsIC01MCUpOwogIHBhZGRpbmc6IDI0cHg7Cn0KLm1vZGFsX2RpYWxvZ0NvbnRlbnRfbmFycm93X18xeXBsNm50MiB7CiAgd2lkdGg6IDM2MHB4Owp9Ci5tb2RhbF9kaWFsb2dDb250ZW50X3dpZGVfXzF5cGw2bnQzIHsKICB3aWR0aDogNTQwcHg7Cn0KQG1lZGlhIHNjcmVlbiBhbmQgKG1heC13aWR0aDogMzYwcHgpIHsKICAubW9kYWxfZGlhbG9nQ29udGVudF9uYXJyb3dfXzF5cGw2bnQyIHsKICAgIHdpZHRoOiAxMDAlOwogICAgYm90dG9tOiAwOwogICAgdHJhbnNmb3JtOiB1bnNldDsKICAgIHRvcDogdW5zZXQ7CiAgICBsZWZ0OiB1bnNldDsKICAgIGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDAgIWltcG9ydGFudDsKICAgIGJvcmRlci1ib3R0b20tcmlnaHQtcmFkaXVzOiAwICFpbXBvcnRhbnQ7CiAgfQp9CkBtZWRpYSBzY3JlZW4gYW5kIChtYXgtd2lkdGg6IDU0MHB4KSB7CiAgLm1vZGFsX2RpYWxvZ0NvbnRlbnRfd2lkZV9fMXlwbDZudDMgewogICAgd2lkdG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SXRlbV9fMW5qa3dmZTEgewogIGdyaWQtY29sdW1uOiB1bnNldDsKfQouc3R5bGVzX2NvbGxlY3RpYmxlc0dyaWRJbWFnZV9fMW5qa3dmZTIgewogIHdpZHRoOiAxMDAlOwogIGhlaWdodDogMTAwJTsKICBvYmplY3QtZml0OiBjb250YWluOwp9Ci5zdHlsZXNfY29sbGVjdGlibGVzR3JpZEltYWdlUGFsZV9fMW5qa3dmZTMgewogIG9wYWNpdHk6IDAuNCAhaW1wb3J0YW50Owp9';\nexport var closeButton = 'fyvr11lw fyvr1tc fyvr1mo';\nexport var collectiblesGrid = 'styles_collectiblesGrid__1njkwfe0';\nexport var collectiblesGridImage = 'styles_collectiblesGridImage__1njkwfe2';\nexport var collectiblesGridImagePale = 'styles_collectiblesGridImagePale__1njkwfe3 styles_collectiblesGridImage__1njkwfe2';\nexport var collectiblesGridItem = 'styles_collectiblesGridItem__1njkwfe1';\nexport var dialogContent = {narrow:'modal_dialogContent_narrow__1ypl6nt2 modal_dialogContentBase__1ypl6nt1 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr11l8 fyvr11wl fyvr11m0 fyvr11rs',wide:'modal_dialogContent_wide__1ypl6nt3 modal_dialogContentBase__1ypl6nt1 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr11l8 fyvr11wl fyvr11m0 fyvr11rs'};\nexport var dialogOverlay = 'fyvr1m0 fyvr1o8 fyvr1qg fyvr1so fyvr11xl fyvr11m0 fyvr11rs';","import 'src/react/ui/styles/modal.css.ts.vanilla.css?source=Lm1vZGFsX2RpYWxvZ0NvbnRlbnRCYXNlX18xeXBsNm50MSB7CiAgdG9wOiA1MCU7CiAgbGVmdDogNTAlOwogIHRyYW5zZm9ybTogdHJhbnNsYXRlKC01MCUsIC01MCUpOwogIHBhZGRpbmc6IDI0cHg7Cn0KLm1vZGFsX2RpYWxvZ0NvbnRlbnRfbmFycm93X18xeXBsNm50MiB7CiAgd2lkdGg6IDM2MHB4Owp9Ci5tb2RhbF9kaWFsb2dDb250ZW50X3dpZGVfXzF5cGw2bnQzIHsKICB3aWR0aDogNTQwcHg7Cn0KQG1lZGlhIHNjcmVlbiBhbmQgKG1heC13aWR0aDogMzYwcHgpIHsKICAubW9kYWxfZGlhbG9nQ29udGVudF9uYXJyb3dfXzF5cGw2bnQyIHsKICAgIHdpZHRoOiAxMDAlOwogICAgYm90dG9tOiAwOwogICAgdHJhbnNmb3JtOiB1bnNldDsKICAgIHRvcDogdW5zZXQ7CiAgICBsZWZ0OiB1bnNldDsKICAgIGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDAgIWltcG9ydGFudDsKICAgIGJvcmRlci1ib3R0b20tcmlnaHQtcmFkaXVzOiAwICFpbXBvcnRhbnQ7CiAgfQp9CkBtZWRpYSBzY3JlZW4gYW5kIChtYXgtd2lkdGg6IDU0MHB4KSB7CiAgLm1vZGFsX2RpYWxvZ0NvbnRlbnRfd2lkZV9fMXlwbDZudDMgewogICAgd2lkdGg6IDEwMCU7CiAgICBib3R0b206IDA7CiAgICB0cmFuc2Zvcm06IHVuc2V0OwogICAgdG9wOiB1bnNldDsKICAgIGxlZnQ6IHVuc2V0OwogICAgYm9yZGVyLWJvdHRvbS1sZWZ0LXJhZGl1czogMCAhaW1wb3J0YW50OwogICAgYm9yZGVyLWJvdHRvbS1yaWdodC1yYWRpdXM6IDAgIWltcG9ydGFudDsKICB9Cn0=';\nimport 'src/react/ui/modals/TransferModal/styles.css.ts.vanilla.css?source=LnN0eWxlc190cmFuc2Zlck1vZGFsQ29udGVudF9faTFxejlnMCB7CiAgd2lkdGg6IDU0MHB4Owp9CkBtZWRpYSBzY3JlZW4gYW5kIChtYXgtd2lkdGg6IDU0MHB4KSB7CiAgLnN0eWxlc190cmFuc2Zlck1vZGFsQ29udGVudF9faTFxejlnMCB7CiAgICB3aWR0aDogMTAwJTsKICB9Cn0=';\nexport var closeButton = 'fyvr11lw fyvr1tc fyvr1mo';\nexport var dialogOverlay = 'fyvr1m0 fyvr1o8 fyvr1qg fyvr1so fyvr11xl fyvr11m0 fyvr11rs';\nexport var transferModalContent = 'styles_transferModalContent__i1qz9g0 modal_dialogContent_wide__1ypl6nt3 modal_dialogContentBase__1ypl6nt1 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr11l8 fyvr11wl fyvr11m0 fyvr11rs fyvr1vo fyvr1xs fyvr1zw fyvr1120';","import 'src/react/ui/components/collectible-card/styles.css.ts.vanilla.css?source=LnN0eWxlc19jb2xsZWN0aWJsZUNhcmRfX2JpZXA3YTAgewogIHdpZHRoOiAxNzVweDsKICBib3JkZXI6IDFweCBzb2xpZCBoc2xhKDAsIDAlLCAzMSUsIDEpOwp9Ci5zdHlsZXNfY29sbGVjdGlibGVJbWFnZV9fYmllcDdhMSB7CiAgd2lkdGg6IDE3NXB4OwogIGhlaWdodDogMTc1cHg7CiAgb2JqZWN0LWZpdDogY292ZXI7Cn0KLnN0eWxlc19jb2xsZWN0aWJsZVRpbGVXcmFwcGVyX19iaWVwN2EyIHsKICBwYWRkaW5nOiAwOwogIGJvcmRlcjogbm9uZTsKICBib3JkZXItcmFkaXVzOiAwOwogIGJhY2tncm91bmQ6IG5vbmU7CiAgcG9zaXRpb246IHJlbGF0aXZlOwp9Ci5zdHlsZXNfY29sbGVjdGlibGVUaWxlV3JhcHBlcl9fYmllcDdhMjpmb2N1cyB7CiAgb3V0bGluZTogbm9uZTsKfQouc3R5bGVzX29mZmVyQmVsbEJ1dHRvbl9fYmllcDdhMyB7CiAgd2lkdGg6IDIycHg7CiAgaGVpZ2h0OiAyMnB4Owp9Ci5zdHlsZXNfZm9vdGVyX2FuaW1hdGVkX19iaWVwN2E1IHsKICB0cmFuc2l0aW9uOiB0cmFuc2Zvcm0gMC4ycyBlYXNlLWluLW91dDsKfQouc3R5bGVzX2NvbGxlY3RpYmxlVGlsZVdyYXBwZXJfX2JpZXA3YTI6aG92ZXIgLnN0eWxlc19mb290ZXJfYW5pbWF0ZWRfX2JpZXA3YTUgewogIHRyYW5zZm9ybTogdHJhbnNsYXRlWSgtMzBweCk7Cn0KLnN0eWxlc19hY3Rpb25XcmFwcGVyX19iaWVwN2E3IHsKICB0cmFuc2l0aW9uOiB0cmFuc2Zvcm0gMC4ycyBlYXNlLWluLW91dDsKICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgd2lkdGg6IDEwMCU7CiAgYm90dG9tOiAtMzZweDsKfQouc3R5bGVzX2NvbGxlY3RpYmxlVGlsZVdyYXBwZXJfX2JpZXA3YTI6aG92ZXIgLnN0eWxlc19hY3Rpb25XcmFwcGVyX19iaWVwN2E3IHsKICB0cmFuc2Zvcm06IHRyYW5zbGF0ZVkoLTM2cHgpOwp9';\nexport var actionWrapper = 'styles_actionWrapper__biep7a7';\nexport var collectibleCard = 'styles_collectibleCard__biep7a0';\nexport var collectibleImage = 'styles_collectibleImage__biep7a1';\nexport var collectibleTileWrapper = 'styles_collectibleTileWrapper__biep7a2';\nexport var footer = {animated:'styles_footer_animated__biep7a5 fyvr11wl','static':'fyvr11wl'};\nexport var offerBellButton = 'styles_offerBellButton__biep7a3';"],"mappings":";;;AACO,IAAI,mBAAmB;AACvB,IAAI,2BAA2B;;;ACD/B,IAAI,0BAA0B;AAC9B,IAAI,oBAAoB;;;ACDxB,IAAI,uBAAuB;;;ACD3B,IAAI,eAAe;;;ACEnB,IAAI,cAAc;AAClB,IAAI,mBAAmB;AACvB,IAAI,wBAAwB;AAC5B,IAAI,4BAA4B;AAChC,IAAI,uBAAuB;AAC3B,IAAI,gBAAgB,EAAC,QAAO,kJAAiJ,MAAK,+IAA8I;AAChU,IAAI,gBAAgB;;;ACNpB,IAAIA,eAAc;AAClB,IAAIC,iBAAgB;AACpB,IAAI,uBAAuB;;;ACH3B,IAAI,gBAAgB;AACpB,IAAI,kBAAkB;AACtB,IAAI,mBAAmB;AACvB,IAAI,yBAAyB;AAC7B,IAAI,SAAS,EAAC,UAAS,4CAA2C,UAAS,WAAU;AACrF,IAAI,kBAAkB;","names":["closeButton","dialogOverlay"]}
@@ -14,12 +14,6 @@ import {
14
14
  getPresentableChainName,
15
15
  getPublicRpcClient
16
16
  } from "./chunk-OUZ42I6B.js";
17
- import {
18
- EIP2981_ABI
19
- } from "./chunk-3OHM45R3.js";
20
- import {
21
- ERC1155_ABI
22
- } from "./chunk-WFE6OCYF.js";
23
17
  import {
24
18
  AddressSchema,
25
19
  ChainIdSchema,
@@ -85,6 +79,12 @@ import {
85
79
  UnexpectedStepsError,
86
80
  UnknownTransactionTypeError
87
81
  } from "./chunk-T2AMWIKD.js";
82
+ import {
83
+ EIP2981_ABI
84
+ } from "./chunk-3OHM45R3.js";
85
+ import {
86
+ ERC1155_ABI
87
+ } from "./chunk-WFE6OCYF.js";
88
88
 
89
89
  // src/react/hooks/useBalanceOfCollectible.tsx
90
90
  import { queryOptions, skipToken, useQuery } from "@tanstack/react-query";
@@ -1795,7 +1795,9 @@ var TransactionMachine = class {
1795
1795
  const targetChain = Number(this.config.config.chainId);
1796
1796
  await this.transition("SWITCH_CHAIN" /* SWITCH_CHAIN */);
1797
1797
  try {
1798
- await this.switchChainFn(this.config.config.chainId);
1798
+ if (!this.config.config.isWaaS) {
1799
+ await this.switchChainFn(this.config.config.chainId);
1800
+ }
1799
1801
  await this.walletClient.switchChain({
1800
1802
  id: Number(this.config.config.chainId)
1801
1803
  });
@@ -1838,6 +1840,7 @@ var TransactionMachine = class {
1838
1840
  }
1839
1841
  async executeTransaction(step) {
1840
1842
  try {
1843
+ await this.switchChain();
1841
1844
  const transactionData = {
1842
1845
  account: this.getAccount(),
1843
1846
  chain: this.getChainForTransaction(),
@@ -1859,6 +1862,7 @@ var TransactionMachine = class {
1859
1862
  if (!step.post) {
1860
1863
  throw new MissingPostStepError();
1861
1864
  }
1865
+ await this.switchChain();
1862
1866
  let signature;
1863
1867
  if (!step.signature) {
1864
1868
  throw new MissingSignatureDataError();
@@ -1991,7 +1995,6 @@ var TransactionMachine = class {
1991
1995
  if (!step.to && !step.signature) {
1992
1996
  throw new MissingStepDataError();
1993
1997
  }
1994
- await this.switchChain();
1995
1998
  if (step.id === "buy" /* buy */) {
1996
1999
  await this.executeBuyStep({ step, props });
1997
2000
  return;
@@ -2097,25 +2100,24 @@ function AlertMessage({ message, type }) {
2097
2100
  import { observable } from "@legendapp/state";
2098
2101
  var initialState = {
2099
2102
  isOpen: false,
2100
- open: ({ chainIdToSwitchTo, onError, onSuccess }) => {
2103
+ open: ({ chainIdToSwitchTo, onError, onSuccess, onClose }) => {
2101
2104
  switchChainModal$.state.set({
2102
2105
  ...switchChainModal$.state.get(),
2103
2106
  chainIdToSwitchTo,
2104
2107
  onError,
2105
- onSuccess
2108
+ onSuccess,
2109
+ onClose
2106
2110
  });
2107
2111
  switchChainModal$.isOpen.set(true);
2108
2112
  },
2109
2113
  close: () => {
2110
2114
  switchChainModal$.isOpen.set(false);
2111
- switchChainModal$.state.set({
2112
- ...initialState.state
2113
- });
2114
2115
  },
2115
2116
  state: {
2116
2117
  chainIdToSwitchTo: void 0,
2117
2118
  onError: void 0,
2118
2119
  onSuccess: void 0,
2120
+ onClose: void 0,
2119
2121
  isSwitching: false
2120
2122
  }
2121
2123
  };
@@ -2176,6 +2178,7 @@ var SwitchChainModal = observer(() => {
2176
2178
  Close,
2177
2179
  {
2178
2180
  onClick: () => {
2181
+ switchChainModal$.state.onClose?.();
2179
2182
  switchChainModal$.delete();
2180
2183
  },
2181
2184
  className: closeButton,
@@ -2202,6 +2205,7 @@ var useTransactionMachine = (config, onSuccess, onError, onTransactionSent) => {
2202
2205
  const { chains } = useSwitchChain2();
2203
2206
  const { connector, isConnected } = useAccount4();
2204
2207
  const walletKind = connector?.id === "sequence" ? "sequence" /* sequence */ : "unknown" /* unknown */;
2208
+ const isWaaS = connector?.id.endsWith("waas") || false;
2205
2209
  if (!isConnected) {
2206
2210
  return { machine: null, error: null, isLoading: false };
2207
2211
  }
@@ -2227,18 +2231,26 @@ var useTransactionMachine = (config, onSuccess, onError, onTransactionSent) => {
2227
2231
  }
2228
2232
  const machine = new TransactionMachine(
2229
2233
  {
2230
- config: { sdkConfig, marketplaceConfig, walletKind, chains, ...config },
2234
+ config: {
2235
+ sdkConfig,
2236
+ marketplaceConfig,
2237
+ walletKind,
2238
+ chains,
2239
+ ...config,
2240
+ isWaaS
2241
+ },
2231
2242
  onSuccess,
2232
2243
  onTransactionSent
2233
2244
  },
2234
2245
  walletClient,
2235
2246
  getPublicRpcClient(config.chainId),
2236
2247
  openSelectPaymentModal,
2237
- async (chainId) => new Promise((resolve, reject) => {
2248
+ async () => new Promise((resolve, reject) => {
2238
2249
  showSwitchChainModal({
2239
- chainIdToSwitchTo: Number(chainId),
2250
+ chainIdToSwitchTo: Number(config.chainId),
2240
2251
  onSuccess: resolve,
2241
- onError: reject
2252
+ onError: reject,
2253
+ onClose: reject
2242
2254
  });
2243
2255
  })
2244
2256
  );
@@ -2383,4 +2395,4 @@ export {
2383
2395
  useCancelOrder,
2384
2396
  useBuyCollectable
2385
2397
  };
2386
- //# sourceMappingURL=chunk-6LQST3KZ.js.map
2398
+ //# sourceMappingURL=chunk-Z3VR2KMP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/react/hooks/useBalanceOfCollectible.tsx","../src/react/hooks/useConfig.tsx","../src/utils/_internal/error/context.ts","../src/react/provider.tsx","../src/react/hooks/useCountOfCollectables.tsx","../src/react/_internal/api/zod-schema.ts","../src/react/hooks/useCollectible.tsx","../src/react/hooks/useCollection.tsx","../src/react/hooks/useCurrencies.tsx","../src/react/hooks/useCurrency.tsx","../src/react/hooks/useFilters.tsx","../src/react/hooks/useFloorOrder.tsx","../src/react/hooks/useHighestOffer.tsx","../src/react/hooks/useListBalances.tsx","../src/react/hooks/useListCollectibles.tsx","../src/react/hooks/useListOffersForCollectible.tsx","../src/react/hooks/useCountOffersForCollectible.tsx","../src/react/hooks/useListListingsForCollectible.tsx","../src/react/hooks/useCountListingsForCollectible.tsx","../src/react/hooks/useLowestListing.tsx","../src/react/hooks/useMarketplaceConfig.tsx","../src/react/hooks/options/marketplaceConfigOptions.ts","../src/react/hooks/useRoyaltyPercentage.tsx","../src/react/hooks/useGenerateListingTransaction.tsx","../src/react/hooks/useGenerateOfferTransaction.tsx","../src/react/hooks/useGenerateSellTransaction.tsx","../src/react/hooks/useGenerateCancelTransaction.tsx","../src/react/hooks/useTransferTokens.tsx","../src/react/hooks/useCheckoutOptions.tsx","../src/react/hooks/useListCollections.tsx","../src/react/hooks/useGenerateBuyTransaction.tsx","../src/react/_internal/transaction-machine/execute-transaction.ts","../src/react/_internal/transaction-machine/logger.ts","../src/react/_internal/transaction-machine/useTransactionMachine.ts","../src/react/ui/modals/_internal/components/switchChainModal/index.tsx","../src/react/ui/modals/_internal/components/alertMessage/index.tsx","../src/react/ui/modals/_internal/components/switchChainModal/store.ts","../src/react/hooks/useCancelOrder.tsx","../src/react/hooks/useBuyCollectable.tsx"],"sourcesContent":["import { queryOptions, skipToken, useQuery } from '@tanstack/react-query';\nimport type { Hex } from 'viem';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tCollectableIdSchema,\n\ttype QueryArgSchema,\n\tcollectableKeys,\n\tgetIndexerClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst fetchBalanceOfCollectibleSchema = z.object({\n\tcollectionAddress: AddressSchema,\n\tcollectableId: CollectableIdSchema.pipe(z.coerce.string()),\n\tuserAddress: AddressSchema,\n\tchainId: ChainIdSchema.pipe(z.coerce.number()),\n});\n\ntype FetchBalanceOfCollectibleArgs = z.input<\n\ttypeof fetchBalanceOfCollectibleSchema\n>;\n\nconst fetchBalanceOfCollectible = async (\n\targs: FetchBalanceOfCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = fetchBalanceOfCollectibleSchema.parse(args);\n\tconst indexerClient = getIndexerClient(parsedArgs.chainId, config);\n\treturn indexerClient\n\t\t.getTokenBalances({\n\t\t\taccountAddress: parsedArgs.userAddress,\n\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t\ttokenID: parsedArgs.collectableId,\n\t\t\tincludeMetadata: false,\n\t\t\tmetadataOptions: {\n\t\t\t\tverifiedOnly: true,\n\t\t\t\tincludeContracts: [parsedArgs.collectionAddress],\n\t\t\t},\n\t\t})\n\t\t.then((res) => res.balances[0] || null);\n};\n\ninterface BalanceOfCollectibleOptions\n\textends Omit<FetchBalanceOfCollectibleArgs, 'userAddress'> {\n\tuserAddress: Hex | undefined;\n\tquery?: z.infer<typeof QueryArgSchema>;\n}\nexport const balanceOfCollectibleOptions = (\n\targs: BalanceOfCollectibleOptions,\n\tconfig: SdkConfig,\n) => {\n\tconst enabled = !!args.userAddress && (args.query?.enabled ?? true);\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.userBalances, args],\n\t\tqueryFn: enabled\n\t\t\t? () =>\n\t\t\t\t\tfetchBalanceOfCollectible(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...args,\n\t\t\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: this is guaranteed by the userAddress check above\n\t\t\t\t\t\t\tuserAddress: args.userAddress!,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tconfig,\n\t\t\t\t\t)\n\t\t\t: skipToken,\n\t\tenabled,\n\t});\n};\n\nexport const useBalanceOfCollectible = (args: BalanceOfCollectibleOptions) => {\n\tconst config = useConfig();\n\treturn useQuery(balanceOfCollectibleOptions(args, config));\n};\n","'use client';\n\nimport { useContext } from 'react';\n\nimport { MarketplaceSdkProviderNotFoundError } from '../../utils/_internal/error/context';\nimport { MarketplaceSdkContext } from '../provider';\n\nexport function useConfig() {\n\tconst context = useContext(MarketplaceSdkContext);\n\tif (!context) {\n\t\tthrow new MarketplaceSdkProviderNotFoundError();\n\t}\n\treturn context;\n}\n","import { BaseError } from './base';\n\nexport type MarketplaceSdkProviderNotFoundErrorType =\n\tMarketplaceSdkProviderNotFoundError & {\n\t\tname: 'MarketplaceSDKProviderNotFoundError';\n\t};\n\nexport class MarketplaceSdkProviderNotFoundError extends BaseError {\n\toverride name = 'MarketplaceSDKProviderNotFoundError';\n\tconstructor() {\n\t\tsuper('`useConfig` must be used within `MarketplaceSdkProvider`.');\n\t}\n}\n","'use client';\n\nimport { createContext } from 'react';\nimport '@0xsequence/design-system/styles.css';\nimport type { SdkConfig } from '../types';\nimport { PROVIDER_ID } from './_internal/get-provider';\n\nexport const MarketplaceSdkContext = createContext({} as SdkConfig);\n\nexport type MarketplaceSdkProviderProps = {\n\tconfig: SdkConfig;\n\tchildren: React.ReactNode;\n};\n\nexport function MarketplaceProvider({\n\tconfig,\n\tchildren,\n}: MarketplaceSdkProviderProps) {\n\treturn (\n\t\t<MarketplaceSdkContext.Provider value={config}>\n\t\t\t<div id={PROVIDER_ID}>{children}</div>\n\t\t</MarketplaceSdkContext.Provider>\n\t);\n}\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tOrderSide,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { collectiblesFilterSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst BaseSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tquery: QueryArgSchema,\n});\n\nconst UseCountOfCollectableSchema = BaseSchema.extend({\n\tfilter: collectiblesFilterSchema,\n\tside: z.nativeEnum(OrderSide),\n}).or(\n\tBaseSchema.extend({\n\t\tfilter: z.undefined(),\n\t\tside: z.undefined(),\n\t}),\n);\n\nexport type UseCountOfCollectablesArgs = z.infer<\n\ttypeof UseCountOfCollectableSchema\n>;\n\nexport type UseContOfCollectableReturn = Awaited<\n\tReturnType<typeof fetchCountOfCollectables>\n>;\n\nconst fetchCountOfCollectables = async (\n\targs: UseCountOfCollectablesArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseCountOfCollectableSchema.parse(args);\n\tconst marketplaceClient = getMarketplaceClient(parsedArgs.chainId, config);\n\tif (parsedArgs.filter) {\n\t\treturn marketplaceClient\n\t\t\t.getCountOfFilteredCollectibles({\n\t\t\t\t...parsedArgs,\n\t\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: safe to assert here, as it's validated\n\t\t\t\tside: parsedArgs.side!,\n\t\t\t})\n\t\t\t.then((resp) => resp.count);\n\t}\n\treturn marketplaceClient\n\t\t.getCountOfAllCollectibles({\n\t\t\t...parsedArgs,\n\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t})\n\t\t.then((resp) => resp.count);\n};\n\nexport const countOfCollectablesOptions = (\n\targs: UseCountOfCollectablesArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.counts, args],\n\t\tqueryFn: () => fetchCountOfCollectables(args, config),\n\t});\n};\n\nexport const useCountOfCollectables = (args: UseCountOfCollectablesArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(countOfCollectablesOptions(args, config));\n};\n","// generated with https://transform.tools/typescript-to-zod\n//\n//\nimport { z } from 'zod';\nimport {\n\tCollectibleStatus,\n\tCollectionStatus,\n\tContractType,\n\tExecuteType,\n\tMarketplaceKind,\n\tOrderSide,\n\tOrderStatus,\n\tOrderbookKind,\n\tProjectStatus,\n\tPropertyType,\n\tSortOrder,\n\tSourceKind,\n\tStepType,\n\tTransactionCrypto,\n\tTransactionNFTCheckoutProvider,\n\tTransactionOnRampProvider,\n\tTransactionSwapProvider,\n\tWalletKind,\n} from './marketplace.gen';\n\nexport const assetSchema = z.object({\n\tid: z.number(),\n\tcollectionId: z.number(),\n\ttokenId: z.string(),\n\turl: z.string().optional(),\n\tmetadataField: z.string(),\n\tname: z.string().optional(),\n\tfilesize: z.number().optional(),\n\tmimeType: z.string().optional(),\n\twidth: z.number().optional(),\n\theight: z.number().optional(),\n\tupdatedAt: z.string().optional(),\n});\n\nexport const sortOrderSchema = z.nativeEnum(SortOrder);\n\nexport const propertyTypeSchema = z.nativeEnum(PropertyType);\n\nexport const marketplaceKindSchema = z.nativeEnum(MarketplaceKind);\n\nexport const orderbookKindSchema = z.nativeEnum(OrderbookKind);\n\nexport const sourceKindSchema = z.nativeEnum(SourceKind);\n\nexport const orderSideSchema = z.nativeEnum(OrderSide);\n\nexport const orderStatusSchema = z.nativeEnum(OrderStatus);\n\nexport const contractTypeSchema = z.nativeEnum(ContractType);\n\nexport const collectionStatusSchema = z.nativeEnum(CollectionStatus);\n\nexport const projectStatusSchema = z.nativeEnum(ProjectStatus);\n\nexport const collectibleStatusSchema = z.nativeEnum(CollectibleStatus);\n\nexport const walletKindSchema = z.nativeEnum(WalletKind);\n\nexport const stepTypeSchema = z.nativeEnum(StepType);\n\nexport const transactionCryptoSchema = z.nativeEnum(TransactionCrypto);\n\nexport const transactionNFTCheckoutProviderSchema = z.nativeEnum(\n\tTransactionNFTCheckoutProvider,\n);\n\nexport const transactionOnRampProviderSchema = z.nativeEnum(\n\tTransactionOnRampProvider,\n);\n\nexport const transactionSwapProviderSchema = z.nativeEnum(\n\tTransactionSwapProvider,\n);\n\nexport const executeTypeSchema = z.nativeEnum(ExecuteType);\n\nexport const sortBySchema = z.object({\n\tcolumn: z.string(),\n\torder: sortOrderSchema,\n});\n\nexport const propertyFilterSchema = z.object({\n\tname: z.string(),\n\ttype: propertyTypeSchema,\n\tmin: z.number().optional(),\n\tmax: z.number().optional(),\n\tvalues: z.array(z.any()).optional(),\n});\n\nexport const collectiblesFilterSchema = z.object({\n\tincludeEmpty: z.boolean(),\n\tsearchText: z.string().optional(),\n\tproperties: z.array(propertyFilterSchema).optional(),\n\tmarketplaces: z.array(marketplaceKindSchema).optional(),\n\tinAccounts: z.array(z.string()).optional(),\n\tnotInAccounts: z.array(z.string()).optional(),\n\tordersCreatedBy: z.array(z.string()).optional(),\n\tordersNotCreatedBy: z.array(z.string()).optional(),\n});\n\nexport const feeBreakdownSchema = z.object({\n\tkind: z.string(),\n\trecipientAddress: z.string(),\n\tbps: z.number(),\n});\n\nexport const orderFilterSchema = z.object({\n\tcreatedBy: z.array(z.string()).optional(),\n\tmarketplace: z.array(marketplaceKindSchema).optional(),\n\tcurrencies: z.array(z.string()).optional(),\n});\n\nexport const collectionLastSyncedSchema = z.object({\n\tallOrders: z.string(),\n\tnewOrders: z.string(),\n});\n\nexport const projectSchema = z.object({\n\tprojectId: z.number(),\n\tchainId: z.number(),\n\tcontractAddress: z.string(),\n\tstatus: projectStatusSchema,\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().optional(),\n});\n\nexport const collectibleSchema = z.object({\n\tchainId: z.number(),\n\tcontractAddress: z.string(),\n\tstatus: collectibleStatusSchema,\n\ttokenId: z.string(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().optional(),\n});\n\nexport const currencySchema = z.object({\n\tchainId: z.number(),\n\tcontractAddress: z.string(),\n\tname: z.string(),\n\tsymbol: z.string(),\n\tdecimals: z.number(),\n\timageUrl: z.string(),\n\texchangeRate: z.number(),\n\tdefaultChainCurrency: z.boolean(),\n\tnativeCurrency: z.boolean(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().optional(),\n});\n\nexport const orderDataSchema = z.object({\n\torderId: z.string(),\n\tquantity: z.string(),\n});\n\nexport const additionalFeeSchema = z.object({\n\tamount: z.string(),\n\treceiver: z.string(),\n});\n\nexport const postRequestSchema = z.object({\n\tendpoint: z.string(),\n\tmethod: z.string(),\n\tbody: z.any(),\n});\n\nexport const createReqSchema = z.object({\n\ttokenId: z.string(),\n\tquantity: z.string(),\n\texpiry: z.string(),\n\tcurrencyAddress: z.string(),\n\tpricePerToken: z.string(),\n});\n\nexport const getOrdersInputSchema = z.object({\n\tcontractAddress: z.string(),\n\torderId: z.string(),\n\tmarketplace: marketplaceKindSchema,\n});\n\nexport const domainSchema = z.object({\n\tname: z.string(),\n\tversion: z.string(),\n\tchainId: z.number(),\n\tverifyingContract: z.string(),\n});\n\nexport const checkoutOptionsMarketplaceOrderSchema = z.object({\n\tcontractAddress: z.string(),\n\torderId: z.string(),\n\tmarketplace: marketplaceKindSchema,\n});\n\nexport const checkoutOptionsItemSchema = z.object({\n\ttokenId: z.string(),\n\tquantity: z.string(),\n});\n\nexport const checkoutOptionsSchema = z.object({\n\tcrypto: transactionCryptoSchema,\n\tswap: z.array(transactionSwapProviderSchema),\n\tnftCheckout: z.array(transactionNFTCheckoutProviderSchema),\n\tonRamp: z.array(transactionOnRampProviderSchema),\n});\n\nexport const listCurrenciesArgsSchema = z.object({});\n\nexport const listCurrenciesReturnSchema = z.object({\n\tcurrencies: z.array(currencySchema),\n});\n\nexport const getCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n});\n\nexport const getLowestPriceOfferForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getHighestPriceOfferForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getLowestPriceListingForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getHighestPriceListingForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getCollectibleLowestOfferArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getCollectibleHighestOfferArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getCollectibleLowestListingArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilters: orderFilterSchema.optional(),\n});\n\nexport const getCollectibleHighestListingArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const generateBuyTransactionArgsSchema = z.object({\n\tcollectionAddress: z.string(),\n\tbuyer: z.string(),\n\tmarketplace: marketplaceKindSchema,\n\tordersData: z.array(orderDataSchema),\n\tadditionalFees: z.array(additionalFeeSchema),\n\twalletType: walletKindSchema.optional(),\n});\n\nexport const generateSellTransactionArgsSchema = z.object({\n\tcollectionAddress: z.string(),\n\tseller: z.string(),\n\tmarketplace: marketplaceKindSchema,\n\tordersData: z.array(orderDataSchema),\n\tadditionalFees: z.array(additionalFeeSchema),\n\twalletType: walletKindSchema.optional(),\n});\n\nexport const generateListingTransactionArgsSchema = z.object({\n\tcollectionAddress: z.string(),\n\towner: z.string(),\n\tcontractType: contractTypeSchema,\n\torderbook: orderbookKindSchema,\n\tlisting: createReqSchema,\n\twalletType: walletKindSchema.optional(),\n});\n\nexport const generateOfferTransactionArgsSchema = z.object({\n\tcollectionAddress: z.string(),\n\tmaker: z.string(),\n\tcontractType: contractTypeSchema,\n\torderbook: orderbookKindSchema,\n\toffer: createReqSchema,\n\twalletType: walletKindSchema.optional(),\n});\n\nexport const executeArgsSchema = z.object({\n\tsignature: z.string(),\n\texecuteType: executeTypeSchema,\n\tbody: z.any(),\n});\n\nexport const executeReturnSchema = z.object({\n\torderId: z.string(),\n});\n\nexport const getCountOfAllCollectiblesArgsSchema = z.object({\n\tcontractAddress: z.string(),\n});\n\nexport const getCountOfAllCollectiblesReturnSchema = z.object({\n\tcount: z.number(),\n});\n\nexport const getCountOfFilteredCollectiblesArgsSchema = z.object({\n\tside: orderSideSchema,\n\tcontractAddress: z.string(),\n\tfilter: collectiblesFilterSchema.optional(),\n});\n\nexport const getCountOfFilteredCollectiblesReturnSchema = z.object({\n\tcount: z.number(),\n});\n\nexport const getFloorOrderArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\tfilter: collectiblesFilterSchema.optional(),\n});\n\nexport const syncOrderReturnSchema = z.object({});\n\nexport const syncOrdersReturnSchema = z.object({});\n\nexport const checkoutOptionsMarketplaceArgsSchema = z.object({\n\twallet: z.string(),\n\torders: z.array(checkoutOptionsMarketplaceOrderSchema),\n\tadditionalFee: z.number(),\n});\n\nexport const checkoutOptionsMarketplaceReturnSchema = z.object({\n\toptions: checkoutOptionsSchema,\n});\n\nexport const checkoutOptionsSalesContractArgsSchema = z.object({\n\twallet: z.string(),\n\tcontractAddress: z.string(),\n\tcollectionAddress: z.string(),\n\titems: z.array(checkoutOptionsItemSchema),\n});\n\nexport const checkoutOptionsSalesContractReturnSchema = z.object({\n\toptions: checkoutOptionsSchema,\n});\n\nexport const countListingsForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const countListingsForCollectibleReturnSchema = z.object({\n\tcount: z.number(),\n});\n\nexport const countOffersForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const countOffersForCollectibleReturnSchema = z.object({\n\tcount: z.number(),\n});\n\nexport const tokenMetadataSchema = z.object({\n\ttokenId: z.string(),\n\tname: z.string(),\n\tdescription: z.string().optional(),\n\timage: z.string().optional(),\n\tvideo: z.string().optional(),\n\taudio: z.string().optional(),\n\tproperties: z.record(z.any()).optional(),\n\tattributes: z.array(z.record(z.any())),\n\timage_data: z.string().optional(),\n\texternal_url: z.string().optional(),\n\tbackground_color: z.string().optional(),\n\tanimation_url: z.string().optional(),\n\tdecimals: z.number().optional(),\n\tupdatedAt: z.string().optional(),\n\tassets: z.array(assetSchema).optional(),\n});\n\nexport const pageSchema = z.object({\n\tpage: z.number(),\n\tpageSize: z.number(),\n\tmore: z.boolean().optional(),\n\tsort: z.array(sortBySchema).optional(),\n});\n\nexport const filterSchema = z.object({\n\ttext: z.string().optional(),\n\tproperties: z.array(propertyFilterSchema).optional(),\n});\n\nexport const orderSchema = z.object({\n\torderId: z.string(),\n\tmarketplace: marketplaceKindSchema,\n\tside: orderSideSchema,\n\tstatus: orderStatusSchema,\n\tchainId: z.number(),\n\tcollectionContractAddress: z.string(),\n\ttokenId: z.string(),\n\tcreatedBy: z.string(),\n\tpriceAmount: z.string(),\n\tpriceAmountFormatted: z.string(),\n\tpriceAmountNet: z.string(),\n\tpriceAmountNetFormatted: z.string(),\n\tpriceCurrencyAddress: z.string(),\n\tpriceDecimals: z.number(),\n\tpriceUSD: z.number(),\n\tquantityInitial: z.string(),\n\tquantityInitialFormatted: z.string(),\n\tquantityRemaining: z.string(),\n\tquantityRemainingFormatted: z.string(),\n\tquantityAvailable: z.string(),\n\tquantityAvailableFormatted: z.string(),\n\tquantityDecimals: z.number(),\n\tfeeBps: z.number(),\n\tfeeBreakdown: z.array(feeBreakdownSchema),\n\tvalidFrom: z.string(),\n\tvalidUntil: z.string(),\n\tblockNumber: z.number(),\n\torderCreatedAt: z.string().optional(),\n\torderUpdatedAt: z.string().optional(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().optional(),\n});\n\nexport const collectibleOrderSchema = z.object({\n\tmetadata: tokenMetadataSchema,\n\torder: orderSchema.optional(),\n});\n\nexport const activitySchema = z.object({\n\ttype: z.string(),\n\tfromAddress: z.string(),\n\ttoAddress: z.string(),\n\ttxHash: z.string(),\n\ttimestamp: z.number(),\n\ttokenId: z.string(),\n\ttokenImage: z.string(),\n\ttokenName: z.string(),\n\tcurrency: currencySchema.optional(),\n});\n\nexport const collectionConfigSchema = z.object({\n\tlastSynced: z.record(collectionLastSyncedSchema),\n\tcollectiblesSynced: z.string(),\n});\n\nexport const signatureSchema = z.object({\n\tdomain: domainSchema,\n\ttypes: z.any(),\n\tprimaryType: z.string(),\n\tvalue: z.any(),\n});\n\nexport const getCollectibleReturnSchema = z.object({\n\tmetadata: tokenMetadataSchema,\n});\n\nexport const getLowestPriceOfferForCollectibleReturnSchema = z.object({\n\torder: orderSchema,\n});\n\nexport const getHighestPriceOfferForCollectibleReturnSchema = z.object({\n\torder: orderSchema,\n});\n\nexport const getLowestPriceListingForCollectibleReturnSchema = z.object({\n\torder: orderSchema,\n});\n\nexport const getHighestPriceListingForCollectibleReturnSchema = z.object({\n\torder: orderSchema,\n});\n\nexport const listListingsForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listListingsForCollectibleReturnSchema = z.object({\n\tlistings: z.array(orderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const listOffersForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listOffersForCollectibleReturnSchema = z.object({\n\toffers: z.array(orderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const getCollectibleLowestOfferReturnSchema = z.object({\n\torder: orderSchema.optional(),\n});\n\nexport const getCollectibleHighestOfferReturnSchema = z.object({\n\torder: orderSchema.optional(),\n});\n\nexport const getCollectibleLowestListingReturnSchema = z.object({\n\torder: orderSchema.optional(),\n});\n\nexport const getCollectibleHighestListingReturnSchema = z.object({\n\torder: orderSchema.optional(),\n});\n\nexport const listCollectibleListingsArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectibleListingsReturnSchema = z.object({\n\tlistings: z.array(orderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectibleOffersArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectibleOffersReturnSchema = z.object({\n\toffers: z.array(orderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectiblesArgsSchema = z.object({\n\tside: orderSideSchema,\n\tcontractAddress: z.string(),\n\tfilter: collectiblesFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectiblesReturnSchema = z.object({\n\tcollectibles: z.array(collectibleOrderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const getFloorOrderReturnSchema = z.object({\n\tcollectible: collectibleOrderSchema,\n});\n\nexport const listCollectiblesWithLowestListingArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\tfilter: collectiblesFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectiblesWithLowestListingReturnSchema = z.object({\n\tcollectibles: z.array(collectibleOrderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectiblesWithHighestOfferArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\tfilter: collectiblesFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectiblesWithHighestOfferReturnSchema = z.object({\n\tcollectibles: z.array(collectibleOrderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const syncOrderArgsSchema = z.object({\n\torder: orderSchema,\n});\n\nexport const syncOrdersArgsSchema = z.object({\n\torders: z.array(orderSchema),\n});\n\nexport const getOrdersArgsSchema = z.object({\n\tinput: z.array(getOrdersInputSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const getOrdersReturnSchema = z.object({\n\torders: z.array(orderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const collectionSchema = z.object({\n\tstatus: collectionStatusSchema,\n\tchainId: z.number(),\n\tcontractAddress: z.string(),\n\tcontractType: contractTypeSchema,\n\ttokenQuantityDecimals: z.number(),\n\tconfig: collectionConfigSchema,\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().optional(),\n});\n\nexport const stepSchema = z.object({\n\tid: stepTypeSchema,\n\tdata: z.string(),\n\tto: z.string(),\n\tvalue: z.string(),\n\tsignature: signatureSchema.optional(),\n\tpost: postRequestSchema.optional(),\n\texecuteType: executeTypeSchema.optional(),\n});\n\nexport const generateBuyTransactionReturnSchema = z.object({\n\tsteps: z.array(stepSchema),\n});\n\nexport const generateSellTransactionReturnSchema = z.object({\n\tsteps: z.array(stepSchema),\n});\n\nexport const generateListingTransactionReturnSchema = z.object({\n\tsteps: z.array(stepSchema),\n});\n\nexport const generateOfferTransactionReturnSchema = z.object({\n\tsteps: z.array(stepSchema),\n});\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMetadataClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst UseCollectibleSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tcollectibleId: z.string(),\n\tquery: QueryArgSchema,\n});\n\nexport type UseCollectibleArgs = z.infer<typeof UseCollectibleSchema>;\n\nexport type UseCollectibleReturn = Awaited<ReturnType<typeof fetchCollectible>>;\n\nconst fetchCollectible = async (\n\targs: UseCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseCollectibleSchema.parse(args);\n\tconst metadataClient = getMetadataClient(config);\n\treturn metadataClient\n\t\t.getTokenMetadata({\n\t\t\tchainID: parsedArgs.chainId,\n\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t\ttokenIDs: [parsedArgs.collectibleId],\n\t\t})\n\t\t.then((resp) => resp.tokenMetadata[0]);\n};\n\nexport const collectibleOptions = (\n\targs: UseCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.details, args, config],\n\t\tqueryFn: () => fetchCollectible(args, config),\n\t});\n};\n\nexport const useCollectible = (args: UseCollectibleArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(collectibleOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectionKeys,\n\tgetMetadataClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst UseCollectionSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tquery: QueryArgSchema,\n});\n\nexport type UseCollectionArgs = z.input<typeof UseCollectionSchema>;\n\nexport type UseCollectionReturn = Awaited<ReturnType<typeof fetchCollection>>;\n\nconst fetchCollection = async (args: UseCollectionArgs, config: SdkConfig) => {\n\tconst parsedArgs = UseCollectionSchema.parse(args);\n\tconst metadataClient = getMetadataClient(config);\n\treturn metadataClient\n\t\t.getContractInfo({\n\t\t\tchainID: parsedArgs.chainId,\n\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t})\n\t\t.then((resp) => resp.contractInfo);\n};\n\nexport const collectionOptions = (\n\targs: UseCollectionArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectionKeys.detail, args, config],\n\t\tqueryFn: () => fetchCollection(args, config),\n\t});\n};\n\nexport const useCollection = (args: UseCollectionArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(collectionOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { MarketplaceConfig, SdkConfig } from '../../types';\nimport { CollectionNotFoundError } from '../../utils/_internal/error/transaction';\nimport {\n\tAddressSchema,\n\ttype ChainId,\n\tChainIdSchema,\n\ttype Currency,\n\tQueryArgSchema,\n\tconfigKeys,\n\tcurrencyKeys,\n\tgetMarketplaceClient,\n\tgetQueryClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst ChainIdCoerce = ChainIdSchema.transform((val) => val.toString());\n\nconst UseCurrenciesArgsSchema = z.object({\n\tchainId: ChainIdCoerce,\n\tcollectionAddress: AddressSchema.optional(),\n\tincludeNativeCurrency: z.boolean().optional(),\n\tquery: QueryArgSchema,\n});\n\ntype UseCurrenciesArgs = z.input<typeof UseCurrenciesArgsSchema>;\n\nexport type UseCurrenciesReturn = Awaited<ReturnType<typeof fetchCurrencies>>;\n\nconst fetchCurrencies = async (chainId: ChainId, config: SdkConfig) => {\n\tconst parsedChainId = ChainIdCoerce.parse(chainId);\n\tconst marketplaceClient = getMarketplaceClient(parsedChainId, config);\n\treturn marketplaceClient.listCurrencies().then((resp) => resp.currencies);\n};\n\nconst selectCurrencies = (data: Currency[], args: UseCurrenciesArgs) => {\n\tconst argsParsed = UseCurrenciesArgsSchema.parse(args);\n\t// if collectionAddress is passed, filter currencies based on collection currency options\n\tif (argsParsed.collectionAddress) {\n\t\tconst queryClient = getQueryClient();\n\t\tconst marketplaceConfigCache = queryClient.getQueriesData({\n\t\t\tqueryKey: configKeys.marketplace,\n\t\t})[0][1] as MarketplaceConfig;\n\n\t\tconst collection = marketplaceConfigCache?.collections.find(\n\t\t\t(collection) =>\n\t\t\t\tcollection.collectionAddress === argsParsed.collectionAddress,\n\t\t);\n\n\t\tif (!collection) {\n\t\t\tthrow new CollectionNotFoundError(argsParsed.collectionAddress!);\n\t\t}\n\n\t\treturn data.filter(\n\t\t\t(currency) =>\n\t\t\t\tcollection.currencyOptions?.includes(currency.contractAddress) ||\n\t\t\t\t// biome-ignore lint/suspicious/noDoubleEquals: <explanation>\n\t\t\t\tcurrency.nativeCurrency == argsParsed.includeNativeCurrency ||\n\t\t\t\tcurrency.defaultChainCurrency,\n\t\t);\n\t}\n\t// if includeNativeCurrency is true, return all currencies\n\tif (argsParsed.includeNativeCurrency) {\n\t\treturn data;\n\t}\n\n\t// if includeNativeCurrency is false or undefined, filter out native currencies\n\treturn data.filter((currency) => !currency.nativeCurrency);\n};\n\nexport const currenciesOptions = (\n\targs: UseCurrenciesArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...currencyKeys.lists, args.chainId],\n\t\tqueryFn: () => fetchCurrencies(args.chainId, config),\n\t\tselect: (data) => selectCurrencies(data, args),\n\t\tenabled: args.query?.enabled,\n\t});\n};\n\nexport const useCurrencies = (args: UseCurrenciesArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(currenciesOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\ttype ChainId,\n\tChainIdSchema,\n\ttype Currency,\n\tQueryArgSchema,\n\tcurrencyKeys,\n\tgetMarketplaceClient,\n\tgetQueryClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst ChainIdCoerce = ChainIdSchema.transform((val) => val.toString());\n\nconst UseCurrencyArgsSchema = z.object({\n\tchainId: ChainIdCoerce,\n\tcurrencyAddress: AddressSchema,\n\tquery: QueryArgSchema,\n});\n\ntype UseCurrencyArgs = z.input<typeof UseCurrencyArgsSchema>;\n\nexport type UseCurrencyReturn = Currency | undefined;\n\nconst fetchCurrency = async (\n\tchainId: ChainId,\n\tcurrencyAddress: string,\n\tconfig: SdkConfig,\n): Promise<Currency | undefined> => {\n\tconst parsedChainId = ChainIdCoerce.parse(chainId);\n\n\tconst queryClient = getQueryClient();\n\tlet currencies = queryClient.getQueryData([...currencyKeys.lists, chainId]) as\n\t\t| Currency[]\n\t\t| undefined;\n\n\tif (!currencies) {\n\t\tconst marketplaceClient = getMarketplaceClient(parsedChainId, config);\n\t\tcurrencies = await marketplaceClient\n\t\t\t.listCurrencies()\n\t\t\t.then((resp) => resp.currencies);\n\t}\n\n\treturn currencies?.find(\n\t\t(currency) =>\n\t\t\tcurrency.contractAddress.toLowerCase() === currencyAddress.toLowerCase(),\n\t);\n};\n\nexport const currencyOptions = (args: UseCurrencyArgs, config: SdkConfig) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...currencyKeys.details, args.chainId, args.currencyAddress],\n\t\tqueryFn: () => fetchCurrency(args.chainId, args.currencyAddress, config),\n\t});\n};\n\nexport const useCurrency = (args: UseCurrencyArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(currencyOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMetadataClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst UseFiltersSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tquery: QueryArgSchema,\n});\n\nexport type UseFiltersArgs = z.infer<typeof UseFiltersSchema>;\n\nexport type UseFilterReturn = Awaited<ReturnType<typeof fetchFilters>>;\n\nexport const fetchFilters = async (args: UseFiltersArgs, config: SdkConfig) => {\n\tconst parsedArgs = UseFiltersSchema.parse(args);\n\tconst metadataClient = getMetadataClient(config);\n\treturn metadataClient\n\t\t.tokenCollectionFilters({\n\t\t\tchainID: parsedArgs.chainId,\n\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t})\n\t\t.then((resp) => resp.filters);\n};\n\nexport const filtersOptions = (args: UseFiltersArgs, config: SdkConfig) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.filter, args, config],\n\t\tqueryFn: () => fetchFilters(args, config),\n\t});\n};\n\nexport const useFilters = (args: UseFiltersArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(filtersOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst UseFloorOrderSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tquery: QueryArgSchema,\n});\n\nexport type UseFloorOrderArgs = z.infer<typeof UseFloorOrderSchema>;\n\nexport type UseFloorOrderReturn = Awaited<ReturnType<typeof fetchFloorOrder>>;\n\nconst fetchFloorOrder = async (args: UseFloorOrderArgs, config: SdkConfig) => {\n\tconst marketplaceClient = getMarketplaceClient(args.chainId, config);\n\treturn marketplaceClient\n\t\t.getFloorOrder({ contractAddress: args.collectionAddress })\n\t\t.then((data) => data.collectible);\n};\n\nexport const floorOrderOptions = (\n\targs: UseFloorOrderArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\tqueryKey: [...collectableKeys.floorOrders, args, config],\n\t\tqueryFn: () => fetchFloorOrder(args, config),\n\t});\n};\n\nexport const useFloorOrder = (args: UseFloorOrderArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(floorOrderOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { getCollectibleHighestOfferArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseHighestOfferArgsSchema = getCollectibleHighestOfferArgsSchema\n\t.omit({\n\t\tcontractAddress: true,\n\t})\n\t.extend({\n\t\tcollectionAddress: AddressSchema,\n\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\tquery: QueryArgSchema,\n\t});\n\nexport type UseHighestOfferArgs = z.infer<typeof UseHighestOfferArgsSchema>;\n\nexport type UseHighestOfferReturn = Awaited<\n\tReturnType<typeof fetchHighestOffer>\n>;\n\nconst fetchHighestOffer = async (\n\targs: UseHighestOfferArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseHighestOfferArgsSchema.parse(args);\n\tconst marketplaceClient = getMarketplaceClient(parsedArgs.chainId, config);\n\treturn marketplaceClient.getCollectibleHighestOffer({\n\t\t...parsedArgs,\n\t\tcontractAddress: parsedArgs.collectionAddress,\n\t});\n};\n\nexport const highestOfferOptions = (\n\targs: UseHighestOfferArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.highestOffers, args, config],\n\t\tqueryFn: () => fetchHighestOffer(args, config),\n\t});\n};\n\nexport const useHighestOffer = (args: UseHighestOfferArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(highestOfferOptions(args, config));\n};\n","import { type Page, SortOrder } from '@0xsequence/indexer';\nimport { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tbalanceQueries,\n\tgetIndexerClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nexport const metadataOptionsSchema = z.object({\n\tverifiedOnly: z.boolean().optional(),\n\tunverifiedOnly: z.boolean().optional(),\n\tincludeContracts: z.array(z.string()).optional(),\n});\n\nconst sortOrderSchema = z.nativeEnum(SortOrder);\n\nconst sortBySchema = z.object({\n\tcolumn: z.string(),\n\torder: sortOrderSchema,\n});\n\nconst pageSchema = z.object({\n\tpage: z.number().optional(),\n\tcolumn: z.string().optional(),\n\tbefore: z.any().optional(),\n\tafter: z.any().optional(),\n\tsort: z.array(sortBySchema).optional(),\n\tpageSize: z.number().optional(),\n\tmore: z.boolean().optional(),\n});\n\nconst useListBalancesArgsSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.number()),\n\taccountAddress: AddressSchema.optional(),\n\tcontractAddress: AddressSchema.optional(),\n\ttokenId: z.string().optional(),\n\tincludeMetadata: z.boolean().optional(),\n\tmetadataOptions: metadataOptionsSchema.optional(),\n\tincludeCollectionTokens: z.boolean().optional(),\n\tpage: pageSchema.optional(),\n\tquery: QueryArgSchema,\n});\n\nexport type UseFetchTokenBalancesReturn = Awaited<\n\tReturnType<typeof fetchBalances>\n>;\n\nexport type UseListBalancesArgs = z.input<typeof useListBalancesArgsSchema>;\n\nconst fetchBalances = async (\n\targs: UseListBalancesArgs,\n\tconfig: SdkConfig,\n\tpage: Page,\n) => {\n\tconst parsedArgs = useListBalancesArgsSchema.parse(args);\n\tconst indexerClient = getIndexerClient(parsedArgs.chainId, config);\n\n\treturn indexerClient.getTokenBalances({\n\t\t...parsedArgs,\n\t\ttokenID: parsedArgs.tokenId,\n\t\tpage: page,\n\t});\n};\n\nexport const listBalancesOptions = (\n\targs: UseListBalancesArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn infiniteQueryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...balanceQueries.lists, args, config],\n\t\tqueryFn: ({ pageParam }) => fetchBalances(args, config, pageParam),\n\t\tinitialPageParam: { page: 1, pageSize: 30 } as Page,\n\t\tgetNextPageParam: (lastPage) => lastPage.page.after,\n\t});\n};\n\nexport const useListBalances = (args: UseListBalancesArgs) => {\n\tconst config = useConfig();\n\treturn useInfiniteQuery(listBalancesOptions(args, config));\n};\n","import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { Page, SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\ttype ListCollectiblesArgs,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { listCollectiblesArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseListCollectiblesArgsSchema = listCollectiblesArgsSchema\n\t.omit({\n\t\tcontractAddress: true,\n\t})\n\t.extend({\n\t\tcollectionAddress: AddressSchema,\n\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\tquery: QueryArgSchema,\n\t});\n\nexport type UseListCollectiblesArgs = z.infer<\n\ttypeof UseListCollectiblesArgsSchema\n>;\n\nexport type UseListCollectiblesReturn = Awaited<\n\tReturnType<typeof fetchCollectibles>\n>;\n\nconst fetchCollectibles = async (\n\targs: UseListCollectiblesArgs,\n\tmarketplaceClient: Awaited<ReturnType<typeof getMarketplaceClient>>,\n\tpage: Page,\n) => {\n\tconst parsedArgs = UseListCollectiblesArgsSchema.parse(args);\n\tconst arg = {\n\t\t...parsedArgs,\n\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\tpage: page,\n\t} satisfies ListCollectiblesArgs;\n\n\treturn marketplaceClient.listCollectibles(arg);\n};\n\nexport const listCollectiblesOptions = (\n\targs: UseListCollectiblesArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst marketplaceClient = getMarketplaceClient(args.chainId, config);\n\treturn infiniteQueryOptions({\n\t\tqueryKey: [...collectableKeys.lists, args],\n\t\tqueryFn: ({ pageParam }) =>\n\t\t\tfetchCollectibles(args, marketplaceClient, pageParam),\n\t\tinitialPageParam: { page: 1, pageSize: 30 },\n\t\tgetNextPageParam: (lastPage) =>\n\t\t\tlastPage.page?.more ? lastPage.page : undefined,\n\t});\n};\n\nexport const useListCollectibles = (args: UseListCollectiblesArgs) => {\n\tconst config = useConfig();\n\treturn useInfiniteQuery(listCollectiblesOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tChainIdSchema,\n\ttype ListOffersForCollectibleArgs,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { listOffersForCollectibleArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseListOffersForCollectibleArgsSchema = listOffersForCollectibleArgsSchema\n\t.extend({\n\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\tcollectionAddress: z.string(),\n\t\tcollectibleId: z.string(),\n\t})\n\t.omit({ contractAddress: true, tokenId: true });\n\ntype UseListOffersForCollectibleArgs = z.infer<\n\ttypeof UseListOffersForCollectibleArgsSchema\n>;\n\nexport type UseListOffersForCollectibleReturn = Awaited<\n\tReturnType<typeof fetchListOffersForCollectible>\n>;\n\nconst fetchListOffersForCollectible = async (\n\tconfig: SdkConfig,\n\targs: UseListOffersForCollectibleArgs,\n) => {\n\tconst arg = {\n\t\tcontractAddress: args.collectionAddress,\n\t\ttokenId: args.collectibleId,\n\t\tfilter: args.filter,\n\t\tpage: args.page,\n\t} satisfies ListOffersForCollectibleArgs;\n\n\tconst marketplaceClient = getMarketplaceClient(args.chainId, config);\n\treturn marketplaceClient.listCollectibleOffers(arg);\n};\n\nexport const listOffersForCollectibleOptions = (\n\targs: UseListOffersForCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\tqueryKey: [...collectableKeys.offers, args, config],\n\t\tqueryFn: () => fetchListOffersForCollectible(config, args),\n\t});\n};\n\nexport const useListOffersForCollectible = (\n\targs: UseListOffersForCollectibleArgs,\n) => {\n\tconst config = useConfig();\n\n\treturn useQuery(listOffersForCollectibleOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { countOffersForCollectibleArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseCountOffersForCollectibleArgsSchema =\n\tcountOffersForCollectibleArgsSchema\n\t\t.omit({\n\t\t\tcontractAddress: true,\n\t\t\ttokenId: true,\n\t\t})\n\t\t.extend({\n\t\t\tcollectionAddress: AddressSchema,\n\t\t\tcollectibleId: z.string(),\n\t\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\t\tquery: QueryArgSchema,\n\t\t});\n\nexport type UseCountOffersForCollectibleArgs = z.infer<\n\ttypeof UseCountOffersForCollectibleArgsSchema\n>;\n\nexport type UseCountOffersForCollectibleReturn = Awaited<\n\tReturnType<typeof fetchCountOffersForCollectible>\n>;\n\nconst fetchCountOffersForCollectible = async (\n\targs: UseCountOffersForCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseCountOffersForCollectibleArgsSchema.parse(args);\n\tconst marketplaceClient = getMarketplaceClient(parsedArgs.chainId, config);\n\treturn marketplaceClient.getCountOfOffersForCollectible({\n\t\t...parsedArgs,\n\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\ttokenId: parsedArgs.collectibleId,\n\t});\n};\n\nexport const countOffersForCollectibleOptions = (\n\targs: UseCountOffersForCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.offersCount, args, config],\n\t\tqueryFn: () => fetchCountOffersForCollectible(args, config),\n\t});\n};\n\nexport const useCountOffersForCollectible = (\n\targs: UseCountOffersForCollectibleArgs,\n) => {\n\tconst config = useConfig();\n\treturn useQuery(countOffersForCollectibleOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tChainIdSchema,\n\ttype ListListingsForCollectibleArgs,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { listListingsForCollectibleArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseListListingsForCollectibleArgsSchema =\n\tlistListingsForCollectibleArgsSchema\n\t\t.extend({\n\t\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\t\tcollectionAddress: z.string(),\n\t\t\tcollectibleId: z.string(),\n\t\t})\n\t\t.omit({ contractAddress: true, tokenId: true });\n\ntype UseListListingsForCollectibleArgs = z.infer<\n\ttypeof UseListListingsForCollectibleArgsSchema\n>;\n\nexport type UseListListingsForCollectibleReturn = Awaited<\n\tReturnType<typeof fetchListListingsForCollectible>\n>;\n\nconst fetchListListingsForCollectible = async (\n\tconfig: SdkConfig,\n\targs: UseListListingsForCollectibleArgs,\n) => {\n\tconst arg = {\n\t\tcontractAddress: args.collectionAddress,\n\t\ttokenId: args.collectibleId,\n\t\tfilter: args.filter,\n\t\tpage: args.page,\n\t} satisfies ListListingsForCollectibleArgs;\n\n\tconst marketplaceClient = getMarketplaceClient(args.chainId, config);\n\treturn marketplaceClient.listCollectibleListings(arg);\n};\n\nexport const listListingsForCollectibleOptions = (\n\targs: UseListListingsForCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\tqueryKey: [...collectableKeys.listings, args, config],\n\t\tqueryFn: () => fetchListListingsForCollectible(config, args),\n\t});\n};\n\nexport const useListListingsForCollectible = (\n\targs: UseListListingsForCollectibleArgs,\n) => {\n\tconst config = useConfig();\n\n\treturn useQuery(listListingsForCollectibleOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { countListingsForCollectibleArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseCountListingsForCollectibleArgsSchema =\n\tcountListingsForCollectibleArgsSchema\n\t\t.omit({\n\t\t\tcontractAddress: true,\n\t\t\ttokenId: true,\n\t\t})\n\t\t.extend({\n\t\t\tcollectionAddress: AddressSchema,\n\t\t\tcollectibleId: z.string(),\n\t\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\t\tquery: QueryArgSchema,\n\t\t});\n\nexport type UseCountListingsForCollectibleArgs = z.infer<\n\ttypeof UseCountListingsForCollectibleArgsSchema\n>;\n\nexport type UseCountListingsForCollectibleReturn = Awaited<\n\tReturnType<typeof fetchCountListingsForCollectible>\n>;\n\nconst fetchCountListingsForCollectible = async (\n\targs: UseCountListingsForCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseCountListingsForCollectibleArgsSchema.parse(args);\n\tconst marketplaceClient = getMarketplaceClient(parsedArgs.chainId, config);\n\treturn marketplaceClient.getCountOfListingsForCollectible({\n\t\t...parsedArgs,\n\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\ttokenId: parsedArgs.collectibleId,\n\t});\n};\n\nexport const countListingsForCollectibleOptions = (\n\targs: UseCountListingsForCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.listingsCount, args, config],\n\t\tqueryFn: () => fetchCountListingsForCollectible(args, config),\n\t});\n};\n\nexport const useCountListingsForCollectible = (\n\targs: UseCountListingsForCollectibleArgs,\n) => {\n\tconst config = useConfig();\n\treturn useQuery(countListingsForCollectibleOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { getCollectibleLowestListingArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseLowestListingSchema = getCollectibleLowestListingArgsSchema\n\t.omit({\n\t\tcontractAddress: true,\n\t})\n\t.extend({\n\t\tcollectionAddress: AddressSchema,\n\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\tquery: QueryArgSchema,\n\t});\n\nexport type UseLowestListingArgs = z.infer<typeof UseLowestListingSchema>;\n\nexport type UseLowestListingReturn = Awaited<\n\tReturnType<typeof fetchLowestListing>\n>;\n\nconst fetchLowestListing = async (\n\targs: UseLowestListingArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseLowestListingSchema.parse(args);\n\tconst marketplaceClient = getMarketplaceClient(parsedArgs.chainId, config);\n\treturn marketplaceClient.getCollectibleLowestListing({\n\t\t...parsedArgs,\n\t\tcontractAddress: parsedArgs.collectionAddress,\n\t});\n};\n\nexport const lowestListingOptions = (\n\targs: UseLowestListingArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.lowestListings, args, config],\n\t\tqueryFn: () => fetchLowestListing(args, config),\n\t});\n};\n\nexport const useLowestListing = (args: UseLowestListingArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(lowestListingOptions(args, config));\n};\n","import { useQuery } from '@tanstack/react-query';\nimport { marketplaceConfigOptions } from './options/marketplaceConfigOptions';\nimport { useConfig } from './useConfig';\n\nexport * from './options/marketplaceConfigOptions';\n\nexport const useMarketplaceConfig = () => {\n\tconst config = useConfig();\n\treturn useQuery(marketplaceConfigOptions(config));\n};\n","import { queryOptions } from '@tanstack/react-query';\nimport type { Env, MarketplaceConfig, SdkConfig } from '../../../types';\nimport {\n\tMarketplaceConfigFetchError,\n\tProjectNotFoundError,\n} from '../../../utils/_internal/error/transaction';\nimport { builderMarketplaceApi, configKeys } from '../../_internal';\n\nconst fetchBuilderConfig = async (projectId: string, env: Env) => {\n\tconst url = `${builderMarketplaceApi(projectId, env)}`;\n\tconst response = await fetch(`${url}/config.json`);\n\n\tconst json = await response.json();\n\tif (!response.ok) {\n\t\tconsole.error('Failed to fetch marketplace config:', response.status, json);\n\t\t//@ts-ignore\n\t\tswitch (json.code) {\n\t\t\tcase 3000: // Throws 3000 if the project is not found\n\t\t\t\tthrow new ProjectNotFoundError(projectId, url);\n\t\t\tdefault:\n\t\t\t\t//@ts-ignore\n\t\t\t\tthrow new MarketplaceConfigFetchError(json.msg);\n\t\t}\n\t}\n\treturn json as MarketplaceConfig;\n};\n\nconst fetchStyles = async (projectId: string, env: Env) => {\n\tconst response = await fetch(\n\t\t`${builderMarketplaceApi(projectId, env)}/styles.css`,\n\t);\n\tconst styles = await response.text();\n\t// React sanitizes this string, so we need to remove all quotes, they are not needed anyway\n\treturn styles.replaceAll(/['\"]/g, '');\n};\n\nconst fetchMarketplaceConfig = async (\n\tenv: Env,\n\tprojectId: string,\n): Promise<MarketplaceConfig> => {\n\tconst [marketplaceConfig, cssString] = await Promise.all([\n\t\tfetchBuilderConfig(projectId, env),\n\t\tfetchStyles(projectId, env),\n\t]);\n\n\treturn {\n\t\t...marketplaceConfig,\n\t\tcssString,\n\t\tmanifestUrl: `${builderMarketplaceApi(projectId, env)}/manifest.json`,\n\t};\n};\n\nexport const marketplaceConfigOptions = (\n\tconfig: Pick<SdkConfig, 'projectId'> | SdkConfig,\n) => {\n\tlet env: Env = 'production';\n\tif ('_internal' in config && config._internal !== undefined) {\n\t\tenv = config._internal.builderEnv ?? env;\n\t}\n\n\tconst projectId = config.projectId;\n\treturn queryOptions({\n\t\tqueryKey: [...configKeys.marketplace, env, projectId],\n\t\tqueryFn: () => fetchMarketplaceConfig(env, projectId),\n\t});\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport type { Hex } from 'viem';\nimport { getContract } from 'viem';\nimport { z } from 'zod';\nimport { EIP2981_ABI } from '../../utils';\nimport { getPublicRpcClient } from '../../utils/get-public-rpc-client';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n} from '../_internal';\n\nconst UseRoyaletyPercentageSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tcollectibleId: z.string(),\n\tquery: QueryArgSchema,\n});\n\ntype UseRoyaletyPercentageArgs = z.infer<typeof UseRoyaletyPercentageSchema>;\n\nconst fetchRoyaletyPercentage = async (args: UseRoyaletyPercentageArgs) => {\n\tconst parsedArgs = UseRoyaletyPercentageSchema.parse(args);\n\tconst publicClient = getPublicRpcClient(parsedArgs.chainId);\n\n\tconst contract = getContract({\n\t\taddress: parsedArgs.collectionAddress as Hex,\n\t\tabi: EIP2981_ABI,\n\t\tclient: publicClient,\n\t});\n\n\ttry {\n\t\tconst [_, royaltyPercentage] = await contract.read.royaltyInfo([\n\t\t\tBigInt(args.collectibleId),\n\t\t\t100n,\n\t\t]);\n\n\t\treturn royaltyPercentage;\n\t} catch {\n\t\t//TODO: dont swallow errors\n\t\treturn 0n;\n\t}\n};\n\nexport const royaletyPercentageOptions = (args: UseRoyaletyPercentageArgs) =>\n\tqueryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.royaltyPercentage, args],\n\t\tqueryFn: () => fetchRoyaletyPercentage(args),\n\t});\n\nexport const useRoyaltyPercentage = (args: UseRoyaletyPercentageArgs) => {\n\treturn useQuery(royaletyPercentageOptions(args));\n};\n","import { useMutation } from '@tanstack/react-query';\nimport { useConfig } from './useConfig';\n\nexport type UseGenerateListingTransactionArgs = {\n\tchainId: ChainId;\n\tonSuccess?: (data?: Step[]) => void;\n};\n\nimport type { SdkConfig } from '../../types';\nimport {\n\ttype ChainId,\n\ttype CreateReq,\n\ttype GenerateListingTransactionArgs,\n\ttype Step,\n\tgetMarketplaceClient,\n} from '../_internal';\n\nexport type CreateReqWithDateExpiry = Omit<CreateReq, 'expiry'> & {\n\texpiry: Date;\n};\n\nexport type GenerateListingTransactionProps = Omit<\n\tGenerateListingTransactionArgs,\n\t'listing'\n> & {\n\tlisting: CreateReqWithDateExpiry;\n};\n\nconst dateToUnixTime = (date: Date) =>\n\tMath.floor(date.getTime() / 1000).toString();\n\nexport const generateListingTransaction = async (\n\tparams: GenerateListingTransactionProps,\n\tconfig: SdkConfig,\n\tchainId: ChainId,\n) => {\n\tconst args = {\n\t\t...params,\n\t\tlisting: {\n\t\t\t...params.listing,\n\t\t\texpiry: dateToUnixTime(params.listing.expiry),\n\t\t},\n\t} satisfies GenerateListingTransactionArgs;\n\tconst marketplaceClient = getMarketplaceClient(chainId, config);\n\treturn (await marketplaceClient.generateListingTransaction(args)).steps;\n};\n\nexport const useGenerateListingTransaction = (\n\tparams: UseGenerateListingTransactionArgs,\n) => {\n\tconst config = useConfig();\n\n\tconst { mutate, mutateAsync, ...result } = useMutation({\n\t\tonSuccess: params.onSuccess,\n\t\tmutationFn: (args: GenerateListingTransactionProps) =>\n\t\t\tgenerateListingTransaction(args, config, params.chainId),\n\t});\n\n\treturn {\n\t\t...result,\n\t\tgenerateListingTransaction: mutate,\n\t\tgenerateListingTransactionAsync: mutateAsync,\n\t};\n};\n","import { useMutation } from '@tanstack/react-query';\nimport type { SdkConfig } from '../../types';\nimport {\n\ttype ChainId,\n\ttype CreateReq,\n\ttype GenerateOfferTransactionArgs,\n\ttype Step,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nexport type UseGenerateOfferTransactionArgs = {\n\tchainId: ChainId;\n\tonSuccess?: (data?: Step[]) => void;\n};\n\ntype CreateReqWithDateExpiry = Omit<CreateReq, 'expiry'> & {\n\texpiry: Date;\n};\n\nexport type GenerateOfferTransactionProps = Omit<\n\tGenerateOfferTransactionArgs,\n\t'offer'\n> & {\n\toffer: CreateReqWithDateExpiry;\n};\n\nconst dateToUnixTime = (date: Date) =>\n\tMath.floor(date.getTime() / 1000).toString();\n\nexport const generateOfferTransaction = async (\n\tparams: GenerateOfferTransactionProps,\n\tconfig: SdkConfig,\n\tchainId: ChainId,\n) => {\n\tconst args = {\n\t\t...params,\n\t\toffer: { ...params.offer, expiry: dateToUnixTime(params.offer.expiry) },\n\t} satisfies GenerateOfferTransactionArgs;\n\tconst marketplaceClient = getMarketplaceClient(chainId, config);\n\treturn (await marketplaceClient.generateOfferTransaction(args)).steps;\n};\n\nexport const useGenerateOfferTransaction = (\n\tparams: UseGenerateOfferTransactionArgs,\n) => {\n\tconst config = useConfig();\n\n\tconst { mutate, mutateAsync, ...result } = useMutation({\n\t\tonSuccess: params.onSuccess,\n\t\tmutationFn: (args: GenerateOfferTransactionProps) =>\n\t\t\tgenerateOfferTransaction(args, config, params.chainId),\n\t});\n\n\treturn {\n\t\t...result,\n\t\tgenerateOfferTransaction: mutate,\n\t\tgenerateOfferTransactionAsync: mutateAsync,\n\t};\n};\n","import { useMutation } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\ttype ChainId,\n\tChainIdSchema,\n\ttype GenerateSellTransactionArgs,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { stepSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UserGeneratSellTransactionArgsSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tonSuccess: z.function().args(stepSchema.array().optional()).optional(),\n});\n\ntype UseGenerateSellTransactionArgs = z.infer<\n\ttypeof UserGeneratSellTransactionArgsSchema\n>;\n\nexport const generateSellTransaction = async (\n\targs: GenerateSellTransactionArgs,\n\tconfig: SdkConfig,\n\tchainId: ChainId,\n) => {\n\tconst parsedChainId = ChainIdSchema.pipe(z.coerce.string()).parse(chainId);\n\tconst marketplaceClient = getMarketplaceClient(parsedChainId, config);\n\treturn marketplaceClient\n\t\t.generateSellTransaction(args)\n\t\t.then((data) => data.steps);\n};\n\nexport const useGenerateSellTransaction = (\n\tparams: UseGenerateSellTransactionArgs,\n) => {\n\tconst config = useConfig();\n\n\tconst { mutate, mutateAsync, ...result } = useMutation({\n\t\tonSuccess: params.onSuccess,\n\t\tmutationFn: (args: GenerateSellTransactionArgs) =>\n\t\t\tgenerateSellTransaction(args, config, params.chainId),\n\t});\n\n\treturn {\n\t\t...result,\n\t\tgenerateSellTransaction: mutate,\n\t\tgenerateSellTransactionAsync: mutateAsync,\n\t};\n};\n","import { useMutation } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\ttype ChainId,\n\tChainIdSchema,\n\ttype GenerateCancelTransactionArgs,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { stepSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UserGenerateCancelTransactionArgsSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tonSuccess: z.function().args(stepSchema.array().optional()).optional(),\n});\n\ntype UseGenerateCancelTransactionArgs = z.infer<\n\ttypeof UserGenerateCancelTransactionArgsSchema\n>;\n\nexport const generateCancelTransaction = async (\n\targs: GenerateCancelTransactionArgs,\n\tconfig: SdkConfig,\n\tchainId: ChainId,\n) => {\n\tconst parsedChainId = ChainIdSchema.pipe(z.coerce.string()).parse(chainId);\n\tconst marketplaceClient = getMarketplaceClient(parsedChainId, config);\n\treturn marketplaceClient\n\t\t.generateCancelTransaction(args)\n\t\t.then((data) => data.steps);\n};\n\nexport const useGenerateCancelTransaction = (\n\tparams: UseGenerateCancelTransactionArgs,\n) => {\n\tconst config = useConfig();\n\n\tconst { mutate, mutateAsync, ...result } = useMutation({\n\t\tonSuccess: params.onSuccess,\n\t\tmutationFn: (args: GenerateCancelTransactionArgs) =>\n\t\t\tgenerateCancelTransaction(args, config, params.chainId),\n\t});\n\n\treturn {\n\t\t...result,\n\t\tgenerateCancelTransaction: mutate,\n\t\tgenerateCancelTransactionAsync: mutateAsync,\n\t};\n};\n","import { type Abi, type Address, type Hex, erc721Abi } from 'viem';\nimport { useAccount, useWriteContract } from 'wagmi';\nimport { ERC1155_ABI } from '../../utils';\nimport { NoWalletConnectedError } from '../../utils/_internal/error/transaction';\nimport type { ChainId, ContractType } from '../_internal';\n\ninterface BaseTransferParams {\n\tchainId: ChainId;\n\tcollectionAddress: Hex;\n\ttokenId: string;\n\treceiverAddress: Address;\n}\n\ninterface ERC721TransferParams extends BaseTransferParams {\n\tcontractType: ContractType.ERC721;\n}\n\ninterface ERC1155TransferParams extends BaseTransferParams {\n\tcontractType: ContractType.ERC1155;\n\tquantity: string;\n}\n\nexport type TransferTokensParams = ERC721TransferParams | ERC1155TransferParams;\n\nconst prepareTransferConfig = (\n\tparams: TransferTokensParams,\n\taccountAddress: Address,\n) => {\n\tif (params.contractType === 'ERC721') {\n\t\treturn {\n\t\t\tabi: erc721Abi as Abi,\n\t\t\taddress: params.collectionAddress,\n\t\t\tfunctionName: 'safeTransferFrom',\n\t\t\targs: [\n\t\t\t\taccountAddress,\n\t\t\t\tparams.receiverAddress,\n\t\t\t\tBigInt(params.tokenId),\n\t\t\t] as const,\n\t\t} as const;\n\t}\n\n\treturn {\n\t\tabi: ERC1155_ABI as Abi,\n\t\taddress: params.collectionAddress,\n\t\tfunctionName: 'safeTransferFrom',\n\t\targs: [\n\t\t\taccountAddress,\n\t\t\tparams.receiverAddress,\n\t\t\tBigInt(params.tokenId),\n\t\t\tparams.quantity,\n\t\t\t'0x', // data\n\t\t] as const,\n\t};\n};\n\nexport const useTransferTokens = () => {\n\tconst { address: accountAddress } = useAccount();\n\tconst {\n\t\twriteContractAsync,\n\t\tdata: hash,\n\t\tisPending,\n\t\tisError,\n\t\tisSuccess,\n\t} = useWriteContract();\n\n\tconst transferTokensAsync = async (params: TransferTokensParams) => {\n\t\tif (!accountAddress) {\n\t\t\tthrow new NoWalletConnectedError();\n\t\t}\n\n\t\tconst config = prepareTransferConfig(params, accountAddress);\n\t\treturn await writeContractAsync(config);\n\t};\n\n\treturn {\n\t\ttransferTokensAsync,\n\t\thash,\n\t\ttransferring: isPending,\n\t\ttransferFailed: isError,\n\t\ttransferSuccess: isSuccess,\n\t};\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport type { Hex } from 'viem';\nimport { useAccount } from 'wagmi';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tMarketplaceKind,\n\tQueryArgSchema,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst UseCheckoutOptionsSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\torders: z.array(\n\t\tz.object({\n\t\t\tcollectionAddress: AddressSchema,\n\t\t\torderId: z.string(),\n\t\t\tmarketplace: z.nativeEnum(MarketplaceKind),\n\t\t}),\n\t),\n\tquery: QueryArgSchema,\n});\n\nexport type UseCheckoutOptionsArgs = z.infer<typeof UseCheckoutOptionsSchema>;\n\nexport type UseCheckoutOptionsReturn = Awaited<\n\tReturnType<typeof fetchCheckoutOptions>\n>;\n\nconst fetchCheckoutOptions = async (\n\targs: UseCheckoutOptionsArgs & { walletAddress: Hex },\n\tconfig: SdkConfig,\n) => {\n\tconst marketplaceClient = getMarketplaceClient(args.chainId, config);\n\treturn marketplaceClient.checkoutOptionsMarketplace({\n\t\twallet: args.walletAddress,\n\t\torders: args.orders.map((order) => ({\n\t\t\tcontractAddress: order.collectionAddress,\n\t\t\torderId: order.orderId,\n\t\t\tmarketplace: order.marketplace,\n\t\t})),\n\t\tadditionalFee: 0, //TODO: add additional fee\n\t});\n};\n\nexport const checkoutOptionsOptions = (\n\targs: UseCheckoutOptionsArgs & { walletAddress: Hex },\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\tqueryKey: ['checkoutOptions', args],\n\t\tqueryFn: () => fetchCheckoutOptions(args, config),\n\t});\n};\n\nexport const useCheckoutOptions = (args: UseCheckoutOptionsArgs) => {\n\tconst { address } = useAccount();\n\tconst config = useConfig();\n\treturn useQuery(\n\t\t// biome-ignore lint/style/noNonNullAssertion: <explanation>\n\t\tcheckoutOptionsOptions({ walletAddress: address!, ...args }, config),\n\t);\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { MarketplaceConfig, SdkConfig } from '../../types';\nimport {\n\tQueryArgSchema,\n\tcollectionKeys,\n\tgetMetadataClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\nimport { useMarketplaceConfig } from './useMarketplaceConfig';\n\nconst UseListCollectionsSchema = z.object({\n\tquery: QueryArgSchema.optional().default({}),\n});\n\nexport type UseListCollectionsArgs = z.input<typeof UseListCollectionsSchema>;\n\nexport type UseListCollectionsReturn = Awaited<\n\tReturnType<typeof fetchListCollections>\n>;\n\ntype FetchListCollectionsArgs = {\n\tmarketplaceConfig: MarketplaceConfig;\n\tquery?: z.infer<typeof QueryArgSchema>;\n};\n\nconst fetchListCollections = async (\n\t{ marketplaceConfig }: FetchListCollectionsArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst metadataClient = getMetadataClient(config);\n\n\tif (!marketplaceConfig?.collections?.length) {\n\t\treturn [];\n\t}\n\n\t// Group collections by chainId\n\tconst collectionsByChain = marketplaceConfig.collections.reduce<\n\t\tRecord<string, string[]>\n\t>((acc, curr) => {\n\t\tconst { chainId, collectionAddress } = curr;\n\t\tif (!acc[chainId]) {\n\t\t\tacc[chainId] = [];\n\t\t}\n\t\tacc[chainId].push(collectionAddress);\n\t\treturn acc;\n\t}, {});\n\n\t// Fetch collections for each chain\n\tconst promises = Object.entries(collectionsByChain).map(\n\t\t([chainId, addresses]) =>\n\t\t\tmetadataClient\n\t\t\t\t.getContractInfoBatch({\n\t\t\t\t\tchainID: chainId,\n\t\t\t\t\tcontractAddresses: addresses,\n\t\t\t\t})\n\t\t\t\t.then((resp) => Object.values(resp.contractInfoMap)),\n\t);\n\n\tconst results = await Promise.all(promises);\n\treturn results.flat();\n};\n\nexport const listCollectionsOptions = (\n\targs: FetchListCollectionsArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectionKeys.list],\n\t\tqueryFn: () => fetchListCollections(args, config),\n\t});\n};\n\nexport const useListCollections = (args: UseListCollectionsArgs = {}) => {\n\tconst config = useConfig();\n\tconst { data: marketplaceConfig, isLoading: isLoadingConfig } =\n\t\tuseMarketplaceConfig();\n\n\treturn useQuery({\n\t\t...listCollectionsOptions(\n\t\t\t// biome-ignore lint/style/noNonNullAssertion: <explanation>\n\t\t\t{ marketplaceConfig: marketplaceConfig!, query: args.query },\n\t\t\tconfig,\n\t\t),\n\t\tenabled: !isLoadingConfig && !!marketplaceConfig,\n\t});\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport type { Hex } from 'viem';\nimport { useAccount } from 'wagmi';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tMarketplaceKind,\n\tQueryArgSchema,\n\tWalletKind,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nexport const UseGenerateBuyTransactionArgsSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tmarketplace: z.nativeEnum(MarketplaceKind),\n\tordersData: z.array(\n\t\tz.object({\n\t\t\torderId: z.string(),\n\t\t\tquantity: z.string(),\n\t\t\tmarketplace: z.string(),\n\t\t}),\n\t),\n\twalletType: z.nativeEnum(WalletKind).optional(),\n\tquery: QueryArgSchema,\n});\n\ntype UseGenerateBuyTransactionArgs = z.infer<\n\ttypeof UseGenerateBuyTransactionArgsSchema\n>;\n\nexport const fetchGenerateBuyTransaction = async (\n\targs: UseGenerateBuyTransactionArgs & { buyer: Hex },\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseGenerateBuyTransactionArgsSchema.parse(args);\n\tconst marketplaceClient = getMarketplaceClient(parsedArgs.chainId, config);\n\n\treturn marketplaceClient\n\t\t.generateBuyTransaction({\n\t\t\t...parsedArgs,\n\t\t\tbuyer: args.buyer,\n\t\t\tadditionalFees: [], // TODO: Add additional fees\n\t\t})\n\t\t.then((data) => data.steps);\n};\n\nexport const generateBuyTransactionOptions = (\n\targs: UseGenerateBuyTransactionArgs & { buyer: Hex },\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\tqueryKey: ['generateBuyTransaction', args],\n\t\tqueryFn: () => fetchGenerateBuyTransaction(args, config),\n\t\t...args.query,\n\t});\n};\n\nexport const useGenerateBuyTransaction = (\n\targs: UseGenerateBuyTransactionArgs,\n) => {\n\tconst { address } = useAccount();\n\tconst config = useConfig();\n\treturn useQuery(\n\t\t// biome-ignore lint/style/noNonNullAssertion: <explanation>\n\t\tgenerateBuyTransactionOptions({ buyer: address!, ...args }, config),\n\t);\n};\n","import type { SelectPaymentSettings } from '@0xsequence/kit-checkout';\nimport type {\n\tChain,\n\tHash,\n\tHex,\n\tPublicClient,\n\tTypedDataDomain,\n\tWalletClient,\n} from 'viem';\nimport { avalanche, optimism } from 'viem/chains';\nimport {\n\ttype AdditionalFee,\n\ttype SequenceMarketplace,\n\tTransactionSwapProvider,\n\ttype WalletKind,\n\tWebrpcError,\n\tgetMarketplaceClient,\n} from '..';\nimport {\n\ttype ContractType,\n\ttype CreateReq,\n\tExecuteType,\n\ttype MarketplaceConfig,\n\ttype MarketplaceKind,\n\tOrderbookKind,\n\ttype SdkConfig,\n\ttype Step,\n\tStepType,\n} from '../../../types';\nimport {\n\tChainIdUnavailableError,\n\tChainSwitchError,\n\tCheckoutOptionsError,\n\tInvalidSignatureStepError,\n\tMissingPostStepError,\n\tMissingSignatureDataError,\n\tMissingStepDataError,\n\tNoExecutionStepError,\n\tNoStepsFoundError,\n\tNoWalletConnectedError,\n\tOrderNotFoundError,\n\tOrdersFetchError,\n\tPaymentModalError,\n\tPaymentModalTransactionError,\n\tStepExecutionError,\n\tStepGenerationError,\n\tTransactionError,\n\tTransactionReceiptError,\n\tUnexpectedStepsError,\n\tUnknownTransactionTypeError,\n} from '../../../utils/_internal/error/transaction';\nimport { type TransactionLogger, createLogger } from './logger';\n\nexport enum TransactionState {\n\tIDLE = 'IDLE',\n\tSWITCH_CHAIN = 'SWITCH_CHAIN',\n\tCHECKING_STEPS = 'CHECKING_STEPS',\n\tTOKEN_APPROVAL = 'TOKEN_APPROVAL',\n\tEXECUTING_TRANSACTION = 'EXECUTING_TRANSACTION',\n\tCONFIRMING = 'CONFIRMING',\n\tSUCCESS = 'SUCCESS',\n\tERROR = 'ERROR',\n}\n\nexport enum TransactionType {\n\tBUY = 'BUY',\n\tSELL = 'SELL',\n\tLISTING = 'LISTING',\n\tOFFER = 'OFFER',\n\tTRANSFER = 'TRANSFER',\n\tCANCEL = 'CANCEL',\n}\n\nexport interface TransactionConfig {\n\ttype: TransactionType;\n\twalletKind: WalletKind;\n\tchainId: string;\n\tchains: readonly Chain[];\n\tcollectionAddress: string;\n\tsdkConfig: SdkConfig;\n\tmarketplaceConfig: MarketplaceConfig;\n\tisWaaS: boolean;\n}\n\ninterface StateConfig {\n\tconfig: TransactionConfig;\n\tonTransactionSent?: (hash: Hash) => void;\n\tonSuccess?: (hash: Hash) => void;\n}\n\nexport interface BuyInput {\n\torderId: string;\n\tcollectableDecimals: number;\n\tmarketplace: MarketplaceKind;\n\tquantity: string;\n}\n\nexport interface SellInput {\n\torderId: string;\n\tmarketplace: MarketplaceKind;\n\tquantity?: string;\n}\n\nexport interface ListingInput {\n\tcontractType: ContractType;\n\tlisting: CreateReq;\n}\n\nexport interface OfferInput {\n\tcontractType: ContractType;\n\toffer: CreateReq;\n}\n\nexport interface CancelInput {\n\torderId: string;\n\tmarketplace: MarketplaceKind;\n}\n\nexport type Input =\n\t| BuyInput\n\t| SellInput\n\t| ListingInput\n\t| OfferInput\n\t| CancelInput;\n\ntype TransactionInput =\n\t| {\n\t\t\ttype: TransactionType.BUY;\n\t\t\tprops: BuyInput;\n\t }\n\t| {\n\t\t\ttype: TransactionType.SELL;\n\t\t\tprops: SellInput;\n\t }\n\t| {\n\t\t\ttype: TransactionType.LISTING;\n\t\t\tprops: ListingInput;\n\t }\n\t| {\n\t\t\ttype: TransactionType.OFFER;\n\t\t\tprops: OfferInput;\n\t }\n\t| {\n\t\t\ttype: TransactionType.CANCEL;\n\t\t\tprops: CancelInput;\n\t };\n\ninterface TransactionStep {\n\tisPending: boolean;\n\tisExecuting: boolean;\n}\n\nexport interface TransactionSteps {\n\tswitchChain: TransactionStep & {\n\t\texecute: () => Promise<void>;\n\t};\n\tapproval: TransactionStep & {\n\t\texecute: () =>\n\t\t\t| Promise<{ hash: Hash } | undefined>\n\t\t\t| Promise<void>\n\t\t\t| undefined;\n\t};\n\ttransaction: TransactionStep & {\n\t\texecute: () => Promise<{ hash: Hash } | undefined> | Promise<void>;\n\t};\n}\n\nexport class TransactionMachine {\n\tprivate currentState: TransactionState;\n\tprivate readonly logger: TransactionLogger;\n\tprivate marketplaceClient: SequenceMarketplace;\n\tprivate memoizedSteps: TransactionSteps | null = null;\n\tprivate lastProps: Input | null = null;\n\n\tconstructor(\n\t\tprivate readonly config: StateConfig,\n\t\tprivate readonly walletClient: WalletClient,\n\t\tprivate readonly publicClient: PublicClient,\n\t\tprivate readonly openSelectPaymentModal: (\n\t\t\tsettings: SelectPaymentSettings,\n\t\t) => void,\n\t\tprivate readonly switchChainFn: (chainId: string) => Promise<void>,\n\t) {\n\t\tthis.currentState = TransactionState.IDLE;\n\t\tthis.logger = createLogger('TransactionMachine');\n\t\tthis.marketplaceClient = getMarketplaceClient(\n\t\t\tconfig.config.chainId,\n\t\t\tconfig.config.sdkConfig,\n\t\t);\n\t}\n\n\tprivate getAccount() {\n\t\tconst account = this.walletClient.account;\n\t\tif (!account) {\n\t\t\tthrow new NoWalletConnectedError();\n\t\t}\n\t\treturn account;\n\t}\n\n\tprivate getMarketplaceFee(collectionAddress: string) {\n\t\tconst defaultFee = 2.5;\n\t\tconst defaultPlatformFeeRecipient =\n\t\t\t'0x858dB1cbF6D09D447C96A11603189b49B2D1C219';\n\t\tconst avalancheAndOptimismPlatformFeeRecipient =\n\t\t\t'0x400cdab4676c17aec07e8ec748a5fc3b674bca41';\n\t\tconst collection = this.config.config.marketplaceConfig.collections.find(\n\t\t\t(collection) =>\n\t\t\t\tcollection.collectionAddress.toLowerCase() ===\n\t\t\t\t\tcollectionAddress.toLowerCase() &&\n\t\t\t\tthis.getChainId() === Number(collection.chainId),\n\t\t);\n\n\t\tconst avalancheOrOptimism =\n\t\t\tthis.getChainId() === avalanche.id || this.getChainId() === optimism.id;\n\t\tconst receiver = avalancheOrOptimism\n\t\t\t? avalancheAndOptimismPlatformFeeRecipient\n\t\t\t: defaultPlatformFeeRecipient;\n\n\t\tconst percentageToBPS = (percentage: string | number) =>\n\t\t\t(Number(percentage) * 10000) / 100;\n\n\t\treturn {\n\t\t\tamount: percentageToBPS(\n\t\t\t\tcollection?.marketplaceFeePercentage || defaultFee,\n\t\t\t).toString(),\n\t\t\treceiver,\n\t\t} satisfies AdditionalFee;\n\t}\n\n\tprivate getAccountAddress() {\n\t\treturn this.getAccount().address;\n\t}\n\n\tprivate async generateSteps({\n\t\ttype,\n\t\tprops,\n\t}: TransactionInput): Promise<Step[]> {\n\t\tthis.logger.debug('Generating steps', { type, props });\n\t\tconst { collectionAddress } = this.config.config;\n\t\tconst address = this.getAccountAddress();\n\n\t\ttry {\n\t\t\tswitch (type) {\n\t\t\t\tcase TransactionType.BUY:\n\t\t\t\t\treturn await this.marketplaceClient\n\t\t\t\t\t\t.generateBuyTransaction({\n\t\t\t\t\t\t\tcollectionAddress,\n\t\t\t\t\t\t\tbuyer: address,\n\t\t\t\t\t\t\twalletType: this.config.config.walletKind,\n\t\t\t\t\t\t\tmarketplace: props.marketplace,\n\t\t\t\t\t\t\tordersData: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\torderId: props.orderId,\n\t\t\t\t\t\t\t\t\tquantity: props.quantity || '1',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\tadditionalFees: [this.getMarketplaceFee(collectionAddress)],\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.then((resp) => resp.steps);\n\n\t\t\t\tcase TransactionType.SELL:\n\t\t\t\t\treturn await this.marketplaceClient\n\t\t\t\t\t\t.generateSellTransaction({\n\t\t\t\t\t\t\tcollectionAddress,\n\t\t\t\t\t\t\tseller: address,\n\t\t\t\t\t\t\twalletType: this.config.config.walletKind,\n\t\t\t\t\t\t\tmarketplace: props.marketplace,\n\t\t\t\t\t\t\tordersData: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\torderId: props.orderId,\n\t\t\t\t\t\t\t\t\tquantity: props.quantity || '1',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\tadditionalFees: [],\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.then((resp) => resp.steps);\n\n\t\t\t\tcase TransactionType.LISTING:\n\t\t\t\t\treturn await this.marketplaceClient\n\t\t\t\t\t\t.generateListingTransaction({\n\t\t\t\t\t\t\tcollectionAddress,\n\t\t\t\t\t\t\towner: address,\n\t\t\t\t\t\t\twalletType: this.config.config.walletKind,\n\t\t\t\t\t\t\tcontractType: props.contractType,\n\t\t\t\t\t\t\torderbook: OrderbookKind.sequence_marketplace_v2,\n\t\t\t\t\t\t\tlisting: props.listing,\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.then((resp) => resp.steps);\n\n\t\t\t\tcase TransactionType.OFFER:\n\t\t\t\t\treturn await this.marketplaceClient\n\t\t\t\t\t\t.generateOfferTransaction({\n\t\t\t\t\t\t\tcollectionAddress,\n\t\t\t\t\t\t\tmaker: address,\n\t\t\t\t\t\t\twalletType: this.config.config.walletKind,\n\t\t\t\t\t\t\tcontractType: props.contractType,\n\t\t\t\t\t\t\torderbook: OrderbookKind.sequence_marketplace_v2,\n\t\t\t\t\t\t\toffer: props.offer,\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.then((resp) => resp.steps);\n\n\t\t\t\tcase TransactionType.CANCEL:\n\t\t\t\t\treturn await this.marketplaceClient\n\t\t\t\t\t\t.generateCancelTransaction({\n\t\t\t\t\t\t\tcollectionAddress,\n\t\t\t\t\t\t\tmaker: address,\n\t\t\t\t\t\t\tmarketplace: props.marketplace,\n\t\t\t\t\t\t\torderId: props.orderId,\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.then((resp) => resp.steps);\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new UnknownTransactionTypeError(type);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (error instanceof WebrpcError) {\n\t\t\t\tthrow new StepGenerationError(type, error);\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tprivate clearMemoizedSteps() {\n\t\tthis.logger.debug('Clearing memoized steps');\n\t\tthis.memoizedSteps = null;\n\t\tthis.lastProps = null;\n\t}\n\n\tprivate async transition(newState: TransactionState) {\n\t\tthis.logger.state(this.currentState, newState);\n\t\tthis.currentState = newState;\n\t\tthis.clearMemoizedSteps();\n\t}\n\n\tprivate getChainId(): number {\n\t\tconst chainId = this.walletClient.chain?.id;\n\t\tif (!chainId) {\n\t\t\tthrow new ChainIdUnavailableError();\n\t\t}\n\t\treturn chainId;\n\t}\n\n\tprivate getChainForTransaction() {\n\t\tconst chainId = this.config.config.chainId;\n\t\treturn this.config.config.chains.find(\n\t\t\t(chain) => chain.id === Number(chainId),\n\t\t);\n\t}\n\n\tprivate isOnCorrectChain() {\n\t\treturn this.getChainId() === Number(this.config.config.chainId);\n\t}\n\n\tprivate async switchChain(): Promise<void> {\n\t\tthis.logger.debug('Checking chain', {\n\t\t\tcurrentChain: this.getChainId(),\n\t\t\ttargetChain: Number(this.config.config.chainId),\n\t\t});\n\n\t\tif (!this.isOnCorrectChain()) {\n\t\t\tconst currentChain = this.getChainId();\n\t\t\tconst targetChain = Number(this.config.config.chainId);\n\n\t\t\tawait this.transition(TransactionState.SWITCH_CHAIN);\n\t\t\ttry {\n\t\t\t\tif (!this.config.config.isWaaS) {\n\t\t\t\t\tawait this.switchChainFn(this.config.config.chainId);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tawait this.walletClient.switchChain({\n\t\t\t\t\tid: Number(this.config.config.chainId),\n\t\t\t\t});\n\t\t\t\tthis.logger.debug('Switched chain');\n\t\t\t} catch (error) {\n\t\t\t\tthrow new ChainSwitchError(currentChain, targetChain);\n\t\t\t}\n\t\t}\n\t}\n\n\tasync start(props: Input) {\n\t\tthis.logger.debug('Starting transaction', props);\n\n\t\tawait this.transition(TransactionState.CHECKING_STEPS);\n\t\tconst { type } = this.config.config;\n\n\t\tconst steps = await this.generateSteps({\n\t\t\ttype,\n\t\t\tprops,\n\t\t} as TransactionInput);\n\n\t\tfor (const step of steps) {\n\t\t\tawait this.executeStep({ step, props });\n\t\t}\n\n\t\tawait this.transition(TransactionState.SUCCESS);\n\t}\n\n\tprivate async handleTransactionSuccess(hash?: Hash) {\n\t\tif (!hash) {\n\t\t\t// TODO: This is to handle signature steps, but it's not ideal\n\t\t\tawait this.transition(TransactionState.SUCCESS);\n\t\t\treturn;\n\t\t}\n\t\tawait this.transition(TransactionState.CONFIRMING);\n\t\tthis.config.onTransactionSent?.(hash);\n\n\t\ttry {\n\t\t\tconst receipt = await this.publicClient.waitForTransactionReceipt({\n\t\t\t\thash,\n\t\t\t});\n\t\t\tthis.logger.debug('Transaction confirmed', receipt);\n\n\t\t\tawait this.transition(TransactionState.SUCCESS);\n\t\t\tthis.config.onSuccess?.(hash);\n\t\t} catch (error) {\n\t\t\tthrow new TransactionReceiptError(hash, error as Error);\n\t\t}\n\t}\n\n\tprivate async executeTransaction(step: Step): Promise<Hash> {\n\t\ttry {\n\t\t\tawait this.switchChain();\n\n\t\t\tconst transactionData = {\n\t\t\t\taccount: this.getAccount(),\n\t\t\t\tchain: this.getChainForTransaction(),\n\t\t\t\tto: step.to as Hex,\n\t\t\t\tdata: step.data as Hex,\n\t\t\t\tvalue: BigInt(step.value || '0'),\n\t\t\t};\n\n\t\t\tthis.logger.debug('Executing transaction', transactionData);\n\t\t\tconst hash = await this.walletClient.sendTransaction(transactionData);\n\t\t\tthis.logger.debug('Transaction submitted', { hash });\n\n\t\t\tawait this.handleTransactionSuccess(hash);\n\t\t\treturn hash;\n\t\t} catch (error) {\n\t\t\tthrow new StepExecutionError(step.id, error as Error);\n\t\t}\n\t}\n\n\tprivate async executeSignature(step: Step) {\n\t\tthis.logger.debug('Executing signature', { stepId: step.id });\n\t\tif (!step.post) {\n\t\t\tthrow new MissingPostStepError();\n\t\t}\n\n\t\tawait this.switchChain();\n\n\t\tlet signature: Hex;\n\t\tif (!step.signature) {\n\t\t\tthrow new MissingSignatureDataError();\n\t\t}\n\n\t\tswitch (step.id) {\n\t\t\tcase StepType.signEIP712:\n\t\t\t\tsignature = await this.walletClient.signTypedData({\n\t\t\t\t\tdomain: step.signature.domain as TypedDataDomain,\n\t\t\t\t\ttypes: step.signature.types,\n\t\t\t\t\tprimaryType: step.signature.primaryType,\n\t\t\t\t\taccount: this.getAccountAddress(),\n\t\t\t\t\tmessage: step.signature.value,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase StepType.signEIP191:\n\t\t\t\tsignature = await this.walletClient.signMessage({\n\t\t\t\t\tmessage: step.data,\n\t\t\t\t\taccount: step.to as Hex,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new InvalidSignatureStepError(step.id);\n\t\t}\n\n\t\tawait this.marketplaceClient.execute({\n\t\t\tsignature,\n\t\t\texecuteType: ExecuteType.order,\n\t\t\tbody: step.post,\n\t\t});\n\t\tawait this.handleTransactionSuccess();\n\t}\n\n\tprivate openPaymentModalWithPromise(\n\t\tsettings: Omit<SelectPaymentSettings, 'onSuccess' | 'onError'>,\n\t): Promise<void> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.openSelectPaymentModal({\n\t\t\t\t...settings,\n\t\t\t\tonSuccess: async (hash: string) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.handleTransactionSuccess(hash as Hash);\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonError: (error: Error) => {\n\t\t\t\t\treject(new PaymentModalError(error));\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t}\n\n\tprivate async executeBuyStep({\n\t\tstep,\n\t\tprops,\n\t}: {\n\t\tstep: Step;\n\t\tprops: BuyInput;\n\t}) {\n\t\ttry {\n\t\t\tawait this.transition(TransactionState.EXECUTING_TRANSACTION);\n\n\t\t\ttry {\n\t\t\t\tconst [checkoutOptions, orders] = await Promise.all([\n\t\t\t\t\tthis.marketplaceClient\n\t\t\t\t\t\t.checkoutOptionsMarketplace({\n\t\t\t\t\t\t\twallet: this.getAccountAddress(),\n\t\t\t\t\t\t\torders: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcontractAddress: this.config.config.collectionAddress,\n\t\t\t\t\t\t\t\t\torderId: props.orderId,\n\t\t\t\t\t\t\t\t\tmarketplace: props.marketplace,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\tadditionalFee: Number(\n\t\t\t\t\t\t\t\tthis.getMarketplaceFee(this.config.config.collectionAddress)\n\t\t\t\t\t\t\t\t\t.amount,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\t\tthrow new CheckoutOptionsError(error);\n\t\t\t\t\t\t}),\n\t\t\t\t\tthis.marketplaceClient\n\t\t\t\t\t\t.getOrders({\n\t\t\t\t\t\t\tinput: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\torderId: props.orderId,\n\t\t\t\t\t\t\t\t\tmarketplace: props.marketplace,\n\t\t\t\t\t\t\t\t\tcontractAddress: this.config.config.collectionAddress,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\t\tthrow new OrdersFetchError(props.orderId, error);\n\t\t\t\t\t\t}),\n\t\t\t\t]);\n\n\t\t\t\tconst order = orders.orders[0];\n\t\t\t\tif (!order) {\n\t\t\t\t\tthrow new OrderNotFoundError(props.orderId);\n\t\t\t\t}\n\n\t\t\t\tconst paymentModalProps = {\n\t\t\t\t\tchain: this.getChainId()!,\n\t\t\t\t\tcollectibles: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttokenId: order.tokenId,\n\t\t\t\t\t\t\tquantity: props.quantity,\n\t\t\t\t\t\t\tdecimals: props.collectableDecimals,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\tcurrencyAddress: order.priceCurrencyAddress,\n\t\t\t\t\tprice: order.priceAmount,\n\t\t\t\t\ttargetContractAddress: step.to,\n\t\t\t\t\ttxData: step.data as Hex,\n\t\t\t\t\tcollectionAddress: this.config.config.collectionAddress,\n\t\t\t\t\trecipientAddress: this.getAccountAddress(),\n\t\t\t\t\tenableMainCurrencyPayment: true,\n\t\t\t\t\tenableSwapPayments: !!checkoutOptions.options?.swap?.includes(\n\t\t\t\t\t\tTransactionSwapProvider.zerox,\n\t\t\t\t\t),\n\t\t\t\t\tcreditCardProviders: checkoutOptions?.options.nftCheckout || [],\n\t\t\t\t};\n\n\t\t\t\tthis.logger.debug('Opening payment modal', paymentModalProps);\n\t\t\t\tawait this.openPaymentModalWithPromise(paymentModalProps);\n\t\t\t} catch (error) {\n\t\t\t\tif (error instanceof TransactionError) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tthrow new PaymentModalTransactionError(step.id, error as Error);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (error instanceof TransactionError) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tthrow new StepExecutionError(step.id, error as Error);\n\t\t}\n\t}\n\n\tprivate async executeStep({\n\t\tstep,\n\t\tprops,\n\t}: {\n\t\tstep: Step;\n\t\tprops: TransactionInput['props'];\n\t}) {\n\t\ttry {\n\t\t\tthis.logger.debug('Executing step', { stepId: step.id });\n\n\t\t\tif (!step.to && !step.signature) {\n\t\t\t\tthrow new MissingStepDataError();\n\t\t\t}\n\n\t\t\tif (step.id === StepType.buy) {\n\t\t\t\tawait this.executeBuyStep({ step, props: props as BuyInput });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (step.signature) {\n\t\t\t\tawait this.executeSignature(step);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst hash = await this.executeTransaction(step);\n\n\t\t\tif (step.id !== StepType.tokenApproval) {\n\t\t\t\tthis.config.onSuccess?.(hash);\n\t\t\t}\n\n\t\t\treturn { hash };\n\t\t} catch (error) {\n\t\t\tif (error instanceof TransactionError) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tthrow new StepExecutionError(step.id, error as Error);\n\t\t}\n\t}\n\n\tasync getTransactionSteps(props: Input): Promise<TransactionSteps> {\n\t\tthis.logger.debug('Getting transaction steps', props);\n\t\t// Return memoized value if props and state haven't changed\n\t\tif (\n\t\t\tthis.memoizedSteps &&\n\t\t\tthis.lastProps &&\n\t\t\tJSON.stringify(props) === JSON.stringify(this.lastProps)\n\t\t) {\n\t\t\tthis.logger.debug('Returning memoized steps');\n\t\t\treturn this.memoizedSteps;\n\t\t}\n\n\t\tconst type = this.config.config.type;\n\t\tconst steps = await this.generateSteps({\n\t\t\ttype,\n\t\t\tprops,\n\t\t} as TransactionInput);\n\t\t// Extract execution step, it should always be the last step\n\t\tconst executionStep = steps.pop();\n\t\tif (!executionStep) {\n\t\t\tthrow new NoStepsFoundError();\n\t\t}\n\t\tif (executionStep.id === StepType.tokenApproval) {\n\t\t\tthrow new NoExecutionStepError();\n\t\t}\n\t\tconst approvalStep = steps.pop();\n\n\t\tif (steps.length > 0) {\n\t\t\tthrow new UnexpectedStepsError();\n\t\t}\n\n\t\tthis.lastProps = props;\n\t\tthis.memoizedSteps = {\n\t\t\tswitchChain: {\n\t\t\t\tisPending: !this.isOnCorrectChain(),\n\t\t\t\tisExecuting: this.currentState === TransactionState.SWITCH_CHAIN,\n\t\t\t\texecute: () => this.switchChain(),\n\t\t\t},\n\t\t\tapproval: {\n\t\t\t\tisPending: Boolean(approvalStep),\n\t\t\t\tisExecuting: this.currentState === TransactionState.TOKEN_APPROVAL,\n\t\t\t\texecute: () =>\n\t\t\t\t\tapprovalStep && this.executeStep({ step: approvalStep, props }),\n\t\t\t},\n\t\t\ttransaction: {\n\t\t\t\tisPending: Boolean(executionStep),\n\t\t\t\tisExecuting:\n\t\t\t\t\tthis.currentState === TransactionState.EXECUTING_TRANSACTION,\n\t\t\t\texecute: () => this.executeStep({ step: executionStep, props }),\n\t\t\t},\n\t\t} as const;\n\n\t\tthis.logger.debug('Generated new transaction steps', this.memoizedSteps);\n\t\treturn this.memoizedSteps;\n\t}\n}\n","export class TransactionLogger {\n\tconstructor(\n\t\tprivate readonly context: string,\n\t\tprivate readonly enabled: boolean = true,\n\t) {}\n\n\tprivate formatData(data: unknown): unknown {\n\t\tif (data instanceof Error) {\n\t\t\treturn {\n\t\t\t\tname: data.name,\n\t\t\t\tmessage: data.message,\n\t\t\t\tcause:\n\t\t\t\t\tdata.cause instanceof Error\n\t\t\t\t\t\t? this.formatData(data.cause)\n\t\t\t\t\t\t: data.cause,\n\t\t\t\tstack: data.stack?.split('\\n').slice(0, 3),\n\t\t\t};\n\t\t}\n\n\t\tif (Array.isArray(data)) {\n\t\t\treturn data.map((item) => this.formatData(item));\n\t\t}\n\n\t\tif (typeof data === 'object' && data !== null) {\n\t\t\treturn Object.fromEntries(\n\t\t\t\tObject.entries(data).map(([key, value]) => [\n\t\t\t\t\tkey,\n\t\t\t\t\tthis.formatData(value),\n\t\t\t\t]),\n\t\t\t);\n\t\t}\n\n\t\treturn data;\n\t}\n\n\tprivate log(\n\t\tlevel: 'debug' | 'error' | 'info',\n\t\tmessage: string,\n\t\tdata?: unknown,\n\t) {\n\t\tif (!this.enabled) return;\n\t\tconsole[level](\n\t\t\t`[${this.context}] ${message}`,\n\t\t\tdata ? this.formatData(data) : '',\n\t\t);\n\t}\n\n\tdebug(message: string, data?: unknown) {\n\t\tthis.log('debug', message, data);\n\t}\n\n\terror(message: string, error: unknown) {\n\t\tthis.log('error', message, error);\n\t}\n\n\tinfo(message: string, data?: unknown) {\n\t\tthis.log('info', message, data);\n\t}\n\n\tstate(from: string, to: string) {\n\t\tthis.info(`State transition: ${from} -> ${to}`);\n\t}\n}\n\nexport const createLogger = (context: string, enabled = true) =>\n\tnew TransactionLogger(context, enabled);\n","import { useSelectPaymentModal } from '@0xsequence/kit-checkout';\nimport type { Hash } from 'viem';\nimport { useAccount, useSwitchChain, useWalletClient } from 'wagmi';\nimport { getPublicRpcClient } from '../../../utils';\nimport {\n\tNoMarketplaceConfigError,\n\tNoWalletConnectedError,\n\tTransactionError,\n} from '../../../utils/_internal/error/transaction';\nimport { useConfig, useMarketplaceConfig } from '../../hooks';\nimport { useSwitchChainModal } from '../../ui/modals/_internal/components/switchChainModal';\nimport { WalletKind } from '../api';\nimport {\n\ttype Input,\n\ttype TransactionConfig,\n\tTransactionMachine,\n} from './execute-transaction';\n\nexport type UseTransactionMachineConfig = Omit<\n\tTransactionConfig,\n\t'sdkConfig' | 'marketplaceConfig' | 'walletKind' | 'chains' | 'isWaaS'\n>;\n\nexport const useTransactionMachine = (\n\tconfig: UseTransactionMachineConfig,\n\tonSuccess?: (hash: Hash) => void,\n\tonError?: (error: TransactionError) => void,\n\tonTransactionSent?: (hash: Hash) => void,\n) => {\n\tconst { data: walletClient, isLoading: walletClientIsLoading } =\n\t\tuseWalletClient();\n\tconst { show: showSwitchChainModal } = useSwitchChainModal();\n\tconst sdkConfig = useConfig();\n\tconst {\n\t\tdata: marketplaceConfig,\n\t\terror: marketplaceError,\n\t\tisLoading: marketplaceConfigIsLoading,\n\t} = useMarketplaceConfig();\n\tconst { openSelectPaymentModal } = useSelectPaymentModal();\n\tconst { chains } = useSwitchChain();\n\n\tconst { connector, isConnected } = useAccount();\n\tconst walletKind =\n\t\tconnector?.id === 'sequence' \n\t\t\t? WalletKind.sequence \n\t\t\t\t: WalletKind.unknown;\n\n\t// TODO: remove this once we have a better way to check if the wallet is a WAAS wallet\n\tconst isWaaS = connector?.id.endsWith('waas') || false;\n\n\tif (!isConnected) {\n\t\t// No wallet connected, TODO: add some sort of state for this\n\t\treturn { machine: null, error: null, isLoading: false };\n\t}\n\n\tif (walletClientIsLoading || marketplaceConfigIsLoading) {\n\t\treturn { machine: null, error: null, isLoading: true };\n\t}\n\n\tif (marketplaceError) {\n\t\tconst error = new TransactionError('Marketplace config error', {\n\t\t\tcause: marketplaceError,\n\t\t});\n\t\tonError?.(error);\n\t\treturn { machine: null, error };\n\t}\n\n\tif (!walletClient) {\n\t\tconst error = new NoWalletConnectedError();\n\t\tonError?.(error);\n\t\treturn { machine: null, error };\n\t}\n\n\tif (!marketplaceConfig) {\n\t\tconst error = new NoMarketplaceConfigError();\n\t\tonError?.(error);\n\t\treturn { machine: null, error };\n\t}\n\n\tconst machine = new TransactionMachine(\n\t\t{\n\t\t\tconfig: { \n\t\t\t\tsdkConfig, \n\t\t\t\tmarketplaceConfig, \n\t\t\t\twalletKind,\n\t\t\t\tchains, \n\t\t\t\t...config,\n\t\t\t\tisWaaS\n\t\t\t},\n\t\t\tonSuccess,\n\t\t\tonTransactionSent,\n\t\t},\n\t\twalletClient,\n\t\tgetPublicRpcClient(config.chainId),\n\t\topenSelectPaymentModal,\n\t\tasync () =>\n\t\t\tnew Promise((resolve, reject) => {\n\t\t\t\tshowSwitchChainModal({\n\t\t\t\t\tchainIdToSwitchTo: Number(config.chainId),\n\t\t\t\t\tonSuccess: resolve,\n\t\t\t\t\tonError: reject,\n\t\t\t\t\tonClose: reject,\n\t\t\t\t});\n\t\t\t}),\n\t);\n\n\treturn {\n\t\tmachine: {\n\t\t\tgetTransactionSteps: async (props: Input) => {\n\t\t\t\ttry {\n\t\t\t\t\treturn await machine.getTransactionSteps(props);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tconst error = e as TransactionError;\n\t\t\t\t\tonError?.(error);\n\t\t\t\t}\n\t\t\t},\n\t\t\tstart: async (props: Input) => {\n\t\t\t\ttry {\n\t\t\t\t\tawait machine.start(props);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tconst error = e as TransactionError;\n\t\t\t\t\tonError?.(error);\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\terror: null,\n\t\tisLoading: false,\n\t};\n};\n","import {\n\tButton,\n\tCloseIcon,\n\tIconButton,\n\tSpinner,\n\tText,\n} from '@0xsequence/design-system';\nimport { observer } from '@legendapp/state/react';\nimport { Close, Content, Overlay, Portal, Root } from '@radix-ui/react-dialog';\nimport type { SwitchChainErrorType } from 'viem';\nimport { useSwitchChain } from 'wagmi';\nimport { getPresentableChainName } from '../../../../../../utils/network';\nimport type { ChainId } from '../../../../../_internal';\nimport AlertMessage from '../alertMessage';\nimport { switchChainModal$ } from './store';\nimport {\n\tcloseButton,\n\tdialogOverlay,\n\tswitchChainCta,\n\tswitchChainModalContent,\n} from './styles.css';\n\nexport type ShowSwitchChainModalArgs = {\n\tchainIdToSwitchTo: ChainId;\n\tonSuccess?: () => void;\n\tonError?: (error: SwitchChainErrorType) => void;\n\tonClose?: () => void;\n};\n\nexport const useSwitchChainModal = () => {\n\treturn {\n\t\tshow: (args: ShowSwitchChainModalArgs) => switchChainModal$.open(args),\n\t\tclose: () => switchChainModal$.close(),\n\t\tisSwitching$: switchChainModal$.state.isSwitching,\n\t};\n};\n\nconst SwitchChainModal = observer(() => {\n\tconst chainIdToSwitchTo = switchChainModal$.state.chainIdToSwitchTo.get();\n\tconst isSwitching$ = switchChainModal$.state.isSwitching;\n\tconst chainName = getPresentableChainName(chainIdToSwitchTo!);\n\tconst { switchChainAsync } = useSwitchChain();\n\n\tasync function handleSwitchChain() {\n\t\tisSwitching$.set(true);\n\n\t\ttry {\n\t\t\tawait switchChainAsync({ chainId: Number(chainIdToSwitchTo!) });\n\n\t\t\tswitchChainModal$.state.onSuccess?.();\n\n\t\t\tswitchChainModal$.close();\n\t\t} catch (error) {\n\t\t\tswitchChainModal$.state.onError?.(error as SwitchChainErrorType);\n\t\t} finally {\n\t\t\tisSwitching$.set(false);\n\t\t}\n\t}\n\n\treturn (\n\t\t<Root open={switchChainModal$.isOpen.get()}>\n\t\t\t<Portal>\n\t\t\t\t<Overlay className={dialogOverlay} />\n\n\t\t\t\t<Content className={switchChainModalContent}>\n\t\t\t\t\t<Text fontSize=\"large\" fontWeight=\"bold\" color=\"text100\">\n\t\t\t\t\t\tWrong network\n\t\t\t\t\t</Text>\n\n\t\t\t\t\t<AlertMessage\n\t\t\t\t\t\ttype=\"warning\"\n\t\t\t\t\t\tmessage={`You need to switch to ${chainName} network before completing the transaction`}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<Button\n\t\t\t\t\t\tname=\"switch-chain\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tlabel={isSwitching$.get() ? <Spinner /> : 'Switch Network'}\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tpending={isSwitching$.get()}\n\t\t\t\t\t\tshape=\"square\"\n\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\tisSwitching$.get()\n\t\t\t\t\t\t\t\t? switchChainCta.pending\n\t\t\t\t\t\t\t\t: switchChainCta.default\n\t\t\t\t\t\t}\n\t\t\t\t\t\tjustifySelf=\"flex-end\"\n\t\t\t\t\t\tonClick={handleSwitchChain}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<Close\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tswitchChainModal$.state.onClose?.();\n\t\t\t\t\t\t\tswitchChainModal$.delete();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tclassName={closeButton}\n\t\t\t\t\t\tasChild\n\t\t\t\t\t>\n\t\t\t\t\t\t<IconButton size=\"xs\" aria-label=\"Close modal\" icon={CloseIcon} />\n\t\t\t\t\t</Close>\n\t\t\t\t</Content>\n\t\t\t</Portal>\n\t\t</Root>\n\t);\n});\n\nexport default SwitchChainModal;\n","import { Box, Text, WarningIcon } from '@0xsequence/design-system';\nimport SvgInfoIcon from '../../../../icons/InfoIcon';\nimport { alertMessageBox, alertMessageBoxVariants } from './styles.css';\n\ntype AlertMessageProps = {\n\tmessage: string;\n\ttype: 'warning' | 'info';\n};\n\nexport default function AlertMessage({ message, type }: AlertMessageProps) {\n\treturn (\n\t\t<Box className={`${alertMessageBox} ${alertMessageBoxVariants[type]}`}>\n\t\t\t<Text\n\t\t\t\tcolor=\"white\"\n\t\t\t\tfontSize=\"normal\"\n\t\t\t\tfontWeight=\"medium\"\n\t\t\t\tfontFamily=\"body\"\n\t\t\t>\n\t\t\t\t{message}\n\t\t\t</Text>\n\n\t\t\t{type === 'warning' && <WarningIcon size=\"sm\" color=\"white\" />}\n\t\t\t{type === 'info' && <SvgInfoIcon size=\"sm\" color=\"white\" />}\n\t\t</Box>\n\t);\n}\n","import { observable } from '@legendapp/state';\nimport type { SwitchChainErrorType } from 'viem';\nimport type { ShowSwitchChainModalArgs } from '.';\nimport type { ChainId } from '../../../../../_internal';\n\nexport interface SwitchChainModalState {\n\tisOpen: boolean;\n\topen: (args: ShowSwitchChainModalArgs) => void;\n\tclose: () => void;\n\tstate: {\n\t\tchainIdToSwitchTo: ChainId | undefined;\n\t\tisSwitching: boolean;\n\t\tonSuccess: (() => void) | undefined;\n\t\tonError: undefined | ((error: SwitchChainErrorType) => void);\n\t\tonClose: (() => void) | undefined;\n\t};\n}\n\nexport const initialState: SwitchChainModalState = {\n\tisOpen: false,\n\topen: ({ chainIdToSwitchTo, onError, onSuccess, onClose }) => {\n\t\tswitchChainModal$.state.set({\n\t\t\t...switchChainModal$.state.get(),\n\t\t\tchainIdToSwitchTo,\n\t\t\tonError,\n\t\t\tonSuccess,\n\t\t\tonClose,\n\t\t});\n\t\tswitchChainModal$.isOpen.set(true);\n\t},\n\tclose: () => {\n\t\tswitchChainModal$.isOpen.set(false);\n\t},\n\tstate: {\n\t\tchainIdToSwitchTo: undefined,\n\t\tonError: undefined,\n\t\tonSuccess: undefined,\n\t\tonClose: undefined,\n\t\tisSwitching: false,\n\t},\n};\n\nexport const switchChainModal$ = observable(initialState);\n","import {\n\ttype CancelInput,\n\tTransactionType,\n} from '../_internal/transaction-machine/execute-transaction';\nimport {\n\ttype UseTransactionMachineConfig,\n\tuseTransactionMachine,\n} from '../_internal/transaction-machine/useTransactionMachine';\n\ninterface UseCancelOrderArgs extends Omit<UseTransactionMachineConfig, 'type'> {\n\tonSuccess?: (hash: string) => void;\n\tonError?: (error: Error) => void;\n\tonTransactionSent?: (hash: string) => void;\n}\n\nexport const useCancelOrder = ({\n\tonSuccess,\n\tonError,\n\tonTransactionSent,\n\t...config\n}: UseCancelOrderArgs) => {\n\tconst { machine, isLoading } = useTransactionMachine(\n\t\t{\n\t\t\t...config,\n\t\t\ttype: TransactionType.CANCEL,\n\t\t},\n\t\tonSuccess,\n\t\tonError,\n\t\tonTransactionSent,\n\t);\n\n\treturn {\n\t\tcancel: (props: CancelInput) => machine?.start(props),\n\t\tonError,\n\t\tonSuccess,\n\t\tonTransactionSent,\n\t\tisLoading,\n\t};\n};\n","import type { Hash } from 'viem';\nimport type { TransactionErrorTypes } from '../../utils/_internal/error/transaction';\nimport {\n\ttype BuyInput,\n\tTransactionType,\n} from '../_internal/transaction-machine/execute-transaction';\nimport {\n\ttype UseTransactionMachineConfig,\n\tuseTransactionMachine,\n} from '../_internal/transaction-machine/useTransactionMachine';\n\ntype UseBuyOrderError = TransactionErrorTypes;\n\ninterface UseBuyOrderArgs extends Omit<UseTransactionMachineConfig, 'type'> {\n\tonSuccess?: (hash: Hash) => void;\n\tonError?: (error: UseBuyOrderError) => void;\n\tonTransactionSent?: (hash: string) => void;\n}\n\nexport const useBuyCollectable = ({\n\tonSuccess,\n\tonError,\n\tonTransactionSent,\n\t...config\n}: UseBuyOrderArgs) => {\n\tconst { machine, error, isLoading } = useTransactionMachine(\n\t\t{\n\t\t\t...config,\n\t\t\ttype: TransactionType.BUY,\n\t\t},\n\t\tonSuccess,\n\t\tonError,\n\t\tonTransactionSent,\n\t);\n\n\treturn {\n\t\tbuy: (props: BuyInput) => {\n\t\t\tif (!machine || isLoading) return;\n\t\t\tmachine.start(props);\n\t\t},\n\t\tisLoading,\n\t\terror,\n\t};\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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I;AACH,gBAAM,QAAQ,MAAM,KAAK;AAAA,QAC1B,SAAS,GAAG;AACX,gBAAM,QAAQ;AACd,oBAAU,KAAK;AAAA,QAChB;AAAA,MACD;AAAA,IACD;AAAA,IACA,OAAO;AAAA,IACP,WAAW;AAAA,EACZ;AACD;;;AIjHO,IAAM,iBAAiB,CAAC;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,MAA0B;AACzB,QAAM,EAAE,SAAS,UAAU,IAAI;AAAA,IAC9B;AAAA,MACC,GAAG;AAAA,MACH;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,SAAO;AAAA,IACN,QAAQ,CAAC,UAAuB,SAAS,MAAM,KAAK;AAAA,IACpD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;;;ACnBO,IAAM,oBAAoB,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,MAAuB;AACtB,QAAM,EAAE,SAAS,OAAO,UAAU,IAAI;AAAA,IACrC;AAAA,MACC,GAAG;AAAA,MACH;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,SAAO;AAAA,IACN,KAAK,CAAC,UAAoB;AACzB,UAAI,CAAC,WAAW,UAAW;AAC3B,cAAQ,MAAM,KAAK;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;","names":["queryOptions","useQuery","z","z","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","collection","queryOptions","useQuery","queryOptions","useQuery","z","ChainIdCoerce","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","SortOrder","z","z","sortOrderSchema","SortOrder","sortBySchema","pageSchema","infiniteQueryOptions","useInfiniteQuery","z","z","infiniteQueryOptions","useInfiniteQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","useQuery","queryOptions","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","useMutation","dateToUnixTime","useMutation","useMutation","z","z","useMutation","useMutation","z","z","useMutation","queryOptions","useQuery","useAccount","z","z","queryOptions","useAccount","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","useAccount","z","z","queryOptions","useAccount","useQuery","collection","useAccount","useSwitchChain","Text","jsx","jsx","jsxs","Text","useSwitchChain","useAccount"]}