{
"error": "simulation_failed",
"message": "could not simulate the provided calls"
}
{
"error": "unauthorized"
}
{
"error": "horizon_unreachable"
}
Fee
Quote a gas-in-token fee
Request a fee quote for paying Soroban gas in a token instead of XLM. The facilitator simulates the calls, prices the XLM fee as a token amount, and returns the quote including the FeeForwarder contract address and a ledger-based expiry.
The SDK uses this quote to build the FeeForwarder.forward() authorization entry before calling POST /relay with feeToken set.
POST
/
fee
/
quote
Error
A valid request URL is required to generate request examples
Server-held API key. Injected by the BFF (createRelayRoute / createSignerProxyRoute from @buckspay/nextjs). This key must only appear in server-side code and must never be shipped to a browser bundle.
Body
application/json
Request body for POST /fee/quote. Calls are simulated server-side to price the XLM fee as a token amount.
Fee expressed in the requested token's smallest unit (USDC stroops for USDC). The SDK passes this as the fee_amount argument in the forward() invocation.
Ledger sequence after which this quote expires. The SDK refuses to build a relay with an expired quote.
Required range: x >= 1
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Buckspay SDK","description":"Gasless smart-wallet SDK for Stellar (Soroban) USDC payments - web and mobile.","colors":{"primary":"#1884FF","light":"#21CBF3","dark":"#1884FF"},"logo":{"light":"https://mintcdn.com/buckspay/npvFrjcwne30-E69/logo/buckspay-light.png?fit=max\u0026auto=format\u0026n=npvFrjcwne30-E69\u0026q=85\u0026s=8ea8e7682265d39c221fe2366f04b7d6","dark":"https://mintcdn.com/buckspay/npvFrjcwne30-E69/logo/buckspay.png?fit=max\u0026auto=format\u0026n=npvFrjcwne30-E69\u0026q=85\u0026s=fca5f0b7359fb8a30e6a23f336ca0ada"},"favicon":"https://mintcdn.com/buckspay/npvFrjcwne30-E69/images/favicon.svg?fit=max\u0026auto=format\u0026n=npvFrjcwne30-E69\u0026q=85\u0026s=f8185102fd9b76e5100ef92e303b0761","appearance":{"default":"dark"},"background":{"color":{"dark":"#0A0D10"}},"navbar":{"links":[{"href":"https://github.com/bucks-pay/buckspay-sdk","label":"GitHub"}]},"footer":{"socials":{"github":"https://github.com/bucks-pay/buckspay-sdk"}},"search":{"prompt":"Search or ask the Buckspay SDK docs"},"styling":{"codeblocks":"dark","latex":false},"contextual":{"options":["copy","view","chatgpt","claude","cursor","vscode"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"buckspay","hasAudioNarration":false,"actualSubdomain":"buckspay","customDomains":["docs.buckspay.xyz"],"gitSource":{"type":"github","owner":"bucks-pay","repo":"buckspay-sdk","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae95b4dcb76ddd761cc4fdc:success","clientVersion":"0.0.4102","searchFilterCounts":[{"language":"default","tag":"Guides","count":36},{"language":"default","tag":"SDK Reference","count":13},{"language":"default","tag":"API Reference","count":12},{"language":"default","tag":"Features","count":9},{"language":"default","tag":"Production","count":7},{"language":"default","tag":"Signers","count":6},{"language":"default","tag":"Concepts","count":5},{"language":"default","tag":"Platforms","count":5},{"language":"default","tag":"Security","count":5},{"language":"default","tag":"Get Started","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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":[],"page":{"pagePath":"api-reference/fee/quote-a-gas-in-token-fee","slug":"/api-reference/fee/quote-a-gas-in-token-fee","pageMetadata":{"title":"Quote a gas-in-token fee","description":"Request a fee quote for paying Soroban gas in a token instead of XLM. The facilitator simulates the calls, prices the XLM fee as a token amount, and returns the quote including the `FeeForwarder` contract address and a ledger-based expiry.\n\nThe SDK uses this quote to build the `FeeForwarder.forward()` authorization entry before calling `POST /relay` with `feeToken` set.","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /fee/quote","href":"/api-reference/fee/quote-a-gas-in-token-fee","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"Request a fee quote for paying Soroban gas in a token instead of XLM. The facilitator simulates the calls, prices the XLM fee as a token amount, and returns the quote including the \", _jsx(_components.code, {\n children: \"FeeForwarder\"\n }), \" contract address and a ledger-based expiry.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"The SDK uses this quote to build the \", _jsx(_components.code, {\n children: \"FeeForwarder.forward()\"\n }), \" authorization entry before calling \", _jsx(_components.code, {\n children: \"POST /relay\"\n }), \" with \", _jsx(_components.code, {\n children: \"feeToken\"\n }), \" set.\"]\n })]\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}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Quote a gas-in-token fee","description":"Request a fee quote for paying Soroban gas in a token instead of XLM. The facilitator simulates the calls, prices the XLM fee as a token amount, and returns the quote including the `FeeForwarder` contract address and a ledger-based expiry.\n\nThe SDK uses this quote to build the `FeeForwarder.forward()` authorization entry before calling `POST /relay` with `feeToken` set.","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /fee/quote","href":"/api-reference/fee/quote-a-gas-in-token-fee","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Quote a gas-in-token fee","operationId":"postFeeQuote","tags":["Fee"],"description":"Request a fee quote for paying Soroban gas in a token instead of XLM. The facilitator simulates the calls, prices the XLM fee as a token amount, and returns the quote including the `FeeForwarder` contract address and a ledger-based expiry.\n\nThe SDK uses this quote to build the `FeeForwarder.forward()` authorization entry before calling `POST /relay` with `feeToken` set.","requestBody":"b8529271-8c88-4307-a3ed-e55ee57b6b0b","responses":{"200":"c934a19f-d708-4260-a150-efa2373cdeeb","400":"014dd00d-bc18-4ae6-b32d-d0d9510fe605","401":"53943bff-ee5c-4182-a3e5-94945c0e8a6b","502":"3ed3c1fc-7e03-4aac-b2c9-23d17d8766ad"},"method":"post","type":"path","servers":["27e53354-1cab-4581-850c-4cd432c68c79"],"security":["234518de-e331-4328-82b3-da6eb8063d8d"],"path":"/fee/quote","baseUrlOptions":["{facilitatorUrl}"],"title":"Quote a gas-in-token fee","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["chain","from","token","calls"],"properties":{"chain":{"type":"string","enum":["stellar-testnet","stellar-pubnet"],"description":"Stellar network identifier used in facilitator requests.","isRequired":true,"uniqueKey":"chain","typeLabel":"enum\u003cstring>"},"from":{"type":"string","description":"Payer address (G or C) whose account the fee will be deducted from.","pattern":"^[GC][A-Z2-7]{55}$","isRequired":true,"uniqueKey":"from","typeLabel":"string"},"token":{"type":"string","description":"Token contract address (USDC SAC) used to pay the gas fee.","pattern":"^C[A-Z2-7]{55}$","isRequired":true,"uniqueKey":"token","typeLabel":"string"},"calls":{"type":"array","minItems":1,"description":"Calls to simulate for fee estimation.","items":{"type":"object","required":["contract","fn","args"],"properties":{"contract":{"type":"string","description":"Target contract address.","pattern":"^C[A-Z2-7]{55}$","isRequired":true,"uniqueKey":"calls.items.[INDEX].contract","typeLabel":"string"},"fn":{"type":"string","description":"Contract function name (e.g. `transfer`).","isRequired":true,"uniqueKey":"calls.items.[INDEX].fn","typeLabel":"string"},"args":{"type":"array","description":"Soroban `ScVal` arguments serialized as base64 XDR strings.","items":{"type":"string","description":"One `ScVal` argument as base64 XDR.","minLength":1,"pattern":"^[A-Za-z0-9+/]+=*$","uniqueKey":"calls.items.[INDEX].args.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"calls.items.[INDEX].args","typeLabel":"string[]"}},"uniqueKey":"calls.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"calls","typeLabel":"object[]"}},"description":"Request body for `POST /fee/quote`. Calls are simulated server-side to price the XLM fee as a token amount.","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"from":"\u003cstring>","token":"\u003cstring>","calls":[{"contract":"\u003cstring>","fn":"\u003cstring>","args":["\u003cstring>"]}]}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"c934a19f-d708-4260-a150-efa2373cdeeb":{"description":"Fee quote computed successfully.","content":{"application/json":{"schema":{"type":"object","required":["forwarder","collector","token","estimatedXlmFee","tokenAmount","expiresAtLedger"],"properties":{"forwarder":{"type":"string","description":"`FeeForwarder` contract address. The SDK uses this to build the `forward()` authorization entry.","pattern":"^C[A-Z2-7]{55}$","isRequired":true,"uniqueKey":"forwarder","typeLabel":"string"},"collector":{"type":"string","description":"Address that collects the fee (G or C). Embedded in the `forward()` invocation.","pattern":"^[GC][A-Z2-7]{55}$","isRequired":true,"uniqueKey":"collector","typeLabel":"string"},"token":{"type":"string","description":"Token used to pay the fee. Echoes the request `token`.","pattern":"^C[A-Z2-7]{55}$","isRequired":true,"uniqueKey":"token","typeLabel":"string"},"estimatedXlmFee":{"type":"string","description":"Estimated XLM fee in stroops.","pattern":"^\\d+$","isRequired":true,"uniqueKey":"estimatedXlmFee","typeLabel":"string"},"tokenAmount":{"type":"string","description":"Fee expressed in the requested token's smallest unit (USDC stroops for USDC). The SDK passes this as the `fee_amount` argument in the `forward()` invocation.","pattern":"^\\d+$","isRequired":true,"uniqueKey":"tokenAmount","typeLabel":"string"},"expiresAtLedger":{"type":"integer","minimum":1,"description":"Ledger sequence after which this quote expires. The SDK refuses to build a relay with an expired quote.","isRequired":true,"uniqueKey":"expiresAtLedger","typeLabel":"integer"}},"description":"Fee quote returned by `POST /fee/quote`. Mirrors the SDK `FeeQuote` type from `@buckspay/core`.","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"forwarder":"\u003cstring>","collector":"\u003cstring>","token":"\u003cstring>","estimatedXlmFee":"\u003cstring>","tokenAmount":"\u003cstring>","expiresAtLedger":2}}},"exampleType":"generated"}},"exampleType":"generated"},"014dd00d-bc18-4ae6-b32d-d0d9510fe605":{"description":"The calls could not be simulated or the token is not supported.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Machine-readable error code. SDK error codes (e.g. `RELAYER_REJECTED`, `SESSION_POLICY_VIOLATION`) or raw facilitator codes (e.g. `auth_expired`, `simulation_failed`) depending on context.","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"message":{"type":"string","description":"Optional human-readable detail. Never log raw upstream messages - they may contain addresses or sensitive information.","uniqueKey":"message","typeLabel":"string"},"details":{"type":"object","description":"Optional structured validation errors (present on BFF-level schema failures).","uniqueKey":"details","typeLabel":"object"}},"description":"Error body returned on non-2xx responses. The `error` field maps to a `BuckspayErrorCode` or a raw facilitator error string (see `mapFacilitatorError` in `@buckspay/relayer`).","uniqueKey":"","typeLabel":"object"},"example":{"error":"simulation_failed","message":"could not simulate the provided calls"},"examples":{"Example":{"title":"Example","value":{"error":"simulation_failed","message":"could not simulate the provided calls"}}},"exampleType":"examples"}},"exampleType":"examples"},"53943bff-ee5c-4182-a3e5-94945c0e8a6b":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Machine-readable error code. SDK error codes (e.g. `RELAYER_REJECTED`, `SESSION_POLICY_VIOLATION`) or raw facilitator codes (e.g. `auth_expired`, `simulation_failed`) depending on context.","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"message":{"type":"string","description":"Optional human-readable detail. Never log raw upstream messages - they may contain addresses or sensitive information.","uniqueKey":"message","typeLabel":"string"},"details":{"type":"object","description":"Optional structured validation errors (present on BFF-level schema failures).","uniqueKey":"details","typeLabel":"object"}},"description":"Error body returned on non-2xx responses. The `error` field maps to a `BuckspayErrorCode` or a raw facilitator error string (see `mapFacilitatorError` in `@buckspay/relayer`).","uniqueKey":"","typeLabel":"object"},"example":{"error":"unauthorized"},"examples":{"Example":{"title":"Example","value":{"error":"unauthorized"}}},"exampleType":"examples"}},"exampleType":"examples"},"3ed3c1fc-7e03-4aac-b2c9-23d17d8766ad":{"description":"Facilitator could not reach Stellar Horizon.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Machine-readable error code. SDK error codes (e.g. `RELAYER_REJECTED`, `SESSION_POLICY_VIOLATION`) or raw facilitator codes (e.g. `auth_expired`, `simulation_failed`) depending on context.","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"message":{"type":"string","description":"Optional human-readable detail. Never log raw upstream messages - they may contain addresses or sensitive information.","uniqueKey":"message","typeLabel":"string"},"details":{"type":"object","description":"Optional structured validation errors (present on BFF-level schema failures).","uniqueKey":"details","typeLabel":"object"}},"description":"Error body returned on non-2xx responses. The `error` field maps to a `BuckspayErrorCode` or a raw facilitator error string (see `mapFacilitatorError` in `@buckspay/relayer`).","uniqueKey":"","typeLabel":"object"},"example":{"error":"horizon_unreachable"},"examples":{"Example":{"title":"Example","value":{"error":"horizon_unreachable"}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"234518de-e331-4328-82b3-da6eb8063d8d":{"FacilitatorApiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Server-held API key. Injected by the BFF (`createRelayRoute` / `createSignerProxyRoute` from `@buckspay/nextjs`). This key must only appear in server-side code and must never be shipped to a browser bundle.","scopes":[]}}},"servers":{"27e53354-1cab-4581-850c-4cd432c68c79":{"url":"{facilitatorUrl}","description":"Buckspay facilitator (all endpoints). Set via BUCKSPAY_FACILITATOR_URL on the server.","variables":{"facilitatorUrl":{"default":"https://facilitator.buckspay.xyz","description":"Base URL of the Buckspay facilitator service."}}}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","description":"Server-held API key. Injected by the BFF (`createRelayRoute` / `createSignerProxyRoute` from `@buckspay/nextjs`). This key must only appear in server-side code and must never be shipped to a browser bundle.","scopes":[]},"schema":{"title":"x-api-key","type":"string","description":"Server-held API key. Injected by the BFF (`createRelayRoute` / `createSignerProxyRoute` from `@buckspay/nextjs`). This key must only appear in server-side code and must never be shipped to a browser bundle.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"FacilitatorApiKey","name":"x-api-key"}],"title":"FacilitatorApiKey"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"buckspay","siteName":"Buckspay SDK","title":"Quote a gas-in-token fee - Buckspay SDK","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-01T01:48:35.779Z","originalFileLocation":"api-reference/fee/quote-a-gas-in-token-fee.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=\"Request a fee quote for paying Soroban gas in a token instead of XLM. The facilitator simulates the calls, prices the XLM fee as a token amount, and returns the quote including the FeeForwarder contract address and a ledger-based expiry. The SDK uses this quote to build the FeeForwarder.forward() authorization entry before calling POST /relay with feeToken set.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Buckspay SDK\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/buckspay/HQ53bdLVcWcry6ev/_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/buckspay/HQ53bdLVcWcry6ev/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/buckspay/HQ53bdLVcWcry6ev/_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/buckspay/HQ53bdLVcWcry6ev/_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/buckspay/HQ53bdLVcWcry6ev/_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/buckspay/HQ53bdLVcWcry6ev/_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/buckspay/HQ53bdLVcWcry6ev/_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/buckspay/HQ53bdLVcWcry6ev/_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/buckspay/HQ53bdLVcWcry6ev/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Quote a gas-in-token fee - Buckspay SDK\">\u003cmeta data-mint-head property=\"og:description\" content=\"Request a fee quote for paying Soroban gas in a token instead of XLM. The facilitator simulates the calls, prices the XLM fee as a token amount, and returns the quote including the FeeForwarder contract address and a ledger-based expiry. The SDK uses this quote to build the FeeForwarder.forward() authorization entry before calling POST /relay with feeToken set.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Buckspay SDK\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.buckspay.xyz/api-reference/fee/quote-a-gas-in-token-fee\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://buckspay.mintlify.site/_mintlify/api/og/v2?division=Fee\u0026amp;title=Quote+a+gas-in-token+fee\u0026amp;description=Request+a+fee+quote+for+paying+Soroban+gas+in+a+token+instead+of+XLM.+The+facilitator+simulates+the+calls%2C+prices+the+XLM+fee+as+a+token+amount%2C+and+returns+the\u0026amp;theme=35af4ee300a5cd95d7ae32a8\u0026amp;signature=3b7a094fe28512d504a2930e323b1c3703f79fa9505ad0a5416a5b01f966c610\">\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=\"Quote a gas-in-token fee - Buckspay SDK\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Request a fee quote for paying Soroban gas in a token instead of XLM. The facilitator simulates the calls, prices the XLM fee as a token amount, and returns the quote including the FeeForwarder contract address and a ledger-based expiry. The SDK uses this quote to build the FeeForwarder.forward() authorization entry before calling POST /relay with feeToken set.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://buckspay.mintlify.site/_mintlify/api/og/v2?division=Fee\u0026amp;title=Quote+a+gas-in-token+fee\u0026amp;description=Request+a+fee+quote+for+paying+Soroban+gas+in+a+token+instead+of+XLM.+The+facilitator+simulates+the+calls%2C+prices+the+XLM+fee+as+a+token+amount%2C+and+returns+the\u0026amp;theme=35af4ee300a5cd95d7ae32a8\u0026amp;signature=3b7a094fe28512d504a2930e323b1c3703f79fa9505ad0a5416a5b01f966c610\">\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/buckspay/HQ53bdLVcWcry6ev/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Buckspay SDK\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1884FF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.buckspay.xyz/api-reference/fee/quote-a-gas-in-token-fee\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/fee/quote-a-gas-in-token-fee.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.buckspay.xyz/#organization\",\"name\":\"Buckspay SDK\",\"url\":\"https://docs.buckspay.xyz\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/buckspay/npvFrjcwne30-E69/logo/buckspay-light.png?fit=max\u0026auto=format\u0026n=npvFrjcwne30-E69\u0026q=85\u0026s=8ea8e7682265d39c221fe2366f04b7d6\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.buckspay.xyz#website\",\"name\":\"Buckspay SDK\",\"url\":\"https://docs.buckspay.xyz\",\"publisher\":{\"@id\":\"https://docs.buckspay.xyz/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.buckspay.xyz/api-reference/fee/quote-a-gas-in-token-fee#webpage\",\"url\":\"https://docs.buckspay.xyz/api-reference/fee/quote-a-gas-in-token-fee\",\"name\":\"Quote a gas-in-token fee\",\"description\":\"Request a fee quote for paying Soroban gas in a token instead of XLM. The facilitator simulates the calls, prices the XLM fee as a token amount, and returns the quote including the FeeForwarder contract address and a ledger-based expiry. The SDK uses this quote to build the FeeForwarder.forward() authorization entry before calling POST /relay with feeToken set.\",\"dateModified\":\"2026-07-01T01:48:35.779Z\",\"isPartOf\":{\"@id\":\"https://docs.buckspay.xyz#website\"},\"breadcrumb\":{\"@id\":\"https://docs.buckspay.xyz/api-reference/fee/quote-a-gas-in-token-fee#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.buckspay.xyz/api-reference/fee/quote-a-gas-in-token-fee#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Buckspay SDK\",\"item\":\"https://docs.buckspay.xyz\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Quote a gas-in-token fee\",\"item\":\"https://docs.buckspay.xyz/api-reference/fee/quote-a-gas-in-token-fee\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.buckspay.xyz/api-reference/fee/quote-a-gas-in-token-fee#apireference\",\"headline\":\"Quote a gas-in-token fee\",\"name\":\"Quote a gas-in-token fee\",\"description\":\"Request a fee quote for paying Soroban gas in a token instead of XLM. The facilitator simulates the calls, prices the XLM fee as a token amount, and returns the quote including the FeeForwarder contract address and a ledger-based expiry. The SDK uses this quote to build the FeeForwarder.forward() authorization entry before calling POST /relay with feeToken set.\",\"url\":\"https://docs.buckspay.xyz/api-reference/fee/quote-a-gas-in-token-fee\",\"mainEntityOfPage\":{\"@id\":\"https://docs.buckspay.xyz/api-reference/fee/quote-a-gas-in-token-fee#webpage\"},\"dateModified\":\"2026-07-01T01:48:35.779Z\",\"publisher\":{\"@id\":\"https://docs.buckspay.xyz/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.buckspay.xyz#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Buckspay SDK\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Buckspay SDK\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/fee/quote-a-gas-in-token-fee.md","siteName":"Buckspay SDK","nav":{"global":null,"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":""}]},{"tab":"SDK Reference","pages":[{"title":"SDK Reference","href":"/sdk-reference/core/src"}]},{"tab":"API Reference","groups":[{"group":"Overview","pages":[{"title":"API Reference","href":"/api-reference"}]},{"group":"Relay","pages":[{"title":"Relay a signed payment","description":"Submit a signed Soroban `SorobanAuthorizationEntry` (base64 XDR) to the facilitator. The facilitator wraps it in a fee-bump transaction, submits it to Stellar, and returns a `Receipt`.\n\nIn gas-in-token mode, set `feeToken` and ensure `authorizationEntryXdr` encodes the `FeeForwarder.forward()` invocation (a single host-function op that includes the actual transfer as a sub-invocation). No separate fee auth entry is needed.\n\n**The API key is injected server-side by the BFF; the browser never sends this header directly.**","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /relay","href":"/api-reference/relay/relay-a-signed-payment"}]},{"group":"Fee","pages":[{"title":"Quote a gas-in-token fee","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /fee/quote","href":"/api-reference/fee/quote-a-gas-in-token-fee"}]},{"group":"Account State","pages":[{"title":"Get classic account state","description":"Returns on-chain state for a classic Stellar G-address: whether it exists, whether it has a USDC trustline, and its XLM and USDC balances. Used by the SDK to gate the onboarding flow and to display account state in UI.","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /stellar/account/{publicKey}","href":"/api-reference/account-state/get-classic-account-state"},{"title":"Get contract account state","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /stellar/contract/{address}","href":"/api-reference/account-state/get-contract-account-state"}]},{"group":"Onboarding","pages":[{"title":"Build onboarding transaction","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /stellar/onboard/build","href":"/api-reference/onboarding/build-onboarding-transaction"},{"title":"Submit signed onboarding transaction","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /stellar/onboard/submit","href":"/api-reference/onboarding/submit-signed-onboarding-transaction"},{"title":"Deploy a passkey smart-account","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /stellar/contract/deploy","href":"/api-reference/onboarding/deploy-a-passkey-smart-account"},{"title":"Deploy a policy session-account","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /stellar/session-account/deploy","href":"/api-reference/onboarding/deploy-a-policy-session-account"}]},{"group":"Auth","pages":[{"title":"Social identity -> Stellar key","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /auth/social","href":"/api-reference/auth/social-identity->-stellar-key"},{"title":"Email OTP -> Stellar key","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /auth/email","href":"/api-reference/auth/email-otp->-stellar-key"}]},{"group":"Swap","pages":[{"title":"Get an EVM swap quote","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /swap/quote","href":"/api-reference/swap/get-an-evm-swap-quote"}]}]}]},"basePath":"","title":"Quote a gas-in-token fee - Buckspay SDK","buildId":"dpl_596ePT575z4qnAFksq1biRW97aLY","deploymentId":"dpl_596ePT575z4qnAFksq1biRW97aLY","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-C9Wu0MeN.js","utils-jWgu-6Qf.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DBD8f9qn.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-BGuX1ui5.js","snippetPresets-Evy63nQB.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BQHO1lnV.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-B6C8m-t_.js","shallow-BG4cT0fH.js","getApiPlaygroundDisplay-CgEPrE-D.js","CodeSnippet-CU8JyZ9N.js","CodeSnippets-BnxHU32T.js","Page-D6S0Yh6q.js","getPastedJson-CwiYOonh.js","icon-DYDpWmDf.js","MethodPill-C-J-l7_c.js","DuplicateIcon-B6ARwg9w.js","createIcon-Dsv4MtDq.js","DynamicMarkdown-CtasenyM.js","SectionHeading-YNcgYwjB.js","axios-vUo_bRtp.js","Markdown-CwLx6PAg.js","clsx-C3kuh_dz.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CmKHfscc.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-U3mI6Ljh.js"]}