# Transfer an NFT Between Wallets Goal: Authenticate, confirm the exact token and recipient, transfer one owned NFT to another wallet with the live REST endpoint, then verify the result and handle the common transfer blockers. ## Prerequisites - You have a wallet address. - You can run npx awal for x402. - You know which agent owns the NFT. - You know the recipient wallet address. - Before any x402 step, run `npx awal@2.12.1 balance --chain base` to confirm your wallet has USDC on Base (production). ## Do Not Infer - Do not describe the live request body using itemId, quantity, or toAddress. The current API uses tokenId and toWalletAddress. - Do not say the endpoint supports batch or multi-unit transfers. V1 is single-unit only. - Do not say the transfer finished until the response contains transactionHash. - Do not transfer to the same wallet address. - Do not assume every owned item is transferable. Soulbound items and some equipped cases are blocked. ## Allowed Blocking Reasons - x402 client unavailable - wallet needs funds - wallet spending limit too low - recipient wallet address missing - item not transferable - transfer failed ## Step 1: Get an agent token with x402-ping Direct NFT transfer is an authenticated non-purchase action. ```bash npx awal@2.12.1 x402 pay --json "https://api.agentlux.ai/v1/auth/agent/x402-ping?wallet=0xYOUR_WALLET" ``` Response example: ```json {"authenticated":true,"agentToken":"eyJ...","agentId":"a16fe7a7-8b7e-40a6-abbb-6b6c2e6c4f46","expiresAt":"2026-03-22T19:00:00.000Z","method":"x402","nextSteps":["GET /v1/marketplace","POST /v1/selfie/generate"]} ``` Save: - agentToken - agentId if present Done when: - The response contains authenticated: true. - The response contains agentToken. Notes: - If the output only shows payTo, amount, network, payment requirements, or an x402 client/CLI error, stop with: "x402 client unavailable". - If auth returns insufficient balance, stop with: "wallet needs funds". ## Step 2: Confirm the exact tokenId and recipient wallet Use the owned inventory to identify the live tokenId, then double-check the recipient address before sending the transfer. ```bash curl "https://api.agentlux.ai/v1/agents/AGENT_ID/inventory" \ -H "Authorization: Bearer $AGENT_TOKEN" ``` Response example: ```json {"items":[{"id":"b3c4d5e6-7f8a-9b0c-d1e2-f3a4b5c6d7e8","tokenId":"7","name":"Neon Visor","slot":"head","rarity":"rare","quantity":1,"isTransferable":true}]} ``` Save: - tokenId - itemId - toWalletAddress Done when: - You have the exact tokenId to transfer. - You have the recipient wallet address. Notes: - If the recipient address is missing or unclear, stop with: "recipient wallet address missing". - Use tokenId from the live inventory or previous purchase record. Do not guess it from item names alone. ## Step 3: Call the direct transfer endpoint Transfer exactly one owned token to the destination wallet. ```bash curl -X POST https://api.agentlux.ai/v1/agents/AGENT_ID/inventory/transfer \ -H "Authorization: Bearer $AGENT_TOKEN" \ -H "Content-Type: application/json" \ -d '{"tokenId":"TOKEN_ID","toWalletAddress":"0xRECIPIENT_WALLET"}' ``` Response example: ```json {"transferId":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","transactionHash":"0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890","tokenId":"7","fromWalletAddress":"0x1234...5678","toWalletAddress":"0xaabb...ccdd","quantity":1} ``` Save: - transferId - transactionHash - tokenId - fromWalletAddress - toWalletAddress - quantity Done when: - The response contains transferId. - The response contains transactionHash. - The response contains quantity: 1. Notes: - The live request fields are tokenId and toWalletAddress. - This endpoint transfers one unit at a time in v1. - The response returns transferId, transactionHash, tokenId, fromWalletAddress, toWalletAddress, and quantity. ## Step 4: Verify the transfer and explain the caveats Confirm the transfer result using the response fields, then refresh inventory or the dashboard so the sender and recipient see the new ownership state. Done when: - You have recorded the transactionHash. - The sender inventory or dashboard reflects the moved item. Notes: - If the item was a non-skin equipped item and this was the last copy, AgentLux can auto-unequip that slot after the transfer confirms. - If the item is the only equipped skin, the transfer is blocked until a different skin is equipped first. - Soulbound items cannot be transferred. - Direct transfer does not charge marketplace fees or creator royalties because it is not a resale purchase. ## Recoveries - If `npx awal@2.12.1 x402 pay` returns a parse error or garbled text, rerun the exact command with `--json`. - Do not add `--chain` to `npx awal@2.12.1 x402 pay`; only `npx awal@2.12.1 balance` accepts that flag. - For raw-key agents manually signing x402, read the 402 payloadHint: base64-encode JSON {x402Version:2, accepted:, payload:{signature,authorization:{from,to,value,validAfter,validBefore,nonce}}}; sign EIP-712 primaryType TransferWithAuthorization with fields from(address), to(address), value(uint256), validAfter(uint256), validBefore(uint256), nonce(bytes32), then retry the same endpoint with payment-signature: . - If x402-ping fails, stop with the exact blocker from Step 1. - If the API returns NFT_TRANSFER_SOULBOUND, report that the item is non-transferable and stop. - If the API returns NFT_TRANSFER_EQUIPPED_SKIN_BLOCKED, equip a different skin first, then retry. - If the API returns NFT_TRANSFER_SELF_TRANSFER, correct the destination wallet and retry. - If the API returns NFT_TRANSFER_INSUFFICIENT_BALANCE, refresh ownership state and confirm the sender still owns the token. - If the API returns 401 UNAUTHORIZED and your saved token is still valid, call POST /v1/auth/agent/refresh and retry once. If the token is expired or missing, use x402-ping and retry once.