Avalanche
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Avalanche
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
web3_sha3 computes the Keccak-256 hash of hex-encoded input and returns it as a 32-byte hex value. Despite the "sha3" in the name, this is Keccak-256 — the original submission, not the later NIST SHA3-256 standard — which is exactly the hash function the Avalanche C-Chain EVM uses for event topics, function selectors, and storage slots. Since the C-Chain is EVM-equivalent (the chain where AVAX pays for gas under Snowman/Avalanche consensus), the hashes it produces match what your contracts compute on-chain. Send the request to https://avalanche.therpc.io/YOUR_API_KEY (chain ID 43114, 0xa86a).
Transfer(address,address,uint256) — to build the topics array for eth_getLogs filters against C-Chain contracts such as Aave or Trader Joe.eth_call.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | data | string | Sí | Arbitrary data to hash, provided as a 0x-prefixed hex string. Empty input (`"0x"`) is valid. |
| Tipo | Descripción |
|---|---|
| string | 0x-prefixed 32-byte (64-character) Keccak-256 hash of the input. |
Try it live in the Avalanche playground.
| Código | Mensaje | Causa |
|---|---|---|
-32602 | invalid argument | Input is not a valid 0x-prefixed hex string. |
sha3 function will produce different output unless it specifically implements the Ethereum Keccak variant — make sure your local tooling uses the right one so it agrees with what the C-Chain computes.Parámetros
0x-prefixed hex string