@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,31 @@
|
|
|
1
|
+
import type { Hex } from 'viem';
|
|
2
|
+
import type { EvmChainReference } from '../chains/types.js';
|
|
3
|
+
import type { ResolvedModule } from '../modules/types.js';
|
|
4
|
+
import type { AccountCallEncodingInput, AccountCapabilities, AccountConstruction, AccountDefinition, AccountDeploymentPlan, AccountEip7702AdoptionPlan, AccountIdentity, AccountSignatureEnvelope } from './types.js';
|
|
5
|
+
export interface AccountSignatureEnvelopeInput {
|
|
6
|
+
readonly account: AccountIdentity;
|
|
7
|
+
readonly envelope: AccountSignatureEnvelope;
|
|
8
|
+
readonly validatorContribution: Hex;
|
|
9
|
+
readonly purpose: 'erc1271' | 'intent' | 'user-operation';
|
|
10
|
+
}
|
|
11
|
+
export interface AccountAdapter {
|
|
12
|
+
readonly account: AccountDefinition;
|
|
13
|
+
readonly capabilities: AccountCapabilities;
|
|
14
|
+
readonly getIdentity: (input: AccountConstruction) => AccountIdentity;
|
|
15
|
+
readonly getDeploymentPlan: (input: AccountConstruction) => AccountDeploymentPlan;
|
|
16
|
+
readonly getEip7702AdoptionPlan?: (input: AccountConstruction) => AccountEip7702AdoptionPlan;
|
|
17
|
+
readonly getEip7702InitCall?: (input: AccountConstruction, eip7702InitSignature: Hex) => Hex;
|
|
18
|
+
readonly encodeCalls: (input: AccountCallEncodingInput) => Hex;
|
|
19
|
+
readonly encodeModuleInstallation: (module: ResolvedModule) => readonly Hex[];
|
|
20
|
+
readonly encodeModuleUninstallation: (module: ResolvedModule) => Hex;
|
|
21
|
+
readonly encodeSignatureEnvelope: (input: AccountSignatureEnvelopeInput) => Hex;
|
|
22
|
+
}
|
|
23
|
+
export interface AccountRuntime {
|
|
24
|
+
readonly adapter: AccountAdapter;
|
|
25
|
+
readonly construction: AccountConstruction;
|
|
26
|
+
readonly identity: AccountIdentity;
|
|
27
|
+
}
|
|
28
|
+
export interface AccountRuntimePort {
|
|
29
|
+
readonly forChain: (chain: EvmChainReference) => Promise<AccountRuntime>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../accounts/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EACV,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,eAAe,EACf,wBAAwB,EACzB,MAAM,SAAS,CAAA;AAEhB,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;IACjC,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAA;IAC3C,QAAQ,CAAC,qBAAqB,EAAE,GAAG,CAAA;IACnC,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,QAAQ,GAAG,gBAAgB,CAAA;CAC1D;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAA;IACnC,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAA;IAC1C,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,eAAe,CAAA;IACrE,QAAQ,CAAC,iBAAiB,EAAE,CAC1B,KAAK,EAAE,mBAAmB,KACvB,qBAAqB,CAAA;IAC1B,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAChC,KAAK,EAAE,mBAAmB,KACvB,0BAA0B,CAAA;IAK/B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAC5B,KAAK,EAAE,mBAAmB,EAC1B,oBAAoB,EAAE,GAAG,KACtB,GAAG,CAAA;IACR,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,GAAG,CAAA;IAC9D,QAAQ,CAAC,wBAAwB,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,SAAS,GAAG,EAAE,CAAA;IAC7E,QAAQ,CAAC,0BAA0B,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,GAAG,CAAA;IACpE,QAAQ,CAAC,uBAAuB,EAAE,CAChC,KAAK,EAAE,6BAA6B,KACjC,GAAG,CAAA;CACT;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;IAChC,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAA;IAC1C,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAA;CACnC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,cAAc,CAAC,CAAA;CACzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eoa.d.ts","sourceRoot":"","sources":["../../../../accounts/adapters/eoa.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAGhD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAQnD,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,mBAAmB,GAChC,cAAc,CAmChB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { deploymentPlan } from '../deployment.js';
|
|
2
|
+
import { ModuleInstallationNotSupportedError } from '../error.js';
|
|
3
|
+
function eoaAddress(input) {
|
|
4
|
+
if (input.account.kind !== 'eoa')
|
|
5
|
+
throw new Error('Expected EOA account');
|
|
6
|
+
if (!input.eoa)
|
|
7
|
+
throw new Error('EOA account is required');
|
|
8
|
+
return input.eoa.address;
|
|
9
|
+
}
|
|
10
|
+
export function createEoaAdapter(construction) {
|
|
11
|
+
if (construction.account.kind !== 'eoa') {
|
|
12
|
+
throw new Error('Expected EOA account');
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
account: construction.account,
|
|
16
|
+
capabilities: {
|
|
17
|
+
modular: false,
|
|
18
|
+
supportsDeployment: false,
|
|
19
|
+
supportsUserOperations: false,
|
|
20
|
+
supportsEip7702Adoption: false,
|
|
21
|
+
supportsSmartSessions: false,
|
|
22
|
+
supportsOriginSignatureReuse: true,
|
|
23
|
+
signatureEnvelope: { kind: 'none' },
|
|
24
|
+
},
|
|
25
|
+
getIdentity: (input) => ({
|
|
26
|
+
definition: input.account,
|
|
27
|
+
address: eoaAddress(input),
|
|
28
|
+
}),
|
|
29
|
+
getDeploymentPlan: (input) => deploymentPlan(input.chain, { address: eoaAddress(input) }, true),
|
|
30
|
+
encodeCalls: () => {
|
|
31
|
+
throw new Error('EOA calls do not use ERC-7579 encoding');
|
|
32
|
+
},
|
|
33
|
+
encodeModuleInstallation: () => {
|
|
34
|
+
throw new ModuleInstallationNotSupportedError('eoa');
|
|
35
|
+
},
|
|
36
|
+
encodeModuleUninstallation: () => {
|
|
37
|
+
throw new ModuleInstallationNotSupportedError('eoa');
|
|
38
|
+
},
|
|
39
|
+
encodeSignatureEnvelope: ({ envelope, validatorContribution }) => {
|
|
40
|
+
if (envelope.kind !== 'none')
|
|
41
|
+
throw new Error('Expected EOA envelope');
|
|
42
|
+
return validatorContribution;
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AccountAdapter } from '../adapter.js';
|
|
2
|
+
import type { AccountConstruction } from '../types.js';
|
|
3
|
+
export declare const HCA_IMPLEMENTATION_ADDRESS: "0x7c2cC1e499a87ab480Df154e05164cD56D05d570";
|
|
4
|
+
export declare function createHcaAdapter(construction: AccountConstruction): AccountAdapter;
|
|
5
|
+
//# sourceMappingURL=hca.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hca.d.ts","sourceRoot":"","sources":["../../../../accounts/adapters/hca.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAIhD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAGnD,eAAO,MAAM,0BAA0B,EACrC,4CAAqD,CAAA;AAwFvD,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,mBAAmB,GAChC,cAAc,CAqChB"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { concat, decodeAbiParameters, decodeFunctionData, encodeFunctionData, encodePacked, keccak256, pad, parseAbi, slice, } from 'viem';
|
|
2
|
+
import { ENS_HCA_MODULE } from '../../modules/validators/ens.js';
|
|
3
|
+
import { deploymentPlan } from '../deployment.js';
|
|
4
|
+
import { encodeErc7579Calls } from '../erc7579-calls.js';
|
|
5
|
+
import { ModuleInstallationNotSupportedError } from '../error.js';
|
|
6
|
+
import { encodeAddressEnvelope } from './shared.js';
|
|
7
|
+
export const HCA_IMPLEMENTATION_ADDRESS = '0x7c2cC1e499a87ab480Df154e05164cD56D05d570';
|
|
8
|
+
const HCA_FACTORY_ADDRESS = '0x358680728dedb552adaa9f5eb5d4395b291cf943';
|
|
9
|
+
const CREATE3_PROXY_HASH = '0x21c35dbe1b344a2488cf3321d6ce542f8e9f305544ff09e4993a62319a497c1f';
|
|
10
|
+
function primaryOwner(factoryData) {
|
|
11
|
+
const decoded = decodeFunctionData({
|
|
12
|
+
abi: parseAbi(['function createAccount(bytes)']),
|
|
13
|
+
data: factoryData,
|
|
14
|
+
});
|
|
15
|
+
const [, owners] = decodeAbiParameters([
|
|
16
|
+
{ type: 'uint256' },
|
|
17
|
+
{
|
|
18
|
+
type: 'tuple[]',
|
|
19
|
+
components: [
|
|
20
|
+
{ name: 'addr', type: 'address' },
|
|
21
|
+
{ name: 'expiration', type: 'uint48' },
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
], decoded.args[0]);
|
|
25
|
+
const owner = owners[0];
|
|
26
|
+
if (!owner)
|
|
27
|
+
throw new Error('HCA primary owner is required');
|
|
28
|
+
return owner.addr;
|
|
29
|
+
}
|
|
30
|
+
function predictCreate3Address(factory, owner) {
|
|
31
|
+
const salt = pad(owner, { size: 32, dir: 'right' });
|
|
32
|
+
const proxyHash = keccak256(encodePacked(['bytes1', 'address', 'bytes32', 'bytes32'], ['0xff', factory, salt, CREATE3_PROXY_HASH]));
|
|
33
|
+
const proxyAddress = slice(proxyHash, 12, 32);
|
|
34
|
+
return slice(keccak256(concat(['0xd694', proxyAddress, '0x01'])), 12, 32);
|
|
35
|
+
}
|
|
36
|
+
function hcaMaterial(input) {
|
|
37
|
+
if (input.account.kind !== 'hca')
|
|
38
|
+
throw new Error('Expected HCA account');
|
|
39
|
+
if (input.eoa)
|
|
40
|
+
return { address: input.eoa.address };
|
|
41
|
+
if (input.sessions.enabled || input.modules.length > 0) {
|
|
42
|
+
throw new Error('HCA accounts cannot install sessions or additional modules');
|
|
43
|
+
}
|
|
44
|
+
if (!input.owner || input.owner.kind !== 'ens') {
|
|
45
|
+
throw new Error('HCA accounts require ENS owners');
|
|
46
|
+
}
|
|
47
|
+
if (input.initData && !('factory' in input.initData)) {
|
|
48
|
+
return { address: input.initData.address };
|
|
49
|
+
}
|
|
50
|
+
let factory;
|
|
51
|
+
let factoryData;
|
|
52
|
+
if (input.initData && 'factory' in input.initData) {
|
|
53
|
+
factory = input.initData.factory;
|
|
54
|
+
factoryData = input.initData.factoryData;
|
|
55
|
+
try {
|
|
56
|
+
decodeFunctionData({
|
|
57
|
+
abi: parseAbi(['function createAccount(bytes)']),
|
|
58
|
+
data: factoryData,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return { address: input.initData.address };
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
factory =
|
|
67
|
+
input.account.factory.source === 'explicit'
|
|
68
|
+
? input.account.factory.value
|
|
69
|
+
: HCA_FACTORY_ADDRESS;
|
|
70
|
+
const validator = input.setup.validators[0];
|
|
71
|
+
if (!validator)
|
|
72
|
+
throw new Error('HCA owner validator is required');
|
|
73
|
+
factoryData = encodeFunctionData({
|
|
74
|
+
abi: parseAbi(['function createAccount(bytes)']),
|
|
75
|
+
functionName: 'createAccount',
|
|
76
|
+
args: [validator.initData],
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
address: predictCreate3Address(factory, primaryOwner(factoryData)),
|
|
81
|
+
factory,
|
|
82
|
+
factoryData,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export function createHcaAdapter(construction) {
|
|
86
|
+
if (construction.account.kind !== 'hca') {
|
|
87
|
+
throw new Error('Expected HCA account');
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
account: construction.account,
|
|
91
|
+
capabilities: {
|
|
92
|
+
modular: false,
|
|
93
|
+
supportsDeployment: true,
|
|
94
|
+
supportsUserOperations: true,
|
|
95
|
+
supportsEip7702Adoption: false,
|
|
96
|
+
supportsSmartSessions: false,
|
|
97
|
+
supportsOriginSignatureReuse: true,
|
|
98
|
+
signatureEnvelope: { kind: 'hca', validator: ENS_HCA_MODULE },
|
|
99
|
+
},
|
|
100
|
+
getIdentity: (input) => ({
|
|
101
|
+
definition: input.account,
|
|
102
|
+
address: hcaMaterial(input).address,
|
|
103
|
+
}),
|
|
104
|
+
getDeploymentPlan: (input) => deploymentPlan(input.chain, hcaMaterial(input), input.deployed),
|
|
105
|
+
encodeCalls: encodeErc7579Calls,
|
|
106
|
+
encodeModuleInstallation: () => {
|
|
107
|
+
throw new ModuleInstallationNotSupportedError('hca');
|
|
108
|
+
},
|
|
109
|
+
encodeModuleUninstallation: () => {
|
|
110
|
+
throw new ModuleInstallationNotSupportedError('hca');
|
|
111
|
+
},
|
|
112
|
+
encodeSignatureEnvelope: ({ envelope, validatorContribution }) => {
|
|
113
|
+
if (envelope.kind !== 'hca')
|
|
114
|
+
throw new Error('Expected HCA envelope');
|
|
115
|
+
return encodeAddressEnvelope(envelope.validator, validatorContribution, ENS_HCA_MODULE);
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Hex } from 'viem';
|
|
2
|
+
import type { ResolvedModule } from '../../modules/types.js';
|
|
3
|
+
import type { AccountAdapter } from '../adapter.js';
|
|
4
|
+
import type { AccountConstruction } from '../types.js';
|
|
5
|
+
export declare const KERNEL_IMPLEMENTATION_ADDRESS: "0xd6cedde84be40893d153be9d467cd6ad37875b28";
|
|
6
|
+
export declare function wrapKernelMessageHash(messageHash: Hex, account: Hex): Hex;
|
|
7
|
+
export declare function kernelInstallData(module: ResolvedModule): readonly Hex[];
|
|
8
|
+
export declare function createKernelAdapter(construction: AccountConstruction): AccountAdapter;
|
|
9
|
+
//# sourceMappingURL=kernel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../../../accounts/adapters/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,GAAG,EAOT,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAGhD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAKnD,eAAO,MAAM,6BAA6B,EACxC,4CAAqD,CAAA;AAQvD,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,GAAG,GAAG,CAgBzE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,SAAS,GAAG,EAAE,CA2CxE;AAyED,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,mBAAmB,GAChC,cAAc,CAmChB"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { concat, concatHex, decodeAbiParameters, decodeFunctionData, domainSeparator, encodeAbiParameters, encodeFunctionData, getContractAddress, keccak256, parseAbi, stringToHex, toHex, zeroAddress, zeroHash, } from 'viem';
|
|
2
|
+
import { moduleTypeId } from '../../modules/erc7579-abi.js';
|
|
3
|
+
import { deploymentPlan } from '../deployment.js';
|
|
4
|
+
import { encodeErc7579Calls } from '../erc7579-calls.js';
|
|
5
|
+
import { encodeUninstallModule } from './shared.js';
|
|
6
|
+
const KERNEL_META_FACTORY_ADDRESS = '0xd703aae79538628d27099b8c4f621be4ccd142d5';
|
|
7
|
+
export const KERNEL_IMPLEMENTATION_ADDRESS = '0xd6cedde84be40893d153be9d467cd6ad37875b28';
|
|
8
|
+
const KERNEL_FACTORY_ADDRESS = '0x2577507b78c2008ff367261cb6285d44ba5ef2e9';
|
|
9
|
+
const KERNEL_BYTECODE = '0x603d3d8160223d3973d6cedde84be40893d153be9d467cd6ad37875b2860095155f3363d3d373d3d363d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc545af43d6000803e6038573d6000fd5b3d6000f3';
|
|
10
|
+
const HOOK_INSTALLED_ADDRESS = '0x0000000000000000000000000000000000000001';
|
|
11
|
+
export function wrapKernelMessageHash(messageHash, account) {
|
|
12
|
+
const separator = domainSeparator({
|
|
13
|
+
domain: {
|
|
14
|
+
name: 'Kernel',
|
|
15
|
+
version: '0.3.3',
|
|
16
|
+
chainId: 0,
|
|
17
|
+
verifyingContract: account,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
const structHash = keccak256(encodeAbiParameters([{ type: 'bytes32' }, { type: 'bytes32' }], [keccak256(stringToHex('Kernel(bytes32 hash)')), messageHash]));
|
|
21
|
+
return keccak256(concatHex(['0x1901', separator, structHash]));
|
|
22
|
+
}
|
|
23
|
+
export function kernelInstallData(module) {
|
|
24
|
+
const install = (initData) => encodeFunctionData({
|
|
25
|
+
abi: parseAbi(['function installModule(uint256,address,bytes)']),
|
|
26
|
+
functionName: 'installModule',
|
|
27
|
+
args: [moduleTypeId(module.kind), module.address, initData],
|
|
28
|
+
});
|
|
29
|
+
switch (module.kind) {
|
|
30
|
+
case 'validator': {
|
|
31
|
+
const data = encodeAbiParameters([{ type: 'bytes' }, { type: 'bytes' }, { type: 'bytes' }], [module.initData, '0x', '0x']);
|
|
32
|
+
return [
|
|
33
|
+
install(concat([HOOK_INSTALLED_ADDRESS, data])),
|
|
34
|
+
encodeFunctionData({
|
|
35
|
+
abi: parseAbi(['function grantAccess(bytes21,bytes4,bool)']),
|
|
36
|
+
functionName: 'grantAccess',
|
|
37
|
+
args: [concat(['0x01', module.address]), '0xe9ae5c53', true],
|
|
38
|
+
}),
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
case 'executor': {
|
|
42
|
+
const data = encodeAbiParameters([{ type: 'bytes' }, { type: 'bytes' }], [module.initData, '0x']);
|
|
43
|
+
return [install(concat([zeroAddress, data]))];
|
|
44
|
+
}
|
|
45
|
+
case 'fallback': {
|
|
46
|
+
const [selector, flags, selectorData] = decodeAbiParameters([{ type: 'bytes4' }, { type: 'bytes1' }, { type: 'bytes' }], module.initData);
|
|
47
|
+
const data = encodeAbiParameters([{ type: 'bytes' }, { type: 'bytes' }], [concat([flags, selectorData]), '0x']);
|
|
48
|
+
return [install(concat([selector, HOOK_INSTALLED_ADDRESS, data]))];
|
|
49
|
+
}
|
|
50
|
+
case 'hook':
|
|
51
|
+
return [install(module.initData)];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function kernelMaterial(input) {
|
|
55
|
+
if (input.account.kind !== 'kernel')
|
|
56
|
+
throw new Error('Expected Kernel account');
|
|
57
|
+
if (input.eoa)
|
|
58
|
+
return { address: input.eoa.address };
|
|
59
|
+
if (input.initData && !('factory' in input.initData)) {
|
|
60
|
+
return { address: input.initData.address };
|
|
61
|
+
}
|
|
62
|
+
let factoryData;
|
|
63
|
+
let salt;
|
|
64
|
+
let initializationCallData;
|
|
65
|
+
if (input.initData && 'factory' in input.initData) {
|
|
66
|
+
const decoded = decodeFunctionData({
|
|
67
|
+
abi: parseAbi([
|
|
68
|
+
'function deployWithFactory(address factory,bytes createData,bytes32 salt)',
|
|
69
|
+
]),
|
|
70
|
+
data: input.initData.factoryData,
|
|
71
|
+
});
|
|
72
|
+
if (decoded.args[0].toLowerCase() !== KERNEL_FACTORY_ADDRESS.toLowerCase()) {
|
|
73
|
+
throw new Error('Unsupported Kernel implementation');
|
|
74
|
+
}
|
|
75
|
+
factoryData = input.initData.factoryData;
|
|
76
|
+
initializationCallData = decoded.args[1];
|
|
77
|
+
salt = decoded.args[2];
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
const rootValidator = input.setup.validators[0];
|
|
81
|
+
if (!rootValidator)
|
|
82
|
+
throw new Error('Kernel root validator is required');
|
|
83
|
+
const initConfig = [
|
|
84
|
+
...input.setup.validators.slice(1),
|
|
85
|
+
...input.setup.executors,
|
|
86
|
+
...input.setup.fallbacks,
|
|
87
|
+
...input.setup.hooks,
|
|
88
|
+
].flatMap(kernelInstallData);
|
|
89
|
+
initializationCallData = encodeFunctionData({
|
|
90
|
+
abi: parseAbi([
|
|
91
|
+
'function initialize(bytes21,address,bytes,bytes,bytes[])',
|
|
92
|
+
]),
|
|
93
|
+
functionName: 'initialize',
|
|
94
|
+
args: [
|
|
95
|
+
concat(['0x01', rootValidator.address]),
|
|
96
|
+
zeroAddress,
|
|
97
|
+
rootValidator.initData,
|
|
98
|
+
'0x',
|
|
99
|
+
initConfig,
|
|
100
|
+
],
|
|
101
|
+
});
|
|
102
|
+
salt =
|
|
103
|
+
input.account.salt.source === 'explicit'
|
|
104
|
+
? input.account.salt.value
|
|
105
|
+
: zeroHash;
|
|
106
|
+
factoryData = encodeFunctionData({
|
|
107
|
+
abi: parseAbi(['function deployWithFactory(address,bytes,bytes32)']),
|
|
108
|
+
functionName: 'deployWithFactory',
|
|
109
|
+
args: [KERNEL_FACTORY_ADDRESS, initializationCallData, salt],
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
const actualSalt = keccak256(concat([initializationCallData, salt]));
|
|
113
|
+
const address = getContractAddress({
|
|
114
|
+
from: KERNEL_FACTORY_ADDRESS,
|
|
115
|
+
opcode: 'CREATE2',
|
|
116
|
+
bytecode: KERNEL_BYTECODE,
|
|
117
|
+
salt: actualSalt,
|
|
118
|
+
});
|
|
119
|
+
return {
|
|
120
|
+
address,
|
|
121
|
+
factory: input.initData?.factory ?? KERNEL_META_FACTORY_ADDRESS,
|
|
122
|
+
factoryData,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
export function createKernelAdapter(construction) {
|
|
126
|
+
if (construction.account.kind !== 'kernel') {
|
|
127
|
+
throw new Error('Expected Kernel account');
|
|
128
|
+
}
|
|
129
|
+
const validator = construction.setup.validators[0]?.address ?? zeroAddress;
|
|
130
|
+
return {
|
|
131
|
+
account: construction.account,
|
|
132
|
+
capabilities: {
|
|
133
|
+
modular: true,
|
|
134
|
+
supportsDeployment: true,
|
|
135
|
+
supportsUserOperations: true,
|
|
136
|
+
supportsEip7702Adoption: false,
|
|
137
|
+
supportsSmartSessions: true,
|
|
138
|
+
supportsOriginSignatureReuse: true,
|
|
139
|
+
signatureEnvelope: { kind: 'kernel', validator, isRoot: true },
|
|
140
|
+
},
|
|
141
|
+
getIdentity: (input) => ({
|
|
142
|
+
definition: input.account,
|
|
143
|
+
address: kernelMaterial(input).address,
|
|
144
|
+
}),
|
|
145
|
+
getDeploymentPlan: (input) => deploymentPlan(input.chain, kernelMaterial(input), input.deployed),
|
|
146
|
+
encodeCalls: encodeErc7579Calls,
|
|
147
|
+
encodeModuleInstallation: kernelInstallData,
|
|
148
|
+
encodeModuleUninstallation: encodeUninstallModule,
|
|
149
|
+
encodeSignatureEnvelope: ({ envelope, validatorContribution }) => {
|
|
150
|
+
if (envelope.kind !== 'kernel')
|
|
151
|
+
throw new Error('Expected Kernel envelope');
|
|
152
|
+
return concat([
|
|
153
|
+
envelope.isRoot ? '0x00' : concat(['0x01', envelope.validator]),
|
|
154
|
+
keccak256(toHex('kernel.replayable.signature')),
|
|
155
|
+
validatorContribution,
|
|
156
|
+
]);
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
import type { AccountAdapter } from '../adapter.js';
|
|
3
|
+
import { type DeploymentMaterial } from '../deployment.js';
|
|
4
|
+
import type { AccountConstruction } from '../types.js';
|
|
5
|
+
export declare const NEXUS_IMPLEMENTATION_ADDRESS: "0x000000000032ddc454c3bdcba80484ad5a798705";
|
|
6
|
+
export declare const NEXUS_FACTORY_ADDRESS: "0x0000000000679a258c64d2f20f310e12b64b7375";
|
|
7
|
+
export declare const NEXUS_IMPLEMENTATION_1_2_1: "0x000000000d41c0bf0063dba53343389cdb2c9c78";
|
|
8
|
+
export declare const NEXUS_FACTORY_1_2_1: "0x0000000099d5576c73a3b190dabeeaa0f128ce6b";
|
|
9
|
+
export declare function nexusDefaultValidator(version: string | undefined): Address;
|
|
10
|
+
export interface NexusDeploymentMaterial extends DeploymentMaterial {
|
|
11
|
+
readonly initializationCallData?: Hex;
|
|
12
|
+
readonly implementation?: Address;
|
|
13
|
+
readonly salt?: Hex;
|
|
14
|
+
}
|
|
15
|
+
export declare function nexusMaterial(input: AccountConstruction): NexusDeploymentMaterial;
|
|
16
|
+
export declare function createNexusAdapter(construction: AccountConstruction): AccountAdapter;
|
|
17
|
+
//# sourceMappingURL=nexus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nexus.d.ts","sourceRoot":"","sources":["../../../../accounts/adapters/nexus.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAOZ,KAAK,GAAG,EAKT,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,KAAK,kBAAkB,EAAkB,MAAM,eAAe,CAAA;AAEvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAOnD,eAAO,MAAM,4BAA4B,EACvC,4CAAqD,CAAA;AACvD,eAAO,MAAM,qBAAqB,EAChC,4CAAqD,CAAA;AAIvD,eAAO,MAAM,0BAA0B,EACrC,4CAAqD,CAAA;AACvD,eAAO,MAAM,mBAAmB,EAC9B,4CAAqD,CAAA;AAMvD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAW1E;AA+BD,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE,QAAQ,CAAC,sBAAsB,CAAC,EAAE,GAAG,CAAA;IACrC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAA;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,GAAG,CAAA;CACpB;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,mBAAmB,GACzB,uBAAuB,CAwHzB;AA4CD,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,mBAAmB,GAChC,cAAc,CAwChB"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { concat, decodeFunctionData, encodeAbiParameters, encodeFunctionData, encodePacked, getContractAddress, keccak256, parseAbi, size, zeroAddress, } from 'viem';
|
|
2
|
+
import { OWNABLE_VALIDATOR_ADDRESS } from '../../modules/validators/ownable.js';
|
|
3
|
+
import { deploymentPlan } from '../deployment.js';
|
|
4
|
+
import { encodeErc7579Calls } from '../erc7579-calls.js';
|
|
5
|
+
import { encodeAddressEnvelope, encodeInstallModule, encodeUninstallModule, } from './shared.js';
|
|
6
|
+
export const NEXUS_IMPLEMENTATION_ADDRESS = '0x000000000032ddc454c3bdcba80484ad5a798705';
|
|
7
|
+
export const NEXUS_FACTORY_ADDRESS = '0x0000000000679a258c64d2f20f310e12b64b7375';
|
|
8
|
+
// Current default (1.2.1): new implementation + factory, same bootstrap and
|
|
9
|
+
// proxy creation code as 1.2.0. `version: '1.2.0'` opts back into the previous
|
|
10
|
+
// implementation + factory so its counterfactual address doesn't change.
|
|
11
|
+
export const NEXUS_IMPLEMENTATION_1_2_1 = '0x000000000d41c0bf0063dba53343389cdb2c9c78';
|
|
12
|
+
export const NEXUS_FACTORY_1_2_1 = '0x0000000099d5576c73a3b190dabeeaa0f128ce6b';
|
|
13
|
+
const NEXUS_BOOTSTRAP_ADDRESS = '0x00000000006efb61d8c9546ff1b500de3f244ea7';
|
|
14
|
+
const NEXUS_CREATION_CODE = '0x60806040526102aa803803806100148161018c565b92833981016040828203126101885781516001600160a01b03811692909190838303610188576020810151906001600160401b03821161018857019281601f8501121561018857835161006e610069826101c5565b61018c565b9481865260208601936020838301011161018857815f926020809301865e8601015260017f90b772c2cb8a51aa7a8a65fc23543c6d022d5b3f8e2b92eed79fba7eef8293005d823b15610176577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b031916821790557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a282511561015e575f8091610146945190845af43d15610156573d91610137610069846101c5565b9283523d5f602085013e6101e0565b505b604051606b908161023f8239f35b6060916101e0565b50505034156101485763b398979f60e01b5f5260045ffd5b634c9c8ce360e01b5f5260045260245ffd5b5f80fd5b6040519190601f01601f191682016001600160401b038111838210176101b157604052565b634e487b7160e01b5f52604160045260245ffd5b6001600160401b0381116101b157601f01601f191660200190565b9061020457508051156101f557805190602001fd5b63d6bda27560e01b5f5260045ffd5b81511580610235575b610215575090565b639996b31560e01b5f9081526001600160a01b0391909116600452602490fd5b50803b1561020d56fe60806040523615605c575f8073ffffffffffffffffffffffffffffffffffffffff7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5416368280378136915af43d5f803e156058573d5ff35b3d5ffd5b00fea164736f6c634300081b000a';
|
|
15
|
+
export function nexusDefaultValidator(version) {
|
|
16
|
+
switch (version) {
|
|
17
|
+
case '1.0.2':
|
|
18
|
+
return '0x0000002d6db27c52e3c11c1cf24072004ac75cba';
|
|
19
|
+
case 'rhinestone-1.0.0-beta':
|
|
20
|
+
return '0x0000000000e9e6e96bcaa3c113187cdb7e38aed9';
|
|
21
|
+
default:
|
|
22
|
+
// 1.2.0 and 1.2.1 both hardwire the Ownable validator; unset and
|
|
23
|
+
// rhinestone-1.0.0 resolve to it as well.
|
|
24
|
+
return OWNABLE_VALIDATOR_ADDRESS;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// Resolves the implementation + factory a fresh account deploys against. Only
|
|
28
|
+
// the default (unset) and an explicit '1.2.1' deploy the current contracts;
|
|
29
|
+
// '1.2.0' and the legacy pins keep the previous implementation + factory so
|
|
30
|
+
// their counterfactual addresses don't change.
|
|
31
|
+
function getNexusDeployment(version) {
|
|
32
|
+
if (!version || version === '1.2.1') {
|
|
33
|
+
return {
|
|
34
|
+
implementation: NEXUS_IMPLEMENTATION_1_2_1,
|
|
35
|
+
factory: NEXUS_FACTORY_1_2_1,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
implementation: NEXUS_IMPLEMENTATION_ADDRESS,
|
|
40
|
+
factory: NEXUS_FACTORY_ADDRESS,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
// Maps a Nexus factory to the implementation it deploys, so a persisted
|
|
44
|
+
// `initData` payload recomputes against the right implementation instead of
|
|
45
|
+
// defaulting to one version.
|
|
46
|
+
function implementationForFactory(factory) {
|
|
47
|
+
return factory.toLowerCase() === NEXUS_FACTORY_1_2_1
|
|
48
|
+
? NEXUS_IMPLEMENTATION_1_2_1
|
|
49
|
+
: NEXUS_IMPLEMENTATION_ADDRESS;
|
|
50
|
+
}
|
|
51
|
+
export function nexusMaterial(input) {
|
|
52
|
+
if (input.account.kind !== 'nexus')
|
|
53
|
+
throw new Error('Expected Nexus account');
|
|
54
|
+
if (input.eoa)
|
|
55
|
+
return { address: input.eoa.address };
|
|
56
|
+
if (input.initData && !('factory' in input.initData)) {
|
|
57
|
+
return { address: input.initData.address };
|
|
58
|
+
}
|
|
59
|
+
const version = input.account.version.source === 'explicit'
|
|
60
|
+
? input.account.version.value
|
|
61
|
+
: undefined;
|
|
62
|
+
let factory;
|
|
63
|
+
let factoryData;
|
|
64
|
+
let implementation;
|
|
65
|
+
let initializationCallData;
|
|
66
|
+
let salt;
|
|
67
|
+
if (input.initData && 'factory' in input.initData) {
|
|
68
|
+
const decoded = decodeFunctionData({
|
|
69
|
+
abi: parseAbi(['function createAccount(bytes,bytes32)']),
|
|
70
|
+
data: input.initData.factoryData,
|
|
71
|
+
});
|
|
72
|
+
factory = input.initData.factory;
|
|
73
|
+
implementation = implementationForFactory(factory);
|
|
74
|
+
factoryData = input.initData.factoryData;
|
|
75
|
+
const initData = decoded.args[0];
|
|
76
|
+
salt = decoded.args[1];
|
|
77
|
+
initializationCallData = encodeFunctionData({
|
|
78
|
+
abi: parseAbi(['function initializeAccount(bytes)']),
|
|
79
|
+
functionName: 'initializeAccount',
|
|
80
|
+
args: [initData],
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
const deployment = getNexusDeployment(version);
|
|
85
|
+
factory = deployment.factory;
|
|
86
|
+
implementation = deployment.implementation;
|
|
87
|
+
salt =
|
|
88
|
+
input.account.salt.source === 'explicit'
|
|
89
|
+
? input.account.salt.value
|
|
90
|
+
: keccak256('0x');
|
|
91
|
+
const defaultValidator = input.setup.validators.find((module) => module.address === OWNABLE_VALIDATOR_ADDRESS);
|
|
92
|
+
const defaultValidatorInitData = defaultValidator?.initData ?? '0x';
|
|
93
|
+
const validators = input.setup.validators.filter((module) => module.address !== OWNABLE_VALIDATOR_ADDRESS);
|
|
94
|
+
const configs = (modules) => modules.map((module) => ({
|
|
95
|
+
module: module.address,
|
|
96
|
+
initData: module.initData,
|
|
97
|
+
}));
|
|
98
|
+
const bootstrapData = size(defaultValidatorInitData) > 0
|
|
99
|
+
? encodeFunctionData({
|
|
100
|
+
abi: parseAbi([
|
|
101
|
+
'struct BootstrapConfig {address module;bytes initData;}',
|
|
102
|
+
'struct BootstrapPreValidationHookConfig {uint256 hookType;address module;bytes data;}',
|
|
103
|
+
'function initNexusWithDefaultValidatorAndOtherModulesNoRegistry(bytes defaultValidatorInitData,BootstrapConfig[] validators,BootstrapConfig[] executors,BootstrapConfig hook,BootstrapConfig[] fallbacks,BootstrapPreValidationHookConfig[] preValidationHooks)',
|
|
104
|
+
]),
|
|
105
|
+
functionName: 'initNexusWithDefaultValidatorAndOtherModulesNoRegistry',
|
|
106
|
+
args: [
|
|
107
|
+
defaultValidatorInitData,
|
|
108
|
+
configs(validators),
|
|
109
|
+
configs(input.setup.executors),
|
|
110
|
+
{ module: zeroAddress, initData: '0x' },
|
|
111
|
+
configs(input.setup.fallbacks),
|
|
112
|
+
[],
|
|
113
|
+
],
|
|
114
|
+
})
|
|
115
|
+
: encodeFunctionData({
|
|
116
|
+
abi: parseAbi([
|
|
117
|
+
'struct BootstrapConfig {address module;bytes initData;}',
|
|
118
|
+
'struct BootstrapPreValidationHookConfig {uint256 hookType;address module;bytes data;}',
|
|
119
|
+
'function initNexusNoRegistry(BootstrapConfig[] validators,BootstrapConfig[] executors,BootstrapConfig hook,BootstrapConfig[] fallbacks,BootstrapPreValidationHookConfig[] preValidationHooks)',
|
|
120
|
+
]),
|
|
121
|
+
functionName: 'initNexusNoRegistry',
|
|
122
|
+
args: [
|
|
123
|
+
configs(validators),
|
|
124
|
+
configs(input.setup.executors),
|
|
125
|
+
{ module: zeroAddress, initData: '0x' },
|
|
126
|
+
configs(input.setup.fallbacks),
|
|
127
|
+
[],
|
|
128
|
+
],
|
|
129
|
+
});
|
|
130
|
+
const initData = encodeAbiParameters([{ type: 'address' }, { type: 'bytes' }], [NEXUS_BOOTSTRAP_ADDRESS, bootstrapData]);
|
|
131
|
+
factoryData = encodeFunctionData({
|
|
132
|
+
abi: parseAbi(['function createAccount(bytes,bytes32)']),
|
|
133
|
+
functionName: 'createAccount',
|
|
134
|
+
args: [initData, salt],
|
|
135
|
+
});
|
|
136
|
+
initializationCallData = encodeFunctionData({
|
|
137
|
+
abi: parseAbi(['function initializeAccount(bytes)']),
|
|
138
|
+
functionName: 'initializeAccount',
|
|
139
|
+
args: [initData],
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
const accountInitData = encodeAbiParameters([
|
|
143
|
+
{ name: 'address', type: 'address' },
|
|
144
|
+
{ name: 'calldata', type: 'bytes' },
|
|
145
|
+
], [implementation, initializationCallData]);
|
|
146
|
+
const address = getContractAddress({
|
|
147
|
+
opcode: 'CREATE2',
|
|
148
|
+
from: factory,
|
|
149
|
+
salt,
|
|
150
|
+
bytecode: concat([NEXUS_CREATION_CODE, accountInitData]),
|
|
151
|
+
});
|
|
152
|
+
return {
|
|
153
|
+
address,
|
|
154
|
+
factory,
|
|
155
|
+
factoryData,
|
|
156
|
+
implementation,
|
|
157
|
+
initializationCallData,
|
|
158
|
+
salt,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function nexusEip7702AdoptionPlan(input) {
|
|
162
|
+
const { eoa: _eoa, ...factoryConstruction } = input;
|
|
163
|
+
const material = nexusMaterial(factoryConstruction);
|
|
164
|
+
if (!material.factoryData || !material.implementation) {
|
|
165
|
+
throw new Error('Nexus EIP-7702 initialization data is unavailable');
|
|
166
|
+
}
|
|
167
|
+
const decoded = decodeFunctionData({
|
|
168
|
+
abi: parseAbi(['function createAccount(bytes,bytes32)']),
|
|
169
|
+
data: material.factoryData,
|
|
170
|
+
});
|
|
171
|
+
if (decoded.functionName !== 'createAccount') {
|
|
172
|
+
throw new Error('Invalid Nexus EIP-7702 initialization data');
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
contract: material.implementation,
|
|
176
|
+
initData: decoded.args[0],
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
// Builds the signed `initializeAccount` call sent as the account setup op when a
|
|
180
|
+
// 7702 intent is prepared. The account authorizes initialization by prefixing
|
|
181
|
+
// the raw module init data (packed with the any-chain sentinel) with its
|
|
182
|
+
// EIP-7702 init signature.
|
|
183
|
+
function nexusEip7702InitCall(input, eip7702InitSignature) {
|
|
184
|
+
const { initData } = nexusEip7702AdoptionPlan(input);
|
|
185
|
+
const packedInitData = encodePacked(['uint256', 'uint256', 'uint256', 'bytes'], [0n, 1n, 0n, initData]);
|
|
186
|
+
return encodeFunctionData({
|
|
187
|
+
abi: parseAbi(['function initializeAccount(bytes)']),
|
|
188
|
+
functionName: 'initializeAccount',
|
|
189
|
+
args: [concat([eip7702InitSignature, packedInitData])],
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
export function createNexusAdapter(construction) {
|
|
193
|
+
if (construction.account.kind !== 'nexus') {
|
|
194
|
+
throw new Error('Expected Nexus account');
|
|
195
|
+
}
|
|
196
|
+
const version = construction.account.version.source === 'explicit'
|
|
197
|
+
? construction.account.version.value
|
|
198
|
+
: undefined;
|
|
199
|
+
const validator = construction.setup.validators[0]?.address ?? zeroAddress;
|
|
200
|
+
return {
|
|
201
|
+
account: construction.account,
|
|
202
|
+
capabilities: {
|
|
203
|
+
modular: true,
|
|
204
|
+
supportsDeployment: true,
|
|
205
|
+
supportsUserOperations: true,
|
|
206
|
+
supportsEip7702Adoption: true,
|
|
207
|
+
supportsSmartSessions: true,
|
|
208
|
+
supportsOriginSignatureReuse: true,
|
|
209
|
+
signatureEnvelope: { kind: 'nexus', validator },
|
|
210
|
+
},
|
|
211
|
+
getIdentity: (input) => ({
|
|
212
|
+
definition: input.account,
|
|
213
|
+
address: nexusMaterial(input).address,
|
|
214
|
+
}),
|
|
215
|
+
getDeploymentPlan: (input) => deploymentPlan(input.chain, nexusMaterial(input), input.deployed),
|
|
216
|
+
getEip7702AdoptionPlan: nexusEip7702AdoptionPlan,
|
|
217
|
+
getEip7702InitCall: nexusEip7702InitCall,
|
|
218
|
+
encodeCalls: encodeErc7579Calls,
|
|
219
|
+
encodeModuleInstallation: (module) => [encodeInstallModule(module)],
|
|
220
|
+
encodeModuleUninstallation: encodeUninstallModule,
|
|
221
|
+
encodeSignatureEnvelope: ({ envelope, validatorContribution }) => {
|
|
222
|
+
if (envelope.kind !== 'nexus')
|
|
223
|
+
throw new Error('Expected Nexus envelope');
|
|
224
|
+
return encodeAddressEnvelope(envelope.validator, validatorContribution, nexusDefaultValidator(version));
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AccountAdapter } from '../adapter.js';
|
|
2
|
+
import { type DeploymentMaterial } from '../deployment.js';
|
|
3
|
+
import type { AccountConstruction } from '../types.js';
|
|
4
|
+
export declare function safeV0FactoryMaterial(input: AccountConstruction): Pick<Required<DeploymentMaterial>, 'factory' | 'factoryData'>;
|
|
5
|
+
export declare function createSafeAdapter(construction: AccountConstruction): AccountAdapter;
|
|
6
|
+
//# sourceMappingURL=safe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../../../accounts/adapters/safe.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,KAAK,kBAAkB,EAAkB,MAAM,eAAe,CAAA;AAEvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAyHnD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,mBAAmB,GACzB,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC,CA0D/D;AAED,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,mBAAmB,GAChC,cAAc,CA8BhB"}
|