Hook for interacting with smart contracts using paymasters to cover gas fees.
Use the useWriteContractSponsored hook to initiate transactions on smart contracts with the transaction gas fees sponsored by a
paymaster.It uses the useWriteContract hook from wagmi
under the hood.
Import
import { useWriteContractSponsored } from "@abstract-foundation/agw-react";
Usage
import { useWriteContractSponsored } from "@abstract-foundation/agw-react";import { getGeneralPaymasterInput } from "viem/zksync";import type { Abi } from "viem";const contractAbi: Abi = [ /* Your contract ABI here */];export default function App() { const { writeContractSponsored, data, error, isSuccess, isPending } = useWriteContractSponsored(); const handleWriteContract = () => { writeContractSponsored({ abi: contractAbi, address: "0xC4822AbB9F05646A9Ce44EFa6dDcda0Bf45595AA", functionName: "mint", args: ["0x273B3527BF5b607dE86F504fED49e1582dD2a1C6", BigInt(1)], paymaster: "0x5407B5040dec3D339A9247f3654E59EEccbb6391", paymasterInput: getGeneralPaymasterInput({ innerInput: "0x", }), }); }; return ( <div> <button onClick={handleWriteContract} disabled={isPending}> {isPending ? "Processing..." : "Execute Sponsored Transaction"} </button> {isSuccess && <div>Transaction Hash: {data}</div>} {error && <div>Error: {error.message}</div>} </div> );}
Returns
Returns a UseWriteContractSponsoredReturnType<Config, unknown>.
Show properties
function
Synchronous function to submit a transaction to a smart contract with gas
fees sponsored by a paymaster.
function
Asynchronous function to submit a transaction to a smart contract with gas
fees sponsored by a paymaster.
Hex | undefined
The transaction hash of the sponsored transaction.
WriteContractErrorType | null
The error if the transaction failed.
boolean
Indicates if the transaction was successful.
boolean
Indicates if the transaction is currently pending.
unknown
Additional context information about the transaction.
number
The number of times the transaction has failed.
WriteContractErrorType | null
The reason for the transaction failure, if any.
boolean
Indicates if the transaction resulted in an error.
boolean
Indicates if the hook is in an idle state (no transaction has been initiated).
boolean
Indicates if the transaction processing is paused.
() => void
A function to clean the mutation internal state (i.e., it resets the mutation
to its initial state).
'idle' | 'pending' | 'success' | 'error'
The current status of the transaction.
'idle' initial status prior to the mutation function executing.
'pending' if the mutation is currently executing.
'error' if the last mutation attempt resulted in an error.
'success' if the last mutation attempt was successful.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Abstract","colors":{"primary":"#0D9373","light":"#07C983","dark":"#0D9373"},"logo":{"light":"https://mintcdn.com/abstract/DVQXlXAnGWn0I2rD/logo/light.svg?fit=max\u0026auto=format\u0026n=DVQXlXAnGWn0I2rD\u0026q=85\u0026s=38a6db7ffacc552b39842e1f9c6eacb3","dark":"https://mintcdn.com/abstract/DVQXlXAnGWn0I2rD/logo/dark.svg?fit=max\u0026auto=format\u0026n=DVQXlXAnGWn0I2rD\u0026q=85\u0026s=1c8ad3ffd9051953c017c7b4518ca5f9"},"favicon":"https://mintcdn.com/abstract/DVQXlXAnGWn0I2rD/favicon.svg?fit=max\u0026auto=format\u0026n=DVQXlXAnGWn0I2rD\u0026q=85\u0026s=ee7f2c612a28c072296c08f56da877d1","background":{"decoration":"grid"},"footer":{"socials":{"x":"https://x.com/abstractchain","discord":"https://discord.com/invite/abstractchain","github":"https://github.com/abstract-foundation"}},"banner":{"content":"Abstract Chain is shutting down. Start migrating your assets. [Migrate](https://migrate.abs.xyz)","dismissible":false},"contextual":{"options":["copy","chatgpt","claude","mcp","cursor"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"abstract","hasAudioNarration":false,"actualSubdomain":"abstract","customDomains":["docs.abs.xyz"],"gitSource":{"type":"github","owner":"abstract-foundation","repo":"abstract-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"issues":true,"edits":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ac54e1abf1a1138cf6134b8","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"API Reference","count":55},{"language":"default","tag":"Documentation","count":51},{"language":"default","tag":"Abstract Global Wallet","count":40},{"language":"default","tag":"How Abstract Works","count":24},{"language":"default","tag":"Ethereum API","count":24},{"language":"default","tag":"ZKSync API","count":24},{"language":"default","tag":"Ecosystem","count":20},{"language":"default","tag":"AI Agents","count":18},{"language":"default","tag":"Build on Abstract","count":17},{"language":"default","tag":"Smart Contracts","count":12}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#banner{padding:8px 16px;background:#19e783;font-size:12px;line-height:18px;font-weight:500;letter-spacing:-0.12px}#banner,#banner *{-webkit-text-fill-color:#181818}#banner>div{width:100%;margin:0}#banner p{display:flex;align-items:center;justify-content:center;gap:16px}#banner a{display:inline-flex;flex-shrink:0;align-items:center;gap:4px;height:24px;padding:0 8px;border-radius:100px;background:#fff;text-decoration:none!important;white-space:nowrap;box-shadow:0 6px 10px -4px rgba(0, 0, 0, 0.12),\n 0 0 0 1px rgba(0, 0, 0, 0.05);transition:background-color 0.2s ease,\n -webkit-text-fill-color 0.2s ease}#banner a::after{content:'';width:16px;height:16px;background-color:#181818;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5.75 3C5.33579 3 5 3.33579 5 3.75C5 4.16421 5.33579 4.5 5.75 4.5H10.4393L3.21967 11.7197C2.92678 12.0126 2.92678 12.4874 3.21967 12.7803C3.51256 13.0732 3.98744 13.0732 4.28033 12.7803L11.5 5.56066V10.25C11.5 10.6642 11.8358 11 12.25 11C12.6642 11 13 10.6642 13 10.25V3.75C13 3.33579 12.6642 3 12.25 3H5.75Z'/%3E%3C/svg%3E\")\n center / 16px 16px no-repeat;transition:background-color 0.2s ease}#banner a:hover{background:#181818;-webkit-text-fill-color:#fff}#banner a:hover::after{background-color:#fff}@media (max-width: 1023px){#banner{padding:16px}#banner p{justify-content:space-between;gap:8px;text-align:left}}"}]}
{"page":{"pagePath":"abstract-global-wallet/agw-react/hooks/useWriteContractSponsored","slug":"/abstract-global-wallet/agw-react/hooks/useWriteContractSponsored","pageMetadata":{"title":"useWriteContractSponsored","description":"Hook for interacting with smart contracts using paymasters to cover gas fees.","href":"/abstract-global-wallet/agw-react/hooks/useWriteContractSponsored"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Hook for interacting with smart contracts using paymasters to cover gas fees.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Use the `,_jsx(_components.code,{children:`useWriteContractSponsored`}),` hook to initiate transactions on smart contracts with the transaction gas fees sponsored by a\n`,_jsx(_components.a,{href:`/how-abstract-works/native-account-abstraction/paymasters`,children:`paymaster`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`It uses the `,_jsx(_components.a,{href:`https://wagmi.sh/react/api/hooks/useWriteContract`,children:`useWriteContract`}),` hook from `,_jsx(_components.a,{href:`https://wagmi.sh/`,children:`wagmi`}),`\nunder the hood.`]}),`\n`,_jsx(Heading,{level:`2`,id:`import`,children:`Import`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`tsx`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`tsx`,children:_jsxs(_components.code,{language:`tsx`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`useWriteContractSponsored`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@abstract-foundation/agw-react\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`usage`,children:`Usage`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`35`,language:`tsx`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`tsx`,children:_jsxs(_components.code,{language:`tsx`,numberOfLines:`35`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`useWriteContractSponsored`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@abstract-foundation/agw-react\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`getGeneralPaymasterInput`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"viem/zksync\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Abi`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"viem\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` contractAbi`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Abi`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /* Your contract ABI here */`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`];`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` default`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` App`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`writeContractSponsored`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`isSuccess`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`isPending`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` useWriteContractSponsored`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` handleWriteContract`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` writeContractSponsored`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` abi:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` contractAbi`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` address:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0xC4822AbB9F05646A9Ce44EFa6dDcda0Bf45595AA\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` functionName:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"mint\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` args:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0x273B3527BF5b607dE86F504fED49e1582dD2a1C6\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`BigInt`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` paymaster:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0x5407B5040dec3D339A9247f3654E59EEccbb6391\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` paymasterInput:`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` getGeneralPaymasterInput`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` innerInput:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0x\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` };`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`div`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`button`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` onClick`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`handleWriteContract`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` disabled`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`isPending`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` {`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`isPending`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ?`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Processing...\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Execute Sponsored Transaction\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`button`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` {`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`isSuccess`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`div`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`Transaction Hash: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`div`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` {`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`div`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`Error: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`div`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`div`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`returns`,children:`Returns`}),`\n`,_jsxs(_components.p,{children:[`Returns a `,_jsx(_components.code,{children:`UseWriteContractSponsoredReturnType\u003cConfig, unknown>`}),`.`]}),`\n`,_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`writeContractSponsored`,type:`function`,id:`param-write-contract-sponsored`,children:_jsx(_components.p,{children:`Synchronous function to submit a transaction to a smart contract with gas\nfees sponsored by a paymaster.`})}),_jsx(ResponseField,{name:`writeContractSponsoredAsync`,type:`function`,id:`param-write-contract-sponsored-async`,children:_jsx(_components.p,{children:`Asynchronous function to submit a transaction to a smart contract with gas\nfees sponsored by a paymaster.`})}),_jsx(ResponseField,{name:`data`,type:`Hex | undefined`,id:`param-data`,children:_jsx(_components.p,{children:`The transaction hash of the sponsored transaction.`})}),_jsx(ResponseField,{name:`error`,type:`WriteContractErrorType | null`,id:`param-error`,children:_jsx(_components.p,{children:`The error if the transaction failed.`})}),_jsx(ResponseField,{name:`isSuccess`,type:`boolean`,id:`param-is-success`,children:_jsx(_components.p,{children:`Indicates if the transaction was successful.`})}),_jsx(ResponseField,{name:`isPending`,type:`boolean`,id:`param-is-pending`,children:_jsx(_components.p,{children:`Indicates if the transaction is currently pending.`})}),_jsx(ResponseField,{name:`context`,type:`unknown`,id:`param-context`,children:_jsx(_components.p,{children:`Additional context information about the transaction.`})}),_jsx(ResponseField,{name:`failureCount`,type:`number`,id:`param-failure-count`,children:_jsx(_components.p,{children:`The number of times the transaction has failed.`})}),_jsx(ResponseField,{name:`failureReason`,type:`WriteContractErrorType | null`,id:`param-failure-reason`,children:_jsx(_components.p,{children:`The reason for the transaction failure, if any.`})}),_jsx(ResponseField,{name:`isError`,type:`boolean`,id:`param-is-error`,children:_jsx(_components.p,{children:`Indicates if the transaction resulted in an error.`})}),_jsx(ResponseField,{name:`isIdle`,type:`boolean`,id:`param-is-idle`,children:_jsx(_components.p,{children:`Indicates if the hook is in an idle state (no transaction has been initiated).`})}),_jsx(ResponseField,{name:`isPaused`,type:`boolean`,id:`param-is-paused`,children:_jsx(_components.p,{children:`Indicates if the transaction processing is paused.`})}),_jsx(ResponseField,{name:`reset`,type:`() => void`,id:`param-reset`,children:_jsx(_components.p,{children:`A function to clean the mutation internal state (i.e., it resets the mutation\nto its initial state).`})}),_jsxs(ResponseField,{name:`status`,type:`'idle' | 'pending' | 'success' | 'error'`,id:`param-status`,children:[_jsx(_components.p,{children:`The current status of the transaction.`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'idle'`}),` initial status prior to the mutation function executing.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'pending'`}),` if the mutation is currently executing.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'error'`}),` if the last mutation attempt resulted in an error.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`'success'`}),` if the last mutation attempt was successful.`]}),`\n`]})]}),_jsx(ResponseField,{name:`submittedAt`,type:`number`,id:`param-submitted-at`,children:_jsx(_components.p,{children:`The timestamp when the transaction was submitted.`})}),_jsx(ResponseField,{name:`submittedTransaction`,type:`TransactionRequest | undefined`,id:`param-submitted-transaction`,children:_jsx(_components.p,{children:`The submitted transaction details.`})}),_jsx(ResponseField,{name:`variables`,type:`WriteContractSponsoredVariables\u003cAbi, string, readonly unknown[], Config, number> | undefined`,id:`param-variables`,children:_jsx(_components.p,{children:`The variables used for the contract write operation.`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"useWriteContractSponsored","description":"Hook for interacting with smart contracts using paymasters to cover gas fees.","href":"/abstract-global-wallet/agw-react/hooks/useWriteContractSponsored"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Import","slug":"import","depth":2,"children":[]},{"title":"Usage","slug":"usage","depth":2,"children":[]},{"title":"Returns","slug":"returns","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"abstract","siteName":"Abstract","title":"useWriteContractSponsored - Abstract","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-07T03:42:27.073Z","originalFileLocation":"abstract-global-wallet/agw-react/hooks/useWriteContractSponsored.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Hook for interacting with smart contracts using paymasters to cover gas fees.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Abstract\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/abstract/TFUvf-HcBH5wtn49/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/abstract/TFUvf-HcBH5wtn49/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/abstract/TFUvf-HcBH5wtn49/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/abstract/TFUvf-HcBH5wtn49/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/abstract/TFUvf-HcBH5wtn49/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/abstract/TFUvf-HcBH5wtn49/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/abstract/TFUvf-HcBH5wtn49/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/abstract/TFUvf-HcBH5wtn49/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/abstract/TFUvf-HcBH5wtn49/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"useWriteContractSponsored - Abstract\">\u003cmeta data-mint-head property=\"og:description\" content=\"Hook for interacting with smart contracts using paymasters to cover gas fees.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Abstract\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useWriteContractSponsored\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://abstract.mintlify.site/_mintlify/api/og/v2?division=Wallet+Actions\u0026amp;title=useWriteContractSponsored\u0026amp;description=Hook+for+interacting+with+smart+contracts+using+paymasters+to+cover+gas+fees.\u0026amp;theme=8c61e18bc3e7c19b4d27108b\u0026amp;signature=6838cfdfcb2dc2e21aebe70af9abc04632785bc5a4ca8ae151016c139397c520\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"useWriteContractSponsored - Abstract\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Hook for interacting with smart contracts using paymasters to cover gas fees.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://abstract.mintlify.site/_mintlify/api/og/v2?division=Wallet+Actions\u0026amp;title=useWriteContractSponsored\u0026amp;description=Hook+for+interacting+with+smart+contracts+using+paymasters+to+cover+gas+fees.\u0026amp;theme=8c61e18bc3e7c19b4d27108b\u0026amp;signature=6838cfdfcb2dc2e21aebe70af9abc04632785bc5a4ca8ae151016c139397c520\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/abstract/TFUvf-HcBH5wtn49/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Abstract\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0D9373\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useWriteContractSponsored\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/abstract-global-wallet/agw-react/hooks/useWriteContractSponsored.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.abs.xyz/#organization\",\"name\":\"Abstract\",\"url\":\"https://docs.abs.xyz\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/abstract/DVQXlXAnGWn0I2rD/logo/light.svg?fit=max\u0026auto=format\u0026n=DVQXlXAnGWn0I2rD\u0026q=85\u0026s=38a6db7ffacc552b39842e1f9c6eacb3\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.abs.xyz#website\",\"name\":\"Abstract\",\"url\":\"https://docs.abs.xyz\",\"publisher\":{\"@id\":\"https://docs.abs.xyz/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useWriteContractSponsored#webpage\",\"url\":\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useWriteContractSponsored\",\"name\":\"useWriteContractSponsored\",\"description\":\"Hook for interacting with smart contracts using paymasters to cover gas fees.\",\"dateModified\":\"2026-01-07T03:42:27.073Z\",\"isPartOf\":{\"@id\":\"https://docs.abs.xyz#website\"},\"breadcrumb\":{\"@id\":\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useWriteContractSponsored#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useWriteContractSponsored#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Wallet Actions\",\"item\":\"https://docs.abs.xyz/abstract-global-wallet/agw-client/actions/deployContract\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"useWriteContractSponsored\",\"item\":\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useWriteContractSponsored\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useWriteContractSponsored#article\",\"headline\":\"useWriteContractSponsored\",\"name\":\"useWriteContractSponsored\",\"description\":\"Hook for interacting with smart contracts using paymasters to cover gas fees.\",\"url\":\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useWriteContractSponsored\",\"mainEntityOfPage\":{\"@id\":\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useWriteContractSponsored#webpage\"},\"dateModified\":\"2026-01-07T03:42:27.073Z\",\"publisher\":{\"@id\":\"https://docs.abs.xyz/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.abs.xyz#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Abstract\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Abstract\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/abstract-global-wallet/agw-react/hooks/useWriteContractSponsored.md","siteName":"Abstract","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/overview"}]},{"tab":"Abstract Global Wallet","groups":[{"group":"Abstract Global Wallet","pages":[{"title":"Abstract Global Wallet","sidebarTitle":"Overview","href":"/abstract-global-wallet/overview"},{"title":"Getting Started","href":"/abstract-global-wallet/getting-started"},{"title":"How It Works","href":"/abstract-global-wallet/architecture"},{"title":"Frequently Asked Questions","href":"/abstract-global-wallet/frequently-asked-questions"}]},{"group":"Library Integrations","pages":[{"title":"Native Integration","href":"/abstract-global-wallet/agw-react/native-integration"},{"title":"ConnectKit","href":"/abstract-global-wallet/agw-react/integrating-with-connectkit"},{"title":"Dynamic","href":"/abstract-global-wallet/agw-react/integrating-with-dynamic"},{"title":"Privy","href":"/abstract-global-wallet/agw-react/integrating-with-privy"},{"title":"RainbowKit","href":"/abstract-global-wallet/agw-react/integrating-with-rainbowkit"},{"title":"Reown","href":"/abstract-global-wallet/agw-react/integrating-with-reown"},{"title":"Thirdweb","href":"/abstract-global-wallet/agw-react/integrating-with-thirdweb"}]},{"group":"Abstract Client","pages":[{"title":"AbstractWalletProvider","href":"/abstract-global-wallet/agw-react/AbstractWalletProvider"},{"title":"useLoginWithAbstract","href":"/abstract-global-wallet/agw-react/hooks/useLoginWithAbstract"},{"title":"useAbstractClient","href":"/abstract-global-wallet/agw-react/hooks/useAbstractClient"},{"title":"useGlobalWalletSignerAccount","href":"/abstract-global-wallet/agw-react/hooks/useGlobalWalletSignerAccount"},{"title":"useGlobalWalletSignerClient","href":"/abstract-global-wallet/agw-react/hooks/useGlobalWalletSignerClient"}]},{"group":"Wallet Actions","pages":[{"title":"deployContract","href":"/abstract-global-wallet/agw-client/actions/deployContract"},{"title":"signTransaction","href":"/abstract-global-wallet/agw-client/actions/signTransaction"},{"title":"sendTransaction","href":"/abstract-global-wallet/agw-client/actions/sendTransaction"},{"title":"sendCalls","href":"/abstract-global-wallet/agw-client/actions/sendCalls"},{"title":"signMessage","href":"/abstract-global-wallet/agw-client/actions/signMessage"},{"title":"writeContract","description":"Function to call functions on a smart contract using the connected Abstract Global Wallet.","href":"/abstract-global-wallet/agw-client/actions/writeContract"},{"title":"useWriteContractSponsored","href":"/abstract-global-wallet/agw-react/hooks/useWriteContractSponsored"}]},{"group":"Session Keys","pages":[{"title":"Session keys","sidebarTitle":"Overview","description":"Explore session keys, how to create them, and how to use them with the Abstract Global Wallet.","href":"/abstract-global-wallet/session-keys/overview"},{"title":"Going to Production","sidebarTitle":"Going to Production","href":"/abstract-global-wallet/session-keys/going-to-production"},{"title":"createSession","href":"/abstract-global-wallet/agw-client/session-keys/createSession"},{"title":"useCreateSession","href":"/abstract-global-wallet/agw-react/hooks/useCreateSession"},{"title":"createSessionClient","href":"/abstract-global-wallet/agw-client/session-keys/createSessionClient"},{"title":"toSessionClient","href":"/abstract-global-wallet/agw-client/session-keys/toSessionClient"},{"title":"getSessionHash","href":"/abstract-global-wallet/agw-client/session-keys/getSessionHash"},{"title":"getSessionStatus","href":"/abstract-global-wallet/agw-client/session-keys/getSessionStatus"},{"title":"revokeSessions","href":"/abstract-global-wallet/agw-client/session-keys/revokeSessions"},{"title":"useRevokeSessions","href":"/abstract-global-wallet/agw-react/hooks/useRevokeSessions"}]},{"group":"FIAT On-ramp","pages":[{"title":"Using Crossmint","href":"/abstract-global-wallet/fiat-on-ramp/using-crossmint"}]},{"group":"Utils","pages":[{"title":"getSmartAccountAddress FromInitialSigner","href":"/abstract-global-wallet/agw-client/getSmartAccountAddressFromInitialSigner"},{"title":"transformEIP1193Provider","href":"/abstract-global-wallet/agw-client/transformEIP1193Provider"}]}]},{"tab":"AI Agents","pages":[{"title":"AI Agents","href":"/ai-agents/overview"}]},{"tab":"Ecosystem","pages":[{"title":"Ecosystem","href":"/ecosystem/automation"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/overview/abstract-json-rpc-api"}]}]},"basePath":"","title":"useWriteContractSponsored - Abstract","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":["10e4515597"],"chunks":["BannerMarkdown-BOAJk9BH.js","dist-Dl6_zDnT.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}