### Marketplace Quickstart Source: https://docs.sequence.xyz/llms.txt Quickstart Guide on building an In-Game Marketplace using Sequence's Unreal SDK. ```APIDOC ## Marketplace Quickstart ### Description Quickstart Guide on how to build your own In-Game Marketplace using Sequence's Unreal SDK. ### Method Not specified, likely SDK method calls. ### Endpoint Not applicable (SDK). ### Parameters Not specified. ### Request Example Not specified. ### Response Not specified. ``` -------------------------------- ### Swaps Quickstart Source: https://docs.sequence.xyz/llms.txt Quickstart Guide on making Smart Swaps using Sequence's Unreal SDK. ```APIDOC ## Swaps Quickstart ### Description Quickstart Guide on how to make Smart Swaps using Sequence's Unreal SDK. ### Method Not specified, likely SDK method calls. ### Endpoint Not applicable (SDK). ### Parameters Not specified. ### Request Example Not specified. ### Response Not specified. ``` -------------------------------- ### Install Dependencies and Run Locally Source: https://docs.sequence.xyz/guides/build-embedding-wallet Install project dependencies using pnpm and start the local development server. This command prepares and launches the application. ```bash pnpm install && pnpm dev ``` -------------------------------- ### Unreal Embedded Wallet Setup Source: https://docs.sequence.xyz/llms.txt Quickstart Documentation for Sequence's Unreal SDK. ```APIDOC ## Unreal Embedded Wallet Setup ### Description Quickstart Documentation for Sequence's Unreal SDK. ### Method Not specified, likely SDK method calls. ### Endpoint Not applicable (SDK). ### Parameters Not specified. ### Request Example Not specified. ### Response Not specified. ``` -------------------------------- ### Install Dependencies and Run Sidekick with Redis Source: https://docs.sequence.xyz/solutions/infrastructure/sidekick/quickstart Use these commands to install project dependencies and start Sidekick along with a Redis server for development. ```shell pnpm install pnpm dev:withRedis ``` -------------------------------- ### Install Dependencies and Run Development Server Source: https://docs.sequence.xyz/guides/webgl-guide Install project dependencies and start the development server to view your WebGL application. Use your preferred package manager (pnpm, npm, or yarn). ```bash pnpm install pnpm run dev ``` -------------------------------- ### Install go-sequence with go get Source: https://docs.sequence.xyz/api-references/indexer/installation Install the go-sequence library for Go projects. This command fetches the latest version of the library, which is necessary for integrating with the Sequence Indexer from Go applications. ```bash go get -u github.com/0xsequence/go-sequence@latest ``` -------------------------------- ### Install and Run React Project Source: https://docs.sequence.xyz/guides/unity-webgl-telegram Install project dependencies and start the development server for your React-based WebGL game. This command is run from the React project's root directory. ```bash pnpm install pnpm run dev ``` -------------------------------- ### Start Sidekick in Docker Source: https://docs.sequence.xyz/solutions/infrastructure/sidekick/quickstart Start the Sidekick server using a Docker container. Ensure Docker is installed and accessible. ```shell pnpm docker:start ``` -------------------------------- ### Go Installation and Initialization Source: https://docs.sequence.xyz/api-references/metadata/overview Install the `go-sequence` package and initialize the metadata client with your API Access Key. ```bash go get -u github.com/0xsequence/go-sequence@latest ``` ```go import ( "context" "github.com/0xsequence/go-sequence/metadata" ) seqMetadata := metadata.NewMetadata("YOUR_API_ACCESS_KEY") contractInfo, err := seqMetadata.GetContractInfo(context.Background(), "polygon", "0x631998e91476DA5B870D741192fc5Cbc55F5a52E") ``` -------------------------------- ### Node.js Installation and Initialization Source: https://docs.sequence.xyz/api-references/metadata/overview Install the `@0xsequence/metadata` package and initialize the `SequenceMetadata` client with your API Access Key. ```bash npm install @0xsequence/metadata ``` ```typescript import { SequenceMetadata } from '@0xsequence/metadata' const metadata = new SequenceMetadata('https://metadata.sequence.app', 'YOUR_API_ACCESS_KEY') ``` -------------------------------- ### Go Installation Source: https://docs.sequence.xyz/api-references/indexer/installation Install the go-sequence package for Go projects and initialize the Sequence Indexer client. ```bash go get -u github.com/0xsequence/go-sequence@latest ``` ```go import ( "github.com/0xsequence/go-sequence/indexer" ) // see https://docs.sequence.xyzhttps://status.sequence.info for list of // indexer hosts for the chain you'd like to query seqIndexer := indexer.NewIndexer("https://polygon-indexer.sequence.app", "AQAAAAAAAF_JvPALhBthL7VGn6jV0YDqaFY") // see examples below for the kinds of queries you can make accountAddress := "ACCOUNT_ADDRESS" includeMetadata := true metadataOptions := indexer.MetadataOptions{ VerifiedOnly: true, } _, tokenBalances, err := seqIndexer.GetTokenBalances(context.Background(), &accountAddress, nil, nil, &includeMetadata, &metadataOptions, nil, nil) ``` -------------------------------- ### Install Dependencies Source: https://docs.sequence.xyz/guides/use-with-privy Install the necessary Sequence, Privy, and wagmi/viem packages using pnpm. ```bash pnpm install @0xsequence/account @0xsequence/core @0xsequence/network @0xsequence/sessions @0xsequence/signhub @privy-io/react-auth @privy-io/wagmi-connector wagmi @privy-io/wagmi @tanstack/react-query viem ethers ``` -------------------------------- ### Install Checkout SDK Source: https://docs.sequence.xyz/solutions/payments/checkout-sdk Install the necessary packages for Sequence Checkout and Connect using pnpm. ```bash pnpm add @0xsequence/checkout @0xsequence/connect ``` -------------------------------- ### Install Google and Apple Sign-In Packages Source: https://docs.sequence.xyz/guides/treasure-chest-guide Install necessary packages for Google OAuth and Apple Sign-In. ```shell pnpm i @react-oauth/google react-apple-signin-auth ``` -------------------------------- ### Install Marketplace SDK Dependencies Source: https://docs.sequence.xyz/sdk/web/marketplace-sdk/getting-started Install the Marketplace SDK and its peer dependencies using pnpm. ```bash pnpm add @0xsequence/marketplace-sdk @0xsequence/connect wagmi viem @tanstack/react-query ``` -------------------------------- ### Install Sequence WaaS SDK Source: https://docs.sequence.xyz/sdk/headless-wallet/authentication Install the Sequence WaaS SDK using your preferred package manager. ```bash pnpm install @0xsequence/waas ``` ```bash npm install @0xsequence/waas ``` ```bash yarn add @0xsequence/waas ``` -------------------------------- ### Install Sequence Packages Source: https://docs.sequence.xyz/sdk/typescript/guides/backend/integration Install the necessary packages for Sequence integration, including authentication, network configuration, and ethers.js. ```bash npm install @0xsequence/auth @0xsequence/network ethers ``` -------------------------------- ### Import useSellModal Hook Source: https://docs.sequence.xyz/sdk/web/marketplace-sdk/hooks/marketplace-actions/useSellModal Import the useSellModal hook from the Sequence Marketplace SDK for React applications. Ensure you have followed the Getting Started guide for necessary setup. ```typescript import { useSellModal } from "@0xsequence/marketplace-sdk/react"; ``` -------------------------------- ### Import useMakeOfferModal Hook Source: https://docs.sequence.xyz/sdk/web/marketplace-sdk/hooks/marketplace-actions/useMakeOfferModal Import the useMakeOfferModal hook from the marketplace SDK. Ensure you have set up your project according to the Getting Started guide. ```typescript import { useMakeOfferModal } from "@0xsequence/marketplace-sdk/react"; ``` -------------------------------- ### Import useCreateListingModal Hook Source: https://docs.sequence.xyz/sdk/web/marketplace-sdk/hooks/marketplace-actions/useCreateListingModal Import the `useCreateListingModal` hook from the marketplace SDK. Ensure you have followed the Getting Started guide for collection address and chain ID. ```typescript import { useCreateListingModal } from "@0xsequence/marketplace-sdk/react"; ``` -------------------------------- ### Install pnpm Source: https://docs.sequence.xyz/guides/building-relaying-server Installs the pnpm package manager. Ensure pnpm is installed before proceeding with the project setup. ```shell curl -fsSL https://get.pnpm.io/install.sh | sh - ``` -------------------------------- ### Copy Example Configuration Files Source: https://docs.sequence.xyz/guides/telegram-integration Copy the example environment and wrangler configuration files to your project root. Update these files with your specific project keys and bot tokens. ```shell cp .env.example .env && cp example.wrangler.toml wrangler.toml ``` -------------------------------- ### Create Go Project Directory Source: https://docs.sequence.xyz/sdk/unity/wallets/embedded-wallet/onboard/authentication/oidc Set up a new directory for your Go project and create the main.go file. This is part of the local server setup process for editor testing. ```bash mkdir myUnityServer cd myUnityServer touch main.go ``` -------------------------------- ### Install Sequence Connect SDK Source: https://docs.sequence.xyz/solutions/wallets/developers/ecosystem-wallet/react_quickstart Install the core Sequence Web SDK package, which includes necessary hooks, components, and the wallet modal. ```bash pnpm install @0xsequence/connect ``` -------------------------------- ### Build an NFT Minting Server with Sidekick Source: https://docs.sequence.xyz/llms.txt This example demonstrates how to construct an NFT minting server utilizing the Sidekick backend. It requires Sidekick to be set up and running. ```javascript import express from "express"; import { Sidekick } from "@0xsequence/sidekick"; const app = express(); const sidekick = new Sidekick(); app.post("/mint", async (req, res) => { const { wallet, nftContract, tokenId, metadata } = req.body; try { const tx = await sidekick.mintNFT({ wallet, nftContract, tokenId, metadata, }); res.json({ success: true, transactionHash: tx.hash }); } catch (error) { res.status(500).json({ success: false, error: error.message }); } }); app.listen(3000, () => { console.log("Minting server listening on port 3000"); }); ``` -------------------------------- ### Clone the Demo Repository Source: https://docs.sequence.xyz/guides/build-embedding-wallet Clone the official demo repository to get started with embedded wallet linking. This sets up the necessary project structure. ```bash git clone https://github.com/0xsequence-demos/demo-embedded-wallet-linking.git && cd ./demo-embedded-wallet-linking ``` -------------------------------- ### Run Development Server Source: https://docs.sequence.xyz/sdk/web/marketplace-sdk/getting-started Start your application's development server using pnpm to view the marketplace. The application will be accessible at `http://localhost:5173`. ```bash pnpm run dev ``` -------------------------------- ### Get Fee History Source: https://docs.sequence.xyz/sdk/unity/advanced/clients Retrieve the fee history for a specified number of blocks, starting from a given block. The newestBlock parameter should be a hexadecimal string or 'latest'. ```csharp FeeHistoryResult feeHistory = await client.FeeHistory(blockCount, newestBlock, new int[] { }); ``` -------------------------------- ### Fetch Token Supplies with Metadata (Go) Source: https://docs.sequence.xyz/api-references/indexer/examples/unique-tokens This Go example shows how to retrieve token supplies and metadata using the Sequence Go SDK. It includes options for filtering verified contracts. Ensure you have the `github.com/0xsequence/go-sequence/indexer` package. ```go go import ( "context" "fmt" "log" "net/http" "github.com/0xsequence/go-sequence/indexer" ) func GetTokenSupplies(contractAddress string) { seqIndexer := indexer.NewIndexer("https://polygon-indexer.sequence.app", "AQAAAAAAAF_JvPALhBthL7VGn6jV0YDqaFY") metadataOptions := indexer.MetadataOptions{ VerifiedOnly: true, // Set to true if you want to fetch only verified contracts UnverifiedOnly: false, IncludeContracts: nil, // Provide a list of specific contracts to include, if any } _, _, tokenDetails, err := seqIndexer.GetTokenSupplies(context.Background(), contractAddress, nil, &metadataOptions, nil) if err != nil { log.Fatal(err) } fmt.Println("token details:", tokenDetails) } ``` -------------------------------- ### Clone Primary Sales Repository from Github Source: https://docs.sequence.xyz/guides/primary-sales Clone the primary sales repository from GitHub to start development. After cloning, install dependencies and run the development server. ```shell git clone https://github.com/0xsequence-demos/primary-sale-1155-boilerplate.git ``` ```shell pnpm install && pnpm dev ``` -------------------------------- ### Create Marketplace Boilerplate Source: https://docs.sequence.xyz/solutions/payments/marketplace/custom Use this command to quickly set up a marketplace boilerplate project. Follow the prompts to initialize the environment. ```shell npx sequence-cli marketplace create-marketplace-boilerplate ``` -------------------------------- ### Use useCountOfCollectables Hook Source: https://docs.sequence.xyz/sdk/web/marketplace-sdk/hooks/marketplace-data/useCountOfCollectables Import and use the useCountOfCollectables hook to get the number of NFTs in a collection. This example shows basic usage with chainId, collectionAddress, and filter options. ```typescript import { OrderSide } from "@0xsequence/marketplace-sdk"; import { useCountOfCollectables } from "@0xsequence/marketplace-sdk/react"; const countOfCollectables = useCountOfCollectables({ chainId, collectionAddress, side: OrderSide.listing, filter: { searchText: text, includeEmpty, properties, }, }); ``` -------------------------------- ### Get Token Balances Summary Source: https://docs.sequence.xyz/api-references/indexer-gateway/examples/get-token-balances-details This example demonstrates how to retrieve a summary of verified token balances for a specified account across 'mainnet' and 'polygon' networks using cURL. ```APIDOC ## POST /rpc/IndexerGateway/GetTokenBalancesSummary ### Description Retrieves a summary of verified token balances for specified accounts across multiple networks. ### Method POST ### Endpoint https://indexer.sequence.app/rpc/IndexerGateway/GetTokenBalancesSummary ### Parameters #### Request Body - **networks** (array[string]) - Required - The list of networks to query (e.g., "mainnet", "polygon"). - **filter** (object) - Required - Filtering criteria for the balances. - **accountAddresses** (array[string]) - Required - A list of account addresses to fetch balances for. ### Request Example ```json { "networks": [ "polygon", "mainnet" ], "filter": { "accountAddresses": [ "0x8e3E38fe7367dd3b52D1e281E4e8400447C8d8B9" ] } } ``` ### Response #### Success Response (200) - **nativeBalances** (array[object]) - An array of native balance summaries per network. - **chainId** (number) - The ID of the blockchain network. - **results** (array[object]) - List of native balance results. - **balance** (string) - The native balance amount. - **balances** (array[object]) - An array of token balance summaries per network. - **chainId** (number) - The ID of the blockchain network. - **results** (array[object]) - List of token balance results. - **contractAddress** (string) - The address of the token contract. - **balance** (string) - The token balance amount. #### Response Example ```json { "nativeBalances": [ { "chainId": 1, "results": [ { "balance": "1000000000000000000" } ] } ], "balances": [ { "chainId": 137, "results": [ { "contractAddress": "0x...". "balance": "500000000000000000" } ] } ] } ``` ``` -------------------------------- ### Get Block Range Source: https://docs.sequence.xyz/sdk/unity/advanced/clients Retrieve a list of Block objects within a specified range. The starting and ending block numbers should be provided as hexadecimal strings, or as 'earliest' or 'latest'. ```csharp List blockRange = await client.BlockRange(startingBlockNumber, endingBlockNumber); ``` -------------------------------- ### Get Ecosystem Config C++ Source: https://docs.sequence.xyz/sdk/unreal/wallets/ecosystem-wallet/authentication Retrieves configuration data for the ecosystem, such as name, supported chains, and enabled authentication providers. Call this to understand the ecosystem's setup. ```cpp const TSuccessCallback SuccessCallback = [this, OnSuccess](const FEcosystemConfig& Config) { // Ecosystem Name: Config.Name // Supported Chains: Config.SupportedChains // Auth Providers: Config.EnabledProviders }; const FFailureCallback FailureCallback = [OnFailure](const FSequenceError& Error) { }; USequenceConnect* Connect = NewObject(); Connect->GetEcosystemConfig(SuccessCallback, FailureCallback); ``` -------------------------------- ### Setup Crypto Shims for Ethers Source: https://docs.sequence.xyz/sdk/mobile Installs necessary shims for crypto-related packages like ethers and registers pbkdf2 from react-native-quick-crypto. Ensure this is imported early in your app lifecycle. ```typescript import { install } from "react-native-quick-crypto"; install(); import "react-native-url-polyfill/auto"; import { ReadableStream } from "web-streams-polyfill"; globalThis.ReadableStream = ReadableStream; import crypto from "react-native-quick-crypto"; global.getRandomValues = crypto.getRandomValues; export * from "@ethersproject/shims"; import * as ethers from "ethers"; ethers.pbkdf2.register( ( password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512" ) => { console.info("Using react-native-quick-crypto for pbkdf2"); return ethers.hexlify( new Uint8Array( crypto.pbkdf2Sync( password, salt, iterations, keylen, algo === "sha256" ? "SHA-256" : "SHA-512" ) ) ); } ); export * from "ethers"; ``` -------------------------------- ### Initialize EOS Platform Source: https://docs.sequence.xyz/sdk/unreal/wallets/embedded-wallet/guides/epic-auth-guide Initialize the EOS platform using `EOS_Platform_Create` with your project credentials. It's recommended to load these from a configuration file for security. ```cpp // .h void Initialize(); // .cpp void UEOSManager::Initialize() { const FString CacheDirectory = FPaths::ConvertRelativePathToFull(FPaths::Combine(FPaths::ProjectSavedDir(), TEXT("EOSCache"))); EOS_Platform_Options PlatformOptions = {}; PlatformOptions.ApiVersion = EOS_PLATFORM_OPTIONS_API_LATEST; PlatformOptions.ProductId = "ProductId"; PlatformOptions.SandboxId = "SandboxId"; PlatformOptions.DeploymentId = "DeploymentId"; PlatformOptions.ClientCredentials.ClientId = "ClientId"; PlatformOptions.ClientCredentials.ClientSecret = "ClientSecret"; PlatformOptions.EncryptionKey = "EncryptionKey"; PlatformOptions.TickBudgetInMilliseconds = 0; PlatformOptions.CacheDirectory = TCHAR_TO_UTF8(*CacheDirectory); PlatformOptions.OverrideCountryCode = nullptr; PlatformOptions.OverrideLocaleCode = nullptr; PlatformOptions.Flags = 0; this->EosPlatform = EOS_Platform_Create(&PlatformOptions); if (!this->EosPlatform) { UE_LOG(LogTemp, Error, TEXT("Failed to create EOS platform.")); return; } UE_LOG(LogTemp, Display, TEXT("EOS Platform initialized successfully.")); } ``` -------------------------------- ### Get Balance Updates with TypeScript Source: https://docs.sequence.xyz/api-references/indexer-gateway/examples/get-balance-updates This TypeScript example demonstrates how to use the Sequence Indexer Gateway client to fetch balance updates. It includes error handling and logging for the results. ```typescript import { SequenceIndexerGateway } from '@0xsequence/indexer' const INDEXER_TOKEN = 'AQAAAAAAAF_JvPALhBthL7VGn6jV0YDqaFY'; const CONTRACT_ADDRESS = '0xdac17f958d2ee523a2206206994597c13d831ec7'; const indexerGateway = new SequenceIndexerGateway( 'https://indexer.sequence.app', INDEXER_TOKEN ) const res = await indexerGateway.getBalanceUpdates({ chainIds: [1], contractAddress: CONTRACT_ADDRESS }) res.balances.forEach(({ chainId, error, results }) => { if (error) { console.error(`Error fetching balance updates for chainId ${chainId}: ${error}`); return; } console.log(`chainId: ${chainId}`); results.forEach(({ accountAddress, balance }) => { if (balance === '0') { return; } console.log(` accountAddress: ${accountAddress}, balance: ${balance}`); }); }); ``` -------------------------------- ### Initialize Sequence Wallet and Sign In Source: https://docs.sequence.xyz/guides/typed-on-chain-signatures Initialize the Sequence wallet with your project access key and network, then implement a sign-in function to connect the user's wallet. ```typescript import { sequence } from '0xsequence' function App() { sequence.initWallet(PROJECT_ACCESS_KEY, { defaultNetwork: 'sepolia', }); const signIn = async () => { const wallet = sequence.getWallet() const details = await wallet.connect({app: 'sequence signature validation demo'}) if(details){ console.log('is signed in') console.log(details) } } return ( ... ... ) } ``` -------------------------------- ### Run Local Server Source: https://docs.sequence.xyz/sdk/unity/wallets/embedded-wallet/onboard/authentication/oidc Start the local Go server for OIDC authentication in the editor. Ensure the server is running before initiating sign-in. ```bash go run main.go ``` -------------------------------- ### Implementing an ERC20 Transaction with Fee Options Source: https://docs.sequence.xyz/sdk/headless-wallet/fee-options This example shows how to use `checkTransactionFeeOptions` to get fee details and then send an ERC20 token transfer using `sequence.sendERC20`, including the fetched fee options. ```APIDOC #### Implementing an ERC20 Transaction ```typescript theme={null} import { ethers } from 'ethers' import { erc20 } from '@0xsequence/waas' ... const response = await checkTransactionFeeOptions({ transactions: [erc20({ token: customTokenAddress, to: destinationAddress, value: ethers.parseUnits(amount, decimals).toString() })], network: 'arbitrum-nova' // i.e. network or chainID e.g. 42170 }) const tx = await sequence.sendERC20({ token: customTokenAddress, to: destinationAddress, value: ethers.parseUnits(amount, decimals), network: 'arbitrum-nova', transactionsFeeOption: response.feeOptions, transactionsFeeQuote: response.feeQuote }) ``` ``` -------------------------------- ### Create React Embedded Wallet Starter with Sequence-CLI Source: https://docs.sequence.xyz/guides/template-overview Use this command to create a starter project for a React application with an embedded wallet integrated with the Web SDK. ```bash npx sequence-cli boilerplates create-embedded-wallet-react-starter ``` -------------------------------- ### Get Wallet Address Source: https://docs.sequence.xyz/sdk/headless-wallet/use-wallets Access the unique wallet address linked to the user's authenticated account. This address is 42 characters long, starts with '0x', and serves as the gateway to all account functions. ```APIDOC ## Get Wallet Address ### Description Access the wallet linked to the user's authenticated account. This wallet serves as the gateway to all account functions. ### Method ```ts const address = await sequence.getAddress(); ``` ### Response Example ```json { "example": "0xE4b10c53aa75E19E088cfDD0cff7D46a0E4206F0" } ``` ``` -------------------------------- ### Start Guest Session in C++ Source: https://docs.sequence.xyz/sdk/unreal/wallets/embedded-wallet/onboarding/authentication Initiates a guest session for users who do not wish to create an account immediately. Access to the wallet will be lost if the app is uninstalled or the user signs out. ```cpp const TFunction OnApiSuccess = [] { }; const FFailureCallback OnApiFailure = [](const FSequenceError& Error) { }; USequenceSessions* Sessions = NewObject(); Sessions->StartGuestSession(OnApiSuccess, OnApiFailure); ``` -------------------------------- ### Fetch Token Supplies with Metadata (TypeScript) Source: https://docs.sequence.xyz/api-references/indexer/examples/unique-tokens This TypeScript example demonstrates how to use the Sequence Indexer SDK to fetch token supplies and metadata. It works in both web applications and Node.js environments. Ensure you have the `@0xsequence/indexer` package installed. ```typescript // Works in both a Webapp (browser) or Node.js: import { SequenceIndexer } from '@0xsequence/indexer' const indexer = new SequenceIndexer('https://polygon-indexer.sequence.app', 'AQAAAAAAAF_JvPALhBthL7VGn6jV0YDqaFY') // here we query the Skyweaver contract address, but you can use any const contractAddress = '0x631998e91476DA5B870D741192fc5Cbc55F5a52E' // query Sequence Indexer for all token details / supplies const tokenDetails = await indexer.getTokenSupplies({ contractAddress: contractAddress, includeMetadata: true }) console.log('token details of contract:', tokenDetails) ``` -------------------------------- ### Install Sequence Web SDK Libraries Source: https://docs.sequence.xyz/sdk/web/wallet-sdk/ecosystem/getting-started Install the required libraries for the Sequence Web SDK using npm, pnpm, or yarn. ```bash npm install @0xsequence/connect wagmi viem # or pnpm install @0xsequence/connect wagmi viem # or yarn add @0xsequence/connect wagmi viem ```