@rhinestone/sdk 2.0.0-beta.8 → 2.0.0
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 +16 -0
- package/dist/src/accounts/adapters/nexus.d.ts.map +1 -0
- package/dist/src/accounts/adapters/nexus.js +212 -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 +3 -10
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/error.js +5 -11
- 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/types.js +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 +158 -0
- package/dist/src/actions/smart-sessions.d.ts +30 -6
- package/dist/src/actions/smart-sessions.d.ts.map +1 -1
- package/dist/src/actions/smart-sessions.js +69 -18
- 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 +637 -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-types.js +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/chains/non-evm.d.ts +26 -0
- 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/clients/orchestrator/errors.d.ts +238 -0
- package/dist/src/clients/orchestrator/errors.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/errors.js +525 -0
- 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} +115 -42
- package/dist/src/clients/orchestrator/public.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/public.js +14 -0
- package/dist/src/clients/orchestrator/types.d.ts +144 -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/clients/orchestrator/wire.gen.d.ts +6463 -0
- 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/config/account.d.ts +743 -0
- 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} +43 -12
- package/dist/src/errors/execution.d.ts.map +1 -0
- package/dist/src/errors/execution.js +123 -0
- package/dist/src/errors/index.d.ts +6 -4
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +7 -6
- package/dist/src/index.d.ts +14 -83
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -290
- package/dist/src/jwt-server/jcs.d.ts +1 -1
- package/dist/src/jwt-server/jcs.js +4 -2
- 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 +2 -1
- package/dist/src/modules/validators/permissions.d.ts.map +1 -1
- package/dist/src/modules/validators/permissions.js +192 -18
- package/dist/src/modules/validators/policies/claim/arbiters.d.ts +19 -0
- package/dist/src/modules/validators/policies/claim/arbiters.d.ts.map +1 -0
- package/dist/src/modules/validators/policies/claim/arbiters.js +82 -0
- 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 +16 -0
- package/dist/src/smart-sessions/index.d.ts.map +1 -0
- package/dist/src/smart-sessions/index.js +45 -0
- 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 +136 -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 +68 -4
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +113 -51
- package/package.json +6 -11
- package/dist/src/accounts/index.d.ts +0 -51
- package/dist/src/accounts/index.d.ts.map +0 -1
- package/dist/src/accounts/index.js +0 -589
- 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 -27
- package/dist/src/accounts/kernel.d.ts.map +0 -1
- package/dist/src/accounts/kernel.js +0 -272
- package/dist/src/accounts/nexus.d.ts +0 -33
- package/dist/src/accounts/nexus.d.ts.map +0 -1
- package/dist/src/accounts/nexus.js +0 -444
- package/dist/src/accounts/safe.d.ts +0 -33
- package/dist/src/accounts/safe.d.ts.map +0 -1
- package/dist/src/accounts/safe.js +0 -343
- package/dist/src/accounts/signing/common.d.ts +0 -32
- package/dist/src/accounts/signing/common.d.ts.map +0 -1
- package/dist/src/accounts/signing/common.js +0 -184
- 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 -45
- 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 -33
- package/dist/src/accounts/startale.d.ts +0 -26
- package/dist/src/accounts/startale.d.ts.map +0 -1
- package/dist/src/accounts/startale.js +0 -191
- 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/actions/recovery.d.ts +0 -33
- package/dist/src/actions/recovery.d.ts.map +0 -1
- package/dist/src/actions/recovery.js +0 -189
- 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/error.js +0 -85
- package/dist/src/execution/index.d.ts +0 -41
- package/dist/src/execution/index.d.ts.map +0 -1
- package/dist/src/execution/index.js +0 -202
- package/dist/src/execution/utils.d.ts +0 -126
- package/dist/src/execution/utils.d.ts.map +0 -1
- package/dist/src/execution/utils.js +0 -1054
- 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 -90
- 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 -10
- package/dist/src/modules/read.d.ts.map +0 -1
- package/dist/src/modules/read.js +0 -171
- 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 -266
- 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 -196
- package/dist/src/modules/validators/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/validators/smart-sessions.js +0 -772
- package/dist/src/orchestrator/caip2.d.ts +0 -7
- package/dist/src/orchestrator/caip2.d.ts.map +0 -1
- package/dist/src/orchestrator/caip2.js +0 -17
- 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 -291
- 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/error.d.ts +0 -97
- package/dist/src/orchestrator/error.d.ts.map +0 -1
- package/dist/src/orchestrator/error.js +0 -173
- package/dist/src/orchestrator/index.d.ts +0 -11
- package/dist/src/orchestrator/index.d.ts.map +0 -1
- package/dist/src/orchestrator/index.js +0 -9
- package/dist/src/orchestrator/registry.d.ts +0 -16
- package/dist/src/orchestrator/registry.d.ts.map +0 -1
- package/dist/src/orchestrator/registry.js +0 -90
- package/dist/src/orchestrator/types.d.ts.map +0 -1
- package/dist/src/orchestrator/types.js +0 -15
- 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/types.d.ts +0 -446
- 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/{types.js → accounts/adapter.js} +0 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { encodePacked, hashMessage, pad, } from 'viem';
|
|
2
|
+
import { getChainById } from '../../chains/catalog.js';
|
|
3
|
+
import { getValidatorCapabilities } from '../../modules/validators/capabilities.js';
|
|
4
|
+
import { defineValidator } from '../../modules/validators/definition.js';
|
|
5
|
+
import { buildPermit2ClaimPolicyCalldata } from '../../modules/validators/policies/claim/permit2.js';
|
|
6
|
+
import { resolveAtomicValidator, resolveValidator, } from '../../modules/validators/resolve.js';
|
|
7
|
+
import { getSessionData } from '../../modules/validators/smart-sessions/digest.js';
|
|
8
|
+
import { getSmartSessionEmissaryAddress } from '../../modules/validators/smart-sessions/module.js';
|
|
9
|
+
import { resolvePermit2ClaimPolicy, selectPermit2ClaimPolicyForMessage, } from '../../modules/validators/smart-sessions/policies/claim.js';
|
|
10
|
+
import { getAccountSignatureEnvelope } from '../../signing/context.js';
|
|
11
|
+
import { createValidatorSigningTasks, signingTopology, } from '../../signing/plan.js';
|
|
12
|
+
import { createSignerInvocationPort } from '../../signing/signers/registry.js';
|
|
13
|
+
export function createIntentSessionSignerInvoker(prepared, fallback) {
|
|
14
|
+
const signers = {};
|
|
15
|
+
for (const resolved of Object.values(prepared.resolvedSessions ?? {})) {
|
|
16
|
+
const validator = defineValidator(resolved.session.owners, 'smart-session-validator');
|
|
17
|
+
const owners = validator.kind === 'multi-factor'
|
|
18
|
+
? validator.validators.flatMap(({ owners: factorOwners }) => factorOwners)
|
|
19
|
+
: validator.owners;
|
|
20
|
+
for (const owner of owners) {
|
|
21
|
+
signers[owner.signerId] =
|
|
22
|
+
owner.kind === 'webauthn'
|
|
23
|
+
? { kind: 'webauthn', account: owner.account }
|
|
24
|
+
: { kind: 'ecdsa', account: owner.account };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const session = createSignerInvocationPort({
|
|
28
|
+
signers,
|
|
29
|
+
resolveChain: (chain) => getChainById(chain.id),
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
has: (signer) => session.has?.(signer) ?? fallback.has?.(signer) ?? false,
|
|
33
|
+
invoke: (signer, invocation) => session.has?.(signer)
|
|
34
|
+
? session.invoke(signer, invocation)
|
|
35
|
+
: fallback.invoke(signer, invocation),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export function buildSessionIntentPlanInput(prepared, context) {
|
|
39
|
+
const payloads = {};
|
|
40
|
+
const stages = [];
|
|
41
|
+
for (const [index, origin] of prepared.signing.origins.entries()) {
|
|
42
|
+
const session = requireSession(prepared, origin.chain.id);
|
|
43
|
+
stages.push(buildSessionStage({
|
|
44
|
+
id: `origin-${index}`,
|
|
45
|
+
outputId: `origin-${index}`,
|
|
46
|
+
usage: 'intent-origin',
|
|
47
|
+
typedData: origin.typedData,
|
|
48
|
+
payloadId: origin.id,
|
|
49
|
+
chain: origin.chain,
|
|
50
|
+
session,
|
|
51
|
+
environment: requireSessionEnvironment(prepared),
|
|
52
|
+
context,
|
|
53
|
+
payloads,
|
|
54
|
+
output: session.verifyExecutions ? 'pair' : 'notarized',
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
const destination = prepared.signing.destination;
|
|
58
|
+
if (destination?.mode === 'sign') {
|
|
59
|
+
const session = requireSession(prepared, destination.payload.chain.id);
|
|
60
|
+
stages.push(buildSessionStage({
|
|
61
|
+
id: 'destination',
|
|
62
|
+
outputId: destination.artifactId,
|
|
63
|
+
usage: 'intent-destination',
|
|
64
|
+
typedData: destination.payload.typedData,
|
|
65
|
+
payloadId: destination.payload.id,
|
|
66
|
+
chain: destination.payload.chain,
|
|
67
|
+
session,
|
|
68
|
+
environment: requireSessionEnvironment(prepared),
|
|
69
|
+
context,
|
|
70
|
+
payloads,
|
|
71
|
+
output: session.verifyExecutions ? 'pre-claim' : 'notarized',
|
|
72
|
+
includeNotarized: session.verifyExecutions,
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
else if (destination) {
|
|
76
|
+
const stageId = destination.originArtifactId;
|
|
77
|
+
stages.push({
|
|
78
|
+
id: 'destination',
|
|
79
|
+
checkpoint: { kind: 'none', id: 'destination:none' },
|
|
80
|
+
priorOutputs: [
|
|
81
|
+
{
|
|
82
|
+
stageId,
|
|
83
|
+
outputId: destination.originArtifactId,
|
|
84
|
+
selection: destination.selection,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
tasks: [],
|
|
88
|
+
schedule: [],
|
|
89
|
+
artifacts: [
|
|
90
|
+
{
|
|
91
|
+
id: destination.artifactId,
|
|
92
|
+
usage: 'intent-destination',
|
|
93
|
+
input: {
|
|
94
|
+
kind: 'reuse-artifact',
|
|
95
|
+
stageId,
|
|
96
|
+
artifactId: destination.originArtifactId,
|
|
97
|
+
selection: destination.selection,
|
|
98
|
+
},
|
|
99
|
+
validatorCodec: { kind: 'none' },
|
|
100
|
+
erc7739: { kind: 'none' },
|
|
101
|
+
accountEnvelope: { kind: 'none' },
|
|
102
|
+
erc6492: { kind: 'none' },
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if (prepared.signing.target) {
|
|
108
|
+
const target = prepared.signing.target;
|
|
109
|
+
stages.push(buildSessionStage({
|
|
110
|
+
id: 'target',
|
|
111
|
+
outputId: 'target',
|
|
112
|
+
usage: 'intent-target',
|
|
113
|
+
typedData: target.typedData,
|
|
114
|
+
payloadId: target.id,
|
|
115
|
+
chain: target.chain,
|
|
116
|
+
session: requireSession(prepared, target.chain.id),
|
|
117
|
+
environment: requireSessionEnvironment(prepared),
|
|
118
|
+
context,
|
|
119
|
+
payloads,
|
|
120
|
+
output: 'pre-claim',
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
123
|
+
return { intent: prepared.signing, stages, payloads };
|
|
124
|
+
}
|
|
125
|
+
function buildSessionStage(input) {
|
|
126
|
+
const signing = sessionOwnerSigning(input.session, input.context.account.address);
|
|
127
|
+
const module = getSmartSessionEmissaryAddress(input.environment);
|
|
128
|
+
const tasks = [];
|
|
129
|
+
const artifacts = [];
|
|
130
|
+
const scheduleIds = [];
|
|
131
|
+
const checkpoint = input.session.enableData
|
|
132
|
+
? {
|
|
133
|
+
kind: 'session-enabled',
|
|
134
|
+
id: `${input.id}:session-enabled`,
|
|
135
|
+
chain: input.chain,
|
|
136
|
+
account: input.context.account.address,
|
|
137
|
+
permissionId: input.session.session.permissionId,
|
|
138
|
+
}
|
|
139
|
+
: { kind: 'none', id: `${input.id}:none` };
|
|
140
|
+
const notarizedId = `${input.id}:notarized`;
|
|
141
|
+
if (input.output === 'pair' ||
|
|
142
|
+
input.output === 'notarized' ||
|
|
143
|
+
input.includeNotarized) {
|
|
144
|
+
const payloadId = notarizedPayload(input.context.account.address, input.payloadId);
|
|
145
|
+
input.payloads[payloadId] = {
|
|
146
|
+
kind: 'message',
|
|
147
|
+
message: { raw: payloadId },
|
|
148
|
+
};
|
|
149
|
+
const stageTasks = sessionTasks(`${notarizedId}:signer`, signing, input.chain, payloadId, 'session-notarized');
|
|
150
|
+
tasks.push(...stageTasks);
|
|
151
|
+
scheduleIds.push(...stageTasks.map(({ id }) => id));
|
|
152
|
+
artifacts.push({
|
|
153
|
+
id: input.output === 'notarized' ? input.outputId : notarizedId,
|
|
154
|
+
usage: input.output === 'notarized' ? input.usage : 'intent-notarized-claim',
|
|
155
|
+
input: {
|
|
156
|
+
kind: 'task-results',
|
|
157
|
+
taskIds: stageTasks.map(({ id }) => id),
|
|
158
|
+
},
|
|
159
|
+
validatorCodec: sessionCodec(input.session, module, signing.signerCodec, 'notarized', input.typedData),
|
|
160
|
+
...(signing.validatorFactors
|
|
161
|
+
? { validatorFactors: signing.validatorFactors }
|
|
162
|
+
: {}),
|
|
163
|
+
erc7739: { kind: 'none' },
|
|
164
|
+
accountEnvelope: sessionAccountEnvelope(getAccountSignatureEnvelope(input.context), module),
|
|
165
|
+
erc6492: { kind: 'none' },
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
if (input.output === 'pair' || input.output === 'pre-claim') {
|
|
169
|
+
input.payloads[input.payloadId] = {
|
|
170
|
+
kind: 'message',
|
|
171
|
+
message: { raw: input.payloadId },
|
|
172
|
+
};
|
|
173
|
+
const preClaimId = input.output === 'pre-claim' ? input.outputId : `${input.id}:pre-claim`;
|
|
174
|
+
const stageTasks = sessionTasks(`${preClaimId}:signer`, signing, input.chain, input.payloadId, 'session-pre-claim');
|
|
175
|
+
tasks.push(...stageTasks);
|
|
176
|
+
scheduleIds.push(...stageTasks.map(({ id }) => id));
|
|
177
|
+
artifacts.push({
|
|
178
|
+
id: preClaimId,
|
|
179
|
+
usage: input.output === 'pre-claim' ? input.usage : 'intent-pre-claim',
|
|
180
|
+
input: {
|
|
181
|
+
kind: 'task-results',
|
|
182
|
+
taskIds: stageTasks.map(({ id }) => id),
|
|
183
|
+
},
|
|
184
|
+
validatorCodec: sessionPreClaimCodec(input.session, module, signing.signerCodec, checkpoint.id),
|
|
185
|
+
...(signing.validatorFactors
|
|
186
|
+
? { validatorFactors: signing.validatorFactors }
|
|
187
|
+
: {}),
|
|
188
|
+
erc7739: { kind: 'none' },
|
|
189
|
+
accountEnvelope: { kind: 'none' },
|
|
190
|
+
erc6492: { kind: 'none' },
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
if (input.output === 'pair') {
|
|
194
|
+
artifacts.push({
|
|
195
|
+
id: input.outputId,
|
|
196
|
+
usage: input.usage,
|
|
197
|
+
input: {
|
|
198
|
+
kind: 'session-claim-pair',
|
|
199
|
+
preClaimArtifactId: `${input.id}:pre-claim`,
|
|
200
|
+
notarizedClaimArtifactId: notarizedId,
|
|
201
|
+
},
|
|
202
|
+
validatorCodec: { kind: 'none' },
|
|
203
|
+
erc7739: { kind: 'none' },
|
|
204
|
+
accountEnvelope: { kind: 'none' },
|
|
205
|
+
erc6492: { kind: 'none' },
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
return {
|
|
209
|
+
id: input.id,
|
|
210
|
+
checkpoint,
|
|
211
|
+
priorOutputs: [],
|
|
212
|
+
tasks,
|
|
213
|
+
schedule: [
|
|
214
|
+
{
|
|
215
|
+
id: `${input.id}:session-signers`,
|
|
216
|
+
execution: 'serial',
|
|
217
|
+
taskIds: scheduleIds,
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
artifacts,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function sessionTasks(taskPrefix, signing, chain, payloadId, role) {
|
|
224
|
+
return createValidatorSigningTasks({
|
|
225
|
+
validator: signing.validator,
|
|
226
|
+
signerReferences: signing.signerReferences,
|
|
227
|
+
taskPrefix,
|
|
228
|
+
ecdsaInvocation: 'ecdsa-sign-message',
|
|
229
|
+
webauthnInvocation: 'webauthn-sign-hash',
|
|
230
|
+
role,
|
|
231
|
+
}).map((task) => ({
|
|
232
|
+
...task,
|
|
233
|
+
chain,
|
|
234
|
+
payload: { source: 'plan-payload', payloadId },
|
|
235
|
+
}));
|
|
236
|
+
}
|
|
237
|
+
function sessionOwnerSigning(session, account) {
|
|
238
|
+
const validator = defineValidator(session.session.owners, 'smart-session-validator');
|
|
239
|
+
const owners = validatorOwners(validator);
|
|
240
|
+
const capabilities = getValidatorCapabilities(validator, resolveValidator(validator), 'smart-session-owner', 'intent', false);
|
|
241
|
+
return {
|
|
242
|
+
validator,
|
|
243
|
+
...signingTopology(validator),
|
|
244
|
+
signerReferences: Object.fromEntries(owners.map((owner) => [
|
|
245
|
+
owner.signerId,
|
|
246
|
+
{
|
|
247
|
+
id: owner.signerId,
|
|
248
|
+
kind: owner.kind === 'webauthn'
|
|
249
|
+
? 'webauthn'
|
|
250
|
+
: 'ecdsa',
|
|
251
|
+
},
|
|
252
|
+
])),
|
|
253
|
+
signerCodec: withWebauthnContext(requireSessionSignerCodec(capabilities.contributionCodec), validator.kind === 'passkey', account),
|
|
254
|
+
...(validator.kind === 'multi-factor'
|
|
255
|
+
? {
|
|
256
|
+
validatorFactors: validator.validators.map((factor) => ({
|
|
257
|
+
id: factor.id,
|
|
258
|
+
publicId: factor.publicId,
|
|
259
|
+
validator: resolveAtomicValidator(factor).address,
|
|
260
|
+
codec: withWebauthnContext(requireAtomicSignerCodec(getValidatorCapabilities(factor, resolveAtomicValidator(factor), 'smart-session-owner', 'intent', false).contributionCodec), factor.kind === 'passkey', account),
|
|
261
|
+
})),
|
|
262
|
+
}
|
|
263
|
+
: {}),
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
function sessionCodec(session, validator, signerCodec, mode, typedData) {
|
|
267
|
+
return {
|
|
268
|
+
kind: 'smart-session',
|
|
269
|
+
validator: { kind: 'validator', address: validator },
|
|
270
|
+
mode,
|
|
271
|
+
permissionId: session.session.permissionId,
|
|
272
|
+
signerCodec,
|
|
273
|
+
...(mode === 'notarized'
|
|
274
|
+
? { claimPolicyData: claimPolicyData(session, typedData) }
|
|
275
|
+
: {}),
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function sessionPreClaimCodec(session, validator, signerCodec, factId) {
|
|
279
|
+
const enabled = sessionCodec(session, validator, signerCodec, 'pre-claim');
|
|
280
|
+
if (!session.enableData)
|
|
281
|
+
return enabled;
|
|
282
|
+
return {
|
|
283
|
+
kind: 'smart-session-state',
|
|
284
|
+
factId,
|
|
285
|
+
whenEnabled: enabled,
|
|
286
|
+
whenDisabled: {
|
|
287
|
+
kind: 'smart-session',
|
|
288
|
+
validator: { kind: 'validator', address: validator },
|
|
289
|
+
mode: 'enable-and-use',
|
|
290
|
+
permissionId: session.session.permissionId,
|
|
291
|
+
signerCodec,
|
|
292
|
+
enableData: {
|
|
293
|
+
...session.enableData,
|
|
294
|
+
session: getSessionData(session.session),
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
function requireSessionSignerCodec(codec) {
|
|
300
|
+
if (codec.kind === 'smart-session') {
|
|
301
|
+
throw new Error('A Smart Session owner cannot use a session validator');
|
|
302
|
+
}
|
|
303
|
+
return codec;
|
|
304
|
+
}
|
|
305
|
+
function requireAtomicSignerCodec(codec) {
|
|
306
|
+
if (codec.kind !== 'ordered-threshold') {
|
|
307
|
+
throw new Error('A Smart Session factor must use an atomic validator');
|
|
308
|
+
}
|
|
309
|
+
return codec;
|
|
310
|
+
}
|
|
311
|
+
function validatorOwners(validator) {
|
|
312
|
+
return validator.kind === 'multi-factor'
|
|
313
|
+
? validator.validators.flatMap(({ owners }) => owners)
|
|
314
|
+
: validator.owners;
|
|
315
|
+
}
|
|
316
|
+
function withWebauthnContext(codec, webauthn, account) {
|
|
317
|
+
if (!webauthn || codec.kind !== 'ordered-threshold')
|
|
318
|
+
return codec;
|
|
319
|
+
return {
|
|
320
|
+
...codec,
|
|
321
|
+
webauthn: {
|
|
322
|
+
account,
|
|
323
|
+
usePrecompile: false,
|
|
324
|
+
format: 'current',
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
function sessionAccountEnvelope(envelope, validator) {
|
|
329
|
+
if (envelope.kind === 'none')
|
|
330
|
+
return envelope;
|
|
331
|
+
return envelope.kind === 'kernel'
|
|
332
|
+
? { ...envelope, validator, isRoot: false }
|
|
333
|
+
: { ...envelope, validator };
|
|
334
|
+
}
|
|
335
|
+
function notarizedPayload(account, payload) {
|
|
336
|
+
return hashMessage({
|
|
337
|
+
raw: encodePacked(['bytes32', 'bytes32'], [pad(account, { size: 32 }), payload]),
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
function claimPolicyData(session, typedData) {
|
|
341
|
+
if (!typedData ||
|
|
342
|
+
typedData.primaryType !== 'PermitBatchWitnessTransferFrom' ||
|
|
343
|
+
session.session.claimPolicies.length === 0) {
|
|
344
|
+
return undefined;
|
|
345
|
+
}
|
|
346
|
+
const message = typedData.message;
|
|
347
|
+
const policy = selectPermit2ClaimPolicyForMessage(session.session.claimPolicies, message);
|
|
348
|
+
return policy
|
|
349
|
+
? buildPermit2ClaimPolicyCalldata(resolvePermit2ClaimPolicy(policy), message)
|
|
350
|
+
: undefined;
|
|
351
|
+
}
|
|
352
|
+
function requireSession(prepared, chainId) {
|
|
353
|
+
const session = prepared.resolvedSessions?.[chainId];
|
|
354
|
+
if (!session)
|
|
355
|
+
throw new Error(`Prepared session for chain ${chainId} is missing`);
|
|
356
|
+
return session;
|
|
357
|
+
}
|
|
358
|
+
function requireSessionEnvironment(prepared) {
|
|
359
|
+
if (!prepared.sessionEnvironment) {
|
|
360
|
+
throw new Error('Prepared Smart Session environment is missing');
|
|
361
|
+
}
|
|
362
|
+
return prepared.sessionEnvironment;
|
|
363
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Hex } from 'viem';
|
|
2
|
+
import type { AccountRuntime } from '../../accounts/adapter.js';
|
|
3
|
+
import type { Call } from '../../calls/types.js';
|
|
4
|
+
import type { ResolvedSessionSignerSet } from '../../modules/validators/smart-sessions/types.js';
|
|
5
|
+
import type { IntentInput, IntentWorkflowContext } from './types.js';
|
|
6
|
+
export interface PreparedIntentSessions {
|
|
7
|
+
readonly signatureMode: number;
|
|
8
|
+
readonly byChain: Readonly<Record<number, ResolvedSessionSignerSet>>;
|
|
9
|
+
readonly mockSignatures: Readonly<Record<string, Hex>>;
|
|
10
|
+
readonly preClaimCalls: Readonly<Record<number, readonly Call[]>>;
|
|
11
|
+
}
|
|
12
|
+
export declare function prepareIntentSessions<CompatibilityConfig>(input: {
|
|
13
|
+
readonly intent: IntentInput<CompatibilityConfig>;
|
|
14
|
+
readonly runtime: AccountRuntime;
|
|
15
|
+
readonly context: Pick<IntentWorkflowContext<CompatibilityConfig>, 'checkpoints'>;
|
|
16
|
+
}): Promise<PreparedIntentSessions | undefined>;
|
|
17
|
+
//# sourceMappingURL=sessions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../../../transactions/intents/sessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAO7C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAA;AAC7F,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEjE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC,CAAA;IACpE,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAA;IACtD,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC,CAAA;CAClE;AAED,wBAAsB,qBAAqB,CAAC,mBAAmB,EAAE,KAAK,EAAE;IACtE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAA;IACjD,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;IAChC,QAAQ,CAAC,OAAO,EAAE,IAAI,CACpB,qBAAqB,CAAC,mBAAmB,CAAC,EAC1C,aAAa,CACd,CAAA;CACF,GAAG,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAmF9C"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { buildSmartSessionMockSignature } from '../../modules/validators/smart-sessions/mock-signature.js';
|
|
2
|
+
import { DUMMY_PRECLAIMOP_SELECTOR, DUMMY_PRECLAIMOP_TARGET, } from '../../modules/validators/smart-sessions/resolve.js';
|
|
3
|
+
export async function prepareIntentSessions(input) {
|
|
4
|
+
const selection = input.intent.signers;
|
|
5
|
+
if (!selection || selection.kind !== 'smart-session')
|
|
6
|
+
return undefined;
|
|
7
|
+
const chains = sessionChains(input.intent);
|
|
8
|
+
const resolvedEntries = await Promise.all(chains.map(async (chain) => {
|
|
9
|
+
const selected = selection.byChain[chain.id];
|
|
10
|
+
if (!selected) {
|
|
11
|
+
throw new Error(`No session configured for chain ${chain.id}`);
|
|
12
|
+
}
|
|
13
|
+
const checkpointId = `intent-session:${chain.id}:${selected.session.permissionId}`;
|
|
14
|
+
const facts = await input.context.checkpoints.read({
|
|
15
|
+
kind: 'session-enabled',
|
|
16
|
+
id: checkpointId,
|
|
17
|
+
chain,
|
|
18
|
+
account: input.runtime.identity.address,
|
|
19
|
+
permissionId: selected.session.permissionId,
|
|
20
|
+
});
|
|
21
|
+
const enabled = facts.find((fact) => fact.kind === 'session-enabled' && fact.id === checkpointId);
|
|
22
|
+
if (enabled?.kind !== 'session-enabled') {
|
|
23
|
+
throw new Error(`Session state for chain ${chain.id} is missing`);
|
|
24
|
+
}
|
|
25
|
+
const verifyExecutions = !enabled.enabled || selected.session.hasExplicitPermissions;
|
|
26
|
+
return [
|
|
27
|
+
chain.id,
|
|
28
|
+
{
|
|
29
|
+
kind: 'smart-session',
|
|
30
|
+
session: selected.session,
|
|
31
|
+
...(enabled.enabled || !selected.enableData
|
|
32
|
+
? {}
|
|
33
|
+
: { enableData: selected.enableData }),
|
|
34
|
+
verifyExecutions,
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
}));
|
|
38
|
+
const byChain = Object.fromEntries(resolvedEntries);
|
|
39
|
+
const mockSignatures = Object.fromEntries(resolvedEntries.map(([chainId, resolved]) => [
|
|
40
|
+
String(chainId),
|
|
41
|
+
buildSmartSessionMockSignature({
|
|
42
|
+
session: resolved.session,
|
|
43
|
+
environment: input.runtime.construction.sessions.environment,
|
|
44
|
+
chainCount: input.intent.sourceChains?.length ?? 1,
|
|
45
|
+
targetChainId: chainId,
|
|
46
|
+
shape: !resolved.verifyExecutions
|
|
47
|
+
? 'erc1271'
|
|
48
|
+
: resolved.enableData
|
|
49
|
+
? 'enable'
|
|
50
|
+
: 'use',
|
|
51
|
+
}),
|
|
52
|
+
]));
|
|
53
|
+
const preClaimCalls = Object.fromEntries((input.intent.sourceChains ?? []).flatMap((chain) => {
|
|
54
|
+
const resolved = byChain[chain.id];
|
|
55
|
+
return resolved?.verifyExecutions && resolved.enableData
|
|
56
|
+
? [
|
|
57
|
+
[
|
|
58
|
+
chain.id,
|
|
59
|
+
[
|
|
60
|
+
{
|
|
61
|
+
target: DUMMY_PRECLAIMOP_TARGET,
|
|
62
|
+
value: 0n,
|
|
63
|
+
data: DUMMY_PRECLAIMOP_SELECTOR,
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
],
|
|
67
|
+
]
|
|
68
|
+
: [];
|
|
69
|
+
}));
|
|
70
|
+
return {
|
|
71
|
+
signatureMode: resolvedEntries.some(([, value]) => value.verifyExecutions)
|
|
72
|
+
? 5
|
|
73
|
+
: 1,
|
|
74
|
+
byChain,
|
|
75
|
+
mockSignatures,
|
|
76
|
+
preClaimCalls,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function sessionChains(intent) {
|
|
80
|
+
const chains = new Map((intent.sourceChains ?? []).map((chain) => [chain.id, chain]));
|
|
81
|
+
if (intent.destination.kind === 'evm') {
|
|
82
|
+
chains.set(intent.destination.id, intent.destination);
|
|
83
|
+
}
|
|
84
|
+
return [...chains.values()];
|
|
85
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Hex } from 'viem';
|
|
2
|
+
import { type IndependentOwnerSignature } from '../../signing/intent-plans/independent.js';
|
|
3
|
+
import type { IntentWorkflowContext, PreparedIntent, SignedIntent } from './types.js';
|
|
4
|
+
export declare function signIntent<CompatibilityConfig>(context: IntentWorkflowContext<CompatibilityConfig>, prepared: PreparedIntent<CompatibilityConfig>): Promise<SignedIntent<CompatibilityConfig>>;
|
|
5
|
+
export declare function signIntentAsOwner<CompatibilityConfig>(context: IntentWorkflowContext<CompatibilityConfig>, prepared: PreparedIntent<CompatibilityConfig>, selection: {
|
|
6
|
+
readonly signerId: string;
|
|
7
|
+
readonly validatorId?: number | Hex;
|
|
8
|
+
}): Promise<IndependentOwnerSignature>;
|
|
9
|
+
export declare function assembleIntent<CompatibilityConfig>(context: IntentWorkflowContext<CompatibilityConfig>, prepared: PreparedIntent<CompatibilityConfig>, signatures: readonly IndependentOwnerSignature[]): Promise<SignedIntent<CompatibilityConfig>>;
|
|
10
|
+
//# sourceMappingURL=sign-transaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign-transaction.d.ts","sourceRoot":"","sources":["../../../../transactions/intents/sign-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAe/B,OAAO,EAGL,KAAK,yBAAyB,EAC/B,MAAM,wCAAwC,CAAA;AAuB/C,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACd,YAAY,EACb,MAAM,SAAS,CAAA;AAEhB,wBAAsB,UAAU,CAAC,mBAAmB,EAClD,OAAO,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,EACnD,QAAQ,EAAE,cAAc,CAAC,mBAAmB,CAAC,GAC5C,OAAO,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,CAsC5C;AAED,wBAAsB,iBAAiB,CAAC,mBAAmB,EACzD,OAAO,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,EACnD,QAAQ,EAAE,cAAc,CAAC,mBAAmB,CAAC,EAC7C,SAAS,EAAE;IACT,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CACpC,GACA,OAAO,CAAC,yBAAyB,CAAC,CA0DpC;AAED,wBAAsB,cAAc,CAAC,mBAAmB,EACtD,OAAO,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,EACnD,QAAQ,EAAE,cAAc,CAAC,mBAAmB,CAAC,EAC7C,UAAU,EAAE,SAAS,yBAAyB,EAAE,GAC/C,OAAO,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,CAsD5C"}
|