{"uid":"cap_vlEsV0LKCn6YHWj9rWJvi","slug":"abi-encode-typed-parameters-6e9ff824","name":"ABI-Encode Typed Parameters","description":"ABI-encode a list of typed parameters — Genesis402 / UnyKorn Operator Network","url":"https://twin.unykorn.org/abi-encode?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"params":{"type":"object","properties":{"types":{},"values":{}}}}},"responseSchema":{"type":"json","example":{"ok":true,"type":"abi-encode","receipt":{"tx_hash":"0x<64hex>","amount_usd":0.002,"receipt_id":"g402-<16hex>"},"generated_at":"<iso8601>"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_8HqtkeB3pc-qJLF3M8IRb","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"ABI-encodes a list of typed parameters into Ethereum ABI binary format","exampleAgentPrompt":"ABI-encode these parameters for me: types are ['address','uint256'] and values are ['0xAbCd...1234', 1000000000000000000] — I need the encoded hex to build a contract call.","exampleUseCases":[{"title":"Build EVM contract calldata","prompt":"I need to ABI-encode the types ['address','uint256','bool'] with values ['0xDeAdBeEf000000000000000000000000DeAdBeEf', 500, true] so I can assemble a raw transaction to send to a smart contract."},{"title":"Encode tuple for multicall","prompt":"Can you ABI-encode a tuple? The types are ['tuple(address,uint256)'] and the value is [['0x1234567890abcdef1234567890abcdef12345678', 42]] — I'm building a multicall payload."},{"title":"Verify encoding matches on-chain expectation","prompt":"ABI-encode types ['bytes32','uint8'] with values ['0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef', 7] so I can check the output matches what my Solidity unit test expects."}],"resultDescription":"Returns a JSON object with ok:true, the encoded ABI hex string, and a payment receipt including transaction hash, amount paid in USD, and a unique receipt ID. The ABI-encoded result can be used directly as calldata or as part of a larger transaction payload.","failureModes":["Mismatched types and values arrays length — returns error indicating count mismatch","Invalid Solidity type strings (e.g. 'uint' without bit size) — returns type parsing error","Values that don't conform to declared types (e.g. string where uint256 expected) — returns encoding error","Payment failure or insufficient USDC balance — returns 402 Payment Required","Malformed JSON request body — returns 400 Bad Request"],"whenToPreferThis":"Use this endpoint when an AI agent needs to ABI-encode Ethereum parameters without a local Web3 library (ethers.js, viem, web3.py) available, or when running in a sandboxed environment that can't execute arbitrary code. Ideal for agents constructing raw contract calldata, multicall payloads, or verifying encoding outputs in a blockchain workflow. It costs $0.002 USDC per call via x402, so prefer a local library when one is available at no cost.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T18:55:13.355Z","isFirstParty":false,"canonicalSlug":"abi-encode-typed-parameters-6e9ff824"}