@rhinestone/sdk 2.0.0-beta.44 → 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/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/{orchestrator → clients/orchestrator}/chain-catalog.d.ts +5 -3
- package/dist/src/clients/orchestrator/chain-catalog.d.ts.map +1 -0
- package/dist/src/{orchestrator → clients/orchestrator}/chain-catalog.js +24 -3
- 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} +4 -4
- 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 +498 -498
- 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} +23 -14
- 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 -324
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -286
- 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 +1 -1
- package/dist/src/modules/validators/policies/claim/arbiters.d.ts.map +1 -1
- package/dist/src/modules/validators/policies/claim/arbiters.js +3 -1
- 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 -3
- 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 -13
- package/dist/src/accounts/json-rpc/providers.d.ts +0 -3
- package/dist/src/accounts/json-rpc/providers.d.ts.map +0 -1
- package/dist/src/accounts/json-rpc/providers.js +0 -4
- 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 -520
- 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 -186
- 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 -1603
- 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 -22
- package/dist/src/modules/validators/cross-chain-permits.d.ts.map +0 -1
- package/dist/src/modules/validators/cross-chain-permits.js +0 -107
- 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 -226
- package/dist/src/modules/validators/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/validators/smart-sessions.js +0 -1197
- package/dist/src/orchestrator/caip2.d.ts +0 -18
- package/dist/src/orchestrator/caip2.d.ts.map +0 -1
- package/dist/src/orchestrator/caip2.js +0 -58
- package/dist/src/orchestrator/chain-catalog.d.ts.map +0 -1
- package/dist/src/orchestrator/client.d.ts +0 -43
- package/dist/src/orchestrator/client.d.ts.map +0 -1
- package/dist/src/orchestrator/client.js +0 -336
- 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 -12
- 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 -7
- package/dist/src/orchestrator/registry.d.ts.map +0 -1
- package/dist/src/orchestrator/registry.js +0 -46
- 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 -31
- 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,377 @@
|
|
|
1
|
+
import { SigningPipelineError } from './error.js';
|
|
2
|
+
export function validateSigningPlan(plan) {
|
|
3
|
+
const stageIds = new Set();
|
|
4
|
+
const taskIds = new Set();
|
|
5
|
+
const artifactIds = new Set();
|
|
6
|
+
const artifactStages = new Map();
|
|
7
|
+
for (const stage of plan.stages) {
|
|
8
|
+
assertUnique(stageIds, stage.id, `Duplicate signing stage ${stage.id}`);
|
|
9
|
+
const declaredPriorOutputs = new Set();
|
|
10
|
+
for (const prior of stage.priorOutputs) {
|
|
11
|
+
const key = priorOutputKey(prior);
|
|
12
|
+
assertUnique(declaredPriorOutputs, key, `Duplicate prior output ${prior.stageId}:${prior.outputId}`);
|
|
13
|
+
if (artifactStages.get(prior.outputId) !== prior.stageId) {
|
|
14
|
+
fail(plan, `Prior output ${prior.stageId}:${prior.outputId} is unavailable`, stage.id);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const scheduled = new Set();
|
|
18
|
+
const stageTasks = new Set();
|
|
19
|
+
for (const task of stage.taskTemplates) {
|
|
20
|
+
assertUnique(taskIds, task.id, `Duplicate signing task ${task.id}`);
|
|
21
|
+
stageTasks.add(task.id);
|
|
22
|
+
if (task.payload.source === 'prior-output' &&
|
|
23
|
+
!declaredPriorOutputs.has(priorOutputKey(task.payload))) {
|
|
24
|
+
fail(plan, `Signing task ${task.id} uses an undeclared prior output`, stage.id);
|
|
25
|
+
}
|
|
26
|
+
if (task.payload.source === 'checkpoint-fact' &&
|
|
27
|
+
(stage.checkpoint.kind === 'none' ||
|
|
28
|
+
task.payload.checkpointId !== stage.checkpoint.id)) {
|
|
29
|
+
fail(plan, `Signing task ${task.id} uses an undeclared checkpoint`, stage.id);
|
|
30
|
+
}
|
|
31
|
+
if (task.when &&
|
|
32
|
+
(stage.checkpoint.kind !== 'delegation-code' ||
|
|
33
|
+
task.when.factId !== stage.checkpoint.id)) {
|
|
34
|
+
fail(plan, `Signing task ${task.id} uses an undeclared delegation fact`, stage.id);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
for (const batch of stage.schedule) {
|
|
38
|
+
for (const taskId of batch.taskIds) {
|
|
39
|
+
if (!stageTasks.has(taskId)) {
|
|
40
|
+
fail(plan, `Schedule references unknown task ${taskId}`, stage.id);
|
|
41
|
+
}
|
|
42
|
+
assertUnique(scheduled, taskId, `Signing task ${taskId} is scheduled more than once`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (scheduled.size !== stageTasks.size) {
|
|
46
|
+
fail(plan, `Stage ${stage.id} has unscheduled signing tasks`, stage.id);
|
|
47
|
+
}
|
|
48
|
+
for (const artifact of stage.artifacts) {
|
|
49
|
+
if (artifact.stageId !== stage.id) {
|
|
50
|
+
fail(plan, `Artifact ${artifact.id} belongs to another stage`, stage.id);
|
|
51
|
+
}
|
|
52
|
+
assertUnique(artifactIds, artifact.id, `Duplicate signing artifact ${artifact.id}`);
|
|
53
|
+
artifactStages.set(artifact.id, stage.id);
|
|
54
|
+
switch (artifact.input.kind) {
|
|
55
|
+
case 'task-results':
|
|
56
|
+
for (const taskId of artifact.input.taskIds) {
|
|
57
|
+
if (!stageTasks.has(taskId)) {
|
|
58
|
+
fail(plan, `Artifact ${artifact.id} references a task outside its stage`, stage.id, artifact.id);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
62
|
+
case 'reuse-artifact': {
|
|
63
|
+
const reference = {
|
|
64
|
+
stageId: artifact.input.stageId,
|
|
65
|
+
outputId: artifact.input.artifactId,
|
|
66
|
+
selection: artifact.input.selection,
|
|
67
|
+
};
|
|
68
|
+
if (!declaredPriorOutputs.has(priorOutputKey(reference))) {
|
|
69
|
+
fail(plan, `Artifact ${artifact.id} uses an undeclared prior output`, stage.id, artifact.id);
|
|
70
|
+
}
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
case 'session-claim-pair':
|
|
74
|
+
for (const componentId of [
|
|
75
|
+
artifact.input.preClaimArtifactId,
|
|
76
|
+
artifact.input.notarizedClaimArtifactId,
|
|
77
|
+
]) {
|
|
78
|
+
if (componentId === artifact.id ||
|
|
79
|
+
artifactStages.get(componentId) !== stage.id) {
|
|
80
|
+
fail(plan, `Session claim pair ${artifact.id} references an unavailable component`, stage.id, artifact.id);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
if (artifact.validatorCodec.kind === 'smart-session-state' &&
|
|
86
|
+
(stage.checkpoint.kind !== 'session-enabled' ||
|
|
87
|
+
stage.checkpoint.id !== artifact.validatorCodec.factId)) {
|
|
88
|
+
fail(plan, `Artifact ${artifact.id} uses an undeclared session-state fact`, stage.id, artifact.id);
|
|
89
|
+
}
|
|
90
|
+
if (artifact.validatorCodec.kind === 'smart-session-state') {
|
|
91
|
+
const { whenEnabled, whenDisabled } = artifact.validatorCodec;
|
|
92
|
+
if (whenEnabled.validator.address.toLowerCase() !==
|
|
93
|
+
whenDisabled.validator.address.toLowerCase() ||
|
|
94
|
+
whenEnabled.permissionId.toLowerCase() !==
|
|
95
|
+
whenDisabled.permissionId.toLowerCase()) {
|
|
96
|
+
fail(plan, `Artifact ${artifact.id} changes Smart Session identity by state`, stage.id, artifact.id);
|
|
97
|
+
}
|
|
98
|
+
if (whenEnabled.mode === 'enable-and-use' ||
|
|
99
|
+
whenDisabled.mode !== 'enable-and-use' ||
|
|
100
|
+
!whenDisabled.enableData) {
|
|
101
|
+
fail(plan, `Artifact ${artifact.id} has an invalid Smart Session state route`, stage.id, artifact.id);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else if (artifact.validatorCodec.kind === 'smart-session' &&
|
|
105
|
+
artifact.validatorCodec.mode === 'enable-and-use' &&
|
|
106
|
+
!artifact.validatorCodec.enableData) {
|
|
107
|
+
fail(plan, `Artifact ${artifact.id} has no Smart Session enable data`, stage.id, artifact.id);
|
|
108
|
+
}
|
|
109
|
+
if (artifact.erc6492.kind !== 'none' && artifact.usage !== 'erc1271') {
|
|
110
|
+
fail(plan, `ERC-6492 is not permitted for ${artifact.usage}`, stage.id, artifact.id);
|
|
111
|
+
}
|
|
112
|
+
if (plan.kind === 'account-message' && artifact.erc7739.kind !== 'none') {
|
|
113
|
+
fail(plan, 'ERC-7739 is not a message-signing operation', stage.id, artifact.id);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const outputIds = new Set();
|
|
118
|
+
for (const output of plan.publicOutputs) {
|
|
119
|
+
assertUnique(outputIds, output.id, `Duplicate public output ${output.id}`);
|
|
120
|
+
if (output.source.kind === 'artifact' &&
|
|
121
|
+
!artifactIds.has(output.source.artifactId)) {
|
|
122
|
+
fail(plan, `Public output references unknown artifact ${output.source.artifactId}`);
|
|
123
|
+
}
|
|
124
|
+
if (output.source.kind === 'task-result' &&
|
|
125
|
+
!taskIds.has(output.source.taskId)) {
|
|
126
|
+
fail(plan, `Public output references unknown task ${output.source.taskId}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function priorOutputKey(input) {
|
|
131
|
+
return `${input.stageId}:${input.outputId}:${input.selection}`;
|
|
132
|
+
}
|
|
133
|
+
export function materializeSigningStage(input) {
|
|
134
|
+
return {
|
|
135
|
+
stageId: input.stage.id,
|
|
136
|
+
facts: input.facts,
|
|
137
|
+
tasks: input.stage.taskTemplates
|
|
138
|
+
.filter((template) => taskIsRequired(template, input.facts))
|
|
139
|
+
.map((template) => materializeTask(template, input)),
|
|
140
|
+
schedule: input.stage.schedule
|
|
141
|
+
.map((batch) => ({
|
|
142
|
+
...batch,
|
|
143
|
+
taskIds: batch.taskIds.filter((taskId) => {
|
|
144
|
+
const template = input.stage.taskTemplates.find(({ id }) => id === taskId);
|
|
145
|
+
return template && taskIsRequired(template, input.facts);
|
|
146
|
+
}),
|
|
147
|
+
}))
|
|
148
|
+
.filter(({ taskIds }) => taskIds.length > 0),
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
export function createSingleStageSigningPlan(input) {
|
|
152
|
+
const taskTemplates = input.tasks.map((task) => ({
|
|
153
|
+
...task,
|
|
154
|
+
...(input.chain ? { chain: input.chain } : {}),
|
|
155
|
+
payload: { source: 'plan-payload', payloadId: input.payload.id },
|
|
156
|
+
}));
|
|
157
|
+
return {
|
|
158
|
+
version: 1,
|
|
159
|
+
kind: input.kind,
|
|
160
|
+
payload: input.payload,
|
|
161
|
+
configuredTopology: input.configuredTopology,
|
|
162
|
+
effectiveSelection: input.effectiveSelection,
|
|
163
|
+
stages: [
|
|
164
|
+
{
|
|
165
|
+
id: input.stageId,
|
|
166
|
+
checkpoint: input.checkpoint ?? {
|
|
167
|
+
kind: 'none',
|
|
168
|
+
id: `${input.stageId}-no-read`,
|
|
169
|
+
},
|
|
170
|
+
priorOutputs: [],
|
|
171
|
+
taskTemplates,
|
|
172
|
+
schedule: taskTemplates.length === 0
|
|
173
|
+
? []
|
|
174
|
+
: [
|
|
175
|
+
{
|
|
176
|
+
id: `${input.stageId}-signers`,
|
|
177
|
+
execution: 'parallel',
|
|
178
|
+
taskIds: taskTemplates.map(({ id }) => id),
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
artifacts: input.artifacts.map((artifact) => ({
|
|
182
|
+
...artifact,
|
|
183
|
+
stageId: input.stageId,
|
|
184
|
+
input: {
|
|
185
|
+
kind: 'task-results',
|
|
186
|
+
taskIds: taskTemplates.map(({ id }) => id),
|
|
187
|
+
},
|
|
188
|
+
})),
|
|
189
|
+
},
|
|
190
|
+
],
|
|
191
|
+
publicOutputs: input.artifacts.map((artifact) => ({
|
|
192
|
+
id: artifact.id,
|
|
193
|
+
source: { kind: 'artifact', artifactId: artifact.id },
|
|
194
|
+
exposedForIndependentSigning: false,
|
|
195
|
+
})),
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
export function createValidatorSigningTasks(input) {
|
|
199
|
+
const selectedSignerIds = input.selectedSignerIds;
|
|
200
|
+
const factors = input.validator.kind === 'multi-factor'
|
|
201
|
+
? input.validator.validators.map((validator) => ({
|
|
202
|
+
factorId: validator.id,
|
|
203
|
+
owners: validator.owners,
|
|
204
|
+
}))
|
|
205
|
+
: [{ factorId: undefined, owners: input.validator.owners }];
|
|
206
|
+
const tasks = factors.flatMap((factor) => factor.owners.flatMap((owner) => {
|
|
207
|
+
if (selectedSignerIds && !selectedSignerIds.includes(owner.signerId)) {
|
|
208
|
+
return [];
|
|
209
|
+
}
|
|
210
|
+
const signer = input.signerReferences[owner.signerId];
|
|
211
|
+
if (!signer)
|
|
212
|
+
throw new Error(`Signer reference ${owner.signerId} is missing`);
|
|
213
|
+
const webauthn = owner.kind === 'webauthn';
|
|
214
|
+
return [
|
|
215
|
+
{
|
|
216
|
+
id: `${input.taskPrefix}:${owner.id}`,
|
|
217
|
+
signer,
|
|
218
|
+
role: input.role ?? (factor.factorId ? 'factor' : 'owner'),
|
|
219
|
+
invocationKind: webauthn
|
|
220
|
+
? input.webauthnInvocation
|
|
221
|
+
: input.ecdsaInvocation,
|
|
222
|
+
contribution: webauthn
|
|
223
|
+
? {
|
|
224
|
+
kind: 'webauthn',
|
|
225
|
+
ownerId: owner.id,
|
|
226
|
+
publicKey: owner.account.publicKey,
|
|
227
|
+
...(factor.factorId ? { factorId: factor.factorId } : {}),
|
|
228
|
+
}
|
|
229
|
+
: {
|
|
230
|
+
kind: 'ecdsa',
|
|
231
|
+
ownerId: owner.id,
|
|
232
|
+
encoding: 'raw-signer',
|
|
233
|
+
...(factor.factorId ? { factorId: factor.factorId } : {}),
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
];
|
|
237
|
+
}));
|
|
238
|
+
return input.validator.kind === 'multi-factor'
|
|
239
|
+
? [...tasks].sort((left, right) => left.invocationKind.startsWith('ecdsa') ===
|
|
240
|
+
right.invocationKind.startsWith('ecdsa')
|
|
241
|
+
? 0
|
|
242
|
+
: left.invocationKind.startsWith('ecdsa')
|
|
243
|
+
? -1
|
|
244
|
+
: 1)
|
|
245
|
+
: tasks;
|
|
246
|
+
}
|
|
247
|
+
export function signingTopology(validator, selectedSignerIds) {
|
|
248
|
+
const validators = validator.kind === 'multi-factor' ? validator.validators : [validator];
|
|
249
|
+
return {
|
|
250
|
+
configuredTopology: {
|
|
251
|
+
rootValidatorId: validator.id,
|
|
252
|
+
validators: validators.map((item) => ({
|
|
253
|
+
id: item.id,
|
|
254
|
+
ownerIds: item.owners.map(({ id }) => id),
|
|
255
|
+
threshold: item.threshold,
|
|
256
|
+
})),
|
|
257
|
+
threshold: validator.threshold,
|
|
258
|
+
},
|
|
259
|
+
effectiveSelection: {
|
|
260
|
+
validatorIds: validators.flatMap((item) => selectedSignerIds &&
|
|
261
|
+
!item.owners.some(({ signerId }) => selectedSignerIds.includes(signerId))
|
|
262
|
+
? []
|
|
263
|
+
: [item.id]),
|
|
264
|
+
signerIds: selectedSignerIds ??
|
|
265
|
+
validators.flatMap((item) => item.owners.map(({ signerId }) => signerId)),
|
|
266
|
+
threshold: validator.threshold,
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
function taskIsRequired(template, facts) {
|
|
271
|
+
if (!template.when)
|
|
272
|
+
return true;
|
|
273
|
+
const fact = facts.find(({ id }) => id === template.when?.factId);
|
|
274
|
+
if (fact?.kind !== 'delegation-code') {
|
|
275
|
+
throw new Error(`Delegation fact ${template.when.factId} is missing`);
|
|
276
|
+
}
|
|
277
|
+
return (fact.code?.toLowerCase() !==
|
|
278
|
+
`0xef0100${template.when.contract.slice(2)}`.toLowerCase());
|
|
279
|
+
}
|
|
280
|
+
function materializeTask(template, input) {
|
|
281
|
+
const material = resolvePayloadMaterial(template, input);
|
|
282
|
+
const chain = template.chain;
|
|
283
|
+
switch (template.invocationKind) {
|
|
284
|
+
case 'ecdsa-sign-message':
|
|
285
|
+
requireMaterial(template, material, 'message');
|
|
286
|
+
return {
|
|
287
|
+
...template,
|
|
288
|
+
invocation: {
|
|
289
|
+
kind: 'ecdsa-sign-message',
|
|
290
|
+
...(chain ? { chain } : {}),
|
|
291
|
+
message: material.message,
|
|
292
|
+
},
|
|
293
|
+
};
|
|
294
|
+
case 'ecdsa-sign-typed-data':
|
|
295
|
+
requireMaterial(template, material, 'typed-data');
|
|
296
|
+
return {
|
|
297
|
+
...template,
|
|
298
|
+
invocation: {
|
|
299
|
+
kind: 'ecdsa-sign-typed-data',
|
|
300
|
+
...(chain ? { chain } : {}),
|
|
301
|
+
typedData: material.typedData,
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
case 'webauthn-sign-hash':
|
|
305
|
+
requireMaterial(template, material, 'message');
|
|
306
|
+
return {
|
|
307
|
+
...template,
|
|
308
|
+
invocation: { kind: 'webauthn-sign-hash', hash: material.message.raw },
|
|
309
|
+
};
|
|
310
|
+
case 'webauthn-sign-typed-data':
|
|
311
|
+
requireMaterial(template, material, 'typed-data');
|
|
312
|
+
return {
|
|
313
|
+
...template,
|
|
314
|
+
invocation: {
|
|
315
|
+
kind: 'webauthn-sign-typed-data',
|
|
316
|
+
typedData: material.typedData,
|
|
317
|
+
},
|
|
318
|
+
};
|
|
319
|
+
case 'sign-authorization':
|
|
320
|
+
requireMaterial(template, material, 'authorization');
|
|
321
|
+
if (!chain)
|
|
322
|
+
throw new Error(`Authorization task ${template.id} has no chain`);
|
|
323
|
+
return {
|
|
324
|
+
...template,
|
|
325
|
+
invocation: {
|
|
326
|
+
kind: 'sign-authorization',
|
|
327
|
+
chain,
|
|
328
|
+
authorization: material.authorization,
|
|
329
|
+
},
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
function resolvePayloadMaterial(template, input) {
|
|
334
|
+
const reference = template.payload;
|
|
335
|
+
if (reference.source === 'plan-payload') {
|
|
336
|
+
const material = input.payloads[reference.payloadId];
|
|
337
|
+
if (!material)
|
|
338
|
+
throw new Error(`No payload material for ${reference.payloadId}`);
|
|
339
|
+
return material;
|
|
340
|
+
}
|
|
341
|
+
if (reference.source === 'prior-output') {
|
|
342
|
+
const artifact = input.priorOutputs[`${reference.stageId}:${reference.outputId}`];
|
|
343
|
+
const selected = reference.selection === 'pre-claim' &&
|
|
344
|
+
typeof artifact === 'object' &&
|
|
345
|
+
'preClaimSig' in artifact
|
|
346
|
+
? artifact.preClaimSig
|
|
347
|
+
: artifact;
|
|
348
|
+
if (typeof selected !== 'string') {
|
|
349
|
+
throw new Error(`Prior output ${reference.outputId} is not signable bytes`);
|
|
350
|
+
}
|
|
351
|
+
return { kind: 'message', message: { raw: selected } };
|
|
352
|
+
}
|
|
353
|
+
const fact = input.facts.find(({ id }) => id === reference.factId);
|
|
354
|
+
if (fact?.kind !== 'delegation-code' || !fact.code) {
|
|
355
|
+
throw new Error(`Checkpoint fact ${reference.factId} is not signable bytes`);
|
|
356
|
+
}
|
|
357
|
+
return { kind: 'message', message: { raw: fact.code } };
|
|
358
|
+
}
|
|
359
|
+
function requireMaterial(template, material, kind) {
|
|
360
|
+
if (material.kind !== kind) {
|
|
361
|
+
throw new Error(`Signing task ${template.id} requires ${kind}, received ${material.kind}`);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
function assertUnique(values, value, message) {
|
|
365
|
+
if (values.has(value))
|
|
366
|
+
throw new Error(message);
|
|
367
|
+
values.add(value);
|
|
368
|
+
}
|
|
369
|
+
function fail(plan, message, stageId, artifactId) {
|
|
370
|
+
throw new SigningPipelineError(message, {
|
|
371
|
+
planKind: plan.kind,
|
|
372
|
+
payloadKind: plan.payload.kind,
|
|
373
|
+
failureStage: 'plan',
|
|
374
|
+
...(stageId ? { stageId } : {}),
|
|
375
|
+
...(artifactId ? { artifactId } : {}),
|
|
376
|
+
});
|
|
377
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
export declare const ERC6492_MAGIC_BYTES: "0x6492649264926492649264926492649264926492649264926492649264926492";
|
|
3
|
+
export interface Erc6492Signature {
|
|
4
|
+
readonly factory: Address;
|
|
5
|
+
readonly factoryData: Hex;
|
|
6
|
+
readonly signature: Hex;
|
|
7
|
+
}
|
|
8
|
+
export declare function isErc6492Signature(signature: Hex): boolean;
|
|
9
|
+
export declare function wrapErc6492Signature(input: Erc6492Signature): Hex;
|
|
10
|
+
export declare function unwrapErc6492Signature(signature: Hex): Erc6492Signature;
|
|
11
|
+
//# sourceMappingURL=erc6492.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erc6492.d.ts","sourceRoot":"","sources":["../../../../signing/protocols/erc6492.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAIZ,KAAK,GAAG,EAGT,MAAM,MAAM,CAAA;AAEb,eAAO,MAAM,mBAAmB,EAC9B,oEAA6E,CAAA;AAE/E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAA;CACxB;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAK1D;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,GAAG,GAAG,CAYjE;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,GAAG,GAAG,gBAAgB,CAUvE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { concat, decodeAbiParameters, encodeAbiParameters, size, slice, } from 'viem';
|
|
2
|
+
export const ERC6492_MAGIC_BYTES = '0x6492649264926492649264926492649264926492649264926492649264926492';
|
|
3
|
+
export function isErc6492Signature(signature) {
|
|
4
|
+
return (size(signature) >= 32 &&
|
|
5
|
+
slice(signature, size(signature) - 32).toLowerCase() === ERC6492_MAGIC_BYTES);
|
|
6
|
+
}
|
|
7
|
+
export function wrapErc6492Signature(input) {
|
|
8
|
+
return concat([
|
|
9
|
+
encodeAbiParameters([
|
|
10
|
+
{ name: 'create2Factory', type: 'address' },
|
|
11
|
+
{ name: 'factoryCalldata', type: 'bytes' },
|
|
12
|
+
{ name: 'originalERC1271Signature', type: 'bytes' },
|
|
13
|
+
], [input.factory, input.factoryData, input.signature]),
|
|
14
|
+
ERC6492_MAGIC_BYTES,
|
|
15
|
+
]);
|
|
16
|
+
}
|
|
17
|
+
export function unwrapErc6492Signature(signature) {
|
|
18
|
+
if (!isErc6492Signature(signature)) {
|
|
19
|
+
throw new Error('Signature is not ERC-6492 encoded');
|
|
20
|
+
}
|
|
21
|
+
const encoded = slice(signature, 0, size(signature) - 32);
|
|
22
|
+
const [factory, factoryData, originalSignature] = decodeAbiParameters([{ type: 'address' }, { type: 'bytes' }, { type: 'bytes' }], encoded);
|
|
23
|
+
return { factory, factoryData, signature: originalSignature };
|
|
24
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Address, type Hex, type TypedDataDefinition } from 'viem';
|
|
2
|
+
export interface Erc7739VerifierDomain {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly version: string;
|
|
5
|
+
readonly chainId: number;
|
|
6
|
+
readonly verifyingContract: Address;
|
|
7
|
+
readonly salt: Hex;
|
|
8
|
+
}
|
|
9
|
+
export declare function hashErc7739TypedData(input: {
|
|
10
|
+
readonly typedData: TypedDataDefinition;
|
|
11
|
+
readonly verifierDomain: Erc7739VerifierDomain;
|
|
12
|
+
}): Hex;
|
|
13
|
+
export declare function wrapErc7739TypedDataSignature(input: {
|
|
14
|
+
readonly typedData: TypedDataDefinition;
|
|
15
|
+
readonly signature: Hex;
|
|
16
|
+
}): Hex;
|
|
17
|
+
//# sourceMappingURL=erc7739.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erc7739.d.ts","sourceRoot":"","sources":["../../../../signing/protocols/erc7739.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAGZ,KAAK,GAAG,EAKR,KAAK,mBAAmB,EAGzB,MAAM,MAAM,CAAA;AAGb,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAA;IACnC,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAA;CACnB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAA;IACvC,QAAQ,CAAC,cAAc,EAAE,qBAAqB,CAAA;CAC/C,GAAG,GAAG,CAwDN;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAA;IACvC,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAA;CACxB,GAAG,GAAG,CASN"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { concat, encodeAbiParameters, hashDomain, hashStruct, keccak256, toHex, } from 'viem';
|
|
2
|
+
import { wrapTypedDataSignature } from 'viem/experimental/erc7739';
|
|
3
|
+
export function hashErc7739TypedData(input) {
|
|
4
|
+
const { domain, types, primaryType, message } = input.typedData;
|
|
5
|
+
if (!domain || !primaryType) {
|
|
6
|
+
throw new Error('ERC-7739 requires a complete typed-data definition');
|
|
7
|
+
}
|
|
8
|
+
const typeFields = types;
|
|
9
|
+
const contentsType = encodeType(primaryType, typeFields);
|
|
10
|
+
const typedDataSignTypeHash = keccak256(toHex(`TypedDataSign(${primaryType} contents,string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)${contentsType}`));
|
|
11
|
+
const contentsHash = hashStruct({
|
|
12
|
+
data: message,
|
|
13
|
+
primaryType,
|
|
14
|
+
types: typeFields,
|
|
15
|
+
});
|
|
16
|
+
const verifier = input.verifierDomain;
|
|
17
|
+
const structHash = keccak256(encodeAbiParameters([
|
|
18
|
+
{ type: 'bytes32' },
|
|
19
|
+
{ type: 'bytes32' },
|
|
20
|
+
{ type: 'bytes32' },
|
|
21
|
+
{ type: 'bytes32' },
|
|
22
|
+
{ type: 'uint256' },
|
|
23
|
+
{ type: 'address' },
|
|
24
|
+
{ type: 'bytes32' },
|
|
25
|
+
], [
|
|
26
|
+
typedDataSignTypeHash,
|
|
27
|
+
contentsHash,
|
|
28
|
+
keccak256(toHex(verifier.name)),
|
|
29
|
+
keccak256(toHex(verifier.version)),
|
|
30
|
+
BigInt(verifier.chainId),
|
|
31
|
+
verifier.verifyingContract,
|
|
32
|
+
verifier.salt,
|
|
33
|
+
]));
|
|
34
|
+
const domainTypes = [];
|
|
35
|
+
if (domain.name)
|
|
36
|
+
domainTypes.push({ name: 'name', type: 'string' });
|
|
37
|
+
if (domain.version)
|
|
38
|
+
domainTypes.push({ name: 'version', type: 'string' });
|
|
39
|
+
if (domain.chainId)
|
|
40
|
+
domainTypes.push({ name: 'chainId', type: 'uint256' });
|
|
41
|
+
if (domain.verifyingContract) {
|
|
42
|
+
domainTypes.push({ name: 'verifyingContract', type: 'address' });
|
|
43
|
+
}
|
|
44
|
+
if (domain.salt)
|
|
45
|
+
domainTypes.push({ name: 'salt', type: 'bytes32' });
|
|
46
|
+
const appDomainSeparator = hashDomain({
|
|
47
|
+
domain,
|
|
48
|
+
types: { EIP712Domain: domainTypes },
|
|
49
|
+
});
|
|
50
|
+
return keccak256(concat(['0x1901', appDomainSeparator, structHash]));
|
|
51
|
+
}
|
|
52
|
+
export function wrapErc7739TypedDataSignature(input) {
|
|
53
|
+
const typedData = input.typedData;
|
|
54
|
+
return wrapTypedDataSignature({
|
|
55
|
+
domain: typedData.domain,
|
|
56
|
+
primaryType: typedData.primaryType,
|
|
57
|
+
types: typedData.types,
|
|
58
|
+
message: typedData.message,
|
|
59
|
+
signature: input.signature,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function encodeType(primaryType, types) {
|
|
63
|
+
const dependencies = new Set();
|
|
64
|
+
const collect = (type) => {
|
|
65
|
+
const typeName = type.match(/^\w*/)?.[0];
|
|
66
|
+
if (!typeName || dependencies.has(typeName) || !types[typeName])
|
|
67
|
+
return;
|
|
68
|
+
dependencies.add(typeName);
|
|
69
|
+
for (const field of types[typeName])
|
|
70
|
+
collect(field.type);
|
|
71
|
+
};
|
|
72
|
+
collect(primaryType);
|
|
73
|
+
dependencies.delete(primaryType);
|
|
74
|
+
return [primaryType, ...dependencies]
|
|
75
|
+
.sort((left, right) => {
|
|
76
|
+
if (left === primaryType)
|
|
77
|
+
return -1;
|
|
78
|
+
if (right === primaryType)
|
|
79
|
+
return 1;
|
|
80
|
+
return left.localeCompare(right);
|
|
81
|
+
})
|
|
82
|
+
.map((type) => `${type}(${types[type].map((field) => `${field.type} ${field.name}`).join(',')})`)
|
|
83
|
+
.join('');
|
|
84
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type Address, type Hex, type TypedDataDefinition } from 'viem';
|
|
2
|
+
import type { AccountKind } from '../accounts/types.js';
|
|
3
|
+
import type { EvmChainReference } from '../chains/types.js';
|
|
4
|
+
import type { ValidatorContributionCodec } from '../modules/validators/types.js';
|
|
5
|
+
import type { SigningContext } from './context.js';
|
|
6
|
+
import type { ArtifactAssemblyPlan, ConfiguredValidatorTopology, EffectiveSignerSelection, PayloadSigningTask, SigningCheckpointPort, SigningPayloadMaterial, SigningPlan, SigningTranscript } from './types.js';
|
|
7
|
+
export interface SessionEnableSigningPlanInput {
|
|
8
|
+
readonly typedData: TypedDataDefinition;
|
|
9
|
+
readonly chain: EvmChainReference;
|
|
10
|
+
readonly configuredTopology: ConfiguredValidatorTopology;
|
|
11
|
+
readonly effectiveSelection: EffectiveSignerSelection;
|
|
12
|
+
readonly tasks: readonly PayloadSigningTask[];
|
|
13
|
+
readonly signingMaterial?: SigningPayloadMaterial;
|
|
14
|
+
readonly validatorCodec: ValidatorContributionCodec;
|
|
15
|
+
readonly validatorFactors?: import('./types.js').ArtifactAssemblyPlan['validatorFactors'];
|
|
16
|
+
readonly route: Pick<ArtifactAssemblyPlan, 'erc7739' | 'accountEnvelope' | 'erc6492'>;
|
|
17
|
+
}
|
|
18
|
+
export declare function createSessionEnableSigningPlan(input: SessionEnableSigningPlanInput): SigningPlan;
|
|
19
|
+
export declare function signSessionEnablement(input: {
|
|
20
|
+
readonly planInput: SessionEnableSigningPlanInput;
|
|
21
|
+
readonly context: SigningContext;
|
|
22
|
+
readonly checkpoints: SigningCheckpointPort;
|
|
23
|
+
}): Promise<{
|
|
24
|
+
readonly signature: Hex;
|
|
25
|
+
readonly transcript: SigningTranscript;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function resolveSessionEnableChain(input: {
|
|
28
|
+
readonly accountKind: AccountKind;
|
|
29
|
+
readonly validator: Address;
|
|
30
|
+
readonly hashesAndChainIds: readonly {
|
|
31
|
+
readonly chainId: bigint;
|
|
32
|
+
}[];
|
|
33
|
+
readonly defaultChain: EvmChainReference;
|
|
34
|
+
}): EvmChainReference;
|
|
35
|
+
//# sourceMappingURL=session-enable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-enable.d.ts","sourceRoot":"","sources":["../../../signing/session-enable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EAGR,KAAK,mBAAmB,EACzB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAExD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAA;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAI/C,OAAO,KAAK,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,WAAW,EACX,iBAAiB,EAClB,MAAM,SAAS,CAAA;AAEhB,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAA;IACvC,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAA;IACjC,QAAQ,CAAC,kBAAkB,EAAE,2BAA2B,CAAA;IACxD,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,CAAA;IACrD,QAAQ,CAAC,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAA;IAC7C,QAAQ,CAAC,eAAe,CAAC,EAAE,sBAAsB,CAAA;IACjD,QAAQ,CAAC,cAAc,EAAE,0BAA0B,CAAA;IACnD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,SAAS,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,CAAA;IACtF,QAAQ,CAAC,KAAK,EAAE,IAAI,CAClB,oBAAoB,EACpB,SAAS,GAAG,iBAAiB,GAAG,SAAS,CAC1C,CAAA;CACF;AAED,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,6BAA6B,GACnC,WAAW,CAqBb;AAED,wBAAsB,qBAAqB,CAAC,KAAK,EAAE;IACjD,QAAQ,CAAC,SAAS,EAAE,6BAA6B,CAAA;IACjD,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;IAChC,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAA;CAC5C,GAAG,OAAO,CAAC;IACV,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAA;IACvB,QAAQ,CAAC,UAAU,EAAE,iBAAiB,CAAA;CACvC,CAAC,CAkBD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAC/C,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAA;IACjC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,iBAAiB,EAAE,SAAS;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACnE,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAA;CACzC,GAAG,iBAAiB,CAoBpB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { hashTypedData, isAddressEqual, } from 'viem';
|
|
2
|
+
import { toEvmChainReference } from '../chains/caip2.js';
|
|
3
|
+
import { K1_DEFAULT_VALIDATOR_ADDRESS } from '../modules/validators/k1.js';
|
|
4
|
+
import { executeSigningPlan } from './execute.js';
|
|
5
|
+
import { createSingleStageSigningPlan } from './plan.js';
|
|
6
|
+
import { assembleTypedDataStage } from './typed-data.js';
|
|
7
|
+
export function createSessionEnableSigningPlan(input) {
|
|
8
|
+
return createSingleStageSigningPlan({
|
|
9
|
+
kind: 'session-enable',
|
|
10
|
+
payload: { kind: 'session-enable', id: hashTypedData(input.typedData) },
|
|
11
|
+
configuredTopology: input.configuredTopology,
|
|
12
|
+
effectiveSelection: input.effectiveSelection,
|
|
13
|
+
stageId: 'session-enable',
|
|
14
|
+
chain: input.chain,
|
|
15
|
+
tasks: input.tasks,
|
|
16
|
+
artifacts: [
|
|
17
|
+
{
|
|
18
|
+
id: 'session-enable-signature',
|
|
19
|
+
usage: 'session-enable',
|
|
20
|
+
validatorCodec: input.validatorCodec,
|
|
21
|
+
...(input.validatorFactors
|
|
22
|
+
? { validatorFactors: input.validatorFactors }
|
|
23
|
+
: {}),
|
|
24
|
+
...input.route,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export async function signSessionEnablement(input) {
|
|
30
|
+
const plan = createSessionEnableSigningPlan(input.planInput);
|
|
31
|
+
const transcript = await executeSigningPlan({
|
|
32
|
+
plan,
|
|
33
|
+
payloads: {
|
|
34
|
+
[plan.payload.id]: input.planInput.signingMaterial ?? {
|
|
35
|
+
kind: 'typed-data',
|
|
36
|
+
typedData: input.planInput.typedData,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
signerInvoker: input.context.signerInvoker,
|
|
40
|
+
checkpoints: input.checkpoints,
|
|
41
|
+
assembleStage: (stage) => assembleTypedDataStage(stage, input.context),
|
|
42
|
+
});
|
|
43
|
+
const signature = transcript.stages[0].outputs['session-enable-signature'];
|
|
44
|
+
return { signature, transcript };
|
|
45
|
+
}
|
|
46
|
+
export function resolveSessionEnableChain(input) {
|
|
47
|
+
const startaleK1 = input.accountKind === 'startale' &&
|
|
48
|
+
isAddressEqual(input.validator, K1_DEFAULT_VALIDATOR_ADDRESS);
|
|
49
|
+
if (!startaleK1)
|
|
50
|
+
return input.defaultChain;
|
|
51
|
+
const chainIds = [
|
|
52
|
+
...new Set(input.hashesAndChainIds.map(({ chainId }) => chainId.toString())),
|
|
53
|
+
];
|
|
54
|
+
if (chainIds.length > 1) {
|
|
55
|
+
throw new Error('Startale accounts with K1 validator do not support multi-chain session enable');
|
|
56
|
+
}
|
|
57
|
+
const chainId = chainIds[0];
|
|
58
|
+
if (chainId === undefined) {
|
|
59
|
+
throw new Error('Startale K1 session enable requires one session chain');
|
|
60
|
+
}
|
|
61
|
+
return toEvmChainReference(Number(chainId));
|
|
62
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Account, WalletClient } from 'viem';
|
|
2
|
+
export declare function walletClientToAccount(walletClient: WalletClient): Account;
|
|
3
|
+
export declare function wrapParaAccount(viemAccount: Account, walletId?: string): Account;
|
|
4
|
+
//# sourceMappingURL=compatibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compatibility.d.ts","sourceRoot":"","sources":["../../../../signing/signers/compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAOP,YAAY,EACb,MAAM,MAAM,CAAA;AAGb,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CA0BzE;AAED,wBAAgB,eAAe,CAC7B,WAAW,EAAE,OAAO,EACpB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CA+BT"}
|