@rhinestone/sdk 2.0.0-beta.43 → 2.0.0-beta.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/src/accounts/adapter.d.ts +31 -0
- package/dist/src/accounts/adapter.d.ts.map +1 -0
- package/dist/src/accounts/adapters/eoa.d.ts +4 -0
- package/dist/src/accounts/adapters/eoa.d.ts.map +1 -0
- package/dist/src/accounts/adapters/eoa.js +45 -0
- package/dist/src/accounts/adapters/hca.d.ts +5 -0
- package/dist/src/accounts/adapters/hca.d.ts.map +1 -0
- package/dist/src/accounts/adapters/hca.js +118 -0
- package/dist/src/accounts/adapters/kernel.d.ts +9 -0
- package/dist/src/accounts/adapters/kernel.d.ts.map +1 -0
- package/dist/src/accounts/adapters/kernel.js +159 -0
- package/dist/src/accounts/adapters/nexus.d.ts +17 -0
- package/dist/src/accounts/adapters/nexus.d.ts.map +1 -0
- package/dist/src/accounts/adapters/nexus.js +227 -0
- package/dist/src/accounts/adapters/safe.d.ts +6 -0
- package/dist/src/accounts/adapters/safe.d.ts.map +1 -0
- package/dist/src/accounts/adapters/safe.js +194 -0
- package/dist/src/accounts/adapters/shared.d.ts +9 -0
- package/dist/src/accounts/adapters/shared.d.ts.map +1 -0
- package/dist/src/accounts/adapters/shared.js +62 -0
- package/dist/src/accounts/adapters/startale.d.ts +14 -0
- package/dist/src/accounts/adapters/startale.d.ts.map +1 -0
- package/dist/src/accounts/adapters/startale.js +165 -0
- package/dist/src/accounts/construction.d.ts +25 -0
- package/dist/src/accounts/construction.d.ts.map +1 -0
- package/dist/src/accounts/construction.js +34 -0
- package/dist/src/accounts/deployment.d.ts +12 -0
- package/dist/src/accounts/deployment.d.ts.map +1 -0
- package/dist/src/accounts/deployment.js +33 -0
- package/dist/src/accounts/erc7579-calls.d.ts +4 -0
- package/dist/src/accounts/erc7579-calls.d.ts.map +1 -0
- package/dist/src/accounts/erc7579-calls.js +57 -0
- package/dist/src/accounts/error.d.ts +1 -1
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/legacy.d.ts +14 -0
- package/dist/src/accounts/legacy.d.ts.map +1 -0
- package/dist/src/accounts/legacy.js +40 -0
- package/dist/src/accounts/registry.d.ts +4 -0
- package/dist/src/accounts/registry.d.ts.map +1 -0
- package/dist/src/accounts/registry.js +22 -0
- package/dist/src/accounts/types.d.ts +131 -0
- package/dist/src/accounts/types.d.ts.map +1 -0
- package/dist/src/accounts/wallet-account.d.ts +3 -0
- package/dist/src/accounts/wallet-account.d.ts.map +1 -0
- package/dist/src/accounts/wallet-account.js +12 -0
- package/dist/src/actions/deploy.d.ts +4 -0
- package/dist/src/actions/deploy.d.ts.map +1 -0
- package/dist/src/actions/deploy.js +8 -0
- package/dist/src/actions/ecdsa.d.ts +1 -1
- package/dist/src/actions/ecdsa.d.ts.map +1 -1
- package/dist/src/actions/ecdsa.js +8 -8
- package/dist/src/actions/index.d.ts +2 -16
- package/dist/src/actions/index.d.ts.map +1 -1
- package/dist/src/actions/index.js +3 -49
- package/dist/src/actions/mfa.d.ts +1 -1
- package/dist/src/actions/mfa.d.ts.map +1 -1
- package/dist/src/actions/mfa.js +30 -10
- package/dist/src/actions/modules.d.ts +4 -0
- package/dist/src/actions/modules.d.ts.map +1 -0
- package/dist/src/actions/modules.js +22 -0
- package/dist/src/actions/passkeys.d.ts +2 -2
- package/dist/src/actions/passkeys.d.ts.map +1 -1
- package/dist/src/actions/passkeys.js +19 -14
- package/dist/src/actions/runtime.d.ts +12 -0
- package/dist/src/actions/runtime.d.ts.map +1 -0
- package/dist/src/actions/runtime.js +161 -0
- package/dist/src/actions/smart-sessions.d.ts +2 -2
- package/dist/src/actions/smart-sessions.d.ts.map +1 -1
- package/dist/src/actions/smart-sessions.js +35 -12
- package/dist/src/api/account.d.ts +265 -0
- package/dist/src/api/account.d.ts.map +1 -0
- package/dist/src/api/account.js +635 -0
- package/dist/src/api/accounts.d.ts +12 -0
- package/dist/src/api/accounts.d.ts.map +1 -0
- package/dist/src/api/accounts.js +17 -0
- package/dist/src/api/compose-types.d.ts +147 -0
- package/dist/src/api/compose-types.d.ts.map +1 -0
- package/dist/src/api/compose.d.ts +6 -0
- package/dist/src/api/compose.d.ts.map +1 -0
- package/dist/src/api/compose.js +766 -0
- package/dist/src/api/direct-signing.d.ts +27 -0
- package/dist/src/api/direct-signing.d.ts.map +1 -0
- package/dist/src/api/direct-signing.js +191 -0
- package/dist/src/api/project-mappers.d.ts +7 -0
- package/dist/src/api/project-mappers.d.ts.map +1 -0
- package/dist/src/api/project-mappers.js +23 -0
- package/dist/src/api/queries/app-fees.d.ts +4 -0
- package/dist/src/api/queries/app-fees.d.ts.map +1 -0
- package/dist/src/api/queries/app-fees.js +3 -0
- package/dist/src/api/queries/portfolio.d.ts +9 -0
- package/dist/src/api/queries/portfolio.d.ts.map +1 -0
- package/dist/src/api/queries/portfolio.js +28 -0
- package/dist/src/api/queries/session.d.ts +8 -0
- package/dist/src/api/queries/session.d.ts.map +1 -0
- package/dist/src/api/queries/session.js +15 -0
- package/dist/src/api/sdk.d.ts +80 -0
- package/dist/src/api/sdk.d.ts.map +1 -0
- package/dist/src/api/sdk.js +103 -0
- package/dist/src/api/signer-selection.d.ts +7 -0
- package/dist/src/api/signer-selection.d.ts.map +1 -0
- package/dist/src/api/signer-selection.js +109 -0
- package/dist/src/calls/normalize.d.ts +9 -0
- package/dist/src/calls/normalize.d.ts.map +1 -0
- package/dist/src/calls/normalize.js +17 -0
- package/dist/src/calls/resolve.d.ts +3 -0
- package/dist/src/calls/resolve.d.ts.map +1 -0
- package/dist/src/calls/resolve.js +15 -0
- package/dist/src/calls/types.d.ts +25 -0
- package/dist/src/calls/types.d.ts.map +1 -0
- package/dist/src/calls/types.js +1 -0
- package/dist/src/chains/caip2.d.ts +10 -0
- package/dist/src/chains/caip2.d.ts.map +1 -0
- package/dist/src/chains/caip2.js +85 -0
- package/dist/src/chains/catalog.d.ts +5 -0
- package/dist/src/chains/catalog.d.ts.map +1 -0
- package/dist/src/chains/catalog.js +41 -0
- package/dist/src/chains/errors.d.ts +15 -0
- package/dist/src/chains/errors.d.ts.map +1 -0
- package/dist/src/chains/errors.js +21 -0
- package/dist/src/{orchestrator/destinations.d.ts → chains/non-evm.d.ts} +7 -5
- package/dist/src/chains/non-evm.d.ts.map +1 -0
- package/dist/src/chains/non-evm.js +30 -0
- package/dist/src/chains/tokens.d.ts +4 -0
- package/dist/src/chains/tokens.d.ts.map +1 -0
- package/dist/src/chains/tokens.js +22 -0
- package/dist/src/chains/types.d.ts +25 -0
- package/dist/src/chains/types.d.ts.map +1 -0
- package/dist/src/chains/types.js +1 -0
- package/dist/src/clients/bundler/client.d.ts +10 -0
- package/dist/src/clients/bundler/client.d.ts.map +1 -0
- package/dist/src/clients/bundler/client.js +85 -0
- package/dist/src/clients/bundler/endpoints.d.ts +3 -0
- package/dist/src/clients/bundler/endpoints.d.ts.map +1 -0
- package/dist/src/clients/bundler/endpoints.js +18 -0
- package/dist/src/clients/bundler/port.d.ts +22 -0
- package/dist/src/clients/bundler/port.d.ts.map +1 -0
- package/dist/src/clients/bundler/port.js +1 -0
- package/dist/src/clients/json-rpc.d.ts +20 -0
- package/dist/src/clients/json-rpc.d.ts.map +1 -0
- package/dist/src/clients/json-rpc.js +56 -0
- package/dist/src/clients/orchestrator/auth.d.ts +7 -0
- package/dist/src/clients/orchestrator/auth.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/auth.js +27 -0
- package/dist/src/clients/orchestrator/chain-catalog.d.ts +36 -0
- package/dist/src/clients/orchestrator/chain-catalog.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/chain-catalog.js +67 -0
- package/dist/src/clients/orchestrator/client.d.ts +13 -0
- package/dist/src/clients/orchestrator/client.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/client.js +97 -0
- package/dist/src/{orchestrator/error.d.ts → clients/orchestrator/errors.d.ts} +2 -16
- package/dist/src/clients/orchestrator/errors.d.ts.map +1 -0
- package/dist/src/{orchestrator/error.js → clients/orchestrator/errors.js} +1 -22
- package/dist/src/clients/orchestrator/fetch.d.ts +7 -0
- package/dist/src/clients/orchestrator/fetch.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/fetch.js +37 -0
- package/dist/src/clients/orchestrator/mappers.d.ts +9 -0
- package/dist/src/clients/orchestrator/mappers.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/mappers.js +198 -0
- package/dist/src/clients/orchestrator/port.d.ts +26 -0
- package/dist/src/clients/orchestrator/port.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/port.js +1 -0
- package/dist/src/{orchestrator/types.d.ts → clients/orchestrator/public.d.ts} +12 -15
- package/dist/src/clients/orchestrator/public.d.ts.map +1 -0
- package/dist/src/{orchestrator/types.js → clients/orchestrator/public.js} +3 -0
- package/dist/src/clients/orchestrator/types.d.ts +140 -0
- package/dist/src/clients/orchestrator/types.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/types.js +1 -0
- package/dist/src/clients/orchestrator/wire.d.ts +19 -0
- package/dist/src/clients/orchestrator/wire.d.ts.map +1 -0
- package/dist/src/{orchestrator → clients/orchestrator}/wire.gen.d.ts +519 -499
- package/dist/src/clients/orchestrator/wire.gen.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/wire.gen.js +1 -0
- package/dist/src/clients/orchestrator/wire.js +1 -0
- package/dist/src/clients/paymaster/client.d.ts +8 -0
- package/dist/src/clients/paymaster/client.d.ts.map +1 -0
- package/dist/src/clients/paymaster/client.js +38 -0
- package/dist/src/clients/paymaster/endpoints.d.ts +3 -0
- package/dist/src/clients/paymaster/endpoints.d.ts.map +1 -0
- package/dist/src/clients/paymaster/endpoints.js +16 -0
- package/dist/src/clients/paymaster/port.d.ts +17 -0
- package/dist/src/clients/paymaster/port.d.ts.map +1 -0
- package/dist/src/clients/paymaster/port.js +1 -0
- package/dist/src/clients/rpc/client.d.ts +6 -0
- package/dist/src/clients/rpc/client.d.ts.map +1 -0
- package/dist/src/clients/rpc/client.js +66 -0
- package/dist/src/clients/rpc/compatibility.d.ts +12 -0
- package/dist/src/clients/rpc/compatibility.d.ts.map +1 -0
- package/dist/src/clients/rpc/compatibility.js +16 -0
- package/dist/src/clients/rpc/port.d.ts +13 -0
- package/dist/src/clients/rpc/port.d.ts.map +1 -0
- package/dist/src/clients/rpc/port.js +1 -0
- package/dist/src/clients/rpc/providers.d.ts +3 -0
- package/dist/src/clients/rpc/providers.d.ts.map +1 -0
- package/dist/src/clients/rpc/providers.js +8 -0
- package/dist/src/clients/rpc/transport.d.ts +4 -0
- package/dist/src/clients/rpc/transport.d.ts.map +1 -0
- package/dist/src/clients/rpc/transport.js +5 -0
- package/dist/src/clients/rpc/types.d.ts +23 -0
- package/dist/src/clients/rpc/types.d.ts.map +1 -0
- package/dist/src/clients/rpc/types.js +1 -0
- package/dist/src/config/account-runtime.d.ts +7 -0
- package/dist/src/config/account-runtime.d.ts.map +1 -0
- package/dist/src/config/account-runtime.js +36 -0
- package/dist/src/{types.d.ts → config/account.d.ts} +31 -26
- package/dist/src/config/account.d.ts.map +1 -0
- package/dist/src/config/account.js +10 -0
- package/dist/src/config/defaults.d.ts +14 -0
- package/dist/src/config/defaults.d.ts.map +1 -0
- package/dist/src/config/defaults.js +26 -0
- package/dist/src/config/input.d.ts +54 -0
- package/dist/src/config/input.d.ts.map +1 -0
- package/dist/src/config/input.js +1 -0
- package/dist/src/config/legacy.d.ts +22 -0
- package/dist/src/config/legacy.d.ts.map +1 -0
- package/dist/src/config/legacy.js +23 -0
- package/dist/src/config/resolve.d.ts +13 -0
- package/dist/src/config/resolve.d.ts.map +1 -0
- package/dist/src/config/resolve.js +174 -0
- package/dist/src/config/resolved.d.ts +77 -0
- package/dist/src/config/resolved.d.ts.map +1 -0
- package/dist/src/config/resolved.js +1 -0
- package/dist/src/config/validate.d.ts +3 -0
- package/dist/src/config/validate.d.ts.map +1 -0
- package/dist/src/config/validate.js +6 -0
- package/dist/src/{execution/error.d.ts → errors/execution.d.ts} +2 -2
- package/dist/src/errors/execution.d.ts.map +1 -0
- package/dist/src/{execution/error.js → errors/execution.js} +1 -1
- package/dist/src/errors/index.d.ts +4 -4
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +4 -3
- package/dist/src/index.d.ts +13 -314
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -260
- package/dist/src/modules/erc7579-abi.d.ts +4 -0
- package/dist/src/modules/erc7579-abi.d.ts.map +1 -0
- package/dist/src/modules/erc7579-abi.js +12 -0
- package/dist/src/modules/intent-executor.d.ts +6 -0
- package/dist/src/modules/intent-executor.d.ts.map +1 -0
- package/dist/src/modules/intent-executor.js +13 -0
- package/dist/src/modules/legacy-core.d.ts +29 -0
- package/dist/src/modules/legacy-core.d.ts.map +1 -0
- package/dist/src/modules/legacy-core.js +80 -0
- package/dist/src/modules/normalize.d.ts +4 -0
- package/dist/src/modules/normalize.d.ts.map +1 -0
- package/dist/src/modules/normalize.js +15 -0
- package/dist/src/modules/plan.d.ts +16 -0
- package/dist/src/modules/plan.d.ts.map +1 -0
- package/dist/src/modules/plan.js +51 -0
- package/dist/src/modules/read-core.d.ts +39 -0
- package/dist/src/modules/read-core.d.ts.map +1 -0
- package/dist/src/modules/read-core.js +149 -0
- package/dist/src/modules/types.d.ts +46 -0
- package/dist/src/modules/types.d.ts.map +1 -0
- package/dist/src/modules/types.js +1 -0
- package/dist/src/modules/validators/capabilities.d.ts +4 -0
- package/dist/src/modules/validators/capabilities.d.ts.map +1 -0
- package/dist/src/modules/validators/capabilities.js +58 -0
- package/dist/src/modules/validators/contribution.d.ts +4 -0
- package/dist/src/modules/validators/contribution.d.ts.map +1 -0
- package/dist/src/modules/validators/contribution.js +64 -0
- package/dist/src/modules/validators/definition.d.ts +3 -0
- package/dist/src/modules/validators/definition.d.ts.map +1 -0
- package/dist/src/modules/validators/definition.js +68 -0
- package/dist/src/modules/validators/ens.d.ts +5 -0
- package/dist/src/modules/validators/ens.d.ts.map +1 -0
- package/dist/src/modules/validators/ens.js +34 -0
- package/dist/src/modules/validators/k1.d.ts +2 -0
- package/dist/src/modules/validators/k1.d.ts.map +1 -0
- package/dist/src/modules/validators/k1.js +1 -0
- package/dist/src/modules/validators/multi-factor.d.ts +18 -0
- package/dist/src/modules/validators/multi-factor.d.ts.map +1 -0
- package/dist/src/modules/validators/multi-factor.js +79 -0
- package/dist/src/modules/validators/ownable.d.ts +26 -0
- package/dist/src/modules/validators/ownable.d.ts.map +1 -0
- package/dist/src/modules/validators/ownable.js +84 -0
- package/dist/src/modules/validators/permissions.d.ts +1 -1
- package/dist/src/modules/validators/permissions.d.ts.map +1 -1
- package/dist/src/modules/validators/policies/claim/arbiters.d.ts +9 -12
- package/dist/src/modules/validators/policies/claim/arbiters.d.ts.map +1 -1
- package/dist/src/modules/validators/policies/claim/arbiters.js +52 -27
- package/dist/src/modules/validators/resolve.d.ts +5 -0
- package/dist/src/modules/validators/resolve.d.ts.map +1 -0
- package/dist/src/modules/validators/resolve.js +22 -0
- package/dist/src/modules/validators/signer-id.d.ts +5 -0
- package/dist/src/modules/validators/signer-id.d.ts.map +1 -0
- package/dist/src/modules/validators/signer-id.js +8 -0
- package/dist/src/modules/validators/smart-session-signature-types.d.ts +35 -0
- package/dist/src/modules/validators/smart-session-signature-types.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-session-signature-types.js +1 -0
- package/dist/src/modules/validators/smart-sessions/authorization.d.ts +99 -0
- package/dist/src/modules/validators/smart-sessions/authorization.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/authorization.js +101 -0
- package/dist/src/modules/validators/smart-sessions/calls.d.ts +19 -0
- package/dist/src/modules/validators/smart-sessions/calls.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/calls.js +85 -0
- package/dist/src/modules/validators/smart-sessions/cross-chain-permits.d.ts +4 -0
- package/dist/src/modules/validators/smart-sessions/cross-chain-permits.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/cross-chain-permits.js +77 -0
- package/dist/src/modules/validators/smart-sessions/digest.d.ts +5 -0
- package/dist/src/modules/validators/smart-sessions/digest.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/digest.js +30 -0
- package/dist/src/modules/validators/smart-sessions/mock-signature.d.ts +10 -0
- package/dist/src/modules/validators/smart-sessions/mock-signature.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/mock-signature.js +31 -0
- package/dist/src/modules/validators/smart-sessions/module.d.ts +11 -0
- package/dist/src/modules/validators/smart-sessions/module.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/module.js +18 -0
- package/dist/src/modules/validators/smart-sessions/policies/addresses.d.ts +23 -0
- package/dist/src/modules/validators/smart-sessions/policies/addresses.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/policies/addresses.js +29 -0
- package/dist/src/modules/validators/smart-sessions/policies/claim.d.ts +10 -0
- package/dist/src/modules/validators/smart-sessions/policies/claim.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/policies/claim.js +106 -0
- package/dist/src/modules/validators/smart-sessions/policies/encode.d.ts +4 -0
- package/dist/src/modules/validators/smart-sessions/policies/encode.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/policies/encode.js +197 -0
- package/dist/src/modules/validators/smart-sessions/resolve.d.ts +16 -0
- package/dist/src/modules/validators/smart-sessions/resolve.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/resolve.js +120 -0
- package/dist/src/modules/validators/smart-sessions/signature.d.ts +14 -0
- package/dist/src/modules/validators/smart-sessions/signature.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/signature.js +167 -0
- package/dist/src/modules/validators/smart-sessions/state.d.ts +19 -0
- package/dist/src/modules/validators/smart-sessions/state.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/state.js +42 -0
- package/dist/src/modules/validators/smart-sessions/types.d.ts +227 -0
- package/dist/src/modules/validators/smart-sessions/types.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/types.js +1 -0
- package/dist/src/modules/validators/types.d.ts +143 -0
- package/dist/src/modules/validators/types.d.ts.map +1 -0
- package/dist/src/modules/validators/types.js +1 -0
- package/dist/src/modules/validators/webauthn.d.ts +54 -0
- package/dist/src/modules/validators/webauthn.d.ts.map +1 -0
- package/dist/src/modules/validators/webauthn.js +159 -0
- package/dist/src/signing/context.d.ts +25 -0
- package/dist/src/signing/context.d.ts.map +1 -0
- package/dist/src/signing/context.js +163 -0
- package/dist/src/signing/contribution.d.ts +13 -0
- package/dist/src/signing/contribution.d.ts.map +1 -0
- package/dist/src/signing/contribution.js +83 -0
- package/dist/src/signing/eip7702.d.ts +41 -0
- package/dist/src/signing/eip7702.d.ts.map +1 -0
- package/dist/src/signing/eip7702.js +215 -0
- package/dist/src/signing/error.d.ts +27 -0
- package/dist/src/signing/error.d.ts.map +1 -0
- package/dist/src/signing/error.js +25 -0
- package/dist/src/signing/execute.d.ts +17 -0
- package/dist/src/signing/execute.d.ts.map +1 -0
- package/dist/src/signing/execute.js +138 -0
- package/dist/src/signing/intent-plans/assemble.d.ts +15 -0
- package/dist/src/signing/intent-plans/assemble.d.ts.map +1 -0
- package/dist/src/signing/intent-plans/assemble.js +96 -0
- package/dist/src/signing/intent-plans/independent.d.ts +48 -0
- package/dist/src/signing/intent-plans/independent.d.ts.map +1 -0
- package/dist/src/signing/intent-plans/independent.js +150 -0
- package/dist/src/signing/intent-plans/plan.d.ts +14 -0
- package/dist/src/signing/intent-plans/plan.d.ts.map +1 -0
- package/dist/src/signing/intent-plans/plan.js +187 -0
- package/dist/src/signing/intent-plans/types.d.ts +63 -0
- package/dist/src/signing/intent-plans/types.d.ts.map +1 -0
- package/dist/src/signing/intent-plans/types.js +1 -0
- package/dist/src/signing/message.d.ts +28 -0
- package/dist/src/signing/message.d.ts.map +1 -0
- package/dist/src/signing/message.js +90 -0
- package/dist/src/signing/passkeys.d.ts +28 -0
- package/dist/src/signing/passkeys.d.ts.map +1 -0
- package/dist/src/signing/passkeys.js +17 -0
- package/dist/src/signing/plan.d.ts +35 -0
- package/dist/src/signing/plan.d.ts.map +1 -0
- package/dist/src/signing/plan.js +377 -0
- package/dist/src/signing/protocols/erc6492.d.ts +11 -0
- package/dist/src/signing/protocols/erc6492.d.ts.map +1 -0
- package/dist/src/signing/protocols/erc6492.js +24 -0
- package/dist/src/signing/protocols/erc7739.d.ts +17 -0
- package/dist/src/signing/protocols/erc7739.d.ts.map +1 -0
- package/dist/src/signing/protocols/erc7739.js +84 -0
- package/dist/src/signing/session-enable.d.ts +35 -0
- package/dist/src/signing/session-enable.d.ts.map +1 -0
- package/dist/src/signing/session-enable.js +62 -0
- package/dist/src/signing/signers/compatibility.d.ts +4 -0
- package/dist/src/signing/signers/compatibility.d.ts.map +1 -0
- package/dist/src/signing/signers/compatibility.js +51 -0
- package/dist/src/signing/signers/ecdsa.d.ts +14 -0
- package/dist/src/signing/signers/ecdsa.d.ts.map +1 -0
- package/dist/src/signing/signers/ecdsa.js +54 -0
- package/dist/src/signing/signers/registry.d.ts +7 -0
- package/dist/src/signing/signers/registry.d.ts.map +1 -0
- package/dist/src/signing/signers/registry.js +33 -0
- package/dist/src/signing/signers/types.d.ts +16 -0
- package/dist/src/signing/signers/types.d.ts.map +1 -0
- package/dist/src/signing/signers/types.js +1 -0
- package/dist/src/signing/signers/wallet-chain.d.ts +9 -0
- package/dist/src/signing/signers/wallet-chain.d.ts.map +1 -0
- package/dist/src/signing/signers/wallet-chain.js +15 -0
- package/dist/src/signing/signers/webauthn.d.ts +11 -0
- package/dist/src/signing/signers/webauthn.d.ts.map +1 -0
- package/dist/src/signing/signers/webauthn.js +14 -0
- package/dist/src/signing/typed-data.d.ts +39 -0
- package/dist/src/signing/typed-data.d.ts.map +1 -0
- package/dist/src/signing/typed-data.js +135 -0
- package/dist/src/signing/types.d.ts +346 -0
- package/dist/src/signing/types.d.ts.map +1 -0
- package/dist/src/signing/types.js +1 -0
- package/dist/src/signing/user-operation.d.ts +23 -0
- package/dist/src/signing/user-operation.d.ts.map +1 -0
- package/dist/src/signing/user-operation.js +61 -0
- package/dist/src/smart-sessions/index.d.ts +13 -3
- package/dist/src/smart-sessions/index.d.ts.map +1 -1
- package/dist/src/smart-sessions/index.js +44 -6
- package/dist/src/transactions/intents/account.d.ts +15 -0
- package/dist/src/transactions/intents/account.d.ts.map +1 -0
- package/dist/src/transactions/intents/account.js +48 -0
- package/dist/src/transactions/intents/compatibility.d.ts +4 -0
- package/dist/src/transactions/intents/compatibility.d.ts.map +1 -0
- package/dist/src/transactions/intents/compatibility.js +19 -0
- package/dist/src/transactions/intents/normalize.d.ts +5 -0
- package/dist/src/transactions/intents/normalize.d.ts.map +1 -0
- package/dist/src/transactions/intents/normalize.js +48 -0
- package/dist/src/transactions/intents/prepare.d.ts +7 -0
- package/dist/src/transactions/intents/prepare.d.ts.map +1 -0
- package/dist/src/transactions/intents/prepare.js +249 -0
- package/dist/src/transactions/intents/quotes.d.ts +3 -0
- package/dist/src/transactions/intents/quotes.d.ts.map +1 -0
- package/dist/src/transactions/intents/quotes.js +11 -0
- package/dist/src/transactions/intents/request.d.ts +11 -0
- package/dist/src/transactions/intents/request.d.ts.map +1 -0
- package/dist/src/transactions/intents/request.js +55 -0
- package/dist/src/transactions/intents/send.d.ts +3 -0
- package/dist/src/transactions/intents/send.d.ts.map +1 -0
- package/dist/src/transactions/intents/send.js +22 -0
- package/dist/src/transactions/intents/session-signing.d.ts +7 -0
- package/dist/src/transactions/intents/session-signing.d.ts.map +1 -0
- package/dist/src/transactions/intents/session-signing.js +363 -0
- package/dist/src/transactions/intents/sessions.d.ts +17 -0
- package/dist/src/transactions/intents/sessions.d.ts.map +1 -0
- package/dist/src/transactions/intents/sessions.js +85 -0
- package/dist/src/transactions/intents/sign-transaction.d.ts +10 -0
- package/dist/src/transactions/intents/sign-transaction.d.ts.map +1 -0
- package/dist/src/transactions/intents/sign-transaction.js +386 -0
- package/dist/src/transactions/intents/split.d.ts +13 -0
- package/dist/src/transactions/intents/split.d.ts.map +1 -0
- package/dist/src/transactions/intents/split.js +3 -0
- package/dist/src/transactions/intents/status-policy.d.ts +13 -0
- package/dist/src/transactions/intents/status-policy.d.ts.map +1 -0
- package/dist/src/transactions/intents/status-policy.js +39 -0
- package/dist/src/transactions/intents/status.d.ts +4 -0
- package/dist/src/transactions/intents/status.d.ts.map +1 -0
- package/dist/src/transactions/intents/status.js +50 -0
- package/dist/src/transactions/intents/submit.d.ts +3 -0
- package/dist/src/transactions/intents/submit.d.ts.map +1 -0
- package/dist/src/transactions/intents/submit.js +32 -0
- package/dist/src/transactions/intents/types.d.ts +136 -0
- package/dist/src/transactions/intents/types.d.ts.map +1 -0
- package/dist/src/transactions/intents/types.js +1 -0
- package/dist/src/transactions/user-operations/hash.d.ts +5 -0
- package/dist/src/transactions/user-operations/hash.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/hash.js +9 -0
- package/dist/src/transactions/user-operations/nonce.d.ts +18 -0
- package/dist/src/transactions/user-operations/nonce.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/nonce.js +43 -0
- package/dist/src/transactions/user-operations/prepare.d.ts +12 -0
- package/dist/src/transactions/user-operations/prepare.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/prepare.js +138 -0
- package/dist/src/transactions/user-operations/reconstruct.d.ts +28 -0
- package/dist/src/transactions/user-operations/reconstruct.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/reconstruct.js +52 -0
- package/dist/src/transactions/user-operations/send.d.ts +3 -0
- package/dist/src/transactions/user-operations/send.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/send.js +8 -0
- package/dist/src/transactions/user-operations/sign.d.ts +3 -0
- package/dist/src/transactions/user-operations/sign.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/sign.js +14 -0
- package/dist/src/transactions/user-operations/status.d.ts +4 -0
- package/dist/src/transactions/user-operations/status.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/status.js +37 -0
- package/dist/src/transactions/user-operations/submit.d.ts +3 -0
- package/dist/src/transactions/user-operations/submit.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/submit.js +8 -0
- package/dist/src/transactions/user-operations/types.d.ts +68 -0
- package/dist/src/transactions/user-operations/types.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/types.js +1 -0
- package/dist/src/transactions/user-operations/validator-account.d.ts +5 -0
- package/dist/src/transactions/user-operations/validator-account.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/validator-account.js +26 -0
- package/dist/src/utils/index.d.ts +9 -4
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +54 -51
- package/package.json +3 -4
- package/dist/src/accounts/hca.d.ts +0 -25
- package/dist/src/accounts/hca.d.ts.map +0 -1
- package/dist/src/accounts/hca.js +0 -148
- package/dist/src/accounts/index.d.ts +0 -64
- package/dist/src/accounts/index.d.ts.map +0 -1
- package/dist/src/accounts/index.js +0 -680
- package/dist/src/accounts/json-rpc/index.d.ts +0 -5
- package/dist/src/accounts/json-rpc/index.d.ts.map +0 -1
- package/dist/src/accounts/json-rpc/index.js +0 -19
- package/dist/src/accounts/json-rpc/providers.d.ts +0 -5
- package/dist/src/accounts/json-rpc/providers.d.ts.map +0 -1
- package/dist/src/accounts/json-rpc/providers.js +0 -16
- package/dist/src/accounts/kernel.d.ts +0 -26
- package/dist/src/accounts/kernel.d.ts.map +0 -1
- package/dist/src/accounts/kernel.js +0 -265
- package/dist/src/accounts/nexus.d.ts +0 -34
- package/dist/src/accounts/nexus.d.ts.map +0 -1
- package/dist/src/accounts/nexus.js +0 -469
- package/dist/src/accounts/safe.d.ts +0 -32
- package/dist/src/accounts/safe.d.ts.map +0 -1
- package/dist/src/accounts/safe.js +0 -337
- package/dist/src/accounts/signing/common.d.ts +0 -38
- package/dist/src/accounts/signing/common.d.ts.map +0 -1
- package/dist/src/accounts/signing/common.js +0 -186
- package/dist/src/accounts/signing/message.d.ts +0 -7
- package/dist/src/accounts/signing/message.d.ts.map +0 -1
- package/dist/src/accounts/signing/message.js +0 -42
- package/dist/src/accounts/signing/passkeys.d.ts +0 -36
- package/dist/src/accounts/signing/passkeys.d.ts.map +0 -1
- package/dist/src/accounts/signing/passkeys.js +0 -119
- package/dist/src/accounts/signing/typedData.d.ts +0 -5
- package/dist/src/accounts/signing/typedData.d.ts.map +0 -1
- package/dist/src/accounts/signing/typedData.js +0 -30
- package/dist/src/accounts/startale.d.ts +0 -25
- package/dist/src/accounts/startale.d.ts.map +0 -1
- package/dist/src/accounts/startale.js +0 -188
- package/dist/src/accounts/utils.d.ts +0 -33
- package/dist/src/accounts/utils.d.ts.map +0 -1
- package/dist/src/accounts/utils.js +0 -202
- package/dist/src/auth/provider.d.ts +0 -7
- package/dist/src/auth/provider.d.ts.map +0 -1
- package/dist/src/auth/provider.js +0 -38
- package/dist/src/execution/compact.d.ts +0 -5
- package/dist/src/execution/compact.d.ts.map +0 -1
- package/dist/src/execution/compact.js +0 -4
- package/dist/src/execution/error.d.ts.map +0 -1
- package/dist/src/execution/index.d.ts +0 -42
- package/dist/src/execution/index.d.ts.map +0 -1
- package/dist/src/execution/index.js +0 -187
- package/dist/src/execution/utils.d.ts +0 -167
- package/dist/src/execution/utils.d.ts.map +0 -1
- package/dist/src/execution/utils.js +0 -1606
- package/dist/src/modules/abi/smart-sessions.d.ts +0 -104
- package/dist/src/modules/abi/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/abi/smart-sessions.js +0 -128
- package/dist/src/modules/chain-abstraction.d.ts +0 -5
- package/dist/src/modules/chain-abstraction.d.ts.map +0 -1
- package/dist/src/modules/chain-abstraction.js +0 -3
- package/dist/src/modules/common.d.ts +0 -30
- package/dist/src/modules/common.d.ts.map +0 -1
- package/dist/src/modules/common.js +0 -30
- package/dist/src/modules/index.d.ts +0 -11
- package/dist/src/modules/index.d.ts.map +0 -1
- package/dist/src/modules/index.js +0 -85
- package/dist/src/modules/legacy.d.ts +0 -10
- package/dist/src/modules/legacy.d.ts.map +0 -1
- package/dist/src/modules/legacy.js +0 -62
- package/dist/src/modules/read.d.ts +0 -11
- package/dist/src/modules/read.d.ts.map +0 -1
- package/dist/src/modules/read.js +0 -219
- package/dist/src/modules/validators/core.d.ts +0 -31
- package/dist/src/modules/validators/core.d.ts.map +0 -1
- package/dist/src/modules/validators/core.js +0 -269
- package/dist/src/modules/validators/cross-chain-permits.d.ts +0 -21
- package/dist/src/modules/validators/cross-chain-permits.d.ts.map +0 -1
- package/dist/src/modules/validators/cross-chain-permits.js +0 -111
- package/dist/src/modules/validators/index.d.ts +0 -4
- package/dist/src/modules/validators/index.d.ts.map +0 -1
- package/dist/src/modules/validators/index.js +0 -3
- package/dist/src/modules/validators/smart-sessions.d.ts +0 -225
- package/dist/src/modules/validators/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/validators/smart-sessions.js +0 -1189
- package/dist/src/orchestrator/caip2.d.ts +0 -20
- package/dist/src/orchestrator/caip2.d.ts.map +0 -1
- package/dist/src/orchestrator/caip2.js +0 -49
- package/dist/src/orchestrator/client.d.ts +0 -29
- package/dist/src/orchestrator/client.d.ts.map +0 -1
- package/dist/src/orchestrator/client.js +0 -290
- package/dist/src/orchestrator/consts.d.ts +0 -6
- package/dist/src/orchestrator/consts.d.ts.map +0 -1
- package/dist/src/orchestrator/consts.js +0 -5
- package/dist/src/orchestrator/destinations.d.ts.map +0 -1
- package/dist/src/orchestrator/destinations.js +0 -59
- package/dist/src/orchestrator/error.d.ts.map +0 -1
- package/dist/src/orchestrator/index.d.ts +0 -13
- package/dist/src/orchestrator/index.d.ts.map +0 -1
- package/dist/src/orchestrator/index.js +0 -10
- package/dist/src/orchestrator/registry.d.ts +0 -17
- package/dist/src/orchestrator/registry.d.ts.map +0 -1
- package/dist/src/orchestrator/registry.js +0 -103
- package/dist/src/orchestrator/types.d.ts.map +0 -1
- package/dist/src/orchestrator/utils.d.ts +0 -3
- package/dist/src/orchestrator/utils.d.ts.map +0 -1
- package/dist/src/orchestrator/utils.js +0 -22
- package/dist/src/orchestrator/wire.d.ts +0 -30
- package/dist/src/orchestrator/wire.d.ts.map +0 -1
- package/dist/src/orchestrator/wire.gen.d.ts.map +0 -1
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/utils/walletClient.d.ts +0 -34
- package/dist/src/utils/walletClient.d.ts.map +0 -1
- package/dist/src/utils/walletClient.js +0 -117
- /package/dist/src/{orchestrator/wire.gen.js → accounts/adapter.js} +0 -0
- /package/dist/src/{types.js → accounts/types.js} +0 -0
- /package/dist/src/{orchestrator/wire.js → api/compose-types.js} +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { concat, encodeAbiParameters, hexToBytes, toHex, } from 'viem';
|
|
2
|
+
export const OWNABLE_VALIDATOR_ADDRESS = '0x000000000013fdb5234e4e3162a810f54d9f7e98';
|
|
3
|
+
export const OWNABLE_V0_VALIDATOR_ADDRESS = '0x2483da3a338895199e5e538530213157e931bf06';
|
|
4
|
+
export const OWNABLE_BETA_VALIDATOR_ADDRESS = '0x0000000000e9e6e96bcaa3c113187cdb7e38aed9';
|
|
5
|
+
export const ECDSA_MOCK_SIGNATURE = '0x81d4b4981670cb18f99f0b4a66446df1bf5b204d24cfcb659bf38ba27a4359b5711649ec2423c5e1247245eba2964679b6a1dbb85c992ae40b9b00c6935b02ff1b';
|
|
6
|
+
function moduleAddress(definition) {
|
|
7
|
+
return definition.module.source === 'explicit'
|
|
8
|
+
? definition.module.address
|
|
9
|
+
: OWNABLE_VALIDATOR_ADDRESS;
|
|
10
|
+
}
|
|
11
|
+
export function resolveOwnableAddresses(input) {
|
|
12
|
+
return {
|
|
13
|
+
kind: 'validator',
|
|
14
|
+
address: input.address ?? OWNABLE_VALIDATOR_ADDRESS,
|
|
15
|
+
initData: encodeAbiParameters([
|
|
16
|
+
{ name: 'threshold', type: 'uint256' },
|
|
17
|
+
{ name: 'owners', type: 'address[]' },
|
|
18
|
+
], [
|
|
19
|
+
BigInt(input.threshold),
|
|
20
|
+
input.owners
|
|
21
|
+
.map((owner) => owner.toLowerCase())
|
|
22
|
+
.sort(),
|
|
23
|
+
]),
|
|
24
|
+
deInitData: '0x',
|
|
25
|
+
additionalContext: '0x',
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export function resolveOwnableValidator(definition) {
|
|
29
|
+
const owners = definition.owners
|
|
30
|
+
.map((owner) => {
|
|
31
|
+
if (owner.kind === 'webauthn') {
|
|
32
|
+
throw new Error('Ownable validator contains a WebAuthn owner');
|
|
33
|
+
}
|
|
34
|
+
return owner.account.address.toLowerCase();
|
|
35
|
+
})
|
|
36
|
+
.sort();
|
|
37
|
+
return resolveOwnableAddresses({
|
|
38
|
+
owners,
|
|
39
|
+
threshold: definition.threshold,
|
|
40
|
+
address: moduleAddress(definition),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
export function encodeOwnableMockSignature(ownerCount) {
|
|
44
|
+
return concat(Array.from({ length: ownerCount }, () => ECDSA_MOCK_SIGNATURE));
|
|
45
|
+
}
|
|
46
|
+
export function encodeEcdsaValidatorContribution(input) {
|
|
47
|
+
if (input.threshold < 1 || input.threshold > input.ownerOrder.length) {
|
|
48
|
+
throw new Error('Validator threshold is outside the configured owner set');
|
|
49
|
+
}
|
|
50
|
+
const configured = new Set(input.ownerOrder);
|
|
51
|
+
const contributions = new Map();
|
|
52
|
+
for (const contribution of input.contributions) {
|
|
53
|
+
if (!configured.has(contribution.ownerId)) {
|
|
54
|
+
throw new Error(`Unknown validator owner ${contribution.ownerId}`);
|
|
55
|
+
}
|
|
56
|
+
if (contributions.has(contribution.ownerId)) {
|
|
57
|
+
throw new Error(`Duplicate validator owner ${contribution.ownerId}`);
|
|
58
|
+
}
|
|
59
|
+
contributions.set(contribution.ownerId, contribution.encoding === 'validator-contribution'
|
|
60
|
+
? contribution.signature
|
|
61
|
+
: encodeEcdsaRecoveryValue(contribution.signature, input.recoveryEncoding));
|
|
62
|
+
}
|
|
63
|
+
const ordered = input.ownerOrder.flatMap((ownerId) => {
|
|
64
|
+
const contribution = contributions.get(ownerId);
|
|
65
|
+
return contribution ? [contribution] : [];
|
|
66
|
+
});
|
|
67
|
+
if (ordered.length < input.threshold) {
|
|
68
|
+
throw new Error(`Insufficient validator contributions: required ${input.threshold}, received ${ordered.length}`);
|
|
69
|
+
}
|
|
70
|
+
return concat(ordered);
|
|
71
|
+
}
|
|
72
|
+
export function encodeEcdsaRecoveryValue(signature, encoding) {
|
|
73
|
+
const bytes = hexToBytes(signature);
|
|
74
|
+
if (bytes.length !== 65) {
|
|
75
|
+
throw new Error('ECDSA signatures must contain 65 bytes');
|
|
76
|
+
}
|
|
77
|
+
const recovery = bytes[64];
|
|
78
|
+
const ethereumRecovery = recovery < 27 ? recovery + 27 : recovery;
|
|
79
|
+
const encodedRecovery = encoding === 'validator-offset-4' ? ethereumRecovery + 4 : ethereumRecovery;
|
|
80
|
+
if (encodedRecovery > 255) {
|
|
81
|
+
throw new Error('ECDSA recovery value does not fit in one byte');
|
|
82
|
+
}
|
|
83
|
+
return concat([signature.slice(0, -2), toHex(encodedRecovery)]);
|
|
84
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Permission, ScopedAction } from '
|
|
1
|
+
import type { Permission, ScopedAction } from './smart-sessions/types.js';
|
|
2
2
|
export declare const FAR_FUTURE_MS = 4102444800000;
|
|
3
3
|
declare function resolvePermission(permission: Permission): ScopedAction[];
|
|
4
4
|
declare function resolvePermissions(permissions: readonly Permission[]): ScopedAction[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../../modules/validators/permissions.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAEV,UAAU,
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../../modules/validators/permissions.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAEV,UAAU,EACV,YAAY,EAGb,MAAM,wBAAwB,CAAA;AAiH/B,eAAO,MAAM,aAAa,gBAAoB,CAAA;AAE9C,iBAAS,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,YAAY,EAAE,CA0NjE;AAkBD,iBAAS,kBAAkB,CACzB,WAAW,EAAE,SAAS,UAAU,EAAE,GACjC,YAAY,EAAE,CAwBhB;AAED,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import type { Address } from 'viem';
|
|
2
|
-
import type { CrossChainSettlementLayer } from '
|
|
2
|
+
import type { CrossChainSettlementLayer } from '../../smart-sessions/types.js';
|
|
3
3
|
/**
|
|
4
|
-
* Collects every distinct arbiter address
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Collects every distinct arbiter address for the given settlement layers. The
|
|
5
|
+
* resulting whitelist is what the Permit2 claim policy enforces on-chain — a
|
|
6
|
+
* session signed once with this whitelist is valid against any of those
|
|
7
|
+
* arbiters.
|
|
8
8
|
*
|
|
9
|
-
* **"Any" means any of the *supported* settlement layers**, not any
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* stays meaningful (the worst case is still a Rhinestone-blessed
|
|
14
|
-
* arbiter). To get a truly unrestricted whitelist a caller would have
|
|
15
|
-
* to bypass this helper entirely.
|
|
9
|
+
* **"Any" means any of the *supported* settlement layers**, not any address on
|
|
10
|
+
* earth. When `layers` is empty or undefined, this expands to the union of
|
|
11
|
+
* every layer in {@link SETTLEMENT_LAYER_CONTRACT_KEYS}, so the on-chain arbiter
|
|
12
|
+
* check stays meaningful (the worst case is still a Rhinestone-blessed arbiter).
|
|
16
13
|
*
|
|
17
14
|
* @param layers Settlement layers the session is permitted to use.
|
|
18
15
|
* Empty/undefined ⇒ all supported layers.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arbiters.d.ts","sourceRoot":"","sources":["../../../../../../modules/validators/policies/claim/arbiters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"arbiters.d.ts","sourceRoot":"","sources":["../../../../../../modules/validators/policies/claim/arbiters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAA;AAoD3E;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,SAAS,yBAAyB,EAAE,GAAG,SAAS,EACxD,eAAe,CAAC,EAAE,OAAO,GACxB,OAAO,EAAE,GAAG,SAAS,CA6BvB"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { contractAddresses, contractAddressesDev, } from '@rhinestone/shared-configs';
|
|
2
1
|
/**
|
|
3
|
-
* The contract
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* regardless of which one the orchestrator picks at intent time.
|
|
2
|
+
* The arbiter contract keys that each settlement layer expands to. `ACROSS`
|
|
3
|
+
* whitelists both arbiter impls so a session is permissioned for the 7579 and
|
|
4
|
+
* multicall paths regardless of which one the orchestrator picks at intent time.
|
|
7
5
|
*/
|
|
8
6
|
const SETTLEMENT_LAYER_CONTRACT_KEYS = {
|
|
9
7
|
SAME_CHAIN: ['samechainArbiter'],
|
|
@@ -11,18 +9,47 @@ const SETTLEMENT_LAYER_CONTRACT_KEYS = {
|
|
|
11
9
|
ACROSS: ['across7579Arbiter', 'acrossMulticallArbiter'],
|
|
12
10
|
};
|
|
13
11
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* is what the Permit2 claim policy enforces on-chain — a session signed
|
|
17
|
-
* once with this whitelist is valid against any of those arbiters.
|
|
12
|
+
* Bundled arbiter allow-set — the deployed arbiter addresses per key, per
|
|
13
|
+
* environment (the union across chains).
|
|
18
14
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
15
|
+
* v2: this is a small, signed-path **constant** bundled in the SDK rather than
|
|
16
|
+
* read from `@rhinestone/shared-configs`. The arbiter is baked into the user's
|
|
17
|
+
* Permit2 session signature, so it must stay **client-trusted** — never sourced
|
|
18
|
+
* from the orchestrator you transact against. Rhinestone's arbiters are CREATE2
|
|
19
|
+
* and near-uniform across chains, so this is a handful of addresses per key
|
|
20
|
+
* (e.g. `ecoArbiter` has a mainnet and a testnet address). A new *chain* reuses
|
|
21
|
+
* these; only a contract redeploy or a new settlement layer changes them.
|
|
22
|
+
*/
|
|
23
|
+
const ARBITER_ADDRESSES = {
|
|
24
|
+
prod: {
|
|
25
|
+
samechainArbiter: ['0x000000000006e2569CaF8Ff021810790e0A0D740'],
|
|
26
|
+
ecoArbiter: [
|
|
27
|
+
'0x2e7627CCfAe4eDb336eEb5a70f08415B0F1a2b8C',
|
|
28
|
+
'0xA212A6ACCC8db0e4cdf4394D0A851c70Fc27A8F0',
|
|
29
|
+
],
|
|
30
|
+
across7579Arbiter: ['0x28a4D41776968c1201A807ec51fFB405362B8882'],
|
|
31
|
+
acrossMulticallArbiter: ['0xA162fabb9a0EeF2736485A587aAAB3d015e14224'],
|
|
32
|
+
},
|
|
33
|
+
dev: {
|
|
34
|
+
samechainArbiter: ['0x8fA7720Eee299223f25De8DC03C68A28541dCD10'],
|
|
35
|
+
ecoArbiter: [
|
|
36
|
+
'0x1BeBAfb3D05d84A5Bfd94800c88d1342f755d8AB',
|
|
37
|
+
'0x8A061029AE4c5Cf69b5368119B3b0C80B31F55fE',
|
|
38
|
+
],
|
|
39
|
+
across7579Arbiter: ['0x1b19973F7a29E950ad4FaF8872745B6378005517'],
|
|
40
|
+
acrossMulticallArbiter: ['0x8343FBBA0526deC1c952A098057021027648bcf9'],
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Collects every distinct arbiter address for the given settlement layers. The
|
|
45
|
+
* resulting whitelist is what the Permit2 claim policy enforces on-chain — a
|
|
46
|
+
* session signed once with this whitelist is valid against any of those
|
|
47
|
+
* arbiters.
|
|
48
|
+
*
|
|
49
|
+
* **"Any" means any of the *supported* settlement layers**, not any address on
|
|
50
|
+
* earth. When `layers` is empty or undefined, this expands to the union of
|
|
51
|
+
* every layer in {@link SETTLEMENT_LAYER_CONTRACT_KEYS}, so the on-chain arbiter
|
|
52
|
+
* check stays meaningful (the worst case is still a Rhinestone-blessed arbiter).
|
|
26
53
|
*
|
|
27
54
|
* @param layers Settlement layers the session is permitted to use.
|
|
28
55
|
* Empty/undefined ⇒ all supported layers.
|
|
@@ -32,20 +59,18 @@ export function getArbitersForSettlementLayers(layers, useDevContracts) {
|
|
|
32
59
|
const effectiveLayers = !layers || layers.length === 0
|
|
33
60
|
? Object.keys(SETTLEMENT_LAYER_CONTRACT_KEYS)
|
|
34
61
|
: layers;
|
|
35
|
-
const
|
|
62
|
+
const book = ARBITER_ADDRESSES[useDevContracts ? 'dev' : 'prod'];
|
|
36
63
|
const keys = effectiveLayers.flatMap((l) => SETTLEMENT_LAYER_CONTRACT_KEYS[l]);
|
|
37
64
|
const seen = new Set();
|
|
38
65
|
const addresses = [];
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
for
|
|
46
|
-
|
|
47
|
-
if (!addr)
|
|
48
|
-
continue;
|
|
66
|
+
// The same logical arbiter often shares an address across chains, but a given
|
|
67
|
+
// key may have multiple addresses live (e.g. a mainnet + testnet deployment).
|
|
68
|
+
// Collect every unique address for the requested keys, deduped
|
|
69
|
+
// case-insensitively.
|
|
70
|
+
for (const key of keys) {
|
|
71
|
+
// `keys` are `SETTLEMENT_LAYER_CONTRACT_KEYS` values, so `book` always has
|
|
72
|
+
// an entry for each — no missing-key fallback needed.
|
|
73
|
+
for (const addr of book[key]) {
|
|
49
74
|
const norm = addr.toLowerCase();
|
|
50
75
|
if (seen.has(norm))
|
|
51
76
|
continue;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ResolvedModule } from '../types.js';
|
|
2
|
+
import type { AtomicValidatorDefinition, ResolvedValidatorDefinition } from './types.js';
|
|
3
|
+
export declare function resolveAtomicValidator(definition: AtomicValidatorDefinition): ResolvedModule;
|
|
4
|
+
export declare function resolveValidator(definition: ResolvedValidatorDefinition): ResolvedModule;
|
|
5
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../../modules/validators/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAI9C,OAAO,KAAK,EACV,yBAAyB,EACzB,2BAA2B,EAC5B,MAAM,SAAS,CAAA;AAGhB,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,yBAAyB,GACpC,cAAc,CAYhB;AAED,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,2BAA2B,GACtC,cAAc,CAIhB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { resolveEnsValidator } from './ens.js';
|
|
2
|
+
import { resolveMultiFactorValidator } from './multi-factor.js';
|
|
3
|
+
import { resolveOwnableValidator } from './ownable.js';
|
|
4
|
+
import { resolveWebauthnValidator } from './webauthn.js';
|
|
5
|
+
export function resolveAtomicValidator(definition) {
|
|
6
|
+
switch (definition.kind) {
|
|
7
|
+
case 'ecdsa':
|
|
8
|
+
return resolveOwnableValidator(definition);
|
|
9
|
+
case 'ens':
|
|
10
|
+
return resolveEnsValidator(definition);
|
|
11
|
+
case 'passkey':
|
|
12
|
+
return resolveWebauthnValidator(definition);
|
|
13
|
+
case 'k1':
|
|
14
|
+
case 'smart-session':
|
|
15
|
+
throw new Error(`Validator ${definition.kind} requires feature input`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export function resolveValidator(definition) {
|
|
19
|
+
return definition.kind === 'multi-factor'
|
|
20
|
+
? resolveMultiFactorValidator(definition, resolveAtomicValidator)
|
|
21
|
+
: resolveAtomicValidator(definition);
|
|
22
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Account, Address, Hex } from 'viem';
|
|
2
|
+
import type { WebAuthnAccount } from 'viem/account-abstraction';
|
|
3
|
+
export declare function ecdsaSignerId(account: Account | Address): string;
|
|
4
|
+
export declare function webauthnSignerId(account: WebAuthnAccount | Hex): string;
|
|
5
|
+
//# sourceMappingURL=signer-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signer-id.d.ts","sourceRoot":"","sources":["../../../../modules/validators/signer-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE/D,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAGhE;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,GAAG,GAAG,MAAM,CAGvE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function ecdsaSignerId(account) {
|
|
2
|
+
const address = typeof account === 'string' ? account : account.address;
|
|
3
|
+
return `ecdsa:${address.toLowerCase()}`;
|
|
4
|
+
}
|
|
5
|
+
export function webauthnSignerId(account) {
|
|
6
|
+
const publicKey = typeof account === 'string' ? account : account.publicKey;
|
|
7
|
+
return `webauthn:${publicKey.toLowerCase()}`;
|
|
8
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Address, Hex } from 'viem';
|
|
2
|
+
interface SmartSessionPolicyData {
|
|
3
|
+
readonly policy: Address;
|
|
4
|
+
readonly initData: Hex;
|
|
5
|
+
}
|
|
6
|
+
interface SmartSessionActionData {
|
|
7
|
+
readonly actionTargetSelector: Hex;
|
|
8
|
+
readonly actionTarget: Address;
|
|
9
|
+
readonly actionPolicies: readonly SmartSessionPolicyData[];
|
|
10
|
+
}
|
|
11
|
+
interface SmartSessionErc7739PolicyData {
|
|
12
|
+
readonly allowedERC7739Content: readonly {
|
|
13
|
+
readonly appDomainSeparator: Hex;
|
|
14
|
+
readonly contentNames: readonly string[];
|
|
15
|
+
}[];
|
|
16
|
+
readonly erc1271Policies: readonly SmartSessionPolicyData[];
|
|
17
|
+
}
|
|
18
|
+
export interface SmartSessionEnableContributionData {
|
|
19
|
+
readonly userSignature: Hex;
|
|
20
|
+
readonly hashesAndChainIds: readonly {
|
|
21
|
+
readonly chainId: bigint;
|
|
22
|
+
readonly sessionDigest: Hex;
|
|
23
|
+
}[];
|
|
24
|
+
readonly sessionToEnableIndex: number;
|
|
25
|
+
readonly session: {
|
|
26
|
+
readonly sessionValidator: Address;
|
|
27
|
+
readonly sessionValidatorInitData: Hex;
|
|
28
|
+
readonly salt: Hex;
|
|
29
|
+
readonly erc7739Policies: SmartSessionErc7739PolicyData;
|
|
30
|
+
readonly actions: readonly SmartSessionActionData[];
|
|
31
|
+
readonly claimPolicies: readonly SmartSessionPolicyData[];
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=smart-session-signature-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-session-signature-types.d.ts","sourceRoot":"","sources":["../../../../modules/validators/smart-session-signature-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAExC,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAA;CACvB;AAED,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,oBAAoB,EAAE,GAAG,CAAA;IAClC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,cAAc,EAAE,SAAS,sBAAsB,EAAE,CAAA;CAC3D;AAED,UAAU,6BAA6B;IACrC,QAAQ,CAAC,qBAAqB,EAAE,SAAS;QACvC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,CAAA;QAChC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;KACzC,EAAE,CAAA;IACH,QAAQ,CAAC,eAAe,EAAE,SAAS,sBAAsB,EAAE,CAAA;CAC5D;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,aAAa,EAAE,GAAG,CAAA;IAC3B,QAAQ,CAAC,iBAAiB,EAAE,SAAS;QACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;QACxB,QAAQ,CAAC,aAAa,EAAE,GAAG,CAAA;KAC5B,EAAE,CAAA;IACH,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAA;IACrC,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAA;QAClC,QAAQ,CAAC,wBAAwB,EAAE,GAAG,CAAA;QACtC,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAA;QAClB,QAAQ,CAAC,eAAe,EAAE,6BAA6B,CAAA;QACvD,QAAQ,CAAC,OAAO,EAAE,SAAS,sBAAsB,EAAE,CAAA;QACnD,QAAQ,CAAC,aAAa,EAAE,SAAS,sBAAsB,EAAE,CAAA;KAC1D,CAAA;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { type Address } from 'viem';
|
|
2
|
+
import type { Session, SessionDetails } from './types.js';
|
|
3
|
+
export declare const SESSION_LOCK_TAG: "0x000000000000000000000000";
|
|
4
|
+
export declare const types: {
|
|
5
|
+
readonly PolicyData: readonly [{
|
|
6
|
+
readonly name: "policy";
|
|
7
|
+
readonly type: "address";
|
|
8
|
+
}, {
|
|
9
|
+
readonly name: "initData";
|
|
10
|
+
readonly type: "bytes";
|
|
11
|
+
}];
|
|
12
|
+
readonly ActionData: readonly [{
|
|
13
|
+
readonly name: "actionTargetSelector";
|
|
14
|
+
readonly type: "bytes4";
|
|
15
|
+
}, {
|
|
16
|
+
readonly name: "actionTarget";
|
|
17
|
+
readonly type: "address";
|
|
18
|
+
}, {
|
|
19
|
+
readonly name: "actionPolicies";
|
|
20
|
+
readonly type: "PolicyData[]";
|
|
21
|
+
}];
|
|
22
|
+
readonly ERC7739Context: readonly [{
|
|
23
|
+
readonly name: "appDomainSeparator";
|
|
24
|
+
readonly type: "bytes32";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "contentName";
|
|
27
|
+
readonly type: "string[]";
|
|
28
|
+
}];
|
|
29
|
+
readonly ERC7739Data: readonly [{
|
|
30
|
+
readonly name: "allowedERC7739Content";
|
|
31
|
+
readonly type: "ERC7739Context[]";
|
|
32
|
+
}, {
|
|
33
|
+
readonly name: "erc1271Policies";
|
|
34
|
+
readonly type: "PolicyData[]";
|
|
35
|
+
}];
|
|
36
|
+
readonly LockTagData: readonly [{
|
|
37
|
+
readonly name: "lockTag";
|
|
38
|
+
readonly type: "bytes12";
|
|
39
|
+
}, {
|
|
40
|
+
readonly name: "claimPolicies";
|
|
41
|
+
readonly type: "PolicyData[]";
|
|
42
|
+
}];
|
|
43
|
+
readonly SignedPermissions: readonly [{
|
|
44
|
+
readonly name: "actions";
|
|
45
|
+
readonly type: "ActionData[]";
|
|
46
|
+
}, {
|
|
47
|
+
readonly name: "erc7739Policies";
|
|
48
|
+
readonly type: "ERC7739Data";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "lockTagPolicies";
|
|
51
|
+
readonly type: "LockTagData";
|
|
52
|
+
}, {
|
|
53
|
+
readonly name: "permitGenericPolicy";
|
|
54
|
+
readonly type: "bool";
|
|
55
|
+
}];
|
|
56
|
+
readonly SignedSession: readonly [{
|
|
57
|
+
readonly name: "account";
|
|
58
|
+
readonly type: "address";
|
|
59
|
+
}, {
|
|
60
|
+
readonly name: "expires";
|
|
61
|
+
readonly type: "uint256";
|
|
62
|
+
}, {
|
|
63
|
+
readonly name: "nonce";
|
|
64
|
+
readonly type: "uint256";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "permissions";
|
|
67
|
+
readonly type: "SignedPermissions";
|
|
68
|
+
}, {
|
|
69
|
+
readonly name: "salt";
|
|
70
|
+
readonly type: "bytes32";
|
|
71
|
+
}, {
|
|
72
|
+
readonly name: "sessionValidator";
|
|
73
|
+
readonly type: "address";
|
|
74
|
+
}, {
|
|
75
|
+
readonly name: "sessionValidatorInitData";
|
|
76
|
+
readonly type: "bytes";
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "smartSessionEmissary";
|
|
79
|
+
readonly type: "address";
|
|
80
|
+
}];
|
|
81
|
+
readonly ChainSession: readonly [{
|
|
82
|
+
readonly name: "chainId";
|
|
83
|
+
readonly type: "uint64";
|
|
84
|
+
}, {
|
|
85
|
+
readonly name: "session";
|
|
86
|
+
readonly type: "SignedSession";
|
|
87
|
+
}];
|
|
88
|
+
readonly MultiChainSession: readonly [{
|
|
89
|
+
readonly name: "sessionsAndChainIds";
|
|
90
|
+
readonly type: "ChainSession[]";
|
|
91
|
+
}];
|
|
92
|
+
};
|
|
93
|
+
export declare function getSessionDetails(input: {
|
|
94
|
+
readonly account: Address;
|
|
95
|
+
readonly sessions: readonly Session[];
|
|
96
|
+
readonly environment: 'production' | 'development';
|
|
97
|
+
readonly readNonce: (session: Session) => Promise<bigint>;
|
|
98
|
+
}): Promise<SessionDetails>;
|
|
99
|
+
//# sourceMappingURL=authorization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../../../../../modules/validators/smart-sessions/authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAIb,MAAM,MAAM,CAAA;AAOb,OAAO,KAAK,EAAE,OAAO,EAAe,cAAc,EAAE,MAAM,SAAS,CAAA;AAEnE,eAAO,MAAM,gBAAgB,EAAG,4BAAqC,CAAA;AAErE,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CR,CAAA;AAyCV,wBAAsB,iBAAiB,CAAC,KAAK,EAAE;IAC7C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAA;IACrC,QAAQ,CAAC,WAAW,EAAE,YAAY,GAAG,aAAa,CAAA;IAClD,QAAQ,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CAC1D,GAAG,OAAO,CAAC,cAAc,CAAC,CA8B1B"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { hashStruct, maxUint256, } from 'viem';
|
|
2
|
+
import { getSessionData } from './digest.js';
|
|
3
|
+
import { getSmartSessionEmissaryAddress } from './module.js';
|
|
4
|
+
import { SMART_SESSIONS_FALLBACK_TARGET_FLAG, SMART_SESSIONS_FALLBACK_TARGET_SELECTOR_FLAG, } from './resolve.js';
|
|
5
|
+
export const SESSION_LOCK_TAG = '0x000000000000000000000000';
|
|
6
|
+
export const types = {
|
|
7
|
+
PolicyData: [
|
|
8
|
+
{ name: 'policy', type: 'address' },
|
|
9
|
+
{ name: 'initData', type: 'bytes' },
|
|
10
|
+
],
|
|
11
|
+
ActionData: [
|
|
12
|
+
{ name: 'actionTargetSelector', type: 'bytes4' },
|
|
13
|
+
{ name: 'actionTarget', type: 'address' },
|
|
14
|
+
{ name: 'actionPolicies', type: 'PolicyData[]' },
|
|
15
|
+
],
|
|
16
|
+
ERC7739Context: [
|
|
17
|
+
{ name: 'appDomainSeparator', type: 'bytes32' },
|
|
18
|
+
{ name: 'contentName', type: 'string[]' },
|
|
19
|
+
],
|
|
20
|
+
ERC7739Data: [
|
|
21
|
+
{ name: 'allowedERC7739Content', type: 'ERC7739Context[]' },
|
|
22
|
+
{ name: 'erc1271Policies', type: 'PolicyData[]' },
|
|
23
|
+
],
|
|
24
|
+
LockTagData: [
|
|
25
|
+
{ name: 'lockTag', type: 'bytes12' },
|
|
26
|
+
{ name: 'claimPolicies', type: 'PolicyData[]' },
|
|
27
|
+
],
|
|
28
|
+
SignedPermissions: [
|
|
29
|
+
{ name: 'actions', type: 'ActionData[]' },
|
|
30
|
+
{ name: 'erc7739Policies', type: 'ERC7739Data' },
|
|
31
|
+
{ name: 'lockTagPolicies', type: 'LockTagData' },
|
|
32
|
+
{ name: 'permitGenericPolicy', type: 'bool' },
|
|
33
|
+
],
|
|
34
|
+
SignedSession: [
|
|
35
|
+
{ name: 'account', type: 'address' },
|
|
36
|
+
{ name: 'expires', type: 'uint256' },
|
|
37
|
+
{ name: 'nonce', type: 'uint256' },
|
|
38
|
+
{ name: 'permissions', type: 'SignedPermissions' },
|
|
39
|
+
{ name: 'salt', type: 'bytes32' },
|
|
40
|
+
{ name: 'sessionValidator', type: 'address' },
|
|
41
|
+
{ name: 'sessionValidatorInitData', type: 'bytes' },
|
|
42
|
+
{ name: 'smartSessionEmissary', type: 'address' },
|
|
43
|
+
],
|
|
44
|
+
ChainSession: [
|
|
45
|
+
{ name: 'chainId', type: 'uint64' },
|
|
46
|
+
{ name: 'session', type: 'SignedSession' },
|
|
47
|
+
],
|
|
48
|
+
MultiChainSession: [{ name: 'sessionsAndChainIds', type: 'ChainSession[]' }],
|
|
49
|
+
};
|
|
50
|
+
function signedSession(account, data, nonce, environment) {
|
|
51
|
+
return {
|
|
52
|
+
account,
|
|
53
|
+
permissions: {
|
|
54
|
+
permitGenericPolicy: data.actions.some((action) => action.actionTarget === SMART_SESSIONS_FALLBACK_TARGET_FLAG &&
|
|
55
|
+
action.actionTargetSelector ===
|
|
56
|
+
SMART_SESSIONS_FALLBACK_TARGET_SELECTOR_FLAG),
|
|
57
|
+
lockTagPolicies: {
|
|
58
|
+
lockTag: SESSION_LOCK_TAG,
|
|
59
|
+
claimPolicies: data.claimPolicies,
|
|
60
|
+
},
|
|
61
|
+
erc7739Policies: {
|
|
62
|
+
allowedERC7739Content: data.erc7739Policies.allowedERC7739Content.map((content) => ({
|
|
63
|
+
contentName: content.contentNames,
|
|
64
|
+
appDomainSeparator: content.appDomainSeparator,
|
|
65
|
+
})),
|
|
66
|
+
erc1271Policies: data.erc7739Policies.erc1271Policies,
|
|
67
|
+
},
|
|
68
|
+
actions: data.actions,
|
|
69
|
+
},
|
|
70
|
+
sessionValidator: data.sessionValidator,
|
|
71
|
+
sessionValidatorInitData: data.sessionValidatorInitData,
|
|
72
|
+
salt: data.salt,
|
|
73
|
+
smartSessionEmissary: getSmartSessionEmissaryAddress(environment),
|
|
74
|
+
expires: maxUint256,
|
|
75
|
+
nonce,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export async function getSessionDetails(input) {
|
|
79
|
+
const nonces = await Promise.all(input.sessions.map(input.readNonce));
|
|
80
|
+
const signed = input.sessions.map((session, index) => signedSession(input.account, getSessionData(session), nonces[index], input.environment));
|
|
81
|
+
const hashesAndChainIds = signed.map((session, index) => ({
|
|
82
|
+
chainId: BigInt(input.sessions[index].chain.id),
|
|
83
|
+
sessionDigest: hashStruct({
|
|
84
|
+
types,
|
|
85
|
+
primaryType: 'SignedSession',
|
|
86
|
+
data: session,
|
|
87
|
+
}),
|
|
88
|
+
}));
|
|
89
|
+
const data = {
|
|
90
|
+
domain: { name: 'SmartSessionEmissary', version: '1' },
|
|
91
|
+
types,
|
|
92
|
+
primaryType: 'MultiChainSession',
|
|
93
|
+
message: {
|
|
94
|
+
sessionsAndChainIds: signed.map((session, index) => ({
|
|
95
|
+
chainId: BigInt(input.sessions[index].chain.id),
|
|
96
|
+
session,
|
|
97
|
+
})),
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
return { nonces, hashesAndChainIds, data };
|
|
101
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
import type { Call } from '../../../calls/types.js';
|
|
3
|
+
import type { ChainDigest, Session } from './types.js';
|
|
4
|
+
export declare function encodeEnableSessionCall(input: {
|
|
5
|
+
readonly account: Address;
|
|
6
|
+
readonly session: Session;
|
|
7
|
+
readonly userSignature: Hex;
|
|
8
|
+
readonly hashesAndChainIds: readonly ChainDigest[];
|
|
9
|
+
readonly sessionToEnableIndex: number;
|
|
10
|
+
readonly environment: 'production' | 'development';
|
|
11
|
+
}): Call;
|
|
12
|
+
export declare function encodeDisableSessionCall(input: {
|
|
13
|
+
readonly account: Address;
|
|
14
|
+
readonly session: Session;
|
|
15
|
+
readonly expires: bigint;
|
|
16
|
+
readonly nonce: bigint;
|
|
17
|
+
readonly environment: 'production' | 'development';
|
|
18
|
+
}): Call;
|
|
19
|
+
//# sourceMappingURL=calls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calls.d.ts","sourceRoot":"","sources":["../../../../../modules/validators/smart-sessions/calls.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAGZ,KAAK,GAAG,EAKT,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAKhD,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAgBnD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,aAAa,EAAE,GAAG,CAAA;IAC3B,QAAQ,CAAC,iBAAiB,EAAE,SAAS,WAAW,EAAE,CAAA;IAClD,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAA;IACrC,QAAQ,CAAC,WAAW,EAAE,YAAY,GAAG,aAAa,CAAA;CACnD,GAAG,IAAI,CAwBP;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,EAAE,YAAY,GAAG,aAAa,CAAA;CACnD,GAAG,IAAI,CAgDP"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { encodeAbiParameters, encodeFunctionData, keccak256, maxUint256, zeroAddress, zeroHash, } from 'viem';
|
|
2
|
+
import smartSessionEmissaryAbi from '../../abi/smart-session-emissary.js';
|
|
3
|
+
import { SESSION_LOCK_TAG } from './authorization.js';
|
|
4
|
+
import { getPermissionId, getSessionData } from './digest.js';
|
|
5
|
+
import { getSmartSessionEmissaryAddress } from './module.js';
|
|
6
|
+
const SCOPE_MULTICHAIN = 0;
|
|
7
|
+
const RESET_PERIOD_ONE_WEEK = 6;
|
|
8
|
+
const SIGNED_PERMISSION_DISABLE_TYPEHASH = '0x098b3120e60a8adc9d970dec9c1f8796974a3ab6154f995ad56ee7b9a38d8836';
|
|
9
|
+
function config(permissionId) {
|
|
10
|
+
return {
|
|
11
|
+
scope: SCOPE_MULTICHAIN,
|
|
12
|
+
resetPeriod: RESET_PERIOD_ONE_WEEK,
|
|
13
|
+
allocator: zeroAddress,
|
|
14
|
+
permissionId,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function encodeEnableSessionCall(input) {
|
|
18
|
+
const permissionId = getPermissionId(input.session);
|
|
19
|
+
return {
|
|
20
|
+
target: getSmartSessionEmissaryAddress(input.environment),
|
|
21
|
+
value: 0n,
|
|
22
|
+
data: encodeFunctionData({
|
|
23
|
+
abi: smartSessionEmissaryAbi,
|
|
24
|
+
functionName: 'setConfig',
|
|
25
|
+
args: [
|
|
26
|
+
input.account,
|
|
27
|
+
config(permissionId),
|
|
28
|
+
{
|
|
29
|
+
allocatorSig: zeroHash,
|
|
30
|
+
userSig: input.userSignature,
|
|
31
|
+
expires: maxUint256,
|
|
32
|
+
session: {
|
|
33
|
+
chainDigestIndex: input.sessionToEnableIndex,
|
|
34
|
+
hashesAndChainIds: [...input.hashesAndChainIds],
|
|
35
|
+
sessionToEnable: getSessionData(input.session),
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
}),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export function encodeDisableSessionCall(input) {
|
|
43
|
+
const permissionId = getPermissionId(input.session);
|
|
44
|
+
const disableDigest = keccak256(encodeAbiParameters([
|
|
45
|
+
{ type: 'bytes32' },
|
|
46
|
+
{ type: 'address' },
|
|
47
|
+
{ type: 'bytes32' },
|
|
48
|
+
{ type: 'bytes12' },
|
|
49
|
+
{ type: 'uint256' },
|
|
50
|
+
{ type: 'uint256' },
|
|
51
|
+
], [
|
|
52
|
+
SIGNED_PERMISSION_DISABLE_TYPEHASH,
|
|
53
|
+
input.account,
|
|
54
|
+
permissionId,
|
|
55
|
+
SESSION_LOCK_TAG,
|
|
56
|
+
input.expires,
|
|
57
|
+
input.nonce,
|
|
58
|
+
]));
|
|
59
|
+
return {
|
|
60
|
+
target: getSmartSessionEmissaryAddress(input.environment),
|
|
61
|
+
value: 0n,
|
|
62
|
+
data: encodeFunctionData({
|
|
63
|
+
abi: smartSessionEmissaryAbi,
|
|
64
|
+
functionName: 'removeConfig',
|
|
65
|
+
args: [
|
|
66
|
+
input.account,
|
|
67
|
+
config(permissionId),
|
|
68
|
+
{
|
|
69
|
+
allocatorSig: '0x',
|
|
70
|
+
userSig: '0x',
|
|
71
|
+
expires: input.expires,
|
|
72
|
+
session: {
|
|
73
|
+
chainDigestIndex: 0,
|
|
74
|
+
hashesAndChainIds: [
|
|
75
|
+
{
|
|
76
|
+
chainId: BigInt(input.session.chain.id),
|
|
77
|
+
sessionDigest: disableDigest,
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
}),
|
|
84
|
+
};
|
|
85
|
+
}
|