oneTimeUse pins a one-time-use ID on a session. The session can then settle at most one settlement transaction per participating chain. It does not limit the session to one operation.
Examples on this page use @rhinestone/sdk, where rhinestone is the RhinestoneSDK instance from Create a session with a custom setup.
oneTimeUse, the permit’s maxAmount caps that one settlement instead of acting as a lifetime budget.
How it works
- Every intent the SDK prepares for the session burns the ID first, on each chain it settles on. The policy refuses any settlement that does not burn it.
- Intents need an explicit
source. validUntilis optional. When set, it must be a futureDateand bounds every action in the session. Permit, swap, and function windows stay separate policies.OFTandLZsettlement layers requireoneTimeUse.- A one-time-use session always gets its own salted permission ID.
Policy availability
The SDK uses the deployed OneTimeUseIdPolicy for the session’s chain. Its addresses are exported asONE_TIME_USE_ID_POLICY_ADDRESS and ONE_TIME_USE_ID_POLICY_ADDRESS_DEV (for useDevContracts) from @rhinestone/sdk/smart-sessions.
On a chain without the policy, creating the session throws:
Signing
Leavesigning unset. Unless the session holds a Permit2-layer permit such as ACROSS, which compiles claim policies, it has no signing surface and refuses a non-disabled signing mode. See Session signing.
Use the session
Name the fundingsource explicitly and sign with the session: