DocsDeposit

DocsGuides15 of 33 · 2 min read

Deposit

Move public SOL from your wallet into your private balance.

A deposit takes SOL from your wallet and creates a note that your balance key owns. The deposit is a public transaction: the wallet and the amount are visible.

You need to be unlocked, with SOL in the wallet for the amount and the network fee. A deposit carries no Liora fee.

App

On /app, under Move funds, choose Deposit. Enter an amount in SOL and press Deposit. Approve the transaction in your wallet.

The row under the form follows the transfer until it is confirmed. The balance at the top updates after the next scan, which the app runs by itself.

SDK

ts
const result = await liora.deposit(
  { assetId: "1", amountLamports: "2000000000" },
  (state) => render(state),
);

The wallet needs a signTransaction. The call reports pending, sent and then confirmed or failed, and resolves to the last of them.

buildDeposit(amount) returns the unsigned transaction without sending it, for a wallet flow of your own.

CLI

bash
liora deposit 2000000000 --keypair payer.json
state  confirmed
kind  deposit
signature  3ie4yhgXrpBv7L6xyEUoJZkxhddrtfPGQdNZ1LxDT7fTfjhWnkTUrQzpX31VE58o2PGYQxJ6cNLTMhGyZeZBcj1W
bash
liora balance --keypair payer.json
assetId  1
decimals  9
symbol  SOL
amountLamports  2000000000

#What the chain shows

PublicHidden
The depositing walletWho you pay from the balance
The amountHow much each payment is
The balance key the note went toWhat remains in the balance

A payment or withdrawal names the owner address of each note it spends, so a reader can see that a balance funded by this deposit made a transfer. The recipient and the amount of that transfer stay hidden.

The program records the deposit in a DepositRecorded event. Your device finds its own deposits by looking for its balance keys in those events.

#If it fails

What you seeWhyNext
WALLET_REJECTEDThe transaction was declined in the walletDeposit again and approve
VALIDATION_ERRORThe amount is zero or not a whole number of lamportsCorrect the amount
CONFIRMATION_FAILEDThe transaction failed on chain, most often for lack of SOLNothing was deposited. Fund the wallet and deposit again
A balance that does not rise yetThe scan has not reached the deposit's slotWait a moment and read the balance again