Optional
layer2Signer: SignerPrivate
revenuePrivate
layer2Private
Optional
layer2This call will return the fee in SPEND to register as a merchant.
a promise for a number which represents the amount of SPEND it costs to register as a merchant.
let registrationFeeInSpend = await revenuePool.merchantRegistrationFee();
registrationFee = 1000
This call returns the balance in the RevenuePool for a merchant's safe address. As customers pay merchants with their prepaid cards, the payments accumulate as revenue that the merchants can claim using their merchant safes. This function reveals the revenue that has accumulated for the merchant. This function takes in a parameter, which is the merchant's safe address and returns a promise that is a list balances aggregated by token address (a merchant can accumulate balances for all the stable coin CPXD tokens that are allowed in the cardpay protocol).
he amount of the tokens specified as the token address in the parameters that are estimated to be used to pay for gas as a string in units of wei
.
let balances = await revenuePool.balances(merchantSafeAddress);
for (let balanceInfo of balances) {
console.log(`${balanceInfo.tokenSymbol} balance is ${fromWei(balanceInfo.balance)}`)
}
This call will return the gas estimate for claiming revenue.
a promise for the amount of the tokens specified as the token address in the parameters that are estimated to be used to pay for gas as a string in units of wei
let result = await revenuePool.claimGasEstimate(merchantSafeAddress, tokenAddress, claimAmountInWei);
The merchant's safe address
The token address of the tokens the merchant is claiming
The amount of tokens that are being claimed as a string in native units of the token (e.g. wei
)
This call will transfer unclaimed merchant revenue from the revenue pool into the merchant's safe, thereby "claiming" the merchant's revenue earned from prepaid card payments.
This method returns a promise for a web3 transaction receipt
let result = await revenuePool.claim(merchantSafeAddress, tokenAddress, claimAmountInWei);
Optional
amount: stringOptional
txnOptions: TransactionOptionsOptional
contractOptions: ContractOptionsThis call will register a merchant with the Revenue Pool. In order to register as a merchant a prepaid card is used to pay the merchant registration fee. As part of merchant registration a gnosis safe will be created for the merchant specifically to claim revenue from prepaid card payments from the Revenue Pool. When customers pay a merchant they must specify the merchant safe (created from this call) as the recipient for merchant payments. The parameters to this function are:
let { merchantSafe } = await revenuePool.registerMerchant(merchantsPrepaidCardAddress, infoDID);
This call takes in as a parameter the prepaid card address that the merchant is using to pay the registration fee for becoming a new merchant.
promise for a web3 transaction receipt.
Optional
txnOptions: TransactionOptionsOptional
contractOptions: ContractOptionsPrivate
getPrivate
getPrivate
getPrivate
resolvePrivate
executePrivate
createGenerated using TypeDoc
The
RevenuePool
API is used register merchants and view/claim merchant revenue from prepaid card payments within the layer 2 network in which the Card Protocol runs. TheRevenuePool
API can be obtained fromgetSDK()
with aWeb3
instance that is configured to operate on a layer 2 network (like Gnosis Chain or Sokol).Example