Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
154241a
feat: enhance FallbackPurchaseUI with WaaS fee options integration
mithatakbulut Sep 17, 2025
caec965
fix: improve transaction steps handling by incorporating allowance lo…
mithatakbulut Sep 18, 2025
8f38992
fix format
mithatakbulut Sep 18, 2025
a7bc231
refactor: streamline FallbackPurchaseUI component and improve button …
mithatakbulut Sep 18, 2025
87dda1b
temp: keep `0xsequence/connect/useWaasFeeOptions` until it's fixed in…
mithatakbulut Sep 18, 2025
3d64d86
renamve `useSelectWaasFeeOptions` to have .tsx extension to render Re…
mithatakbulut Sep 18, 2025
6f4001d
refactor waasFeeOption hooks. remove local repetative states, respect…
mithatakbulut Sep 18, 2025
2ddca41
bundle approval + purchase transactions for Sequence embedded wallets…
mithatakbulut Sep 18, 2025
22ec0a8
temp: add necessary sequence packages for useWaasFeeOptions to work
mithatakbulut Sep 18, 2025
c827115
rename useExecutePurchaseWithWaas and add error handling
mithatakbulut Sep 19, 2025
d88017e
add missing type `Transaction`. set `isExecuting` to false once an er…
mithatakbulut Sep 19, 2025
f49b51e
fix SelectWaasFeeOptions.test.tsx
mithatakbulut Sep 19, 2025
dea7388
Update BuyModal to support additional hash types
mithatakbulut Sep 19, 2025
ef0b783
biome-check
mithatakbulut Sep 19, 2025
af2b247
redo type change in Buy Modal store
mithatakbulut Sep 19, 2025
5eb70c4
take 0xtrails package back
mithatakbulut Sep 19, 2025
dadcb13
fix tests: Refactor transaction hooks to maintain backwards compatibi…
mithatakbulut Sep 19, 2025
490e164
remove waas fee selection components and hooks from FallabckPurcaseUI
mithatakbulut Sep 19, 2025
1e7e8a3
remove sequence/hooks and change useWaasFeeOptions to accept requeire…
mithatakbulut Sep 19, 2025
082bfa1
Enhance BuyModalContent to handle pending fee option rejection
mithatakbulut Sep 19, 2025
7347a9b
fix type check: indexer client import of useExecutePurchaseWithwaas
mithatakbulut Sep 19, 2025
65ae74e
Add ErrorLogBox component and integrate error handling in FallbackPur…
mithatakbulut Sep 19, 2025
aa220c9
move ErrorLogBox to more general directory, internal components
mithatakbulut Sep 19, 2025
57fadc3
fix type check usewaasfeeoptionmanager
mithatakbulut Sep 19, 2025
2cf81ed
fix import of error log box
mithatakbulut Sep 19, 2025
239a857
value is not required. remove any from mockCurrencyBalance in test
mithatakbulut Sep 19, 2025
fe2d334
manage display of approve button for sequence wallets. refactor `exec…
mithatakbulut Sep 22, 2025
7d6957d
rename the hook to useExecuteBundledTransactions.ts
mithatakbulut Sep 22, 2025
024cc55
only bundle transactions if there is an approval step
mithatakbulut Sep 22, 2025
3463abe
Refactor useWaasFeeOptions return type from array to object
mithatakbulut Sep 22, 2025
b298be7
Refactor useWaasFeeOptions to utilize a centralized state management …
mithatakbulut Sep 22, 2025
0f21806
move useWaasFeeOptions into hooks directory
mithatakbulut Sep 22, 2025
ce0e733
use currency image
mithatakbulut Sep 23, 2025
73b684c
fix sufficient balance hook to work well for free value
mithatakbulut Sep 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13,816 changes: 3,801 additions & 10,015 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ catalog:
'@0xsequence/indexer': ^2.3.27
'@0xsequence/metadata': ^2.3.27
'@0xsequence/network': ^2.3.27
'@0xsequence/waas': ^2.3.27
'@0xsequence/wallet-widget': ^5.3.14
'@arethetypeswrong/cli': ^0.18.2
'@biomejs/biome': ^2.2.3
Expand Down
1 change: 1 addition & 0 deletions sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"@0xsequence/design-system": "catalog:",
"@0xsequence/indexer": "catalog:",
"@0xsequence/metadata": "catalog:",
"@0xsequence/waas": "catalog:",
"@0xsequence/network": "catalog:",
"@google/model-viewer": "catalog:",
"@tanstack/react-query": "catalog:",
Expand Down
7 changes: 7 additions & 0 deletions sdk/src/react/_internal/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Hex } from 'viem';
import type { ContractType, CreateReq } from '../../types';
import type { MarketplaceKind } from './api';

Expand All @@ -9,6 +10,12 @@ export type CollectableId = string | number;

export type CollectionType = ContractType.ERC1155 | ContractType.ERC721;

export interface Transaction {
to: Hex;
data?: Hex;
value?: bigint;
}

type TransactionStep = {
exist: boolean;
isExecuting: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ describe('useGenerateCancelTransaction', () => {
await waitFor(() => {
expect(onSuccess).toHaveBeenCalledWith(
createMockSteps([StepType.cancel]),
defaultArgs,
undefined,
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ export const useGenerateCancelTransaction = (
const config = useConfig();

const { mutate, mutateAsync, ...result } = useMutation({
onSuccess: params.onSuccess,
onSuccess: (data) => {
// Only pass the data (steps) to the user's onSuccess callback to maintain backwards compatibility
if (params.onSuccess) {
params.onSuccess(data);
}
},
mutationFn: (args: GenerateCancelTransactionArgsWithNumberChainId) =>
generateCancelTransaction(args, config),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,6 @@ describe('useGenerateListingTransaction', () => {
"value": "0",
},
],
{
"additionalFees": [],
"collectionAddress": "0x0000000000000000000000000000000000000000",
"contractType": "ERC721",
"listing": {
"currencyAddress": "0x0000000000000000000000000000000000000000",
"expiry": 2024-12-31T00:00:00.000Z,
"pricePerToken": "1000000000000000000",
"quantity": "1",
"tokenId": "1",
},
"orderbook": "sequence_marketplace_v2",
"owner": "0x0000000000000000000000000000000000000000",
},
undefined,
]
`);
});
Expand Down Expand Up @@ -112,21 +97,6 @@ describe('useGenerateListingTransaction', () => {
"value": "0",
},
],
{
"additionalFees": [],
"collectionAddress": "0x0000000000000000000000000000000000000000",
"contractType": "ERC721",
"listing": {
"currencyAddress": "0x0000000000000000000000000000000000000000",
"expiry": 2024-12-31T00:00:00.000Z,
"pricePerToken": "1000000000000000000",
"quantity": "1",
"tokenId": "1",
},
"orderbook": "sequence_marketplace_v2",
"owner": "0x0000000000000000000000000000000000000000",
},
undefined,
]
`);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ export const useGenerateListingTransaction = (
const config = useConfig();

const { mutate, mutateAsync, ...result } = useMutation({
onSuccess: params.onSuccess,
onSuccess: (data) => {
// Only pass the data (steps) to the user's onSuccess callback to maintain backwards compatibility
if (params.onSuccess) {
params.onSuccess(data);
}
},
mutationFn: (
args: Omit<GenerateListingTransactionArgsWithNumberChainId, 'chainId'>,
) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,6 @@ describe('useGenerateSellTransaction', () => {
"value": "0",
},
],
{
"additionalFees": [],
"collectionAddress": "0x0000000000000000000000000000000000000000",
"contractType": "ERC721",
"marketplace": "sequence_marketplace_v2",
"orderbook": "sequence_marketplace_v2",
"ordersData": [
{
"orderId": "1",
"quantity": "1",
},
],
"seller": "0x0000000000000000000000000000000000000000",
},
undefined,
]
`);
});
Expand All @@ -91,8 +76,6 @@ describe('useGenerateSellTransaction', () => {
await waitFor(() => {
expect(mockOnSuccess).toHaveBeenCalledWith(
createMockSteps([StepType.tokenApproval, StepType.sell]),
mockTransactionProps,
undefined,
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ export const useGenerateSellTransaction = (
const config = useConfig();

const { mutate, mutateAsync, ...result } = useMutation({
onSuccess: params.onSuccess,
onSuccess: (data) => {
// Only pass the data (steps) to the user's onSuccess callback to maintain backwards compatibility
if (params.onSuccess) {
params.onSuccess(data);
}
},
mutationFn: (
args: Omit<GenerateSellTransactionArgsWithNumberChainId, 'chainId'>,
) => generateSellTransaction({ ...args, chainId: params.chainId }, config),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function usePrimarySaleTransactionSteps({
});

// Check allowance if using ERC20
const { data: allowance } = useReadContract({
const { data: allowance, isLoading: allowanceLoading } = useReadContract({
address: paymentToken,
abi: ERC20_ABI,
functionName: 'allowance',
Expand Down Expand Up @@ -138,7 +138,7 @@ export function usePrimarySaleTransactionSteps({

return steps;
},
enabled: enabled && !!buyer && !!abi && !abiLoading,
enabled: enabled && !!buyer && !!abi && !abiLoading && !allowanceLoading,
});
}

Expand Down
Loading