Wallet

All the available functionality related to an account.

Get Balance

Returns the chain's native balance for the wallet address. For Solana, will return in SOL etc.

Query Params

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • wallet: Wallet address

GET /sol/v1/wallet/balance

var myHeaders = new Headers();
myHeaders.append("x-api-key", "YOUR_API_KEY");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/wallet/balance?network=devnet&wallet=97a3giHcGsk8YoEgWv4rP1ooWwJBgS72fpckZM6mQiFH", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Send Sol

Transfer SOL from one wallet to another

BODY (raw)

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • from_address: Wallet address of the sender

  • to_address: Wallet address of the receiver

  • amount: How much to send

POST /sol/v1/wallet/send_sol

var myHeaders = new Headers();
myHeaders.append("x-api-key", "-3iYNcRok7Gm4EMl");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "network": "devnet",
  "from_address": "BFefyp7jNF5Xq2A4JDLLFFGpxLq5oPEFKBAQ46KJHW2R",
  "to_address": "2fmz8SuNVyxEP6QwKQs6LNaT2ATszySPEJdhUDesxktc",
  "amount": 1.2
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/wallet/send_sol", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Get Token Balance

Get the balance of a particular token in a wallet (Supports Token 2022 token info 🆕)

Query Params

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • wallet: Wallet address

  • token: Fungible token address

GET /sol/v1/wallet/token_balance

var myHeaders = new Headers();
myHeaders.append("x-api-key", "-3iYNcRok7Gm4EMl");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/wallet/token_balance?network=mainnet-beta&wallet=BNZPZfmuoWFjvnPRasn6oxWF326Mq2jXv6JpY2AdcqbU&token=FLUXBmPhT3Fd1EDVFdg46YREqHBeNypn1h4EbnTzWERX", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Get All Tokens Balance

This API gets the balance of all the tokens in your wallet (Supports Token 2022 token info 🆕)

Query Params

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • wallet: Wallet address

GET /sol/v1/wallet/all_tokens

var myHeaders = new Headers();
myHeaders.append("x-api-key", "YOUR_API_KEY");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/wallet/all_tokens?network=mainnet-beta&wallet=BNZPZfmuoWFjvnPRasn6oxWF326Mq2jXv6JpY2AdcqbU", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

You can further call Tokens Get Info API to fetch detailed info of required addresses.

Get Portfolio

This request gets all the token details (fungible and non-fungible) from a wallet. (Supports Token 2022 token info 🆕)

Query Params

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • wallet: Wallet address

GET /sol/v1/wallet/get_portfolio

var myHeaders = new Headers();
myHeaders.append("x-api-key", "-3iYNcRok7Gm4EMl");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/wallet/get_portfolio?network=devnet&wallet=BvzKvn6nUUAYtKu2pH3h5SbUkUNcRPQawg4bURBiojJx", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Get All Domains

This API gets all the .sol domain addresses associated with a wallet.

Query Params

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • wallet: Wallet address

GET /sol/v1/wallet/get_domains

var myHeaders = new Headers();
myHeaders.append("x-api-key", "-3iYNcRok7Gm4EMl");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/wallet/get_domains?network=mainnet-beta&wallet=9hqqMGMfG44L2R1a1osDgQRWKYt4YuegfUB6rUSaXrv8", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Resolve Address

Resolves the given name account to the associated .sol domain address.

Query Params

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • wallet: Wallet address

GET /sol/v1/wallet/resolve_address

var myHeaders = new Headers();
myHeaders.append("x-api-key", "-3iYNcRok7Gm4EMl");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/wallet/resolve_address?network=mainnet-beta&address=CK9rDU7Bk9SV5SEmRUakMjN87fpqTTSWq2ieojTmXJoL", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Get Transaction History (deprecated)

Get the transaction history of your wallet

Deprecated! Use Transaction History endpoint instead.

GET /sol/v1/wallet/transaction_history

Query Params:

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • wallet: Wallet address

  • tx_num: (optional) How many transactions (maximum 10 transactions at a time) do you want to fetch

  • before_tx_signature: (optional) Tx signature before which X number of transactions will be fetched, in reverse order going back in time

