Verona 백서

Verona

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 54쪽 중 9쪽

age structures that can be processed. Once configured, these settings define how your Treasury Contract interacts with users and enforces controlled transaction execution. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2Ff8MSf5fIrNDhdfbJ8vxb%2Fimage.png?alt=media&amp;token=2f454584-ae34-41b2-94b6-bf04dfaf8fe0" alt=""><figcaption></figcaption></figure> Once you've entered all the required information, click the **"Add contract grant"** button. **Important Notes:** * You can add **multiple Permissions**, allowing you to define different permissions for various interactions. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FR8hVmjVDdnrho1WWyRC5%2Fimage.png?alt=media&amp;token=ed553222-9339-49b6-9d51-df1e0438fab7" alt=""><figcaption></figcaption></figure> ### Treasury Params There are a few parameters that you can configure within your treasury contract instacne. Currently the parameters are limited to a **redirect URL** which is the URL users will be redirected to after successful login and **Icon URL** which will display this icon on the Abstraxion login screen. These two parameters are required and so you need to fill in the values: <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2F2LIAPw3a3QF3upEhPPwE%2Fimage.png?alt=media&amp;token=a6720fcf-7286-4e9b-8f43-1d24e25b8ecf" alt=""><figcaption></figcaption></figure> Once those parameters have been added you can scroll down to the bottom of the page and click the "**Create**" button to create your treasury contract instance. Once created, the contract will appear on the **Dashboard**. {% hint style="success" %} **Fund the Treasury Contract**: Transfer **$VERONA tokens** to the contract to ensure it can cover gas fees for fee grants. {% endhint %} ## Editing a Treasury Contract Once a Treasury contract is created, it will appear in the **Dashboard**. To edit it, simply click on the contract from the list, which will open a management screen. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FYUTOgjkMS7UdFsSr8QtI%2Fimage.png?alt=media&amp;token=4b7baa7c-722c-435f-b6b9-332bf8fab1eb" alt=""><figcaption></figcaption></figure> ### Withdraw Funds To withdraw any funds sent to the Treasury contract: 1. Click the **"Withdraw Funds"** button. 2. A withdrawal screen will appear. 3. Enter the amount to withdraw which transfers funds from the Treasury contract back to the admin account. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FRAPE310UvIKRcCsmy8jg%2Fimage.png?alt=media&amp;token=083d7cb9-e48d-43cb-8fdd-799812101d04" alt=""><figcaption></figcaption></figure> ### Update Params <a href="#radix-r14" id="radix-r14"></a> To modify the parameters: 1. Click the **"Update Params"** button. 2. A configuration screen will load, allowing you to adjust relevant params. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FpkqObbHWunoRXvo12Zd9%2Fimage.png?alt=media&amp;token=7977fd5a-dbc3-4a52-b4de-9766d433144b" alt=""><figcaption></figcaption></figure> ### Edit Allowance To edit the allowance: 1. Click the **"Edit"** button under the **Allowance** section. 2. This will open a screen where you can adjust the allowance parameters. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FSCxIO5KIJorJxlKK2x5r%2Fimage.png?alt=media&amp;token=34b2c096-1b22-4ff6-a41c-b4f296273af6" alt=""><figcaption></figcaption></figure> ### Update and Add Permissions To add a new permission click the "**Add New**" button. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2F2trlinmnrnMkG7C54qrC%2Fimage.png?alt=media&amp;token=79d27984-703b-4d3f-b4a8-f9644734d83a" alt=""><figcaption></figcaption></figure> A screen will open where you can add the new permission: <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FweedX8HU3bsTHSZf3vAi%2Fimage.png?alt=media&amp;token=16f9c370-1da8-46ad-946a-8bfa76b89ce1" alt=""><figcaption></figcaption></figure> To edit a permission click the "**Edit**" button in the permission listing. A screen will open where you can edit the configuration: <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FBsLM02NLr1CMsHOmPqbB%2Fimage.png?alt=media&amp;token=c69d45ea-c8ef-4cf9-b6c2-985ff6e25b5c" alt=""><figcaption></figcaption></figure> If creating a new grant: * Select a new **Type URL**. * Enter the required field data. * Click **"Save"** to create a new Grant Config. ### Delete a Grant Configs If you need to remove a grant configuration from your treasury contract, you can easily do so through the grant config listing interface. The process involves selecting the grant you wish to delete, confirming the action. To delete an existing grant configurations click the **trash bin** icon on the right of the listed permission. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FeURKgbJ2MVqPkwWrQQ2y%2Fimage.png?alt=media&amp;token=c928eeb0-44e3-4dd7-9212-f8603d5c7cde" alt=""><figcaption></figcaption></figure> **Confirm Deletion** After clicking the trash bin icon, a popup window will appear with the title **"Remove grant config"**. The body of the popup will display the following message: *"**Are you sure you want to remove the \<type url of config> grant config?**"* <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FY1Svb9kCxpcdAfLYuZow%2Fimage.png?alt=media&amp;token=a246f970-d156-4385-a928-409cf864b3ee" alt=""><figcaption></figcaption></figure> * **Cancel**: If you change your mind and do not want to delete the grant config, simply click the **Cancel** button to close the popup without making any changes. * **Confirm**: If you're sure you want to delete the grant config, click the **Confirm** button. After successful deletion, the page will reload and display a success message confirming that the grant configuration has been removed. ## Client-Side Implementation (React App) To integrate gasless transactions and delegated authorizations using a Treasury contract in your app, follow this [**full guide**](/en/build-on-verona/accounts/web-app/build-react-dapp-with-account-abstraxion). You’ll need to configure the `AbstraxionProvider` by setting the Treasury contract in the config: ```typescript const treasuryConfig = { treasury: `CONTRACT_ADDRESS`, // optional (only for mainnet) // rpcUrl: ``, // restUrl: `` } export default function RootLayout({ children, }: { children: React.ReactNode }) { return ( <html lang="en"> <body className={inter.className}> <AbstraxionProvider config={treasuryConfig}> {children} </AbstraxionProvider> </body> </html> ) } ``` This configuration also determines the redirect URL users see after clicking **Connect** and before clicking **Allow** (as shown in the screenshot below). <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2F6knK3ethy9fvyCsPqdPP%2Fimage.png?alt=media&amp;token=9e94a2ec-e69b-4c50-b65b-afc6dfa9824e" alt=""><figcaption></figcaption></figure> While connecting their accounts, users will see a list of **Allowances** — this message is set during the Treasury contract’s creation by the developer while configuring the grant settings. Once the user clicks **Allow**, the app: 1. **Creates Grant permissions** 2. **Deploys a Fee Grant** on behalf of the user. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FpUHbO9JccPjhl5x5mgr2%2Fimage.png?alt=media&amp;token=0b579201-dc03-4d3a-8feb-11006fe2cab4" alt=""><figcaption></figcaption></figure> Whenever your app executes a transaction using `.execute`, make sure the **granter** in the fee configuration (4th parameter) is set to the Treasury contract’s address: {% hint style="warning" %} If you modify the app to use Treasury contracts, ensure that all users **log out and reconnect** to apply the new settings. {% endhint %} ```typescript return client.execute( sender, contract, msg, { amount: [{ amount: "1", denom: "uxion" }], gas: "500000", granter: TREASURY.treasury }, "", [] ); ``` {% hint style="success" %} If you have any questions or encounter issues, feel free to ask in our [**Telegram Developer Group**](https://t.me/+SC47NRhVz9Q2MDg0) or on [**Discord**](https://discord.com/invite/burnt) in our [**Dev Chat channel**](https://discord.com/channels/823953904512401469/1308977704586186762). {% endhint %} # Web App Development Web app integration with Abstraxion — guides, authentication modes, and xion.js demo references Verona **Meta Accounts** and **gasless** flows are integrated into React web apps through **`@burnt-labs/abstraxion-react`** (provider, hooks, and `AbstraxionEmbed`). The package builds on **`@burnt-labs/abstraxion-js`**; use that runtime directly for non-React stacks. ## Live demos {% hint style="success" %} Run each auth mode in the browser—no clone required. Source for every route lives in [`demos/react`](https://github.com/burnt-labs/xion.js/tree/main/demos/react) (Vite + React). {% endhint %} Each demo wires `AbstraxionProvider` with a different `authentication.type`. Open a route, then inspect its source for the exact config. | Mode | Live demo | What it shows | | ---------------------- | -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | **Auto** (recommended) | [sdk-react.demos.burnt.com/auto](https://sdk-react.demos.burnt.com/auto) | Resolves to popup on desktop and redirect on mobile/PWA; state-machine debug panel, session-key and direct signing, manage-authenticators. | | **Embedded** | [sdk-react.demos.burnt.com/embedded](https://sdk-react.demos.burnt.com/embedded) | Dashboard inside an iframe—toggle inline (always visible) vs dynamic (button + modal). | | **Signer** | [sdk-react.demos.burnt.com/signer-mode](https://sdk-react.demos.burnt.com/signer-mode) | BYO keypair via Turnkey or MetaMask; smart account on top with session-key and direct signing, no dashboard redirects. | | **SaaS** | [sdk-react.demos.burnt.com/saas](https://sdk-react.demos.burnt.com/saas) | End-to-end product flow: app login, then a Connect-with-XION-Pay style button that provisions the smart account; both sessions persist with expiry. | ## Guides in this section Pick a document by what you are building. For **how to choose** `authentication.type` (`auto`, `signer`, `embedded`, …), see [Authentication and integration details](#authentication-and-integration-details) below. For **why** teams combine auth modes with signing hooks (before you copy env tables), see [Abstraxion modes and opportunities](/en/build-on-verona/accounts/web-app/abstraxion-modes-opportunities). <table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Account abstraction with gasless transactions</strong></td><td>End-to-end <strong>React (Vite)</strong> app: Treasury, Counter contract, <strong>auto</strong> auth, native <code>&#x3C;button></code>, hooks, and transactions.</td><td><a href="/en/build-on-verona/accounts/web-app/build-react-dapp-with-account-abstraxion">Account Abstraction with Gasless Transactions</a></td></tr><tr><td><strong>Abstraxion modes and opportunities</strong></td><td>Explanation: start with <strong><code>auto</code> / dashboard</strong> auth; then <strong>signer + session</strong> vs <strong>signer + <code>requireAuth</code></strong>; multi-wallet UI as wiring only; passkey/backup as narrative last. Verify in the <a href="#live-demos">live demos</a> or <code>demos/react</code>.</td><td><a href="/en/build-on-verona/accounts/web-app/abstraxion-modes-opportunities">Abstraxion modes and opportunities</a></td></tr><tr><td><strong>Abstraxion signer mode</strong></td><td><strong>type: "signer"</strong>: implement <code>getSignerConfig</code>; session vs <code>requireAuth</code> signing; vendor wiring examples (e.g. Turnkey) and env from <code>demos/react/.env.example</code>.</td><td><a href="/en/build-on-verona/accounts/web-app/abstraxion-signer-mode">Abstraxion signer mode</a></td></tr><tr><td><strong>Custom UI and Abstraxion loading states</strong></td><td>Hook-first UX: <code>login</code>, granular flags, session lifecycle (works across <code>auto</code> / <code>popup</code> / <code>redirect</code>).</td><td><a href="/en/build-on-verona/accounts/web-app/custom-ui-abstraxion-authentication">Custom UI and Abstraxion loading states</a></td></tr></tbody></table> **Reference implementation:** [xion.js `demos/react`](https://github.com/burnt-labs/xion.js/tree/main/demos/react) (Vite + React; one route per live demo above). The **main tutorial** uses **`import.meta.env.VITE_*`**. Legacy Next.js routes in [`apps/demo-app`](https://github.com/burnt-labs/xion.js/tree/main/apps/demo-app) remain for migration reference only. *** ## Authentication and integration details Use this section when you need **mode names**, **defaults**, **env vars**, or **signing** behavior. The guides above walk through concrete projects; this part is the compact map. ### Recommended default: `auto` For most new apps, set: ```typescript authentication: { type: "auto", authAppUrl: process.env.NEXT_PUBLIC_AUTH_APP_URL, }, ``` **Behavior:** During configuration normalization, `auto` becomes either **`popup`** (desktop-style auth window) or **`redirect`** (full-page navigation on mobile / PWA). The SDK then runs the same code paths as those explicit modes. End users get an experience similar to common OAuth flows: the dApp stays mounted when a popup is used. **Backward compatibility:** If you omit `authentication` entirely, the SDK defaults to **`redirect`** for the dashboard flow. That remains supported, but **new integrations should set `auto` explicitly** so intent is clear and desktop users get popups where appropriate. ### Glossary (`AuthenticationConfig.type`) These labels match the TypeScript union on `AbstraxionProvider` config (`@burnt-labs/abstraxion-react`). | `type` | What it does | | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`auto`** | Resolved at runtime to **`popup`** or **`redirect`** (desktop vs mobile / standalone). **Recommended default** for dashboard auth. | | **`popup`** | Auth UI opens in a separate window; parent dApp stays loaded. | | **`redirect`** | Full-page navigation to the auth app and return (e.g. `?granted=true`). Used implicitly when `authentication` is omitted, or as the mobile leg of `auto`. | | **`signer`** | No dashboard redirect: you supply a **`getSignerConfig`** (MetaMask, Turnkey, etc.) and AA API / contract metadata. See [Abstraxion signer mode](/en/build-on-verona/accounts/web-app/abstraxion-signer-mode). | | **`embedded`** | Dashboard UI runs inside an **iframe** you host (`iframeUrl`). Use **`AbstraxionEmbed`** and `authentication.type: "embedded"`. See the [embedded live demo](https://sdk-react.demos.burnt.com/embedded) and embedded routes in [`demos/react`](https://github.com/burnt-labs/xion.js/tree/main/demos/react). | ### When to use which mode | Scenario | Prefer | Live demo / source | Key env / config | | ---------------------------------------------------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Standard Meta Account login (most dApps) | **`auto`** | [Live `/auto`](https://sdk-react.demos.burnt.com/auto) · [`demos/react`](https://github.com/burnt-labs/xion.js/tree/main/demos/react) | `VITE_AUTH_APP_URL` (Vite) or `NEXT_PUBLIC_AUTH_APP_URL` (Next.js) | | You build all connection UI with hooks | **`auto`** (or `popup` / `redirect` if you pin one) | [Live `/auto`](https://sdk-react.demos.burnt.com/auto) · [`demos/react`](https://github.com/burnt-labs/xion.js/tree/main/demos/react) | Same as above + treasury / chain | | Legacy reference: pre-built modal + Burnt UI (not recommended for new apps) | **`auto`** or `redirect` | [`demos/react` source only](https://github.com/burnt-labs/xion.js/tree/main/demos/react) (no live deploy) | `@burnt-labs/ui` is deprecated; prefer **`login()`** + your own UI ([tutorial](/en/build-on-verona/accounts/web-app/build-react-dapp-with-account-abstraxion), [live `/auto`](https://sdk-react.demos.burnt.com/auto)) | | Wallet-led or programmatic signer (no dashboard) | **`signer`** | [Live `/signer-mode`](https://sdk-react.demos.burnt.com/signer-mode) · [`demos/react`](https://github.com/burnt-labs/xion.js/tree/main/demos/react) | Implement **`getSignerConfig`**; copy env from [`demos/react/.env.example`](https://github.com/burnt-labs/xion.js/tree/main/demos/react) (AA API, code id/checksum, optional indexer) | | Session-key vs user-pays-gas signing (`useAbstraxionSigningClient` vs `{ requireAuth: true }`) | See demo (auth is **`signer`** in that route) | [`demos/react` source only](https://github.com/burnt-labs/xion.js/tree/main/demos/react) (no live deploy) | Same env family as signer mode; compare hooks and fee simulation in source | | Inline or “button + modal” embedded dashboard | **`embedded`** | [Live `/embedded`](https://sdk-react.demos.burnt.com/embedded) · [`demos/react`](https://github.com/burnt-labs/xion.js/tree/main/demos/react) | `VITE_IFRAME_URL` or `NEXT_PUBLIC_IFRAME_URL` | | SaaS / treasury-style product onboarding | **`auto`** + product shell | [Live `/saas`](https://sdk-react.demos.burnt.com/saas) · [`demos/react`](https://github.com/burnt-labs/xion.js/tree/main/demos/react) | App login + Connect-style provisioning flow; see live demo for session persistence | ### Signing model (brief) * **Default gasless path:** `useAbstraxionSigningClient()` — session-style signing (Treasury / grantee flow) as in the main tutorials. * **Direct / user-pays-gas:** `useAbstraxionSigningClient({ requireAuth: true })` — see the **direct-signing** demo for fee simulation vs `"auto"`. For **combinations and product posture** (not just hook names), see [Abstraxion modes and opportunities](/en/build-on-verona/accounts/web-app/abstraxion-modes-opportunities). Details stay in the tutorial and the demo source so this hub stays stable for navigation. ### React vs Next.js New walkthroughs use **React + Vite** with **`VITE_*`** env vars and a provider at **`src/main.tsx`**. **Next.js** remains valid: mirror the same config in a
프로젝트로 돌아가기