Login wallet
Log in with a wallet signature (EIP-712 `WalletLogin`) instead of an API key.
On this page
Write a small program that calls `auth.login_wallet` on Grvt {environment} {using}.
Target environment: {environment} (chain ID {chainId}). Recorded signing cases keep their original environment.
{executionGuidance}
Read this first: {origin}/bundle/reference/rpc/login_wallet.md (~54 KB, plain Markdown: this page plus the AGENTS.md rules, Authentication and sessions, Signing, WalletLogin (signed message), Python SDK, Environments).
Fetch other pages from the index at {origin}/llms.txt only as you need them. {origin}/downloads/contract.json is a machine-readable contract for tools, not for reading.
Rules: follow AGENTS.md; do not send requests without the user asking you to; read credentials from environment variables; never retry writes automatically; show me the code and how to run it. 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.
| SDK | Configure the client with an API key; raw edge login is not a generated client method |
|---|---|
| HTTP | POST https:/ (login is served by the edge host, not the trading gateway) |
| WebSocket | not available (edge is HTTP only) |
| Auth | None |
| Signed | signature is a WalletLogin signature. signer must equal address; expiration at most 5 minutes ahead of server time; (address, nonce) is single-use |
| Contract id | edge.wallet_login |
Request
Body type EdgeWalletLoginRequest.
- Wallet address being logged in.
- WalletLogin EIP-712 signature by that wallet.
7 fields of
Signature- 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. - The signature's
r, as0x+ 64 hex characters. Without the0xthe signature fails to verify. - The signature's
s, as0x+ 64 hex characters. Without the0xthe signature fails to verify. - The signature's
v, 27 or 28. - 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 reasonEXPIRED. The SDKs use now + 24 hours. - 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_CANCELorder 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. - 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 (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).
| HTTP | Meaning |
|---|---|
| 400 | invalid request body | invalid wallet address | signature expiration exceeds maximum allowed window |
| 401 | signature expired | invalid signature | signature already used | wallet address not registered | user not found |
| 500 | Internal 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