Readonly
publicStream public key.
Readonly
isIf true, the stream is prepaid - all the required amount needs to be deposited on creation. Prepaid streams cannot have unlimited lifetime.
Readonly
mintSPL token mint address.
Readonly
senderSender address.
Readonly
recipientRecipient address.
Readonly
createdTime at which the stream was created.
Readonly
startsStart time of the stream.
INVARIANT: >= createdAt
Readonly
endsEnd time of the stream. If the stream is unbounded, this can be 0 to indicate no end time.
INVARIANT: prepaid: >= startsAt INVARIANT: unbounded: == 0 || >= startsAt
Readonly
initialAmount available to the recipient once stream starts.
Readonly
flowFlow interval is the interval in which flow payments are released.
Readonly
flowFlow rate is the number of tokens to stream per interval.
Readonly
isIf true, the stream has been cancelled.
Readonly
isIf true, the stream has been cancelled before start.
INVARIANT: !isCancelled => == false
Readonly
isIf true, the stream has been cancelled by the sender.
INVARIANT: !isCancelled || !senderCanCancel => == false
Readonly
cancelledTime at which the stream was cancelled. If it is > 0, it means the stream has been cancelled and any funds in the escrow account not available to be withdrawn by the recipient have been retrieved.
INVARIANT: cancelledAt > 0 iff isCancelled == true
Readonly
senderTrue if a solvent stream can be cancelled by the sender.
Readonly
senderTime at which the sender is allowed to cancel a solvent stream.
Readonly
senderTrue if the sender can change the sender of the stream who will do the upcoming topups.
INVARIANT: prepaid: false
Readonly
senderTime at which the sender is allowed to change the sender.
INVARIANT: prepaid: == 0
Readonly
isIf true, the stream is paused.
INVARIANT: prepaid: == false
Readonly
isIf true, the stream is paused by sender.
INVARIANT: prepaid: == false INVARIANT: runtime: unbounded: !isPaused || !senderCanPause => == false
Readonly
senderTrue if a stream can be paused by the sender.
INVARIANT: prepaid: false
Readonly
senderTime at which the sender is allowed to pause a stream.
INVARIANT: prepaid: == 0
Readonly
recipientTrue if a stream can be resumed by the recipient if it was paused by the sender.
INVARIANT: prepaid: false
Readonly
recipientTime at which the recipient is allowed to resume a stream which was paused by the sender.
INVARIANT: prepaid: == 0
Readonly
anyoneTrue if anyone can withdraw on behalf of the recipient. The amount will go in recipients' account.
Readonly
anyoneTime at which anyone can withdraw on behalf of the recipient.
Readonly
lastTime at which the stream was last resumed.
INVARIANT: prepaid: == 0 INVARIANT: unbounded: (== 0 || >= startsAt) && (endsAt == 0 || < endsAt)
Readonly
accumulatedTotal accumulated active (!isPaused) time since startsAt. This does not include (currentTime - lastResumedAt) time if the stream is not paused.
INVARIANT: prepaid: == 0 INVARIANT: unbounded: == 0 || (currentTime > startsAt && == currentTime - startsAt - totalPausedTime)
Readonly
totalTotal amount withdrawn by the recipient.
INVARIANT: runtime: prepaid: <= amountOwed && <= prepaidAmountNeeded INVARIANT: runtime: unbounded: <= amountOwed && <= totalTopupAmount
Readonly
lastLast time at which recipient withdrew any amount.
Readonly
lastLast amount which recipient withdrew.
Readonly
totalTotal topup amount added for the stream.
INVARIANT: prepaid: == totalPrepaidAmount INVARIANT: unbounded: >= initialAmount + streamingAmountOwed
Readonly
lastLast time at which sender topped up the stream.
Readonly
lastLast topup amount.
Readonly
depositTotal deposit amount needed for the non-prepaid stream. These are needed in case the sender does not topup the stream in time and the amount owed becomes > total topup amount. When that happens, anyone can cancel the stream. The deposit amount will be distributed as a reward to whoever finds the insolvency and cancels the stream.
INVARIANT: prepaid: == 0 INVARIANT: unbounded: == DEPOSIT_AMOUNT_PERIOD_IN_SECS of streaming payments
Readonly
seedSeed of the stream PDA. It's upto the client how they choose the seed. Each tuple (seed, mint, name) corresponds to a unique stream.
Readonly
bumpThe PDA bump.
Readonly
nameName of the stream. Should be unique for a particular set of (seed, mint).
INVARIANT: Length <= 100 unicode chars or 400 bytes
Static
compareReadonly
getReadonly
mustReadonly
getReadonly
refreshReadonly
isReadonly
isReadonly
hasReadonly
getReadonly
hasReadonly
getGet the status of the stream at the given on-chain time.
The on-chain time
The status of the stream
Readonly
getGet the payment status of the stream at the given on-chain time.
The on-chain time
The payment status of the stream
Readonly
getGet the maximum acceptable topup amount at the given on-chain time.
The on-chain time
The maximum acceptable topup amount. If there is no maximum, the noLimit property is true
Readonly
getGet the total amount owed to the recipient at the given on-chain time. This includes any amount the recipient has already withdrawn. That need be subtracted to get the amount the recipient is eligible to withdraw. See totalWithdrawnAmount for more details.
The on-chain time
The total amount owed to the recipient at the given on-chain time
Readonly
getReadonly
isReadonly
validateValidate if the stream can be cancelled at the given on-chain time.
Conditions when validation fails:
The on-chain time
An error is thrown if the stream cannot be cancelled
Readonly
cancelReadonly
validateValidate if the stream can be withdrawn from for excess sender topup at the given on-chain time.
Conditions when validation fails:
The on-chain time
An error is thrown if the stream cannot be withdrawn from for excess sender topup
Readonly
withdrawWithdraw excess sender topup from the non-prepaid stream and validate at the given on-chain time.
The on-chain time
An error is thrown if the stream cannot be withdrawn from for excess sender topup or a user wallet wasn't provided to the Superstream client or there is a Solana RPC issue
Readonly
validateValidate if the non-prepaid stream can be topped up at the given on-chain time.
Conditions when validation fails:
The on-chain time
Optional
topupAmount: BNThe topup amount
An error is thrown if the stream cannot be topped up
Readonly
topupTopup the non-prepaid stream and validate at the given on-chain time.
The on-chain time
The topup amount
An error is thrown if the stream cannot be topped up or a user wallet wasn't provided to the Superstream client or there is a Solana RPC issue
Readonly
validateValidate if the non-prepaid stream's sender can be changed at the given on-chain time.
Conditions when validation fails:
web3.PublicKey.default
this stream's current sender
The on-chain time
Optional
newSender: PublicKeyThe new sender
An error is thrown if the stream's sender cannot be changed
Readonly
changeChange the sender of the non-prepaid stream and validate at the given on-chain time. The new sender should not be
=== web3.PublicKey.default
or === this stream's current sender
The on-chain time
The new sender. The new sender should not be === web3.PublicKey.default
or === this stream's current sender
An error is thrown if the stream's sender cannot be changed or a user wallet wasn't provided to the Superstream client or there is a Solana RPC issue
Readonly
validateValidate if the stream's recipient funds can be withdrawn at the given on-chain time.
Conditions when validation fails:
The on-chain time
An error is thrown if the stream's recipient funds cannot be withdrawn
Readonly
withdrawWithdraw recipient funds from the stream and validate at the given on-chain time.
The on-chain time
An error is thrown if the stream's recipient funds cannot be withdrawn or a user wallet wasn't provided to the Superstream client or there is a Solana RPC issue
Readonly
validateValidate if the stream's recipient funds can be withdrawn and the recipient can be changed at the given on-chain time.
Conditions when validation fails:
this stream's current recipient
The on-chain time
Optional
newRecipient: PublicKeyThe new recipient
An error is thrown if the stream's recipient funds cannot be withdrawn or the recipient cannot be changed
Readonly
withdrawWithdraw recipient funds from the stream and change the recipient of the stream and validate at the given on-chain
time. If the new recipient === web3.PublicKey.default
, the recipient is not changed. The new recipient should not
be === this stream's current recipient
.
The on-chain time
The new recipient. If the new recipient === web3.PublicKey.default
, the recipient is not
changed. The new recipient should not be === this stream's current recipient
An error is thrown if the stream's recipient funds cannot be withdrawn or the recipient cannot be changed or a user wallet wasn't provided to the Superstream client or there is a Solana RPC issue
Readonly
validateValidate if the stream can be paused at the given on-chain time.
Conditions when validation fails:
The on-chain time
An error is thrown if the stream cannot be paused
Readonly
pausePause the non-prepaid stream and validate at the given on-chain time.
The on-chain time
An error is thrown if the stream cannot be paused or a user wallet wasn't provided to the Superstream client or there is a Solana RPC issue
Readonly
validateValidate if the stream can be resumed at the given on-chain time.
Conditions when validation fails:
The on-chain time
An error is thrown if the stream cannot be resumed
Readonly
resumeResume the non-prepaid stream and validate at the given on-chain time.
The on-chain time
An error is thrown if the stream cannot be resumed or a user wallet wasn't provided to the Superstream client or there is a Solana RPC issue
Readonly
getGet or create an associated token account for the stream's mint for the given owner.
The public key of the owner for which an associated token account is needed
The public key of the associated token account fetched or created
An error is thrown if there is a Solana RPC issue
Readonly
getReadonly
getReadonly
getGet or create an associated token account for the stream's mint for the stream recipient.
The public key of the associated token account fetched or created
An error is thrown if there is a Solana RPC issue
Readonly
mustGet the associated token account for the stream's mint for the given owner. If an associated token account doesn't exist, an error is thrown.
The public key of the owner for which the associated token account is needed
The public key of the associated token account
An error is thrown an associated token account doesn't exist or there is a Solana RPC issue
Readonly
mustGet the associated token account for the stream's mint for the stream sender. If an associated token account doesn't exist, an error is thrown.
The public key of the associated token account
An error is thrown an associated token account doesn't exist or there is a Solana RPC issue
Readonly
mustGet the associated token account for the stream's mint for the stream recipient. If an associated token account doesn't exist, an error is thrown.
The public key of the associated token account
An error is thrown an associated token account doesn't exist or there is a Solana RPC issue
Generated using TypeDoc
A payment stream with support for SPL tokens, prepaid and limited upfront payment, unlimited lifetime, cliffs and cancellations.
Possible states of a stream: