API Acre · Crypto Typed Data Hash

by API Acre

POSTBaseSolana

$0.01

per call · USD Coin on Base

Validate EIP-712 typed structured data and derive its domain separator, message hash, and signing digest.

Endpoint

POST https://apiacre.com/v1/crypto/typed-data-hash

2

Calls / 30d

1

Unique payers / 30d

Sep 1

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://apiacre.com/v1/crypto/typed-data-hash", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "typed_data": {
      "domain": {
        "name": "API Acre Example"
      },
      "message": {
        "contents": "Hello"
      },
      "primaryType": "Message",
      "types": {
        "EIP712Domain": [
          {
            "name": "name",
            "type": "string"
          }
        ],
        "Message": [
          {
            "name": "contents",
            "type": "string"
          }
        ]
      }
    }
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://apiacre.com/v1/crypto/typed-data-hash" \
  -H "Content-Type: application/json" \
  -d '{"typed_data":{"domain":{"name":"API Acre Example"},"message":{"contents":"Hello"},"primaryType":"Message","types":{"EIP712Domain":[{"name":"name","type":"string"}],"Message":[{"name":"contents","type":"string"}]}}}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "data": {
    "domainSeparator": "0xc167959bdf834486717879a8cd6eb3e12a864d1b1d7dbcecec40455e1b4bc8c8",
    "messageHash": "0xd6a9eadbfb49313d8b83d02d2bb22b916a5b16e6006946c9ca6fa7959d934b3a",
    "primaryType": "Message",
    "signingHash": "0x7433e410d5f2857cb42d0bfd31bc71e8aa553f02ce0eed397927f01dfb46424c",
    "valid": true
  },
  "meta": {
    "cached": false,
    "duration_ms": 42,
    "next_actions": [],
    "sources": [],
    "warnings": []
  },
  "request_id": "018f1f54-7f38-7ba2-8dc3-5f90272d9f1a",
  "service": "crypto.typed-data-hash",
  "version": "1"
}

Payment details

Pay to0xa0bfa4f07281c9b248dc3aed2217836bca24869b
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase, Solana
Schemesexact

Is this your API?

Pin it to the top of Onchain Data and the homepage with a featured placement.

Get featured →

More from API Acre & similar services