PaymasterSponsorInterface

The primary class for controlling a user's Paymaster sponsor.

Constructor

PaymasterSponsorInterface

new PaymasterSponsorInterface(eoa)

Parameters

eoa
ethers.Wallet
Required

The EOA responsible for funding and managing the Paymaster sponsor




Methods

init

Intializes paymaster sponsor and loads relevant on-chain data.

init()

Parameters

No Parameters

Returns

No Return data



depositInfo

Gets all info regarding an address on the Fun Paymaster.

depositInfo(address)

Parameters

address
string
Required

The address of the target user.

Returns

tokenAmount
ethers.BigNumber

Amount of ERC20 tokens deposited by a user.

sponsorAmount
ethers.BigNumber

Amount of eth deposited by a sponsor.

_unlockBlockSponsor
ethers.BigNumber

Block number when the sponsor wishes to not offer services. If 0 it is indefinitely open for use.

_unlockBlockAccount
ethers.BigNumber

Block number when the user wishes to not use the paymaster. If 0 it is indefinitely open for use.



addTokenDepositTo

Adds a token balance from the sender into a user's account.

addTokenDepositTo(account, amount)

Parameters

account
string
Required

The address of the target user.

amount
string
Required

Amount of ERC20 token in its native decimal.

Returns

receipt
object

Receipt of token deposit transaction.



withdrawTokenDepositTo

Withdraws a token balance from the sender's account into a user's address.

withdrawTokenDepositTo(target, amount)

Parameters

target
string
Required

The address of the target user.

amount
string | ethers.BigNumber
Required

Amount of ERC20 token in its native decimal.

Returns

receipt
object

Receipt of token deposit transaction.



addEthDepositForSponsor

Adds an ETH balance from the sender into a sponsors account.

addEthDepositForSponsor(value, sponsor)

Parameters

value
string | ethers.BigNumber
Required

Amount of Eth in its native decimal.

sponsor
string

Address of sponsor defaults to the current eoa address.

Returns

receipt
object

Receipt of token deposit transaction.



withdrawEthDepositTo

Withdraws an ETH balance from the sender's account into a sponsors address.

withdrawEthDepositTo(target, amount)

Parameters

target
string
Required

Address of withdraw target.

amount
string | ethers.BigNumber
Required

Amount of Eth in its native decimal.

Returns

receipt
object

Receipt of token deposit transaction.



unlockTokenDeposit

Unlocks a user's token account. Blocks wallet from using the paymaster.

unlockTokenDeposit()

Parameters

No Parameters

Returns

receipt
object

Receipt of token deposit transaction.



lockTokenDeposit

Locks a user's token account. Allows wallet to use the paymaster.

unlockTokenDeposit()

Parameters

No Parameters

Returns

receipt
object

Receipt of token deposit transaction.



lockTokenDeposit

Locks a user's token account. Allows wallet to use the paymaster.

unlockSponsorEntrypointStakeAfter(blockNum)

Parameters

blockNum
int
Required

Number of blocks to wait before unlocking sponsors Eth account. Blocks sponsor from paying for other users gas.

Returns

receipt
object

Receipt of token deposit transaction.



lockTokenDeposit

Locks a sponsor's eth account. Allows sponsor to pay for other users gas.

lockSponsorEntrypointStake()

Parameters

No Parameters

Returns

receipt
object
Required

Receipt of token deposit transaction.