Session Keys

private/set_session_key_debug

Takes the same params as private/set_session_key and rebuilds the session-key Action without executing anything, returning the EIP-712 encoded_data, encoded_data_hashed, action_hash, typed_data_hash, domain_separator, action_typehash, module, owner and expected_signer, plus the decoded session key, expiry, protocol scopes and subaccounts. Byte-compare these against your local computation to find why a signature is rejected. Requires a logged-in session.

post/private/set_session_key_debug

Request

  • Base URL: https://api.derive.xyz/v3
  • URL: https://api.derive.xyz/v3/private/set_session_key_debug
  • Auth: none declared

Request body

expiry_secinteger required
ip_whiteliststring[] nullable
labelstring nullable
noncestring required
offchain_scopesstring[] required

Off-chain scopes which are validated in backend only

protocol_scopesstring[] required

Scopes granted to the session key, validated by the protocol. Each is a string like "trade:orderbook:all".

public_session_keystring required

Session key address being authorized.

signaturestring required

0x-prefixed hex, 65-byte r||s||v.

signature_expiry_secinteger required
signerstring required
subaccount_idsinteger[] nullable
walletstring required

Wallet the session key is being registered for.

Response

Success

action_hashstring required

EIP-712 struct hash of the Action: keccak256(abi.encode(action_typehash, …, encoded_data_hashed, …)).

action_typehashstring required

ACTION_TYPEHASH — keccak of the Action struct type string; invariant across deployments.

domain_separatorstring required

EIP-712 domain separator of the Matching contract for this deployment.

encoded_datastring required

ABI-encoded, module-specific action payload (the data bytes), 0x-hex.

encoded_data_hashedstring required

keccak256(encoded_data) — the value packed into the struct hash.

expected_signerstring required

The signer the signature is checked against.

modulestring required

Per-action module contract address bound into the signed struct.

ownerstring required

Wallet that owns the subaccount the action applies to.

recovered_signerstring nullable

null on the debug routes (no signature is checked there); on a signature-mismatch error this is the address actually recovered.

typed_data_hashstring required

Final EIP-712 digest the client signs: keccak256(0x1901 || domain_separator || action_hash).

Changes

No recorded changes to this operation across all 1 revision of this API.