@bosonprotocol/react-kit 0.29.0-alpha.3 → 0.29.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/cta/dispute/DecideDisputeButton.d.ts +2 -1
- package/dist/cjs/components/cta/dispute/DecideDisputeButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/dispute/DecideDisputeButton.js +3 -3
- package/dist/cjs/components/cta/dispute/DecideDisputeButton.js.map +1 -1
- package/dist/cjs/components/cta/dispute/EscalateDisputeButton.d.ts +2 -1
- package/dist/cjs/components/cta/dispute/EscalateDisputeButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/dispute/EscalateDisputeButton.js +3 -3
- package/dist/cjs/components/cta/dispute/EscalateDisputeButton.js.map +1 -1
- package/dist/cjs/components/cta/dispute/ExpireDisputeButton.d.ts +2 -1
- package/dist/cjs/components/cta/dispute/ExpireDisputeButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/dispute/ExpireDisputeButton.js +3 -3
- package/dist/cjs/components/cta/dispute/ExpireDisputeButton.js.map +1 -1
- package/dist/cjs/components/cta/dispute/ExpireEscalationDisputeButton.d.ts +2 -1
- package/dist/cjs/components/cta/dispute/ExpireEscalationDisputeButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/dispute/ExpireEscalationDisputeButton.js +3 -3
- package/dist/cjs/components/cta/dispute/ExpireEscalationDisputeButton.js.map +1 -1
- package/dist/cjs/components/cta/dispute/ExtendDisputeTimeoutButton.d.ts +2 -1
- package/dist/cjs/components/cta/dispute/ExtendDisputeTimeoutButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/dispute/ExtendDisputeTimeoutButton.js +3 -3
- package/dist/cjs/components/cta/dispute/ExtendDisputeTimeoutButton.js.map +1 -1
- package/dist/cjs/components/cta/dispute/RaiseDisputeButton.d.ts +2 -1
- package/dist/cjs/components/cta/dispute/RaiseDisputeButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/dispute/RaiseDisputeButton.js +3 -3
- package/dist/cjs/components/cta/dispute/RaiseDisputeButton.js.map +1 -1
- package/dist/cjs/components/cta/dispute/RefuseDisputeButton.d.ts +2 -1
- package/dist/cjs/components/cta/dispute/RefuseDisputeButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/dispute/RefuseDisputeButton.js +3 -3
- package/dist/cjs/components/cta/dispute/RefuseDisputeButton.js.map +1 -1
- package/dist/cjs/components/cta/dispute/RemoveFeesDisputeResolverButton.d.ts +2 -1
- package/dist/cjs/components/cta/dispute/RemoveFeesDisputeResolverButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/dispute/RemoveFeesDisputeResolverButton.js +3 -3
- package/dist/cjs/components/cta/dispute/RemoveFeesDisputeResolverButton.js.map +1 -1
- package/dist/cjs/components/cta/dispute/ResolveDisputeButton.d.ts +2 -1
- package/dist/cjs/components/cta/dispute/ResolveDisputeButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/dispute/ResolveDisputeButton.js +3 -3
- package/dist/cjs/components/cta/dispute/ResolveDisputeButton.js.map +1 -1
- package/dist/cjs/components/cta/dispute/RetractDisputeButton.d.ts +2 -1
- package/dist/cjs/components/cta/dispute/RetractDisputeButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/dispute/RetractDisputeButton.js +3 -3
- package/dist/cjs/components/cta/dispute/RetractDisputeButton.js.map +1 -1
- package/dist/cjs/components/cta/exchange/BatchCompleteButton.d.ts +2 -1
- package/dist/cjs/components/cta/exchange/BatchCompleteButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/exchange/BatchCompleteButton.js +3 -3
- package/dist/cjs/components/cta/exchange/BatchCompleteButton.js.map +1 -1
- package/dist/cjs/components/cta/exchange/CancelButton.d.ts +2 -1
- package/dist/cjs/components/cta/exchange/CancelButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/exchange/CancelButton.js +3 -3
- package/dist/cjs/components/cta/exchange/CancelButton.js.map +1 -1
- package/dist/cjs/components/cta/exchange/CompleteButton.d.ts +2 -1
- package/dist/cjs/components/cta/exchange/CompleteButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/exchange/CompleteButton.js +3 -3
- package/dist/cjs/components/cta/exchange/CompleteButton.js.map +1 -1
- package/dist/cjs/components/cta/exchange/ExpireButton.d.ts +2 -1
- package/dist/cjs/components/cta/exchange/ExpireButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/exchange/ExpireButton.js +3 -3
- package/dist/cjs/components/cta/exchange/ExpireButton.js.map +1 -1
- package/dist/cjs/components/cta/exchange/RedeemButton.d.ts +2 -1
- package/dist/cjs/components/cta/exchange/RedeemButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/exchange/RedeemButton.js +3 -3
- package/dist/cjs/components/cta/exchange/RedeemButton.js.map +1 -1
- package/dist/cjs/components/cta/exchange/RevokeButton.d.ts +2 -1
- package/dist/cjs/components/cta/exchange/RevokeButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/exchange/RevokeButton.js +3 -3
- package/dist/cjs/components/cta/exchange/RevokeButton.js.map +1 -1
- package/dist/cjs/components/cta/funds/DepositFundsButton.d.ts +2 -1
- package/dist/cjs/components/cta/funds/DepositFundsButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/funds/DepositFundsButton.js +3 -3
- package/dist/cjs/components/cta/funds/DepositFundsButton.js.map +1 -1
- package/dist/cjs/components/cta/funds/WithdrawAllFundsButton.d.ts +2 -1
- package/dist/cjs/components/cta/funds/WithdrawAllFundsButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/funds/WithdrawAllFundsButton.js +3 -3
- package/dist/cjs/components/cta/funds/WithdrawAllFundsButton.js.map +1 -1
- package/dist/cjs/components/cta/funds/WithdrawFundsButton.d.ts +2 -1
- package/dist/cjs/components/cta/funds/WithdrawFundsButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/funds/WithdrawFundsButton.js +3 -3
- package/dist/cjs/components/cta/funds/WithdrawFundsButton.js.map +1 -1
- package/dist/cjs/components/cta/offer/BatchVoidButton.d.ts +2 -1
- package/dist/cjs/components/cta/offer/BatchVoidButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/offer/BatchVoidButton.js +3 -3
- package/dist/cjs/components/cta/offer/BatchVoidButton.js.map +1 -1
- package/dist/cjs/components/cta/offer/CommitButton.d.ts +2 -1
- package/dist/cjs/components/cta/offer/CommitButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/offer/CommitButton.js +3 -3
- package/dist/cjs/components/cta/offer/CommitButton.js.map +1 -1
- package/dist/cjs/components/cta/offer/CreateOfferButton.d.ts +2 -1
- package/dist/cjs/components/cta/offer/CreateOfferButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/offer/CreateOfferButton.js +3 -3
- package/dist/cjs/components/cta/offer/CreateOfferButton.js.map +1 -1
- package/dist/cjs/components/cta/offer/VoidButton.d.ts +2 -1
- package/dist/cjs/components/cta/offer/VoidButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/offer/VoidButton.js +3 -3
- package/dist/cjs/components/cta/offer/VoidButton.js.map +1 -1
- package/dist/cjs/components/cta/seller/CreateSellerButton.d.ts +2 -1
- package/dist/cjs/components/cta/seller/CreateSellerButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/seller/CreateSellerButton.js +3 -3
- package/dist/cjs/components/cta/seller/CreateSellerButton.js.map +1 -1
- package/dist/cjs/components/queryClient/QueryClientProviderCustom.d.ts +6 -0
- package/dist/cjs/components/queryClient/QueryClientProviderCustom.d.ts.map +1 -0
- package/dist/cjs/components/queryClient/QueryClientProviderCustom.js +32 -0
- package/dist/cjs/components/queryClient/QueryClientProviderCustom.js.map +1 -0
- package/dist/cjs/components/queryClient/withQueryClientProvider.d.ts +7 -0
- package/dist/cjs/components/queryClient/withQueryClientProvider.d.ts.map +1 -0
- package/dist/cjs/components/queryClient/withQueryClientProvider.js +44 -0
- package/dist/cjs/components/queryClient/withQueryClientProvider.js.map +1 -0
- package/dist/cjs/components/widgets/commit/CommitWidgetProviders.d.ts.map +1 -1
- package/dist/cjs/components/widgets/commit/CommitWidgetProviders.js +9 -18
- package/dist/cjs/components/widgets/commit/CommitWidgetProviders.js.map +1 -1
- package/dist/cjs/components/widgets/finance/FinanceWidget.d.ts +3 -2
- package/dist/cjs/components/widgets/finance/FinanceWidget.d.ts.map +1 -1
- package/dist/cjs/components/widgets/finance/FinanceWidget.js +7 -15
- package/dist/cjs/components/widgets/finance/FinanceWidget.js.map +1 -1
- package/dist/cjs/components/widgets/redemption/RedemptionWidgetProviders.d.ts.map +1 -1
- package/dist/cjs/components/widgets/redemption/RedemptionWidgetProviders.js +9 -18
- package/dist/cjs/components/widgets/redemption/RedemptionWidgetProviders.js.map +1 -1
- package/dist/cjs/hooks/useMetaTx.d.ts +1 -1
- package/dist/cjs/hooks/useSignerAddress.d.ts +1 -1
- package/dist/cjs/hooks/useSignerAddress.d.ts.map +1 -1
- package/dist/cjs/hooks/useSignerAddress.js +11 -26
- package/dist/cjs/hooks/useSignerAddress.js.map +1 -1
- package/dist/cjs/lib/signer/externalSigner.d.ts.map +1 -1
- package/dist/cjs/lib/signer/externalSigner.js +1 -0
- package/dist/cjs/lib/signer/externalSigner.js.map +1 -1
- package/dist/cjs/lib/signer/useCallSignerFromIframe.js +1 -1
- package/dist/cjs/lib/signer/useCallSignerFromIframe.js.map +1 -1
- package/dist/esm/components/cta/dispute/DecideDisputeButton.d.ts +2 -1
- package/dist/esm/components/cta/dispute/DecideDisputeButton.d.ts.map +1 -1
- package/dist/esm/components/cta/dispute/DecideDisputeButton.js +3 -2
- package/dist/esm/components/cta/dispute/DecideDisputeButton.js.map +1 -1
- package/dist/esm/components/cta/dispute/EscalateDisputeButton.d.ts +2 -1
- package/dist/esm/components/cta/dispute/EscalateDisputeButton.d.ts.map +1 -1
- package/dist/esm/components/cta/dispute/EscalateDisputeButton.js +3 -2
- package/dist/esm/components/cta/dispute/EscalateDisputeButton.js.map +1 -1
- package/dist/esm/components/cta/dispute/ExpireDisputeButton.d.ts +2 -1
- package/dist/esm/components/cta/dispute/ExpireDisputeButton.d.ts.map +1 -1
- package/dist/esm/components/cta/dispute/ExpireDisputeButton.js +3 -2
- package/dist/esm/components/cta/dispute/ExpireDisputeButton.js.map +1 -1
- package/dist/esm/components/cta/dispute/ExpireEscalationDisputeButton.d.ts +2 -1
- package/dist/esm/components/cta/dispute/ExpireEscalationDisputeButton.d.ts.map +1 -1
- package/dist/esm/components/cta/dispute/ExpireEscalationDisputeButton.js +3 -2
- package/dist/esm/components/cta/dispute/ExpireEscalationDisputeButton.js.map +1 -1
- package/dist/esm/components/cta/dispute/ExtendDisputeTimeoutButton.d.ts +2 -1
- package/dist/esm/components/cta/dispute/ExtendDisputeTimeoutButton.d.ts.map +1 -1
- package/dist/esm/components/cta/dispute/ExtendDisputeTimeoutButton.js +3 -2
- package/dist/esm/components/cta/dispute/ExtendDisputeTimeoutButton.js.map +1 -1
- package/dist/esm/components/cta/dispute/RaiseDisputeButton.d.ts +2 -1
- package/dist/esm/components/cta/dispute/RaiseDisputeButton.d.ts.map +1 -1
- package/dist/esm/components/cta/dispute/RaiseDisputeButton.js +3 -2
- package/dist/esm/components/cta/dispute/RaiseDisputeButton.js.map +1 -1
- package/dist/esm/components/cta/dispute/RefuseDisputeButton.d.ts +2 -1
- package/dist/esm/components/cta/dispute/RefuseDisputeButton.d.ts.map +1 -1
- package/dist/esm/components/cta/dispute/RefuseDisputeButton.js +3 -2
- package/dist/esm/components/cta/dispute/RefuseDisputeButton.js.map +1 -1
- package/dist/esm/components/cta/dispute/RemoveFeesDisputeResolverButton.d.ts +2 -1
- package/dist/esm/components/cta/dispute/RemoveFeesDisputeResolverButton.d.ts.map +1 -1
- package/dist/esm/components/cta/dispute/RemoveFeesDisputeResolverButton.js +3 -2
- package/dist/esm/components/cta/dispute/RemoveFeesDisputeResolverButton.js.map +1 -1
- package/dist/esm/components/cta/dispute/ResolveDisputeButton.d.ts +2 -1
- package/dist/esm/components/cta/dispute/ResolveDisputeButton.d.ts.map +1 -1
- package/dist/esm/components/cta/dispute/ResolveDisputeButton.js +3 -2
- package/dist/esm/components/cta/dispute/ResolveDisputeButton.js.map +1 -1
- package/dist/esm/components/cta/dispute/RetractDisputeButton.d.ts +2 -1
- package/dist/esm/components/cta/dispute/RetractDisputeButton.d.ts.map +1 -1
- package/dist/esm/components/cta/dispute/RetractDisputeButton.js +3 -2
- package/dist/esm/components/cta/dispute/RetractDisputeButton.js.map +1 -1
- package/dist/esm/components/cta/exchange/BatchCompleteButton.d.ts +2 -1
- package/dist/esm/components/cta/exchange/BatchCompleteButton.d.ts.map +1 -1
- package/dist/esm/components/cta/exchange/BatchCompleteButton.js +3 -2
- package/dist/esm/components/cta/exchange/BatchCompleteButton.js.map +1 -1
- package/dist/esm/components/cta/exchange/CancelButton.d.ts +2 -1
- package/dist/esm/components/cta/exchange/CancelButton.d.ts.map +1 -1
- package/dist/esm/components/cta/exchange/CancelButton.js +3 -2
- package/dist/esm/components/cta/exchange/CancelButton.js.map +1 -1
- package/dist/esm/components/cta/exchange/CompleteButton.d.ts +2 -1
- package/dist/esm/components/cta/exchange/CompleteButton.d.ts.map +1 -1
- package/dist/esm/components/cta/exchange/CompleteButton.js +3 -2
- package/dist/esm/components/cta/exchange/CompleteButton.js.map +1 -1
- package/dist/esm/components/cta/exchange/ExpireButton.d.ts +2 -1
- package/dist/esm/components/cta/exchange/ExpireButton.d.ts.map +1 -1
- package/dist/esm/components/cta/exchange/ExpireButton.js +3 -2
- package/dist/esm/components/cta/exchange/ExpireButton.js.map +1 -1
- package/dist/esm/components/cta/exchange/RedeemButton.d.ts +2 -1
- package/dist/esm/components/cta/exchange/RedeemButton.d.ts.map +1 -1
- package/dist/esm/components/cta/exchange/RedeemButton.js +3 -2
- package/dist/esm/components/cta/exchange/RedeemButton.js.map +1 -1
- package/dist/esm/components/cta/exchange/RevokeButton.d.ts +2 -1
- package/dist/esm/components/cta/exchange/RevokeButton.d.ts.map +1 -1
- package/dist/esm/components/cta/exchange/RevokeButton.js +3 -2
- package/dist/esm/components/cta/exchange/RevokeButton.js.map +1 -1
- package/dist/esm/components/cta/funds/DepositFundsButton.d.ts +2 -1
- package/dist/esm/components/cta/funds/DepositFundsButton.d.ts.map +1 -1
- package/dist/esm/components/cta/funds/DepositFundsButton.js +3 -2
- package/dist/esm/components/cta/funds/DepositFundsButton.js.map +1 -1
- package/dist/esm/components/cta/funds/WithdrawAllFundsButton.d.ts +2 -1
- package/dist/esm/components/cta/funds/WithdrawAllFundsButton.d.ts.map +1 -1
- package/dist/esm/components/cta/funds/WithdrawAllFundsButton.js +3 -2
- package/dist/esm/components/cta/funds/WithdrawAllFundsButton.js.map +1 -1
- package/dist/esm/components/cta/funds/WithdrawFundsButton.d.ts +2 -1
- package/dist/esm/components/cta/funds/WithdrawFundsButton.d.ts.map +1 -1
- package/dist/esm/components/cta/funds/WithdrawFundsButton.js +3 -2
- package/dist/esm/components/cta/funds/WithdrawFundsButton.js.map +1 -1
- package/dist/esm/components/cta/offer/BatchVoidButton.d.ts +2 -1
- package/dist/esm/components/cta/offer/BatchVoidButton.d.ts.map +1 -1
- package/dist/esm/components/cta/offer/BatchVoidButton.js +3 -2
- package/dist/esm/components/cta/offer/BatchVoidButton.js.map +1 -1
- package/dist/esm/components/cta/offer/CommitButton.d.ts +2 -1
- package/dist/esm/components/cta/offer/CommitButton.d.ts.map +1 -1
- package/dist/esm/components/cta/offer/CommitButton.js +3 -2
- package/dist/esm/components/cta/offer/CommitButton.js.map +1 -1
- package/dist/esm/components/cta/offer/CreateOfferButton.d.ts +2 -1
- package/dist/esm/components/cta/offer/CreateOfferButton.d.ts.map +1 -1
- package/dist/esm/components/cta/offer/CreateOfferButton.js +3 -2
- package/dist/esm/components/cta/offer/CreateOfferButton.js.map +1 -1
- package/dist/esm/components/cta/offer/VoidButton.d.ts +2 -1
- package/dist/esm/components/cta/offer/VoidButton.d.ts.map +1 -1
- package/dist/esm/components/cta/offer/VoidButton.js +3 -2
- package/dist/esm/components/cta/offer/VoidButton.js.map +1 -1
- package/dist/esm/components/cta/seller/CreateSellerButton.d.ts +2 -1
- package/dist/esm/components/cta/seller/CreateSellerButton.d.ts.map +1 -1
- package/dist/esm/components/cta/seller/CreateSellerButton.js +3 -2
- package/dist/esm/components/cta/seller/CreateSellerButton.js.map +1 -1
- package/dist/esm/components/queryClient/QueryClientProviderCustom.d.ts +6 -0
- package/dist/esm/components/queryClient/QueryClientProviderCustom.d.ts.map +1 -0
- package/dist/esm/components/queryClient/QueryClientProviderCustom.js +13 -0
- package/dist/esm/components/queryClient/QueryClientProviderCustom.js.map +1 -0
- package/dist/esm/components/queryClient/withQueryClientProvider.d.ts +7 -0
- package/dist/esm/components/queryClient/withQueryClientProvider.d.ts.map +1 -0
- package/dist/esm/components/queryClient/withQueryClientProvider.js +24 -0
- package/dist/esm/components/queryClient/withQueryClientProvider.js.map +1 -0
- package/dist/esm/components/widgets/commit/CommitWidgetProviders.d.ts.map +1 -1
- package/dist/esm/components/widgets/commit/CommitWidgetProviders.js +9 -17
- package/dist/esm/components/widgets/commit/CommitWidgetProviders.js.map +1 -1
- package/dist/esm/components/widgets/finance/FinanceWidget.d.ts +3 -2
- package/dist/esm/components/widgets/finance/FinanceWidget.d.ts.map +1 -1
- package/dist/esm/components/widgets/finance/FinanceWidget.js +7 -15
- package/dist/esm/components/widgets/finance/FinanceWidget.js.map +1 -1
- package/dist/esm/components/widgets/redemption/RedemptionWidgetProviders.d.ts.map +1 -1
- package/dist/esm/components/widgets/redemption/RedemptionWidgetProviders.js +9 -17
- package/dist/esm/components/widgets/redemption/RedemptionWidgetProviders.js.map +1 -1
- package/dist/esm/hooks/useMetaTx.d.ts +1 -1
- package/dist/esm/hooks/useSignerAddress.d.ts +1 -1
- package/dist/esm/hooks/useSignerAddress.d.ts.map +1 -1
- package/dist/esm/hooks/useSignerAddress.js +11 -26
- package/dist/esm/hooks/useSignerAddress.js.map +1 -1
- package/dist/esm/lib/signer/externalSigner.d.ts.map +1 -1
- package/dist/esm/lib/signer/externalSigner.js +1 -0
- package/dist/esm/lib/signer/externalSigner.js.map +1 -1
- package/dist/esm/lib/signer/useCallSignerFromIframe.js +1 -1
- package/dist/esm/lib/signer/useCallSignerFromIframe.js.map +1 -1
- package/package.json +4 -4
- package/src/components/cta/dispute/DecideDisputeButton.tsx +28 -25
- package/src/components/cta/dispute/EscalateDisputeButton.tsx +31 -28
- package/src/components/cta/dispute/ExpireDisputeButton.tsx +27 -24
- package/src/components/cta/dispute/ExpireEscalationDisputeButton.tsx +27 -24
- package/src/components/cta/dispute/ExtendDisputeTimeoutButton.tsx +29 -26
- package/src/components/cta/dispute/RaiseDisputeButton.tsx +31 -28
- package/src/components/cta/dispute/RefuseDisputeButton.tsx +27 -24
- package/src/components/cta/dispute/RemoveFeesDisputeResolverButton.tsx +71 -68
- package/src/components/cta/dispute/ResolveDisputeButton.tsx +42 -39
- package/src/components/cta/dispute/RetractDisputeButton.tsx +31 -28
- package/src/components/cta/exchange/BatchCompleteButton.tsx +27 -28
- package/src/components/cta/exchange/CancelButton.tsx +27 -28
- package/src/components/cta/exchange/CompleteButton.tsx +27 -28
- package/src/components/cta/exchange/ExpireButton.tsx +27 -28
- package/src/components/cta/exchange/RedeemButton.tsx +27 -28
- package/src/components/cta/exchange/RevokeButton.tsx +27 -28
- package/src/components/cta/funds/DepositFundsButton.tsx +64 -61
- package/src/components/cta/funds/WithdrawAllFundsButton.tsx +28 -25
- package/src/components/cta/funds/WithdrawFundsButton.tsx +47 -44
- package/src/components/cta/offer/BatchVoidButton.tsx +81 -78
- package/src/components/cta/offer/CommitButton.tsx +71 -67
- package/src/components/cta/offer/CreateOfferButton.tsx +137 -132
- package/src/components/cta/offer/VoidButton.tsx +79 -76
- package/src/components/cta/seller/CreateSellerButton.tsx +83 -80
- package/src/components/queryClient/QueryClientProviderCustom.tsx +27 -0
- package/src/components/queryClient/withQueryClientProvider.tsx +50 -0
- package/src/components/widgets/commit/CommitWidgetProviders.tsx +43 -54
- package/src/components/widgets/finance/FinanceWidget.tsx +12 -22
- package/src/components/widgets/redemption/RedemptionWidgetProviders.tsx +20 -30
- package/src/hooks/useSignerAddress.tsx +18 -27
- package/src/lib/signer/externalSigner.ts +1 -0
- package/src/lib/signer/useCallSignerFromIframe.ts +1 -1
|
@@ -10,6 +10,7 @@ import { TransactionResponse } from "@bosonprotocol/common";
|
|
|
10
10
|
import { ButtonSize } from "../../ui/buttonSize";
|
|
11
11
|
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";
|
|
12
12
|
import { useMetaTx } from "../../../hooks/useMetaTx";
|
|
13
|
+
import { withQueryClientProvider } from "../../queryClient/withQueryClientProvider";
|
|
13
14
|
|
|
14
15
|
type Props = {
|
|
15
16
|
hasSellerAccount: boolean;
|
|
@@ -20,45 +21,70 @@ type Props = {
|
|
|
20
21
|
offerIdData: string[] | string;
|
|
21
22
|
}>;
|
|
22
23
|
|
|
23
|
-
export const CreateOfferButton = (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
24
|
+
export const CreateOfferButton = withQueryClientProvider(
|
|
25
|
+
({
|
|
26
|
+
disabled = false,
|
|
27
|
+
showLoading = false,
|
|
28
|
+
extraInfo = "",
|
|
29
|
+
children,
|
|
30
|
+
onPendingSignature,
|
|
31
|
+
onPendingTransaction,
|
|
32
|
+
onSuccess,
|
|
33
|
+
onError,
|
|
34
|
+
waitBlocks = 1,
|
|
35
|
+
size = ButtonSize.Large,
|
|
36
|
+
variant = "primaryFill",
|
|
37
|
+
isMultiVariant,
|
|
38
|
+
hasSellerAccount,
|
|
39
|
+
sellerInfo,
|
|
40
|
+
offersToCreate,
|
|
41
|
+
coreSdkConfig,
|
|
42
|
+
...rest
|
|
43
|
+
}: Props) => {
|
|
44
|
+
const coreSdk = useCoreSdkOverrides({ coreSdkConfig });
|
|
45
|
+
const { isMetaTx, signerAddress } = useMetaTx(coreSdk);
|
|
44
46
|
|
|
45
|
-
|
|
47
|
+
const [isLoading, setIsLoading] = useState<boolean>(false);
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
const handleCreateOffer = async () => {
|
|
50
|
+
if (!isLoading) {
|
|
51
|
+
let txResponse: TransactionResponse | undefined = undefined;
|
|
52
|
+
try {
|
|
53
|
+
setIsLoading(true);
|
|
54
|
+
onPendingSignature?.();
|
|
55
|
+
const seller = signerAddress && sellerInfo ? sellerInfo : null;
|
|
56
|
+
if (isMultiVariant) {
|
|
57
|
+
if (!hasSellerAccount && seller) {
|
|
58
|
+
if (isMetaTx) {
|
|
59
|
+
// createSeller with meta-transaction
|
|
60
|
+
const nonce = Date.now();
|
|
61
|
+
const { r, s, v, functionName, functionSignature } =
|
|
62
|
+
await coreSdk.signMetaTxCreateSeller({
|
|
63
|
+
createSellerArgs: seller,
|
|
64
|
+
nonce
|
|
65
|
+
});
|
|
66
|
+
txResponse = await coreSdk.relayMetaTransaction({
|
|
67
|
+
functionName,
|
|
68
|
+
functionSignature,
|
|
69
|
+
sigR: r,
|
|
70
|
+
sigS: s,
|
|
71
|
+
sigV: v,
|
|
72
|
+
nonce
|
|
73
|
+
});
|
|
74
|
+
} else {
|
|
75
|
+
txResponse = await coreSdk.createSeller(seller);
|
|
76
|
+
}
|
|
77
|
+
onPendingTransaction?.(txResponse.hash, isMetaTx);
|
|
78
|
+
|
|
79
|
+
await txResponse.wait(waitBlocks);
|
|
80
|
+
onPendingSignature?.();
|
|
81
|
+
}
|
|
56
82
|
if (isMetaTx) {
|
|
57
|
-
//
|
|
83
|
+
// createOfferBatch with meta-transaction
|
|
58
84
|
const nonce = Date.now();
|
|
59
85
|
const { r, s, v, functionName, functionSignature } =
|
|
60
|
-
await coreSdk.
|
|
61
|
-
|
|
86
|
+
await coreSdk.signMetaTxCreateOfferBatch({
|
|
87
|
+
createOffersArgs: offersToCreate,
|
|
62
88
|
nonce
|
|
63
89
|
});
|
|
64
90
|
txResponse = await coreSdk.relayMetaTransaction({
|
|
@@ -70,52 +96,49 @@ export const CreateOfferButton = ({
|
|
|
70
96
|
nonce
|
|
71
97
|
});
|
|
72
98
|
} else {
|
|
73
|
-
txResponse = await coreSdk.
|
|
99
|
+
txResponse = await coreSdk.createOfferBatch(offersToCreate);
|
|
74
100
|
}
|
|
75
101
|
onPendingTransaction?.(txResponse.hash, isMetaTx);
|
|
76
102
|
|
|
77
|
-
await txResponse.wait(waitBlocks);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
// createOfferBatch with meta-transaction
|
|
82
|
-
const nonce = Date.now();
|
|
83
|
-
const { r, s, v, functionName, functionSignature } =
|
|
84
|
-
await coreSdk.signMetaTxCreateOfferBatch({
|
|
85
|
-
createOffersArgs: offersToCreate,
|
|
86
|
-
nonce
|
|
87
|
-
});
|
|
88
|
-
txResponse = await coreSdk.relayMetaTransaction({
|
|
89
|
-
functionName,
|
|
90
|
-
functionSignature,
|
|
91
|
-
sigR: r,
|
|
92
|
-
sigS: s,
|
|
93
|
-
sigV: v,
|
|
94
|
-
nonce
|
|
103
|
+
const txReceipt = await txResponse.wait(waitBlocks);
|
|
104
|
+
const offerIds = coreSdk.getCreatedOfferIdsFromLogs(txReceipt.logs);
|
|
105
|
+
onSuccess?.(txReceipt as providers.TransactionReceipt, {
|
|
106
|
+
offerIdData: offerIds
|
|
95
107
|
});
|
|
96
108
|
} else {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
const [offerData] = offersToCreate;
|
|
110
|
+
if (isMetaTx) {
|
|
111
|
+
// meta-transaction
|
|
112
|
+
if (!hasSellerAccount && seller) {
|
|
113
|
+
// createSeller with meta-transaction
|
|
114
|
+
const nonce = Date.now();
|
|
115
|
+
const { r, s, v, functionName, functionSignature } =
|
|
116
|
+
await coreSdk.signMetaTxCreateSeller({
|
|
117
|
+
createSellerArgs: seller,
|
|
118
|
+
nonce
|
|
119
|
+
});
|
|
120
|
+
const createSellerResponse = await coreSdk.relayMetaTransaction(
|
|
121
|
+
{
|
|
122
|
+
functionName,
|
|
123
|
+
functionSignature,
|
|
124
|
+
sigR: r,
|
|
125
|
+
sigS: s,
|
|
126
|
+
sigV: v,
|
|
127
|
+
nonce
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
onPendingTransaction?.(createSellerResponse.hash, isMetaTx);
|
|
131
|
+
await createSellerResponse.wait(waitBlocks);
|
|
132
|
+
onPendingSignature?.();
|
|
133
|
+
}
|
|
134
|
+
// createOffer with meta-transaction
|
|
112
135
|
const nonce = Date.now();
|
|
113
136
|
const { r, s, v, functionName, functionSignature } =
|
|
114
|
-
await coreSdk.
|
|
115
|
-
|
|
137
|
+
await coreSdk.signMetaTxCreateOffer({
|
|
138
|
+
createOfferArgs: offerData,
|
|
116
139
|
nonce
|
|
117
140
|
});
|
|
118
|
-
|
|
141
|
+
txResponse = await coreSdk.relayMetaTransaction({
|
|
119
142
|
functionName,
|
|
120
143
|
functionSignature,
|
|
121
144
|
sigR: r,
|
|
@@ -123,71 +146,53 @@ export const CreateOfferButton = ({
|
|
|
123
146
|
sigV: v,
|
|
124
147
|
nonce
|
|
125
148
|
});
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
149
|
+
} else {
|
|
150
|
+
txResponse =
|
|
151
|
+
!hasSellerAccount && seller
|
|
152
|
+
? await coreSdk.createSellerAndOffer(seller, offerData)
|
|
153
|
+
: await coreSdk.createOffer(offerData);
|
|
129
154
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
});
|
|
137
|
-
txResponse = await coreSdk.relayMetaTransaction({
|
|
138
|
-
functionName,
|
|
139
|
-
functionSignature,
|
|
140
|
-
sigR: r,
|
|
141
|
-
sigS: s,
|
|
142
|
-
sigV: v,
|
|
143
|
-
nonce
|
|
155
|
+
onPendingTransaction?.(txResponse.hash, isMetaTx);
|
|
156
|
+
|
|
157
|
+
const txReceipt = await txResponse.wait(waitBlocks);
|
|
158
|
+
const offerId = coreSdk.getCreatedOfferIdFromLogs(txReceipt.logs);
|
|
159
|
+
onSuccess?.(txReceipt as providers.TransactionReceipt, {
|
|
160
|
+
offerIdData: offerId || ""
|
|
144
161
|
});
|
|
145
|
-
} else {
|
|
146
|
-
txResponse =
|
|
147
|
-
!hasSellerAccount && seller
|
|
148
|
-
? await coreSdk.createSellerAndOffer(seller, offerData)
|
|
149
|
-
: await coreSdk.createOffer(offerData);
|
|
150
162
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const offerId = coreSdk.getCreatedOfferIdFromLogs(txReceipt.logs);
|
|
155
|
-
onSuccess?.(txReceipt as providers.TransactionReceipt, {
|
|
156
|
-
offerIdData: offerId || ""
|
|
163
|
+
} catch (error) {
|
|
164
|
+
onError?.(error as Error, {
|
|
165
|
+
txResponse: txResponse as providers.TransactionResponse
|
|
157
166
|
});
|
|
167
|
+
} finally {
|
|
168
|
+
setIsLoading(false);
|
|
158
169
|
}
|
|
159
|
-
} catch (error) {
|
|
160
|
-
onError?.(error as Error, {
|
|
161
|
-
txResponse: txResponse as providers.TransactionResponse
|
|
162
|
-
});
|
|
163
|
-
} finally {
|
|
164
|
-
setIsLoading(false);
|
|
165
170
|
}
|
|
166
|
-
}
|
|
167
|
-
};
|
|
171
|
+
};
|
|
168
172
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
173
|
+
return (
|
|
174
|
+
<Button
|
|
175
|
+
variant={variant}
|
|
176
|
+
size={size}
|
|
177
|
+
disabled={disabled}
|
|
178
|
+
onClick={handleCreateOffer}
|
|
179
|
+
{...rest}
|
|
180
|
+
>
|
|
181
|
+
<ButtonTextWrapper>
|
|
182
|
+
{children || "Create offer"}
|
|
183
|
+
{extraInfo && ((!isLoading && showLoading) || !showLoading) ? (
|
|
184
|
+
<ExtraInfo>{extraInfo}</ExtraInfo>
|
|
185
|
+
) : (
|
|
186
|
+
<>
|
|
187
|
+
{isLoading && showLoading && (
|
|
188
|
+
<LoadingWrapper>
|
|
189
|
+
<Loading />
|
|
190
|
+
</LoadingWrapper>
|
|
191
|
+
)}
|
|
192
|
+
</>
|
|
193
|
+
)}
|
|
194
|
+
</ButtonTextWrapper>
|
|
195
|
+
</Button>
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
);
|
|
@@ -9,6 +9,7 @@ import { Loading } from "../../Loading";
|
|
|
9
9
|
import { ButtonSize } from "../../ui/buttonSize";
|
|
10
10
|
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";
|
|
11
11
|
import { useMetaTx } from "../../../hooks/useMetaTx";
|
|
12
|
+
import { withQueryClientProvider } from "../../queryClient/withQueryClientProvider";
|
|
12
13
|
|
|
13
14
|
type Props = {
|
|
14
15
|
/**
|
|
@@ -19,89 +20,91 @@ type Props = {
|
|
|
19
20
|
offerId: BigNumberish;
|
|
20
21
|
}>;
|
|
21
22
|
|
|
22
|
-
export const VoidButton = (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
export const VoidButton = withQueryClientProvider(
|
|
24
|
+
({
|
|
25
|
+
offerId,
|
|
26
|
+
disabled = false,
|
|
27
|
+
showLoading = false,
|
|
28
|
+
extraInfo,
|
|
29
|
+
onSuccess,
|
|
30
|
+
onError,
|
|
31
|
+
onPendingSignature,
|
|
32
|
+
onPendingTransaction,
|
|
33
|
+
waitBlocks = 1,
|
|
34
|
+
size = ButtonSize.Large,
|
|
35
|
+
variant = "secondaryFill",
|
|
36
|
+
children,
|
|
37
|
+
coreSdkConfig,
|
|
38
|
+
...rest
|
|
39
|
+
}: Props) => {
|
|
40
|
+
const coreSdk = useCoreSdkOverrides({ coreSdkConfig });
|
|
41
|
+
const [isLoading, setIsLoading] = useState<boolean>(false);
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
const { isMetaTx } = useMetaTx(coreSdk);
|
|
42
44
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
return (
|
|
46
|
+
<Button
|
|
47
|
+
variant={variant}
|
|
48
|
+
disabled={disabled}
|
|
49
|
+
size={size}
|
|
50
|
+
onClick={async () => {
|
|
51
|
+
if (!isLoading) {
|
|
52
|
+
let txResponse: TransactionResponse | undefined = undefined;
|
|
53
|
+
try {
|
|
54
|
+
setIsLoading(true);
|
|
55
|
+
onPendingSignature?.();
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
if (isMetaTx) {
|
|
58
|
+
const nonce = Date.now();
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
const { r, s, v, functionName, functionSignature } =
|
|
61
|
+
await coreSdk.signMetaTxVoidOffer({
|
|
62
|
+
offerId,
|
|
63
|
+
nonce
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
txResponse = await coreSdk.relayMetaTransaction({
|
|
67
|
+
functionName,
|
|
68
|
+
functionSignature,
|
|
69
|
+
sigR: r,
|
|
70
|
+
sigS: s,
|
|
71
|
+
sigV: v,
|
|
61
72
|
nonce
|
|
62
73
|
});
|
|
74
|
+
} else {
|
|
75
|
+
txResponse = await coreSdk.voidOffer(offerId);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
onPendingTransaction?.(txResponse.hash, isMetaTx);
|
|
79
|
+
const receipt = await txResponse.wait(waitBlocks);
|
|
63
80
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
sigS: s,
|
|
69
|
-
sigV: v,
|
|
70
|
-
nonce
|
|
81
|
+
onSuccess?.(receipt as providers.TransactionReceipt, { offerId });
|
|
82
|
+
} catch (error) {
|
|
83
|
+
onError?.(error as Error, {
|
|
84
|
+
txResponse: txResponse as providers.TransactionResponse
|
|
71
85
|
});
|
|
72
|
-
}
|
|
73
|
-
|
|
86
|
+
} finally {
|
|
87
|
+
setIsLoading(false);
|
|
74
88
|
}
|
|
75
|
-
|
|
76
|
-
onPendingTransaction?.(txResponse.hash, isMetaTx);
|
|
77
|
-
const receipt = await txResponse.wait(waitBlocks);
|
|
78
|
-
|
|
79
|
-
onSuccess?.(receipt as providers.TransactionReceipt, { offerId });
|
|
80
|
-
} catch (error) {
|
|
81
|
-
onError?.(error as Error, {
|
|
82
|
-
txResponse: txResponse as providers.TransactionResponse
|
|
83
|
-
});
|
|
84
|
-
} finally {
|
|
85
|
-
setIsLoading(false);
|
|
86
89
|
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
</
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
90
|
+
}}
|
|
91
|
+
{...rest}
|
|
92
|
+
>
|
|
93
|
+
<ButtonTextWrapper>
|
|
94
|
+
{children || "Void"}
|
|
95
|
+
{extraInfo && ((!isLoading && showLoading) || !showLoading) ? (
|
|
96
|
+
<ExtraInfo>{extraInfo}</ExtraInfo>
|
|
97
|
+
) : (
|
|
98
|
+
<>
|
|
99
|
+
{isLoading && showLoading && (
|
|
100
|
+
<LoadingWrapper>
|
|
101
|
+
<Loading />
|
|
102
|
+
</LoadingWrapper>
|
|
103
|
+
)}
|
|
104
|
+
</>
|
|
105
|
+
)}
|
|
106
|
+
</ButtonTextWrapper>
|
|
107
|
+
</Button>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
);
|
|
@@ -9,6 +9,7 @@ import { CreateSellerArgs, TransactionResponse } from "@bosonprotocol/common";
|
|
|
9
9
|
import { ButtonSize } from "../../ui/buttonSize";
|
|
10
10
|
import { useCoreSdkOverrides } from "../../../hooks/core-sdk/useCoreSdkOverrides";
|
|
11
11
|
import { useMetaTx } from "../../../hooks/useMetaTx";
|
|
12
|
+
import { withQueryClientProvider } from "../../queryClient/withQueryClientProvider";
|
|
12
13
|
export type ICreateSellerButton = {
|
|
13
14
|
exchangeId: BigNumberish;
|
|
14
15
|
createSellerArgs: CreateSellerArgs;
|
|
@@ -16,93 +17,95 @@ export type ICreateSellerButton = {
|
|
|
16
17
|
exchangeId: BigNumberish;
|
|
17
18
|
}>;
|
|
18
19
|
|
|
19
|
-
export const CreateSellerButton = (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
20
|
+
export const CreateSellerButton = withQueryClientProvider(
|
|
21
|
+
({
|
|
22
|
+
exchangeId,
|
|
23
|
+
disabled = false,
|
|
24
|
+
showLoading = false,
|
|
25
|
+
extraInfo,
|
|
26
|
+
onSuccess,
|
|
27
|
+
onError,
|
|
28
|
+
onPendingSignature,
|
|
29
|
+
onPendingTransaction,
|
|
30
|
+
waitBlocks = 1,
|
|
31
|
+
children,
|
|
32
|
+
size = ButtonSize.Large,
|
|
33
|
+
variant = "accentInverted",
|
|
34
|
+
createSellerArgs,
|
|
35
|
+
coreSdkConfig,
|
|
36
|
+
...rest
|
|
37
|
+
}: ICreateSellerButton) => {
|
|
38
|
+
const coreSdk = useCoreSdkOverrides({ coreSdkConfig });
|
|
39
|
+
const [isLoading, setIsLoading] = useState<boolean>(false);
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
const { isMetaTx } = useMetaTx(coreSdk);
|
|
40
42
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
return (
|
|
44
|
+
<Button
|
|
45
|
+
variant={variant}
|
|
46
|
+
size={size}
|
|
47
|
+
disabled={disabled}
|
|
48
|
+
onClick={async (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
|
|
49
|
+
e.stopPropagation();
|
|
50
|
+
if (!isLoading) {
|
|
51
|
+
let txResponse: TransactionResponse | undefined = undefined;
|
|
52
|
+
try {
|
|
53
|
+
setIsLoading(true);
|
|
54
|
+
onPendingSignature?.();
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
if (isMetaTx) {
|
|
57
|
+
const nonce = Date.now();
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
const { r, s, v, functionName, functionSignature } =
|
|
60
|
+
await coreSdk.signMetaTxCreateSeller({
|
|
61
|
+
createSellerArgs,
|
|
62
|
+
nonce
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
txResponse = await coreSdk.relayMetaTransaction({
|
|
66
|
+
functionName,
|
|
67
|
+
functionSignature,
|
|
68
|
+
sigR: r,
|
|
69
|
+
sigS: s,
|
|
70
|
+
sigV: v,
|
|
60
71
|
nonce
|
|
61
72
|
});
|
|
73
|
+
} else {
|
|
74
|
+
txResponse = await coreSdk.createSeller(createSellerArgs);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
onPendingTransaction?.(txResponse.hash);
|
|
78
|
+
const receipt = await txResponse.wait(waitBlocks);
|
|
62
79
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
nonce
|
|
80
|
+
onSuccess?.(receipt as providers.TransactionReceipt, {
|
|
81
|
+
exchangeId
|
|
82
|
+
});
|
|
83
|
+
} catch (error) {
|
|
84
|
+
onError?.(error as Error, {
|
|
85
|
+
txResponse: txResponse as providers.TransactionResponse
|
|
70
86
|
});
|
|
71
|
-
}
|
|
72
|
-
|
|
87
|
+
} finally {
|
|
88
|
+
setIsLoading(false);
|
|
73
89
|
}
|
|
74
|
-
|
|
75
|
-
onPendingTransaction?.(txResponse.hash);
|
|
76
|
-
const receipt = await txResponse.wait(waitBlocks);
|
|
77
|
-
|
|
78
|
-
onSuccess?.(receipt as providers.TransactionReceipt, {
|
|
79
|
-
exchangeId
|
|
80
|
-
});
|
|
81
|
-
} catch (error) {
|
|
82
|
-
onError?.(error as Error, {
|
|
83
|
-
txResponse: txResponse as providers.TransactionResponse
|
|
84
|
-
});
|
|
85
|
-
} finally {
|
|
86
|
-
setIsLoading(false);
|
|
87
90
|
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
</
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
91
|
+
}}
|
|
92
|
+
{...rest}
|
|
93
|
+
>
|
|
94
|
+
<ButtonTextWrapper>
|
|
95
|
+
{children || "Create Seller"}
|
|
96
|
+
{extraInfo && ((!isLoading && showLoading) || !showLoading) ? (
|
|
97
|
+
<ExtraInfo>{extraInfo}</ExtraInfo>
|
|
98
|
+
) : (
|
|
99
|
+
<>
|
|
100
|
+
{isLoading && showLoading && (
|
|
101
|
+
<LoadingWrapper>
|
|
102
|
+
<Loading />
|
|
103
|
+
</LoadingWrapper>
|
|
104
|
+
)}
|
|
105
|
+
</>
|
|
106
|
+
)}
|
|
107
|
+
</ButtonTextWrapper>
|
|
108
|
+
</Button>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
);
|