var myHeaders = new Headers();
myHeaders.append("x-api-key", "-3iYNcRok7Gm4EMl");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/wallet/transaction_history?network=devnet&wallet=2fmz8SuNVyxEP6QwKQs6LNaT2ATszySPEJdhUDesxktc&tx_num=2&before_tx_signature=4pbfE4HtYjYyTrPN4pAZ68oXw2XxAUeVTedMvRnEn6qNwSj2RLUWUmjoVaUEbcJuLyBYvC1Za1npyhN1zFD8RXC", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Get Transaction Details (deprecated)

Get particular transaction details from the transaction signature

Deprecated! Use Transaction Details endpoint instead.

GET /sol/v1/wallet/transaction

Query Params:

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • txn_signature: Transaction signature

const myHeaders = new Headers();
myHeaders.append("x-api-key", "QEbMrBRQEP92ToRo");

const requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("http://localhost:4000/sol/v1/wallet/transaction?network=devnet&txn_signature=fQ7tkCegzKYUGxDgrcCSiBkgebBzJsE3jWuc8aUXQdJztoUgL6EGvVQG2oPbMexAvAF2zyPxo3yTbqmAuefHLbc", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Create Semi Custodial Wallet

A type of wallet where Shyft holds half of your private keys while the other half is with the client or the end user.

POST /sol/v1/wallet/create_semi_wallet

We create a standard Solana wallet using keypair.generate(). The private key is then encrypted with the provided password and random encryption parameters. In order to decrypt the key, we need the same password and the same encryption parameters.

So, password and encryption parameters act as 2 keys to unlock your wallet.

Shyft never ever stores or logs your password at any time. This can be confirmed with our open source code.

const myHeaders = new Headers();
myHeaders.append("x-api-key", "QEbMrBRQEP92ToRo");
myHeaders.append("Content-Type", "application/json");

const raw = JSON.stringify({
  "password": "Ishkaran"
});

const requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/wallet/create_semi_wallet/", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Decrypt Semi Custodial Wallet

Decrypt a semi-custodial wallet and get an encrypted private key and decryption key.

You can only get decryption data for semi-custodial wallets created by you.

GET /sol/v1/wallet/decrypt_semi_wallet

const myHeaders = new Headers();
myHeaders.append("x-api-key", "QEbMrBRQEP92ToRo");
myHeaders.append("Content-Type", "application/json");

const raw = JSON.stringify({
  "wallet": "VtkQHQt6GFggoNiWT7Tvafce6cJvCZbzEU8gBTez5rz",
  "password": "Ishkaran"
});

const requestOptions = {
  method: 'GET',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/wallet/decrypt_semi_wallet", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Get Collections In Wallet

For all the NFTs in a wallet, this endpoint returns a list of collections and NFTs under those collections.

GET /sol/v1/wallet/collections

Query Params:

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • wallet_address: Wallet address

var myHeaders = new Headers();
myHeaders.append("x-api-key", "QEbMrBRQEP92ToRo");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/wallet/collections?network=mainnet-beta&wallet_address=5wwb8L8FQyH3MRfQa6GpcP6xNt3XQqSC1wHiVTiLhQA6", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Get Stake Accounts

Get staking accounts of the given wallet.

Stake accounts on Solana can be used to assign tokens to validators on the network to potentially earn rewards for the owner of the stake account. Stake accounts are created and managed differently than traditional wallet addresses, known as system accounts. The system account is only able to send and receive SOL from other accounts on the network, while the stake account supports the more complex operations required to manage the delegation of tokens.

GET /sol/v1/wallet/stake_accounts

Query Params:

  • network: Solana blockchain environment (testnet/devnet/mainnet-beta)

  • wallet_address: Wallet address

  • page: (optional) The page number to get the results for a particular page. If no page number is specified, the page is 1

  • size: (optional) The number of results to be returned for each page. The default number is 10 and a maximum of 10 is allowed.

var myHeaders = new Headers();
myHeaders.append("x-api-key", "QEbMrBRQEP92ToRo");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.shyft.to/sol/v1/wallet/stake_accounts?network=devnet&wallet_address=3YNyqvs6aGGtgtRKQ27ysP6GK5vVJ37vq86JWqyfyLD2&page=4&size=5", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Last updated