Creates a new sub account associated with the main wallet account. Sub accounts allow for hierarchical account management and delegation.
{
"id": 1,
"jsonrpc": "2.0",
"method": "wallet_addSubAccount",
"params": [{
"account": {
"type": "create",
"keys": [{
"type": "p256",
"publicKey": "0x0123456789abcdef..."
}]
}
}]
}
{
"id": 1,
"jsonrpc": "2.0",
"method": "wallet_addSubAccount",
"params": [{
"account": {
"type": "deployed",
"address": "0x1234567890123456789012345678901234567890",
"chainId": 8453
}
}]
}
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"address": "0x1234567890123456789012345678901234567890",
"chainId": "0x2105"
}
}
Provider RPC Methods
wallet_addSubAccount
Add a sub account to the wallet
{
"id": 1,
"jsonrpc": "2.0",
"method": "wallet_addSubAccount",
"params": [{
"account": {
"type": "create",
"keys": [{
"type": "p256",
"publicKey": "0x0123456789abcdef..."
}]
}
}]
}
{
"id": 1,
"jsonrpc": "2.0",
"method": "wallet_addSubAccount",
"params": [{
"account": {
"type": "deployed",
"address": "0x1234567890123456789012345678901234567890",
"chainId": 8453
}
}]
}
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"address": "0x1234567890123456789012345678901234567890",
"chainId": "0x2105"
}
}
Experimental RPC method for creating sub accounts
Was this page helpful?