Solana
Solana (SOL)
Solana can be accessed with the following coin types:
Environment | Coin Type | Faucet |
---|---|---|
Solana Production | sol | |
Solana Testnet | tsol | https://solfaucet.com/ |
Note: Solana Devnet is the primary pre-Mainnet chain for testing by developers and users, whereas Solana Testnet is almost exclusively for validators testing validator client upgrades. For more details on Solana clusters, see their documentation, Solana Clusters.
Generating wallets
1 2 3 4 5 6 7 8 9 10 11
bitgo .coin('tsol') .wallets() .generateWallet({ label: 'My Test Wallet', passphrase: 'secretpassphrase1a5df8380e0e30', }) .then(function (wallet) { // print the new wallet console.dir(wallet); });
1 2 3 4 5 6 7 8
LABEL="My Test Wallet" PASSPHRASE="secretpassphrase1a5df8380e0e30" curl -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d "{ \"label\": \"$LABEL\", \"passphrase\": \"$PASSPHRASE\" }" \ http://$BITGO_EXPRESS_HOST:3080/api/v2/tsol/wallet/generate
You can create wallets with a single line of code using the BitGo SDK.
Creating addresses
1 2 3 4 5 6 7 8 9 10 11
bitgo .coin('tsol') .wallets() .getWallet({ id: '636d0c90b221c80007c69365ca8a3508' }) .then(function (wallet) { return wallet.createAddress(); }) .then(function (newAddress) { // print new address details console.dir(newAddress); });
1 2 3 4 5
WALLET=636d0c90b221c80007c69365ca8a3508 curl -X POST \ -H "Authorization: Bearer $ACCESS_TOKEN" \ https://app.bitgo-test.com/api/v2/tsol/wallet/$WALLET/address
Balances
Solana (SOL) is the native asset of the Solana blockchain. The base unit of Solana is a Lamport (1/1000000000) of 1 SOL coin:
- 1 Lamport is (
10-9
) or 0.000000001 SOL. - 1 Solana is (
109
) or 1000000000 Lamport.
Balances are supported in string and number format but string is recommended to ensure values do not exceed the
programmable number limit: balanceString
, confirmedBalanceString
, and spendableBalanceString
.
Solana accounts have a fee to store data on the blockchain, which is referred to as "rent". In order to prevent accounts from paying rent, a minimum balance of 0.002447136 SOL is retained on Solana wallets to make them rent exempt. The minimum balance must stay on your wallet and cannot be spent.
Fee rate
Solana has a statically set base fee per signature, which is 5000 Lamport or 0.000005 SOL. This results in a fee of 0.000005 SOL for hot wallet transactions, and a fee of 0.00001 SOL for Custody/Cold wallet transactions.
Consolidation
In order to consolidate funds into your root address via SDK, you can use the following:
1 2 3 4 5 6 7 8 9 10 11 12
async function consolidate(walletId) { await bitgo.authenticateWithAccessToken({ accessToken }); const unlock = await bitgo.unlock({ otp: '000000', duration: 3600 }); if (!unlock) { console.log('We did not unlock.'); throw new Error(); } const walletInstance = await bitgo.coin(coin).wallets().get({ id: walletId }); const consolidationTxs = await walletInstance.sendAccountConsolidations({ walletPassphrase: walletPassphrase, }); }
Note: Consolidations for SOL have are limited to 500 addresses per transaction.