IPP_Streaming_v1.sol
Last updated
Last updated
Inherits: IPaymentProcessor_v1
claim everything that the paymentClient owes to the _msgSender
till the current timestamp.
This function should be callable if the _msgSender
is an activePaymentReceiver
.
Parameters
client
address
The {IERC20PaymentClientBase_v1} instance address that processes all claims from _msgSender
.
claim the total amount up til block.timestamp from the client for a payment order with id = streamId by _msgSender.
If for a specific streamId, the tokens could not be transferred for some reason, it will added to the unclaimableAmounts of the paymentReceiver
, and the amount would no longer hold any co-relation with he specific streamId of the paymentReceiver
.
Parameters
client
address
The {IERC20PaymentClientBase_v1} instance address that processes the streamId
claim from _msgSender
.
streamId
uint256
The ID of the streaming payment order for which claim is being made.
Deletes all payments related to a paymentReceiver & leaves currently streaming tokens in the {IERC20PaymentClientBase_v1}.
this function calls _removePayment
which goes through all the payment orders for a paymentReceiver
. For the payment orders that are completely streamed, their details are deleted in the _claimForSpecificStrea
function and for others it is deleted in the _removePayment
function only, leaving the currently streaming tokens as balance of the paymentClient itself.
Parameters
client
address
The {IERC20PaymentClientBase_v1} instance address from which we will remove the payments.
paymentReceiver
address
PaymentReceiver's address.
Deletes a specific payment with id = streamId for a paymentReceiver & leaves currently streaming tokens in the {IERC20PaymentClientBase_v1}.
the detail of the wallet that is being removed is either deleted in the _claimForSpecificStream
or later down in this function itself depending on the timestamp of when this function was called.
Parameters
client
address
The {IERC20PaymentClientBase_v1} instance address from which we will remove the payment.
paymentReceiver
address
Address of the paymentReceiver whose payment order is to be removed.
streamId
uint256
The ID of the paymentReceiver's payment order which is to be removed.
Getter for the start timestamp of a particular payment order with id = streamId associated with a particular paymentReceiver.
Parameters
client
address
address of the payment client.
paymentReceiver
address
PaymentReceiver's address.
streamId
uint256
Id of the wallet for which start is fetched.
Returns
<none>
uint256
start timestamp of the payment order.
Getter for the cliff duration of a particular payment order with id = streamId associated with a particular paymentReceiver.
Parameters
client
address
address of the payment client.
paymentReceiver
address
PaymentReceiver's address.
streamId
uint256
Id of the wallet for which cliff is fetched.
Returns
<none>
uint256
cliff duration of the payment order.
Getter for the stream end timestamp of a particular payment order with id = streamId associated with a particular paymentReceiver.
Parameters
client
address
address of the payment client.
paymentReceiver
address
PaymentReceiver's address.
streamId
uint256
Id of the wallet for which end is fetched.
Returns
<none>
uint256
end timestamp of the payment order.
Getter for the amount of tokens already released for a particular payment order with id = streamId associated with a particular paymentReceiver.
Parameters
client
address
address of the payment client.
paymentReceiver
address
PaymentReceiver's address.
streamId
uint256
Id of the wallet for which released is fetched.
Returns
<none>
uint256
released amount of the payment order.
Calculates the amount of tokens that has already streamed for a particular payment order with id = streamId associated with a particular paymentReceiver.
Parameters
client
address
paymentReceiver
address
PaymentReceiver's address.
streamId
uint256
Id of the wallet for which the streamed amount is fetched.
timestamp
uint256
the time upto which we want the streamed amount.
Returns
<none>
uint256
streamed amount of the stream with id = streamId.
Getter for the amount of releasable tokens for a particular payment order with id = streamId associated with a particular paymentReceiver.
Parameters
client
address
paymentReceiver
address
PaymentReceiver's address.
streamId
uint256
Id of the wallet for which the releasable amount is fetched.
Returns
<none>
uint256
releasable amount of the stream with id = streamId.
See all active payment orders for a paymentClient associated with a particular paymentReceiver.
the paymentReceiver must be an active paymentReceiver for the particular payment client.
Parameters
client
address
Address of the payment client.
paymentReceiver
address
Address of the paymentReceiver.
Returns
<none>
Stream[]
all streams for a particular payment client and payment receiver.
Tells whether a paymentReceiver
has any pending payments for a particular client.
This function is for convenience and can be easily figured out by other means in the codebase.
Parameters
client
address
Address of the payment client.
paymentReceiver
address
Address of the paymentReceiver.
Returns
<none>
bool
true if the paymentReceiver is active for the payment client.
Emitted when a payment gets processed for execution.
Parameters
paymentClient
address
The payment client that originated the order.
recipient
address
The address that will receive the payment.
paymentToken
address
The address of the token that is being used for the payment.
streamId
uint256
ID of the streaming payment order that was added.
amount
uint256
The amount of tokens the payment consists of.
start
uint256
The start date of the streaming period.
cliff
uint256
The duration of the cliff period.
end
uint256
The ending of the streaming period.
Emitted when the stream to an address is removed.
Parameters
paymentClient
address
The payment client that originated the order.
recipient
address
The address that will stop receiving payment.
streamId
uint256
ID of the streaming payment order that was removed.
Emitted when a running stream schedule gets updated.
Parameters
recipient
address
The address that will receive the payment.
paymentToken
address
The address of the token that will be used for the payment.
amount
uint256
The amount of tokens the payment consists of.
start
uint256
The start date of the streaming period.
cliff
uint256
The duration of the cliff period.
end
uint256
The ending of the streaming period.
Emitted when a payment was unclaimable due to a token error.
Parameters
paymentClient
address
The payment client that originated the order.
recipient
address
The address that wshould have received the payment.
paymentToken
address
The address of the token that will be used for the payment.
streamId
uint256
ID of the streaming payment order that was processed.
amount
uint256
The amount of tokens that were unclaimable.
Emitted when an address is removed from the list of active payment receiver, eg because all payments have been fulfilled by a client.
Parameters
paymentClient
address
The address of the payment client.
paymentReceiver
address
The address of the recipient that is removed.
insufficient tokens in the client to do payments.
paymentReceiver's streamId for the paymentClient is not valid.
Parameters
paymentClient
address
The payment client that originated the order.
paymentReceiver
address
The address that will receive the payment.
streamId
uint256
ID of the streaming payment order that was processed.
paymentReceiver's streamId for the paymentClient is no longer active.
Parameters
paymentClient
address
The payment client that originated the order.
paymentReceiver
address
The address that will receive the payment.
streamId
uint256
ID of the streaming payment order that was processed.
the paymentReceiver for the given paymentClient does not exist (anymore).
Parameters
paymentClient
address
The payment client that originated the order.
paymentReceiver
address
The address that will receive the payment.
The default start, cliff and end times are invalid.
Parameters
start
uint256
The start time.
cliff
uint256
The cliff duration.
end
uint256
The end time.
This struct is used to store the payment order for a particular paymentReceiver by a particular payment client.
for _streamId
, valid values will start from 1. 0 is not a valid id.
Properties
_paymentToken
address
The address of the token that is being used for the payment.
_streamId
uint256
A unique identifier of a stream for a specific paymentClient and paymentReceiver combination.
_total
uint256
The total amount that the paymentReceiver should eventually get.
_released
uint256
The amount that has been claimed by the paymentReceiver till now.
_start
uint256
The start date of the streaming period.
_cliff
uint256
The duration of the cliff period.
_end
uint256
The ending of the streaming period.