### Set Up React Application and Install Ethers.js Source: https://docs.gokite.ai/kite-chain/4-building-dapps/counter-dapp Use Create React App to scaffold a new React project and install the ethers.js library for blockchain interaction. ```bash npx create-react-app counter-dapp-frontend cd counter-dapp-frontend npm install ethers ``` -------------------------------- ### Initialize Node Project and Install Hardhat Source: https://docs.gokite.ai/kite-chain/3-developing/counter-smart-contract-hardhat Sets up a new Node.js project and installs Hardhat along with necessary tooling for smart contract development. ```bash mkdir kite-counter-hardhat && cd kite-counter-hardhat npm init -y npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox dotenv ``` -------------------------------- ### Install GoKite AA SDK Source: https://docs.gokite.ai/kite-chain/account-abstraction-sdk Install the GoKite AA SDK package using npm. ```bash npm install gokite-aa-sdk ``` -------------------------------- ### Install Foundry Source: https://docs.gokite.ai/kite-chain/4-building-dapps/token-minter Installs Foundry, a smart contract development toolkit, using a curl command and then updates it. ```bash curl -L | bash foundryup ``` -------------------------------- ### Run the Frontend Development Server Source: https://docs.gokite.ai/kite-chain/4-building-dapps/counter-dapp Start the React development server to view and interact with your dApp locally. ```bash npm start ``` -------------------------------- ### Install Goldsky CLI (Windows) Source: https://docs.gokite.ai/kite-chain/11-goldsky-kite-integration Installs the Goldsky CLI for Windows systems using npm. ```bash npm install -g @goldskycom/cli ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.gokite.ai/kite-chain/9-gasless-integration Perform an HTTP GET request on the current page URL with the `ask` query parameter to get dynamic answers and relevant excerpts from the documentation. ```HTTP GET https://docs.gokite.ai/kite-chain/9-gasless-integration.md?ask= ``` -------------------------------- ### Install OpenZeppelin Contracts Source: https://docs.gokite.ai/kite-chain/4-building-dapps/token-minter Use forge to install the OpenZeppelin contracts library. This is a prerequisite for using OpenZeppelin's ERC20 implementation. ```bash forge install OpenZeppelin/openzeppelin-contracts ``` -------------------------------- ### Agent Instructions: Querying Documentation Source: https://docs.gokite.ai/kite-chain/4-building-dapps/counter-dapp Demonstrates how to query documentation dynamically using an HTTP GET request with an 'ask' query parameter. ```http GET https://docs.gokite.ai/kite-chain/4-building-dapps/counter-dapp.md?ask= ``` -------------------------------- ### Install Kite Passport Source: https://docs.gokite.ai/kite-agent-passport/kite-agent-passport Run this command in your coding agent's environment to install Kite Passport tools and skills. ```bash curl -fsSL https://agentpassport.ai/install.sh | bash ``` -------------------------------- ### Run the React Development Server Source: https://docs.gokite.ai/kite-chain/4-building-dapps/voting-dapp Start the local development server for the React application to view and test the dApp in your browser. ```bash npm run dev ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.gokite.ai/kite-chain/1-getting-started To get information not explicitly present on a page, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.gokite.ai/kite-chain/1-getting-started.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.gokite.ai/kite-chain/1-getting-started/faqs Perform an HTTP GET request on the current page URL with the `ask` query parameter to dynamically query the documentation. Use this when the answer is not explicitly present, for clarification, or to retrieve related sections. ```http GET https://docs.gokite.ai/kite-chain/1-getting-started/faqs.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.gokite.ai/kite-agent-passport/kite-agent-passport Perform an HTTP GET request to the current page URL with the `ask` query parameter to dynamically query the documentation. The question should be specific and self-contained. ```http GET https://docs.gokite.ai/kite-agent-passport/kite-agent-passport.md?ask= ``` -------------------------------- ### Create and Encode Full Node Configuration Source: https://docs.gokite.ai/kite-chain/7-kite-node/mainnet-node-operations Example of creating the full node configuration JSON and then base64 encoding it for the AVAGO_CHAIN_CONFIG_CONTENT environment variable. ```bash echo -n '{"3USaEfTcoUhHxpKXvpAG916UKCUEyjrtkg2hBArBG3JyDP7my":{"Config":"eyJsb2ctbGV2ZWwiOiJ0cmFjZSJ9",Upgrade":null}}' | base64 ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.gokite.ai/get-started-why-kite Perform an HTTP GET request to query the documentation dynamically. Use the `ask` query parameter with a specific, self-contained question in natural language. The response includes a direct answer and relevant excerpts. ```http GET https://docs.gokite.ai/get-started-why-kite.md?ask= ``` -------------------------------- ### Install and List Skills Source: https://docs.gokite.ai/kite-agent-passport/cli-reference Install Kite Passport skills into your coding agent to enable functionalities like authentication, service discovery, and request execution. List the available skills. ```bash npx --yes skills add gokite-ai/passport-skills --list ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.gokite.ai/introduction Use this GET request to ask questions about the documentation. The response includes direct answers and relevant excerpts. ```http GET https://docs.gokite.ai/introduction.md?ask= ``` -------------------------------- ### Verify Goldsky CLI Installation Source: https://docs.gokite.ai/kite-chain/11-goldsky-kite-integration Confirms that the Goldsky CLI is installed and accessible. ```bash goldsky ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.gokite.ai/get-started-why-kite/architecture-and-design-pillars Perform an HTTP GET request to the current page URL with the 'ask' query parameter to dynamically query the documentation. The question should be specific and self-contained. ```http GET https://docs.gokite.ai/get-started-why-kite/architecture-and-design-pillars.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.gokite.ai/kite-agent-passport/cli-reference Perform an HTTP GET request to dynamically query this documentation. Use the `ask` query parameter with a specific, natural language question. ```http GET https://docs.gokite.ai/kite-agent-passport/cli-reference.md?ask= ``` -------------------------------- ### Query Documentation with HTTP GET Source: https://docs.gokite.ai/get-started-why-kite/core-concepts-and-terminology To get additional information not directly available on the page, perform an HTTP GET request on the current page URL with the `ask` query parameter. The question should be specific, self-contained, and in natural language. The response will contain a direct answer and relevant excerpts. ```http GET https://docs.gokite.ai/get-started-why-kite/core-concepts-and-terminology.md?ask= ``` -------------------------------- ### Install Goldsky CLI (macOS/Linux) Source: https://docs.gokite.ai/kite-chain/11-goldsky-kite-integration Installs the Goldsky CLI for macOS and Linux systems using curl. ```bash curl https://goldsky.com | sh ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.gokite.ai/kite-agent-passport/beginner-setup Perform an HTTP GET request to query the documentation dynamically using the `ask` query parameter. The question should be specific and self-contained. ```http GET https://docs.gokite.ai/kite-agent-passport/beginner-setup.md?ask= ``` -------------------------------- ### Initialize User Login Source: https://docs.gokite.ai/kite-agent-passport/cli-reference Start the login process for a returning user by providing their email. This generates a login ID that will be used to verify the OTP code sent via email. ```bash kpass login init --email you@example.com --output json ``` -------------------------------- ### Encode Chain Configuration Source: https://docs.gokite.ai/kite-chain/7-kite-node/mainnet-node-operations Example of how to base64 encode a simple chain configuration string using echo and base64. ```bash echo -n '{"log-level":"trace"}' | base64 ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.gokite.ai/kite-chain/7-kite-node/mainnet-node-operations Instructions on how to query the documentation dynamically using an HTTP GET request with an 'ask' query parameter. ```APIDOC # Agent Instructions: Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question. Perform an HTTP GET request on the current page URL with the `ask` query parameter: ``` GET https://docs.gokite.ai/kite-chain/7-kite-node/mainnet-node-operations.md?ask= ``` The question should be specific, self-contained, and written in natural language. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.gokite.ai/kite-agent-passport/funding/add-kite-tokens-external-wallet Use this GET request to query the documentation dynamically with an 'ask' parameter for specific questions not explicitly answered on the page. ```http GET https://docs.gokite.ai/kite-agent-passport/funding/add-kite-tokens-external-wallet.md?ask= ``` -------------------------------- ### Perform HTTP GET Request to Query Documentation Source: https://docs.gokite.ai/kite-chain/12-lucid-kite-integration Use this method to ask questions dynamically when information is not directly available. The question should be specific and self-contained. ```http GET https://docs.gokite.ai/kite-chain/12-lucid-kite-integration.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.gokite.ai/get-started-why-kite/tokenomics Perform an HTTP GET request to query documentation dynamically. Use the `ask` query parameter with a specific, self-contained question in natural language. ```HTTP GET https://docs.gokite.ai/get-started-why-kite/tokenomics.md?ask= ``` -------------------------------- ### Deploy Instant Subgraph Source: https://docs.gokite.ai/kite-chain/11-goldsky-kite-integration Deploys an instant subgraph to Goldsky for quick setup and event-level indexing from an ABI. Requires contract address and ABI file. ```bash goldsky subgraph deploy / \ --from-abi \ --network ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.gokite.ai/kite-agent-passport Perform an HTTP GET request to the current page URL with the 'ask' query parameter to dynamically query documentation. The question should be specific and self-contained. Use this when the answer is not explicitly present on the current page. ```http GET https://docs.gokite.ai/kite-agent-passport.md?ask= ``` -------------------------------- ### Perform HTTP GET Request to Query Documentation Source: https://docs.gokite.ai/kite-chain/4-building-dapps/voting-dapp Use this method to dynamically query documentation. Include your question as the value for the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.gokite.ai/kite-chain/4-building-dapps/voting-dapp.md?ask= ``` -------------------------------- ### Configure Foundry Remappings Source: https://docs.gokite.ai/kite-chain/4-building-dapps/token-minter Configure remappings in your foundry.toml file to correctly import OpenZeppelin contracts. This ensures Foundry can locate the installed library. ```toml [profile.default] remappings = ["@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/"] ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.gokite.ai/get-started-why-kite/whitepaper-references Use this method to dynamically query the documentation for information not explicitly present on the current page. The question should be specific and self-contained. ```http GET https://docs.gokite.ai/get-started-why-kite/whitepaper-references.md?ask= ``` -------------------------------- ### Supported Tokens Response Example Source: https://docs.gokite.ai/kite-chain/9-gasless-integration This JSON object shows the structure of the response from the `/supported_tokens` endpoint. It lists tokens available for gasless transfers on mainnet and testnet, including their contract addresses and relevant parameters for signature generation. ```json { "mainnet": [ { "address": "0x7aB6f3ed87C42eF0aDb67Ed95090f8bF5240149e", "balance_threshold": "0", "decimals": 6, "eip712_name": "Bridged USDC (Kite AI)", "eip712_version": "2", "minimum_transfer_amount": "10000", "name": "Bridged USDC (Kite AI)", "symbol": "USDC.e" } ], "testnet": [ { "address": "0x8E04D099b1a8Dd20E6caD4b2Ab2B405B98242ec9", "balance_threshold": "0", "decimals": 18, "eip712_name": "PYUSD", "eip712_version": "1", "minimum_transfer_amount": "10000000000000000", "name": "PYUSD", "symbol": "PYUSD" } ] } ``` -------------------------------- ### Initialize User Sign Up Source: https://docs.gokite.ai/kite-agent-passport/cli-reference Initiate the sign-up process for a new user by providing their email address. The output includes a signup ID needed for subsequent steps. ```bash kpass signup init --email you@example.com --output json ``` -------------------------------- ### Initialize GoKiteAASDK Source: https://docs.gokite.ai/kite-chain/account-abstraction-sdk Initialize the SDK with network name, Kite RPC URL, and Bundler RPC URL. ```typescript import { GokiteAASDK } from 'gokite-aa-sdk'; const sdk = new GokiteAASDK( 'kite_testnet', 'https://rpc-testnet.gokite.ai', 'https://bundler-service.staging.gokite.ai/rpc/' ); ``` -------------------------------- ### Initialize Foundry Project Source: https://docs.gokite.ai/kite-chain/4-building-dapps/token-minter Initializes a new Foundry project named 'MyTokenProject' and navigates into its directory. ```bash forge init MyTokenProject cd MyTokenProject ``` -------------------------------- ### List Services with Filters Source: https://docs.gokite.ai/kite-agent-passport/cli-reference Use this command to list available services, filtering by query, payment approach, and asset. Specify the output format as JSON for programmatic use. ```bash ksearch services list \ --query weather \ --payment-approach x402_http \ --asset USDC \ --limit 10 \ --output json ``` -------------------------------- ### Get Account Abstraction Wallet Address Source: https://docs.gokite.ai/kite-chain/account-abstraction-sdk Derive the AA wallet address from an existing EOA signer address. ```typescript const signer = '0xYourEOAAddress'; const aaWalletAddress = sdk.getAccountAddress(signer); console.log('AA Wallet:', aaWalletAddress); ``` -------------------------------- ### Ethers Sign Function Example Source: https://docs.gokite.ai/kite-chain/account-abstraction-sdk Implement a sign function using ethers.js for signing user operation hashes. ```typescript // example with ethers: const signFunction = async (userOpHash: string): Promise => { const signer = new ethers.Wallet(process.env.PRIVATE_KEY!); return signer.signMessage(ethers.getBytes(userOpHash)); }; ``` -------------------------------- ### Settle Payment via Facilitator Source: https://docs.gokite.ai/kite-agent-passport/service-provider-guide Example cURL command to POST a payment settlement request to the facilitator API. ```bash curl -X POST https://facilitator.pieverse.io/v2/settle \ -H "Content-Type: application/json" \ -d '{ "authorization": {...}, "signature": "0x...", "network": "kite-testnet" }' ``` -------------------------------- ### Build and Deploy Token Source: https://docs.gokite.ai/kite-chain/4-building-dapps/token-minter Execute the build and deployment commands using Foundry. This includes sourcing environment variables, building the project, and deploying the script. ```bash source .env forge build forge script script/Deploy.s.sol:DeployScript --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast ``` -------------------------------- ### Resend Request with X-PAYMENT Header Source: https://docs.gokite.ai/kite-agent-passport/service-provider-guide Example cURL command to resend a request with the payment authorization token in the X-PAYMENT header. ```bash curl -H "X-PAYMENT: eyJhdXRob3JpemF0aW9uIjp7..." \ https://your-service.com/api/endpoint ``` -------------------------------- ### Example Agentic Payment Request: Service Discovery Source: https://docs.gokite.ai/kite-agent-passport/kite-agent-passport Query your agent to list all available services that can be accessed and paid for through Kite Passport. ```natural_language Show me all the services available on Kite Passport. ``` -------------------------------- ### Create a Spending Session Source: https://docs.gokite.ai/kite-agent-passport/cli-reference Initiate a spending session for an agent, defining the task summary, maximum transaction amounts, session lifetime, allowed assets, and payment approach. ```bash kpass agent:session create \ --task-summary "Discover paid services and execute one approved API call" \ --max-amount-per-tx 2 \ --max-total-amount 10 \ --ttl 24h \ --assets USDC \ --payment-approach x402_http \ --output json ``` -------------------------------- ### Gasless Transfer API Response Example Source: https://docs.gokite.ai/kite-chain/stablecoin-gasless-transfer This JSON structure represents a successful response from the gasless transfer API, returning the transaction hash. ```json { "txHash": "0x**********************************" } ``` -------------------------------- ### Set Environment Variables Source: https://docs.gokite.ai/kite-chain/4-building-dapps/token-minter Configure environment variables for deployment. Ensure your PRIVATE_KEY and RPC_URL are set correctly in a .env file. ```dotenv PRIVATE_KEY=your_private_key RPC_URL=https://rpc-testnet.gokite.ai ``` -------------------------------- ### Gasless Transfer API Request Example Source: https://docs.gokite.ai/kite-chain/stablecoin-gasless-transfer This JSON structure represents a request to the gasless transfer API. It includes details for authorization and transaction parameters. ```json { "from": "0x**********************************", "to": "0x**********************************",", "value": "1234567890123456", "validAfter": "1234567891", "validBefore": "1234567892", "nonce": "0x**********************************", "v": 28, "r": "0x**********************************", "s": "0x**********************************" } ``` -------------------------------- ### Return 402 Payment Required Response Source: https://docs.gokite.ai/kite-agent-passport/service-provider-guide Example JSON response when a request lacks valid payment. Includes payment terms and resource details. ```json { "error": "X-PAYMENT header is required", "accepts": [ { "scheme": "gokite-aa", "network": "kite-testnet", "maxAmountRequired": "1000000000000000000", "resource": "https://your-service.com/api/endpoint", "description": "Your API - Description of your service", "mimeType": "application/json", "outputSchema": { "input": { "discoverable": true, "method": "GET", "queryParams": { "param1": {"description": "Parameter description", "required": true, "type": "string"} }, "type": "http" }, "output": { "properties": { "result": {"description": "Result description", "type": "string"} }, "required": ["result"], "type": "object" } }, "payTo": "0xYourServiceWalletAddress", "maxTimeoutSeconds": 300, "asset": "0x0fF5393387ad2f9f691FD6Fd28e07E3969e27e63", "extra": null, "merchantName": "Your Service Name" } ], "x402Version": 1 } ``` -------------------------------- ### Example Agentic Payment Request: Design Service Source: https://docs.gokite.ai/kite-agent-passport/kite-agent-passport Delegate the creation of a professional LinkedIn banner to your agent, which will use Kite Passport to pay for the service. ```natural_language Create a professional LinkedIn Banner using Kite Passport. ```