Xai 백서

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

keys for access controls, and transact on behalf of your users. * Gasless transactions - Sponsor user transactions with gasless relayers and user operations. * Wallet and contract webhooks - Get notified of wallet and contract events to automate sending emails, printing shipping labels, or charging customers. * Advanced analytics (coming soon) - View transaction history trends, event logs for each transaction, a ledger of backend wallet funds, and more. #### **Why use Engine?** Engine is beneficial if your app: * Handles multiple company app wallets. * Requires controlled access by multiple team members. * Requires transactions to be delivered reliably during traffic bursts and network congestion. * Sends more than one transaction per block (example: 2 Ethereum transactions within 12 seconds). * Sponsors gas fees for your users. * Deploys smart accounts for each user. * Triggers other actions when wallet or contract events occur. # Build with Sequence Xai Builder (powered by Sequence) is an all-in-one Layer 3 developer console for building web3 games. Click here to learn more: <https://dev-xai.sequence.build/landing> <figure><img src="https://2248955668-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhE4weeNpCJSNUXnecN1R%2Fuploads%2F9EVgMVmjxiDIF0Zkhke0%2Fimage.png?alt=media&amp;token=675fd5f7-0f52-4c0b-97e1-f519ef083025" alt=""><figcaption></figcaption></figure> <details> <summary>Getting started</summary> 1. [Create Project & Obtain Project Access Keys](#user-content-fn-1)[^1] [Create a Project in the XAI Builder](#user-content-fn-2)[^2] Go to [builder.xai.games](https://builder.xai.games/) and click on the <mark style="color:red;">`Start Building`</mark> or <mark style="color:red;">`Sign in`</mark> button to get started. <img src="https://2248955668-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhE4weeNpCJSNUXnecN1R%2Fuploads%2F3fPyqFBG1lVt1jh7G0Sw%2FScreenshot%20from%202024-07-23%2014-42-18.png?alt=media&amp;token=1aee4b61-87fd-457b-838f-3b00429dd0cf" alt="" data-size="original"> 2. #### Choose a sign in method When you first sign in to Xai Builder, a wallet is created for you. You may, however, already have a Sequence wallet. If you are signed in with that wallet, you will see an option to use it. Without a wallet, you will be given a few options to sign in. You can use any of the social sign ins, or you can simply use your email to get started. <img src="https://2248955668-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhE4weeNpCJSNUXnecN1R%2Fuploads%2FWKumFHzxeBChVIfpFwPW%2FScreenshot%20from%202024-07-23%2014-46-27.png?alt=media&amp;token=e1e385ee-1599-498c-a0cb-ff05ecfb23d4" alt="" data-size="original"> 3. #### [Sign in to builder.xai.games](#user-content-fn-3)[^3] After choosing how you would like to sign in, you will be presented with the terms of use. To read the `Terms of Use`, `Privacy Policy`, and `Master Services Agreement`, click on the respective links for each. Once you have read each, click through to continue. You are now signed in to Xai Builder! 4. #### Create a Project [Everything you do in Xai Builder is centered around each project](#user-content-fn-4)[^4] - so let's start one. The easiest way to start a project is to simply click `+ Create Project`. <img src="https://2248955668-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhE4weeNpCJSNUXnecN1R%2Fuploads%2F2uspkTUPlatwuCnTtMWG%2FScreenshot%20from%202024-07-23%2014-42-57.png?alt=media&amp;token=8a198c69-5732-4bb2-9f65-562d6080440a" alt="" data-size="original"> 5. #### Enter the project details A modal will pop up, allowing you to enter details about your project. Provide a project name and, if you like, add an avatar for the project. [Then, select the network(s) on which you would like to start deploying. This can always be changed later.](#user-content-fn-5)[^5] 6. #### Create the project! Now hit the `Create new Project` button! Once you finish, you should now be viewing your project dashboard. </details> <details> <summary>Embedded Wallet</summary> Embedded Wallet Docs Here: <https://docs.sequence.xyz/solutions/wallets/embedded-wallet/overview#sequence-embedded-wallet> Offered via the Xai Builder, Sequence Embedded Wallet enables the creation, management and usage of fully functional EVM compatible wallets that can be easily integrated into your game or experience through our various SDKs such as [TypeScript](https://docs.sequence.xyz/solutions/wallets/embedded-wallet/quickstart), [Unity](https://docs.sequence.xyz/sdk/unity/overview) and [Unreal](https://docs.sequence.xyz/sdk/unreal/overview). These headless wallets can be created on-demand for each user and allow you to integrate an application with an Ethereum compatible blockchain, while using familiar constructions like RPC APIs. Additionally, no necessary pop-up modals, user-facing confirmations, and other distractions so you can provide a truly native and seamless gaming experience. Sequence Embedded Wallet offers non-custodial wallets and the system guarantees that each created wallet can only be accessed with the consent of the owner of the wallet. This is made possible by utilizing the power of [AWS Nitro Enclaves](https://aws.amazon.com/ec2/nitro/nitro-enclaves/) to handle sensitive data in a secure environment that nobody can access - not even Xai or Sequence. These are also shared across experiences, if desired, so your users have a consistent wallet address across your games and platforms, no matter what social login they are using. Check out our [docs](https://docs.sequence.xyz/solutions/wallets/embedded-wallet/quickstart) to get started integrating for your next game or app! </details> <details> <summary>Sequence Kit</summary> Sequence Kit is the ultimate toolkit for effortlessly[ integrating web3 wallets](#user-content-fn-6)[^6] into your applications, providing your users with a smooth and secure onboarding experience. With our robust tools built on the popular [wagmi](https://wagmi.sh/) library, unlock a realm of possibilities in the world of web3. ### Key Features * **Universal Connections**: Seamlessly connect via popular social logins such as Facebook, Google, Discord, and more! Your users will enjoy a smooth, secure onboarding process. * **Embedded Wallets**: Leverage our non-custodial embedded wallet within Sequence Kit to put web3 in the background such as optional popups / modals so users can focus on the experience. * **External Wallet Integration**: Effortlessly integrate with leading web3 wallets like [WalletConnect](https://walletconnect.com/) and [MetaMask](https://metamask.io/). Unleash the power of blockchain with just a few clicks! * **Web3 Inventory**: Provide your users with a web3-enabled inventory, enabling them to manage their coins and collectibles all within your own application. TODO: link to web3 inventory in docs * [**NFT Checkout**](https://docs.sequence.xyz/solutions/wallets/sequence-kit/checkout/): Enable users to purchase collectibles within Sequence Kit using a credit card or crypto. * **Customizability**: Brand Sequence Kit with your own logo, color scheme and configure it with your social providers and wallets you want to servic </details> <details> <summary>Analytics </summary> When you use Sequence via the SDKs to build your application, you can see key insights in Xai Builder. You don't need to do any additional work to see valuable metrics about your project, such as the number of connected wallets or daily transaction requests. You can also query your analytics programatically or connect to services like Dune via the [APIs](https://docs.sequence.xyz/api/analytics/overview). #### How it works When requests are made with Sequence SDKs/APIs, analytics events are fired and sent to our internal analytics system, Databeat. Databeat anonymizes the data and stores it in a secure database designed for high-volume, real-time applications. The metrics you see in Xai Builder are queried from the database, in real-time, for your project and presented in insightful visualizations. ### Overview In the Overview tab of Xai Builder, you will see the key, high-level metrics for your project. Metric cards will show the total value for that metric, and clicking on one will change the chart to show time-series data for that metric. You also have the option to look back at your data beyond the default **Last 30 days** by toggling the filter in the top right corner. #### Wallets connected *Wallets connected* represents the count of distinct wallet addresses connected via Sequence SDKs for the selected time period. <img src="https://2248955668-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhE4weeNpCJSNUXnecN1R%2Fuploads%2FmLA8hc3iwhWhU6zpLCTZ%2Fimage.png?alt=media&amp;token=2ca9766a-deb7-4869-b50d-f23a006f6434" alt="" data-size="original"> #### Marketplace transactions *Marketplace transactions* shows the total number of buy and sell events that occure via the Sequence Marketplace API. <img src="https://2248955668-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhE4weeNpCJSNUXnecN1R%2Fuploads%2FxYLkpHrEmz7CcJiusHgg%2Fimage%20(1).png?alt=media&amp;token=ec5afcd9-47c1-4fd3-af03-d56ede9c454b" alt="" data-size="original"> #### Transaction requests *Transaction requests* represents the total number of transactions sent by wallets associated with the project. <img src="https://2248955668-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhE4weeNpCJSNUXnecN1R%2Fuploads%2Fry1JY6mmWMNMuNXIA4rW%2Fimage%20(2).png?alt=media&amp;token=91d06391-e41f-492d-b220-7f7fac7244a5" alt="" data-size="original"> </details> <details> <summary>Indexer</summary> Sequence Indexer - offered via the Xai Builder - is a simple API to query any blockchain token and NFT data. Simply select the data you want from the indexer, and it generates the necessary code in snippets Fetch different kinds of data from the indexer: * tokens and collectibles owned by any wallet * total supply for any token or collectible * the transaction and transfer history for any wallet address * contract metadata for any token or collection * metadata for any collectible * balance change events for any token or collection Click [here](https://docs.sequence.xyz/solutions/builder/indexer) to get started with the indexer from Xai Builder and see it in action. ### Webhooks #### No-Code Webhooks Xai Builder equips game builders with an indexer that listens to events across the many blockchains that is powered by Sequence to provide an HTTPS callback to a URL you specify - this means you can listen on that endpoint and get up to date information on what’s happening on-chain, customized for what you want to listen to. #### What data can I listen to for my game? * Mints from a contract * TokenID transfers * Transactions by an account address * Event topics, topic hashes, and events emitted by a contract To create Webhooks for your game, simply click [here](https://docs.sequence.xyz/solutions/builder/webhooks/#select-project-and-go-to-webhooks-section) to get started. </details> <details> <summary>Marketplaces</summary> #### Whitelabel Marketplaces Xai Builder provides game builders with a white-label marketplace that can be launched in seconds. With Xai Builder, you can customize your marketplace and integrate it directly into your game experience, all with no-coding experience necessary. #### Try it out Get started quickly at [Xai Builder](https://builder.xai.games/) to launch your marketplace. #### Why would I want my own Marketplace for my web3 game? Xai Builder gives you full control over everything in your marketplace, from enforcing royalties (with ERC-2981) to choosing the best trading mechanism for your community, setting fees, and more. You can also aggregate listings from major platforms like OpenSea or LooksRare, providing you with the benefit of existing liquidity without relinquishing control of the gaming experience. ### Custom Marketplace The Sequence Marketplace API service offers a simple and fast way to interact with sequence marketplace protocols to build a custom marketplace while accelerating your development time. The API is designed to be easy to use and to have all the features you need to build a fully functional marketplace. In addition, we have an [open source custom marketplace boilerplate](https://github.com/0xsequence/marketplace-boilerplate) that you can readily use for your project based on our whitelabel marketplace so you don’t need to build from scratch. 💡 Sequence Market contract is fully audited and can be found at <https://github.com/0xsequence/marketplace-contracts> For more resources on leveraging the Sequence Market Protocol, check out the [in-depth documentation](https://docs.sequence.xyz/api/marketplace/examples/orderbook-transactions). #### Walkthrough Lastly, take a look at Sequence’s [end to end guide](https://docs.sequence.xyz/guides/custom-marketplace) to get you off the ground running with your own marketplace & learn about the infrastructure that powers Sequence. This guide leverages several components of the sequence stack such as our Marketplace APIs and Indexer - all the components needed for accelerating development time & building a scalable in-game or browser based marketplace. </details> <details> <summary>Smart Contract Suite</summary> Xai Builder simplifies smart contract deployment and management with a suite of user-friendly features. Import, deploy, and add contract collaborators to a smart contract in the contracts dashboard and interact directly with your contract. #### What are my deployment options? Deployment of contracts with Xai Builder is simplified through a streamlined process directly within our dashboard. Choose from various contract templates (ERC1155, ERC721, ERC20) and more. The Xai Builder also gives you the option to upload your own custom contracts - saved to your project to deploy to the Xai network. You can check out more information on the deployable contracts through Xai Builder from the link [here](https://docs.sequence.xyz/solutions/builder/contracts). </details> [^1]: Seems to refer to the overall section rather than this specific step [^2]: Redundant from heading [^3]: Seems to not match the step i.e. Review T\&Cs [^4]: Maybe define "what is a project" here. This seems to say Projects are important but not why [^5]: This should be made specific to are you creating a project for mainnet or testnet i.e. Xai or Xai Sepolia [^6]: might be confusing compared to Sequence Embedded wallet. Maybe should be introduced before Sequence Embedded Wallet as the overall product from Sequence? # Subgraph Goldsky is a powerful subgraph provider that allows game developers to efficiently query blockchain data on Xai. By leveraging Goldsky, you can access real-time data for both the testnet and mainnet environments, enabling seamless integration and enhanced functionality for your games. **Why Use Goldsky Subgraphs?** Subgraphs are essential for indexing and querying blockchain data quickly and efficiently. Goldsky provides robust and scalable subgraph solutions, making it easier to interact with complex blockchain data structures. Key benefits include: * **Real-time Data Access:** Obtain up-to-date information from the blockchain, ensuring your game logic remains current and accurate. * **Efficient Queries:** Optimize your data retrieval processes with high-performance querying capabilities. * **Seamless Integration:** Easily integrate subgraph data into your game development workflows. **Accessing Goldsky Subgraphs** Goldsky provides endpoints for both the Xai testnet and mainnet, allowing you to test and deploy your game with reliable data sources. **Testnet Subgraph** To access the Xai testnet subgraph, use the following endpoint: ```bash bashCopy codehttps://api.goldsky.com/api/public/project_cl8ylkiw00krx0hvza0qw17vn/subgraphs/blocks/xai-sepolia/gn ``` This endpoint provides access to testnet data, enabling you to develop and test your game in a safe environment before deploying to mainnet. **Mainnet Subgraph** For live data on the Xai mainnet, use this endpoint: ```bash bashCopy codehttps://api.goldsky.com/api/public/project_cl8ylkiw00krx0hvza0qw17vn/subgraphs/blocks/xai/gn ``` This endpoint ensures you can access real-time mainnet data, crucial for deploying your game to production with accurate and reliable information. **How to Use Goldsky Subgraphs** 1. **Setup Your Environment:** Ensure your development environment is configured to make HTTP requests. Common tools include cURL, Postman, or integrated directly within your codebase using libraries like Axios (JavaScript) or Requests (Python). 2. **Querying Data:** Construct your GraphQL queries to fetch the necessary data from the subgraphs. Here is a basic example of a GraphQL query to get block information: ```graphql graphqlCopy code{ blocks(first: 5) { id number timestamp } } ``` 3. **Integrating into Your Game:** Use the data retrieved from Goldsky subgraphs to enhance your game logic. Whether you need player stats, game state information, or other blockchain-related data, subgraphs provide a reliable source. 4. **Testing:** Always test your queries on the testnet first to ensure they return the expected data. Once validated, you can confidently switch to the mainnet endpoint for production. **Additional Resources** For more detailed information and advanced usage, refer to the Goldsky documentation: * [Goldsky Documentation](https://docs.goldsky.com/chains/xai) By leveraging Goldsky subgraphs, you can build more dynamic, data-driven games on the Xai blockchain, ensuring a smooth and enriched gaming experience for your users. # Xai Gas Subsidy ## XAI Gas Subsidy The XAI Gas Subsidy uses the ERC-2771 standard for secure protocol for native meta transactions. With the XAI Gas Subsidy XAI can sponsor your user's transactions so they don't have to own native XAI. ### How the XAI Gas Subsidy works Instead of using a contract write function, the user will sign a typed data message ([EIP-712](https://eips.ethereum.org/EIPS/eip-712)) with the message implementing the [ERC-2771](https://eips.ethereum.org/EIPS/eip-2771) `meta-transaction`. This means when you use the XAI Gas Subsidy your user does not call the contract directly, instead the XAI relayer will forward to your smart contract. #### Relayer Endpoints: **Xai Mainnet Relayer**: <https://relayer.xai.games/\\> **Xai Mainnet API Docs**: <https://docs.xai.games/gas-relayer/#/relayer> **Xai Testnet Relayer**: <https://develop.relayer.xai.games/> \ **Xai Testnet API Docs**: <https://develop.docs.xai.games/gas-relayer/#/relayer> ### Requirements To use the XAI Gas Subsidy your contracts need to follow the [ERC-2771](https://eips.ethereum.org/EIPS/eip-2771) \_msgSender() overwrite and make sure to only use the \_msgSender() when updating a user's state. \ \ The [ERC-2771](https://eips.ethereum.org/EIPS/eip-2771) requires the validation for a trusted forwarder contract when interacting on behalf of a user. The **trusted forwarder contract for your ecosystem's contracts should be owned by you**. The trusted forwarder contract will be able to execute transactions on behalf of your user's wallet.\ \ Interacting with ERC-20 tokens while using the Xai subsidy requires implementing the ERC-2771 standard. Gasless approvals can be achieved by implementing the ERC-2612 Permit Extension. **Any ERC-20 contracts that don't either implement ERC-2771 or ERC-2612 can not be used for sponsored transaction.**\ \ **FOR ALL INTERACTIONS ALLOWING THE FORWARDER, DO NOT USE `msg.sender` IN YOUR CONTRACTS, YOU MUST USE `_msgSender()` or your contract's state will not be updated properly**\ \ For **testing purposes** there is a Xai mainnet and testnet forwarder deployed: * **Xai mai
프로젝트로 돌아가기