Skip to content
Draft
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
6bba49c
very hack proof-of-concept of a batch call
kasparkallas Sep 5, 2023
426ed67
add reference to SuperUpgrader and the permit token
kasparkallas Sep 5, 2023
04cbb36
update viem & wagmi
kasparkallas Sep 6, 2023
651534b
working with batch call and signature
kasparkallas Sep 6, 2023
d930617
working last contract solution
kasparkallas Sep 7, 2023
84d91f1
add goerli support
kasparkallas Sep 8, 2023
7b40528
make batch call payable
kasparkallas Sep 8, 2023
5cbb9bd
handle non-permit tokens
kasparkallas Sep 8, 2023
4142377
make it possible to unbatch
kasparkallas Sep 8, 2023
80969c2
add error logging
kasparkallas Sep 8, 2023
a124605
Revert "add error logging"
kasparkallas Sep 8, 2023
e5922d7
merge master
kasparkallas Sep 15, 2023
355bfa7
fix rendering issue
kasparkallas Sep 15, 2023
81017eb
improve transaction handling for robustness and fail-modes
kasparkallas Sep 15, 2023
9e8b9e3
merge transaction improvement branch
kasparkallas Sep 15, 2023
e5f558a
ui clean-up
kasparkallas Sep 15, 2023
e81876a
merge
kasparkallas Sep 15, 2023
435702e
generate for new contract
kasparkallas Sep 15, 2023
3056bcd
change function call
kasparkallas Sep 15, 2023
bde00ab
add force write btn
kasparkallas Sep 16, 2023
445cf65
improve TX handling
kasparkallas Sep 18, 2023
267bc3e
giMerge remote-tracking branch 'origin/master' into transaction-handl…
kasparkallas Sep 18, 2023
935841d
merge
kasparkallas Sep 18, 2023
623a851
add spacing and borders to list items
kasparkallas Sep 18, 2023
87e9c37
handle feedback
kasparkallas Sep 18, 2023
a461379
show skip button when TX fails
kasparkallas Sep 18, 2023
490712d
enlarge close button
kasparkallas Sep 18, 2023
a15ee91
flip the condition
kasparkallas Sep 18, 2023
2be5f6f
move transaction view title closer to the close icon
kasparkallas Sep 18, 2023
5daabd6
don't go out of bounds of the array
kasparkallas Sep 19, 2023
965dddc
add error boundary
kasparkallas Sep 19, 2023
355071f
be more forceful with the force transaction btn
kasparkallas Sep 19, 2023
14680f8
concat with errors abi to give viem/wagmi info for decoding
kasparkallas Sep 19, 2023
b3e4001
remove hover and add check when completed
kasparkallas Sep 19, 2023
3bf1bf2
merge
kasparkallas Sep 19, 2023
123492d
Fix create flow and modify flow cases
Sep 19, 2023
304a7a2
Merge branch 'master' into transaction-handling-improvements-for-gnos…
Sep 19, 2023
e71f968
Fix up approval test case
Sep 19, 2023
2193641
update contract address
kasparkallas Sep 19, 2023
7354d45
merge master
kasparkallas Sep 20, 2023
0bf351d
clean-up
kasparkallas Sep 20, 2023
2f3f085
fix status colors
kasparkallas Sep 20, 2023
0a81ad2
guarantee transactions are mapped before proceeding
kasparkallas Sep 20, 2023
928aa2b
Fix up test cases again
Sep 20, 2023
dba4a14
small clean-up
kasparkallas Sep 20, 2023
de24bbd
Merge branch 'transaction-handling-improvements-for-gnosis-safe' of h…
kasparkallas Sep 20, 2023
231df78
use cacheOnBlock when mapping commands
kasparkallas Sep 20, 2023
46a3778
merge
kasparkallas Sep 20, 2023
5d35a03
Adjust the icon colors
Sep 20, 2023
895ac7b
Merge branch 'transaction-handling-improvements-for-gnosis-safe' of h…
Sep 20, 2023
101225d
fix duplicate contract writes
kasparkallas Sep 20, 2023
63d71cf
re-render when fetch status changes
kasparkallas Sep 20, 2023
04b575b
merge
kasparkallas Sep 20, 2023
06eeba8
add cache key and stale time to tx preparation
kasparkallas Sep 21, 2023
58faa66
merge
kasparkallas Sep 21, 2023
0e89f30
move batch call switch
kasparkallas Sep 21, 2023
c3af8e7
fix batch call
kasparkallas Sep 21, 2023
ee1769f
the definite working solution for batch call
kasparkallas Sep 22, 2023
c0fd457
refactor for better readability
kasparkallas Sep 22, 2023
a3dbfae
add link to mint permit underlying token & use permit super token as …
kasparkallas Sep 22, 2023
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
Prev Previous commit
Next Next commit
add force write btn
  • Loading branch information
kasparkallas authored Sep 16, 2023
commit bde00abc3d55fb48567692cc88f66fa6cb8142a6
28 changes: 21 additions & 7 deletions packages/widget/src/ContractWriteButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { LoadingButton } from "@mui/lab";
import { Alert, Button, Collapse, Stack } from "@mui/material";
import { useCallback, useEffect, useState } from "react";
import {
BaseError,
ContractFunctionExecutionError,
ContractFunctionRevertedError,
ContractFunctionZeroDataError,
Expand All @@ -29,6 +28,7 @@ export default function ContractWriteButton({
prepareResult,
writeResult,
transactionResult,
currentError,
}: ContractWriteButtonProps) {
const { eventListeners } = useWidget();
const write = writeResult.write;
Expand Down Expand Up @@ -79,6 +79,10 @@ export default function ContractWriteButton({
}
}, [transactionResult.isLoading, handleNextWrite]);

const isPrepareError = Boolean(
currentError && currentError === prepareResult.error,
);

return (
<Stack
direction="column"
Expand All @@ -98,17 +102,15 @@ export default function ContractWriteButton({
</Button>
) : (
<>
<Collapse in={isSeriousPrepareError}>
<Alert severity="error">
{(prepareResult.error as BaseError)?.shortMessage}
</Alert>
<Collapse in={!!currentError}>
<Alert severity="error">{currentError?.shortMessage}</Alert>
</Collapse>
{isSeriousPrepareError ? (
{isPrepareError ? (
<Button
variant="contained"
size="large"
fullWidth
onClick={() => prepareResult?.refetch()}
onClick={() => prepareResult.refetch()}
endIcon={<ReplayIcon />}
>
Transaction preparation failed. Retry?
Expand Down Expand Up @@ -136,11 +138,23 @@ export default function ContractWriteButton({
{/* {contractWrite.displayTitle} */}
</LoadingButton>
)}
<Collapse in={Boolean(isPrepareError && write)}>
<Button
variant="text"
size="large"
color="error"
fullWidth
onClick={() => write?.()}
>
Force transaction?
</Button>
</Collapse>
<Collapse in={showNextWriteButton}>
<Button
variant="text"
size="large"
fullWidth
color="warning"
onClick={handleNextWrite}
endIcon={<SkipNextIcon />}
>
Expand Down