HyperPlay API Docs
  • đŸŸŖHyperPlay
  • 🎮Overview
  • âŦ‡ī¸Install HyperPlay
  • ❓FAQ
  • Developer Docs
    • 📜Publish / List a Game
      • âš’ī¸Building with HyperPlay
      • 📃Publishing Your Game
      • đŸ›ŗī¸CI/CD Automation
      • đŸ–Ĩī¸Developer Portal
      • 📛HyperPlay Store Badges
      • 🎨HyperPlay Hex Codes
      • 🆘Feedback & Developer Support
      • 🩹[Beta] Patching
    • âŒ¨ī¸Design Considerations
      • Unreal Engine Integration
      • Unity Integration
    • đŸ•šī¸API for Native Games (EVM)
      • Get Accounts
      • Sign-in With Ethereum
      • Get Balance
      • Call Contract Example
      • Send Transaction
      • Send Contract
      • Personal Sign
      • Sign Typed Data v3
      • Sign Typed Data v4
      • Add or Switch Network
      • Add Token
      • RPC Raw
    • 🎱API for Native Games (Non-EVM)
      • Sui Blockchain
        • Get Accounts
        • Get Balance
        • Get Object
        • Send Transaction
        • Send Contract
        • Personal Sign
    • 🌐API for Browser Games (EVM)
    • 🚀Quests
      • How to Create a Quest
    • đŸĒStore APIs
      • Listings by Popularity
    • 🍷Compatibility Layer
      • Benefits of using a Compatibility Layer
      • Downsides and Limitations of the Compatibility Layer
      • FAQ
  • 🔑Access Configs
    • How to create Access Codes
    • How to token gate a Release Branch
Powered by GitBook
On this page
  1. Developer Docs
  2. API for Native Games (EVM)

Sign Typed Data v4

PreviousSign Typed Data v3NextAdd or Switch Network

Last updated 10 months ago

Request

Ask the user to sign typed data

Learn more:

Replace 0x638105aa1b69406560f6428aeface3db9da83c64 with the connected wallet address. The connected wallet address can be requested from Get Accounts.

curl --location --request POST 'localhost:9680/rpc' \
--header 'Content-Type: application/json' \
--data-raw '{
  "request": {
    "method": "eth_signTypedData_v4",
    "params": [
      "0x638105aa1b69406560f6428aeface3db9da83c64",
      "{\"domain\":{\"chainId\":1,\"name\":\"Ether Mail\",\"verifyingContract\":\"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC\",\"version\":\"1\"},\"message\":{\"contents\":\"Hello, Bob!\",\"attachedMoneyInEth\":4.2,\"from\":{\"name\":\"Cow\",\"wallets\":[\"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826\",\"0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF\"]},\"to\":[{\"name\":\"Bob\",\"wallets\":[\"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB\", \"0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57\",\"0xB0B0b0b0b0b0B000000000000000000000000000\"]}]},\"primaryType\":\"Mail\",\"types\":{\"EIP712Domain\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"version\",\"type\":\"string\"},{\"name\":\"chainId\",\"type\":\"uint256\"},{\"name\":\"verifyingContract\",\"type\":\"address\"}],\"Group\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"members\",\"type\":\"Person[]\"}],\"Mail\":[{\"name\":\"from\",\"type\":\"Person\"},{\"name\":\"to\",\"type\":\"Person[]\"},{\"name\":\"contents\",\"type\":\"string\"}],\"Person\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"wallets\",\"type\":\"address[]\"}]}}"
    ]
  },
  "chain": {
    "chainId": "1"
  }
}
'
đŸ•šī¸
https://docs.metamask.io/wallet/how-to/sign-data/#use-eth_signtypeddata_v4