Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c493972
fix: re-enable tokens in example app
alexshchur Mar 4, 2026
efeddec
fix: shielding: simulate before trying to sign a tx, parse error if p…
alexshchur Mar 4, 2026
0a179e3
fix: human-readable errors in tx status too
alexshchur Mar 4, 2026
f556600
fix: add simulate before writing in each write contract hook: shield,…
alexshchur Mar 5, 2026
c799be9
fix: make simulations mandatory for now inside migration fns
alexshchur Mar 5, 2026
736a1c2
fix: remove "Simulating transaction..." status updates from useCofheT…
alexshchur Mar 5, 2026
e807e24
Merge branch 'master' of https://github.com/FhenixProtocol/cofhesdk i…
alexshchur Mar 17, 2026
5b4389f
chore: remove unneeded type assertion
alexshchur Mar 17, 2026
e27c7b7
feat: react: disable 'write contract' button for non-encrypted txs (s…
alexshchur Mar 17, 2026
adee4eb
chore: memoize shield call args in ShieldPageV2
alexshchur Mar 18, 2026
0372c51
chore: cleanup logs
alexshchur Mar 18, 2026
8ca6867
chore: memoize unshield and claim call args in ShieldPageV2
alexshchur Mar 18, 2026
722f5e3
chore: move normalizeSanitizedAmountForUnits to util file
alexshchur Mar 18, 2026
46fb7b8
chore: get rid of some type assertions
alexshchur Mar 18, 2026
51a5e66
chore: better typing for simulations hook
alexshchur Mar 18, 2026
b431601
feat: react: display error message from simulation in shield flow (TO…
alexshchur Mar 18, 2026
9178203
fix: react: no need to retry on simulation fail
alexshchur Mar 18, 2026
449f06c
feat: decouple approval tx from shield tx
alexshchur Mar 18, 2026
1a05102
chore: token allowance hook
alexshchur Mar 19, 2026
b5133ef
feat: add approval tx with proper cache invalidation
alexshchur Mar 19, 2026
6276631
fix: can't shield because the allowance is not updated after approval…
alexshchur Mar 19, 2026
f931362
fix: another attempt: can't shield because the allowance is not updat…
alexshchur Mar 19, 2026
f5bb555
fix: no need to wait 3 extra blocks (experimentally)
alexshchur Mar 19, 2026
7b6311e
Merge branch 'master' of https://github.com/FhenixProtocol/cofhesdk i…
alexshchur Mar 23, 2026
5df290c
Merge branch 'fix/simulate-before-writing' of https://github.com/Fhen…
alexshchur Mar 23, 2026
78a2a12
chore: revert to better var name
alexshchur Mar 23, 2026
37754f3
chore: DRY a conditional
alexshchur Mar 23, 2026
dc21232
chore: DRY up some bigint serialization logic
alexshchur Mar 23, 2026
b2e859c
chore: add serializeBigint utility function
alexshchur Mar 23, 2026
aa31d7b
chore: substitute custom function by viem.parseUnits and cleanup
alexshchur Mar 23, 2026
5336b03
Merge branch 'fix/pre-simulation' of https://github.com/FhenixProtoco…
alexshchur Mar 23, 2026
3b71c8a
chore: extract useApproveWithLifecycle
alexshchur Mar 23, 2026
893a778
chore: extract useCofheTokenApprove from ShieldPageV2
alexshchur Mar 23, 2026
bbb4d4e
fix: don't overwrite error state for shielding function with sim errors
alexshchur Mar 23, 2026
656db15
chore: cleanup
alexshchur Mar 23, 2026
26d91d0
fix: display simulation errors on shield page
alexshchur Mar 23, 2026
1278d38
Merge pull request #181 from FhenixProtocol/fix/decouple-approval-on-…
alexshchur Mar 24, 2026
bcb1ab4
Merge pull request #180 from FhenixProtocol/fix/pre-simulation
alexshchur Mar 24, 2026
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
10 changes: 5 additions & 5 deletions examples/react/src/utils/cofhe.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ const cofheConfig = createCofheConfig({
// 11155111: '0x87A3effB84CBE1E4caB6Ab430139eC41d156D55A', // sepolia weth
// 84532: '0xbED96aa98a49FeA71fcC55d755b915cF022a9159', // base sepolia weth
// },
// tokenLists: {
// 11155111: ['https://storage.googleapis.com/cofhesdk/sepolia.json'],
// 84532: ['https://storage.googleapis.com/cofhesdk/base-sepolia.json'],
// 421613: ['https://tokens.cofhe.io/arbitrum-sepolia.json'],
// },
tokenLists: {
11155111: ['https://storage.googleapis.com/cofhesdk/sepolia.json'],
84532: ['https://storage.googleapis.com/cofhesdk/base-sepolia.json'],
421613: ['https://tokens.cofhe.io/arbitrum-sepolia.json'],
},
},
});

Expand Down
1 change: 1 addition & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
},
"dependencies": {
"@cofhe/sdk": "workspace:*",
"@fhenixprotocol/cofhe-errors": "^1.0.2",
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-select": "^2.2.6",
"@tanstack/query-async-storage-persister": "^5.90.22",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const ActionIcon: React.FC<{ actionType: TransactionActionType }> = ({ actionTyp
return <TbShieldMinus className={iconClassName} />;
case TransactionActionType.Claim:
return <TbShieldCheck className={iconClassName} />;
case TransactionActionType.Approve:
return <GoArrowUpRight className={iconClassName} />;
default:
return <GoArrowUpRight className={iconClassName} />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import { CofheTokenConfidentialBalance } from '../components';
import { useCofheTokensWithExistingEncryptedBalances, type Token } from '@/hooks';
import { getStepConfig } from '@/hooks/useCofheEncrypt';
import { FloatingButtonPage } from '../pagesConfig/types';
import { cofheHumanizeViemError } from '@/utils/cofheErrors';
import { useOnceTransactionMined } from '@/hooks/useOnceTransactionMined';
import { usePortalModals, usePortalNavigation } from '@/stores';
import { PageContainer } from '../components/PageContainer';
Expand All @@ -26,7 +26,7 @@

declare module '../pagesConfig/types' {
interface FloatingButtonPagePropsRegistry {
[FloatingButtonPage.Send]: SendPageProps;

Check warning on line 29 in packages/react/src/components/FnxFloatingButton/pages/SendPage.tsx

View workflow job for this annotation

GitHub Actions / Linting

'FloatingButtonPage' is not defined
}
}

Expand All @@ -49,7 +49,8 @@
},
} = useCofheTokenTransfer({
onError: (error) => {
const errorMessage = error instanceof Error ? error.message : 'Failed to send tokens';
const errorMessage =
cofheHumanizeViemError(error) ?? (error instanceof Error ? error.message : 'Failed to send tokens');
setError(errorMessage);
console.error('Send tx submit error:', error);
},
Expand Down Expand Up @@ -121,6 +122,7 @@

const { tokensWithExistingEncryptedBalance } = useCofheTokensWithExistingEncryptedBalances();

const disabled = !isValidAddress || !isValidAmount || isSending || isEncryptingInput;
return (
<PageContainer
header={
Expand Down Expand Up @@ -249,13 +251,11 @@
footer={
<button
onClick={handleSend}
disabled={!isValidAddress || !isValidAmount || isSending || isEncryptingInput}
disabled={disabled}
className={cn(
'fnx-send-button w-full py-3 px-4 font-small',
'flex items-center justify-center gap-2',
isValidAddress && isValidAmount && !isSending && !isEncryptingInput
? 'fnx-send-button-enabled'
: 'fnx-send-button-disabled'
disabled ? 'fnx-send-button-disabled' : 'fnx-send-button-enabled'
)}
>
<span>Send</span>
Expand Down
Loading
Loading