---
title: "Login wallet"
description: "Log in with a wallet signature (EIP-712 `WalletLogin`) instead of an API key."
---

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://edge.<domain>/auth/wallet/login` (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`](../signing/WalletLogin.md) 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`.

- `address` · string (0x address) · required — Wallet address being logged in.
- `signature` · object Signature · required — WalletLogin EIP-712 signature by that wallet.
- `signature.signer` · string (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.
- `signature.r` · string (uint256) · required — The signature's `r`, as `0x` + 64 hex characters. Without the `0x` the signature fails to verify.
- `signature.s` · string (uint256) · required — The signature's `s`, as `0x` + 64 hex characters. Without the `0x` the signature fails to verify.
- `signature.v` · integer (uint8) · required — The signature's `v`, 27 or 28.
- `signature.expiration` · string (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.
- `signature.nonce` · integer (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.
- `signature.chain_id` · string (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_address` · string (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).

| 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

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):

```sh
curl -sS -D - "https://edge.$GRVT_DOMAIN/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
```
