Verona 백서

Verona

원문

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

"**Checkout**" tab and make sure the "**NFT Price**" and "**Recipient address**" are filled in and then click "**Save changes**". Also make sure "**Enable Credit Card payments"** is enabled under "**Payment methods**". <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FwZ3h4TGjYIEvwm8jRoeV%2Fimage.png?alt=media&amp;token=93050678-bd30-43ed-9285-6f4e0dbfa792" alt=""><figcaption></figcaption></figure> ## Deploy a Treasury Contract <a href="#deploying-a-treasury-contract-for-gasless-transactions" id="deploying-a-treasury-contract-for-gasless-transactions"></a> Before integrating the **Abstraxion SDK** into the application, we first need to deploy a **Treasury Contract**. This contract facilitates **gasless transactions** for your smart contract by handling **fee grants** on behalf of users as well as allowing users to grant authorization(s) to your app to execute certain transactions on their behalf. ### Steps to Deploy a Treasury Contract <a href="#steps-to-deploy-a-treasury-contract" id="steps-to-deploy-a-treasury-contract"></a> 1. Login to the [Developer Portal](https://dev.testnet.burnt.com/). 2. Click the **"New Treasury"** button to create a new treasury contract instance. 3. **Select the appropriate configurations**. The default "**Fee Grant (Allowance)**" and "**Grant Config (Permission)**" should be enough for this application. You will then copy the treasury contract address which will be required in the frontend setup below. ## Building the Frontend <a href="#building-the-frontend" id="building-the-frontend"></a> We've created a frontend which is a [Next.js](https://nextjs.org/) application built to interact with the NFT smart contract created by the Crossmint platform. The frontend app can be downloaded at <https://github.com/burnt-labs/xion-crossmint-hosted-checkout-frontend>. It showcases how users can connect their wallets and purchase NFTs via Crossmint's hosted checkout solution. ### Manual Installation <a href="#manual-installation" id="manual-installation"></a> You will first need to clone the repository: ```bash git clone https://github.com/burnt-labs/xion-crossmint-hosted-checkout-frontend ``` After doing so you will have to change into the newly created directory and then execute the steps below. 1. Install dependencies: ```bash cd xion-crossmint-hosted-checkout-frontend npm install ``` 2. Copy the **`.env.example`** file and name it **`.env.local`** and set the values with the correct information: ```javascript NEXT_PUBLIC_TREASURY_ADDRESS=your_treasury_contract_address NEXT_PUBLIC_RPC_URL="https://rpc.xion-testnet-2.burnt.com:443" NEXT_PUBLIC_REST_URL="https://api.xion-testnet-2.burnt.com" NEXT_PUBLIC_CROSSMINT_API_KEY=your_crossmint_api_key ``` | Variable | Description | | --------------------------------- | --------------------------------------------------------------------------- | | NEXT\_PUBLIC\_TREASURY\_ADDRESS | Treasury address used for gasless transactions and grantz authorization | | NEXT\_PUBLIC\_RPC\_URL | RPC endpoint for Xion (default: `https://rpc.xion-testnet-2.burnt.com:443`) | | NEXT\_PUBLIC\_REST\_URL | REST endpoint for Xion (default: `https://api.xion-testnet-2.burnt.com`) | | NEXT\_PUBLIC\_CROSSMINT\_API\_KEY | Crossmint API key (<https://www.crossmint.com/console>) | 3. Update collection list: This list contains the NFT contract addresses and their corresponding collection IDs that users will be able to purchase.\ Open the `src/app/collections.json` file and add your collections using the following format: ```json { "collections": [ { "id": "your-collection-id", "contractAddress": "your-nft-contract-address" } ] } ``` You can find the collection ID on the listing page for each collection. To copy it, simply click the copy icon next to the desired collection ID. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FRlAskt0IRS1BXtSzUw0s%2Fimage.png?alt=media&amp;token=92b91882-cdc8-4f1a-8d95-53668ea226ad" alt=""><figcaption></figcaption></figure> To find the NFT contract click on the collection and then click the "**Smart contract**" tab and copy the smart "**Contract address**". <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2Fs21n5KUj6uTRfbS7NOn6%2Fimage.png?alt=media&amp;token=14c5d5f0-d676-4a53-bb0a-b3428b6557eb" alt=""><figcaption></figcaption></figure> 4. Build and start the application: ``` npm run dev ``` You can now access the app at [http://localhost:3000](http://localhost:3000/) in your browser. When testing the Checkout and credit card payments on staging you’ll need to use test card numbers. You can find the list of test credit card numbers here <https://docs.crossmint.com/payments/advanced/testing-tips#test-credit-card-numbers>. ## Additional Resources * **Crossmint API Reference**\ Full documentation for all Crossmint API endpoints and capabilities.\ <https://docs.crossmint.com/api-reference/introduction> * **Quickstart: Add a Pay Button**\ A simple guide to help you quickly add Crossmint's checkout button to your frontend.\ <https://docs.crossmint.com/payments/pay-button/quickstart> * **Importing a Custom NFT Contract on XION**\ Requirements and steps for registering your own CW721-based contract with Crossmint.\ <https://docs.crossmint.com/minting/advanced/xion-contracts> * **Enable Multi-NFT Checkout in a Single Order**\ Learn how to allow users to purchase multiple NFTs at once via a single Crossmint transaction.\ <https://docs.crossmint.com/payments/advanced/selling-multiple-nfts> # Integrate Credit Card Payments for Digital Assets in your Mobile App using Crossmint This guide demonstrates how to enable credit card purchases for Digital Assets on the Verona network using Crossmint's payment infrastructure. We'll use a React Native mobile app as our primary example, showing real-world implementation patterns and solutions to common challenges. ## Architecture Overview Here’s a high-level breakdown of how the flow works from the user’s perspective: ``` User → Mobile App → Crossmint Checkout → XION Account ``` Let’s dig deeper into the components: * **Mobile App (React Native)**: This is your Digital Asset storefront, where users browse collections and initiate purchases. * **Crossmint Checkout**: A drop-in payment solution that supports fiat (credit/debit) and crypto. It handles compliance, processing, and minting. * **Verona network**: The final destination where the Digital Asset is minted and stored in the user’s wallet. Here’s what happens under the hood: 1. User selects a Digital Asset and clicks "Buy" 2. Crossmint’s embedded checkout opens inside the app 3. User enters their credit card info and confirms payment 4. Crossmint processes the transaction and mints the Digital Asset 5. Digital Asset is delivered to the user’s XION wallet This architecture lets you offer a familiar ecommerce-like UX. ## Prerequisites Before diving in, let’s make sure you have the essentials ready. ### Accounts You’ll Need * **Crossmint**: [Sign up](https://staging.crossmint.com) on the staging environment first. You’ll get access to the Crossmint Console, where you’ll create collections, manage keys, and configure payments. * **GitHub**: We'll reference public repos and you’ll likely want version control. ### Development Environment Make sure you have the following installed: * Node.js v24+ and npm * iOS or Android emulator (or a physical device) * VS Code (recommended) ## Crossmint Setup Let’s begin with the Crossmint side of the integration. This is where we define your Digital Asset collection, configure payment options, and generate the credentials your app will use. ### 1. Create a Crossmint Account Start by registering on [staging.crossmint.com](https://staging.crossmint.com). This is their testing environment. After signing up, verify your email and complete the developer onboarding flow. ### 2. Create a Project Inside the Crossmint Console: * Click **Create Project** * Enter a **Project name** * Click the **Create project** button This will give you a unique Project ID you’ll use in your app. ### 3. Generate an API Key This step is **crucial**, especially for mobile apps. * Navigate to **Integrate ->** **API Keys** * Under **Client-side keys** click **Create new key** button * For **App type** select **Mobile** * For Origin enter your **iOS bundle ID** or **Android package name** * Under scopes, select only: `orders.create` * Click the **Create client key** button ### 4. Create Collection The Crossmint team has enabled the creation of NFT collections directly within the Console. These collections are based on the [**CW-721 Metadata Onchain**](https://github.com/public-awesome/cw-nfts/tree/main/contracts/cw721-metadata-onchain) contract. You can also import a custom NFT contract, as long as it is built on the [**CW-721 Metadata Onchain**](https://github.com/public-awesome/cw-nfts/tree/main/contracts/cw721-metadata-onchain) standard. To create your collection, follow these steps: 1. Click the "**Token collections**" link in the menu sidebar and then click the "**New collection**" button <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2Ff5NJms3jLuHIYKnvBUym%2Fimage.png?alt=media&amp;token=5ba8dae3-972c-4e38-a8e9-8d6a8fb7da2f" alt=""><figcaption></figcaption></figure> 2. Enter the collection information and click "**Next**" 3. On the "**Create or import your collection contract**" step select "**Create a new contract**" and then click "**Next**". If you have your own custom NFT contract select "**Import an existing contract**" 4. On the "What do you want to do with this collection?" section select "**Sell NFTs**" and click "**Next**" 5. On "**Choose a chain**" select "**Xion**" and click "**Next**" 6. On "**Payment settings**" enter a price for the collection, select who pays the fees and enter an address that will receive the revenue from sales 7. Review details and click the "**Create collection**" button to complete the process ### 5. Create an NFT On the "**Token collections**" page select the collection created above. The NFTs tab is selected by default, click "**manual upload**" and in the window that pops up enter the NFT information. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2F0PmAdm1vIsyhn7SifRbg%2Fimage.png?alt=media&amp;token=ce68d41d-71d8-4d7d-a236-30cd9ca49f31" alt=""><figcaption></figcaption></figure> Click the "**Create NFT**" button when done. ### 6. Update Checkout Settings Click the "**Checkout**" tab and make sure the "**NFT Price**" and "**Recipient address**" are filled in and then click "**Save changes**". Also make sure "**Enable Credit Card payments"** is enabled under "**Payment methods**". <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FwZ3h4TGjYIEvwm8jRoeV%2Fimage.png?alt=media&amp;token=93050678-bd30-43ed-9285-6f4e0dbfa792" alt=""><figcaption></figcaption></figure> ## Deploy a Treasury Contract <a href="#deploying-a-treasury-contract-for-gasless-transactions" id="deploying-a-treasury-contract-for-gasless-transactions"></a> To successfully integrate the **Abstraxion SDK** into the app, we first need to deploy a **Treasury Contract**. In this particular use case the Treasury contract is required for users to log into the app. ### Steps to Deploy a Treasury Contract <a href="#steps-to-deploy-a-treasury-contract" id="steps-to-deploy-a-treasury-contract"></a> 1. Login to the [Developer Portal](https://dev.testnet.burnt.com/). 2. Click the **"New Treasury"** button to create a new treasury contract instance. 3. **Select the appropriate configurations**. The default "**Fee Grant (Allowance)**" and "**Grant Config (Permission)**" should be enough for this application. You will then copy the treasury contract address which will be required in the app setup below. ## Building the Mobile App <a href="#building-the-frontend" id="building-the-frontend"></a> We've created a mobile app to allow users to purchase from Digital Asset collections created within the Crossmint platform . The app can be downloaded at <https://github.com/burnt-labs/xion-crossmint-mobile-app>. ### Manual Installation <a href="#manual-installation" id="manual-installation"></a> You will first need to clone the repository: ```bash git clone https://github.com/burnt-labs/xion-crossmint-mobile-app.git ``` After doing so you will have to change into the newly created directory and then execute the steps below. 1. Install dependencies: ```bash cd xion-crossmint-mobile-app npm install ``` 2. Copy the **`.env.example`** file and name it **`.env.local`** and set the values with the correct information: ```javascript # Configuration EXPO_PUBLIC_TREASURY_CONTRACT_ADDRESS="your-treasury-contract-address" EXPO_PUBLIC_RPC_ENDPOINT="https://rpc.xion-testnet-2.burnt.com:443" EXPO_PUBLIC_REST_ENDPOINT="https://api.xion-testnet-2.burnt.com" # Crossmint Configuration EXPO_PUBLIC_CROSSMINT_API_KEY="your-crossmint-api-key" ``` | Variable | Description | | ----------------------------------------- | --------------------------------------------------------------------------- | | EXPO\_PUBLIC\_TREASURY\_CONTRACT\_ADDRESS | Treasury address used for gasless transactions and grantz authorization | | EXPO\_PUBLIC\_RPC\_ENDPOINT | RPC endpoint for Xion (default: `https://rpc.xion-testnet-2.burnt.com:443`) | | EXPO\_PUBLIC\_REST\_ENDPOINT | REST endpoint for Xion (default: `https://api.xion-testnet-2.burnt.com`) | | EXPO\_PUBLIC\_CROSSMINT\_API\_KEY | Crossmint API key (<https://www.crossmint.com/console>) | 3. Update collection list: This list contains the NFT contract addresses and their corresponding collection IDs that users will be able to purchase.\ Open the `data/collections.json` file and add your collections using the following format: ```json { "collections": [ { "id": "your-collection-id", "contractAddress": "your-nft-contract-address" } ] } ``` You can find the collection ID on the listing page for each collection. To copy it, simply click the copy icon next to the desired collection ID. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FRlAskt0IRS1BXtSzUw0s%2Fimage.png?alt=media&amp;token=92b91882-cdc8-4f1a-8d95-53668ea226ad" alt=""><figcaption></figcaption></figure> To find the NFT contract click on the collection and then click the "**Smart contract**" tab and copy the smart "**Contract address**". <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2Fs21n5KUj6uTRfbS7NOn6%2Fimage.png?alt=media&amp;token=14c5d5f0-d676-4a53-bb0a-b3428b6557eb" alt=""><figcaption></figcaption></figure> 4. Build and start the application. Make sure your Android emulator or iOS simulator is running: {% tabs %} {% tab title="For Android" %} ``` npx expo run:android ``` {% endtab %} {% tab title="For iOS" %} ``` npx expo run:ios ``` {% endtab %} {% endtabs %} When testing the Checkout and credit card payments on staging you’ll need to use test card numbers. You can find the list of test credit card numbers here <https://docs.crossmint.com/payments/advanced/testing-tips#test-credit-card-numbers>. You should see the following when not logged in: <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FWblyFSGmbxXzS6AkETDF%2FScreenshot_1753848239.png?alt=media&amp;token=e56ab0c4-3cc5-489e-96fc-11ac4d5e899c" alt="" width="375"><figcaption></figcaption></figure> After logging in you should see the following: <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2F4pWVVSLKFHLeeXsDXjBi%2FScreenshot_1753848264.png?alt=media&amp;token=9fa1c72b-c92c-4008-a54d-75e2224a80e7" alt="" width="375"><figcaption></figcaption></figure> When you click the **Buy Now** button on any collection you will see the following: <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FFwk2LtkvVwVpwSA0GdmY%2FScreenshot_1753848278.png?alt=media&amp;token=79a2fb31-8c3b-4f67-9237-ee3fe65c67ab" alt="" width="375"><figcaption></figcaption></figure> # ACH & Bank Transfers ACH and bank transfer integrations let Verona apps move users between traditional bank accounts and on-chain stablecoins. These flows are useful for fintech apps, wallets, marketplaces, payroll tools, savings products, and consumer apps that need a familiar bank-based funding or cash-out experience. With Verona, developers can combine bank transfer providers with Meta Accounts and Abstraxion to create a smoother onboarding flow for users who may not already hold crypto. Users can connect with familiar authentication methods, link a bank account, fund their wallet, and cash out stablecoins without needing to understand the underlying blockchain mechanics. ### What You Can Build ACH and bank transfer integrations can support flows such as: * Bank account to stablecoin on-ramp * Stablecoin to bank account off-ramp * Wallet funding for consumer apps * Payouts to linked bank accounts * Stablecoin-backed balances for marketplace or fintech products * Treasury or session-key based transaction flows for smoother repeat usage ### Production Considerations When building ACH or bank transfer flows, make sure to: * Keep provider API credentials server-side. * Verify webhook signatures before updating local state. * Show clear pending, completed, and failed transfer states. * Use testnet credentials and test transfer types before moving to production. * Understand the provider's compliance, KYC, KYB, settlement, and geographic requirements. * Decide whether wallet transactions should use direct signing, Abstraxion session keys, or a hybrid flow. # Build a Brale ACH On/Off-Ramp App The **Brale** ACH Ramp Demo shows how to add bank-based on-ramp and off-ramp flows to a Verona application. Users connect with their Verona Meta Account, link a bank account through **Brale** and **Plaid**, buy stablecoins with ACH, and cash out stablecoins back to a bank account. This guide walks through running the demo locally and explains the pieces you can copy into another Verona app. The demo app source is available at: <https://github.com/burnt-labs/brale-ach-demo> ### How the Demo Works The app has three main parts: * A frontend built with Next.js and Abstraxion for wallet connection and transaction signing. * A small backend API that stores users, KYC details, linked bank addresses, transfer records, and webhook events in SQLite. * Brale API calls for bank linking, ACH debit, ACH credit, transfer creation, and transfer status reconciliation. The on-ramp and off-ramp flows are intentionally separate: * On-ramp: bank USD to wallet SBC. The user does not need to sign an on-chain transaction. * Off-ramp: wallet SBC to bank USD. The user sends SBC to Brale's custodial Verona address before Brale initiates the ACH credit. ### Prerequisites Before you begin, make sure you have: * Node.js 26 or newer * pnpm * Git * A Verona testnet wallet with `uxion` for gas * Brale API credentials * A Brale account ID * ngrok or another public tunnel for local webhook testing You will also need access to Brale's Verona testnet transfer type, which is configured in this demo as `xion_testnet`. ### Clone the Demo App Start by cloning the repository: ``
프로젝트로 돌아가기