The EtherspotApprovalTransaction component authorizes the spending of an asset, owned by yourself, by another Smart Contract. This Smart Contract can serve any purpose, but is usually associated with decentralised finance app (also known as DeFi) such as Uniswap or Gamma.
In other words, it’s like giving your friend permission to spend some of your money, up to a certain limit. In this scenario, the friend is the Smart Contract mentioned above.## Component Properties
import { EtherspotContractTransaction, EtherspotApprovalTransaction, EtherspotBatches, EtherspotBatch,} from "@etherspot/transaction-kit";import { utils } from "ethers";// Later in your render function...<EtherspotBatches> <EtherspotBatch chainId={11155111}> {/* The following block is the first transaction in this batch of transactions, and instructs Etherspot to set a spending limit for the Smart Contract located at `receiverAddress` to be allowed to spend the token located at `tokenAddress` up to the amount specified in `value`. So in summary, using the example below: Smart Contract: 0x0493b9a21dE42546B2E3687Da683D0B7B6ec2180 is allowed to spend up to and including 10 of the token located at: 0x2A9bb3fB4FBF8e536b9a6cBEbA33C4CD18369EaF. */} <EtherspotApprovalTransaction tokenAddress={"0x2A9bb3fB4FBF8e536b9a6cBEbA33C4CD18369EaF"} receiverAddress={"0x0493b9a21dE42546B2E3687Da683D0B7B6ec2180"} value={"10"} /> {/* The following block is the second transaction in this batch of transactions, and instructs Etherspot to call and execute the "stake" function on the Smart Contract located at the `contractAddress`. The "stake" function in the Smart Contract address located at the `contractAddress` takes 1 parameter which is the numbber of tokens to stake. In the <EtherspotApprovalTransaction /> component above, we gave permission for the Smart Contract below to spend 10 tokens of the token located at `tokenAddress` above from the Etherspot Smart Wallet account. */} <EtherspotContractTransaction contractAddress={"0x0493b9a21dE42546B2E3687Da683D0B7B6ec2180"} abi={["function stake(uint)"]} methodName={"stake"} params={[utils.parseEther("10")]} /> </EtherspotBatch></EtherspotBatches>
Sometimes it may seem convenient to set the spending limit to a very high amount, more than what is actually needed. This will result in you not having to call the approval tag again for that Smart Contract.
Whilst no-one is going to stop you doing this, please consider that the Smart Contract you’re giving permission to spend your funds may be compromised in the future and could possibly drain all the funds in your account that it has permission to.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Etherspot Developer Documentation","colors":{"primary":"#3C3761","light":"#4b4579","dark":"#3C3761"},"favicon":"/favicon.png","logo":{"light":"https://mintcdn.com/etherspot/H2UQS5QvokClTYDR/logo/light.png?fit=max\u0026auto=format\u0026n=H2UQS5QvokClTYDR\u0026q=85\u0026s=7d9a2f3cd691d20dd659816d80abae90","dark":"https://mintcdn.com/etherspot/H2UQS5QvokClTYDR/logo/dark.png?fit=max\u0026auto=format\u0026n=H2UQS5QvokClTYDR\u0026q=85\u0026s=b5a86b0e1d031726a106d726503b9fd9"},"appearance":{"default":"dark","strict":false},"background":{"image":"https://mintlify.s3.us-west-1.amazonaws.com/etherspot/background.png","decoration":null},"navbar":{"links":[{"label":"V1 Docs","href":"https://v1.etherspot.io/"}],"primary":{"type":"button","label":"Etherspot","href":"https://etherspot.io"}},"footer":{"socials":{"twitter":"https://twitter.com/etherspot","github":"https://github.com/etherspot","discord":"https://discord.etherspot.io","linkedin":"https://www.linkedin.com/company/etherspotsdk"}},"navigation":{"global":{"anchors":[{"anchor":"GitHub","href":"https://github.com/etherspot","icon":"github"},{"anchor":"Discord","href":"https://discord.etherspot.io","icon":"discord"},{"anchor":"System Status","href":"https://status.etherspot.io/","icon":"check"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"etherspot","hasAudioNarration":false,"actualSubdomain":"etherspot","customDomains":["etherspot.fyi"],"gitSource":{"type":"github","owner":"etherspot","repo":"prime-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a21e60803d4026a3ef7647d","collectionId":"bc235dbd-9ba7-4c2d-9fa4-151b03af9884","schemaVersion":"v2"},"entitlements":{},"buildId":"6a21e60803d4026a3ef7647d:success","clientVersion":"0.0.3964","searchFilterCounts":[{"language":"default","tag":"Prime SDK","count":73},{"language":"default","tag":"API Endpoints","count":38},{"language":"default","tag":"Modular SDK","count":37},{"language":"default","tag":"Arka","count":35},{"language":"default","tag":"Arka Paymaster","count":35},{"language":"default","tag":"Arka (Paymaster) API calls","count":30},{"language":"default","tag":"Arka API calls","count":30},{"language":"default","tag":"Prime SDK examples","count":23},{"language":"default","tag":"TransactionKit","count":17},{"language":"default","tag":"Transaction Kit","count":17}]},"assistantConfig":{},"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":"editor-v7-file-tree","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":"pause-universal-search-reconcile","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":"per-site-search-delta","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":"editor-private-page-search","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":"editor-nav-generations","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":"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":"editor-agent-model-picker","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":"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}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"transaction-kit/components/EtherspotApprovalTransaction","slug":"/transaction-kit/components/EtherspotApprovalTransaction","pageMetadata":{"title":"\u003cEtherspotApprovalTransaction />","description":null,"href":"/transaction-kit/components/EtherspotApprovalTransaction","hidden":false},"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={code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`intro`,children:`Intro`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.strong,{children:`EtherspotApprovalTransaction`}),` component authorizes the spending of an asset, owned by yourself, by another Smart Contract. This Smart Contract can serve any purpose, but is usually associated with decentralised finance app (also known as DeFi) such as Uniswap or Gamma.\nIn other words, it’s like giving your friend permission to spend some of your money, up to a certain limit. In this scenario, the friend is the Smart Contract mentioned above.## Component Properties`]}),`\n`,_jsx(Heading,{level:`2`,id:`component-properties`,children:`Component Properties`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Property`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`tokenAddress`}),_jsx(_components.td,{children:`The token’s Smart Contract address that will be permitted to be moved to the recieverAddress.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`receiverAddress`}),_jsx(_components.td,{children:`The destination blockchain address (on the same chain) permitted for the tokens located at tokenAddress to be moved to.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`value`}),_jsx(_components.td,{children:`The maximum value that the token address is allowed to move to the receiverAddress.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`how-to-use`,children:`How to use`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`51`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`51`,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:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` EtherspotContractTransaction`}),_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:` EtherspotApprovalTransaction`}),_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:` EtherspotBatches`}),_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:` EtherspotBatch`}),_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\":`#D4D4D4`},children:`} `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@etherspot/transaction-kit\"`}),_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:`utils`}),_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:` \"ethers\"`}),_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:`// Later in your render function...`})}),`\n`,_jsx(_components.span,{className:`line`}),`\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\":`#4EC9B0`},children:`EtherspotBatches`}),_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\":`#4EC9B0`},children:`EtherspotBatch`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` chainId`}),_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:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`11155111`}),_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:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`/*`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` The following block is the first transaction in this batch`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` of transactions, and instructs Etherspot to set a spending`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:\" limit for the Smart Contract located at `receiverAddress`\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:\" to be allowed to spend the token located at `tokenAddress`\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:\" up to the amount specified in `value`.\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` So in summary, using the example below:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` Smart Contract: 0x0493b9a21dE42546B2E3687Da683D0B7B6ec2180`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` is allowed to spend up to and including 10 of the token`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` located at: 0x2A9bb3fB4FBF8e536b9a6cBEbA33C4CD18369EaF.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},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\":`#4EC9B0`},children:`EtherspotApprovalTransaction`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` tokenAddress`}),_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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0x2A9bb3fB4FBF8e536b9a6cBEbA33C4CD18369EaF\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` receiverAddress`}),_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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0x0493b9a21dE42546B2E3687Da683D0B7B6ec2180\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` value`}),_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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"10\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},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\":`#808080`},children:` />`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` {`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`/*`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` The following block is the second transaction in this batch`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` of transactions, and instructs Etherspot to call and execute`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` the \"stake\" function on the Smart Contract located at the`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:' `contractAddress`. The \"stake\" function in the Smart Contract'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:\" address located at the `contractAddress` takes 1 parameter\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` which is the numbber of tokens to stake.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` In the \u003cEtherspotApprovalTransaction /> component above, we`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` gave permission for the Smart Contract below to spend 10 tokens`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:\" of the token located at `tokenAddress` above from the Etherspot\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` Smart Wallet account.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},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\":`#4EC9B0`},children:`EtherspotContractTransaction`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` contractAddress`}),_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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0x0493b9a21dE42546B2E3687Da683D0B7B6ec2180\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` abi`}),_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\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"function stake(uint)\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` methodName`}),_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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stake\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` params`}),_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\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`utils`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`parseEther`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"10\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_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\":`#4EC9B0`},children:`EtherspotBatch`}),_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\":`#4EC9B0`},children:`EtherspotBatches`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`a-note-on-setting-the-spend-limit`,children:`A note on setting the spend limit`}),`\n`,_jsx(_components.p,{children:`Sometimes it may seem convenient to set the spending limit to a very high amount, more than what is actually needed. This will result in you not having to call the approval tag again for that Smart Contract.\nWhilst no-one is going to stop you doing this, please consider that the Smart Contract you’re giving permission to spend your funds may be compromised in the future and could possibly drain all the funds in your account that it has permission to.`})]})}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":"\u003cEtherspotApprovalTransaction />","description":null,"href":"/transaction-kit/components/EtherspotApprovalTransaction","hidden":false}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Intro","slug":"intro","depth":2,"children":[]},{"title":"Component Properties","slug":"component-properties","depth":2,"children":[]},{"title":"How to use","slug":"how-to-use","depth":2,"children":[]},{"title":"A note on setting the spend limit","slug":"a-note-on-setting-the-spend-limit","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"etherspot","siteName":"Etherspot Developer Documentation","title":"\u003cEtherspotApprovalTransaction /> - Etherspot Developer Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-06T12:59:53.462Z","originalFileLocation":"transaction-kit/components/EtherspotApprovalTransaction.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=\"dark\"}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=\"application-name\" content=\"Etherspot Developer Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/etherspot/ZWnIjRvZNxvLlDpp/_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/etherspot/ZWnIjRvZNxvLlDpp/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/etherspot/ZWnIjRvZNxvLlDpp/_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/etherspot/ZWnIjRvZNxvLlDpp/_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/etherspot/ZWnIjRvZNxvLlDpp/_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/etherspot/ZWnIjRvZNxvLlDpp/_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/etherspot/ZWnIjRvZNxvLlDpp/_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/etherspot/ZWnIjRvZNxvLlDpp/_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/etherspot/ZWnIjRvZNxvLlDpp/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"\u0026lt;EtherspotApprovalTransaction /\u0026gt; - Etherspot Developer Documentation\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Etherspot Developer Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://etherspot.fyi/transaction-kit/components/EtherspotApprovalTransaction\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://etherspot.mintlify.app/_mintlify/api/og/v2?division=Components\u0026amp;title=%3CEtherspotApprovalTransaction+%2F%3E\u0026amp;theme=e300f97d39ba5eae24c63402\u0026amp;signature=ed60ae3757bfd123e4198e0dd84e595de5deb1fb26b42a09f8559b328081a2b0\">\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=\"\u0026lt;EtherspotApprovalTransaction /\u0026gt; - Etherspot Developer Documentation\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://etherspot.mintlify.app/_mintlify/api/og/v2?division=Components\u0026amp;title=%3CEtherspotApprovalTransaction+%2F%3E\u0026amp;theme=e300f97d39ba5eae24c63402\u0026amp;signature=ed60ae3757bfd123e4198e0dd84e595de5deb1fb26b42a09f8559b328081a2b0\">\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/etherspot/ZWnIjRvZNxvLlDpp/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Etherspot Developer Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3C3761\">\u003clink data-mint-head rel=\"canonical\" href=\"https://etherspot.fyi/transaction-kit/components/EtherspotApprovalTransaction\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/transaction-kit/components/EtherspotApprovalTransaction.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://etherspot.fyi/#organization\",\"name\":\"Etherspot Developer Documentation\",\"url\":\"https://etherspot.fyi\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/etherspot/H2UQS5QvokClTYDR/logo/light.png?fit=max\u0026auto=format\u0026n=H2UQS5QvokClTYDR\u0026q=85\u0026s=7d9a2f3cd691d20dd659816d80abae90\"}},{\"@type\":\"WebSite\",\"@id\":\"https://etherspot.fyi#website\",\"name\":\"Etherspot Developer Documentation\",\"url\":\"https://etherspot.fyi\",\"publisher\":{\"@id\":\"https://etherspot.fyi/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://etherspot.fyi/transaction-kit/components/EtherspotApprovalTransaction#webpage\",\"url\":\"https://etherspot.fyi/transaction-kit/components/EtherspotApprovalTransaction\",\"name\":\"\\u003cEtherspotApprovalTransaction />\",\"dateModified\":\"2026-01-06T12:59:53.462Z\",\"isPartOf\":{\"@id\":\"https://etherspot.fyi#website\"},\"breadcrumb\":{\"@id\":\"https://etherspot.fyi/transaction-kit/components/EtherspotApprovalTransaction#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://etherspot.fyi/transaction-kit/components/EtherspotApprovalTransaction#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Transaction Kit\",\"item\":\"https://etherspot.fyi/transaction-kit/intro\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Components\",\"item\":\"https://etherspot.fyi/transaction-kit/components/EtherspotTransactionKit\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"\\u003cEtherspotApprovalTransaction />\",\"item\":\"https://etherspot.fyi/transaction-kit/components/EtherspotApprovalTransaction\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://etherspot.fyi/transaction-kit/components/EtherspotApprovalTransaction#article\",\"headline\":\"\\u003cEtherspotApprovalTransaction />\",\"name\":\"\\u003cEtherspotApprovalTransaction />\",\"url\":\"https://etherspot.fyi/transaction-kit/components/EtherspotApprovalTransaction\",\"mainEntityOfPage\":{\"@id\":\"https://etherspot.fyi/transaction-kit/components/EtherspotApprovalTransaction#webpage\"},\"dateModified\":\"2026-01-06T12:59:53.462Z\",\"publisher\":{\"@id\":\"https://etherspot.fyi/#organization\"},\"isPartOf\":{\"@id\":\"https://etherspot.fyi#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Etherspot Developer Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Etherspot Developer Documentation","nav":{"global":{"anchors":[{"anchor":"GitHub","href":"https://github.com/etherspot","icon":"github"},{"anchor":"Discord","href":"https://discord.etherspot.io","icon":"discord"},{"anchor":"System Status","href":"https://status.etherspot.io/","icon":"check"}]},"tabs":[{"tab":"Home","pages":[{"title":"Home","href":"/introduction"}]},{"tab":"Prime SDK","pages":[{"title":"Prime SDK","href":"/prime-sdk/intro"}]},{"tab":"Modular SDK","pages":[{"title":"Modular SDK","href":"/modular-sdk/intro"}]},{"tab":"RemoteSigner SDK","pages":[{"title":"RemoteSigner SDK","href":"/remote-signer-sdk/intro"}]},{"tab":"Skandha","pages":[{"title":"Skandha","href":"/skandha/intro"}]},{"tab":"Arka","pages":[{"title":"Arka","href":"/arka/intro"}]},{"tab":"TransactionKit","groups":[{"group":"Transaction Kit","pages":[{"title":"Introduction to Transaction Kit","icon":"screwdriver-wrench","href":"/transaction-kit/intro"},{"title":"Installation","icon":"gear","href":"/transaction-kit/installation"},{"title":"Send Native Token","icon":"paper-plane-top","href":"/transaction-kit/send-native-token"},{"title":"Staking","icon":"steak","href":"/transaction-kit/staking"},{"title":"Paymaster usage","icon":"circle-play","href":"/transaction-kit/paymaster"},{"group":"Components","pages":[{"title":"\u003cEtherspotTransactionKit />","href":"/transaction-kit/components/EtherspotTransactionKit"},{"title":"\u003cEtherspotBatches />","href":"/transaction-kit/components/EtherspotBatches"},{"title":"\u003cEtherspotBatch />","href":"/transaction-kit/components/EtherspotBatch"},{"title":"\u003cEtherspotTransaction />","href":"/transaction-kit/components/EtherspotTransaction"},{"title":"\u003cEtherspotContractTransaction />","description":null,"href":"/transaction-kit/components/EtherspotContractTransaction"},{"title":"\u003cEtherspotApprovalTransaction />","href":"/transaction-kit/components/EtherspotApprovalTransaction"},{"title":"\u003cEtherspotTokenTransferTransaction />","description":null,"href":"/transaction-kit/components/EtherspotTokenTransferTransaction"}]},{"group":"Hooks","pages":[{"title":"useEtherspotTransactions()","href":"/transaction-kit/hooks/useEtherspotTransactions"},{"title":"useEtherspotAssets()","href":"/transaction-kit/hooks/useEtherspotAssets"},{"title":"useEtherspotNfts()","href":"/transaction-kit/hooks/useEtherspotNfts"},{"title":"getAccountTransaction()","href":"/transaction-kit/hooks/getAccountTransaction"},{"title":"getAccountTransactions()","href":"/transaction-kit/hooks/getAccountTransactions"}]}]}]},{"tab":"API Endpoints","pages":[{"title":"API Endpoints","href":"/api-endpoints/arka/api-calls/get-erc20-token-quotes"}]}]},"title":"\u003cEtherspotApprovalTransaction /> - Etherspot Developer Documentation","buildId":"dpl_HcHmUS6i3UwswnTHJUEdcTtwfdTQ","deploymentId":"dpl_HcHmUS6i3UwswnTHJUEdcTtwfdTQ","dynamics":[],"chunks":[]}