streamLamports
Streams lamports to a receiving address
Warning:
The SOL Pay Stream Wallet should not be considered as a permanent wallet. While the Stream Wallet can theoretically hold funds even after the main application has been closed, there is no guarantee that the Stream Wallet will be able to hold funds over a long period of time, especially across browser restarts or crashes. It is highly recommended that applications prompt users to back up their Stream Wallet using the backupStreamWallet method and restore their Stream Wallet at solpay.solblaze.org/stream-wallet.
Parameters:
address: string - the address to send the streamed lamports
lamportsPerSecond: number - the number of lamports to stream per second (accumulates in a pending balance)
refillLamports (optional, default:
10000000
): number - the number of lamports to request for refills to the Stream WalletthresholdLamports (optional, default:
100000
): number - the minimum number of lamports required to transfer the pending lamports to the receiving address
Returns:
string (...
) - the stream identifier (which can be used in the other stream methods)
Throws:
SOL Pay SDK Fatal Error: No connection found. Use SOLPay.connectNetwork() to connect to the Solana network.
- could not find a connection to the Solana networkSOL Pay SDK Fatal Error: No wallet connection found. Use SOLPay.connectWallet() to connect to a Solana wallet.
- no wallet was connectedSOL Pay SDK Fatal Error: Connection did not respond. Use SOLPay.connectNetwork() to connect to the Solana network.
- did not receive response from Solana networkUncaught SOL Pay SDK Fatal Error: User rejected the stream request.
- did not receive approval from the user to start the streamSOL Pay SDK Fatal Error: Invalid address ${address}.
- an invalid address was usedSOL Pay SDK Fatal Error: Invalid lamports per second ${lamportsPerSecond}.
- an invalid lamports per second value was usedSOL Pay SDK Fatal Error: Invalid refill lamports ${refillLamports}.
- an invalid refill lamports value was usedSOL Pay SDK Fatal Error: Invalid threshold lamports ${thresholdLamports}.
- an invalid threshold lamports value was used
Last updated