v2.0.0-rc.1 release candidate
The API is frozen and later candidates carry fixes only, except the receipt-free and Safe create surface of /fhe-airdrop, which is @beta. Published on the next dist-tag; latest stays on 1.6.0 until 2.0.0.Disperse 2.0 · Events · 21@tokenops/sdk/fhe-disperse
Disperse 2.0 event reference.
The contracts are unchanged from the 1.x line. What changed is how strictly the SDK reads them: a receipt without the event a write depends on now throws ReceiptEventNotFoundError, and a repeated one ReceiptEventAmbiguousError. With waitForReceipt: false, read these logs from the executed transaction yourself.
Registration· 2
| Event | Args | Emitted on |
|---|---|---|
| UserRegistered | (indexed user, wallet0, wallet1) | register succeeds. The SDK reads only the event naming the caller: none throws DisperseSubwalletNotFoundError, more than one ReceiptEventAmbiguousError. |
| Initialized | (version) | A subwallet clone is initialized during register (emitted by the subwallet, not the singleton). |
Dispersal· 3
| Event | Args | Emitted on |
|---|---|---|
| ConfidentialTokensDispersed | (indexed token, indexed sender, recipientCount, feeType) | One summary event per disperse; feeType records the fee path. |
| WalletDistribution | (indexed sender, wallet, recipients, requested, transferred) | Wallet-mode disperse (disperseConfidentialTokens / disperseConfidentialTokensWithTokenFee); up to two per call, each carrying the subwallet plus the recipients, requested and transferred arrays. Parsed into DisperseResult.distributions. |
| DirectDistribution | (indexed sender, recipients, requested, transferred) | disperseConfidentialTokenDirect succeeds; one per call. A disperse receipt with neither distribution event throws ReceiptEventNotFoundError. |
Disclosure· 1
| Event | Args | Emitted on |
|---|---|---|
| HandlesDisclosedToParty | (indexed discloser, indexed party, handles) | discloseHandleToParty / batchDiscloseHandlesToParty succeed. Parsed into DisclosureResult; missing throws ReceiptEventNotFoundError, repeated ReceiptEventAmbiguousError. |
Fees + limits· 8
| Event | Args | Emitted on |
|---|---|---|
| CustomFeeSet | (indexed user, gasFee, tokenFee) | setCustomFee succeeds. |
| CustomFeeDisabled | (indexed user) | disableCustomFee succeeds. |
| FeeConfigUpdated | (config) | setFeeConfig succeeds. |
| GasFeeWithdrawn | (indexed to, amount) | withdrawGasFee succeeds. |
| TokenFeeWithdrawn | (indexed token, indexed to, amount) | withdrawTokenFee succeeds. Carries the transferred handle; a receipt without it throws ReceiptEventNotFoundError. |
| MaxBatchSizeDirectUpdated | (oldSize, newSize) | setMaxBatchSizeDirect succeeds. |
| MaxBatchSizeHoldingUpdated | (oldSize, newSize) | setMaxBatchSizeHolding succeeds. |
| MaxBatchSizeTokenFeeUpdated | (oldSize, newSize) | setMaxBatchSizeTokenFee succeeds. |
Recovery + admin· 4
| Event | Args | Emitted on |
|---|---|---|
| Paused | (account) | pause succeeds. |
| Unpaused | (account) | unpause succeeds. |
| ConfidentialTokensRescued | (indexed token, indexed to) | rescueConfidentialTokens succeeds (WITHDRAWER_ROLE). |
| ERC20Rescued | (indexed token, indexed to, amount) | rescueERC20 succeeds (WITHDRAWER_ROLE). |
Roles· 3
| Event | Args | Emitted on |
|---|---|---|
| RoleGranted | (indexed role, indexed account, indexed sender) | grantRole succeeds. |
| RoleRevoked | (indexed role, indexed account, indexed sender) | revokeRole / renounceRole succeeds. |
| RoleAdminChanged | (indexed role, indexed previousAdminRole, indexed newAdminRole) | The admin role of a role is reassigned (AccessControl). |
parseEventLogs({ abi, logs }) and persist by topic. The ACL.Allowed event from the FHE coprocessor is the canonical source for handle ownership — see the indexing events recipe (coming soon).Browse recipes