Defined in: enduser/src/UserClient.ts:17
new UserClient(
config):UserClient
Defined in: enduser/src/UserClient.ts:26
| Parameter | Type |
|---|---|
config |
UserClientConfig |
UserClient
accountAddress:
`0x${string}`
Defined in: enduser/src/UserClient.ts:18
optionalbundlerClient:any
Defined in: enduser/src/UserClient.ts:24
client:
WalletClient
Defined in: core/dist/clients/BaseClient.d.ts:5
optionalentryPointAddress:`0x${string}`
Defined in: enduser/src/UserClient.ts:20
optionalgTokenAddress:`0x${string}`
Defined in: enduser/src/UserClient.ts:23
optionalgTokenStakingAddress:`0x${string}`
Defined in: enduser/src/UserClient.ts:21
BaseClient.gTokenStakingAddress
protectedoptionalpaymasterFactoryAddress:`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:10
BaseClient.paymasterFactoryAddress
optionalpublicClient:PublicClient
Defined in: core/dist/clients/BaseClient.d.ts:6
optionalregistryAddress:`0x${string}`
Defined in: enduser/src/UserClient.ts:22
optionalsbtAddress:`0x${string}`
Defined in: enduser/src/UserClient.ts:19
execute(
target,value,data,options?):Promise<`0x${string}`>
Defined in: enduser/src/UserClient.ts:155
Execute a transaction from the AA account
| Parameter | Type |
|---|---|
target |
`0x${string}` |
value |
bigint |
data |
`0x${string}` |
options? |
TransactionOptions |
Promise<`0x${string}`>
executeBatch(
targets,values,datas,options?):Promise<`0x${string}`>
Defined in: enduser/src/UserClient.ts:174
Execute a batch of transactions
| Parameter | Type |
|---|---|
targets |
`0x${string}`[] |
values |
bigint[] |
datas |
`0x${string}`[] |
options? |
TransactionOptions |
Promise<`0x${string}`>
executeGasless(
params,options?):Promise<`0x${string}`>
Defined in: enduser/src/UserClient.ts:441
Execute a transaction with Gasless Sponsorship
| Parameter | Type |
|---|---|
params |
{ data: `0x${string}`; maxRate?: bigint; operator?: `0x${string}`; paymaster: `0x${string}`; paymasterType: "V4" | "Super"; target: `0x${string}`; value: bigint; } |
params.data |
`0x${string}` |
params.maxRate? |
bigint |
params.operator? |
`0x${string}` |
params.paymaster? |
`0x${string}` |
params.paymasterType? |
"V4" | "Super" |
params.target? |
`0x${string}` |
params.value? |
bigint |
options? |
TransactionOptions |
Promise<`0x${string}`>
exitRole(
roleId,options?):Promise<`0x${string}`>
Defined in: enduser/src/UserClient.ts:320
| Parameter | Type |
|---|---|
roleId |
`0x${string}` |
options? |
TransactionOptions |
Promise<`0x${string}`>
getAddress():
`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:16
Get the account address of the connected wallet
`0x${string}`
getNonce(
key):Promise<bigint>
Defined in: enduser/src/UserClient.ts:125
Get the nonce of the account from EntryPoint (more reliable for 4337)
| Parameter | Type | Default value |
|---|---|---|
key |
bigint |
0n |
Promise<bigint>
getOwner():
Promise<`0x${string}`>
Defined in: enduser/src/UserClient.ts:143
Get the owner of the AA account
Promise<`0x${string}`>
getSBTBalance():
Promise<bigint>
Defined in: enduser/src/UserClient.ts:196
Get user's SBT balance
Promise<bigint>
getStakedBalance(
roleId):Promise<bigint>
Defined in: enduser/src/UserClient.ts:302
Get staked balance for a specific role
| Parameter | Type |
|---|---|
roleId |
`0x${string}` |
Promise<bigint>
getStartPublicClient():
WalletClient<Transport,Chain|undefined,Account|undefined> |PublicClient
Defined in: core/dist/clients/BaseClient.d.ts:20
Helper to ensure public client exists or fallback to wallet client (if it supports read)
WalletClient<Transport, Chain | undefined, Account | undefined> | PublicClient
BaseClient.getStartPublicClient
getTokenBalance(
token):Promise<bigint>
Defined in: enduser/src/UserClient.ts:248
Get Token Balance
| Parameter | Type |
|---|---|
token |
`0x${string}` |
Promise<bigint>
leaveCommunity(
community,options?):Promise<`0x${string}`>
Defined in: enduser/src/UserClient.ts:337
| Parameter | Type |
|---|---|
community |
`0x${string}` |
options? |
TransactionOptions |
Promise<`0x${string}`>
mintSBT(
roleId,options?):Promise<`0x${string}`>
Defined in: enduser/src/UserClient.ts:209
| Parameter | Type |
|---|---|
roleId |
`0x${string}` |
options? |
TransactionOptions |
Promise<`0x${string}`>
registerAsEndUser(
communityAddress,stakeAmount,options?):Promise<`0x${string}`>
Defined in: enduser/src/UserClient.ts:358
Register as EndUser (One-click: Approve + Register) Handles GToken approval to Staking contract and Role registration.
| Parameter | Type |
|---|---|
communityAddress |
`0x${string}` |
stakeAmount |
bigint |
options? |
TransactionOptions |
Promise<`0x${string}`>
protectedrequireEntryPoint():`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:25
`0x${string}`
protectedrequireGToken():`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:22
`0x${string}`
protectedrequireGTokenStaking():`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:23
`0x${string}`
BaseClient.requireGTokenStaking
protectedrequirePaymasterFactory():`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:24
`0x${string}`
BaseClient.requirePaymasterFactory
protectedrequireRegistry():`0x${string}`
Defined in: core/dist/clients/BaseClient.d.ts:21
`0x${string}`
stakeForRole(
roleId,amount,options?):Promise<`0x${string}`>
Defined in: enduser/src/UserClient.ts:265
| Parameter | Type |
|---|---|
roleId |
`0x${string}` |
amount |
bigint |
options? |
TransactionOptions |
Promise<`0x${string}`>
transferToken(
token,to,amount,options?):Promise<`0x${string}`>
Defined in: enduser/src/UserClient.ts:230
| Parameter | Type |
|---|---|
token |
`0x${string}` |
to |
`0x${string}` |
amount |
bigint |
options? |
TransactionOptions |
Promise<`0x${string}`>
unstakeFromRole(
roleId,options?):Promise<`0x${string}`>
Defined in: enduser/src/UserClient.ts:282
| Parameter | Type |
|---|---|
roleId |
`0x${string}` |
options? |
TransactionOptions |
Promise<`0x${string}`>
staticdeployAccount(client,params):Promise<{accountAddress:`0x${string}`;hash:`0x${string}`; }>
Defined in: enduser/src/UserClient.ts:45
Deploy a new Smart Account (Supports multiple factory types) Static helper to facilitate onboarding before instantiating the UserClient.
| Parameter | Type | Description |
|---|---|---|
client |
any |
WalletClient to sign the deployment transaction |
params |
{ accountType?: string; customAbi?: any; factoryAddress?: `0x${string}`; owner: `0x${string}`; publicClient?: any; salt?: bigint; } |
Deployment parameters |
params.accountType? |
string |
- |
params.customAbi? |
any |
- |
params.factoryAddress? |
`0x${string}` |
- |
params.owner |
`0x${string}` |
- |
params.publicClient? |
any |
- |
params.salt? |
bigint |
- |
Promise<{ accountAddress: `0x${string}`; hash: `0x${string}`; }>
Object containing the deployed account address and transaction hash