Defined in: operator/src/OperatorLifecycle.ts:19
OperatorLifecycle - L3 Pattern
Responsibilities:
- Managing the complete lifecycle of a Paymaster Operator
- Unifying setup (onboard), operation (config), and exit (withdraw)
new OperatorLifecycle(
config):OperatorLifecycle
Defined in: operator/src/OperatorLifecycle.ts:21
| Parameter | Type |
|---|---|
config |
OperatorClientConfig |
OperatorLifecycle
PaymasterOperatorClient.constructor
client:
WalletClient
Defined in: core/dist/clients/BaseClient.d.ts:5
PaymasterOperatorClient.client
protectedoptionalentryPointAddress:`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:11
PaymasterOperatorClient.entryPointAddress
ethUsdPriceFeed:
`0x${string}`
Defined in: operator/src/PaymasterOperatorClient.ts:23
PaymasterOperatorClient.ethUsdPriceFeed
protectedoptionalgTokenAddress:`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:8
PaymasterOperatorClient.gTokenAddress
protectedoptionalgTokenStakingAddress:`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:9
PaymasterOperatorClient.gTokenStakingAddress
protectedoptionalpaymasterFactoryAddress:`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:10
PaymasterOperatorClient.paymasterFactoryAddress
optionalpublicClient:PublicClient
Defined in: core/dist/clients/BaseClient.d.ts:6
PaymasterOperatorClient.publicClient
protectedoptionalregistryAddress:`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:7
PaymasterOperatorClient.registryAddress
superPaymasterAddress:
`0x${string}`
Defined in: operator/src/PaymasterOperatorClient.ts:21
PaymasterOperatorClient.superPaymasterAddress
optionaltokenAddress:`0x${string}`
Defined in: operator/src/PaymasterOperatorClient.ts:22
PaymasterOperatorClient.tokenAddress
xpntsFactory:
`0x${string}`
Defined in: operator/src/PaymasterOperatorClient.ts:24
PaymasterOperatorClient.xpntsFactory
addGasToken(
token,price,options?):Promise<`0x${string}`>
Defined in: operator/src/PaymasterOperatorClient.ts:409
| Parameter | Type |
|---|---|
token |
`0x${string}` |
price |
bigint |
options? |
TransactionOptions |
Promise<`0x${string}`>
PaymasterOperatorClient.addGasToken
checkReadiness():
Promise<OperatorStatus>
Defined in: operator/src/OperatorLifecycle.ts:33
Check if the account is ready to become an operator (e.g., has GToken, has ROLE_COMMUNITY, etc.)
Promise<OperatorStatus>
configureOperator(
xPNTsToken?,treasury?,options?):Promise<`0x${string}`>
Defined in: operator/src/PaymasterOperatorClient.ts:324
Configure operator parameters (Token, Treasury). Exchange rate is now read live from xPNTsToken.exchangeRate() at runtime. If parameters are undefined, existing values are preserved.
| Parameter | Type |
|---|---|
xPNTsToken? |
`0x${string}` |
treasury? |
`0x${string}` |
options? |
TransactionOptions |
Promise<`0x${string}`>
PaymasterOperatorClient.configureOperator
deployAndRegisterPaymasterV4(
params?,options?):Promise<{deployHash:`0x${string}`;paymasterAddress:`0x${string}`;registerHash:`0x${string}`; }>
Defined in: operator/src/PaymasterOperatorClient.ts:142
Deploy a new Paymaster V4 and Register as AOA Operator (one-stop API). This method handles:
- Checks prerequisites (ROLE_COMMUNITY)
- Predicts new Paymaster address
- Deploys Paymaster V4 via Factory
- Registers ROLE_PAYMASTER_AOA with staking
| Parameter | Type | Description |
|---|---|---|
params? |
{ priceFeed?: `0x${string}`; salt?: bigint; stakeAmount?: bigint; version?: string; } |
Deployment parameters |
params.priceFeed? |
`0x${string}` |
- |
params.salt? |
bigint |
- |
params.stakeAmount? |
bigint |
- |
params.version? |
string |
- |
options? |
TransactionOptions |
Transaction options |
Promise<{ deployHash: `0x${string}`; paymasterAddress: `0x${string}`; registerHash: `0x${string}`; }>
Object containing new paymaster address and transaction hashes
PaymasterOperatorClient.deployAndRegisterPaymasterV4
depositCollateral(
amount,options?):Promise<`0x${string}`>
Defined in: operator/src/PaymasterOperatorClient.ts:283
Deposit collateral (aPNTs/GToken) to SuperPaymaster. This is a helper method used by registerAsSuperPaymasterOperator.
| Parameter | Type |
|---|---|
amount |
bigint |
options? |
TransactionOptions |
Promise<`0x${string}`>
PaymasterOperatorClient.depositCollateral
getAddress():
`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:16
Get the account address of the connected wallet
`0x${string}`
PaymasterOperatorClient.getAddress
getOperatorDetails(
operator?):Promise<any>
Defined in: operator/src/PaymasterOperatorClient.ts:372
| Parameter | Type |
|---|---|
operator? |
`0x${string}` |
Promise<any>
PaymasterOperatorClient.getOperatorDetails
getOperatorStats():
Promise<any>
Defined in: operator/src/OperatorLifecycle.ts:93
Promise<any>
getStartPublicClient():
PublicClient|WalletClient<Transport,Chain|undefined,Account|undefined>
Defined in: core/dist/clients/BaseClient.d.ts:20
Helper to ensure public client exists or fallback to wallet client (if it supports read)
PublicClient | WalletClient<Transport, Chain | undefined, Account | undefined>
PaymasterOperatorClient.getStartPublicClient
getTokenPrice(
token):Promise<bigint>
Defined in: operator/src/PaymasterOperatorClient.ts:422
| Parameter | Type |
|---|---|
token |
`0x${string}` |
Promise<bigint>
PaymasterOperatorClient.getTokenPrice
initiateExit(
options?):Promise<`0x${string}`>
Defined in: operator/src/OperatorLifecycle.ts:104
Start the exit process: Unstake from Registry/SuperPaymaster and Unlock funds
| Parameter | Type |
|---|---|
options? |
TransactionOptions |
Promise<`0x${string}`>
PaymasterOperatorClient.initiateExit
isOperator(
operator):Promise<boolean>
Defined in: operator/src/PaymasterOperatorClient.ts:362
| Parameter | Type |
|---|---|
operator |
`0x${string}` |
Promise<boolean>
PaymasterOperatorClient.isOperator
registerAsSuperPaymasterOperator(
params?,options?):Promise<`0x${string}`>
Defined in: operator/src/PaymasterOperatorClient.ts:50
Register as SuperPaymaster Operator (one-stop API). This method handles all necessary steps:
- Checks prerequisites (must have ROLE_COMMUNITY)
- Checks and approves GToken to GTokenStaking
- Registers ROLE_PAYMASTER_SUPER
- Optionally deposits collateral to SuperPaymaster
| Parameter | Type | Description |
|---|---|---|
params? |
{ depositAmount?: bigint; stakeAmount?: bigint; } |
Registration parameters |
params.depositAmount? |
bigint |
- |
params.stakeAmount? |
bigint |
- |
options? |
TransactionOptions |
Transaction options |
Promise<`0x${string}`>
Transaction hash of role registration
PaymasterOperatorClient.registerAsSuperPaymasterOperator
protectedrequireEntryPoint():`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:25
`0x${string}`
PaymasterOperatorClient.requireEntryPoint
protectedrequireGToken():`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:22
`0x${string}`
PaymasterOperatorClient.requireGToken
protectedrequireGTokenStaking():`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:23
`0x${string}`
PaymasterOperatorClient.requireGTokenStaking
protectedrequirePaymasterFactory():`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:24
`0x${string}`
PaymasterOperatorClient.requirePaymasterFactory
protectedrequireRegistry():`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:21
`0x${string}`
PaymasterOperatorClient.requireRegistry
setupNode(
params,options?):Promise<`0x${string}`[]>
Defined in: operator/src/OperatorLifecycle.ts:50
One-click Setup: Register + Deposit + Deploy Node Wraps existing registerAsSuperPaymasterOperator or deployAndRegisterPaymasterV4
| Parameter | Type |
|---|---|
params |
{ depositAmount?: bigint; stakeAmount?: bigint; type: "V4" | "SUPER"; } |
params.depositAmount? |
bigint |
params.stakeAmount? |
bigint |
params.type? |
"V4" | "SUPER" |
options? |
TransactionOptions |
Promise<`0x${string}`[]>
setupPaymasterDeposit(
params,options?):Promise<`0x${string}`>
Defined in: operator/src/PaymasterOperatorClient.ts:431
| Parameter | Type |
|---|---|
params |
{ amount: bigint; paymaster: `0x${string}`; token: `0x${string}`; user: `0x${string}`; } |
params.amount |
bigint |
params.paymaster? |
`0x${string}` |
params.token? |
`0x${string}` |
params.user? |
`0x${string}` |
options? |
TransactionOptions |
Promise<`0x${string}`>
PaymasterOperatorClient.setupPaymasterDeposit
withdrawAllFunds(
to?,options?):Promise<`0x${string}`[]>
Defined in: operator/src/OperatorLifecycle.ts:112
Finalize exit: Withdraw all funds (Collateral + Rewards)
| Parameter | Type |
|---|---|
to? |
`0x${string}` |
options? |
TransactionOptions |
Promise<`0x${string}`[]>
withdrawCollateral(
to,amount,options?):Promise<`0x${string}`>
Defined in: operator/src/PaymasterOperatorClient.ts:349
| Parameter | Type |
|---|---|
to |
`0x${string}` |
amount |
bigint |
options? |
TransactionOptions |
Promise<`0x${string}`>
PaymasterOperatorClient.withdrawCollateral
withdrawStake(
to,options?):Promise<`0x${string}`>
Defined in: operator/src/PaymasterOperatorClient.ts:393
| Parameter | Type |
|---|---|
to |
`0x${string}` |
options? |
TransactionOptions |
Promise<`0x${string}`>