sessions.createSessionKey()
Generate a session keypair locally. The SDK returns the data but does NOT store it.Usage
Parameters
Return Value
Returns aSessionKeyData object:
Example
sessions.addSessionKeyToContract()
Register a session key on the CHIPI wallet smart contract. Requires owner signature.Usage
Parameters
Return Value
Returns aPromise<string> with the transaction hash.
Example
This uses gasless transactions via the Chipi paymaster. Users don’t need STRK for gas.
executeTransactionWithSession()
Execute a transaction using a session key instead of the owner’s private key.Usage
Parameters
Return Value
Returns aPromise<string> with the transaction hash.
Example
Signature Format: Session transactions use a 4-element signature
[sessionPubKey, r, s, validUntil] instead of the owner’s 2-element [r, s]. The SDK handles this automatically.sessions.revokeSessionKey()
Remove a session key’s authorization from the CHIPI wallet contract.Usage
Parameters
Return Value
Returns aPromise<string> with the transaction hash.
Example
sessions.getSessionData()
Query the on-chain status of a session key.Usage
Parameters
Return Value
Returns aPromise<SessionDataResponse>:
Example
Error Handling
All session methods throwChipiSessionError for session-specific failures:
Error Codes
Related
- Session Keys Quickstart - Full lifecycle guide
- CHIPI Wallet Smart Contract - Cairo implementation
- Transfer - Basic token transfers
- Call Any Contract - Custom contract interactions
