@rhinestone/sdk 2.0.0-beta.44 → 2.0.0-beta.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/accounts/adapter.d.ts +31 -0
- package/dist/src/accounts/adapter.d.ts.map +1 -0
- package/dist/src/accounts/adapters/eoa.d.ts +4 -0
- package/dist/src/accounts/adapters/eoa.d.ts.map +1 -0
- package/dist/src/accounts/adapters/eoa.js +45 -0
- package/dist/src/accounts/adapters/hca.d.ts +5 -0
- package/dist/src/accounts/adapters/hca.d.ts.map +1 -0
- package/dist/src/accounts/adapters/hca.js +118 -0
- package/dist/src/accounts/adapters/kernel.d.ts +9 -0
- package/dist/src/accounts/adapters/kernel.d.ts.map +1 -0
- package/dist/src/accounts/adapters/kernel.js +159 -0
- package/dist/src/accounts/adapters/nexus.d.ts +17 -0
- package/dist/src/accounts/adapters/nexus.d.ts.map +1 -0
- package/dist/src/accounts/adapters/nexus.js +227 -0
- package/dist/src/accounts/adapters/safe.d.ts +6 -0
- package/dist/src/accounts/adapters/safe.d.ts.map +1 -0
- package/dist/src/accounts/adapters/safe.js +194 -0
- package/dist/src/accounts/adapters/shared.d.ts +9 -0
- package/dist/src/accounts/adapters/shared.d.ts.map +1 -0
- package/dist/src/accounts/adapters/shared.js +62 -0
- package/dist/src/accounts/adapters/startale.d.ts +14 -0
- package/dist/src/accounts/adapters/startale.d.ts.map +1 -0
- package/dist/src/accounts/adapters/startale.js +165 -0
- package/dist/src/accounts/construction.d.ts +25 -0
- package/dist/src/accounts/construction.d.ts.map +1 -0
- package/dist/src/accounts/construction.js +34 -0
- package/dist/src/accounts/deployment.d.ts +12 -0
- package/dist/src/accounts/deployment.d.ts.map +1 -0
- package/dist/src/accounts/deployment.js +33 -0
- package/dist/src/accounts/erc7579-calls.d.ts +4 -0
- package/dist/src/accounts/erc7579-calls.d.ts.map +1 -0
- package/dist/src/accounts/erc7579-calls.js +57 -0
- package/dist/src/accounts/error.d.ts +1 -1
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/legacy.d.ts +14 -0
- package/dist/src/accounts/legacy.d.ts.map +1 -0
- package/dist/src/accounts/legacy.js +40 -0
- package/dist/src/accounts/registry.d.ts +4 -0
- package/dist/src/accounts/registry.d.ts.map +1 -0
- package/dist/src/accounts/registry.js +22 -0
- package/dist/src/accounts/types.d.ts +131 -0
- package/dist/src/accounts/types.d.ts.map +1 -0
- package/dist/src/accounts/wallet-account.d.ts +3 -0
- package/dist/src/accounts/wallet-account.d.ts.map +1 -0
- package/dist/src/accounts/wallet-account.js +12 -0
- package/dist/src/actions/deploy.d.ts +4 -0
- package/dist/src/actions/deploy.d.ts.map +1 -0
- package/dist/src/actions/deploy.js +8 -0
- package/dist/src/actions/ecdsa.d.ts +1 -1
- package/dist/src/actions/ecdsa.d.ts.map +1 -1
- package/dist/src/actions/ecdsa.js +8 -8
- package/dist/src/actions/index.d.ts +2 -16
- package/dist/src/actions/index.d.ts.map +1 -1
- package/dist/src/actions/index.js +3 -49
- package/dist/src/actions/mfa.d.ts +1 -1
- package/dist/src/actions/mfa.d.ts.map +1 -1
- package/dist/src/actions/mfa.js +30 -10
- package/dist/src/actions/modules.d.ts +4 -0
- package/dist/src/actions/modules.d.ts.map +1 -0
- package/dist/src/actions/modules.js +22 -0
- package/dist/src/actions/passkeys.d.ts +2 -2
- package/dist/src/actions/passkeys.d.ts.map +1 -1
- package/dist/src/actions/passkeys.js +19 -14
- package/dist/src/actions/runtime.d.ts +12 -0
- package/dist/src/actions/runtime.d.ts.map +1 -0
- package/dist/src/actions/runtime.js +161 -0
- package/dist/src/actions/smart-sessions.d.ts +2 -2
- package/dist/src/actions/smart-sessions.d.ts.map +1 -1
- package/dist/src/actions/smart-sessions.js +35 -12
- package/dist/src/api/account.d.ts +265 -0
- package/dist/src/api/account.d.ts.map +1 -0
- package/dist/src/api/account.js +640 -0
- package/dist/src/api/accounts.d.ts +12 -0
- package/dist/src/api/accounts.d.ts.map +1 -0
- package/dist/src/api/accounts.js +17 -0
- package/dist/src/api/compose-types.d.ts +147 -0
- package/dist/src/api/compose-types.d.ts.map +1 -0
- package/dist/src/api/compose.d.ts +6 -0
- package/dist/src/api/compose.d.ts.map +1 -0
- package/dist/src/api/compose.js +766 -0
- package/dist/src/api/direct-signing.d.ts +27 -0
- package/dist/src/api/direct-signing.d.ts.map +1 -0
- package/dist/src/api/direct-signing.js +191 -0
- package/dist/src/api/project-mappers.d.ts +7 -0
- package/dist/src/api/project-mappers.d.ts.map +1 -0
- package/dist/src/api/project-mappers.js +23 -0
- package/dist/src/api/queries/app-fees.d.ts +4 -0
- package/dist/src/api/queries/app-fees.d.ts.map +1 -0
- package/dist/src/api/queries/app-fees.js +3 -0
- package/dist/src/api/queries/portfolio.d.ts +9 -0
- package/dist/src/api/queries/portfolio.d.ts.map +1 -0
- package/dist/src/api/queries/portfolio.js +28 -0
- package/dist/src/api/queries/session.d.ts +8 -0
- package/dist/src/api/queries/session.d.ts.map +1 -0
- package/dist/src/api/queries/session.js +15 -0
- package/dist/src/api/sdk.d.ts +80 -0
- package/dist/src/api/sdk.d.ts.map +1 -0
- package/dist/src/api/sdk.js +103 -0
- package/dist/src/api/signer-selection.d.ts +7 -0
- package/dist/src/api/signer-selection.d.ts.map +1 -0
- package/dist/src/api/signer-selection.js +109 -0
- package/dist/src/calls/normalize.d.ts +9 -0
- package/dist/src/calls/normalize.d.ts.map +1 -0
- package/dist/src/calls/normalize.js +17 -0
- package/dist/src/calls/resolve.d.ts +3 -0
- package/dist/src/calls/resolve.d.ts.map +1 -0
- package/dist/src/calls/resolve.js +15 -0
- package/dist/src/calls/types.d.ts +25 -0
- package/dist/src/calls/types.d.ts.map +1 -0
- package/dist/src/calls/types.js +1 -0
- package/dist/src/chains/caip2.d.ts +10 -0
- package/dist/src/chains/caip2.d.ts.map +1 -0
- package/dist/src/chains/caip2.js +85 -0
- package/dist/src/chains/catalog.d.ts +5 -0
- package/dist/src/chains/catalog.d.ts.map +1 -0
- package/dist/src/chains/catalog.js +41 -0
- package/dist/src/chains/errors.d.ts +15 -0
- package/dist/src/chains/errors.d.ts.map +1 -0
- package/dist/src/chains/errors.js +21 -0
- package/dist/src/{orchestrator/destinations.d.ts → chains/non-evm.d.ts} +7 -5
- package/dist/src/chains/non-evm.d.ts.map +1 -0
- package/dist/src/chains/non-evm.js +30 -0
- package/dist/src/chains/tokens.d.ts +4 -0
- package/dist/src/chains/tokens.d.ts.map +1 -0
- package/dist/src/chains/tokens.js +22 -0
- package/dist/src/chains/types.d.ts +25 -0
- package/dist/src/chains/types.d.ts.map +1 -0
- package/dist/src/chains/types.js +1 -0
- package/dist/src/clients/bundler/client.d.ts +10 -0
- package/dist/src/clients/bundler/client.d.ts.map +1 -0
- package/dist/src/clients/bundler/client.js +85 -0
- package/dist/src/clients/bundler/endpoints.d.ts +3 -0
- package/dist/src/clients/bundler/endpoints.d.ts.map +1 -0
- package/dist/src/clients/bundler/endpoints.js +18 -0
- package/dist/src/clients/bundler/port.d.ts +22 -0
- package/dist/src/clients/bundler/port.d.ts.map +1 -0
- package/dist/src/clients/bundler/port.js +1 -0
- package/dist/src/clients/json-rpc.d.ts +20 -0
- package/dist/src/clients/json-rpc.d.ts.map +1 -0
- package/dist/src/clients/json-rpc.js +56 -0
- package/dist/src/clients/orchestrator/auth.d.ts +7 -0
- package/dist/src/clients/orchestrator/auth.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/auth.js +27 -0
- package/dist/src/{orchestrator → clients/orchestrator}/chain-catalog.d.ts +5 -3
- package/dist/src/clients/orchestrator/chain-catalog.d.ts.map +1 -0
- package/dist/src/{orchestrator → clients/orchestrator}/chain-catalog.js +24 -3
- package/dist/src/clients/orchestrator/client.d.ts +13 -0
- package/dist/src/clients/orchestrator/client.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/client.js +97 -0
- package/dist/src/{orchestrator/error.d.ts → clients/orchestrator/errors.d.ts} +2 -16
- package/dist/src/clients/orchestrator/errors.d.ts.map +1 -0
- package/dist/src/{orchestrator/error.js → clients/orchestrator/errors.js} +1 -22
- package/dist/src/clients/orchestrator/fetch.d.ts +7 -0
- package/dist/src/clients/orchestrator/fetch.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/fetch.js +37 -0
- package/dist/src/clients/orchestrator/mappers.d.ts +9 -0
- package/dist/src/clients/orchestrator/mappers.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/mappers.js +198 -0
- package/dist/src/clients/orchestrator/port.d.ts +26 -0
- package/dist/src/clients/orchestrator/port.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/port.js +1 -0
- package/dist/src/{orchestrator/types.d.ts → clients/orchestrator/public.d.ts} +16 -4
- package/dist/src/clients/orchestrator/public.d.ts.map +1 -0
- package/dist/src/{orchestrator/types.js → clients/orchestrator/public.js} +3 -0
- package/dist/src/clients/orchestrator/types.d.ts +144 -0
- package/dist/src/clients/orchestrator/types.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/types.js +1 -0
- package/dist/src/clients/orchestrator/wire.d.ts +19 -0
- package/dist/src/clients/orchestrator/wire.d.ts.map +1 -0
- package/dist/src/{orchestrator → clients/orchestrator}/wire.gen.d.ts +1193 -499
- package/dist/src/clients/orchestrator/wire.gen.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/wire.gen.js +1 -0
- package/dist/src/clients/orchestrator/wire.js +1 -0
- package/dist/src/clients/paymaster/client.d.ts +8 -0
- package/dist/src/clients/paymaster/client.d.ts.map +1 -0
- package/dist/src/clients/paymaster/client.js +38 -0
- package/dist/src/clients/paymaster/endpoints.d.ts +3 -0
- package/dist/src/clients/paymaster/endpoints.d.ts.map +1 -0
- package/dist/src/clients/paymaster/endpoints.js +16 -0
- package/dist/src/clients/paymaster/port.d.ts +17 -0
- package/dist/src/clients/paymaster/port.d.ts.map +1 -0
- package/dist/src/clients/paymaster/port.js +1 -0
- package/dist/src/clients/rpc/client.d.ts +6 -0
- package/dist/src/clients/rpc/client.d.ts.map +1 -0
- package/dist/src/clients/rpc/client.js +66 -0
- package/dist/src/clients/rpc/compatibility.d.ts +12 -0
- package/dist/src/clients/rpc/compatibility.d.ts.map +1 -0
- package/dist/src/clients/rpc/compatibility.js +16 -0
- package/dist/src/clients/rpc/port.d.ts +13 -0
- package/dist/src/clients/rpc/port.d.ts.map +1 -0
- package/dist/src/clients/rpc/port.js +1 -0
- package/dist/src/clients/rpc/providers.d.ts +3 -0
- package/dist/src/clients/rpc/providers.d.ts.map +1 -0
- package/dist/src/clients/rpc/providers.js +8 -0
- package/dist/src/clients/rpc/transport.d.ts +4 -0
- package/dist/src/clients/rpc/transport.d.ts.map +1 -0
- package/dist/src/clients/rpc/transport.js +5 -0
- package/dist/src/clients/rpc/types.d.ts +23 -0
- package/dist/src/clients/rpc/types.d.ts.map +1 -0
- package/dist/src/clients/rpc/types.js +1 -0
- package/dist/src/config/account-runtime.d.ts +7 -0
- package/dist/src/config/account-runtime.d.ts.map +1 -0
- package/dist/src/config/account-runtime.js +36 -0
- package/dist/src/{types.d.ts → config/account.d.ts} +37 -14
- package/dist/src/config/account.d.ts.map +1 -0
- package/dist/src/config/account.js +10 -0
- package/dist/src/config/defaults.d.ts +14 -0
- package/dist/src/config/defaults.d.ts.map +1 -0
- package/dist/src/config/defaults.js +26 -0
- package/dist/src/config/input.d.ts +54 -0
- package/dist/src/config/input.d.ts.map +1 -0
- package/dist/src/config/input.js +1 -0
- package/dist/src/config/legacy.d.ts +22 -0
- package/dist/src/config/legacy.d.ts.map +1 -0
- package/dist/src/config/legacy.js +23 -0
- package/dist/src/config/resolve.d.ts +13 -0
- package/dist/src/config/resolve.d.ts.map +1 -0
- package/dist/src/config/resolve.js +174 -0
- package/dist/src/config/resolved.d.ts +77 -0
- package/dist/src/config/resolved.d.ts.map +1 -0
- package/dist/src/config/resolved.js +1 -0
- package/dist/src/config/validate.d.ts +3 -0
- package/dist/src/config/validate.d.ts.map +1 -0
- package/dist/src/config/validate.js +6 -0
- package/dist/src/{execution/error.d.ts → errors/execution.d.ts} +2 -2
- package/dist/src/errors/execution.d.ts.map +1 -0
- package/dist/src/{execution/error.js → errors/execution.js} +1 -1
- package/dist/src/errors/index.d.ts +4 -4
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +4 -3
- package/dist/src/index.d.ts +13 -324
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -286
- package/dist/src/modules/erc7579-abi.d.ts +4 -0
- package/dist/src/modules/erc7579-abi.d.ts.map +1 -0
- package/dist/src/modules/erc7579-abi.js +12 -0
- package/dist/src/modules/intent-executor.d.ts +6 -0
- package/dist/src/modules/intent-executor.d.ts.map +1 -0
- package/dist/src/modules/intent-executor.js +13 -0
- package/dist/src/modules/legacy-core.d.ts +29 -0
- package/dist/src/modules/legacy-core.d.ts.map +1 -0
- package/dist/src/modules/legacy-core.js +80 -0
- package/dist/src/modules/normalize.d.ts +4 -0
- package/dist/src/modules/normalize.d.ts.map +1 -0
- package/dist/src/modules/normalize.js +15 -0
- package/dist/src/modules/plan.d.ts +16 -0
- package/dist/src/modules/plan.d.ts.map +1 -0
- package/dist/src/modules/plan.js +51 -0
- package/dist/src/modules/read-core.d.ts +39 -0
- package/dist/src/modules/read-core.d.ts.map +1 -0
- package/dist/src/modules/read-core.js +149 -0
- package/dist/src/modules/types.d.ts +46 -0
- package/dist/src/modules/types.d.ts.map +1 -0
- package/dist/src/modules/types.js +1 -0
- package/dist/src/modules/validators/capabilities.d.ts +4 -0
- package/dist/src/modules/validators/capabilities.d.ts.map +1 -0
- package/dist/src/modules/validators/capabilities.js +58 -0
- package/dist/src/modules/validators/contribution.d.ts +4 -0
- package/dist/src/modules/validators/contribution.d.ts.map +1 -0
- package/dist/src/modules/validators/contribution.js +64 -0
- package/dist/src/modules/validators/definition.d.ts +3 -0
- package/dist/src/modules/validators/definition.d.ts.map +1 -0
- package/dist/src/modules/validators/definition.js +68 -0
- package/dist/src/modules/validators/ens.d.ts +5 -0
- package/dist/src/modules/validators/ens.d.ts.map +1 -0
- package/dist/src/modules/validators/ens.js +34 -0
- package/dist/src/modules/validators/k1.d.ts +2 -0
- package/dist/src/modules/validators/k1.d.ts.map +1 -0
- package/dist/src/modules/validators/k1.js +1 -0
- package/dist/src/modules/validators/multi-factor.d.ts +18 -0
- package/dist/src/modules/validators/multi-factor.d.ts.map +1 -0
- package/dist/src/modules/validators/multi-factor.js +79 -0
- package/dist/src/modules/validators/ownable.d.ts +26 -0
- package/dist/src/modules/validators/ownable.d.ts.map +1 -0
- package/dist/src/modules/validators/ownable.js +84 -0
- package/dist/src/modules/validators/permissions.d.ts +1 -1
- package/dist/src/modules/validators/permissions.d.ts.map +1 -1
- package/dist/src/modules/validators/policies/claim/arbiters.d.ts +1 -1
- package/dist/src/modules/validators/policies/claim/arbiters.d.ts.map +1 -1
- package/dist/src/modules/validators/policies/claim/arbiters.js +3 -1
- package/dist/src/modules/validators/resolve.d.ts +5 -0
- package/dist/src/modules/validators/resolve.d.ts.map +1 -0
- package/dist/src/modules/validators/resolve.js +22 -0
- package/dist/src/modules/validators/signer-id.d.ts +5 -0
- package/dist/src/modules/validators/signer-id.d.ts.map +1 -0
- package/dist/src/modules/validators/signer-id.js +8 -0
- package/dist/src/modules/validators/smart-session-signature-types.d.ts +35 -0
- package/dist/src/modules/validators/smart-session-signature-types.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-session-signature-types.js +1 -0
- package/dist/src/modules/validators/smart-sessions/authorization.d.ts +99 -0
- package/dist/src/modules/validators/smart-sessions/authorization.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/authorization.js +101 -0
- package/dist/src/modules/validators/smart-sessions/calls.d.ts +19 -0
- package/dist/src/modules/validators/smart-sessions/calls.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/calls.js +85 -0
- package/dist/src/modules/validators/smart-sessions/cross-chain-permits.d.ts +4 -0
- package/dist/src/modules/validators/smart-sessions/cross-chain-permits.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/cross-chain-permits.js +77 -0
- package/dist/src/modules/validators/smart-sessions/digest.d.ts +5 -0
- package/dist/src/modules/validators/smart-sessions/digest.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/digest.js +30 -0
- package/dist/src/modules/validators/smart-sessions/mock-signature.d.ts +10 -0
- package/dist/src/modules/validators/smart-sessions/mock-signature.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/mock-signature.js +31 -0
- package/dist/src/modules/validators/smart-sessions/module.d.ts +11 -0
- package/dist/src/modules/validators/smart-sessions/module.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/module.js +18 -0
- package/dist/src/modules/validators/smart-sessions/policies/addresses.d.ts +23 -0
- package/dist/src/modules/validators/smart-sessions/policies/addresses.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/policies/addresses.js +29 -0
- package/dist/src/modules/validators/smart-sessions/policies/claim.d.ts +10 -0
- package/dist/src/modules/validators/smart-sessions/policies/claim.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/policies/claim.js +106 -0
- package/dist/src/modules/validators/smart-sessions/policies/encode.d.ts +4 -0
- package/dist/src/modules/validators/smart-sessions/policies/encode.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/policies/encode.js +197 -0
- package/dist/src/modules/validators/smart-sessions/resolve.d.ts +16 -0
- package/dist/src/modules/validators/smart-sessions/resolve.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/resolve.js +120 -0
- package/dist/src/modules/validators/smart-sessions/signature.d.ts +14 -0
- package/dist/src/modules/validators/smart-sessions/signature.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/signature.js +167 -0
- package/dist/src/modules/validators/smart-sessions/state.d.ts +19 -0
- package/dist/src/modules/validators/smart-sessions/state.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/state.js +42 -0
- package/dist/src/modules/validators/smart-sessions/types.d.ts +227 -0
- package/dist/src/modules/validators/smart-sessions/types.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/types.js +1 -0
- package/dist/src/modules/validators/types.d.ts +143 -0
- package/dist/src/modules/validators/types.d.ts.map +1 -0
- package/dist/src/modules/validators/types.js +1 -0
- package/dist/src/modules/validators/webauthn.d.ts +54 -0
- package/dist/src/modules/validators/webauthn.d.ts.map +1 -0
- package/dist/src/modules/validators/webauthn.js +159 -0
- package/dist/src/signing/context.d.ts +25 -0
- package/dist/src/signing/context.d.ts.map +1 -0
- package/dist/src/signing/context.js +163 -0
- package/dist/src/signing/contribution.d.ts +13 -0
- package/dist/src/signing/contribution.d.ts.map +1 -0
- package/dist/src/signing/contribution.js +83 -0
- package/dist/src/signing/eip7702.d.ts +41 -0
- package/dist/src/signing/eip7702.d.ts.map +1 -0
- package/dist/src/signing/eip7702.js +215 -0
- package/dist/src/signing/error.d.ts +27 -0
- package/dist/src/signing/error.d.ts.map +1 -0
- package/dist/src/signing/error.js +25 -0
- package/dist/src/signing/execute.d.ts +17 -0
- package/dist/src/signing/execute.d.ts.map +1 -0
- package/dist/src/signing/execute.js +138 -0
- package/dist/src/signing/intent-plans/assemble.d.ts +15 -0
- package/dist/src/signing/intent-plans/assemble.d.ts.map +1 -0
- package/dist/src/signing/intent-plans/assemble.js +96 -0
- package/dist/src/signing/intent-plans/independent.d.ts +48 -0
- package/dist/src/signing/intent-plans/independent.d.ts.map +1 -0
- package/dist/src/signing/intent-plans/independent.js +150 -0
- package/dist/src/signing/intent-plans/plan.d.ts +14 -0
- package/dist/src/signing/intent-plans/plan.d.ts.map +1 -0
- package/dist/src/signing/intent-plans/plan.js +187 -0
- package/dist/src/signing/intent-plans/types.d.ts +63 -0
- package/dist/src/signing/intent-plans/types.d.ts.map +1 -0
- package/dist/src/signing/intent-plans/types.js +1 -0
- package/dist/src/signing/message.d.ts +28 -0
- package/dist/src/signing/message.d.ts.map +1 -0
- package/dist/src/signing/message.js +90 -0
- package/dist/src/signing/passkeys.d.ts +28 -0
- package/dist/src/signing/passkeys.d.ts.map +1 -0
- package/dist/src/signing/passkeys.js +17 -0
- package/dist/src/signing/plan.d.ts +35 -0
- package/dist/src/signing/plan.d.ts.map +1 -0
- package/dist/src/signing/plan.js +377 -0
- package/dist/src/signing/protocols/erc6492.d.ts +11 -0
- package/dist/src/signing/protocols/erc6492.d.ts.map +1 -0
- package/dist/src/signing/protocols/erc6492.js +24 -0
- package/dist/src/signing/protocols/erc7739.d.ts +17 -0
- package/dist/src/signing/protocols/erc7739.d.ts.map +1 -0
- package/dist/src/signing/protocols/erc7739.js +84 -0
- package/dist/src/signing/session-enable.d.ts +35 -0
- package/dist/src/signing/session-enable.d.ts.map +1 -0
- package/dist/src/signing/session-enable.js +62 -0
- package/dist/src/signing/signers/compatibility.d.ts +4 -0
- package/dist/src/signing/signers/compatibility.d.ts.map +1 -0
- package/dist/src/signing/signers/compatibility.js +51 -0
- package/dist/src/signing/signers/ecdsa.d.ts +14 -0
- package/dist/src/signing/signers/ecdsa.d.ts.map +1 -0
- package/dist/src/signing/signers/ecdsa.js +54 -0
- package/dist/src/signing/signers/registry.d.ts +7 -0
- package/dist/src/signing/signers/registry.d.ts.map +1 -0
- package/dist/src/signing/signers/registry.js +33 -0
- package/dist/src/signing/signers/types.d.ts +16 -0
- package/dist/src/signing/signers/types.d.ts.map +1 -0
- package/dist/src/signing/signers/types.js +1 -0
- package/dist/src/signing/signers/wallet-chain.d.ts +9 -0
- package/dist/src/signing/signers/wallet-chain.d.ts.map +1 -0
- package/dist/src/signing/signers/wallet-chain.js +15 -0
- package/dist/src/signing/signers/webauthn.d.ts +11 -0
- package/dist/src/signing/signers/webauthn.d.ts.map +1 -0
- package/dist/src/signing/signers/webauthn.js +14 -0
- package/dist/src/signing/typed-data.d.ts +39 -0
- package/dist/src/signing/typed-data.d.ts.map +1 -0
- package/dist/src/signing/typed-data.js +135 -0
- package/dist/src/signing/types.d.ts +346 -0
- package/dist/src/signing/types.d.ts.map +1 -0
- package/dist/src/signing/types.js +1 -0
- package/dist/src/signing/user-operation.d.ts +23 -0
- package/dist/src/signing/user-operation.d.ts.map +1 -0
- package/dist/src/signing/user-operation.js +61 -0
- package/dist/src/smart-sessions/index.d.ts +13 -3
- package/dist/src/smart-sessions/index.d.ts.map +1 -1
- package/dist/src/smart-sessions/index.js +44 -6
- package/dist/src/transactions/intents/account.d.ts +15 -0
- package/dist/src/transactions/intents/account.d.ts.map +1 -0
- package/dist/src/transactions/intents/account.js +48 -0
- package/dist/src/transactions/intents/compatibility.d.ts +4 -0
- package/dist/src/transactions/intents/compatibility.d.ts.map +1 -0
- package/dist/src/transactions/intents/compatibility.js +19 -0
- package/dist/src/transactions/intents/normalize.d.ts +5 -0
- package/dist/src/transactions/intents/normalize.d.ts.map +1 -0
- package/dist/src/transactions/intents/normalize.js +48 -0
- package/dist/src/transactions/intents/prepare.d.ts +7 -0
- package/dist/src/transactions/intents/prepare.d.ts.map +1 -0
- package/dist/src/transactions/intents/prepare.js +249 -0
- package/dist/src/transactions/intents/quotes.d.ts +3 -0
- package/dist/src/transactions/intents/quotes.d.ts.map +1 -0
- package/dist/src/transactions/intents/quotes.js +11 -0
- package/dist/src/transactions/intents/request.d.ts +11 -0
- package/dist/src/transactions/intents/request.d.ts.map +1 -0
- package/dist/src/transactions/intents/request.js +55 -0
- package/dist/src/transactions/intents/send.d.ts +3 -0
- package/dist/src/transactions/intents/send.d.ts.map +1 -0
- package/dist/src/transactions/intents/send.js +22 -0
- package/dist/src/transactions/intents/session-signing.d.ts +7 -0
- package/dist/src/transactions/intents/session-signing.d.ts.map +1 -0
- package/dist/src/transactions/intents/session-signing.js +363 -0
- package/dist/src/transactions/intents/sessions.d.ts +17 -0
- package/dist/src/transactions/intents/sessions.d.ts.map +1 -0
- package/dist/src/transactions/intents/sessions.js +85 -0
- package/dist/src/transactions/intents/sign-transaction.d.ts +10 -0
- package/dist/src/transactions/intents/sign-transaction.d.ts.map +1 -0
- package/dist/src/transactions/intents/sign-transaction.js +386 -0
- package/dist/src/transactions/intents/split.d.ts +13 -0
- package/dist/src/transactions/intents/split.d.ts.map +1 -0
- package/dist/src/transactions/intents/split.js +3 -0
- package/dist/src/transactions/intents/status-policy.d.ts +13 -0
- package/dist/src/transactions/intents/status-policy.d.ts.map +1 -0
- package/dist/src/transactions/intents/status-policy.js +39 -0
- package/dist/src/transactions/intents/status.d.ts +4 -0
- package/dist/src/transactions/intents/status.d.ts.map +1 -0
- package/dist/src/transactions/intents/status.js +50 -0
- package/dist/src/transactions/intents/submit.d.ts +3 -0
- package/dist/src/transactions/intents/submit.d.ts.map +1 -0
- package/dist/src/transactions/intents/submit.js +32 -0
- package/dist/src/transactions/intents/types.d.ts +136 -0
- package/dist/src/transactions/intents/types.d.ts.map +1 -0
- package/dist/src/transactions/intents/types.js +1 -0
- package/dist/src/transactions/user-operations/hash.d.ts +5 -0
- package/dist/src/transactions/user-operations/hash.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/hash.js +9 -0
- package/dist/src/transactions/user-operations/nonce.d.ts +18 -0
- package/dist/src/transactions/user-operations/nonce.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/nonce.js +43 -0
- package/dist/src/transactions/user-operations/prepare.d.ts +12 -0
- package/dist/src/transactions/user-operations/prepare.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/prepare.js +138 -0
- package/dist/src/transactions/user-operations/reconstruct.d.ts +28 -0
- package/dist/src/transactions/user-operations/reconstruct.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/reconstruct.js +52 -0
- package/dist/src/transactions/user-operations/send.d.ts +3 -0
- package/dist/src/transactions/user-operations/send.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/send.js +8 -0
- package/dist/src/transactions/user-operations/sign.d.ts +3 -0
- package/dist/src/transactions/user-operations/sign.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/sign.js +14 -0
- package/dist/src/transactions/user-operations/status.d.ts +4 -0
- package/dist/src/transactions/user-operations/status.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/status.js +37 -0
- package/dist/src/transactions/user-operations/submit.d.ts +3 -0
- package/dist/src/transactions/user-operations/submit.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/submit.js +8 -0
- package/dist/src/transactions/user-operations/types.d.ts +68 -0
- package/dist/src/transactions/user-operations/types.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/types.js +1 -0
- package/dist/src/transactions/user-operations/validator-account.d.ts +5 -0
- package/dist/src/transactions/user-operations/validator-account.d.ts.map +1 -0
- package/dist/src/transactions/user-operations/validator-account.js +26 -0
- package/dist/src/utils/index.d.ts +9 -4
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +54 -51
- package/package.json +3 -3
- package/dist/src/accounts/hca.d.ts +0 -25
- package/dist/src/accounts/hca.d.ts.map +0 -1
- package/dist/src/accounts/hca.js +0 -148
- package/dist/src/accounts/index.d.ts +0 -64
- package/dist/src/accounts/index.d.ts.map +0 -1
- package/dist/src/accounts/index.js +0 -680
- package/dist/src/accounts/json-rpc/index.d.ts +0 -5
- package/dist/src/accounts/json-rpc/index.d.ts.map +0 -1
- package/dist/src/accounts/json-rpc/index.js +0 -13
- package/dist/src/accounts/json-rpc/providers.d.ts +0 -3
- package/dist/src/accounts/json-rpc/providers.d.ts.map +0 -1
- package/dist/src/accounts/json-rpc/providers.js +0 -4
- package/dist/src/accounts/kernel.d.ts +0 -26
- package/dist/src/accounts/kernel.d.ts.map +0 -1
- package/dist/src/accounts/kernel.js +0 -265
- package/dist/src/accounts/nexus.d.ts +0 -34
- package/dist/src/accounts/nexus.d.ts.map +0 -1
- package/dist/src/accounts/nexus.js +0 -520
- package/dist/src/accounts/safe.d.ts +0 -32
- package/dist/src/accounts/safe.d.ts.map +0 -1
- package/dist/src/accounts/safe.js +0 -337
- package/dist/src/accounts/signing/common.d.ts +0 -38
- package/dist/src/accounts/signing/common.d.ts.map +0 -1
- package/dist/src/accounts/signing/common.js +0 -186
- package/dist/src/accounts/signing/message.d.ts +0 -7
- package/dist/src/accounts/signing/message.d.ts.map +0 -1
- package/dist/src/accounts/signing/message.js +0 -42
- package/dist/src/accounts/signing/passkeys.d.ts +0 -36
- package/dist/src/accounts/signing/passkeys.d.ts.map +0 -1
- package/dist/src/accounts/signing/passkeys.js +0 -119
- package/dist/src/accounts/signing/typedData.d.ts +0 -5
- package/dist/src/accounts/signing/typedData.d.ts.map +0 -1
- package/dist/src/accounts/signing/typedData.js +0 -30
- package/dist/src/accounts/startale.d.ts +0 -25
- package/dist/src/accounts/startale.d.ts.map +0 -1
- package/dist/src/accounts/startale.js +0 -188
- package/dist/src/accounts/utils.d.ts +0 -33
- package/dist/src/accounts/utils.d.ts.map +0 -1
- package/dist/src/accounts/utils.js +0 -202
- package/dist/src/auth/provider.d.ts +0 -7
- package/dist/src/auth/provider.d.ts.map +0 -1
- package/dist/src/auth/provider.js +0 -38
- package/dist/src/execution/compact.d.ts +0 -5
- package/dist/src/execution/compact.d.ts.map +0 -1
- package/dist/src/execution/compact.js +0 -4
- package/dist/src/execution/error.d.ts.map +0 -1
- package/dist/src/execution/index.d.ts +0 -42
- package/dist/src/execution/index.d.ts.map +0 -1
- package/dist/src/execution/index.js +0 -186
- package/dist/src/execution/utils.d.ts +0 -167
- package/dist/src/execution/utils.d.ts.map +0 -1
- package/dist/src/execution/utils.js +0 -1603
- package/dist/src/modules/abi/smart-sessions.d.ts +0 -104
- package/dist/src/modules/abi/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/abi/smart-sessions.js +0 -128
- package/dist/src/modules/chain-abstraction.d.ts +0 -5
- package/dist/src/modules/chain-abstraction.d.ts.map +0 -1
- package/dist/src/modules/chain-abstraction.js +0 -3
- package/dist/src/modules/common.d.ts +0 -30
- package/dist/src/modules/common.d.ts.map +0 -1
- package/dist/src/modules/common.js +0 -30
- package/dist/src/modules/index.d.ts +0 -11
- package/dist/src/modules/index.d.ts.map +0 -1
- package/dist/src/modules/index.js +0 -85
- package/dist/src/modules/legacy.d.ts +0 -10
- package/dist/src/modules/legacy.d.ts.map +0 -1
- package/dist/src/modules/legacy.js +0 -62
- package/dist/src/modules/read.d.ts +0 -11
- package/dist/src/modules/read.d.ts.map +0 -1
- package/dist/src/modules/read.js +0 -219
- package/dist/src/modules/validators/core.d.ts +0 -31
- package/dist/src/modules/validators/core.d.ts.map +0 -1
- package/dist/src/modules/validators/core.js +0 -269
- package/dist/src/modules/validators/cross-chain-permits.d.ts +0 -22
- package/dist/src/modules/validators/cross-chain-permits.d.ts.map +0 -1
- package/dist/src/modules/validators/cross-chain-permits.js +0 -107
- package/dist/src/modules/validators/index.d.ts +0 -4
- package/dist/src/modules/validators/index.d.ts.map +0 -1
- package/dist/src/modules/validators/index.js +0 -3
- package/dist/src/modules/validators/smart-sessions.d.ts +0 -226
- package/dist/src/modules/validators/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/validators/smart-sessions.js +0 -1197
- package/dist/src/orchestrator/caip2.d.ts +0 -18
- package/dist/src/orchestrator/caip2.d.ts.map +0 -1
- package/dist/src/orchestrator/caip2.js +0 -58
- package/dist/src/orchestrator/chain-catalog.d.ts.map +0 -1
- package/dist/src/orchestrator/client.d.ts +0 -43
- package/dist/src/orchestrator/client.d.ts.map +0 -1
- package/dist/src/orchestrator/client.js +0 -336
- package/dist/src/orchestrator/consts.d.ts +0 -6
- package/dist/src/orchestrator/consts.d.ts.map +0 -1
- package/dist/src/orchestrator/consts.js +0 -5
- package/dist/src/orchestrator/destinations.d.ts.map +0 -1
- package/dist/src/orchestrator/destinations.js +0 -59
- package/dist/src/orchestrator/error.d.ts.map +0 -1
- package/dist/src/orchestrator/index.d.ts +0 -12
- package/dist/src/orchestrator/index.d.ts.map +0 -1
- package/dist/src/orchestrator/index.js +0 -9
- package/dist/src/orchestrator/registry.d.ts +0 -7
- package/dist/src/orchestrator/registry.d.ts.map +0 -1
- package/dist/src/orchestrator/registry.js +0 -46
- package/dist/src/orchestrator/types.d.ts.map +0 -1
- package/dist/src/orchestrator/utils.d.ts +0 -3
- package/dist/src/orchestrator/utils.d.ts.map +0 -1
- package/dist/src/orchestrator/utils.js +0 -22
- package/dist/src/orchestrator/wire.d.ts +0 -31
- package/dist/src/orchestrator/wire.d.ts.map +0 -1
- package/dist/src/orchestrator/wire.gen.d.ts.map +0 -1
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/utils/walletClient.d.ts +0 -34
- package/dist/src/utils/walletClient.d.ts.map +0 -1
- package/dist/src/utils/walletClient.js +0 -117
- /package/dist/src/{orchestrator/wire.gen.js → accounts/adapter.js} +0 -0
- /package/dist/src/{types.js → accounts/types.js} +0 -0
- /package/dist/src/{orchestrator/wire.js → api/compose-types.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../transactions/intents/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAsB,MAAM,MAAM,CAAA;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAIzE,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,mBAAmB,GAC7B,mBAAmB,CAUrB;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,iBAAiB,GACvB,iBAAiB,CAenB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export function normalizeIntentTypedData(typedData) {
|
|
2
|
+
const types = typedData.types;
|
|
3
|
+
return {
|
|
4
|
+
...typedData,
|
|
5
|
+
message: normalizeTypedDataMessage(types, typedData.primaryType, typedData.message),
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export function normalizeIntentQuote(quote) {
|
|
9
|
+
return {
|
|
10
|
+
...quote,
|
|
11
|
+
signData: {
|
|
12
|
+
origin: quote.signData.origin.map(normalizeIntentTypedData),
|
|
13
|
+
destination: normalizeIntentTypedData(quote.signData.destination),
|
|
14
|
+
...(quote.signData.targetExecution
|
|
15
|
+
? {
|
|
16
|
+
targetExecution: normalizeIntentTypedData(quote.signData.targetExecution),
|
|
17
|
+
}
|
|
18
|
+
: {}),
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function normalizeTypedDataMessage(types, primaryType, message) {
|
|
23
|
+
const fields = types[primaryType];
|
|
24
|
+
if (!fields)
|
|
25
|
+
return message;
|
|
26
|
+
return Object.fromEntries(Object.entries(message).map(([name, value]) => {
|
|
27
|
+
const type = fields.find((field) => field.name === name)?.type;
|
|
28
|
+
return [name, type ? normalizeTypedDataValue(types, type, value) : value];
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
function normalizeTypedDataValue(types, type, value) {
|
|
32
|
+
if (value === null || value === undefined)
|
|
33
|
+
return value;
|
|
34
|
+
const array = type.match(/^(.+)\[\d*\]$/u);
|
|
35
|
+
if (array) {
|
|
36
|
+
return Array.isArray(value)
|
|
37
|
+
? value.map((item) => normalizeTypedDataValue(types, array[1], item))
|
|
38
|
+
: value;
|
|
39
|
+
}
|
|
40
|
+
if (/^u?int\d*$/u.test(type)) {
|
|
41
|
+
return typeof value === 'string' || typeof value === 'number'
|
|
42
|
+
? BigInt(value)
|
|
43
|
+
: value;
|
|
44
|
+
}
|
|
45
|
+
return types[type]
|
|
46
|
+
? normalizeTypedDataMessage(types, type, value)
|
|
47
|
+
: value;
|
|
48
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AccountRuntime } from '../../accounts/adapter.js';
|
|
2
|
+
import type { EvmChainReference } from '../../chains/types.js';
|
|
3
|
+
import type { IntentSigningInput } from '../../signing/intent-plans/types.js';
|
|
4
|
+
import type { IntentInput, IntentWorkflowContext, PreparedIntent } from './types.js';
|
|
5
|
+
export declare function prepareIntent<CompatibilityConfig>(context: IntentWorkflowContext<CompatibilityConfig>, input: IntentInput<CompatibilityConfig>): Promise<PreparedIntent<CompatibilityConfig>>;
|
|
6
|
+
export declare function buildIntentSigningInput(runtime: AccountRuntime, quote: PreparedIntent['quote'], sessions?: PreparedIntent['resolvedSessions'], destination?: EvmChainReference, ownerValidator?: import('../../modules/validators/types.js').ResolvedValidatorDefinition, selectedSignerIds?: readonly string[]): IntentSigningInput;
|
|
7
|
+
//# sourceMappingURL=prepare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../../../transactions/intents/prepare.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAI5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAI3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAO1E,OAAO,KAAK,EACV,WAAW,EACX,qBAAqB,EACrB,cAAc,EACf,MAAM,SAAS,CAAA;AAEhB,wBAAsB,aAAa,CAAC,mBAAmB,EACrD,OAAO,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,EACnD,KAAK,EAAE,WAAW,CAAC,mBAAmB,CAAC,GACtC,OAAO,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,CA2D9C;AA4ED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,EAC9B,QAAQ,CAAC,EAAE,cAAc,CAAC,kBAAkB,CAAC,EAC7C,WAAW,CAAC,EAAE,iBAAiB,EAC/B,cAAc,CAAC,EAAE,OAAO,gCAAgC,EAAE,2BAA2B,EACrF,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,GACpC,kBAAkB,CA2IpB"}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { hashTypedData, keccak256, stringToHex } from 'viem';
|
|
2
|
+
import { resolveCalls } from '../../calls/resolve.js';
|
|
3
|
+
import { chainIdFromReference, toEvmChainReference } from '../../chains/caip2.js';
|
|
4
|
+
import { defineValidator } from '../../modules/validators/definition.js';
|
|
5
|
+
import { ecdsaSignerId } from '../../modules/validators/signer-id.js';
|
|
6
|
+
import { signingTopology } from '../../signing/plan.js';
|
|
7
|
+
import { projectIntentAccount } from './account.js';
|
|
8
|
+
import { normalizeIntentQuote } from './normalize.js';
|
|
9
|
+
import { selectIntentQuote } from './quotes.js';
|
|
10
|
+
import { buildIntentRequest } from './request.js';
|
|
11
|
+
import { prepareIntentSessions } from './sessions.js';
|
|
12
|
+
export async function prepareIntent(context, input) {
|
|
13
|
+
const accountChain = selectAccountChain(input);
|
|
14
|
+
const runtime = await context.account.forChain(accountChain);
|
|
15
|
+
const calls = await resolveDestinationCalls(context, input, runtime);
|
|
16
|
+
const source = await resolveSourceCalls(context, input, runtime);
|
|
17
|
+
const sessions = await prepareIntentSessions({
|
|
18
|
+
intent: input,
|
|
19
|
+
runtime,
|
|
20
|
+
context,
|
|
21
|
+
});
|
|
22
|
+
const ownerSelection = input.signers?.kind === 'owner' ? input.signers : undefined;
|
|
23
|
+
const request = buildIntentRequest({
|
|
24
|
+
transaction: sessions
|
|
25
|
+
? { ...input, signatureMode: sessions.signatureMode }
|
|
26
|
+
: input,
|
|
27
|
+
account: {
|
|
28
|
+
...projectIntentAccount({
|
|
29
|
+
runtime,
|
|
30
|
+
setupOverride: input.accountSetupOverride,
|
|
31
|
+
...(input.eip7702InitSignature
|
|
32
|
+
? { eip7702InitSignature: input.eip7702InitSignature }
|
|
33
|
+
: {}),
|
|
34
|
+
}),
|
|
35
|
+
...(sessions ? { mockSignatures: sessions.mockSignatures } : {}),
|
|
36
|
+
},
|
|
37
|
+
calls,
|
|
38
|
+
sourceCalls: mergeSourceCalls(sessions?.preClaimCalls, source.calls),
|
|
39
|
+
providedFunds: source.providedFunds,
|
|
40
|
+
});
|
|
41
|
+
const response = await context.quoteClient.createQuote(request);
|
|
42
|
+
const quote = normalizeIntentQuote(selectIntentQuote(response.routes));
|
|
43
|
+
const quotes = response.routes.map((candidate) => candidate.intentId === quote.intentId
|
|
44
|
+
? quote
|
|
45
|
+
: normalizeIntentQuote(candidate));
|
|
46
|
+
return {
|
|
47
|
+
traceId: response.traceId,
|
|
48
|
+
input,
|
|
49
|
+
request,
|
|
50
|
+
quote,
|
|
51
|
+
quotes,
|
|
52
|
+
signing: buildIntentSigningInput(runtime, quote, sessions?.byChain, input.destination.kind === 'evm' ? input.destination : undefined, ownerSelection?.validator, ownerSelection?.signerIds),
|
|
53
|
+
accountChain,
|
|
54
|
+
...(sessions
|
|
55
|
+
? {
|
|
56
|
+
resolvedSessions: sessions.byChain,
|
|
57
|
+
sessionEnvironment: runtime.construction.sessions.environment,
|
|
58
|
+
}
|
|
59
|
+
: {}),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function selectAccountChain(input) {
|
|
63
|
+
if (input.destination.kind === 'evm')
|
|
64
|
+
return input.destination;
|
|
65
|
+
const source = input.sourceChains?.at(-1);
|
|
66
|
+
if (!source) {
|
|
67
|
+
throw new Error('A non-EVM intent requires at least one EVM source chain');
|
|
68
|
+
}
|
|
69
|
+
return source;
|
|
70
|
+
}
|
|
71
|
+
async function resolveDestinationCalls(context, input, runtime) {
|
|
72
|
+
if (input.destination.kind === 'non-evm') {
|
|
73
|
+
if (input.calls.length > 0) {
|
|
74
|
+
throw new Error(`Destination calls are not supported for ${input.destination.caip2}`);
|
|
75
|
+
}
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
return resolveCalls(input.calls, {
|
|
79
|
+
account: runtime.identity.address,
|
|
80
|
+
chain: input.destination,
|
|
81
|
+
config: context.compatibilityConfig,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
async function resolveSourceCalls(context, input, runtime) {
|
|
85
|
+
const allowed = new Map((input.sourceChains ?? []).map((chain) => [chain.id, chain]));
|
|
86
|
+
if (input.destination.kind === 'evm') {
|
|
87
|
+
allowed.set(input.destination.id, input.destination);
|
|
88
|
+
}
|
|
89
|
+
const calls = {};
|
|
90
|
+
const providedFunds = {};
|
|
91
|
+
for (const [chainIdValue, sourceCalls] of Object.entries(input.sourceCalls ?? {})) {
|
|
92
|
+
const chainId = Number(chainIdValue);
|
|
93
|
+
const chain = allowed.get(chainId);
|
|
94
|
+
if (!chain)
|
|
95
|
+
throw new Error(`Invalid source calls chain ${chainId}`);
|
|
96
|
+
calls[chainId] = await resolveCalls(sourceCalls.map(({ call }) => call), {
|
|
97
|
+
account: runtime.identity.address,
|
|
98
|
+
chain,
|
|
99
|
+
config: context.compatibilityConfig,
|
|
100
|
+
});
|
|
101
|
+
for (const sourceCall of sourceCalls) {
|
|
102
|
+
for (const provided of sourceCall.provides ?? []) {
|
|
103
|
+
const balances = (providedFunds[chainId] ??= {});
|
|
104
|
+
balances[provided.token] =
|
|
105
|
+
(balances[provided.token] ?? 0n) + provided.amount;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return { calls, providedFunds };
|
|
110
|
+
}
|
|
111
|
+
export function buildIntentSigningInput(runtime, quote, sessions, destination, ownerValidator, selectedSignerIds) {
|
|
112
|
+
const sessionTopology = sessions
|
|
113
|
+
? signingTopology(defineValidator(requireSession(sessions).session.owners, 'smart-session-validator'))
|
|
114
|
+
: undefined;
|
|
115
|
+
const selectedOwner = ownerValidator ?? runtime.construction.owner;
|
|
116
|
+
const topology = sessionTopology
|
|
117
|
+
? sessionTopology
|
|
118
|
+
: selectedOwner
|
|
119
|
+
? signingTopology(selectedOwner, selectedSignerIds)
|
|
120
|
+
: {
|
|
121
|
+
configuredTopology: {
|
|
122
|
+
rootValidatorId: 'eoa',
|
|
123
|
+
validators: [],
|
|
124
|
+
threshold: 1,
|
|
125
|
+
},
|
|
126
|
+
effectiveSelection: {
|
|
127
|
+
validatorIds: [],
|
|
128
|
+
signerIds: runtime.construction.eoa
|
|
129
|
+
? [ecdsaSignerId(runtime.construction.eoa)]
|
|
130
|
+
: [],
|
|
131
|
+
threshold: 1,
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
const origins = quote.signData.origin.map((typedData, index) => ({
|
|
135
|
+
id: hashTypedData(typedData),
|
|
136
|
+
chain: toEvmChainReference(Number(typedData.domain?.chainId)),
|
|
137
|
+
role: 'origin',
|
|
138
|
+
typedData,
|
|
139
|
+
usage: 'intent-origin',
|
|
140
|
+
artifactId: `origin-${index}`,
|
|
141
|
+
}));
|
|
142
|
+
if (origins.length === 0)
|
|
143
|
+
throw new Error('Intent quote has no origin payloads');
|
|
144
|
+
const lastOrigin = origins.at(-1);
|
|
145
|
+
if (!lastOrigin)
|
|
146
|
+
throw new Error('Intent quote has no origin payloads');
|
|
147
|
+
const destinationChain = destination;
|
|
148
|
+
const destinationSession = destinationChain
|
|
149
|
+
? sessions?.[destinationChain.id]
|
|
150
|
+
: undefined;
|
|
151
|
+
const destinationPayload = destinationChain
|
|
152
|
+
? {
|
|
153
|
+
id: hashTypedData(quote.signData.destination),
|
|
154
|
+
chain: toEvmChainReference(Number(quote.signData.destination.domain?.chainId ?? destinationChain.id)),
|
|
155
|
+
role: 'destination',
|
|
156
|
+
typedData: quote.signData.destination,
|
|
157
|
+
usage: 'intent-destination',
|
|
158
|
+
}
|
|
159
|
+
: undefined;
|
|
160
|
+
const targetExecution = quote.signData.targetExecution;
|
|
161
|
+
const targetCandidate = targetExecution
|
|
162
|
+
? {
|
|
163
|
+
id: hashTypedData(targetExecution),
|
|
164
|
+
chain: toEvmChainReference(Number(targetExecution.domain?.chainId ??
|
|
165
|
+
chainIdFromReference(runtime.construction.chain))),
|
|
166
|
+
role: 'target',
|
|
167
|
+
typedData: targetExecution,
|
|
168
|
+
usage: 'intent-target',
|
|
169
|
+
}
|
|
170
|
+
: undefined;
|
|
171
|
+
const targetSession = targetCandidate
|
|
172
|
+
? sessions?.[targetCandidate.chain.id]
|
|
173
|
+
: undefined;
|
|
174
|
+
const target = targetCandidate && targetSession?.verifyExecutions
|
|
175
|
+
? targetCandidate
|
|
176
|
+
: undefined;
|
|
177
|
+
return {
|
|
178
|
+
// Standalone `signIntent(SignData)` builds a synthetic quote with no
|
|
179
|
+
// intentId; fall back to the last origin payload hash so the signing-task
|
|
180
|
+
// namespace stays deterministic rather than relying on `stringToHex`
|
|
181
|
+
// coercing `undefined` to an empty string.
|
|
182
|
+
id: quote.intentId ? keccak256(stringToHex(quote.intentId)) : lastOrigin.id,
|
|
183
|
+
preparedSignatureMode: sessions
|
|
184
|
+
? Object.values(sessions).some(({ verifyExecutions }) => verifyExecutions)
|
|
185
|
+
? 'session-with-execution-verification'
|
|
186
|
+
: 'session'
|
|
187
|
+
: 'default',
|
|
188
|
+
...topology,
|
|
189
|
+
origins: origins.map(({ artifactId: _artifactId, ...origin }) => origin),
|
|
190
|
+
destination: sessions && destinationSession && destinationPayload
|
|
191
|
+
? {
|
|
192
|
+
mode: 'sign',
|
|
193
|
+
payload: destinationPayload,
|
|
194
|
+
artifactId: 'destination',
|
|
195
|
+
}
|
|
196
|
+
: {
|
|
197
|
+
mode: 'reuse-origin',
|
|
198
|
+
artifactId: 'destination',
|
|
199
|
+
originArtifactId: lastOrigin.artifactId,
|
|
200
|
+
selection: sessions ? 'pre-claim' : 'whole',
|
|
201
|
+
},
|
|
202
|
+
...(target ? { target } : {}),
|
|
203
|
+
artifacts: [
|
|
204
|
+
...origins.map((origin) => ({
|
|
205
|
+
id: origin.artifactId,
|
|
206
|
+
usage: 'intent-origin',
|
|
207
|
+
payloadId: origin.id,
|
|
208
|
+
cardinality: 'one',
|
|
209
|
+
shape: sessions?.[origin.chain.id]?.verifyExecutions
|
|
210
|
+
? 'session-claims'
|
|
211
|
+
: 'hex',
|
|
212
|
+
exposedForIndependentSigning: !sessions,
|
|
213
|
+
})),
|
|
214
|
+
{
|
|
215
|
+
id: 'destination',
|
|
216
|
+
usage: 'intent-destination',
|
|
217
|
+
payloadId: hashTypedData(quote.signData.destination),
|
|
218
|
+
cardinality: 'one',
|
|
219
|
+
shape: 'hex',
|
|
220
|
+
exposedForIndependentSigning: false,
|
|
221
|
+
},
|
|
222
|
+
...(target
|
|
223
|
+
? [
|
|
224
|
+
{
|
|
225
|
+
id: 'target',
|
|
226
|
+
usage: 'intent-target',
|
|
227
|
+
payloadId: target.id,
|
|
228
|
+
cardinality: 'one',
|
|
229
|
+
shape: 'hex',
|
|
230
|
+
exposedForIndependentSigning: false,
|
|
231
|
+
},
|
|
232
|
+
]
|
|
233
|
+
: []),
|
|
234
|
+
],
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
function requireSession(sessions) {
|
|
238
|
+
const session = Object.values(sessions)[0];
|
|
239
|
+
if (!session)
|
|
240
|
+
throw new Error('Intent session selection is empty');
|
|
241
|
+
return session;
|
|
242
|
+
}
|
|
243
|
+
function mergeSourceCalls(first, second) {
|
|
244
|
+
const result = { ...first };
|
|
245
|
+
for (const [chainId, calls] of Object.entries(second)) {
|
|
246
|
+
result[Number(chainId)] = [...(result[Number(chainId)] ?? []), ...calls];
|
|
247
|
+
}
|
|
248
|
+
return result;
|
|
249
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quotes.d.ts","sourceRoot":"","sources":["../../../../transactions/intents/quotes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAEzE,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,iBAAiB,EAAE,EACpC,QAAQ,CAAC,EAAE,MAAM,GAChB,iBAAiB,CAYnB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function selectIntentQuote(quotes, intentId) {
|
|
2
|
+
const quote = intentId
|
|
3
|
+
? quotes.find((candidate) => candidate.intentId === intentId)
|
|
4
|
+
: quotes[0];
|
|
5
|
+
if (!quote) {
|
|
6
|
+
throw new Error(intentId
|
|
7
|
+
? `Quote ${intentId} is not in the prepared transaction`
|
|
8
|
+
: 'Orchestrator returned no quote');
|
|
9
|
+
}
|
|
10
|
+
return quote;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Call } from '../../calls/types.js';
|
|
2
|
+
import type { OrchestratorAccount, OrchestratorIntentRequest } from '../../clients/orchestrator/types.js';
|
|
3
|
+
import type { IntentInput } from './types.js';
|
|
4
|
+
export declare function buildIntentRequest<CompatibilityConfig>(input: {
|
|
5
|
+
readonly transaction: IntentInput<CompatibilityConfig>;
|
|
6
|
+
readonly account: OrchestratorAccount;
|
|
7
|
+
readonly calls: readonly Call[];
|
|
8
|
+
readonly sourceCalls: Readonly<Record<number, readonly Call[]>>;
|
|
9
|
+
readonly providedFunds: Readonly<Record<number, Readonly<Record<`0x${string}`, bigint>>>>;
|
|
10
|
+
}): OrchestratorIntentRequest;
|
|
11
|
+
//# sourceMappingURL=request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../../transactions/intents/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAG7C,OAAO,KAAK,EACV,mBAAmB,EAEnB,yBAAyB,EAC1B,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,wBAAgB,kBAAkB,CAAC,mBAAmB,EAAE,KAAK,EAAE;IAC7D,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAA;IACtD,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAA;IACrC,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAA;IAC/B,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC,CAAA;IAC/D,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAC9B,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CACxD,CAAA;CACF,GAAG,yBAAyB,CA4C5B"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { chainIdFromReference } from '../../chains/caip2.js';
|
|
2
|
+
import { normalizeTokenAddress } from '../../chains/tokens.js';
|
|
3
|
+
export function buildIntentRequest(input) {
|
|
4
|
+
const destinationChainId = chainIdFromReference(input.transaction.destination);
|
|
5
|
+
const nonEvm = input.transaction.destination.kind === 'non-evm';
|
|
6
|
+
const auxiliaryFunds = mergeAuxiliaryFunds(input.transaction.options?.auxiliaryFunds, input.providedFunds);
|
|
7
|
+
return {
|
|
8
|
+
account: input.account,
|
|
9
|
+
destinationChainId,
|
|
10
|
+
destinationExecutions: input.calls.map(toExecution),
|
|
11
|
+
tokenRequests: input.transaction.tokenRequests.map((request) => ({
|
|
12
|
+
tokenAddress: normalizeTokenAddress(request.token, destinationChainId, nonEvm),
|
|
13
|
+
...(request.amount === undefined ? {} : { amount: request.amount }),
|
|
14
|
+
})),
|
|
15
|
+
...(input.transaction.recipient
|
|
16
|
+
? { recipient: input.transaction.recipient }
|
|
17
|
+
: {}),
|
|
18
|
+
...(input.transaction.gasLimit === undefined
|
|
19
|
+
? {}
|
|
20
|
+
: { destinationGasUnits: input.transaction.gasLimit }),
|
|
21
|
+
...(input.transaction.accountAccessList
|
|
22
|
+
? { accountAccessList: input.transaction.accountAccessList }
|
|
23
|
+
: {}),
|
|
24
|
+
options: {
|
|
25
|
+
...input.transaction.options,
|
|
26
|
+
signatureMode: input.transaction.signatureMode ?? 1,
|
|
27
|
+
...(auxiliaryFunds ? { auxiliaryFunds } : {}),
|
|
28
|
+
},
|
|
29
|
+
...(Object.keys(input.sourceCalls).length > 0
|
|
30
|
+
? {
|
|
31
|
+
preClaimExecutions: Object.fromEntries(Object.entries(input.sourceCalls).map(([chainId, calls]) => [
|
|
32
|
+
Number(chainId),
|
|
33
|
+
calls.map(toExecution),
|
|
34
|
+
])),
|
|
35
|
+
}
|
|
36
|
+
: {}),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function toExecution(call) {
|
|
40
|
+
return { to: call.target, value: call.value, data: call.data };
|
|
41
|
+
}
|
|
42
|
+
function mergeAuxiliaryFunds(configured, provided) {
|
|
43
|
+
const result = {};
|
|
44
|
+
for (const [chainId, balances] of Object.entries(configured ?? {})) {
|
|
45
|
+
result[Number(chainId)] = { ...balances };
|
|
46
|
+
}
|
|
47
|
+
for (const [chainId, balances] of Object.entries(provided)) {
|
|
48
|
+
const target = (result[Number(chainId)] ??= {});
|
|
49
|
+
for (const [token, amount] of Object.entries(balances)) {
|
|
50
|
+
target[token] =
|
|
51
|
+
(target[token] ?? 0n) + amount;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return Object.keys(result).length > 0 ? result : undefined;
|
|
55
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IntentInput, IntentWorkflowContext, SubmittedIntent } from './types.js';
|
|
2
|
+
export declare function sendIntent<CompatibilityConfig>(context: IntentWorkflowContext<CompatibilityConfig>, input: IntentInput<CompatibilityConfig>): Promise<SubmittedIntent>;
|
|
3
|
+
//# sourceMappingURL=send.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../../../transactions/intents/send.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,WAAW,EACX,qBAAqB,EACrB,eAAe,EAChB,MAAM,SAAS,CAAA;AAEhB,wBAAsB,UAAU,CAAC,mBAAmB,EAClD,OAAO,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,EACnD,KAAK,EAAE,WAAW,CAAC,mBAAmB,CAAC,GACtC,OAAO,CAAC,eAAe,CAAC,CAa1B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { prepareIntent } from './prepare.js';
|
|
2
|
+
import { signIntent } from './sign-transaction.js';
|
|
3
|
+
import { submitIntent } from './submit.js';
|
|
4
|
+
export async function sendIntent(context, input) {
|
|
5
|
+
const prepared = await prepareIntent(context, input);
|
|
6
|
+
let signed = await signIntent(context, prepared);
|
|
7
|
+
if (input.eip7702InitSignature) {
|
|
8
|
+
signed = {
|
|
9
|
+
...signed,
|
|
10
|
+
authorizations: await context.signAuthorizations({
|
|
11
|
+
chains: authorizationChains(input),
|
|
12
|
+
eip7702InitSignature: input.eip7702InitSignature,
|
|
13
|
+
}),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return submitIntent(context, signed);
|
|
17
|
+
}
|
|
18
|
+
function authorizationChains(input) {
|
|
19
|
+
const chains = new Map((input.sourceChains ?? []).map((chain) => [chain.caip2, chain]));
|
|
20
|
+
chains.set(input.destination.caip2, input.destination);
|
|
21
|
+
return [...chains.values()];
|
|
22
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SigningContext } from '../../signing/context.js';
|
|
2
|
+
import type { IntentSigningPlanCreationInput } from '../../signing/intent-plans/types.js';
|
|
3
|
+
import type { SignerInvocationPort } from '../../signing/types.js';
|
|
4
|
+
import type { PreparedIntent } from './types.js';
|
|
5
|
+
export declare function createIntentSessionSignerInvoker<CompatibilityConfig>(prepared: PreparedIntent<CompatibilityConfig>, fallback: SignerInvocationPort): SignerInvocationPort;
|
|
6
|
+
export declare function buildSessionIntentPlanInput<CompatibilityConfig>(prepared: PreparedIntent<CompatibilityConfig>, context: SigningContext): IntentSigningPlanCreationInput;
|
|
7
|
+
//# sourceMappingURL=session-signing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-signing.d.ts","sourceRoot":"","sources":["../../../../transactions/intents/session-signing.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAA;AAOtF,OAAO,KAAK,EAEV,oBAAoB,EAGrB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,wBAAgB,gCAAgC,CAAC,mBAAmB,EAClE,QAAQ,EAAE,cAAc,CAAC,mBAAmB,CAAC,EAC7C,QAAQ,EAAE,oBAAoB,GAC7B,oBAAoB,CA+BtB;AAED,wBAAgB,2BAA2B,CAAC,mBAAmB,EAC7D,QAAQ,EAAE,cAAc,CAAC,mBAAmB,CAAC,EAC7C,OAAO,EAAE,cAAc,GACtB,8BAA8B,CA2FhC"}
|