import { useAbstractClient } from "@abstract-foundation/agw-react";export default function Example() { const { data: abstractClient, isLoading, error } = useAbstractClient(); // Use the client to perform actions such as sending transactions or deploying contracts async function submitTx() { if (!abstractClient) return; const hash = await abstractClient.sendTransaction({ to: "0x8e729E23CDc8bC21c37a73DA4bA9ebdddA3C8B6d", data: "0x69", }); } // ... rest of your component ...}
fetching: Is true whenever the queryFn is executing, which includes initial
pending state as well as background refetches. - paused: The query wanted to fetch,
but has been paused. - idle: The query is not fetching. See Network Mode for
more information.
cancelRefetch: When set to true, a
currently running request will be canceled before a new request is made. When
set to false, no refetch will be made if there is already a request running. Defaults to true.
pending: if there’s no cached data and no query attempt was finished yet.
error: if the query attempt resulted in an error. The corresponding error
property has the error received from the attempted fetch.
success: if the query has received a response with no errors and is ready to display its data.The corresponding data property on the query is the data received from the
successful fetch or if the query’s enabled property is set to false and has not been fetched
yet, data is the first initialData supplied to the query on initialization.
{"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":""},"chroma":{"liveDeploymentHistoryId":"6ac54e1abf1a1138cf6134b8","collectionId":"266d5344-ff76-4caa-b0f0-702abdf2436e","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ac54e1abf1a1138cf6134b8"},"feedback":{"thumbs":true,"issues":true,"edits":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ac54e1abf1a1138cf6134b8","clientVersion":"0.0.4044","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":"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":"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":"llms-txt-v2","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":"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":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","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":"sso-setup-deadline-banner","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:-.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,.12),0 0 0 1px rgba(0,0,0,.05);transition:background-color .2s ease,-webkit-text-fill-color .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\") center/16px 16px no-repeat;transition:background-color .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/useAbstractClient","slug":"/abstract-global-wallet/agw-react/hooks/useAbstractClient","pageMetadata":{"title":"useAbstractClient","description":"Hook for creating and managing an Abstract client instance.","href":"/abstract-global-wallet/agw-react/hooks/useAbstractClient"},"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 creating and managing an Abstract client instance.\"\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:[`Gets the `,_jsx(_components.a,{href:`https://viem.sh/docs/clients/wallet`,children:`Wallet client`}),`\nexposed by the `,_jsx(_components.a,{href:`/abstract-global-wallet/agw-react/AbstractWalletProvider`,children:`AbstractWalletProvider`}),` context.\nUse this client to perform actions from the connected Abstract Global Wallet, for example\n`,_jsx(_components.a,{href:`/abstract-global-wallet/agw-client/actions/deployContract`,children:`deployContract`}),`,\n`,_jsx(_components.a,{href:`/abstract-global-wallet/agw-client/actions/sendTransaction`,children:`sendTransaction`}),`,\n`,_jsx(_components.a,{href:`/abstract-global-wallet/agw-client/actions/writeContract`,children:`writeContract`}),`, etc.`]}),`\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:`useAbstractClient`}),_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:`17`,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:`17`,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:`useAbstractClient`}),_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`,_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:` Example`}),_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:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`abstractClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`isLoading`}),_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:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` useAbstractClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Use the client to perform actions such as sending transactions or deploying contracts`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` submitTx`}),_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:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`abstractClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_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:` hash`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` abstractClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`sendTransaction`}),_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:` to:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0x8e729E23CDc8bC21c37a73DA4bA9ebdddA3C8B6d\"`}),_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:` data:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0x69\"`}),_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`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // ... rest of your component ...`})}),`\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:`UseQueryResult\u003cAbstractClient, Error>`}),`.`]}),`\n`,_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`data`,type:`AbstractClient | undefined`,id:`param-data`,children:_jsxs(_components.p,{children:[`The\n`,_jsx(_components.a,{href:`/abstract-global-wallet/agw-client/createAbstractClient`,children:`AbstractClient`}),`\ninstance from the\n`,_jsx(_components.a,{href:`/abstract-global-wallet/agw-react/AbstractWalletProvider`,children:`AbstractWalletProvider`}),`\ncontext.`]})}),_jsx(ResponseField,{name:`dataUpdatedAt`,type:`number`,id:`param-data-updated-at`,children:_jsx(_components.p,{children:`The timestamp for when the query most recently returned the status as\n‘success’.`})}),_jsx(ResponseField,{name:`error`,type:`null | Error`,id:`param-error`,children:_jsx(_components.p,{children:`The error object for the query, if an error was thrown. Defaults to null.`})}),_jsx(ResponseField,{name:`errorUpdatedAt`,type:`number`,id:`param-error-updated-at`,children:_jsx(_components.p,{children:`The timestamp for when the query most recently returned the status as ‘error’.`})}),_jsx(ResponseField,{name:`errorUpdateCount`,type:`number`,id:`param-error-update-count`,children:_jsx(_components.p,{children:`The sum of all errors.`})}),_jsx(ResponseField,{name:`failureCount`,type:`number`,id:`param-failure-count`,children:_jsx(_components.p,{children:`The failure count for the query. Incremented every time the query fails. Reset\nto 0 when the query succeeds.`})}),_jsx(ResponseField,{name:`failureReason`,type:`null | Error`,id:`param-failure-reason`,children:_jsx(_components.p,{children:`The failure reason for the query retry. Reset to null when the query succeeds.`})}),_jsx(ResponseField,{name:`fetchStatus`,type:`'fetching' | 'idle' | 'paused'`,id:`param-fetch-status`,children:_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`fetching: Is true whenever the queryFn is executing, which includes initial\npending state as well as background refetches. - paused: The query wanted to fetch,\nbut has been paused. - idle: The query is not fetching. See Network Mode for\nmore information.`}),`\n`]})}),_jsx(ResponseField,{name:`isError / isPending / isSuccess`,type:`boolean`,id:`param-is-error-is-pending-is-success`,children:_jsx(_components.p,{children:`Boolean variables derived from status.`})}),_jsx(ResponseField,{name:`isFetched`,type:`boolean`,id:`param-is-fetched`,children:_jsx(_components.p,{children:`Will be true if the query has been fetched.`})}),_jsx(ResponseField,{name:`isFetchedAfterMount`,type:`boolean`,id:`param-is-fetched-after-mount`,children:_jsx(_components.p,{children:`Will be true if the query has been fetched after the component mounted. This\nproperty can be used to not show any previously cached data.`})}),_jsx(ResponseField,{name:`isFetching / isPaused`,type:`boolean`,id:`param-is-fetching-is-paused`,children:_jsx(_components.p,{children:`Boolean variables derived from fetchStatus.`})}),_jsx(ResponseField,{name:`isLoading`,type:`boolean`,id:`param-is-loading`,children:_jsxs(_components.p,{children:[`Is `,_jsx(_components.code,{children:`true`}),` whenever the first fetch for a query is in-flight. Is the same as\n`,_jsx(_components.code,{children:`isFetching \u0026\u0026 isPending`}),`.`]})}),_jsx(ResponseField,{name:`isLoadingError`,type:`boolean`,id:`param-is-loading-error`,children:_jsxs(_components.p,{children:[`Will be `,_jsx(_components.code,{children:`true`}),` if the query failed while fetching for the first time.`]})}),_jsx(ResponseField,{name:`isPlaceholderData`,type:`boolean`,id:`param-is-placeholder-data`,children:_jsxs(_components.p,{children:[`Will be `,_jsx(_components.code,{children:`true`}),` if the data shown is the placeholder data.`]})}),_jsx(ResponseField,{name:`isRefetchError`,type:`boolean`,id:`param-is-refetch-error`,children:_jsxs(_components.p,{children:[`Will be `,_jsx(_components.code,{children:`true`}),` if the query failed while refetching.`]})}),_jsx(ResponseField,{name:`isRefetching`,type:`boolean`,id:`param-is-refetching`,children:_jsxs(_components.p,{children:[`Is true whenever a background refetch is in-flight, which does not include\ninitial `,_jsx(_components.code,{children:`pending`}),`. Is the same as `,_jsx(_components.code,{children:`isFetching \u0026\u0026 !isPending`}),`.`]})}),_jsx(ResponseField,{name:`isStale`,type:`boolean`,id:`param-is-stale`,children:_jsxs(_components.p,{children:[`Will be `,_jsx(_components.code,{children:`true`}),` if the data in the cache is invalidated or if the data is older\nthan the given staleTime.`]})}),_jsxs(ResponseField,{name:`refetch`,type:`(options?: {cancelRefetch?: boolean}) => Promise\u003cQueryObserverResult\u003cAbstractClient, Error>>`,id:`param-refetch`,children:[_jsx(_components.p,{children:`A function to manually refetch the query.`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`cancelRefetch`}),`: When set to `,_jsx(_components.code,{children:`true`}),`, a\ncurrently running request will be canceled before a new request is made. When\nset to false, no refetch will be made if there is already a request running. Defaults to `,_jsx(_components.code,{children:`true`}),`.`]}),`\n`]})]}),_jsx(ResponseField,{name:`status`,type:`'error' | 'pending' | 'success'`,id:`param-status`,children:_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`pending`}),`: if there’s no cached data and no query attempt was finished yet.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`error`}),`: if the query attempt resulted in an error. The corresponding error\nproperty has the error received from the attempted fetch.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`success`}),`: if the query has received a response with no errors and is ready to display its data.`]}),`\n`,_jsx(_components.p,{children:`The corresponding data property on the query is the data received from the\nsuccessful fetch or if the query’s enabled property is set to false and has not been fetched\nyet, data is the first initialData supplied to the query on initialization.`}),`\n`]}),`\n`]})})]})]})}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":"useAbstractClient","description":"Hook for creating and managing an Abstract client instance.","href":"/abstract-global-wallet/agw-react/hooks/useAbstractClient"}}},"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":"useAbstractClient - Abstract","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-07T03:42:26.120Z","originalFileLocation":"abstract-global-wallet/agw-react/hooks/useAbstractClient.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 creating and managing an Abstract client instance.\">\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=\"useAbstractClient - Abstract\">\u003cmeta data-mint-head property=\"og:description\" content=\"Hook for creating and managing an Abstract client instance.\">\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/useAbstractClient\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://abstract.mintlify.app/_mintlify/api/og/v2?division=Abstract+Client\u0026amp;title=useAbstractClient\u0026amp;description=Hook+for+creating+and+managing+an+Abstract+client+instance.\u0026amp;theme=cc6f26b1bf49ae4f28088bdf\u0026amp;signature=8a6ff7e1a08fb3e42859159135082e09d14131e4a5aa6830aabff75958c6f7cd\">\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=\"useAbstractClient - Abstract\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Hook for creating and managing an Abstract client instance.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://abstract.mintlify.app/_mintlify/api/og/v2?division=Abstract+Client\u0026amp;title=useAbstractClient\u0026amp;description=Hook+for+creating+and+managing+an+Abstract+client+instance.\u0026amp;theme=cc6f26b1bf49ae4f28088bdf\u0026amp;signature=8a6ff7e1a08fb3e42859159135082e09d14131e4a5aa6830aabff75958c6f7cd\">\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/useAbstractClient\">\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/useAbstractClient.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/useAbstractClient#webpage\",\"url\":\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useAbstractClient\",\"name\":\"useAbstractClient\",\"description\":\"Hook for creating and managing an Abstract client instance.\",\"dateModified\":\"2026-01-07T03:42:26.120Z\",\"isPartOf\":{\"@id\":\"https://docs.abs.xyz#website\"},\"breadcrumb\":{\"@id\":\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useAbstractClient#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useAbstractClient#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Abstract Client\",\"item\":\"https://docs.abs.xyz/abstract-global-wallet/agw-react/AbstractWalletProvider\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"useAbstractClient\",\"item\":\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useAbstractClient\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useAbstractClient#article\",\"headline\":\"useAbstractClient\",\"name\":\"useAbstractClient\",\"description\":\"Hook for creating and managing an Abstract client instance.\",\"url\":\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useAbstractClient\",\"mainEntityOfPage\":{\"@id\":\"https://docs.abs.xyz/abstract-global-wallet/agw-react/hooks/useAbstractClient#webpage\"},\"dateModified\":\"2026-01-07T03:42:26.120Z\",\"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\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","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","description":"Hook for signing in and signing out users with Abstract Global Wallet.","href":"/abstract-global-wallet/agw-react/hooks/useLoginWithAbstract"},{"title":"useAbstractClient","href":"/abstract-global-wallet/agw-react/hooks/useAbstractClient"},{"title":"useGlobalWalletSignerAccount","description":"Hook to get the approved signer of the connected Abstract Global Wallet.","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","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","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":"useAbstractClient - Abstract","buildId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","deploymentId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","dynamics":["10e4515597"],"chunks":["BannerMarkdown-CX_qQQOL.js","dist-BTZUMDnx.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","clsx-xpJZXxdP.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}