diff --git a/apps/docs/docs/getting-started/mutation.md b/apps/docs/docs/getting-started/mutation.md index cffa7592..e4ba7e24 100644 --- a/apps/docs/docs/getting-started/mutation.md +++ b/apps/docs/docs/getting-started/mutation.md @@ -50,7 +50,7 @@ const [clearIdentityState, clearIdentity] = useMutation((tx) => tx.Identity.clear_identity(), ); -clearIdentity(accounts.at(0)?.polkadotSigner); +clearIdentity({ signer: accounts.at(0)?.polkadotSigner }); ``` ## Submitting transaction diff --git a/packages/react/src/hooks/useMutation.ts b/packages/react/src/hooks/useMutation.ts index 6ab86066..5a482796 100644 --- a/packages/react/src/hooks/useMutation.ts +++ b/packages/react/src/hooks/useMutation.ts @@ -59,13 +59,14 @@ export function useMutation< const submit = useAtomCallback< void, - [from?: PolkadotSigner, options?: TxOptions>] + [options?: TxOptions> & { signer: PolkadotSigner }] >( useCallback( - async (get, _set, submitSigner, submitOptions) => { + async (get, _set, submitOptions) => { setState(PENDING); - const signer = submitSigner ?? options?.signer ?? contextSigner; + const signer = + submitOptions?.signer ?? options?.signer ?? contextSigner; if (signer === undefined) { throw new MutationError("No signer provided");