Get JWT
Authenticate using signed payload to get a JWT for usage in other endpoints
There are multiple valid headers required to be sent as part of this request.
For onboarding examples, refer to go, java and python code in code-samples.
StarkNet Message Hash and Signature
Inspired by EIP-712, (a standard for hashing and signing typed structured data) the encoding of an off-chain message is defined as:
signed_data = Enc[PREFIX_MESSAGE, domain_separator, account, hash_struct(message)]
where:
- PREFIX_MESSAGE = "StarkNet Message"
- domain_separator is defined as the hash_struct of the StarkNetDomain struct:
- Struct contains: name, chainId and version
- chainId is can be obtained calling GET /system/config
- account is the StarkNet account address
- The message to be hashed is represented as a struct
- hash_struct(message) = Enc[type_hash(MyStruct), Enc[param1], ..., Enc[paramN]]
- where type_hash is defined as in EIP-712 (but using selector instead of keccak)
- More details on StarkNet - Hash Functions
In case of more complex structure of object, you have to work in the spirit of EIP-712. This json structure has 4 mandatory items: types, primaryType, domain and message. These items are designed to be able to be an interface with a wallet. At sign request, the wallet will display:
- message will be displayed at the bottom of the wallet display, showing clearly (not in hex) the message to sign. Its structure has to be in accordance with the type listed in primaryType, defined in types.
- domain will be shown above the message. Its structure has to be in accordance with StarkNetDomain.
The predefined types that you can use :
- felt : for an integer on 251 bits.
- felt* : for an array of felt.
- string : for a shortString of 31 ASCII characters max.
- selector : for a name of a smart contract function.
- merkletree : for a Root of a Merkle tree, calculated with the provided data.
Specification details: Signing transactions and off-chain messages
Message Hash Sample Code
For a complete message_hash example, refer to python code in code-samples.
Examples:
{
"paradex-signature-expiration": 1682364556,
"paradex-starknet-account": "0x129f3dc1b8962d8a87abc692424c78fda963ade0e1cd17bf3d1c26f8d41ee7a",
"paradex-starknet-signature": [
"1381323390094460587764867648394252677239485992175346764030313478865763678671",
"396490140510115262427678549757564216013606350105112805717359873954984880589"
],
"paradex-timestamp": 1681759756
}
Headers
Starknet account
Starknet signature
Timestamp when the signature was created
Timestamp when signature expires (default 30 min | Max 1 week)
Optional flag to authorize all isolated market accounts linked to the main account. When set to true, the returned JWT will grant trading access to all isolated accounts. Defaults to false if not specified
Response
OK
Example response
{
"jwt_token": "eyJhbGciOiJFUzM4NCIsInR5cCI6IkpXVCJ9.eyJ0eXAiOiJhdCtKV1QiLCJleHAiOjE2ODE0NTI5MDcsImlhdCI6MTY4MTQ1MjYwNywiaXNzIjoiUGFyYWRleCBzdGFnaW5nIiwic3ViIjoiMHg0OTVkMmViNTIzNmExMmI4YjRhZDdkMzg0OWNlNmEyMDNjZTIxYzQzZjQ3M2MyNDhkZmQ1Y2U3MGQ5NDU0ZmEifQ.BPihIbGhnnsuPlReqC9x12JFXldpswg5EdA6tTiDQm-_UHaRz_8RfVBqWc2fPN6CzFsXTq7GowZu-2qMxPvZK_fGcxEhTp2k1r8MUxowlUIT4vPu2scCwrsyIujlCAwS"
}Changes
Changed in 8 of the 65 revisions of this API.26417
- ●
added the new
BLOCK_TRADE_REPLAYED_SIGNATUREenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_REPLAYED_SIGNATUREenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
EVM_VAULT_OPERATORS_DISABLEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
EVM_VAULT_OPERATORS_DISABLEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
VAULT_DATA_PRIVATEenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
VAULT_DATA_PRIVATEenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
- ○
removed the
INVALID_RHINOFI_QUOTEenum value from the////response property for the response statusresponse-property-enum-value-removed
- ○
removed the
INVALID_RHINOFI_QUOTEenum value from the////response property for the response statusresponse-property-enum-value-removed
- ○
removed the
INVALID_RHINOFI_QUOTE_COMMITenum value from the////response property for the response statusresponse-property-enum-value-removed
- ○
removed the
INVALID_RHINOFI_QUOTE_COMMITenum value from the////response property for the response statusresponse-property-enum-value-removed
- ○
removed the
INVALID_RHINOFI_REQUESTenum value from the////response property for the response statusresponse-property-enum-value-removed
- ○
removed the
INVALID_RHINOFI_REQUESTenum value from the////response property for the response statusresponse-property-enum-value-removed
- ○
- ●
added the new
IP_NOT_ALLOWEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
IP_NOT_ALLOWEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
MARKET_NOT_SETTLEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
MARKET_NOT_SETTLEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
- ●
added the new
BLOCK_TRADE_INVALID_SIGNATUREenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_INVALID_SIGNATUREenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_SIGNER_KEY_UNAUTHORIZEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_SIGNER_KEY_UNAUTHORIZEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
- ●
added the new
EVM_ADDRESS_ALREADY_ONBOARDEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
EVM_ADDRESS_ALREADY_ONBOARDEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
INSUFFICIENT_EVM_BALANCEenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
INSUFFICIENT_EVM_BALANCEenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
PORTFOLIO_MARGIN_INVALID_ACCOUNT_KINDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
PORTFOLIO_MARGIN_INVALID_ACCOUNT_KINDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
PORTFOLIO_MARGIN_ONBOARDING_DISABLEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
PORTFOLIO_MARGIN_ONBOARDING_DISABLEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
- ○
removed the
BAD_STARKNET_REQUESTenum value from the////response property for the response statusresponse-property-enum-value-removed
- ○
removed the
BAD_STARKNET_REQUESTenum value from the////response property for the response statusresponse-property-enum-value-removed
- ○
removed the
INVALID_PRICE_PRECISIONenum value from the////response property for the response statusresponse-property-enum-value-removed
- ○
removed the
INVALID_PRICE_PRECISIONenum value from the////response property for the response statusresponse-property-enum-value-removed
- ○
removed the
TRANSACTION_NOT_FOUNDenum value from the////response property for the response statusresponse-property-enum-value-removed
- ○
removed the
TRANSACTION_NOT_FOUNDenum value from the////response property for the response statusresponse-property-enum-value-removed
- ○
- ▲
the
response's property type changed fromobjectto no type for statusresponse-property-type-changed
- ▲
the
response's property type changed fromobjectto no type for statusresponse-property-type-changed
- ●
added the new
BLOCK_TRADE_ACCOUNT_MISMATCHenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_ACCOUNT_MISMATCHenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_ALREADY_CANCELLEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_ALREADY_CANCELLEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_EXPIREDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_EXPIREDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_INVALID_STATUSenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_INVALID_STATUSenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_MISSING_SIGNATUREenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_MISSING_SIGNATUREenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_MISSING_SIGNERSenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_MISSING_SIGNERSenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_MISSING_TRADESenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_MISSING_TRADESenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_NOT_ENABLEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_NOT_ENABLEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_NOT_FOUNDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_NOT_FOUNDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_UNAUTHORIZEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
BLOCK_TRADE_UNAUTHORIZEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
EVM_SIGNATURE_VERIFICATION_FAILEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
EVM_SIGNATURE_VERIFICATION_FAILEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
INVALID_EVM_SIGNATUREenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
INVALID_EVM_SIGNATUREenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
MEDIA_NOT_FOUNDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
MEDIA_NOT_FOUNDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
OFFER_ALREADY_CANCELLEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
OFFER_ALREADY_CANCELLEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
OFFER_INVALID_STATUSenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
OFFER_INVALID_STATUSenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
OFFER_PARENT_MISMATCHenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
OFFER_PARENT_MISMATCHenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
OFFER_PARENT_NOT_ACCEPTINGenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
OFFER_PARENT_NOT_ACCEPTINGenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
OFFER_UNAUTHORIZEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
OFFER_UNAUTHORIZEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
PORTFOLIO_MARGIN_CONFIG_NOT_FOUNDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
PORTFOLIO_MARGIN_CONFIG_NOT_FOUNDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
SUBKEY_NOT_ACTIVATABLEenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
SUBKEY_NOT_ACTIVATABLEenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
XP_TRANSFERS_DISABLEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ●
added the new
XP_TRANSFERS_DISABLEDenum value to the////response property for the response statusresponse-property-enum-value-added
- ○
removed the
INVALID_JOIN_WAITLIST_REQUESTenum value from the////response property for the response statusresponse-property-enum-value-removed
- ○
removed the
INVALID_JOIN_WAITLIST_REQUESTenum value from the////response property for the response statusresponse-property-enum-value-removed
- ▲
- ○
added the media type
application/jsonfor the response with the statusresponse-media-type-added
- ○
added the media type
application/jsonfor the response with the statusresponse-media-type-added
- ○
added the media type
application/jsonfor the response with the statusresponse-media-type-added
This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○