Users

Users

Get Stark keys for registered user

  • Typescript Core SDK

📚SDK REFERENCE

  • getUser

Request

Get Stark keys for user with the address 0x5D680Fbb3e60deCAbF62DfcACc56DB7d5964736a:

const getUserStarkKeys = async (ethAddress: string) => {
  const response = await client.getUser(ethAddress);
  return response;
};
getUserStarkKeys('0x5D680Fbb3e60deCAbF62DfcACc56DB7d5964736a')
  .then((result) => {
    console.log(result);
  })
  .catch((e) => {
    console.log(e);
  });

Example response

{
  // List of Stark keys
  accounts: [
    '0xd361e623760332811d06a976ceab515f3591b128f6ee15901991b69c9003b7',
  ];
}
  • Kotlin (JVM) Core SDK

📚SDK REFERENCE

  • getUsers

  • Swift Core SDK

📚SDK REFERENCE

  • getUsers

  • Golang Core SDK

📚SDK REFERENCE

  • GetUsers

  • C# Core SDK

📚SDK REFERENCE

  • GetUsers

Get user balances

  • Typescript Core SDK

📚SDK REFERENCE

  • listBalances

Request

Get list of tokens owned by the user with address 0x5D680Fbb3e60deCAbF62DfcACc56DB7d5964736a:

const getListBalances = async (owner: string) => {
  const response = await client.listBalances({
    owner,
  });
  return response;
};
getListBalances('0x5D680Fbb3e60deCAbF62DfcACc56DB7d5964736a')
  .then((result) => {
    console.log(result);
  })
  .catch((e) => {
    console.log(e);
  });

Example response

{
  result: [
    {
      token_address: '', // Address of the contract that represents this ERC20 token or empty for ETH
      symbol: 'ETH', // Symbol of the token
      balance: '100000000000000000', // Amount which is currently inside the exchange
      preparing_withdrawal: '0', // Amount which is currently preparing withdrawal from the exchange
      withdrawable: '0' // Amount which is currently withdrawable from the exchange
    }
  ],
  cursor: 'eyJfIjoiIiwic3ltYm9sIjoiRVRIIiwiY29udHJhY3RfYWRkcmVzcyI6IiIsImlteCI6IjEwMDAwMDAwMDAwMDAwMDAwMCIsInByZXBhcmluZ193aXRoZHJhd2FsIjoiMCIsIndpdGhkcmF3YWJsZSI6IjAifQ'
}

  • Kotlin (JVM) Core SDK

📚SDK REFERENCE

  • listBalances

  • Swift Core SDK

📚SDK REFERENCE

  • listBalances

  • Golang Core SDK

📚SDK REFERENCE

  • ListBalances

  • C# Core SDK

📚SDK REFERENCE

  • ListBalances

Get specific balance for user

  • Typescript Core SDK

📚SDK REFERENCE

  • getBalance

Request

Get the balance of the token 0x1facdd0165489f373255a90304650e15481b2c85 owned by the user with address 0x1facdd0165489f373255a90304650e15481b2c85:

const getBalanceToken = async (owner: string, address: string) => {
  const response = await client.getBalance({
    owner,
    address,
  });
  return response;
};
getBalanceToken(
  '0x5D680Fbb3e60deCAbF62DfcACc56DB7d5964736a',
  '0x1facdd0165489f373255a90304650e15481b2c85'
)
  .then((result) => {
    console.log(result);
  })
  .catch((e) => {
    console.log(e);
  });

Example response

  {
      token_address: '0x1facdd0165489f373255a90304650e15481b2c85', // Address of the contract that represents this ERC20 token or empty for ETH
      symbol: 'IMX', // Symbol of the token
      balance: '100000000000000000', // Amount which is currently inside the exchange
      preparing_withdrawal: '0', // Amount which is currently preparing withdrawal from the exchange
      withdrawable: '0' // Amount which is currently withdrawable from the exchange
  }

  • Kotlin (JVM) Core SDK

📚SDK REFERENCE

  • getBalance

  • Swift Core SDK

📚SDK REFERENCE

  • getBalance

  • Golang Core SDK

📚SDK REFERENCE

  • GetBalance

  • C# Core SDK

📚SDK REFERENCE

  • GetBalance

Last updated