Restrictions
Extensions are external smart contracts that can be added to the Paymaster contract. These restrictions are used to enforce specific conditions rules that must be met for a transaction to be eligible
createRestriction
async function createRestriction(
name: string,
type: RestrictionMethod,
runner: Signer | Wallet,
items?: RestrictionItems,
restrictionFactoryContractAddress?: string
): Promise<Address>Deploys a new restriction contract based on the provided parameters.
name:string- The name of the restriction contract to be created.type:RestrictionMethod- The type of restriction contract to be created. It can be one of the following:CONTRACT,USER, orFUNCTIONrunner:Signer|Wallet: ASignerorWalletinstance used for signing transactions and interacting with the Restriction Factory contract.items:RestrictionItems(optional) - An object containing the items (e.g., contract addresses, user addresses, function signatures with contract addresses) related to the restriction being created.restrictionFactoryContractAddress:Address(optional) - The address of the Restriction Factory contract. If not provided, it will be retrieved based on the chain ID.Returns: Address: address of the deployed restriction.
types
PaymasterParams
A tuple type representing the parameters for several methods of Paymaster instance: populatePaymasterTransaction, sendPaymasterTransaction, checkTransactionEligibility and getMinimalAllowance. Added for easier usage.
PaymasterType
RestrictionMethod
PaymasterOptions
PaymasterOverrides
BaseRestrictionItem
AddressOrBaseRestrictionItem
ContractItems
UserItems
FunctionItems
RestrictionItems
typechain
Last updated