@rhinestone/sdk 2.0.0-beta.44 → 2.0.0-beta.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/accounts/adapter.d.ts +31 -0
- package/dist/src/accounts/adapter.d.ts.map +1 -0
- package/dist/src/accounts/adapters/eoa.d.ts +4 -0
- package/dist/src/accounts/adapters/eoa.d.ts.map +1 -0
- package/dist/src/accounts/adapters/eoa.js +45 -0
- package/dist/src/accounts/adapters/hca.d.ts +5 -0
- package/dist/src/accounts/adapters/hca.d.ts.map +1 -0
- package/dist/src/accounts/adapters/hca.js +118 -0
- package/dist/src/accounts/adapters/kernel.d.ts +9 -0
- package/dist/src/accounts/adapters/kernel.d.ts.map +1 -0
- package/dist/src/accounts/adapters/kernel.js +159 -0
- package/dist/src/accounts/adapters/nexus.d.ts +17 -0
- package/dist/src/accounts/adapters/nexus.d.ts.map +1 -0
- package/dist/src/accounts/adapters/nexus.js +227 -0
- package/dist/src/accounts/adapters/safe.d.ts +6 -0
- package/dist/src/accounts/adapters/safe.d.ts.map +1 -0
- package/dist/src/accounts/adapters/safe.js +194 -0
- package/dist/src/accounts/adapters/shared.d.ts +9 -0
- package/dist/src/accounts/adapters/shared.d.ts.map +1 -0
- package/dist/src/accounts/adapters/shared.js +62 -0
- package/dist/src/accounts/adapters/startale.d.ts +14 -0
- package/dist/src/accounts/adapters/startale.d.ts.map +1 -0
- package/dist/src/accounts/adapters/startale.js +165 -0
- package/dist/src/accounts/construction.d.ts +25 -0
- package/dist/src/accounts/construction.d.ts.map +1 -0
- package/dist/src/accounts/construction.js +34 -0
- package/dist/src/accounts/deployment.d.ts +12 -0
- package/dist/src/accounts/deployment.d.ts.map +1 -0
- package/dist/src/accounts/deployment.js +33 -0
- package/dist/src/accounts/erc7579-calls.d.ts +4 -0
- package/dist/src/accounts/erc7579-calls.d.ts.map +1 -0
- package/dist/src/accounts/erc7579-calls.js +57 -0
- package/dist/src/accounts/error.d.ts +1 -1
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/legacy.d.ts +14 -0
- package/dist/src/accounts/legacy.d.ts.map +1 -0
- package/dist/src/accounts/legacy.js +40 -0
- package/dist/src/accounts/registry.d.ts +4 -0
- package/dist/src/accounts/registry.d.ts.map +1 -0
- package/dist/src/accounts/registry.js +22 -0
- package/dist/src/accounts/types.d.ts +131 -0
- package/dist/src/accounts/types.d.ts.map +1 -0
- package/dist/src/accounts/wallet-account.d.ts +3 -0
- package/dist/src/accounts/wallet-account.d.ts.map +1 -0
- package/dist/src/accounts/wallet-account.js +12 -0
- package/dist/src/actions/deploy.d.ts +4 -0
- package/dist/src/actions/deploy.d.ts.map +1 -0
- package/dist/src/actions/deploy.js +8 -0
- package/dist/src/actions/ecdsa.d.ts +1 -1
- package/dist/src/actions/ecdsa.d.ts.map +1 -1
- package/dist/src/actions/ecdsa.js +8 -8
- package/dist/src/actions/index.d.ts +2 -16
- package/dist/src/actions/index.d.ts.map +1 -1
- package/dist/src/actions/index.js +3 -49
- package/dist/src/actions/mfa.d.ts +1 -1
- package/dist/src/actions/mfa.d.ts.map +1 -1
- package/dist/src/actions/mfa.js +30 -10
- package/dist/src/actions/modules.d.ts +4 -0
- package/dist/src/actions/modules.d.ts.map +1 -0
- package/dist/src/actions/modules.js +22 -0
- package/dist/src/actions/passkeys.d.ts +2 -2
- package/dist/src/actions/passkeys.d.ts.map +1 -1
- package/dist/src/actions/passkeys.js +19 -14
- package/dist/src/actions/runtime.d.ts +12 -0
- package/dist/src/actions/runtime.d.ts.map +1 -0
- package/dist/src/actions/runtime.js +161 -0
- package/dist/src/actions/smart-sessions.d.ts +2 -2
- package/dist/src/actions/smart-sessions.d.ts.map +1 -1
- package/dist/src/actions/smart-sessions.js +35 -12
- package/dist/src/api/account.d.ts +265 -0
- package/dist/src/api/account.d.ts.map +1 -0
- package/dist/src/api/account.js +640 -0
- package/dist/src/api/accounts.d.ts +12 -0
- package/dist/src/api/accounts.d.ts.map +1 -0
- package/dist/src/api/accounts.js +17 -0
- package/dist/src/api/compose-types.d.ts +147 -0
- package/dist/src/api/compose-types.d.ts.map +1 -0
- package/dist/src/api/compose.d.ts +6 -0
- package/dist/src/api/compose.d.ts.map +1 -0
- package/dist/src/api/compose.js +766 -0
- package/dist/src/api/direct-signing.d.ts +27 -0
- package/dist/src/api/direct-signing.d.ts.map +1 -0
- package/dist/src/api/direct-signing.js +191 -0
- package/dist/src/api/project-mappers.d.ts +7 -0
- package/dist/src/api/project-mappers.d.ts.map +1 -0
- package/dist/src/api/project-mappers.js +23 -0
- package/dist/src/api/queries/app-fees.d.ts +4 -0
- package/dist/src/api/queries/app-fees.d.ts.map +1 -0
- package/dist/src/api/queries/app-fees.js +3 -0
- package/dist/src/api/queries/portfolio.d.ts +9 -0
- package/dist/src/api/queries/portfolio.d.ts.map +1 -0
- package/dist/src/api/queries/portfolio.js +28 -0
- package/dist/src/api/queries/session.d.ts +8 -0
- package/dist/src/api/queries/session.d.ts.map +1 -0
- package/dist/src/api/queries/session.js +15 -0
- package/dist/src/api/sdk.d.ts +80 -0
- package/dist/src/api/sdk.d.ts.map +1 -0
- package/dist/src/api/sdk.js +103 -0
- package/dist/src/api/signer-selection.d.ts +7 -0
- package/dist/src/api/signer-selection.d.ts.map +1 -0
- package/dist/src/api/signer-selection.js +109 -0
- package/dist/src/calls/normalize.d.ts +9 -0
- package/dist/src/calls/normalize.d.ts.map +1 -0
- package/dist/src/calls/normalize.js +17 -0
- package/dist/src/calls/resolve.d.ts +3 -0
- package/dist/src/calls/resolve.d.ts.map +1 -0
- package/dist/src/calls/resolve.js +15 -0
- package/dist/src/calls/types.d.ts +25 -0
- package/dist/src/calls/types.d.ts.map +1 -0
- package/dist/src/calls/types.js +1 -0
- package/dist/src/chains/caip2.d.ts +10 -0
- package/dist/src/chains/caip2.d.ts.map +1 -0
- package/dist/src/chains/caip2.js +85 -0
- package/dist/src/chains/catalog.d.ts +5 -0
- package/dist/src/chains/catalog.d.ts.map +1 -0
- package/dist/src/chains/catalog.js +41 -0
- package/dist/src/chains/errors.d.ts +15 -0
- package/dist/src/chains/errors.d.ts.map +1 -0
- package/dist/src/chains/errors.js +21 -0
- package/dist/src/{orchestrator/destinations.d.ts → chains/non-evm.d.ts} +7 -5
- package/dist/src/chains/non-evm.d.ts.map +1 -0
- package/dist/src/chains/non-evm.js +30 -0
- package/dist/src/chains/tokens.d.ts +4 -0
- package/dist/src/chains/tokens.d.ts.map +1 -0
- package/dist/src/chains/tokens.js +22 -0
- package/dist/src/chains/types.d.ts +25 -0
- package/dist/src/chains/types.d.ts.map +1 -0
- package/dist/src/chains/types.js +1 -0
- package/dist/src/clients/bundler/client.d.ts +10 -0
- package/dist/src/clients/bundler/client.d.ts.map +1 -0
- package/dist/src/clients/bundler/client.js +85 -0
- package/dist/src/clients/bundler/endpoints.d.ts +3 -0
- package/dist/src/clients/bundler/endpoints.d.ts.map +1 -0
- package/dist/src/clients/bundler/endpoints.js +18 -0
- package/dist/src/clients/bundler/port.d.ts +22 -0
- package/dist/src/clients/bundler/port.d.ts.map +1 -0
- package/dist/src/clients/bundler/port.js +1 -0
- package/dist/src/clients/json-rpc.d.ts +20 -0
- package/dist/src/clients/json-rpc.d.ts.map +1 -0
- package/dist/src/clients/json-rpc.js +56 -0
- package/dist/src/clients/orchestrator/auth.d.ts +7 -0
- package/dist/src/clients/orchestrator/auth.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/auth.js +27 -0
- package/dist/src/{orchestrator → clients/orchestrator}/chain-catalog.d.ts +5 -3
- package/dist/src/clients/orchestrator/chain-catalog.d.ts.map +1 -0
- package/dist/src/{orchestrator → clients/orchestrator}/chain-catalog.js +24 -3
- package/dist/src/clients/orchestrator/client.d.ts +13 -0
- package/dist/src/clients/orchestrator/client.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/client.js +97 -0
- package/dist/src/{orchestrator/error.d.ts → clients/orchestrator/errors.d.ts} +2 -16
- package/dist/src/clients/orchestrator/errors.d.ts.map +1 -0
- package/dist/src/{orchestrator/error.js → clients/orchestrator/errors.js} +1 -22
- package/dist/src/clients/orchestrator/fetch.d.ts +7 -0
- package/dist/src/clients/orchestrator/fetch.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/fetch.js +37 -0
- package/dist/src/clients/orchestrator/mappers.d.ts +9 -0
- package/dist/src/clients/orchestrator/mappers.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/mappers.js +198 -0
- package/dist/src/clients/orchestrator/port.d.ts +26 -0
- package/dist/src/clients/orchestrator/port.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/port.js +1 -0
- package/dist/src/{orchestrator/types.d.ts → clients/orchestrator/public.d.ts} +16 -4
- package/dist/src/clients/orchestrator/public.d.ts.map +1 -0
- package/dist/src/{orchestrator/types.js → clients/orchestrator/public.js} +3 -0
- package/dist/src/clients/orchestrator/types.d.ts +144 -0
- package/dist/src/clients/orchestrator/types.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/types.js +1 -0
- package/dist/src/clients/orchestrator/wire.d.ts +19 -0
- package/dist/src/clients/orchestrator/wire.d.ts.map +1 -0
- package/dist/src/{orchestrator → clients/orchestrator}/wire.gen.d.ts +1193 -499
- package/dist/src/clients/orchestrator/wire.gen.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/wire.gen.js +1 -0
- package/dist/src/clients/orchestrator/wire.js +1 -0
- package/dist/src/clients/paymaster/client.d.ts +8 -0
- package/dist/src/clients/paymaster/client.d.ts.map +1 -0
- package/dist/src/clients/paymaster/client.js +38 -0
- package/dist/src/clients/paymaster/endpoints.d.ts +3 -0
- package/dist/src/clients/paymaster/endpoints.d.ts.map +1 -0
- package/dist/src/clients/paymaster/endpoints.js +16 -0
- package/dist/src/clients/paymaster/port.d.ts +17 -0
- package/dist/src/clients/paymaster/port.d.ts.map +1 -0
- package/dist/src/clients/paymaster/port.js +1 -0
- package/dist/src/clients/rpc/client.d.ts +6 -0
- package/dist/src/clients/rpc/client.d.ts.map +1 -0
- package/dist/src/clients/rpc/client.js +66 -0
- package/dist/src/clients/rpc/compatibility.d.ts +12 -0
- package/dist/src/clients/rpc/compatibility.d.ts.map +1 -0
- package/dist/src/clients/rpc/compatibility.js +16 -0
- package/dist/src/clients/rpc/port.d.ts +13 -0
- package/dist/src/clients/rpc/port.d.ts.map +1 -0
- package/dist/src/clients/rpc/port.js +1 -0
- package/dist/src/clients/rpc/providers.d.ts +3 -0
- package/dist/src/clients/rpc/providers.d.ts.map +1 -0
- package/dist/src/clients/rpc/providers.js +8 -0
- package/dist/src/clients/rpc/transport.d.ts +4 -0
- package/dist/src/clients/rpc/transport.d.ts.map +1 -0
- package/dist/src/clients/rpc/transport.js +5 -0
- package/dist/src/clients/rpc/types.d.ts +23 -0
- package/dist/src/clients/rpc/types.d.ts.map +1 -0
- package/dist/src/clients/rpc/types.js +1 -0
- package/dist/src/config/account-runtime.d.ts +7 -0
- package/dist/src/config/account-runtime.d.ts.map +1 -0
- package/dist/src/config/account-runtime.js +36 -0
- package/dist/src/{types.d.ts → config/account.d.ts} +37 -14
- package/dist/src/config/account.d.ts.map +1 -0
- package/dist/src/config/account.js +10 -0
- package/dist/src/config/defaults.d.ts +14 -0
- package/dist/src/config/defaults.d.ts.map +1 -0
- package/dist/src/config/defaults.js +26 -0
- package/dist/src/config/input.d.ts +54 -0
- package/dist/src/config/input.d.ts.map +1 -0
- package/dist/src/config/input.js +1 -0
- package/dist/src/config/legacy.d.ts +22 -0
- package/dist/src/config/legacy.d.ts.map +1 -0
- package/dist/src/config/legacy.js +23 -0
- package/dist/src/config/resolve.d.ts +13 -0
- package/dist/src/config/resolve.d.ts.map +1 -0
- package/dist/src/config/resolve.js +174 -0
- package/dist/src/config/resolved.d.ts +77 -0
- package/dist/src/config/resolved.d.ts.map +1 -0
- package/dist/src/config/resolved.js +1 -0
- package/dist/src/config/validate.d.ts +3 -0
- package/dist/src/config/validate.d.ts.map +1 -0
- package/dist/src/config/validate.js +6 -0
- package/dist/src/{execution/error.d.ts → errors/execution.d.ts} +2 -2
- package/dist/src/errors/execution.d.ts.map +1 -0
- package/dist/src/{execution/error.js → errors/execution.js} +1 -1
- package/dist/src/errors/index.d.ts +4 -4
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +4 -3
- package/dist/src/index.d.ts +13 -324
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -286
- package/dist/src/modules/erc7579-abi.d.ts +4 -0
- package/dist/src/modules/erc7579-abi.d.ts.map +1 -0
- package/dist/src/modules/erc7579-abi.js +12 -0
- package/dist/src/modules/intent-executor.d.ts +6 -0
- package/dist/src/modules/intent-executor.d.ts.map +1 -0
- package/dist/src/modules/intent-executor.js +13 -0
- package/dist/src/modules/legacy-core.d.ts +29 -0
- package/dist/src/modules/legacy-core.d.ts.map +1 -0
- package/dist/src/modules/legacy-core.js +80 -0
- package/dist/src/modules/normalize.d.ts +4 -0
- package/dist/src/modules/normalize.d.ts.map +1 -0
- package/dist/src/modules/normalize.js +15 -0
- package/dist/src/modules/plan.d.ts +16 -0
- package/dist/src/modules/plan.d.ts.map +1 -0
- package/dist/src/modules/plan.js +51 -0
- package/dist/src/modules/read-core.d.ts +39 -0
- package/dist/src/modules/read-core.d.ts.map +1 -0
- package/dist/src/modules/read-core.js +149 -0
- package/dist/src/modules/types.d.ts +46 -0
- package/dist/src/modules/types.d.ts.map +1 -0
- package/dist/src/modules/types.js +1 -0
- package/dist/src/modules/validators/capabilities.d.ts +4 -0
- package/dist/src/modules/validators/capabilities.d.ts.map +1 -0
- package/dist/src/modules/validators/capabilities.js +58 -0
- package/dist/src/modules/validators/contribution.d.ts +4 -0
- package/dist/src/modules/validators/contribution.d.ts.map +1 -0
- package/dist/src/modules/validators/contribution.js +64 -0
- package/dist/src/modules/validators/definition.d.ts +3 -0
- package/dist/src/modules/validators/definition.d.ts.map +1 -0
- package/dist/src/modules/validators/definition.js +68 -0
- package/dist/src/modules/validators/ens.d.ts +5 -0
- package/dist/src/modules/validators/ens.d.ts.map +1 -0
- package/dist/src/modules/validators/ens.js +34 -0
- package/dist/src/modules/validators/k1.d.ts +2 -0
- package/dist/src/modules/validators/k1.d.ts.map +1 -0
- package/dist/src/modules/validators/k1.js +1 -0
- package/dist/src/modules/validators/multi-factor.d.ts +18 -0
- package/dist/src/modules/validators/multi-factor.d.ts.map +1 -0
- package/dist/src/modules/validators/multi-factor.js +79 -0
- package/dist/src/modules/validators/ownable.d.ts +26 -0
- package/dist/src/modules/validators/ownable.d.ts.map +1 -0
- package/dist/src/modules/validators/ownable.js +84 -0
- package/dist/src/modules/validators/permissions.d.ts +1 -1
- package/dist/src/modules/validators/permissions.d.ts.map +1 -1
- package/dist/src/modules/validators/policies/claim/arbiters.d.ts +1 -1
- package/dist/src/modules/validators/policies/claim/arbiters.d.ts.map +1 -1
- package/dist/src/modules/validators/policies/claim/arbiters.js +3 -1
- package/dist/src/modules/validators/resolve.d.ts +5 -0
- package/dist/src/modules/validators/resolve.d.ts.map +1 -0
- package/dist/src/modules/validators/resolve.js +22 -0
- package/dist/src/modules/validators/signer-id.d.ts +5 -0
- package/dist/src/modules/validators/signer-id.d.ts.map +1 -0
- package/dist/src/modules/validators/signer-id.js +8 -0
- package/dist/src/modules/validators/smart-session-signature-types.d.ts +35 -0
- package/dist/src/modules/validators/smart-session-signature-types.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-session-signature-types.js +1 -0
- package/dist/src/modules/validators/smart-sessions/authorization.d.ts +99 -0
- package/dist/src/modules/validators/smart-sessions/authorization.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/authorization.js +101 -0
- package/dist/src/modules/validators/smart-sessions/calls.d.ts +19 -0
- package/dist/src/modules/validators/smart-sessions/calls.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/calls.js +85 -0
- package/dist/src/modules/validators/smart-sessions/cross-chain-permits.d.ts +4 -0
- package/dist/src/modules/validators/smart-sessions/cross-chain-permits.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/cross-chain-permits.js +77 -0
- package/dist/src/modules/validators/smart-sessions/digest.d.ts +5 -0
- package/dist/src/modules/validators/smart-sessions/digest.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/digest.js +30 -0
- package/dist/src/modules/validators/smart-sessions/mock-signature.d.ts +10 -0
- package/dist/src/modules/validators/smart-sessions/mock-signature.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/mock-signature.js +31 -0
- package/dist/src/modules/validators/smart-sessions/module.d.ts +11 -0
- package/dist/src/modules/validators/smart-sessions/module.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/module.js +18 -0
- package/dist/src/modules/validators/smart-sessions/policies/addresses.d.ts +23 -0
- package/dist/src/modules/validators/smart-sessions/policies/addresses.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/policies/addresses.js +29 -0
- package/dist/src/modules/validators/smart-sessions/policies/claim.d.ts +10 -0
- package/dist/src/modules/validators/smart-sessions/policies/claim.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/policies/claim.js +106 -0
- package/dist/src/modules/validators/smart-sessions/policies/encode.d.ts +4 -0
- package/dist/src/modules/validators/smart-sessions/policies/encode.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/policies/encode.js +197 -0
- package/dist/src/modules/validators/smart-sessions/resolve.d.ts +16 -0
- package/dist/src/modules/validators/smart-sessions/resolve.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/resolve.js +120 -0
- package/dist/src/modules/validators/smart-sessions/signature.d.ts +14 -0
- package/dist/src/modules/validators/smart-sessions/signature.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/signature.js +167 -0
- package/dist/src/modules/validators/smart-sessions/state.d.ts +19 -0
- package/dist/src/modules/validators/smart-sessions/state.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/state.js +42 -0
- package/dist/src/modules/validators/smart-sessions/types.d.ts +227 -0
- package/dist/src/modules/validators/smart-sessions/types.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/types.js +1 -0
- package/dist/src/modules/validators/types.d.ts +143 -0
- package/dist/src/modules/validators/types.d.ts.map +1 -0
- package/dist/src/modules/validators/types.js +1 -0
- package/dist/src/modules/validators/webauthn.d.ts +54 -0
- package/dist/src/modules/validators/webauthn.d.ts.map +1 -0
- package/dist/src/modules/validators/webauthn.js +159 -0
- package/dist/src/signing/context.d.ts +25 -0
- package/dist/src/signing/context.d.ts.map +1 -0
- package/dist/src/signing/context.js +163 -0
- package/dist/src/signing/contribution.d.ts +13 -0
- package/dist/src/signing/contribution.d.ts.map +1 -0
- package/dist/src/signing/contribution.js +83 -0
- package/dist/src/signing/eip7702.d.ts +41 -0
- package/dist/src/signing/eip7702.d.ts.map +1 -0
- package/dist/src/signing/eip7702.js +215 -0
- package/dist/src/signing/error.d.ts +27 -0
- package/dist/src/signing/error.d.ts.map +1 -0
- package/dist/src/signing/error.js +25 -0
- package/dist/src/signing/execute.d.ts +17 -0
- package/dist/src/signing/execute.d.ts.map +1 -0
- package/dist/src/signing/execute.js +138 -0
- package/dist/src/signing/intent-plans/assemble.d.ts +15 -0
- package/dist/src/signing/intent-plans/assemble.d.ts.map +1 -0
- package/dist/src/signing/intent-plans/assemble.js +96 -0
- package/dist/src/signing/intent-plans/independent.d.ts +48 -0
- package/dist/src/signing/intent-plans/independent.d.ts.map +1 -0
- package/dist/src/signing/intent-plans/independent.js +150 -0
- package/dist/src/signing/intent-plans/plan.d.ts +14 -0
- package/dist/src/signing/intent-plans/plan.d.ts.map +1 -0
- package/dist/src/signing/intent-plans/plan.js +187 -0
- package/dist/src/signing/intent-plans/types.d.ts +63 -0
- package/dist/src/signing/intent-plans/types.d.ts.map +1 -0
- package/dist/src/signing/intent-plans/types.js +1 -0
- package/dist/src/signing/message.d.ts +28 -0
- package/dist/src/signing/message.d.ts.map +1 -0
- package/dist/src/signing/message.js +90 -0
- package/dist/src/signing/passkeys.d.ts +28 -0
- package/dist/src/signing/passkeys.d.ts.map +1 -0
- package/dist/src/signing/passkeys.js +17 -0
- package/dist/src/signing/plan.d.ts +35 -0
- package/dist/src/signing/plan.d.ts.map +1 -0
- package/dist/src/signing/plan.js +377 -0
- package/dist/src/signing/protocols/erc6492.d.ts +11 -0
- package/dist/src/signing/protocols/erc6492.d.ts.map +1 -0
- package/dist/src/signing/protocols/erc6492.js +24 -0
- package/dist/src/signing/protocols/erc7739.d.ts +17 -0
- package/dist/src/signing/protocols/erc7739.d.ts.map +1 -0
- package/dist/src/signing/protocols/erc7739.js +84 -0
- package/dist/src/signing/session-enable.d.ts +35 -0
- package/dist/src/signing/session-enable.d.ts.map +1 -0
- package/dist/src/signing/session-enable.js +62 -0
- package/dist/src/signing/signers/compatibility.d.ts +4 -0
- package/dist/src/signing/signers/compatibility.d.ts.map +1 -0
- package/dist/src/signing/signers/compatibility.js +51 -0
- package/dist/src/signing/signers/ecdsa.d.ts +14 -0
- package/dist/src/signing/signers/ecdsa.d.ts.map +1 -0
- package/dist/src/signing/signers/ecdsa.js +54 -0
- package/dist/src/signing/signers/registry.d.ts +7 -0
- package/dist/src/signing/signers/registry.d.ts.map +1 -0
- package/dist/src/signing/signers/registry.js +33 -0
- package/dist/src/signing/signers/types.d.ts +16 -0
- package/dist/src/signing/signers/types.d.ts.map +1 -0
- package/dist/src/signing/signers/types.js +1 -0
- package/dist/src/signing/signers/wallet-chain.d.ts +9 -0
- package/dist/src/signing/signers/wallet-chain.d.ts.map +1 -0
- package/dist/src/signing/signers/wallet-chain.js +15 -0
- package/dist/src/signing/signers/webauthn.d.ts +11 -0
- package/dist/src/signing/signers/webauthn.d.ts.map +1 -0
- package/dist/src/signing/signers/webauthn.js +14 -0
- package/dist/src/signing/typed-data.d.ts +39 -0
- package/dist/src/signing/typed-data.d.ts.map +1 -0
- package/dist/src/signing/typed-data.js +135 -0
- package/dist/src/signing/types.d.ts +346 -0
- package/dist/src/signing/types.d.ts.map +1 -0
- package/dist/src/signing/types.js +1 -0
- package/dist/src/signing/user-operation.d.ts +23 -0
- package/dist/src/signing/user-operation.d.ts.map +1 -0
- package/dist/src/signing/user-operation.js +61 -0
- package/dist/src/smart-sessions/index.d.ts +13 -3
- package/dist/src/smart-sessions/index.d.ts.map +1 -1
- package/dist/src/smart-sessions/index.js +44 -6
- package/dist/src/transactions/intents/account.d.ts +15 -0
- package/dist/src/transactions/intents/account.d.ts.map +1 -0
- package/dist/src/transactions/intents/account.js +48 -0
- package/dist/src/transactions/intents/compatibility.d.ts +4 -0
- package/dist/src/transactions/intents/compatibility.d.ts.map +1 -0
- package/dist/src/transactions/intents/compatibility.js +19 -0
- package/dist/src/transactions/intents/normalize.d.ts +5 -0
- package/dist/src/transactions/intents/normalize.d.ts.map +1 -0
- package/dist/src/transactions/intents/normalize.js +48 -0
- package/dist/src/transactions/intents/prepare.d.ts +7 -0
- package/dist/src/transactions/intents/prepare.d.ts.map +1 -0
- package/dist/src/transactions/intents/prepare.js +249 -0
- package/dist/src/transactions/intents/quotes.d.ts +3 -0
- package/dist/src/transactions/intents/quotes.d.ts.map +1 -0
- package/dist/src/transactions/intents/quotes.js +11 -0
- package/dist/src/transactions/intents/request.d.ts +11 -0
- package/dist/src/transactions/intents/request.d.ts.map +1 -0
- package/dist/src/transactions/intents/request.js +55 -0
- package/dist/src/transactions/intents/send.d.ts +3 -0
- package/dist/src/transactions/intents/send.d.ts.map +1 -0
- package/dist/src/transactions/intents/send.js +22 -0
- package/dist/src/transactions/intents/session-signing.d.ts +7 -0
- package/dist/src/transactions/intents/session-signing.d.ts.map +1 -0
- package/dist/src/transactions/intents/session-signing.js +363 -0
- package/dist/src/transactions/intents/sessions.d.ts +17 -0
- package/dist/src/transactions/intents/sessions.d.ts.map +1 -0
- package/dist/src/transactions/intents/sessions.js +85 -0
- package/dist/src/transactions/intents/sign-transaction.d.ts +10 -0
- package/dist/src/transactions/intents/sign-transaction.d.ts.map +1 -0
- package/dist/src/transactions/intents/sign-transaction.js +386 -0
- package/dist/src/transactions/intents/split.d.ts +13 -0
- package/dist/src/transactions/intents/split.d.ts.map +1 -0
- package/dist/src/transactions/intents/split.js +3 -0
- package/dist/src/transactions/intents/status-policy.d.ts +13 -0
- package/dist/src/transactions/intents/status-policy.d.ts.map +1 -0
- package/dist/src/transactions/intents/status-policy.js +39 -0
- package/dist/src/transactions/intents/status.d.ts +4 -0
- package/dist/src/transactions/intents/status.d.ts.map +1 -0
- package/dist/src/transactions/intents/status.js +50 -0
- package/dist/src/transactions/intents/submit.d.ts +3 -0
- package/dist/src/transactions/intents/submit.d.ts.map +1 -0
- package/dist/src/transactions/intents/submit.js +32 -0
- package/dist/src/transactions/intents/types.d.ts +136 -0
- package/dist/src/transactions/intents/types.d.ts.map +1 -0
- package/dist/src/transactions/intents/types.js +1 -0
- package/dist/src/transactions/user-operations/hash.d.ts +5 -0
- package/dist/src/transactions/user-operations/hash.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/hash.js +9 -0
- package/dist/src/transactions/user-operations/nonce.d.ts +18 -0
- package/dist/src/transactions/user-operations/nonce.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/nonce.js +43 -0
- package/dist/src/transactions/user-operations/prepare.d.ts +12 -0
- package/dist/src/transactions/user-operations/prepare.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/prepare.js +138 -0
- package/dist/src/transactions/user-operations/reconstruct.d.ts +28 -0
- package/dist/src/transactions/user-operations/reconstruct.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/reconstruct.js +52 -0
- package/dist/src/transactions/user-operations/send.d.ts +3 -0
- package/dist/src/transactions/user-operations/send.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/send.js +8 -0
- package/dist/src/transactions/user-operations/sign.d.ts +3 -0
- package/dist/src/transactions/user-operations/sign.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/sign.js +14 -0
- package/dist/src/transactions/user-operations/status.d.ts +4 -0
- package/dist/src/transactions/user-operations/status.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/status.js +37 -0
- package/dist/src/transactions/user-operations/submit.d.ts +3 -0
- package/dist/src/transactions/user-operations/submit.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/submit.js +8 -0
- package/dist/src/transactions/user-operations/types.d.ts +68 -0
- package/dist/src/transactions/user-operations/types.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/types.js +1 -0
- package/dist/src/transactions/user-operations/validator-account.d.ts +5 -0
- package/dist/src/transactions/user-operations/validator-account.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/validator-account.js +26 -0
- package/dist/src/utils/index.d.ts +9 -4
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +54 -51
- package/package.json +3 -3
- package/dist/src/accounts/hca.d.ts +0 -25
- package/dist/src/accounts/hca.d.ts.map +0 -1
- package/dist/src/accounts/hca.js +0 -148
- package/dist/src/accounts/index.d.ts +0 -64
- package/dist/src/accounts/index.d.ts.map +0 -1
- package/dist/src/accounts/index.js +0 -680
- package/dist/src/accounts/json-rpc/index.d.ts +0 -5
- package/dist/src/accounts/json-rpc/index.d.ts.map +0 -1
- package/dist/src/accounts/json-rpc/index.js +0 -13
- package/dist/src/accounts/json-rpc/providers.d.ts +0 -3
- package/dist/src/accounts/json-rpc/providers.d.ts.map +0 -1
- package/dist/src/accounts/json-rpc/providers.js +0 -4
- package/dist/src/accounts/kernel.d.ts +0 -26
- package/dist/src/accounts/kernel.d.ts.map +0 -1
- package/dist/src/accounts/kernel.js +0 -265
- package/dist/src/accounts/nexus.d.ts +0 -34
- package/dist/src/accounts/nexus.d.ts.map +0 -1
- package/dist/src/accounts/nexus.js +0 -520
- package/dist/src/accounts/safe.d.ts +0 -32
- package/dist/src/accounts/safe.d.ts.map +0 -1
- package/dist/src/accounts/safe.js +0 -337
- package/dist/src/accounts/signing/common.d.ts +0 -38
- package/dist/src/accounts/signing/common.d.ts.map +0 -1
- package/dist/src/accounts/signing/common.js +0 -186
- package/dist/src/accounts/signing/message.d.ts +0 -7
- package/dist/src/accounts/signing/message.d.ts.map +0 -1
- package/dist/src/accounts/signing/message.js +0 -42
- package/dist/src/accounts/signing/passkeys.d.ts +0 -36
- package/dist/src/accounts/signing/passkeys.d.ts.map +0 -1
- package/dist/src/accounts/signing/passkeys.js +0 -119
- package/dist/src/accounts/signing/typedData.d.ts +0 -5
- package/dist/src/accounts/signing/typedData.d.ts.map +0 -1
- package/dist/src/accounts/signing/typedData.js +0 -30
- package/dist/src/accounts/startale.d.ts +0 -25
- package/dist/src/accounts/startale.d.ts.map +0 -1
- package/dist/src/accounts/startale.js +0 -188
- package/dist/src/accounts/utils.d.ts +0 -33
- package/dist/src/accounts/utils.d.ts.map +0 -1
- package/dist/src/accounts/utils.js +0 -202
- package/dist/src/auth/provider.d.ts +0 -7
- package/dist/src/auth/provider.d.ts.map +0 -1
- package/dist/src/auth/provider.js +0 -38
- package/dist/src/execution/compact.d.ts +0 -5
- package/dist/src/execution/compact.d.ts.map +0 -1
- package/dist/src/execution/compact.js +0 -4
- package/dist/src/execution/error.d.ts.map +0 -1
- package/dist/src/execution/index.d.ts +0 -42
- package/dist/src/execution/index.d.ts.map +0 -1
- package/dist/src/execution/index.js +0 -186
- package/dist/src/execution/utils.d.ts +0 -167
- package/dist/src/execution/utils.d.ts.map +0 -1
- package/dist/src/execution/utils.js +0 -1603
- package/dist/src/modules/abi/smart-sessions.d.ts +0 -104
- package/dist/src/modules/abi/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/abi/smart-sessions.js +0 -128
- package/dist/src/modules/chain-abstraction.d.ts +0 -5
- package/dist/src/modules/chain-abstraction.d.ts.map +0 -1
- package/dist/src/modules/chain-abstraction.js +0 -3
- package/dist/src/modules/common.d.ts +0 -30
- package/dist/src/modules/common.d.ts.map +0 -1
- package/dist/src/modules/common.js +0 -30
- package/dist/src/modules/index.d.ts +0 -11
- package/dist/src/modules/index.d.ts.map +0 -1
- package/dist/src/modules/index.js +0 -85
- package/dist/src/modules/legacy.d.ts +0 -10
- package/dist/src/modules/legacy.d.ts.map +0 -1
- package/dist/src/modules/legacy.js +0 -62
- package/dist/src/modules/read.d.ts +0 -11
- package/dist/src/modules/read.d.ts.map +0 -1
- package/dist/src/modules/read.js +0 -219
- package/dist/src/modules/validators/core.d.ts +0 -31
- package/dist/src/modules/validators/core.d.ts.map +0 -1
- package/dist/src/modules/validators/core.js +0 -269
- package/dist/src/modules/validators/cross-chain-permits.d.ts +0 -22
- package/dist/src/modules/validators/cross-chain-permits.d.ts.map +0 -1
- package/dist/src/modules/validators/cross-chain-permits.js +0 -107
- package/dist/src/modules/validators/index.d.ts +0 -4
- package/dist/src/modules/validators/index.d.ts.map +0 -1
- package/dist/src/modules/validators/index.js +0 -3
- package/dist/src/modules/validators/smart-sessions.d.ts +0 -226
- package/dist/src/modules/validators/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/validators/smart-sessions.js +0 -1197
- package/dist/src/orchestrator/caip2.d.ts +0 -18
- package/dist/src/orchestrator/caip2.d.ts.map +0 -1
- package/dist/src/orchestrator/caip2.js +0 -58
- package/dist/src/orchestrator/chain-catalog.d.ts.map +0 -1
- package/dist/src/orchestrator/client.d.ts +0 -43
- package/dist/src/orchestrator/client.d.ts.map +0 -1
- package/dist/src/orchestrator/client.js +0 -336
- package/dist/src/orchestrator/consts.d.ts +0 -6
- package/dist/src/orchestrator/consts.d.ts.map +0 -1
- package/dist/src/orchestrator/consts.js +0 -5
- package/dist/src/orchestrator/destinations.d.ts.map +0 -1
- package/dist/src/orchestrator/destinations.js +0 -59
- package/dist/src/orchestrator/error.d.ts.map +0 -1
- package/dist/src/orchestrator/index.d.ts +0 -12
- package/dist/src/orchestrator/index.d.ts.map +0 -1
- package/dist/src/orchestrator/index.js +0 -9
- package/dist/src/orchestrator/registry.d.ts +0 -7
- package/dist/src/orchestrator/registry.d.ts.map +0 -1
- package/dist/src/orchestrator/registry.js +0 -46
- package/dist/src/orchestrator/types.d.ts.map +0 -1
- package/dist/src/orchestrator/utils.d.ts +0 -3
- package/dist/src/orchestrator/utils.d.ts.map +0 -1
- package/dist/src/orchestrator/utils.js +0 -22
- package/dist/src/orchestrator/wire.d.ts +0 -31
- package/dist/src/orchestrator/wire.d.ts.map +0 -1
- package/dist/src/orchestrator/wire.gen.d.ts.map +0 -1
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/utils/walletClient.d.ts +0 -34
- package/dist/src/utils/walletClient.d.ts.map +0 -1
- package/dist/src/utils/walletClient.js +0 -117
- /package/dist/src/{orchestrator/wire.gen.js → accounts/adapter.js} +0 -0
- /package/dist/src/{types.js → accounts/types.js} +0 -0
- /package/dist/src/{orchestrator/wire.js → api/compose-types.js} +0 -0
package/dist/src/index.js
CHANGED
|
@@ -1,289 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { getOrchestrator } from './orchestrator/index.js';
|
|
8
|
-
import { hyperCoreMainnet, solanaMainnet, tronMainnet } from './orchestrator/index.js';
|
|
9
|
-
/**
|
|
10
|
-
* Initialize a Rhinestone account from a fully-resolved config.
|
|
11
|
-
* Note: accounts are deployed onchain only when the first transaction is sent.
|
|
12
|
-
* @internal Use {@link RhinestoneSDK.createAccount} instead.
|
|
13
|
-
*/
|
|
14
|
-
async function createAccountInternal(config) {
|
|
15
|
-
// Sanity check for existing (externally created) accounts
|
|
16
|
-
// Ensures we decode the initdata correctly
|
|
17
|
-
checkAddress(config);
|
|
18
|
-
// Validate that owners field is provided for non-EOA accounts
|
|
19
|
-
if (config.account?.type !== 'eoa' && !config.owners) {
|
|
20
|
-
throw new OwnersFieldRequiredError();
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Deploys the account on a given chain
|
|
24
|
-
* @param chain Chain to deploy the account on
|
|
25
|
-
* @param params Optional deployment params (e.g. `sponsored`)
|
|
26
|
-
*/
|
|
27
|
-
function deploy(chain, params) {
|
|
28
|
-
return deployInternal(config, chain, params);
|
|
29
|
-
}
|
|
30
|
-
function isDeployed(chain) {
|
|
31
|
-
return isDeployedInternal(config, chain);
|
|
32
|
-
}
|
|
33
|
-
function setup(chain) {
|
|
34
|
-
return setupInternal(config, chain);
|
|
35
|
-
}
|
|
36
|
-
function getInitData() {
|
|
37
|
-
const initData = getInitCode(config);
|
|
38
|
-
if (!initData) {
|
|
39
|
-
throw new FactoryArgsNotAvailableError();
|
|
40
|
-
}
|
|
41
|
-
if (!('factory' in initData)) {
|
|
42
|
-
throw new FactoryArgsNotAvailableError();
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
factory: initData.factory,
|
|
46
|
-
factoryData: initData.factoryData,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
function signEip7702InitData() {
|
|
50
|
-
return signEip7702InitDataInternal(config);
|
|
51
|
-
}
|
|
52
|
-
function prepareTransaction(transaction) {
|
|
53
|
-
return prepareTransactionInternal(config, transaction);
|
|
54
|
-
}
|
|
55
|
-
function getTransactionMessages(preparedTransaction, options) {
|
|
56
|
-
return getTransactionMessagesInternal(config, preparedTransaction, options);
|
|
57
|
-
}
|
|
58
|
-
function signTransaction(preparedTransaction, options) {
|
|
59
|
-
if (options && 'owner' in options) {
|
|
60
|
-
return signTransactionInternal(config, preparedTransaction, options);
|
|
61
|
-
}
|
|
62
|
-
return signTransactionInternal(config, preparedTransaction, options);
|
|
63
|
-
}
|
|
64
|
-
function assembleTransaction(preparedTransaction, signatures) {
|
|
65
|
-
return assembleTransactionInternal(config, preparedTransaction, signatures);
|
|
66
|
-
}
|
|
67
|
-
function signAuthorizations(preparedTransaction) {
|
|
68
|
-
return signAuthorizationsInternal(config, preparedTransaction);
|
|
69
|
-
}
|
|
70
|
-
function signMessage(message, chain, signers) {
|
|
71
|
-
return signMessageInternal(config, message, chain, signers);
|
|
72
|
-
}
|
|
73
|
-
function signTypedData(parameters, chain, signers) {
|
|
74
|
-
return signTypedDataInternal(config, parameters, chain, signers);
|
|
75
|
-
}
|
|
76
|
-
async function signIntent(signData, targetChain, signers) {
|
|
77
|
-
const { originSignatures, destinationSignature } = await signIntentInternal(config, signData, targetChain, signers, false);
|
|
78
|
-
const targetExecutionSignature = await getTargetExecutionSignatureInternal(config, signData, targetChain, signers);
|
|
79
|
-
return {
|
|
80
|
-
originSignatures,
|
|
81
|
-
destinationSignature,
|
|
82
|
-
targetExecutionSignature,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
function submitTransaction(signedTransaction, options) {
|
|
86
|
-
return submitTransactionInternal(config, signedTransaction, options?.authorizations ?? [], options?.internal_dryRun ?? false);
|
|
87
|
-
}
|
|
88
|
-
function prepareUserOperation(transaction) {
|
|
89
|
-
return prepareUserOperationInternal(config, transaction);
|
|
90
|
-
}
|
|
91
|
-
function signUserOperation(preparedUserOperation) {
|
|
92
|
-
return signUserOperationInternal(config, preparedUserOperation);
|
|
93
|
-
}
|
|
94
|
-
function submitUserOperation(signedUserOperation) {
|
|
95
|
-
return submitUserOperationInternal(config, signedUserOperation);
|
|
96
|
-
}
|
|
97
|
-
function sendUserOperation(transaction) {
|
|
98
|
-
return sendUserOperationInternal(config, transaction);
|
|
99
|
-
}
|
|
100
|
-
function waitForExecution(result) {
|
|
101
|
-
return waitForExecutionInternal(config, result);
|
|
102
|
-
}
|
|
103
|
-
function getAddress() {
|
|
104
|
-
return getAddressInternal(config);
|
|
105
|
-
}
|
|
106
|
-
function getPortfolio(onTestnets = false) {
|
|
107
|
-
return getPortfolioInternal(config, onTestnets);
|
|
108
|
-
}
|
|
109
|
-
function getOwners(chain) {
|
|
110
|
-
const accountType = getAccountProvider(config).type;
|
|
111
|
-
const account = getAddress();
|
|
112
|
-
// For HCA, the module lives behind the factory (custom factories define
|
|
113
|
-
// their own). Resolve from the configured or initData factory so reads hit
|
|
114
|
-
// the right module.
|
|
115
|
-
const hcaFactory = config.account?.type === 'hca'
|
|
116
|
-
? (config.account.factory ??
|
|
117
|
-
(config.initData && 'factory' in config.initData
|
|
118
|
-
? config.initData.factory
|
|
119
|
-
: undefined))
|
|
120
|
-
: undefined;
|
|
121
|
-
return getOwnersInternal(accountType, account, chain, config.provider, hcaFactory);
|
|
122
|
-
}
|
|
123
|
-
function getValidators(chain) {
|
|
124
|
-
const accountType = getAccountProvider(config).type;
|
|
125
|
-
const account = getAddress();
|
|
126
|
-
return getValidatorsInternal(accountType, account, chain, config.provider);
|
|
127
|
-
}
|
|
128
|
-
function getExecutors(chain) {
|
|
129
|
-
const accountType = getAccountProvider(config).type;
|
|
130
|
-
const account = getAddress();
|
|
131
|
-
return getExecutorsInternal(accountType, account, chain, config.provider);
|
|
132
|
-
}
|
|
133
|
-
function experimental_getSessionDetails(sessions) {
|
|
134
|
-
const account = getAddress();
|
|
135
|
-
return getSessionDetailsInternal(account, sessions, config.provider, config.useDevContracts);
|
|
136
|
-
}
|
|
137
|
-
function experimental_isSessionEnabled(session) {
|
|
138
|
-
const account = getAddress();
|
|
139
|
-
return isSessionEnabledInternal(account, config.provider, session, config.useDevContracts);
|
|
140
|
-
}
|
|
141
|
-
function experimental_signEnableSession(details) {
|
|
142
|
-
return signEnableSessionInternal(config, details);
|
|
143
|
-
}
|
|
144
|
-
return {
|
|
145
|
-
config,
|
|
146
|
-
deploy,
|
|
147
|
-
isDeployed,
|
|
148
|
-
setup,
|
|
149
|
-
signEip7702InitData,
|
|
150
|
-
prepareTransaction,
|
|
151
|
-
getTransactionMessages,
|
|
152
|
-
signTransaction,
|
|
153
|
-
assembleTransaction,
|
|
154
|
-
signAuthorizations,
|
|
155
|
-
signMessage,
|
|
156
|
-
signTypedData,
|
|
157
|
-
signIntent,
|
|
158
|
-
submitTransaction,
|
|
159
|
-
prepareUserOperation,
|
|
160
|
-
signUserOperation,
|
|
161
|
-
submitUserOperation,
|
|
162
|
-
sendUserOperation,
|
|
163
|
-
waitForExecution,
|
|
164
|
-
getAddress,
|
|
165
|
-
getPortfolio,
|
|
166
|
-
getOwners,
|
|
167
|
-
getValidators,
|
|
168
|
-
getExecutors,
|
|
169
|
-
experimental_getSessionDetails,
|
|
170
|
-
experimental_isSessionEnabled,
|
|
171
|
-
experimental_signEnableSession,
|
|
172
|
-
getInitData,
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
async function createSessionInternal(authProvider, endpointUrl, headers, useDevContracts, definition) {
|
|
176
|
-
const orchestrator = getOrchestrator(authProvider, endpointUrl, headers);
|
|
177
|
-
const catalog = await orchestrator.getChainCatalog();
|
|
178
|
-
const wrappedNativeToken = catalog.getWrappedNativeToken(definition.chain.id)
|
|
179
|
-
?.address;
|
|
180
|
-
// Fail fast: without the wrapped-native address we can't add the native-wrap
|
|
181
|
-
// `deposit()` permission, and a silently under-scoped session would
|
|
182
|
-
// sign/enable fine but break native-wrap intents later.
|
|
183
|
-
if (!wrappedNativeToken) {
|
|
184
|
-
throw new Error(`createSession: the orchestrator's /chains has no wrapped-native token for chain ${definition.chain.id}. The chain must be supported and advertise its wrappedNativeToken.`);
|
|
185
|
-
}
|
|
186
|
-
return toSession(definition, { wrappedNativeToken, useDevContracts });
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Stateful entry point that holds shared configuration (auth, provider, bundler,
|
|
190
|
-
* paymaster) and creates accounts from it.
|
|
191
|
-
*/
|
|
192
|
-
class RhinestoneSDK {
|
|
193
|
-
authProvider;
|
|
194
|
-
endpointUrl;
|
|
195
|
-
provider;
|
|
196
|
-
bundler;
|
|
197
|
-
paymaster;
|
|
198
|
-
useDevContracts;
|
|
199
|
-
headers;
|
|
200
|
-
/**
|
|
201
|
-
* Create a Rhinestone SDK instance.
|
|
202
|
-
* @param options Shared configuration applied to every account created by this instance
|
|
203
|
-
*/
|
|
204
|
-
constructor(options) {
|
|
205
|
-
this.authProvider = createAuthProvider(options);
|
|
206
|
-
this.endpointUrl = options.endpointUrl;
|
|
207
|
-
this.provider = options.provider;
|
|
208
|
-
this.bundler = options.bundler;
|
|
209
|
-
this.paymaster = options.paymaster;
|
|
210
|
-
this.useDevContracts = options.useDevContracts;
|
|
211
|
-
this.headers = options.headers;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Create an account using this instance's shared configuration.
|
|
215
|
-
* @param config Per-account configuration (owners, account type, modules, sessions)
|
|
216
|
-
* @returns The account instance
|
|
217
|
-
* @example
|
|
218
|
-
* ```ts
|
|
219
|
-
* import { RhinestoneSDK } from '@rhinestone/sdk'
|
|
220
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
|
221
|
-
*
|
|
222
|
-
* const owner = privateKeyToAccount('0x...')
|
|
223
|
-
*
|
|
224
|
-
* const sdk = new RhinestoneSDK({
|
|
225
|
-
* auth: { mode: 'apiKey', apiKey: process.env.RHINESTONE_API_KEY! },
|
|
226
|
-
* })
|
|
227
|
-
*
|
|
228
|
-
* const account = await sdk.createAccount({
|
|
229
|
-
* owners: { type: 'ecdsa', accounts: [owner] },
|
|
230
|
-
* })
|
|
231
|
-
* ```
|
|
232
|
-
*/
|
|
233
|
-
createAccount(config) {
|
|
234
|
-
const rhinestoneConfig = {
|
|
235
|
-
...config,
|
|
236
|
-
_authProvider: this.authProvider,
|
|
237
|
-
endpointUrl: this.endpointUrl,
|
|
238
|
-
provider: this.provider,
|
|
239
|
-
bundler: this.bundler,
|
|
240
|
-
paymaster: this.paymaster,
|
|
241
|
-
useDevContracts: this.useDevContracts,
|
|
242
|
-
headers: this.headers,
|
|
243
|
-
};
|
|
244
|
-
return createAccountInternal(rhinestoneConfig);
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Create a smart session, resolving the chain's wrapped-native token from the
|
|
248
|
-
* orchestrator's chain catalog (`GET /chains`) so native-token wrapping is
|
|
249
|
-
* permitted automatically. Project-scoped — needs the API key but no account.
|
|
250
|
-
* For a fully offline build, use the standalone {@link toSession} and pass
|
|
251
|
-
* `wrappedNativeToken` yourself.
|
|
252
|
-
* @param definition The session definition
|
|
253
|
-
* @returns The resolved session
|
|
254
|
-
*/
|
|
255
|
-
createSession(definition) {
|
|
256
|
-
return createSessionInternal(this.authProvider, this.endpointUrl, this.headers, this.useDevContracts, definition);
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Get the current status of a submitted intent.
|
|
260
|
-
* @param intentId The intent ID returned when the transaction was submitted
|
|
261
|
-
* @returns The intent status
|
|
262
|
-
*/
|
|
263
|
-
getIntentStatus(intentId) {
|
|
264
|
-
return getIntentStatusInternal(this.authProvider, this.endpointUrl, intentId, this.headers);
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Split a transaction into multiple intents across chains.
|
|
268
|
-
* @param input The intents to split
|
|
269
|
-
* @returns The split-intents result
|
|
270
|
-
*/
|
|
271
|
-
splitIntents(input) {
|
|
272
|
-
return splitIntentsInternal(this.authProvider, this.endpointUrl, input, this.headers);
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* Get the integrator's accrued app-fee balance, as USD totals.
|
|
276
|
-
*
|
|
277
|
-
* App fees are earned by the integrator identified by this instance's API key
|
|
278
|
-
* (project-scoped, not tied to any account) and valued in USD at the moment
|
|
279
|
-
* each fee is collected, so the balance is not affected by later price
|
|
280
|
-
* movements of the collected tokens.
|
|
281
|
-
* @returns The withdrawable and pending app-fee balances in USD
|
|
282
|
-
*/
|
|
283
|
-
getAppFeeBalances() {
|
|
284
|
-
return getAppFeeBalancesInternal(this.authProvider, this.endpointUrl, this.headers);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
1
|
+
import { RhinestoneSDK } from './api/sdk.js';
|
|
2
|
+
import { hyperCoreMainnet, solanaMainnet, tronMainnet } from './chains/non-evm.js';
|
|
3
|
+
import { MULTI_FACTOR_VALIDATOR_ADDRESS } from './modules/validators/multi-factor.js';
|
|
4
|
+
import { OWNABLE_VALIDATOR_ADDRESS } from './modules/validators/ownable.js';
|
|
5
|
+
import { SMART_SESSION_EMISSARY_ADDRESS } from './modules/validators/smart-sessions/module.js';
|
|
6
|
+
import { WEBAUTHN_VALIDATOR_ADDRESS } from './modules/validators/webauthn.js';
|
|
287
7
|
export { RhinestoneSDK,
|
|
288
8
|
// Non-viem destination chain descriptors (Solana, Tron, HyperCore)
|
|
289
9
|
hyperCoreMainnet, solanaMainnet, tronMainnet,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erc7579-abi.d.ts","sourceRoot":"","sources":["../../../modules/erc7579-abi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,MAAM,MAAM,YAAY,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;AAE5C,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAW3D"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
|
+
import type { ResolvedModule } from './types.js';
|
|
3
|
+
export declare const INTENT_EXECUTOR_ADDRESS: Address;
|
|
4
|
+
export declare const INTENT_EXECUTOR_ADDRESS_DEV: Address;
|
|
5
|
+
export declare function getIntentExecutorModule(environment: 'production' | 'development'): ResolvedModule;
|
|
6
|
+
//# sourceMappingURL=intent-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent-executor.d.ts","sourceRoot":"","sources":["../../../modules/intent-executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,eAAO,MAAM,uBAAuB,EAAE,OACQ,CAAA;AAC9C,eAAO,MAAM,2BAA2B,EAAE,OACI,CAAA;AAE9C,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,YAAY,GAAG,aAAa,GACxC,cAAc,CAWhB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const INTENT_EXECUTOR_ADDRESS = '0x00000000005aD9ce1f5035FD62CA96CEf16AdAAF';
|
|
2
|
+
export const INTENT_EXECUTOR_ADDRESS_DEV = '0xbf9b5b917a83f8adac17b0752846d41d8d7b7e17';
|
|
3
|
+
export function getIntentExecutorModule(environment) {
|
|
4
|
+
return {
|
|
5
|
+
kind: 'executor',
|
|
6
|
+
address: environment === 'development'
|
|
7
|
+
? INTENT_EXECUTOR_ADDRESS_DEV
|
|
8
|
+
: INTENT_EXECUTOR_ADDRESS,
|
|
9
|
+
initData: '0x',
|
|
10
|
+
deInitData: '0x',
|
|
11
|
+
additionalContext: '0x',
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
import type { ModuleSetup, ResolvedModule } from './types.js';
|
|
3
|
+
declare const MODULE_TYPE_ID_VALIDATOR = 1n;
|
|
4
|
+
declare const MODULE_TYPE_ID_EXECUTOR = 2n;
|
|
5
|
+
declare const MODULE_TYPE_ID_FALLBACK = 3n;
|
|
6
|
+
declare const MODULE_TYPE_ID_HOOK = 4n;
|
|
7
|
+
export type ModuleTypeId = typeof MODULE_TYPE_ID_VALIDATOR | typeof MODULE_TYPE_ID_EXECUTOR | typeof MODULE_TYPE_ID_FALLBACK | typeof MODULE_TYPE_ID_HOOK;
|
|
8
|
+
export interface Module {
|
|
9
|
+
address: Address;
|
|
10
|
+
initData: Hex;
|
|
11
|
+
deInitData: Hex;
|
|
12
|
+
additionalContext: Hex;
|
|
13
|
+
type: ModuleTypeId;
|
|
14
|
+
}
|
|
15
|
+
export interface ModeleSetup {
|
|
16
|
+
validators: Module[];
|
|
17
|
+
executors: Module[];
|
|
18
|
+
fallbacks: Module[];
|
|
19
|
+
hooks: Module[];
|
|
20
|
+
}
|
|
21
|
+
export declare function toLegacyModule(module: ResolvedModule): Module;
|
|
22
|
+
export declare function toLegacyModuleSetup(setup: ModuleSetup): ModeleSetup;
|
|
23
|
+
export declare function getV0Attesters(): {
|
|
24
|
+
readonly addresses: readonly `0x${string}`[];
|
|
25
|
+
readonly threshold: number;
|
|
26
|
+
};
|
|
27
|
+
export declare function planV0ModuleSetup(setup: ModuleSetup): ModuleSetup;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=legacy-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-core.d.ts","sourceRoot":"","sources":["../../../modules/legacy-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAuB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAA;AAClE,OAAO,KAAK,EAAc,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAKtE,QAAA,MAAM,wBAAwB,KAAK,CAAA;AACnC,QAAA,MAAM,uBAAuB,KAAK,CAAA;AAClC,QAAA,MAAM,uBAAuB,KAAK,CAAA;AAClC,QAAA,MAAM,mBAAmB,KAAK,CAAA;AAE9B,MAAM,MAAM,YAAY,GACpB,OAAO,wBAAwB,GAC/B,OAAO,uBAAuB,GAC9B,OAAO,uBAAuB,GAC9B,OAAO,mBAAmB,CAAA;AAE9B,MAAM,WAAW,MAAM;IACrB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,GAAG,CAAA;IACb,UAAU,EAAE,GAAG,CAAA;IACf,iBAAiB,EAAE,GAAG,CAAA;IACtB,IAAI,EAAE,YAAY,CAAA;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAyBD,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAQ7D;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,CAOnE;AAED,wBAAgB,cAAc,IAAI;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,KAAK,MAAM,EAAE,EAAE,CAAA;IAC5C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B,CAQA;AAgBD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,CA0BjE"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { encodeAbiParameters } from 'viem';
|
|
2
|
+
// Legacy module-setup shapes preserved for the `experimental_getModuleSetup`
|
|
3
|
+
// compatibility surface (note the historical `ModeleSetup` spelling, which is
|
|
4
|
+
// part of the published type name).
|
|
5
|
+
const MODULE_TYPE_ID_VALIDATOR = 1n;
|
|
6
|
+
const MODULE_TYPE_ID_EXECUTOR = 2n;
|
|
7
|
+
const MODULE_TYPE_ID_FALLBACK = 3n;
|
|
8
|
+
const MODULE_TYPE_ID_HOOK = 4n;
|
|
9
|
+
const RHINESTONE_ATTESTER_ADDRESS = '0x000000333034E9f539ce08819E12c1b8Cb29084d';
|
|
10
|
+
const OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS = '0x6D0515e8E499468DCe9583626f0cA15b887f9d03';
|
|
11
|
+
const HOOK_ADDRESS = '0x0000000000f6Ed8Be424d673c63eeFF8b9267420';
|
|
12
|
+
const TARGET_MODULE_ADDRESS = '0x0000000000E5a37279A001301A837a91b5de1D5E';
|
|
13
|
+
const SAME_CHAIN_MODULE_ADDRESS = '0x000000000043ff16d5776c7F0f65Ec485C17Ca04';
|
|
14
|
+
const moduleType = (kind) => {
|
|
15
|
+
switch (kind) {
|
|
16
|
+
case 'validator':
|
|
17
|
+
return 1n;
|
|
18
|
+
case 'executor':
|
|
19
|
+
return 2n;
|
|
20
|
+
case 'fallback':
|
|
21
|
+
return 3n;
|
|
22
|
+
case 'hook':
|
|
23
|
+
return 4n;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
export function toLegacyModule(module) {
|
|
27
|
+
return {
|
|
28
|
+
address: module.address,
|
|
29
|
+
initData: module.initData,
|
|
30
|
+
deInitData: module.deInitData,
|
|
31
|
+
additionalContext: module.additionalContext,
|
|
32
|
+
type: moduleType(module.kind),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export function toLegacyModuleSetup(setup) {
|
|
36
|
+
return {
|
|
37
|
+
validators: setup.validators.map(toLegacyModule),
|
|
38
|
+
executors: setup.executors.map(toLegacyModule),
|
|
39
|
+
fallbacks: setup.fallbacks.map(toLegacyModule),
|
|
40
|
+
hooks: setup.hooks.map(toLegacyModule),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function getV0Attesters() {
|
|
44
|
+
return {
|
|
45
|
+
addresses: [
|
|
46
|
+
RHINESTONE_ATTESTER_ADDRESS,
|
|
47
|
+
OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS,
|
|
48
|
+
],
|
|
49
|
+
threshold: 1,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function v0Module(kind, address, initData = '0x') {
|
|
53
|
+
return {
|
|
54
|
+
kind,
|
|
55
|
+
address,
|
|
56
|
+
initData,
|
|
57
|
+
deInitData: '0x',
|
|
58
|
+
additionalContext: '0x',
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export function planV0ModuleSetup(setup) {
|
|
62
|
+
return {
|
|
63
|
+
validators: setup.validators,
|
|
64
|
+
executors: [
|
|
65
|
+
v0Module('executor', SAME_CHAIN_MODULE_ADDRESS),
|
|
66
|
+
v0Module('executor', TARGET_MODULE_ADDRESS),
|
|
67
|
+
v0Module('executor', HOOK_ADDRESS),
|
|
68
|
+
...setup.executors,
|
|
69
|
+
],
|
|
70
|
+
fallbacks: [
|
|
71
|
+
v0Module('fallback', TARGET_MODULE_ADDRESS, encodeAbiParameters([
|
|
72
|
+
{ name: 'selector', type: 'bytes4' },
|
|
73
|
+
{ name: 'flags', type: 'bytes1' },
|
|
74
|
+
{ name: 'data', type: 'bytes' },
|
|
75
|
+
], ['0x3a5be8cb', '0x00', '0x'])),
|
|
76
|
+
...setup.fallbacks,
|
|
77
|
+
],
|
|
78
|
+
hooks: setup.hooks,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ConfiguredModule, ResolvedModule } from './types.js';
|
|
2
|
+
export declare function normalizeModule(module: ConfiguredModule): ResolvedModule;
|
|
3
|
+
export declare function normalizeModules(modules: readonly ConfiguredModule[]): readonly ResolvedModule[];
|
|
4
|
+
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../modules/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAQ/D,wBAAgB,eAAe,CAAC,MAAM,EAAE,gBAAgB,GAAG,cAAc,CAQxE;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,SAAS,gBAAgB,EAAE,GACnC,SAAS,cAAc,EAAE,CAE3B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function materializeData(selection) {
|
|
2
|
+
return selection.source === 'explicit' ? selection.value : '0x';
|
|
3
|
+
}
|
|
4
|
+
export function normalizeModule(module) {
|
|
5
|
+
return {
|
|
6
|
+
kind: module.kind,
|
|
7
|
+
address: module.address,
|
|
8
|
+
initData: materializeData(module.initData),
|
|
9
|
+
deInitData: materializeData(module.deInitData),
|
|
10
|
+
additionalContext: materializeData(module.additionalContext),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export function normalizeModules(modules) {
|
|
14
|
+
return modules.map(normalizeModule);
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Hex } from 'viem';
|
|
2
|
+
import type { ConfiguredModule, ModuleInstallationPlan, ModuleSetup, ResolvedModule } from './types.js';
|
|
3
|
+
export type ModuleCallEncoder = (module: ResolvedModule, operation: ModuleInstallationPlan['operation']) => Hex;
|
|
4
|
+
export declare function planModuleOperation(module: ResolvedModule, operation: ModuleInstallationPlan['operation'], encodeAccountCall: ModuleCallEncoder): ModuleInstallationPlan;
|
|
5
|
+
export declare function planModuleSetup(input: {
|
|
6
|
+
readonly accountKind: string;
|
|
7
|
+
readonly owner: ResolvedModule;
|
|
8
|
+
readonly configured: readonly ConfiguredModule[];
|
|
9
|
+
readonly environment: 'production' | 'development';
|
|
10
|
+
readonly sessions: {
|
|
11
|
+
readonly enabled: boolean;
|
|
12
|
+
readonly module?: `0x${string}`;
|
|
13
|
+
readonly compatibilityFallback?: `0x${string}`;
|
|
14
|
+
};
|
|
15
|
+
}): ModuleSetup;
|
|
16
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../modules/plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAA;AAGpD,OAAO,KAAK,EACV,gBAAgB,EAChB,sBAAsB,EACtB,WAAW,EACX,cAAc,EACf,MAAM,SAAS,CAAA;AAGhB,MAAM,MAAM,iBAAiB,GAAG,CAC9B,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,sBAAsB,CAAC,WAAW,CAAC,KAC3C,GAAG,CAAA;AAER,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,sBAAsB,CAAC,WAAW,CAAC,EAC9C,iBAAiB,EAAE,iBAAiB,GACnC,sBAAsB,CAMxB;AAKD,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAA;IAC9B,QAAQ,CAAC,UAAU,EAAE,SAAS,gBAAgB,EAAE,CAAA;IAChD,QAAQ,CAAC,WAAW,EAAE,YAAY,GAAG,aAAa,CAAA;IAClD,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;QACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,MAAM,EAAE,CAAA;QAC/B,QAAQ,CAAC,qBAAqB,CAAC,EAAE,KAAK,MAAM,EAAE,CAAA;KAC/C,CAAA;CACF,GAAG,WAAW,CA0Cd"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { encodeAbiParameters } from 'viem';
|
|
2
|
+
import { getIntentExecutorModule } from './intent-executor.js';
|
|
3
|
+
import { normalizeModules } from './normalize.js';
|
|
4
|
+
import { resolveSmartSessionModule } from './validators/smart-sessions/module.js';
|
|
5
|
+
export function planModuleOperation(module, operation, encodeAccountCall) {
|
|
6
|
+
return {
|
|
7
|
+
module,
|
|
8
|
+
operation,
|
|
9
|
+
accountCallData: encodeAccountCall(module, operation),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const SAFE_SESSION_COMPATIBILITY_FALLBACK_ADDRESS = '0x000000000052e9685932845660777DF43C2dC496';
|
|
13
|
+
export function planModuleSetup(input) {
|
|
14
|
+
const custom = normalizeModules(input.configured);
|
|
15
|
+
const session = resolveSmartSessionModule({
|
|
16
|
+
enabled: input.sessions.enabled,
|
|
17
|
+
address: input.sessions.module,
|
|
18
|
+
environment: input.environment,
|
|
19
|
+
});
|
|
20
|
+
const validators = [
|
|
21
|
+
input.owner,
|
|
22
|
+
...(session ? [session] : []),
|
|
23
|
+
...custom.filter((module) => module.kind === 'validator'),
|
|
24
|
+
];
|
|
25
|
+
const executors = [
|
|
26
|
+
getIntentExecutorModule(input.environment),
|
|
27
|
+
...custom.filter((module) => module.kind === 'executor'),
|
|
28
|
+
];
|
|
29
|
+
const fallbacks = [];
|
|
30
|
+
if (input.sessions.enabled && input.accountKind === 'safe') {
|
|
31
|
+
fallbacks.push({
|
|
32
|
+
kind: 'fallback',
|
|
33
|
+
address: input.sessions.compatibilityFallback ??
|
|
34
|
+
SAFE_SESSION_COMPATIBILITY_FALLBACK_ADDRESS,
|
|
35
|
+
initData: encodeAbiParameters([
|
|
36
|
+
{ name: 'selector', type: 'bytes4' },
|
|
37
|
+
{ name: 'flags', type: 'bytes1' },
|
|
38
|
+
{ name: 'data', type: 'bytes' },
|
|
39
|
+
], ['0x84b0196e', '0xfe', '0x']),
|
|
40
|
+
deInitData: '0x',
|
|
41
|
+
additionalContext: '0x',
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
fallbacks.push(...custom.filter((module) => module.kind === 'fallback'));
|
|
45
|
+
return {
|
|
46
|
+
validators,
|
|
47
|
+
executors,
|
|
48
|
+
fallbacks,
|
|
49
|
+
hooks: custom.filter((module) => module.kind === 'hook'),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
|
+
import type { EvmChainReference } from '../chains/types.js';
|
|
3
|
+
import type { RpcReadPort } from '../clients/rpc/port.js';
|
|
4
|
+
import type { ModuleKind, ResolvedModule } from './types.js';
|
|
5
|
+
export declare function readInstalledModules(input: {
|
|
6
|
+
readonly rpc: RpcReadPort;
|
|
7
|
+
readonly chain: EvmChainReference;
|
|
8
|
+
readonly accountKind: string;
|
|
9
|
+
readonly account: Address;
|
|
10
|
+
readonly kind: Extract<ModuleKind, 'validator' | 'executor'>;
|
|
11
|
+
}): Promise<readonly Address[]>;
|
|
12
|
+
export declare function readValidatorInitialized(input: {
|
|
13
|
+
readonly rpc: RpcReadPort;
|
|
14
|
+
readonly chain: EvmChainReference;
|
|
15
|
+
readonly account: Address;
|
|
16
|
+
readonly validator: Address;
|
|
17
|
+
}): Promise<boolean>;
|
|
18
|
+
export declare function readModuleInstallations(input: {
|
|
19
|
+
readonly rpc: RpcReadPort;
|
|
20
|
+
readonly chain: EvmChainReference;
|
|
21
|
+
readonly account: Address;
|
|
22
|
+
readonly modules: readonly ResolvedModule[];
|
|
23
|
+
}): Promise<readonly boolean[]>;
|
|
24
|
+
export declare function readOwners(input: {
|
|
25
|
+
readonly rpc: RpcReadPort;
|
|
26
|
+
readonly chain: EvmChainReference;
|
|
27
|
+
readonly accountKind: string;
|
|
28
|
+
readonly account: Address;
|
|
29
|
+
readonly hcaFactory?: Address;
|
|
30
|
+
}): Promise<{
|
|
31
|
+
readonly accounts: readonly Address[];
|
|
32
|
+
readonly threshold: number;
|
|
33
|
+
} | null>;
|
|
34
|
+
export declare function encodeAccountModuleDeInitData(input: {
|
|
35
|
+
readonly accountKind: string;
|
|
36
|
+
readonly module: ResolvedModule;
|
|
37
|
+
readonly installed: readonly Address[];
|
|
38
|
+
}): Hex;
|
|
39
|
+
//# sourceMappingURL=read-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-core.d.ts","sourceRoot":"","sources":["../../../modules/read-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAuB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAA;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAyBzD,wBAAsB,oBAAoB,CAAC,KAAK,EAAE;IAChD,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAA;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE,WAAW,GAAG,UAAU,CAAC,CAAA;CAC7D,GAAG,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAmB9B;AAED,wBAAsB,wBAAwB,CAAC,KAAK,EAAE;IACpD,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAA;IACjC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAC5B,GAAG,OAAO,CAAC,OAAO,CAAC,CAkBnB;AAgBD,wBAAsB,uBAAuB,CAAC,KAAK,EAAE;IACnD,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAA;IACjC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAA;CAC5C,GAAG,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAiB9B;AAED,wBAAsB,UAAU,CAAC,KAAK,EAAE;IACtC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAA;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAC9B,GAAG,OAAO,CAAC;IACV,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAA;IACrC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B,GAAG,IAAI,CAAC,CAmER;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;IAC/B,QAAQ,CAAC,SAAS,EAAE,SAAS,OAAO,EAAE,CAAA;CACvC,GAAG,GAAG,CAkBN"}
|