Developers

Login wallet

Log in with a wallet signature (EIP-712 `WalletLogin`) instead of an API key.

On this page

URLs on this page: Testnet (chain ID 326). Other code on this page doesn't change: it stays on testnet until you switch it in your code. Tutorials, signing cases and live tools always use testnet.

Sets the same session cookie as API-key login.

SDKConfigure the client with an API key; raw edge login is not a generated client method
HTTPPOST https://edge.testnet.grvt.io/auth/wallet/login (login is served by the edge host, not the trading gateway)
WebSocketnot available (edge is HTTP only)
AuthNone
Signedsignature is a WalletLogin signature. signer must equal address; expiration at most 5 minutes ahead of server time; (address, nonce) is single-use
Contract idedge.wallet_login

Request

Body type EdgeWalletLoginRequest.

  • addressstring (0x address)required#
    Wallet address being logged in.
  • signatureobject Signaturerequired#
    WalletLogin EIP-712 signature by that wallet.
    7 fields of Signature
    • signerstring (uint256)required#
      The address of the wallet that signed (0x + 40 hex characters). That wallet must be allowed to act for the account; for an order, to trade for the sub-account.
    • rstring (uint256)required#
      The signature's r, as 0x + 64 hex characters. Without the 0x the signature fails to verify.
    • sstring (uint256)required#
      The signature's s, as 0x + 64 hex characters. Without the 0x the signature fails to verify.
    • vinteger (uint8)required#
      The signature's v, 27 or 28.
    • expirationstring (int64 unix ns)required#
      When the signature stops being valid, in unix nanoseconds, measured on the exchange's clock. At most 30 days ahead (take-profit and stop-loss orders may be accepted up to 180 days ahead); one already past fails with 2001. On an order it is also the order's lifetime: an order still open then is cancelled with reason EXPIRED. The SDKs use now + 24 hours.
    • nonceinteger (uint32)required#
      A number you choose, 0 to 4,294,967,295 (uint32), so that two otherwise identical requests have different signatures. Use a new random one for each request you sign.

      A transfer whose signed fields (nonce and expiration included) exactly repeat an earlier one is rejected, not ignored: it fails with 4007.

      Orders are different. An exact resend of a signed order can be accepted and rest on the book, but the exchange counts fills per signed order, so all copies together never fill more than the signed size, and a resent IMMEDIATE_OR_CANCEL order whose first copy already filled is rejected. An order signed again (new nonce or expiration) is a new order and can fill in full again.

    • chain_idstring (uint64)required#
      The chain id in the signed EIP-712 domain, as a string. Testnet 326, production 325; "0" means the environment's chain id.

Response

Body type EdgeWalletLoginResponse.

  • funding_account_addressstring (0x address)required#
    Funding (main) account linked to the wallet. Note: the public docs show the API-key response shape here; the code returns only this field.

Errors

Edge errors are not gateway error codes. Body: plain text (httputil.WriteError).

HTTPMeaning
400invalid request body | invalid wallet address | signature expiration exceeds maximum allowed window
401signature expired | invalid signature | signature already used | wallet address not registered | user not found
500Internal Server Error

Example

Example code

The SDK clients use API-key sessions; they do not expose wallet login as a client method. Raw HTTP; the body is the wallet_login signing case (public test key, chain id 326), so it fails with 401 wallet address not registered. In your own body signature.expiration is unix nanoseconds, at most 5 minutes ahead (the signing case uses 2100-01-01 so it never expires):

curl -sS -D - "https://edge.testnet.grvt.io/auth/wallet/login" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "address": "0x1267c6181aee40f5ddbd70c56ecf4613117326b5",
  "signature": {
    "signer": "0x1267c6181aee40f5ddbd70c56ecf4613117326b5",
    "expiration": "4102444800000000000",
    "nonce": 4001,
    "chain_id": "326",
    "r": "0x9fe0e9a937fb9942301dd847d189440131d197099eb50a436f384dcff87163f0",
    "s": "0x6171f0d991013f7d0f057bf105abe1180423267f6dc41e3b733d59ac8c71ec9b",
    "v": 28
  }
}
EOF
Sign the example in your browser
esc

↑ ↓ move↵ open⇧↵ open .mdTry an error code like 2002

Keyboard shortcuts

⌘ K
Search the docs
/
Search
l
Next code language (Python → TypeScript → Go → Rust → curl → WebSocket)
j / k
Next / previous page
t
Light / dark theme
?
This help
Esc
Close dialogs and drawers