Learn how to use the createSessions JSON-RPC method.
curl --request POST \
--url 'https://rpc.particle.network/evm-chain/#particle_aa_createSessions' \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "particle_aa_createSessions",
"params": [
{
"name": "Example Session",
"version": "1.0",
"ownerAddress": "0xOwnerAddress"
}
]
}
'{
"jsonrpc": "2.0",
"id": 1,
"result": {
"verifyingPaymasterGasless": {},
"verifyingPaymasterNative": {},
"tokenPaymaster": {},
"sessions": [
{}
],
"transactions": [
{}
]
},
"chainId": 80001
}createSessionscreateSessions will generate transactions (or UserOperation objects and hashes, according to the fee payment mechanism) for initializing a session key within predefined parameters. It takes:
name - string.version - string.ownerAddress - string.biconomyApiKey - (optional), string. It should only be used if you’d like to use a Biconomy Paymaster.validUntil - integer.validAfter - integer.sessionValidationModule - string.sessionKeyDataInAbi (alternative: sessionKeyData) - array.{
"chainId": 80001,
"jsonrpc": "2.0",
"id": "f7423e6b-0f69-4b96-8d1e-dcd485f8c2eb",
"method": "particle_aa_createSessions",
"params": [
{ "name": "BICONOMY", "version": "2.0.0", "ownerAddress": "0xc19dd1f3e212b39a30036EF3DE3F83dEf5a66E41" },
[
{
"validUntil": 0,
"validAfter": 0,
"sessionValidationModule": "0x4b7f018Fa27a97b6a17b6d4d8Cb3c0e2D9340133",
"sessionKeyDataInAbi": [ // or use sessionKeyData to replace
["address", "address", "address", "uint256"],
[
"0x1dacDa1087C4048774bEce7784EB8EC4CfBeDB2c",
"0x909E30bdBCb728131E3F8d17150eaE740C904649",
"0x11D266772b85C2C5D4f84A41ca3E08e9f04Fb5D3",
1
]
]
}
]
]
}
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Request to create sessions.
Version of the JSON-RPC protocol, should be 2.0.
"2.0"
The request identifier.
1
API method being called.
particle_aa_createSessions Parameters for creating sessions.
Show child attributes
Successful response with created session details.
Was this page helpful?
curl --request POST \
--url 'https://rpc.particle.network/evm-chain/#particle_aa_createSessions' \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "particle_aa_createSessions",
"params": [
{
"name": "Example Session",
"version": "1.0",
"ownerAddress": "0xOwnerAddress"
}
]
}
'{
"jsonrpc": "2.0",
"id": 1,
"result": {
"verifyingPaymasterGasless": {},
"verifyingPaymasterNative": {},
"tokenPaymaster": {},
"sessions": [
{}
],
"transactions": [
{}
]
},
"chainId": 80001
}