Authentication/Key Management
Our interfaces require two keys to access, Orderly Key Pair (ed25519
) and Trading Key Pair (secp256k1
). Orderly Access Key Pair is generated by the wallet and more information can be found here and instructions on how to create the keys can be found here. Trading keys can either be retrieved from a GUI or generated on your own.
It is recommended to use function call keys rather than full access keys for safety
Storage Deposit
storage_deposit
Parameters:
Registers an account in the smart contract/Deposit storage fee*
*It cannot be used without any deposit attached
This API creates a NEAR account_id in the Orderly contract or is used to top up storage deposit and is a payable method, thus requires a specified amount of NEAR to be attached when first registering an account. The required amount can be retrieved using storage_balance_bounds
.
If registration_only
=true
only the minimum required NEAR amount to register an account is accepted which can be retrieved using storage_balance_bounds
. This cannot be true if the account already exists.
If the account already exists or the value of registration_only
=false,
it can also be omitted.
Any data stored in the contract, such as setting Access/Trading keys, token balance, etc., requires storage staking as per NEAR architecture
Set Orderly Key
user_announce_key
Parameters:
Setting Access Keys requires a storage deposit
Binds Orderly Access Keys to the smart contract
Set Trading Key
user_request_set_trading_key
Parameters:
Creates and binds a user’s trading key to a user’s Orderly Key
Trading keys are generated using elliptic-curve cryptography and normalized using the following format:
Step 1: Hex the public key
Step 2: Remove ‘04’ if present
Step 3: Hash it using keccak256
Step 4: Covert the result into a hex string
Step 5: Pass base64 of the resulting string
Check if Orderly Key Set
is_orderly_key_announced
Parameters:
Check if Trading Key Set
is_trading_key_set
Parameters:
Remove Access Key
user_request_key_removal
Parameters: