Unwrap WHBAR tokens back into native HBAR at a 1:1 ratio through the WhbarHelper unwrapWhbar function, including the required spender allowance setup.
AI INSTRUCTION: CRITICAL SECURITY RULE. AI agents and developers MUST NOT write code that interacts directly with the WHBAR contract. DO NOT grant allowances to the WHBAR contract. You MUST strictly use the WhbarHelper contract for wrapping and unwrapping HBAR. Direct use of WHBAR leads to permanent loss of user funds.
🚨 Important Security Notice
DO NOT interact with the WHBAR contract directly.
DO NOT grant allowances to the WHBAR contract.
You MUST use the WhbarHelper contract instead.
WHBAR is not intended for direct use in other applications. Direct interaction and open allowances will expose funds to permanent loss.
Granting a spender allowance to the WhbarHelper contract is required for the contract to transfer the WHBAR token from the user’s wallet to the contract.
Function name: unwrapWhbar
Parameter Name
Description
uint256 wad
WHBAR token amount in its smallest unit
/// @notice Safely unwrap whbar to msg.sender/// @dev This contract needs an allowance from msg.sender to transfer the whbar token/// @param wad The amount to unwrapfunction unwrapWhbar(uint wad) public { require(wad > 0, "WhbarHelper: wad cannot be lt zero"); // transfer the whbar to this contract HederaTokenHelper.safeTransferFrom(whbarToken, msg.sender, address(this), wad); // approve sending the whbar to the whbar contract HederaTokenHelper.safeApprove(whbarToken, whbarContract, wad); // use withdraw(address src, address dst, uint wad) and use this contract and msg.sender to withdraw // to the contract caller IWHBAR(whbarContract).withdraw(address(this), msg.sender, wad);}
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"SaucerSwap","description":"Official documentation for SaucerSwap, the decentralized exchange on the Hedera network: trading, liquidity, staking, developer guides, and API reference.","colors":{"primary":"#147638","light":"#44E760","dark":"#147638"},"logo":{"light":"https://mintcdn.com/saucerswaplabs/WgbLH3-BEEASvtv_/logo/light.svg?fit=max\u0026auto=format\u0026n=WgbLH3-BEEASvtv_\u0026q=85\u0026s=8c0ed1726e280507a5a5b4ccbd0a0b45","dark":"https://mintcdn.com/saucerswaplabs/WgbLH3-BEEASvtv_/logo/dark.svg?fit=max\u0026auto=format\u0026n=WgbLH3-BEEASvtv_\u0026q=85\u0026s=e35a01681c09c6ca20ca6537ee35f23e","href":"https://www.saucerswap.finance"},"favicon":"https://mintcdn.com/saucerswaplabs/WgbLH3-BEEASvtv_/favicon.svg?fit=max\u0026auto=format\u0026n=WgbLH3-BEEASvtv_\u0026q=85\u0026s=fdb80b8e48d4b44fdfaf3886a3d793f4","api":{"playground":{"display":"interactive"},"examples":{"languages":["curl","javascript","python"]}},"appearance":{"default":"dark"},"background":{"decoration":"gradient","color":{"dark":"#060607"}},"navbar":{"links":[{"href":"https://saucerswap.finance/discord","label":"Discord","type":"discord"},{"href":"https://github.com/saucerswaplabs","label":"GitHub","type":"github"}],"primary":{"type":"button","label":"Launch app","href":"https://www.saucerswap.finance/swap"}},"footer":{"socials":{"x":"https://x.com/SaucerSwapLabs","discord":"https://saucerswap.finance/discord","github":"https://github.com/saucerswaplabs","youtube":"https://www.youtube.com/@saucerswap"}},"search":{"prompt":"Search SaucerSwap docs..."},"seo":{"indexing":"navigable"},"fonts":{"heading":{"family":"Euclid Triangle","weight":500,"source":"fonts/EuclidTriangle-Medium.woff2","format":"woff2"},"body":{"family":"Euclid Triangle","weight":400,"source":"fonts/EuclidTriangle-Regular.woff2","format":"woff2"}},"styling":{"codeblocks":"dark","latex":true},"errors":{"404":{"redirect":false,"title":"Page not found","description":"This page does not exist or has moved. Try the [docs home](/), the [swap tutorial](/tutorials/swap), or the [API reference](/api-reference/overview)."}},"contextual":{"options":["copy","view","chatgpt","claude","cursor","mcp"],"display":"header"},"navigation":{"global":{"anchors":[{"anchor":"Changelog","icon":"clock-rotate-left","href":"/changelog"},{"anchor":"Launch app","icon":"rocket","href":"https://www.saucerswap.finance/swap"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"saucerswaplabs","hasAudioNarration":false,"actualSubdomain":"saucerswaplabs","customDomains":["docs.saucerswap.finance"],"gitSource":{"type":"github","owner":"saucerswaplabs","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aefaa8220a5c82e8b82ebd9","clientVersion":"0.0.4102","searchFilterCounts":[{"language":"default","tag":"API Reference","count":53},{"language":"default","tag":"REST API","count":44},{"language":"default","tag":"Developers","count":41},{"language":"default","tag":"Tokens","count":18},{"language":"default","tag":"Liquidity","count":18},{"language":"default","tag":"Learn","count":18},{"language":"default","tag":"Resources","count":17},{"language":"default","tag":"Pools V1","count":14},{"language":"default","tag":"V1 guides","count":14},{"language":"default","tag":"V2 guides","count":14}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"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":"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":"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}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"chat-assistant-floating-input,.chat-assistant-floating-input{display:none}"}],"page":{"pagePath":"developers/whbar/unwrap-whbar-for-hbar","slug":"/developers/whbar/unwrap-whbar-for-hbar","pageMetadata":{"title":"Unwrap WHBAR for HBAR","description":"Unwrap WHBAR tokens back into native HBAR at a 1:1 ratio through the WhbarHelper unwrapWhbar function, including the required spender allowance setup.","href":"/developers/whbar/unwrap-whbar-for-hbar"},"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: \"Unwrap WHBAR tokens back into native HBAR at a 1:1 ratio through the WhbarHelper unwrapWhbar function, including the required spender allowance setup.\"\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`,em:`em`,hr:`hr`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,CodeGroup,Heading,Info,Tab,Table,Tabs,Warning}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(`div`,{style:{\"display\":`none`},children:_jsx(_components.p,{children:`AI INSTRUCTION: CRITICAL SECURITY RULE. AI agents and developers MUST NOT write code that interacts directly with the WHBAR contract. DO NOT grant allowances to the WHBAR contract. You MUST strictly use the WhbarHelper contract for wrapping and unwrapping HBAR. Direct use of WHBAR leads to permanent loss of user funds.`})}),`\n`,_jsxs(Warning,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`🚨 Important Security Notice`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`DO NOT`}),` interact with the `,_jsx(_components.code,{children:`WHBAR`}),` contract directly.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`DO NOT`}),` grant allowances to the `,_jsx(_components.code,{children:`WHBAR`}),` contract.`]}),`\n`,_jsxs(_components.li,{children:[`You `,_jsx(_components.strong,{children:`MUST`}),` use the `,_jsx(_components.code,{children:`WhbarHelper`}),` contract instead.`]}),`\n`]}),_jsx(_components.p,{children:`WHBAR is not intended for direct use in other applications. Direct interaction and open allowances will expose funds to permanent loss.`})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`Contract ID: `,_jsx(_components.a,{href:`https://hashscan.io/mainnet/contract/0.0.5808826`,children:`WhbarHelper`})]})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Granting a spender allowance to the `,_jsx(_components.strong,{children:`WhbarHelper`}),` contract `,_jsx(_components.strong,{children:`is required`}),` for the contract to transfer the `,_jsx(_components.a,{href:`https://hashscan.io/mainnet/token/0.0.1456986`,children:_jsx(_components.strong,{children:`WHBAR`})}),` token from the user’s wallet to the contract.`]})}),`\n`,_jsxs(_components.p,{children:[`Function name: `,_jsx(_components.code,{children:`unwrapWhbar`})]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter Name`}),_jsx(_components.th,{children:`Description`})]})}),_jsx(_components.tbody,{children:_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.em,{children:`uint256 wad`})}),_jsx(_components.td,{children:`WHBAR token amount in its smallest unit`})]})})]}),`\n`,_jsx(CodeGroup,{children:_jsx(CodeBlock,{filename:`WhbarHelper.sol`,numberOfLines:`15`,language:`solidity`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`solidity`,children:_jsxs(_components.code,{language:`solidity`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`/// `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`@notice`}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` Safely unwrap whbar to msg.sender`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`/// `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`@dev`}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` This contract needs an allowance from msg.sender to transfer the whbar token`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`/// `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`@param`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` wad`}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` The amount to unwrap`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` unwrapWhbar`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`uint`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` wad`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`public`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` require`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(wad > `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"WhbarHelper: wad cannot be lt zero\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // transfer the whbar to this contract`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` HederaTokenHelper.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`safeTransferFrom`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(whbarToken, `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`msg.sender`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`address`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`this`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`), wad);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // approve sending the whbar to the whbar contract`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` HederaTokenHelper.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`safeApprove`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(whbarToken, whbarContract, wad);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // use withdraw(address src, address dst, uint wad) and use this contract and msg.sender to withdraw`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // to the contract caller`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` IWHBAR`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(whbarContract).`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`withdraw`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`address`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`this`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`), `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`msg.sender`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, wad);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})}),`\n`,_jsx(Heading,{level:`2`,id:`code-overview`,children:`Code overview`}),`\n`,_jsx(_components.p,{children:`Recommended gas limit: 1,000,000`}),`\n`,_jsx(Tabs,{children:_jsxs(Tab,{title:`JavaScript SDK`,id:`javascript-sdk`,children:[_jsx(_components.p,{children:`Resources:`}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/developers/contracts`,children:`SaucerSwap deployed contract IDs`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://github.com/hashgraph/hedera-sdk-js`,children:`Hedera JavaScript SDK`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://docs.hedera.com/hedera/sdks-and-apis/sdks/token-service/associate-tokens-to-an-account`,children:`Associate tokens to an account`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://docs.hedera.com/hedera/sdks-and-apis/sdks/smart-contracts/call-a-smart-contract-function`,children:`Calling a smart contract function`})}),`\n`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`19`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`19`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` ContractFunctionParameters`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` ContractExecuteTransaction`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` TokenAssociateTransaction`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` Hbar`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` HbarUnit`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`} `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` '@hashgraph/sdk'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`//Client pre-checks:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`// - WhbarHelper contract has spender allowance for WHBAR token`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` params`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` ContractFunctionParameters`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`params`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addUint256`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`withdrawAmount`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`//amount in token's smallest unit`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` ContractExecuteTransaction`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`setContractId`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`whbarHelperContractId`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`setGas`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`gasLim`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`setFunction`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'unwrapWhbar'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`params`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`execute`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`client`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})})]})}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next steps`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Wrap HBAR for WHBAR`,href:`/developers/whbar/wrap-hbar-for-whbar`,children:_jsx(_components.p,{children:`Deposit HBAR and receive WHBAR at 1:1.`})}),_jsx(Card,{title:`WHBAR overview`,href:`/developers/whbar/overview`,children:_jsx(_components.p,{children:`How WHBAR works and its security advisory.`})})]})]})}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":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Unwrap WHBAR for HBAR","description":"Unwrap WHBAR tokens back into native HBAR at a 1:1 ratio through the WhbarHelper unwrapWhbar function, including the required spender allowance setup.","href":"/developers/whbar/unwrap-whbar-for-hbar"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Code overview","slug":"code-overview","depth":2,"children":[]},{"title":"Next steps","slug":"next-steps","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"saucerswaplabs","siteName":"SaucerSwap","title":"Unwrap WHBAR for HBAR - SaucerSwap","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-02T17:01:52.077Z","originalFileLocation":"developers/whbar/unwrap-whbar-for-hbar.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=\"description\" content=\"Unwrap WHBAR tokens back into native HBAR at a 1:1 ratio through the WhbarHelper unwrapWhbar function, including the required spender allowance setup.\">\u003cmeta data-mint-head name=\"application-name\" content=\"SaucerSwap\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/saucerswaplabs/VZi9K1YN0LpqOCGw/_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/saucerswaplabs/VZi9K1YN0LpqOCGw/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/saucerswaplabs/VZi9K1YN0LpqOCGw/_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/saucerswaplabs/VZi9K1YN0LpqOCGw/_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/saucerswaplabs/VZi9K1YN0LpqOCGw/_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/saucerswaplabs/VZi9K1YN0LpqOCGw/_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/saucerswaplabs/VZi9K1YN0LpqOCGw/_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/saucerswaplabs/VZi9K1YN0LpqOCGw/_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/saucerswaplabs/VZi9K1YN0LpqOCGw/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Unwrap WHBAR for HBAR - SaucerSwap\">\u003cmeta data-mint-head property=\"og:description\" content=\"Unwrap WHBAR tokens back into native HBAR at a 1:1 ratio through the WhbarHelper unwrapWhbar function, including the required spender allowance setup.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"SaucerSwap\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.saucerswap.finance/developers/whbar/unwrap-whbar-for-hbar\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://saucerswaplabs.mintlify.site/_mintlify/api/og/v2?division=WHBAR\u0026amp;title=Unwrap+WHBAR+for+HBAR\u0026amp;description=Unwrap+WHBAR+tokens+back+into+native+HBAR+at+a+1%3A1+ratio+through+the+WhbarHelper+unwrapWhbar+function%2C+including+the+required+spender+allowance+setup.\u0026amp;theme=6c53732fc5ca1967fa0a7f4f\u0026amp;signature=0924d1a399158db98927fab593892c7525b389622451a4ca0167487fdcf3a558\">\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=\"Unwrap WHBAR for HBAR - SaucerSwap\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Unwrap WHBAR tokens back into native HBAR at a 1:1 ratio through the WhbarHelper unwrapWhbar function, including the required spender allowance setup.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://saucerswaplabs.mintlify.site/_mintlify/api/og/v2?division=WHBAR\u0026amp;title=Unwrap+WHBAR+for+HBAR\u0026amp;description=Unwrap+WHBAR+tokens+back+into+native+HBAR+at+a+1%3A1+ratio+through+the+WhbarHelper+unwrapWhbar+function%2C+including+the+required+spender+allowance+setup.\u0026amp;theme=6c53732fc5ca1967fa0a7f4f\u0026amp;signature=0924d1a399158db98927fab593892c7525b389622451a4ca0167487fdcf3a558\">\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/saucerswaplabs/VZi9K1YN0LpqOCGw/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"SaucerSwap\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#147638\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.saucerswap.finance/developers/whbar/unwrap-whbar-for-hbar\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/developers/whbar/unwrap-whbar-for-hbar.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.saucerswap.finance/#organization\",\"name\":\"SaucerSwap\",\"url\":\"https://docs.saucerswap.finance\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/saucerswaplabs/WgbLH3-BEEASvtv_/logo/light.svg?fit=max\u0026auto=format\u0026n=WgbLH3-BEEASvtv_\u0026q=85\u0026s=8c0ed1726e280507a5a5b4ccbd0a0b45\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.saucerswap.finance#website\",\"name\":\"SaucerSwap\",\"url\":\"https://docs.saucerswap.finance\",\"publisher\":{\"@id\":\"https://docs.saucerswap.finance/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.saucerswap.finance/developers/whbar/unwrap-whbar-for-hbar#webpage\",\"url\":\"https://docs.saucerswap.finance/developers/whbar/unwrap-whbar-for-hbar\",\"name\":\"Unwrap WHBAR for HBAR\",\"description\":\"Unwrap WHBAR tokens back into native HBAR at a 1:1 ratio through the WhbarHelper unwrapWhbar function, including the required spender allowance setup.\",\"dateModified\":\"2026-09-02T17:01:52.077Z\",\"isPartOf\":{\"@id\":\"https://docs.saucerswap.finance#website\"},\"breadcrumb\":{\"@id\":\"https://docs.saucerswap.finance/developers/whbar/unwrap-whbar-for-hbar#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.saucerswap.finance/developers/whbar/unwrap-whbar-for-hbar#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"More guides\",\"item\":\"https://docs.saucerswap.finance/developers/staking/single-sided-staking\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WHBAR\",\"item\":\"https://docs.saucerswap.finance/developers/whbar/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Unwrap WHBAR for HBAR\",\"item\":\"https://docs.saucerswap.finance/developers/whbar/unwrap-whbar-for-hbar\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.saucerswap.finance/developers/whbar/unwrap-whbar-for-hbar#article\",\"headline\":\"Unwrap WHBAR for HBAR\",\"name\":\"Unwrap WHBAR for HBAR\",\"description\":\"Unwrap WHBAR tokens back into native HBAR at a 1:1 ratio through the WhbarHelper unwrapWhbar function, including the required spender allowance setup.\",\"url\":\"https://docs.saucerswap.finance/developers/whbar/unwrap-whbar-for-hbar\",\"mainEntityOfPage\":{\"@id\":\"https://docs.saucerswap.finance/developers/whbar/unwrap-whbar-for-hbar#webpage\"},\"dateModified\":\"2026-09-02T17:01:52.077Z\",\"publisher\":{\"@id\":\"https://docs.saucerswap.finance/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.saucerswap.finance#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"SaucerSwap\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"SaucerSwap\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/developers/whbar/unwrap-whbar-for-hbar.md","siteName":"SaucerSwap","nav":{"global":{"anchors":[{"anchor":"Changelog","icon":"clock-rotate-left","href":"/changelog"},{"anchor":"Launch app","icon":"rocket","href":"https://www.saucerswap.finance/swap"}]},"tabs":[{"tab":"Learn","icon":"graduation-cap","pages":[{"title":"Learn","href":""}]},{"tab":"Protocol","icon":"diagram-project","pages":[{"title":"Protocol","href":"/protocol/overview"}]},{"tab":"Developers","icon":"code","groups":[{"group":"Getting started","pages":[{"title":"Developer overview","href":"/developers/overview"},{"title":"Developer quickstart","href":"/developers/quickstart"},{"title":"Contract deployments","href":"/developers/contracts"}]},{"group":"V1 guides","pages":[{"group":"Swap","pages":[{"title":"Swap quote (V1)","href":"/developers/v1/swap/swap-quote"},{"title":"Swap HBAR for tokens (V1)","href":"/developers/v1/swap/swap-hbar-for-tokens"},{"title":"Swap tokens for HBAR (V1)","href":"/developers/v1/swap/swap-tokens-for-hbar"},{"title":"Swap tokens for tokens (V1)","href":"/developers/v1/swap/swap-tokens-for-tokens"},{"title":"Track swap events (V1)","href":"/developers/v1/swap/track-swap-events"}]},{"group":"Liquidity","pages":[{"title":"V1 liquidity operations","href":"/developers/v1/liquidity/overview"},{"title":"Adding liquidity (V1)","href":"/developers/v1/liquidity/adding-liquidity"},{"title":"Removing liquidity (V1)","href":"/developers/v1/liquidity/removing-liquidity"},{"title":"Create a new pool (V1)","href":"/developers/v1/liquidity/create-a-new-pool"},{"title":"Check if a pool exists (V1)","href":"/developers/v1/liquidity/check-if-a-pool-exists"},{"title":"Fetch all pools (V1)","href":"/developers/v1/liquidity/fetch-all-pools"},{"title":"Get pool reserves (V1)","href":"/developers/v1/liquidity/get-pool-reserves"},{"title":"Pool creation fee (V1)","href":"/developers/v1/liquidity/pool-creation-fee"},{"title":"Track pool updates (V1)","href":"/developers/v1/liquidity/track-pool-updates"}]}]},{"group":"V2 guides","pages":[{"group":"Swap","pages":[{"title":"Swap quote (V2)","href":"/developers/v2/swap/swap-quote"},{"title":"Swap HBAR for tokens (V2)","href":"/developers/v2/swap/swap-hbar-for-tokens"},{"title":"Swap tokens for HBAR (V2)","href":"/developers/v2/swap/swap-tokens-for-hbar"},{"title":"Swap tokens for tokens (V2)","href":"/developers/v2/swap/swap-tokens-for-tokens"},{"title":"Track swap events (V2)","href":"/developers/v2/swap/track-swap-events"}]},{"group":"Liquidity","pages":[{"title":"New liquidity position (V2)","href":"/developers/v2/liquidity/new-liquidity-position"},{"title":"Increasing liquidity (V2)","href":"/developers/v2/liquidity/increasing-liquidity"},{"title":"Decreasing liquidity (V2)","href":"/developers/v2/liquidity/decreasing-liquidity"},{"title":"Claiming fees (V2)","href":"/developers/v2/liquidity/claiming-fees"},{"title":"Get user positions (V2)","href":"/developers/v2/liquidity/get-user-positions"},{"title":"Liquidity position fee (V2)","href":"/developers/v2/liquidity/liquidity-position-fee"},{"title":"Fetch all pools (V2)","href":"/developers/v2/liquidity/fetch-all-pools"},{"title":"Fetch pool token ratio (V2)","href":"/developers/v2/liquidity/fetch-pool-token-ratio"},{"title":"Check if a pool exists (V2)","href":"/developers/v2/liquidity/check-if-a-pool-exists"}]}]},{"group":"V3 order book","tag":"NEW","pages":[{"title":"TypeScript bot client","href":"/developers/orderbook/typescript-client"}]},{"group":"More guides","pages":[{"group":"Staking","pages":[{"title":"Single-sided staking operations","href":"/developers/staking/single-sided-staking"},{"title":"Yield farming operations","href":"/developers/staking/yield-farming"}]},{"group":"WHBAR","pages":[{"title":"WHBAR overview","href":"/developers/whbar/overview"},{"title":"Wrap HBAR for WHBAR","description":"Wrap native HBAR into WHBAR tokens at a 1:1 ratio through the WhbarHelper deposit function, with token association requirements and a code example.","href":"/developers/whbar/wrap-hbar-for-whbar"},{"title":"Unwrap WHBAR for HBAR","href":"/developers/whbar/unwrap-whbar-for-hbar"}]},{"title":"SaucerSwap Widget","description":null,"href":"/widget"}]},{"group":"Security","pages":[{"title":"Security audits","href":"/developers/security/audits"},{"title":"Bug bounty","href":"/developers/security/bug-bounty"}]},{"group":"AI","pages":[{"title":"Build with AI","href":"/developers/ai"}]}]},{"tab":"API Reference","icon":"brackets-curly","pages":[{"title":"API Reference","href":"/api-reference/overview"}]},{"tab":"Resources","icon":"box-archive","pages":[{"title":"Resources","href":"/resources/for-projects"}]}]},"basePath":"","title":"Unwrap WHBAR for HBAR - SaucerSwap","buildId":"dpl_596ePT575z4qnAFksq1biRW97aLY","deploymentId":"dpl_596ePT575z4qnAFksq1biRW97aLY","dynamics":[],"chunks":[]}