streamLamports
Streams lamports to a receiving address
(async() => {
let stream = await SOLPay.streamLamports("...", 2500, 10 ** 7, 150000); // true
})();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