@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
package/dist/src/modules/read.js
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import { createPublicClient } from 'viem';
|
|
2
|
-
import { createTransport } from '../accounts/utils.js';
|
|
3
|
-
import { ENS_HCA_MODULE, OWNABLE_VALIDATOR_ADDRESS } from './validators/core.js';
|
|
4
|
-
async function getValidators(accountType, account, chain, provider) {
|
|
5
|
-
const publicClient = createPublicClient({
|
|
6
|
-
chain,
|
|
7
|
-
transport: createTransport(chain, provider),
|
|
8
|
-
});
|
|
9
|
-
switch (accountType) {
|
|
10
|
-
case 'safe':
|
|
11
|
-
case 'startale':
|
|
12
|
-
case 'hca':
|
|
13
|
-
case 'nexus': {
|
|
14
|
-
const validators = await publicClient.readContract({
|
|
15
|
-
abi: [
|
|
16
|
-
{
|
|
17
|
-
name: 'getValidatorsPaginated',
|
|
18
|
-
type: 'function',
|
|
19
|
-
inputs: [
|
|
20
|
-
{
|
|
21
|
-
name: 'cursor',
|
|
22
|
-
type: 'address',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: 'pageSize',
|
|
26
|
-
type: 'uint256',
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
outputs: [
|
|
30
|
-
{
|
|
31
|
-
name: 'array',
|
|
32
|
-
type: 'address[]',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: 'next',
|
|
36
|
-
type: 'address',
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
functionName: 'getValidatorsPaginated',
|
|
42
|
-
address: account,
|
|
43
|
-
args: ['0x0000000000000000000000000000000000000001', 100n],
|
|
44
|
-
});
|
|
45
|
-
return validators[0];
|
|
46
|
-
}
|
|
47
|
-
case 'eoa': {
|
|
48
|
-
return [];
|
|
49
|
-
}
|
|
50
|
-
case 'kernel': {
|
|
51
|
-
throw new Error('Kernel not supported');
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
async function getOwners(accountType, account, chain, provider, hcaFactory) {
|
|
56
|
-
const publicClient = createPublicClient({
|
|
57
|
-
chain,
|
|
58
|
-
transport: createTransport(chain, provider),
|
|
59
|
-
});
|
|
60
|
-
// HCA accounts hold owner state under the HCA module (the factory's init-data
|
|
61
|
-
// parser), which is OwnableValidator-based, so the getOwners/threshold reads
|
|
62
|
-
// are identical. A custom factory defines its own module, so resolve it from
|
|
63
|
-
// the factory; otherwise fall back to the canonical module.
|
|
64
|
-
let moduleAddress = OWNABLE_VALIDATOR_ADDRESS;
|
|
65
|
-
if (accountType === 'hca') {
|
|
66
|
-
moduleAddress = hcaFactory
|
|
67
|
-
? await publicClient.readContract({
|
|
68
|
-
abi: [
|
|
69
|
-
{
|
|
70
|
-
name: 'initDataParser',
|
|
71
|
-
type: 'function',
|
|
72
|
-
stateMutability: 'view',
|
|
73
|
-
inputs: [],
|
|
74
|
-
outputs: [{ name: '', type: 'address' }],
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
functionName: 'initDataParser',
|
|
78
|
-
address: hcaFactory,
|
|
79
|
-
})
|
|
80
|
-
: ENS_HCA_MODULE;
|
|
81
|
-
}
|
|
82
|
-
const [ownerResult, thresholdResult] = await publicClient.multicall({
|
|
83
|
-
contracts: [
|
|
84
|
-
{
|
|
85
|
-
abi: [
|
|
86
|
-
{
|
|
87
|
-
name: 'getOwners',
|
|
88
|
-
type: 'function',
|
|
89
|
-
inputs: [
|
|
90
|
-
{
|
|
91
|
-
name: 'account',
|
|
92
|
-
type: 'address',
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
outputs: [
|
|
96
|
-
{
|
|
97
|
-
name: '',
|
|
98
|
-
type: 'address[]',
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
},
|
|
102
|
-
],
|
|
103
|
-
functionName: 'getOwners',
|
|
104
|
-
address: moduleAddress,
|
|
105
|
-
args: [account],
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
abi: [
|
|
109
|
-
{
|
|
110
|
-
name: 'threshold',
|
|
111
|
-
type: 'function',
|
|
112
|
-
inputs: [
|
|
113
|
-
{
|
|
114
|
-
name: 'module',
|
|
115
|
-
type: 'address',
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
outputs: [
|
|
119
|
-
{
|
|
120
|
-
name: '',
|
|
121
|
-
type: 'uint256',
|
|
122
|
-
},
|
|
123
|
-
],
|
|
124
|
-
},
|
|
125
|
-
],
|
|
126
|
-
functionName: 'threshold',
|
|
127
|
-
address: moduleAddress,
|
|
128
|
-
args: [account],
|
|
129
|
-
},
|
|
130
|
-
],
|
|
131
|
-
});
|
|
132
|
-
if (ownerResult.error) {
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
if (thresholdResult.error) {
|
|
136
|
-
return null;
|
|
137
|
-
}
|
|
138
|
-
return {
|
|
139
|
-
accounts: ownerResult.result,
|
|
140
|
-
threshold: thresholdResult.result,
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
async function getExecutors(accountType, account, chain, provider) {
|
|
144
|
-
const publicClient = createPublicClient({
|
|
145
|
-
chain,
|
|
146
|
-
transport: createTransport(chain, provider),
|
|
147
|
-
});
|
|
148
|
-
switch (accountType) {
|
|
149
|
-
case 'safe':
|
|
150
|
-
case 'startale':
|
|
151
|
-
case 'hca':
|
|
152
|
-
case 'nexus': {
|
|
153
|
-
const executors = await publicClient.readContract({
|
|
154
|
-
abi: [
|
|
155
|
-
{
|
|
156
|
-
name: 'getExecutorsPaginated',
|
|
157
|
-
type: 'function',
|
|
158
|
-
inputs: [
|
|
159
|
-
{
|
|
160
|
-
name: 'cursor',
|
|
161
|
-
type: 'address',
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
name: 'size',
|
|
165
|
-
type: 'uint256',
|
|
166
|
-
},
|
|
167
|
-
],
|
|
168
|
-
outputs: [
|
|
169
|
-
{
|
|
170
|
-
name: 'array',
|
|
171
|
-
type: 'address[]',
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
name: 'next',
|
|
175
|
-
type: 'address',
|
|
176
|
-
},
|
|
177
|
-
],
|
|
178
|
-
},
|
|
179
|
-
],
|
|
180
|
-
functionName: 'getExecutorsPaginated',
|
|
181
|
-
address: account,
|
|
182
|
-
args: ['0x0000000000000000000000000000000000000001', 100n],
|
|
183
|
-
});
|
|
184
|
-
return executors[0];
|
|
185
|
-
}
|
|
186
|
-
case 'eoa': {
|
|
187
|
-
return [];
|
|
188
|
-
}
|
|
189
|
-
case 'kernel': {
|
|
190
|
-
throw new Error('Kernel not supported');
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
async function isValidatorInitialized(account, chain, validatorAddress, provider) {
|
|
195
|
-
const publicClient = createPublicClient({
|
|
196
|
-
chain,
|
|
197
|
-
transport: createTransport(chain, provider),
|
|
198
|
-
});
|
|
199
|
-
// `isInitialized` is a plain storage read on the validator singleton and
|
|
200
|
-
// returns `false` for an uninitialized (or undeployed) account without
|
|
201
|
-
// reverting. We deliberately let real read failures (provider/ABI errors)
|
|
202
|
-
// propagate rather than coercing them to `false`, which could otherwise
|
|
203
|
-
// produce an `onInstall` call for an already-initialized account.
|
|
204
|
-
return publicClient.readContract({
|
|
205
|
-
abi: [
|
|
206
|
-
{
|
|
207
|
-
name: 'isInitialized',
|
|
208
|
-
type: 'function',
|
|
209
|
-
stateMutability: 'view',
|
|
210
|
-
inputs: [{ name: 'smartAccount', type: 'address' }],
|
|
211
|
-
outputs: [{ name: '', type: 'bool' }],
|
|
212
|
-
},
|
|
213
|
-
],
|
|
214
|
-
functionName: 'isInitialized',
|
|
215
|
-
address: validatorAddress,
|
|
216
|
-
args: [account],
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
export { getValidators, getExecutors, getOwners, isValidatorInitialized };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { type Address, type Hex } from 'viem';
|
|
2
|
-
import type { ENSValidatorConfig, OwnableValidatorConfig, OwnerSet, RhinestoneAccountConfig, WebauthnValidatorConfig } from '../../types.js';
|
|
3
|
-
import { type Module } from '../common.js';
|
|
4
|
-
declare const SMART_SESSION_EMISSARY_ADDRESS_DEV: Address;
|
|
5
|
-
declare const SMART_SESSION_EMISSARY_ADDRESS: Address;
|
|
6
|
-
interface PublicKey {
|
|
7
|
-
prefix?: number | undefined;
|
|
8
|
-
x: bigint;
|
|
9
|
-
y: bigint;
|
|
10
|
-
}
|
|
11
|
-
interface WebauthnCredential {
|
|
12
|
-
pubKey: PublicKey | Hex | Uint8Array;
|
|
13
|
-
authenticatorId: string;
|
|
14
|
-
}
|
|
15
|
-
declare const OWNABLE_VALIDATOR_ADDRESS: Address;
|
|
16
|
-
declare const ENS_HCA_MODULE: Address;
|
|
17
|
-
declare const WEBAUTHN_VALIDATOR_ADDRESS: Address;
|
|
18
|
-
declare const MULTI_FACTOR_VALIDATOR_ADDRESS: Address;
|
|
19
|
-
declare const WEBAUTHN_V0_VALIDATOR_ADDRESS: Address;
|
|
20
|
-
declare function ownerSetUsesEns(owners: OwnerSet): boolean;
|
|
21
|
-
declare function getOwnerValidator(config: RhinestoneAccountConfig): Module;
|
|
22
|
-
declare function getMockSignature(ownerSet: OwnerSet): Hex;
|
|
23
|
-
declare function getValidator(owners: OwnerSet): Module;
|
|
24
|
-
declare function getOwnableValidator(threshold: number, owners: Address[], address?: Address): Module;
|
|
25
|
-
declare function getENSValidator(threshold: number, owners: Address[], expirations: (Date | undefined)[]): Module;
|
|
26
|
-
declare function getWebAuthnValidator(threshold: number, webAuthnCredentials: WebauthnCredential[], address?: Address): Module;
|
|
27
|
-
declare function getMultiFactorValidator(threshold: number, validators: (OwnableValidatorConfig | ENSValidatorConfig | WebauthnValidatorConfig | null)[], address?: Address): Module;
|
|
28
|
-
declare function supportsEip712(validator: Module): boolean;
|
|
29
|
-
export { OWNABLE_VALIDATOR_ADDRESS, ENS_HCA_MODULE, WEBAUTHN_VALIDATOR_ADDRESS, MULTI_FACTOR_VALIDATOR_ADDRESS, WEBAUTHN_V0_VALIDATOR_ADDRESS, SMART_SESSION_EMISSARY_ADDRESS, SMART_SESSION_EMISSARY_ADDRESS_DEV, getOwnerValidator, getOwnableValidator, getENSValidator, getWebAuthnValidator, getMultiFactorValidator, getValidator, getMockSignature, supportsEip712, ownerSetUsesEns, };
|
|
30
|
-
export type { WebauthnCredential };
|
|
31
|
-
//# sourceMappingURL=core.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../modules/validators/core.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAKZ,KAAK,GAAG,EAKT,MAAM,MAAM,CAAA;AAMb,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACtB,QAAQ,EACR,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAA4B,KAAK,MAAM,EAAE,MAAM,WAAW,CAAA;AAEjE,QAAA,MAAM,kCAAkC,EAAE,OACI,CAAA;AAC9C,QAAA,MAAM,8BAA8B,EAAE,OACQ,CAAA;AAE9C,UAAU,SAAS;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED,UAAU,kBAAkB;IAC1B,MAAM,EAAE,SAAS,GAAG,GAAG,GAAG,UAAU,CAAA;IACpC,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,QAAA,MAAM,yBAAyB,EAAE,OACa,CAAA;AAC9C,QAAA,MAAM,cAAc,EAAE,OAAsD,CAAA;AAC5E,QAAA,MAAM,0BAA0B,EAAE,OACY,CAAA;AAC9C,QAAA,MAAM,8BAA8B,EAAE,OACQ,CAAA;AAO9C,QAAA,MAAM,6BAA6B,EAAE,OACS,CAAA;AAU9C,iBAAS,eAAe,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAMlD;AAED,iBAAS,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,UAazD;AAED,iBAAS,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,GAAG,CAsDjD;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,QAAQ,UAiCrC;AAED,iBAAS,mBAAmB,CAC1B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,OAAO,EAAE,EACjB,OAAO,CAAC,EAAE,OAAO,GAChB,MAAM,CAiBR;AAED,iBAAS,eAAe,CACtB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,OAAO,EAAE,EACjB,WAAW,EAAE,CAAC,IAAI,GAAG,SAAS,CAAC,EAAE,GAChC,MAAM,CA4CR;AAED,iBAAS,oBAAoB,CAC3B,SAAS,EAAE,MAAM,EACjB,mBAAmB,EAAE,kBAAkB,EAAE,EACzC,OAAO,CAAC,EAAE,OAAO,GAChB,MAAM,CA4DR;AAED,iBAAS,uBAAuB,CAC9B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,CACR,sBAAsB,GACtB,kBAAkB,GAClB,uBAAuB,GACvB,IAAI,CACP,EAAE,EACH,OAAO,CAAC,EAAE,OAAO,GAChB,MAAM,CAgDR;AAeD,iBAAS,cAAc,CAAC,SAAS,EAAE,MAAM,WAUxC;AAED,OAAO,EACL,yBAAyB,EACzB,cAAc,EACd,0BAA0B,EAC1B,8BAA8B,EAC9B,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,eAAe,GAChB,CAAA;AACD,YAAY,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
import { bytesToHex, concat, encodeAbiParameters, encodePacked, hexToBytes, maxUint48, pad, toHex, } from 'viem';
|
|
2
|
-
import { AccountConfigurationNotSupportedError, OwnersFieldRequiredError, } from '../../accounts/error.js';
|
|
3
|
-
import { MODULE_TYPE_ID_VALIDATOR } from '../common.js';
|
|
4
|
-
const SMART_SESSION_EMISSARY_ADDRESS_DEV = '0x60731de80d78548875f8a67c4fec2a8660194e0c';
|
|
5
|
-
const SMART_SESSION_EMISSARY_ADDRESS = '0xad568b3f825a8d5ffc06dd3253526b64d810ae89';
|
|
6
|
-
const OWNABLE_VALIDATOR_ADDRESS = '0x000000000013fdb5234e4e3162a810f54d9f7e98';
|
|
7
|
-
const ENS_HCA_MODULE = '0x5049ecBd4d961aE6DFEED9b7ccCe7f026454970E';
|
|
8
|
-
const WEBAUTHN_VALIDATOR_ADDRESS = '0x0000000000578c4cb0e472a5462da43c495c3f33';
|
|
9
|
-
const MULTI_FACTOR_VALIDATOR_ADDRESS = '0xf6bdf42c9be18ceca5c06c42a43daf7fbbe7896b';
|
|
10
|
-
// Legacy
|
|
11
|
-
const OWNABLE_V0_VALIDATOR_ADDRESS = '0x2483da3a338895199e5e538530213157e931bf06';
|
|
12
|
-
const OWNABLE_BETA_VALIDATOR_ADDRESS = '0x0000000000e9e6e96bcaa3c113187cdb7e38aed9';
|
|
13
|
-
const WEBAUTHN_V0_VALIDATOR_ADDRESS = '0x0000000000578c4cb0e472a5462da43c495c3f33';
|
|
14
|
-
const ECDSA_MOCK_SIGNATURE = '0x81d4b4981670cb18f99f0b4a66446df1bf5b204d24cfcb659bf38ba27a4359b5711649ec2423c5e1247245eba2964679b6a1dbb85c992ae40b9b00c6935b02ff1b';
|
|
15
|
-
const WEBAUTHN_MOCK_SIGNATURE = '0x0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001b9b86eb98fda3ed4d797d9e690588dfadf17b329a76a47cec935bebf92d7ddc80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000001700000000000000000000000000000000000000000000000000000000000000019b2e9410bb6850f9f660a03d609d5a844fb96bcdc87a15139b03ee22c70f469100d2b865a215c3bf786387064effa8fcedcb1d625b5148f8a1236d5e3ff11acf000000000000000000000000000000000000000000000000000000000000002549960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d9763050000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000867b2274797065223a22776562617574686e2e676574222c226368616c6c656e6765223a22396a4546696a75684557724d34534f572d7443684a625545484550343456636a634a2d42716f3166544d38222c226f726967696e223a22687474703a2f2f6c6f63616c686f73743a38303830222c2263726f73734f726967696e223a66616c73657d0000000000000000000000000000000000000000000000000000';
|
|
16
|
-
// ENS validation is only available on HCA accounts (its validator default is
|
|
17
|
-
// the HCA module). True for a direct ENS owner set or an ENS sub-validator
|
|
18
|
-
// nested in a multi-factor config.
|
|
19
|
-
function ownerSetUsesEns(owners) {
|
|
20
|
-
return (owners.type === 'ens' ||
|
|
21
|
-
(owners.type === 'multi-factor' &&
|
|
22
|
-
owners.validators.some((validator) => validator.type === 'ens')));
|
|
23
|
-
}
|
|
24
|
-
function getOwnerValidator(config) {
|
|
25
|
-
if (!config.owners) {
|
|
26
|
-
throw new OwnersFieldRequiredError();
|
|
27
|
-
}
|
|
28
|
-
// ENS owners resolve to the HCA module, which is only valid for HCA accounts.
|
|
29
|
-
// Other account types would silently install/sign against the wrong validator.
|
|
30
|
-
if (ownerSetUsesEns(config.owners) && config.account?.type !== 'hca') {
|
|
31
|
-
throw new AccountConfigurationNotSupportedError('ENS owners are only supported on HCA accounts', config.account?.type ?? 'nexus');
|
|
32
|
-
}
|
|
33
|
-
return getValidator(config.owners);
|
|
34
|
-
}
|
|
35
|
-
function getMockSignature(ownerSet) {
|
|
36
|
-
switch (ownerSet.type) {
|
|
37
|
-
case 'ecdsa': {
|
|
38
|
-
const owners = ownerSet.accounts.map((account) => account.address);
|
|
39
|
-
const signatures = owners.map(() => ECDSA_MOCK_SIGNATURE);
|
|
40
|
-
return concat(signatures);
|
|
41
|
-
}
|
|
42
|
-
case 'ens': {
|
|
43
|
-
// ENS validator uses same mock signature format as ECDSA for UserOps
|
|
44
|
-
const signatures = ownerSet.owners.map(() => ECDSA_MOCK_SIGNATURE);
|
|
45
|
-
return concat(signatures);
|
|
46
|
-
}
|
|
47
|
-
case 'passkey':
|
|
48
|
-
return WEBAUTHN_MOCK_SIGNATURE;
|
|
49
|
-
case 'multi-factor': {
|
|
50
|
-
const mockValidators = ownerSet.validators.map((validator, index) => {
|
|
51
|
-
const validatorModule = getValidator(validator);
|
|
52
|
-
const signature = getMockSignature(validator);
|
|
53
|
-
return {
|
|
54
|
-
packedValidatorAndId: encodePacked(['bytes12', 'address'], [
|
|
55
|
-
pad(toHex(index), {
|
|
56
|
-
size: 12,
|
|
57
|
-
}),
|
|
58
|
-
validatorModule.address,
|
|
59
|
-
]),
|
|
60
|
-
data: signature,
|
|
61
|
-
};
|
|
62
|
-
});
|
|
63
|
-
return encodeAbiParameters([
|
|
64
|
-
{
|
|
65
|
-
components: [
|
|
66
|
-
{
|
|
67
|
-
internalType: 'bytes32',
|
|
68
|
-
name: 'packedValidatorAndId',
|
|
69
|
-
type: 'bytes32',
|
|
70
|
-
},
|
|
71
|
-
{ internalType: 'bytes', name: 'data', type: 'bytes' },
|
|
72
|
-
],
|
|
73
|
-
name: 'validators',
|
|
74
|
-
type: 'tuple[]',
|
|
75
|
-
},
|
|
76
|
-
], [mockValidators]);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function getValidator(owners) {
|
|
81
|
-
switch (owners.type) {
|
|
82
|
-
case 'ecdsa':
|
|
83
|
-
return getOwnableValidator(owners.threshold ?? 1, owners.accounts.map((account) => account.address), owners.module);
|
|
84
|
-
case 'ens':
|
|
85
|
-
// ENS validation is baked into the HCA account implementation, so the
|
|
86
|
-
// module address is fixed (no override).
|
|
87
|
-
return getENSValidator(owners.threshold ?? 1, owners.owners.map((o) => o.account.address), owners.owners.map((o) => o.expiration));
|
|
88
|
-
case 'passkey':
|
|
89
|
-
return getWebAuthnValidator(owners.threshold ?? 1, owners.accounts.map((account) => ({
|
|
90
|
-
pubKey: account.publicKey,
|
|
91
|
-
authenticatorId: account.id,
|
|
92
|
-
})), owners.module);
|
|
93
|
-
case 'multi-factor': {
|
|
94
|
-
return getMultiFactorValidator(owners.threshold ?? 1, owners.validators, owners.module);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
function getOwnableValidator(threshold, owners, address) {
|
|
99
|
-
return {
|
|
100
|
-
address: address ?? OWNABLE_VALIDATOR_ADDRESS,
|
|
101
|
-
initData: encodeAbiParameters([
|
|
102
|
-
{ name: 'threshold', type: 'uint256' },
|
|
103
|
-
{ name: 'owners', type: 'address[]' },
|
|
104
|
-
], [
|
|
105
|
-
BigInt(threshold),
|
|
106
|
-
owners.map((owner) => owner.toLowerCase()).sort(),
|
|
107
|
-
]),
|
|
108
|
-
deInitData: '0x',
|
|
109
|
-
additionalContext: '0x',
|
|
110
|
-
type: MODULE_TYPE_ID_VALIDATOR,
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
function getENSValidator(threshold, owners, expirations) {
|
|
114
|
-
// format: (uint256 threshold, Owner[] owners)
|
|
115
|
-
// where Owner is a tuple of (address addr, uint48 expiration)
|
|
116
|
-
const ownerPairs = owners.map((owner, index) => {
|
|
117
|
-
const expiration = expirations[index];
|
|
118
|
-
return {
|
|
119
|
-
addr: owner.toLowerCase(),
|
|
120
|
-
// maxUint48 is the on-chain "never expires" sentinel; it's outside the
|
|
121
|
-
// representable Date range, so an omitted expiry maps to it directly.
|
|
122
|
-
expiration: expiration !== undefined
|
|
123
|
-
? Math.floor(expiration.getTime() / 1000)
|
|
124
|
-
: Number(maxUint48),
|
|
125
|
-
};
|
|
126
|
-
});
|
|
127
|
-
// Sort by address to match ENS validator's expectations
|
|
128
|
-
const sortedPairs = ownerPairs.sort((a, b) => a.addr.localeCompare(b.addr));
|
|
129
|
-
const ownersWithExpiration = sortedPairs;
|
|
130
|
-
const initData = encodeAbiParameters([
|
|
131
|
-
{ name: 'threshold', type: 'uint256' },
|
|
132
|
-
{
|
|
133
|
-
name: 'owners',
|
|
134
|
-
type: 'tuple[]',
|
|
135
|
-
components: [
|
|
136
|
-
{ name: 'addr', type: 'address' },
|
|
137
|
-
{ name: 'expiration', type: 'uint48' },
|
|
138
|
-
],
|
|
139
|
-
},
|
|
140
|
-
], [BigInt(threshold), ownersWithExpiration]);
|
|
141
|
-
return {
|
|
142
|
-
address: ENS_HCA_MODULE,
|
|
143
|
-
initData,
|
|
144
|
-
deInitData: '0x',
|
|
145
|
-
additionalContext: '0x',
|
|
146
|
-
type: MODULE_TYPE_ID_VALIDATOR,
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
function getWebAuthnValidator(threshold, webAuthnCredentials, address) {
|
|
150
|
-
function getPublicKey(webAuthnCredential) {
|
|
151
|
-
if (typeof webAuthnCredential.pubKey === 'string' ||
|
|
152
|
-
webAuthnCredential.pubKey instanceof Uint8Array) {
|
|
153
|
-
// It's a P256Credential
|
|
154
|
-
const { x, y, prefix } = parsePublicKey(webAuthnCredential.pubKey);
|
|
155
|
-
if (prefix && prefix !== 4) {
|
|
156
|
-
throw new Error('Only uncompressed public keys are supported');
|
|
157
|
-
}
|
|
158
|
-
return {
|
|
159
|
-
x,
|
|
160
|
-
y,
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
// It's already a PublicKey
|
|
165
|
-
return webAuthnCredential.pubKey;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
const publicKeys = webAuthnCredentials.map(getPublicKey);
|
|
169
|
-
return {
|
|
170
|
-
address: address ?? WEBAUTHN_VALIDATOR_ADDRESS,
|
|
171
|
-
initData: encodeAbiParameters([
|
|
172
|
-
{ name: 'threshold', type: 'uint256' },
|
|
173
|
-
{
|
|
174
|
-
name: 'credentials',
|
|
175
|
-
type: 'tuple[]',
|
|
176
|
-
components: [
|
|
177
|
-
{
|
|
178
|
-
name: 'pubKeyX',
|
|
179
|
-
type: 'uint256',
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
name: 'pubKeyY',
|
|
183
|
-
type: 'uint256',
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
name: 'requireUV',
|
|
187
|
-
type: 'bool',
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
},
|
|
191
|
-
], [
|
|
192
|
-
BigInt(threshold),
|
|
193
|
-
publicKeys.map((publicKey) => ({
|
|
194
|
-
pubKeyX: publicKey.x,
|
|
195
|
-
pubKeyY: publicKey.y,
|
|
196
|
-
requireUV: false,
|
|
197
|
-
})),
|
|
198
|
-
]),
|
|
199
|
-
deInitData: '0x',
|
|
200
|
-
additionalContext: '0x',
|
|
201
|
-
type: MODULE_TYPE_ID_VALIDATOR,
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
function getMultiFactorValidator(threshold, validators, address) {
|
|
205
|
-
return {
|
|
206
|
-
address: address ?? MULTI_FACTOR_VALIDATOR_ADDRESS,
|
|
207
|
-
initData: encodePacked(['uint8', 'bytes'], [
|
|
208
|
-
threshold,
|
|
209
|
-
encodeAbiParameters([
|
|
210
|
-
{
|
|
211
|
-
components: [
|
|
212
|
-
{
|
|
213
|
-
internalType: 'bytes32',
|
|
214
|
-
name: 'packedValidatorAndId',
|
|
215
|
-
type: 'bytes32',
|
|
216
|
-
},
|
|
217
|
-
{ internalType: 'bytes', name: 'data', type: 'bytes' },
|
|
218
|
-
],
|
|
219
|
-
name: 'validators',
|
|
220
|
-
type: 'tuple[]',
|
|
221
|
-
},
|
|
222
|
-
], [
|
|
223
|
-
validators
|
|
224
|
-
.map((validator, index) => {
|
|
225
|
-
if (validator === null) {
|
|
226
|
-
return null;
|
|
227
|
-
}
|
|
228
|
-
const validatorModule = getValidator(validator);
|
|
229
|
-
return {
|
|
230
|
-
packedValidatorAndId: concat([
|
|
231
|
-
pad(toHex(index), {
|
|
232
|
-
size: 12,
|
|
233
|
-
}),
|
|
234
|
-
validatorModule.address,
|
|
235
|
-
]),
|
|
236
|
-
data: validatorModule.initData,
|
|
237
|
-
};
|
|
238
|
-
})
|
|
239
|
-
.filter((validator) => validator !== null),
|
|
240
|
-
]),
|
|
241
|
-
]),
|
|
242
|
-
deInitData: '0x',
|
|
243
|
-
additionalContext: '0x',
|
|
244
|
-
type: MODULE_TYPE_ID_VALIDATOR,
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
function parsePublicKey(publicKey) {
|
|
248
|
-
const bytes = typeof publicKey === 'string' ? hexToBytes(publicKey) : publicKey;
|
|
249
|
-
const offset = bytes.length === 65 ? 1 : 0;
|
|
250
|
-
const x = bytes.slice(offset, 32 + offset);
|
|
251
|
-
const y = bytes.slice(32 + offset, 64 + offset);
|
|
252
|
-
return {
|
|
253
|
-
prefix: bytes.length === 65 ? bytes[0] : undefined,
|
|
254
|
-
x: BigInt(bytesToHex(x)),
|
|
255
|
-
y: BigInt(bytesToHex(y)),
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
function supportsEip712(validator) {
|
|
259
|
-
switch (validator.address.toLowerCase()) {
|
|
260
|
-
case OWNABLE_BETA_VALIDATOR_ADDRESS: // Ownable Validator V1-beta
|
|
261
|
-
case OWNABLE_V0_VALIDATOR_ADDRESS: // Ownable Validator V0
|
|
262
|
-
case SMART_SESSION_EMISSARY_ADDRESS: // Smart Sessions (not yet supported)
|
|
263
|
-
case SMART_SESSION_EMISSARY_ADDRESS_DEV: // Smart Sessions (not yet supported)
|
|
264
|
-
return false;
|
|
265
|
-
default:
|
|
266
|
-
return true;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
export { OWNABLE_VALIDATOR_ADDRESS, ENS_HCA_MODULE, WEBAUTHN_VALIDATOR_ADDRESS, MULTI_FACTOR_VALIDATOR_ADDRESS, WEBAUTHN_V0_VALIDATOR_ADDRESS, SMART_SESSION_EMISSARY_ADDRESS, SMART_SESSION_EMISSARY_ADDRESS_DEV, getOwnerValidator, getOwnableValidator, getENSValidator, getWebAuthnValidator, getMultiFactorValidator, getValidator, getMockSignature, supportsEip712, ownerSetUsesEns, };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { CrossChainPermissionInput, CrossChainPermit } from '../../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Resolve a {@link CrossChainPermissionInput} into a {@link CrossChainPermit}:
|
|
4
|
-
* normalise single/array legs and convert `Date` validity bounds to
|
|
5
|
-
* unix-seconds. Token fields are per-chain ERC-20 addresses (v2 no longer
|
|
6
|
-
* accepts symbols).
|
|
7
|
-
*
|
|
8
|
-
* @internal Used by `expandCrossChainPermit`; not part of the public API.
|
|
9
|
-
*/
|
|
10
|
-
declare function resolveCrossChainPermission(input: CrossChainPermissionInput): CrossChainPermit;
|
|
11
|
-
/**
|
|
12
|
-
* Convert a resolved {@link CrossChainPermit} back into the
|
|
13
|
-
* {@link CrossChainPermissionInput} shape accepted by
|
|
14
|
-
* `SessionDefinition.crossChainPermits`.
|
|
15
|
-
*
|
|
16
|
-
* Useful when a permit was persisted in its resolved (unix-seconds) form and
|
|
17
|
-
* has to be re-supplied as session input: converts `bigint` deadlines to
|
|
18
|
-
* `Date` and maps `recipientIsAccount` to the inverse `allowRecipientNotAccount`.
|
|
19
|
-
*/
|
|
20
|
-
declare function toCrossChainPermissionInput(permit: CrossChainPermit): CrossChainPermissionInput;
|
|
21
|
-
export { resolveCrossChainPermission, toCrossChainPermissionInput };
|
|
22
|
-
//# sourceMappingURL=cross-chain-permits.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cross-chain-permits.d.ts","sourceRoot":"","sources":["../../../../modules/validators/cross-chain-permits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAkB9E;;;;;;;GAOG;AACH,iBAAS,2BAA2B,CAClC,KAAK,EAAE,yBAAyB,GAC/B,gBAAgB,CA0DlB;AAQD;;;;;;;;GAQG;AACH,iBAAS,2BAA2B,CAClC,MAAM,EAAE,gBAAgB,GACvB,yBAAyB,CAuB3B;AAED,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,CAAA"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
function dateToUnixSeconds(input) {
|
|
2
|
-
// Date.getTime() returns milliseconds since epoch; the on-chain policy
|
|
3
|
-
// expects unix-seconds. Integer division matches the Permit2 deadline
|
|
4
|
-
// convention.
|
|
5
|
-
return BigInt(Math.floor(input.getTime() / 1000));
|
|
6
|
-
}
|
|
7
|
-
// Normalise the single-object / array / omitted shapes into arrays. An
|
|
8
|
-
// omitted side stays `undefined` (no restriction), mirroring how the
|
|
9
|
-
// underlying Permit2 policy treats an absent token list.
|
|
10
|
-
function normalizeLegs(legs) {
|
|
11
|
-
if (legs === undefined)
|
|
12
|
-
return undefined;
|
|
13
|
-
const arr = Array.isArray(legs) ? legs : [legs];
|
|
14
|
-
return arr.length ? arr : undefined;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Resolve a {@link CrossChainPermissionInput} into a {@link CrossChainPermit}:
|
|
18
|
-
* normalise single/array legs and convert `Date` validity bounds to
|
|
19
|
-
* unix-seconds. Token fields are per-chain ERC-20 addresses (v2 no longer
|
|
20
|
-
* accepts symbols).
|
|
21
|
-
*
|
|
22
|
-
* @internal Used by `expandCrossChainPermit`; not part of the public API.
|
|
23
|
-
*/
|
|
24
|
-
function resolveCrossChainPermission(input) {
|
|
25
|
-
const fromLegs = normalizeLegs(input.from);
|
|
26
|
-
const toLegs = normalizeLegs(input.to);
|
|
27
|
-
const from = fromLegs?.map((leg) => ({
|
|
28
|
-
chain: leg.chain,
|
|
29
|
-
token: leg.token,
|
|
30
|
-
maxAmount: leg.maxAmount,
|
|
31
|
-
}));
|
|
32
|
-
const to = toLegs?.map((leg) => ({
|
|
33
|
-
chain: leg.chain,
|
|
34
|
-
token: leg.token,
|
|
35
|
-
recipient: leg.recipient,
|
|
36
|
-
}));
|
|
37
|
-
const validUntil = input.validUntil !== undefined
|
|
38
|
-
? dateToUnixSeconds(input.validUntil)
|
|
39
|
-
: undefined;
|
|
40
|
-
const validAfter = input.validAfter !== undefined
|
|
41
|
-
? dateToUnixSeconds(input.validAfter)
|
|
42
|
-
: undefined;
|
|
43
|
-
// Detect an obviously-broken time window early. The on-chain policy
|
|
44
|
-
// would reject any intent in this state anyway; surfacing it at build
|
|
45
|
-
// time saves a round-trip to chain.
|
|
46
|
-
if (validUntil !== undefined &&
|
|
47
|
-
validAfter !== undefined &&
|
|
48
|
-
validAfter > validUntil) {
|
|
49
|
-
throw new Error(`crossChainPermits: validAfter (${validAfter}) is greater than validUntil (${validUntil})`);
|
|
50
|
-
}
|
|
51
|
-
const fillDeadline = input.fillDeadline?.map(({ chain, min, max }) => ({
|
|
52
|
-
chain,
|
|
53
|
-
min: min !== undefined ? dateToUnixSeconds(min) : undefined,
|
|
54
|
-
max: max !== undefined ? dateToUnixSeconds(max) : undefined,
|
|
55
|
-
}));
|
|
56
|
-
return {
|
|
57
|
-
from,
|
|
58
|
-
to,
|
|
59
|
-
validUntil,
|
|
60
|
-
validAfter,
|
|
61
|
-
fillDeadline,
|
|
62
|
-
// Inverted default: callers must opt out of bridge-to-self
|
|
63
|
-
// explicitly. This stops a session key from quietly bridging to an
|
|
64
|
-
// attacker-controlled recipient.
|
|
65
|
-
recipientIsAccount: !input.allowRecipientNotAccount,
|
|
66
|
-
// Passed through verbatim. `getArbitersForSettlementLayers` expands
|
|
67
|
-
// undefined/empty to "all supported layers" at session-data build
|
|
68
|
-
// time.
|
|
69
|
-
settlementLayers: input.settlementLayers,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function unixSecondsToDate(seconds) {
|
|
73
|
-
// Inverse of dateToUnixSeconds: on-chain deadlines are unix-seconds; Date
|
|
74
|
-
// expects milliseconds.
|
|
75
|
-
return new Date(Number(seconds) * 1000);
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Convert a resolved {@link CrossChainPermit} back into the
|
|
79
|
-
* {@link CrossChainPermissionInput} shape accepted by
|
|
80
|
-
* `SessionDefinition.crossChainPermits`.
|
|
81
|
-
*
|
|
82
|
-
* Useful when a permit was persisted in its resolved (unix-seconds) form and
|
|
83
|
-
* has to be re-supplied as session input: converts `bigint` deadlines to
|
|
84
|
-
* `Date` and maps `recipientIsAccount` to the inverse `allowRecipientNotAccount`.
|
|
85
|
-
*/
|
|
86
|
-
function toCrossChainPermissionInput(permit) {
|
|
87
|
-
return {
|
|
88
|
-
from: permit.from,
|
|
89
|
-
to: permit.to,
|
|
90
|
-
validUntil: permit.validUntil !== undefined
|
|
91
|
-
? unixSecondsToDate(permit.validUntil)
|
|
92
|
-
: undefined,
|
|
93
|
-
validAfter: permit.validAfter !== undefined
|
|
94
|
-
? unixSecondsToDate(permit.validAfter)
|
|
95
|
-
: undefined,
|
|
96
|
-
fillDeadline: permit.fillDeadline?.map(({ chain, min, max }) => ({
|
|
97
|
-
chain,
|
|
98
|
-
min: min !== undefined ? unixSecondsToDate(min) : undefined,
|
|
99
|
-
max: max !== undefined ? unixSecondsToDate(max) : undefined,
|
|
100
|
-
})),
|
|
101
|
-
allowRecipientNotAccount: permit.recipientIsAccount !== undefined
|
|
102
|
-
? !permit.recipientIsAccount
|
|
103
|
-
: undefined,
|
|
104
|
-
settlementLayers: permit.settlementLayers,
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
export { resolveCrossChainPermission, toCrossChainPermissionInput };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { getMockSignature, getOwnerValidator, MULTI_FACTOR_VALIDATOR_ADDRESS, OWNABLE_VALIDATOR_ADDRESS, SMART_SESSION_EMISSARY_ADDRESS, WEBAUTHN_VALIDATOR_ADDRESS } from './core.js';
|
|
2
|
-
import { buildMockSignature, DUMMY_PRECLAIMOP_SELECTOR, DUMMY_PRECLAIMOP_TARGET, getEnableSessionCall, getPermissionId, getSmartSessionValidator, isSessionEnabled, packSignature, toSession } from './smart-sessions.js';
|
|
3
|
-
export { OWNABLE_VALIDATOR_ADDRESS, WEBAUTHN_VALIDATOR_ADDRESS, MULTI_FACTOR_VALIDATOR_ADDRESS, SMART_SESSION_EMISSARY_ADDRESS, DUMMY_PRECLAIMOP_TARGET, DUMMY_PRECLAIMOP_SELECTOR, getOwnerValidator, getSmartSessionValidator, getEnableSessionCall, getPermissionId, getMockSignature, buildMockSignature, isSessionEnabled, packSignature, toSession, };
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../modules/validators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,8BAA8B,EAC9B,yBAAyB,EACzB,8BAA8B,EAC9B,0BAA0B,EAC3B,MAAM,QAAQ,CAAA;AACf,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,wBAAwB,EACxB,gBAAgB,EAChB,aAAa,EACb,SAAS,EACV,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,8BAA8B,EAC9B,8BAA8B,EAC9B,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,SAAS,GACV,CAAA"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { getMockSignature, getOwnerValidator, MULTI_FACTOR_VALIDATOR_ADDRESS, OWNABLE_VALIDATOR_ADDRESS, SMART_SESSION_EMISSARY_ADDRESS, WEBAUTHN_VALIDATOR_ADDRESS, } from './core.js';
|
|
2
|
-
import { buildMockSignature, DUMMY_PRECLAIMOP_SELECTOR, DUMMY_PRECLAIMOP_TARGET, getEnableSessionCall, getPermissionId, getSmartSessionValidator, isSessionEnabled, packSignature, toSession, } from './smart-sessions.js';
|
|
3
|
-
export { OWNABLE_VALIDATOR_ADDRESS, WEBAUTHN_VALIDATOR_ADDRESS, MULTI_FACTOR_VALIDATOR_ADDRESS, SMART_SESSION_EMISSARY_ADDRESS, DUMMY_PRECLAIMOP_TARGET, DUMMY_PRECLAIMOP_SELECTOR, getOwnerValidator, getSmartSessionValidator, getEnableSessionCall, getPermissionId, getMockSignature, buildMockSignature, isSessionEnabled, packSignature, toSession, };
|