Documentation can be found here

Storage

Path: <Asset Manager Contract Client Instance>.storage.<method (described above)>

Orderly asset manager contract implements NEP-145 protocol, which has the following methods:

Storage Deposit

Method to deposit NEAR into storage from the account

  await contract.storage.deposit(100000)
Parameter nameTypeIs required?Description
amountnumberYesAmount of NEAR to add to storage deposit

Storage Withdraw

Method to withdraw NEAR from storage into the account

  await contract.storage.withdraw(100000)
Parameter nameTypeIs required?Description
amountnumberNoAmount of NEAR to withdraw from storage into account; can be ommited, then whole available deposit will be returned into account

Storage Balance

Method to get current storage balance

  await contract.storage.balance()

Parameters: None

Storage Unregister

Unregisters a user from the contract, withdraws available deposit, and removes all keys

  await contract.storage.unregister()
Parameter nameTypeIs required?Description
forcebooleanNoIf true will ignore account balances (burn them) and close the account; if false (or omitted) and caller has a positive registered balance it will throw an error

Other methods

Path: <Asset Manager Contract Client Instance>.<method (described above)>

Deposit NEAR

This method is used to deposit NEAR to your account

  await contract.depositNEAR(amount)
Parameter nameTypeIs required?Description
amountnumberYesHow much NEAR to deposit

Withdraw

This method is used to withdraw tokens from your account in the contract

  await contract.withdraw({token: 'usdc.orderly.testnet', amount: 50000000})
Parameter nameTypeIs required?Description
tokenstringYesToken to withdraw from account
amountnumberYesHow much tokens to withdraw

Check if a Token is Listed

This method is used to check if a token is whitelisted on the contract

  await contract.isTokenListed('usdc.orderly.testnet')
Parameter nameTypeIs required?Description
tokenstringYesToken to check

Check if a Pair is Listed

This method is used to check if the symbol pair is whitelisted on the contract

  await contract.isSymbolPairListed('SPOT_NEAR_USDC')
Parameter nameTypeIs required?Description
pairstringYesSymbol pair to check

Get Supported Tokens

This method is used to get all whitelisted tokens on the contract

  await contract.getPossibleTokens()

Account Balance

This method is used to check the account token balance

  await contract.getUserTokenBalance('user.near')
Parameter nameTypeIs required?Description
userstringNoWallet address. If empty then will return balance of connected user