Process payments

The sub2-sdk allows you to process payments of a batch of subscriptions.

const transactionReceipt: TransactionReceipt = await sub2SDK.processBatch(indices, feeRecipient);

Here indices is of type bigint[] and specifies the indices of subscriptions to process. The feeRecipient is of type 0x${string} and is the address that the processing fee will be sent to. The returned value of viem type TransactionReceipt gives information about the transaction.

The transaction sent by processBatch will not revert if any of the individual subscriptions fail to be processed. This means that the processing of the other subscriptions will still go through.

Note: A payment of a subscription will only be processed if the subscription is in auction mode!

Note: This performs an on-chain transaction and requires that the sub2SDK object was initialised with a walletClient.

Last updated