@rhinestone/sdk 2.0.0-beta.44 → 2.0.0-beta.46
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 +640 -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} +16 -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 +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/{orchestrator → clients/orchestrator}/wire.gen.d.ts +1193 -499
- package/dist/src/clients/orchestrator/wire.gen.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/wire.gen.js +1 -0
- package/dist/src/clients/orchestrator/wire.js +1 -0
- package/dist/src/clients/paymaster/client.d.ts +8 -0
- package/dist/src/clients/paymaster/client.d.ts.map +1 -0
- package/dist/src/clients/paymaster/client.js +38 -0
- package/dist/src/clients/paymaster/endpoints.d.ts +3 -0
- package/dist/src/clients/paymaster/endpoints.d.ts.map +1 -0
- package/dist/src/clients/paymaster/endpoints.js +16 -0
- package/dist/src/clients/paymaster/port.d.ts +17 -0
- package/dist/src/clients/paymaster/port.d.ts.map +1 -0
- package/dist/src/clients/paymaster/port.js +1 -0
- package/dist/src/clients/rpc/client.d.ts +6 -0
- package/dist/src/clients/rpc/client.d.ts.map +1 -0
- package/dist/src/clients/rpc/client.js +66 -0
- package/dist/src/clients/rpc/compatibility.d.ts +12 -0
- package/dist/src/clients/rpc/compatibility.d.ts.map +1 -0
- package/dist/src/clients/rpc/compatibility.js +16 -0
- package/dist/src/clients/rpc/port.d.ts +13 -0
- package/dist/src/clients/rpc/port.d.ts.map +1 -0
- package/dist/src/clients/rpc/port.js +1 -0
- package/dist/src/clients/rpc/providers.d.ts +3 -0
- package/dist/src/clients/rpc/providers.d.ts.map +1 -0
- package/dist/src/clients/rpc/providers.js +8 -0
- package/dist/src/clients/rpc/transport.d.ts +4 -0
- package/dist/src/clients/rpc/transport.d.ts.map +1 -0
- package/dist/src/clients/rpc/transport.js +5 -0
- package/dist/src/clients/rpc/types.d.ts +23 -0
- package/dist/src/clients/rpc/types.d.ts.map +1 -0
- package/dist/src/clients/rpc/types.js +1 -0
- package/dist/src/config/account-runtime.d.ts +7 -0
- package/dist/src/config/account-runtime.d.ts.map +1 -0
- package/dist/src/config/account-runtime.js +36 -0
- package/dist/src/{types.d.ts → config/account.d.ts} +37 -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,215 @@
|
|
|
1
|
+
import { encodeAbiParameters, hashTypedData, keccak256, } from 'viem';
|
|
2
|
+
import { executeSigningPlan } from './execute.js';
|
|
3
|
+
export function createNexusEip7702InitTypedData(input) {
|
|
4
|
+
return {
|
|
5
|
+
domain: { name: 'Nexus', version: '1.2.0' },
|
|
6
|
+
types: {
|
|
7
|
+
Initialize: [
|
|
8
|
+
{ name: 'nexus', type: 'address' },
|
|
9
|
+
{ name: 'chainIds', type: 'uint256[]' },
|
|
10
|
+
{ name: 'initData', type: 'bytes' },
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
primaryType: 'Initialize',
|
|
14
|
+
message: {
|
|
15
|
+
nexus: input.contract,
|
|
16
|
+
chainIds: [0n],
|
|
17
|
+
initData: input.initData,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function createNexusEip7702InitPlan(input) {
|
|
22
|
+
const payloadId = hashTypedData(input.typedData);
|
|
23
|
+
return directSigningPlan({
|
|
24
|
+
kind: 'nexus-eip7702-init',
|
|
25
|
+
payload: { kind: 'typed-data', id: payloadId },
|
|
26
|
+
stageId: 'nexus-eip7702-init',
|
|
27
|
+
task: {
|
|
28
|
+
id: 'nexus-eip7702-init-signer',
|
|
29
|
+
signer: input.signer,
|
|
30
|
+
role: 'owner',
|
|
31
|
+
invocationKind: 'ecdsa-sign-typed-data',
|
|
32
|
+
payload: { source: 'plan-payload', payloadId },
|
|
33
|
+
},
|
|
34
|
+
artifactId: 'nexus-eip7702-init-signature',
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export async function signNexusEip7702Init(input) {
|
|
38
|
+
const plan = createNexusEip7702InitPlan(input.planInput);
|
|
39
|
+
const transcript = await executeDirectPlan({
|
|
40
|
+
plan,
|
|
41
|
+
payloads: {
|
|
42
|
+
[plan.payload.id]: {
|
|
43
|
+
kind: 'typed-data',
|
|
44
|
+
typedData: input.planInput.typedData,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
signerInvoker: input.signerInvoker,
|
|
48
|
+
checkpoints: input.checkpoints,
|
|
49
|
+
artifactId: 'nexus-eip7702-init-signature',
|
|
50
|
+
});
|
|
51
|
+
const signature = transcript.stages[0].outputs['nexus-eip7702-init-signature'];
|
|
52
|
+
return { signature, transcript };
|
|
53
|
+
}
|
|
54
|
+
export function createAuthorizationListPlan(input) {
|
|
55
|
+
const chains = dedupeEvmChains(input.chains);
|
|
56
|
+
const payloadId = keccak256(encodeAbiParameters([{ type: 'address' }, { type: 'uint256[]' }], [input.contract, chains.map(({ id }) => BigInt(id))]));
|
|
57
|
+
const payloads = {};
|
|
58
|
+
const stages = chains.map((chain) => {
|
|
59
|
+
const nonce = input.nonceByChain[chain.id];
|
|
60
|
+
if (nonce === undefined) {
|
|
61
|
+
throw new Error(`Authorization nonce for chain ${chain.id} is missing`);
|
|
62
|
+
}
|
|
63
|
+
const chainPayloadId = keccak256(encodeAbiParameters([{ type: 'bytes32' }, { type: 'uint256' }], [payloadId, BigInt(chain.id)]));
|
|
64
|
+
payloads[chainPayloadId] = {
|
|
65
|
+
kind: 'authorization',
|
|
66
|
+
authorization: {
|
|
67
|
+
contractAddress: input.contract,
|
|
68
|
+
chainId: chain.id,
|
|
69
|
+
nonce,
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
const taskId = `authorization-${chain.id}`;
|
|
73
|
+
const factId = `delegation-${chain.id}`;
|
|
74
|
+
return {
|
|
75
|
+
id: `authorization-chain-${chain.id}`,
|
|
76
|
+
checkpoint: {
|
|
77
|
+
kind: 'delegation-code',
|
|
78
|
+
id: factId,
|
|
79
|
+
chain,
|
|
80
|
+
account: input.account,
|
|
81
|
+
},
|
|
82
|
+
priorOutputs: [],
|
|
83
|
+
taskTemplates: [
|
|
84
|
+
{
|
|
85
|
+
id: taskId,
|
|
86
|
+
signer: input.signer,
|
|
87
|
+
role: 'authorization',
|
|
88
|
+
chain,
|
|
89
|
+
invocationKind: 'sign-authorization',
|
|
90
|
+
payload: {
|
|
91
|
+
source: 'plan-payload',
|
|
92
|
+
payloadId: chainPayloadId,
|
|
93
|
+
},
|
|
94
|
+
when: {
|
|
95
|
+
kind: 'delegation-required',
|
|
96
|
+
factId,
|
|
97
|
+
contract: input.contract,
|
|
98
|
+
},
|
|
99
|
+
contribution: { kind: 'authorization' },
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
schedule: [
|
|
103
|
+
{
|
|
104
|
+
id: `authorization-prompt-${chain.id}`,
|
|
105
|
+
execution: 'serial',
|
|
106
|
+
taskIds: [taskId],
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
artifacts: [],
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
const plan = {
|
|
113
|
+
version: 1,
|
|
114
|
+
kind: 'eip7702-authorization-list',
|
|
115
|
+
payload: { kind: 'authorization', id: payloadId },
|
|
116
|
+
configuredTopology: emptyTopology,
|
|
117
|
+
effectiveSelection: emptySelection,
|
|
118
|
+
stages,
|
|
119
|
+
publicOutputs: stages.map((stage) => ({
|
|
120
|
+
id: `${stage.id}-result`,
|
|
121
|
+
source: { kind: 'task-result', taskId: stage.taskTemplates[0].id },
|
|
122
|
+
exposedForIndependentSigning: false,
|
|
123
|
+
})),
|
|
124
|
+
};
|
|
125
|
+
return { plan, payloads };
|
|
126
|
+
}
|
|
127
|
+
export async function signAuthorizationList(input) {
|
|
128
|
+
const { plan, payloads } = createAuthorizationListPlan(input.planInput);
|
|
129
|
+
const transcript = await executeSigningPlan({
|
|
130
|
+
plan,
|
|
131
|
+
payloads,
|
|
132
|
+
signerInvoker: input.signerInvoker,
|
|
133
|
+
checkpoints: input.checkpoints,
|
|
134
|
+
assembleStage: () => ({}),
|
|
135
|
+
});
|
|
136
|
+
const authorizations = transcript.stages.flatMap(({ results }) => Object.values(results).flatMap((result) => result.kind === 'signed-authorization' ? [result.authorization] : []));
|
|
137
|
+
return { authorizations, transcript };
|
|
138
|
+
}
|
|
139
|
+
function directSigningPlan(input) {
|
|
140
|
+
return {
|
|
141
|
+
version: 1,
|
|
142
|
+
kind: input.kind,
|
|
143
|
+
payload: input.payload,
|
|
144
|
+
configuredTopology: emptyTopology,
|
|
145
|
+
effectiveSelection: emptySelection,
|
|
146
|
+
stages: [
|
|
147
|
+
{
|
|
148
|
+
id: input.stageId,
|
|
149
|
+
checkpoint: { kind: 'none', id: `${input.stageId}-no-read` },
|
|
150
|
+
priorOutputs: [],
|
|
151
|
+
taskTemplates: [input.task],
|
|
152
|
+
schedule: [
|
|
153
|
+
{
|
|
154
|
+
id: `${input.stageId}-signer`,
|
|
155
|
+
execution: 'serial',
|
|
156
|
+
taskIds: [input.task.id],
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
artifacts: [
|
|
160
|
+
{
|
|
161
|
+
id: input.artifactId,
|
|
162
|
+
stageId: input.stageId,
|
|
163
|
+
usage: 'erc1271',
|
|
164
|
+
input: { kind: 'task-results', taskIds: [input.task.id] },
|
|
165
|
+
validatorCodec: { kind: 'none' },
|
|
166
|
+
erc7739: { kind: 'none' },
|
|
167
|
+
accountEnvelope: { kind: 'none' },
|
|
168
|
+
erc6492: { kind: 'none' },
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
publicOutputs: [
|
|
174
|
+
{
|
|
175
|
+
id: input.artifactId,
|
|
176
|
+
source: { kind: 'artifact', artifactId: input.artifactId },
|
|
177
|
+
exposedForIndependentSigning: false,
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
async function executeDirectPlan(input) {
|
|
183
|
+
return executeSigningPlan({
|
|
184
|
+
plan: input.plan,
|
|
185
|
+
payloads: input.payloads,
|
|
186
|
+
signerInvoker: input.signerInvoker,
|
|
187
|
+
checkpoints: input.checkpoints,
|
|
188
|
+
assembleStage: ({ results }) => {
|
|
189
|
+
const result = Object.values(results)[0];
|
|
190
|
+
if (result?.kind !== 'ecdsa-signature') {
|
|
191
|
+
throw new Error('Direct signing task did not return an ECDSA signature');
|
|
192
|
+
}
|
|
193
|
+
return { [input.artifactId]: result.signature };
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
function dedupeEvmChains(chains) {
|
|
198
|
+
const seen = new Set();
|
|
199
|
+
return chains.flatMap((chain) => {
|
|
200
|
+
if (chain.kind !== 'evm' || seen.has(chain.id))
|
|
201
|
+
return [];
|
|
202
|
+
seen.add(chain.id);
|
|
203
|
+
return [chain];
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
const emptyTopology = {
|
|
207
|
+
rootValidatorId: 'none',
|
|
208
|
+
validators: [],
|
|
209
|
+
threshold: 0,
|
|
210
|
+
};
|
|
211
|
+
const emptySelection = {
|
|
212
|
+
validatorIds: [],
|
|
213
|
+
signerIds: [],
|
|
214
|
+
threshold: 0,
|
|
215
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { EvmChainReference } from '../chains/types.js';
|
|
2
|
+
import type { SignatureUsage, SigningPayloadKind, SigningPlan, SigningPlanKind, SigningTaskRole } from './types.js';
|
|
3
|
+
export type SigningFailureStage = 'plan' | 'read' | 'invoke' | 'validator-encode' | 'account-envelope' | 'protocol-operation' | 'final-assembly';
|
|
4
|
+
export interface SigningErrorContext {
|
|
5
|
+
readonly planKind: SigningPlanKind;
|
|
6
|
+
readonly payloadKind: SigningPayloadKind;
|
|
7
|
+
readonly failureStage: SigningFailureStage;
|
|
8
|
+
readonly stageId?: string;
|
|
9
|
+
readonly taskId?: string;
|
|
10
|
+
readonly artifactId?: string;
|
|
11
|
+
readonly usage?: SignatureUsage;
|
|
12
|
+
readonly signerRole?: SigningTaskRole;
|
|
13
|
+
readonly chain?: EvmChainReference;
|
|
14
|
+
}
|
|
15
|
+
export declare class SigningPipelineError extends Error {
|
|
16
|
+
readonly context: SigningErrorContext;
|
|
17
|
+
constructor(message: string, context: SigningErrorContext, options?: ErrorOptions);
|
|
18
|
+
}
|
|
19
|
+
export declare function runSigningStep<Result>(input: {
|
|
20
|
+
readonly plan: SigningPlan;
|
|
21
|
+
readonly failureStage: SigningFailureStage;
|
|
22
|
+
readonly stageId: string;
|
|
23
|
+
readonly artifactId: string;
|
|
24
|
+
readonly usage: SignatureUsage;
|
|
25
|
+
readonly operation: () => Result;
|
|
26
|
+
}): Result;
|
|
27
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../signing/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,eAAe,EAChB,MAAM,SAAS,CAAA;AAEhB,MAAM,MAAM,mBAAmB,GAC3B,MAAM,GACN,MAAM,GACN,QAAQ,GACR,kBAAkB,GAClB,kBAAkB,GAClB,oBAAoB,GACpB,gBAAgB,CAAA;AAEpB,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAA;IAClC,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAA;IACxC,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAA;IAC1C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAA;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,eAAe,CAAA;IACrC,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAA;CACnC;AAED,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAA;gBAGnC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,YAAY;CAMzB;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE;IAC5C,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAA;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAA;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,MAAM,CAAA;CACjC,GAAG,MAAM,CAkBT"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class SigningPipelineError extends Error {
|
|
2
|
+
context;
|
|
3
|
+
constructor(message, context, options) {
|
|
4
|
+
super(message, options);
|
|
5
|
+
this.name = 'SigningPipelineError';
|
|
6
|
+
this.context = context;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export function runSigningStep(input) {
|
|
10
|
+
try {
|
|
11
|
+
return input.operation();
|
|
12
|
+
}
|
|
13
|
+
catch (cause) {
|
|
14
|
+
if (cause instanceof SigningPipelineError)
|
|
15
|
+
throw cause;
|
|
16
|
+
throw new SigningPipelineError(`Signing artifact ${input.artifactId} failed during ${input.failureStage}`, {
|
|
17
|
+
planKind: input.plan.kind,
|
|
18
|
+
payloadKind: input.plan.payload.kind,
|
|
19
|
+
failureStage: input.failureStage,
|
|
20
|
+
stageId: input.stageId,
|
|
21
|
+
artifactId: input.artifactId,
|
|
22
|
+
usage: input.usage,
|
|
23
|
+
}, { cause });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MaterializedSigningStage, RawSignerResult, SigningArtifact, SigningCheckpointPort, SigningPayloadRegistry, SigningPlan, SigningStagePlan, SigningTranscript } from './types.js';
|
|
2
|
+
export interface SigningStageAssemblyInput {
|
|
3
|
+
readonly plan: SigningPlan;
|
|
4
|
+
readonly stagePlan: SigningStagePlan;
|
|
5
|
+
readonly stage: MaterializedSigningStage;
|
|
6
|
+
readonly results: Readonly<Record<string, RawSignerResult>>;
|
|
7
|
+
readonly priorOutputs: Readonly<Record<string, SigningArtifact>>;
|
|
8
|
+
}
|
|
9
|
+
export type SigningStageAssembler = (input: SigningStageAssemblyInput) => Readonly<Record<string, SigningArtifact>>;
|
|
10
|
+
export declare function executeSigningPlan(input: {
|
|
11
|
+
readonly plan: SigningPlan;
|
|
12
|
+
readonly payloads: SigningPayloadRegistry;
|
|
13
|
+
readonly checkpoints: SigningCheckpointPort;
|
|
14
|
+
readonly signerInvoker: import('./types.js').SignerInvocationPort;
|
|
15
|
+
readonly assembleStage: SigningStageAssembler;
|
|
16
|
+
}): Promise<SigningTranscript>;
|
|
17
|
+
//# sourceMappingURL=execute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../signing/execute.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,SAAS,CAAA;AAEhB,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAA;IACpC,QAAQ,CAAC,KAAK,EAAE,wBAAwB,CAAA;IACxC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAA;IAC3D,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAA;CACjE;AAED,MAAM,MAAM,qBAAqB,GAAG,CAClC,KAAK,EAAE,yBAAyB,KAC7B,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAA;AAE9C,wBAAsB,kBAAkB,CAAC,KAAK,EAAE;IAC9C,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAA;IACzC,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAA;IAC3C,QAAQ,CAAC,aAAa,EAAE,OAAO,SAAS,EAAE,oBAAoB,CAAA;IAC9D,QAAQ,CAAC,aAAa,EAAE,qBAAqB,CAAA;CAC9C,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA+J7B"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { SigningPipelineError } from './error.js';
|
|
2
|
+
import { materializeSigningStage, validateSigningPlan } from './plan.js';
|
|
3
|
+
export async function executeSigningPlan(input) {
|
|
4
|
+
try {
|
|
5
|
+
validateSigningPlan(input.plan);
|
|
6
|
+
}
|
|
7
|
+
catch (cause) {
|
|
8
|
+
if (cause instanceof SigningPipelineError)
|
|
9
|
+
throw cause;
|
|
10
|
+
throw pipelineError(input.plan, 'plan', 'Signing plan validation failed', {}, cause);
|
|
11
|
+
}
|
|
12
|
+
for (const stage of input.plan.stages) {
|
|
13
|
+
for (const task of stage.taskTemplates) {
|
|
14
|
+
if (!task.when &&
|
|
15
|
+
input.signerInvoker.has &&
|
|
16
|
+
!input.signerInvoker.has(task.signer)) {
|
|
17
|
+
throw pipelineError(input.plan, 'invoke', `Missing signer ${task.signer.id}`, {
|
|
18
|
+
stageId: stage.id,
|
|
19
|
+
taskId: task.id,
|
|
20
|
+
signerRole: task.role,
|
|
21
|
+
...(task.chain ? { chain: task.chain } : {}),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const priorOutputs = {};
|
|
27
|
+
const transcripts = [];
|
|
28
|
+
for (const stagePlan of input.plan.stages) {
|
|
29
|
+
let facts = [];
|
|
30
|
+
if (stagePlan.checkpoint.kind !== 'none') {
|
|
31
|
+
try {
|
|
32
|
+
facts = await input.checkpoints.read(stagePlan.checkpoint);
|
|
33
|
+
}
|
|
34
|
+
catch (cause) {
|
|
35
|
+
throw pipelineError(input.plan, 'read', `Signing checkpoint ${stagePlan.checkpoint.id} failed`, { stageId: stagePlan.id }, cause);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
let declaredPriorOutputs;
|
|
39
|
+
let stage;
|
|
40
|
+
try {
|
|
41
|
+
declaredPriorOutputs = selectDeclaredPriorOutputs(stagePlan, priorOutputs);
|
|
42
|
+
stage = materializeSigningStage({
|
|
43
|
+
plan: input.plan,
|
|
44
|
+
stage: stagePlan,
|
|
45
|
+
payloads: input.payloads,
|
|
46
|
+
facts,
|
|
47
|
+
priorOutputs: declaredPriorOutputs,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
catch (cause) {
|
|
51
|
+
throw pipelineError(input.plan, 'plan', `Signing stage ${stagePlan.id} materialization failed`, { stageId: stagePlan.id }, cause);
|
|
52
|
+
}
|
|
53
|
+
for (const task of stage.tasks) {
|
|
54
|
+
if (task.when &&
|
|
55
|
+
input.signerInvoker.has &&
|
|
56
|
+
!input.signerInvoker.has(task.signer)) {
|
|
57
|
+
throw pipelineError(input.plan, 'invoke', `Missing signer ${task.signer.id}`, {
|
|
58
|
+
stageId: stage.stageId,
|
|
59
|
+
taskId: task.id,
|
|
60
|
+
signerRole: task.role,
|
|
61
|
+
...(task.chain ? { chain: task.chain } : {}),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const results = {};
|
|
66
|
+
const invoke = async (taskId) => {
|
|
67
|
+
const task = stage.tasks.find(({ id }) => id === taskId);
|
|
68
|
+
if (!task)
|
|
69
|
+
throw new Error(`Unknown materialized signing task ${taskId}`);
|
|
70
|
+
try {
|
|
71
|
+
results[task.id] = await input.signerInvoker.invoke(task.signer, task.invocation);
|
|
72
|
+
}
|
|
73
|
+
catch (cause) {
|
|
74
|
+
throw pipelineError(input.plan, 'invoke', `Signing task ${task.id} failed`, {
|
|
75
|
+
stageId: stage.stageId,
|
|
76
|
+
taskId: task.id,
|
|
77
|
+
signerRole: task.role,
|
|
78
|
+
...(task.chain ? { chain: task.chain } : {}),
|
|
79
|
+
}, cause);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
for (const batch of stage.schedule) {
|
|
83
|
+
if (batch.execution === 'parallel') {
|
|
84
|
+
await Promise.all(batch.taskIds.map(invoke));
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
for (const taskId of batch.taskIds)
|
|
88
|
+
await invoke(taskId);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
let outputs;
|
|
92
|
+
try {
|
|
93
|
+
outputs = input.assembleStage({
|
|
94
|
+
plan: input.plan,
|
|
95
|
+
stagePlan,
|
|
96
|
+
stage,
|
|
97
|
+
results,
|
|
98
|
+
priorOutputs: declaredPriorOutputs,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
catch (cause) {
|
|
102
|
+
if (cause instanceof SigningPipelineError)
|
|
103
|
+
throw cause;
|
|
104
|
+
throw pipelineError(input.plan, 'final-assembly', `Signing stage ${stage.stageId} assembly failed`, { stageId: stage.stageId }, cause);
|
|
105
|
+
}
|
|
106
|
+
for (const artifact of stagePlan.artifacts) {
|
|
107
|
+
const output = outputs[artifact.id];
|
|
108
|
+
if (output === undefined) {
|
|
109
|
+
throw pipelineError(input.plan, 'final-assembly', `Assembler omitted artifact ${artifact.id}`, { stageId: stage.stageId, artifactId: artifact.id });
|
|
110
|
+
}
|
|
111
|
+
priorOutputs[`${stage.stageId}:${artifact.id}`] = output;
|
|
112
|
+
}
|
|
113
|
+
transcripts.push({ stage, results, outputs });
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
planKind: input.plan.kind,
|
|
117
|
+
payloadId: input.plan.payload.id,
|
|
118
|
+
stages: transcripts,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function selectDeclaredPriorOutputs(stage, outputs) {
|
|
122
|
+
return Object.fromEntries(stage.priorOutputs.map((reference) => {
|
|
123
|
+
const key = `${reference.stageId}:${reference.outputId}`;
|
|
124
|
+
const output = outputs[key];
|
|
125
|
+
if (output === undefined) {
|
|
126
|
+
throw new Error(`Declared prior output ${key} is unavailable`);
|
|
127
|
+
}
|
|
128
|
+
return [key, output];
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
function pipelineError(plan, failureStage, message, context, cause) {
|
|
132
|
+
return new SigningPipelineError(message, {
|
|
133
|
+
planKind: plan.kind,
|
|
134
|
+
payloadKind: plan.payload.kind,
|
|
135
|
+
failureStage,
|
|
136
|
+
...context,
|
|
137
|
+
}, cause === undefined ? undefined : { cause });
|
|
138
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Hex } from 'viem';
|
|
2
|
+
import type { SigningContext } from '../context.js';
|
|
3
|
+
import type { SigningStageAssemblyInput } from '../execute.js';
|
|
4
|
+
import type { ArtifactAssemblyPlan, SigningArtifact } from '../types.js';
|
|
5
|
+
export declare function assembleIntentStage(input: SigningStageAssemblyInput, context: SigningContext): Readonly<Record<string, SigningArtifact>>;
|
|
6
|
+
export declare function assembleIntentValidatorArtifact(input: {
|
|
7
|
+
readonly artifact: ArtifactAssemblyPlan;
|
|
8
|
+
readonly context: SigningContext;
|
|
9
|
+
readonly validatorContribution: Hex;
|
|
10
|
+
readonly diagnostics?: {
|
|
11
|
+
readonly plan: SigningStageAssemblyInput['plan'];
|
|
12
|
+
readonly stageId: string;
|
|
13
|
+
};
|
|
14
|
+
}): Hex;
|
|
15
|
+
//# sourceMappingURL=assemble.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assemble.d.ts","sourceRoot":"","sources":["../../../../signing/intent-plans/assemble.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAGhD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAErE,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,yBAAyB,EAChC,OAAO,EAAE,cAAc,GACtB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAsB3C;AAED,wBAAgB,+BAA+B,CAAC,KAAK,EAAE;IACrD,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAA;IACvC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;IAChC,QAAQ,CAAC,qBAAqB,EAAE,GAAG,CAAA;IACnC,QAAQ,CAAC,WAAW,CAAC,EAAE;QACrB,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAA;QAChD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KACzB,CAAA;CACF,GAAG,GAAG,CAsCN"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { encodePlannedValidatorContribution } from '../contribution.js';
|
|
2
|
+
import { runSigningStep } from '../error.js';
|
|
3
|
+
import { wrapErc7739TypedDataSignature } from '../protocols/erc7739.js';
|
|
4
|
+
export function assembleIntentStage(input, context) {
|
|
5
|
+
const outputs = {};
|
|
6
|
+
for (const artifact of input.stagePlan.artifacts) {
|
|
7
|
+
if (artifact.input.kind === 'session-claim-pair')
|
|
8
|
+
continue;
|
|
9
|
+
outputs[artifact.id] =
|
|
10
|
+
artifact.input.kind === 'reuse-artifact'
|
|
11
|
+
? resolveReusedArtifact(artifact.id, artifact.input, input.priorOutputs)
|
|
12
|
+
: assembleSignedArtifact(input, artifact, context);
|
|
13
|
+
}
|
|
14
|
+
for (const artifact of input.stagePlan.artifacts) {
|
|
15
|
+
if (artifact.input.kind !== 'session-claim-pair')
|
|
16
|
+
continue;
|
|
17
|
+
const preClaimSig = outputs[artifact.input.preClaimArtifactId];
|
|
18
|
+
const notarizedClaimSig = outputs[artifact.input.notarizedClaimArtifactId];
|
|
19
|
+
if (typeof preClaimSig !== 'string' ||
|
|
20
|
+
typeof notarizedClaimSig !== 'string') {
|
|
21
|
+
throw new Error(`Session claim pair ${artifact.id} is incomplete`);
|
|
22
|
+
}
|
|
23
|
+
outputs[artifact.id] = { preClaimSig, notarizedClaimSig };
|
|
24
|
+
}
|
|
25
|
+
return outputs;
|
|
26
|
+
}
|
|
27
|
+
export function assembleIntentValidatorArtifact(input) {
|
|
28
|
+
if (input.artifact.erc6492.kind !== 'none') {
|
|
29
|
+
throw new Error('ERC-6492 is forbidden for intent signatures');
|
|
30
|
+
}
|
|
31
|
+
const step = (failureStage, operation) => input.diagnostics
|
|
32
|
+
? runSigningStep({
|
|
33
|
+
plan: input.diagnostics.plan,
|
|
34
|
+
failureStage,
|
|
35
|
+
stageId: input.diagnostics.stageId,
|
|
36
|
+
artifactId: input.artifact.id,
|
|
37
|
+
usage: input.artifact.usage,
|
|
38
|
+
operation,
|
|
39
|
+
})
|
|
40
|
+
: operation();
|
|
41
|
+
let contribution = input.validatorContribution;
|
|
42
|
+
const erc7739 = input.artifact.erc7739;
|
|
43
|
+
if (erc7739.kind === 'wrap-typed-data') {
|
|
44
|
+
contribution = step('protocol-operation', () => wrapErc7739TypedDataSignature({
|
|
45
|
+
typedData: erc7739.typedData,
|
|
46
|
+
signature: contribution,
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
return input.artifact.accountEnvelope.kind === 'none'
|
|
50
|
+
? contribution
|
|
51
|
+
: step('account-envelope', () => input.context.accountAdapter.encodeSignatureEnvelope({
|
|
52
|
+
account: input.context.account,
|
|
53
|
+
envelope: input.artifact.accountEnvelope,
|
|
54
|
+
validatorContribution: contribution,
|
|
55
|
+
purpose: 'intent',
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
function assembleSignedArtifact(input, artifact, context) {
|
|
59
|
+
if (artifact.validatorCodec.kind === 'none') {
|
|
60
|
+
if (artifact.input.kind !== 'task-results' ||
|
|
61
|
+
artifact.input.taskIds.length !== 1) {
|
|
62
|
+
throw new Error(`Direct artifact ${artifact.id} requires one task`);
|
|
63
|
+
}
|
|
64
|
+
const result = input.results[artifact.input.taskIds[0]];
|
|
65
|
+
if (result?.kind !== 'ecdsa-signature') {
|
|
66
|
+
throw new Error(`Direct artifact ${artifact.id} requires an ECDSA result`);
|
|
67
|
+
}
|
|
68
|
+
return result.signature;
|
|
69
|
+
}
|
|
70
|
+
return assembleIntentValidatorArtifact({
|
|
71
|
+
artifact,
|
|
72
|
+
context,
|
|
73
|
+
validatorContribution: runSigningStep({
|
|
74
|
+
plan: input.plan,
|
|
75
|
+
failureStage: 'validator-encode',
|
|
76
|
+
stageId: input.stage.stageId,
|
|
77
|
+
artifactId: artifact.id,
|
|
78
|
+
usage: artifact.usage,
|
|
79
|
+
operation: () => encodePlannedValidatorContribution({
|
|
80
|
+
artifact,
|
|
81
|
+
stage: input.stage,
|
|
82
|
+
results: input.results,
|
|
83
|
+
}),
|
|
84
|
+
}),
|
|
85
|
+
diagnostics: { plan: input.plan, stageId: input.stage.stageId },
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function resolveReusedArtifact(artifactId, route, priorOutputs) {
|
|
89
|
+
const source = priorOutputs[`${route.stageId}:${route.artifactId}`];
|
|
90
|
+
if (typeof source === 'string')
|
|
91
|
+
return source;
|
|
92
|
+
if (source && route.selection === 'pre-claim' && 'preClaimSig' in source) {
|
|
93
|
+
return source.preClaimSig;
|
|
94
|
+
}
|
|
95
|
+
throw new Error(`Reused artifact ${route.artifactId} is unavailable for ${artifactId}`);
|
|
96
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Account, Address, Hex } from 'viem';
|
|
2
|
+
import type { WebAuthnAccount } from 'viem/account-abstraction';
|
|
3
|
+
import type { SigningContext } from '../context.js';
|
|
4
|
+
import type { ArtifactAssemblyPlan } from '../types.js';
|
|
5
|
+
export interface IndependentOwnerDescriptor {
|
|
6
|
+
readonly ownerId: string;
|
|
7
|
+
readonly identity: Address | Hex;
|
|
8
|
+
readonly kind: 'ecdsa' | 'webauthn';
|
|
9
|
+
readonly factorId?: string;
|
|
10
|
+
readonly factorPublicId?: number | Hex;
|
|
11
|
+
}
|
|
12
|
+
export type IndependentOwnerSignatureData = {
|
|
13
|
+
readonly kind: 'ecdsa';
|
|
14
|
+
readonly signer: Address;
|
|
15
|
+
readonly origin: readonly Hex[];
|
|
16
|
+
} | {
|
|
17
|
+
readonly kind: 'passkey';
|
|
18
|
+
readonly publicKey: Hex;
|
|
19
|
+
readonly origin: readonly {
|
|
20
|
+
readonly webauthn: {
|
|
21
|
+
readonly authenticatorData: Hex;
|
|
22
|
+
readonly challengeIndex?: number;
|
|
23
|
+
readonly clientDataJSON: string;
|
|
24
|
+
readonly typeIndex?: number;
|
|
25
|
+
readonly userVerificationRequired?: boolean;
|
|
26
|
+
};
|
|
27
|
+
readonly signature: Hex;
|
|
28
|
+
}[];
|
|
29
|
+
};
|
|
30
|
+
export type IndependentOwnerSignature = ({
|
|
31
|
+
readonly intentId: string;
|
|
32
|
+
} & IndependentOwnerSignatureData) | {
|
|
33
|
+
readonly intentId: string;
|
|
34
|
+
readonly kind: 'multi-factor';
|
|
35
|
+
readonly validatorId: number | Hex;
|
|
36
|
+
readonly signature: IndependentOwnerSignatureData;
|
|
37
|
+
};
|
|
38
|
+
export declare function assembleIndependentIntentArtifact(input: {
|
|
39
|
+
readonly intentId: string;
|
|
40
|
+
readonly originIndex: number;
|
|
41
|
+
readonly originCount: number;
|
|
42
|
+
readonly signatures: readonly IndependentOwnerSignature[];
|
|
43
|
+
readonly owners: readonly IndependentOwnerDescriptor[];
|
|
44
|
+
readonly artifact: ArtifactAssemblyPlan;
|
|
45
|
+
readonly context: SigningContext;
|
|
46
|
+
}): Hex;
|
|
47
|
+
export type IndependentSigner = Account | WebAuthnAccount;
|
|
48
|
+
//# sourceMappingURL=independent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"independent.d.ts","sourceRoot":"","sources":["../../../../signing/intent-plans/independent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAY/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAGpD,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,GAAG,CAAA;IAChC,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,CAAA;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CACvC;AAED,MAAM,MAAM,6BAA6B,GACrC;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,EAAE,CAAA;CAChC,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,SAAS;QACxB,QAAQ,CAAC,QAAQ,EAAE;YACjB,QAAQ,CAAC,iBAAiB,EAAE,GAAG,CAAA;YAC/B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;YAChC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;YAC/B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;YAC3B,QAAQ,CAAC,wBAAwB,CAAC,EAAE,OAAO,CAAA;SAC5C,CAAA;QACD,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAA;KACxB,EAAE,CAAA;CACJ,CAAA;AAEL,MAAM,MAAM,yBAAyB,GACjC,CAAC;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,6BAA6B,CAAC,GAC/D;IACE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG,CAAA;IAClC,QAAQ,CAAC,SAAS,EAAE,6BAA6B,CAAA;CAClD,CAAA;AAEL,wBAAgB,iCAAiC,CAAC,KAAK,EAAE;IACvD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,UAAU,EAAE,SAAS,yBAAyB,EAAE,CAAA;IACzD,QAAQ,CAAC,MAAM,EAAE,SAAS,0BAA0B,EAAE,CAAA;IACtD,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAA;IACvC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;CACjC,GAAG,GAAG,CA2BN;AAoLD,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,eAAe,CAAA"}
|