@rhinestone/sdk 2.0.0-beta.8 → 2.0.0
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/README.md +2 -2
- 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 +16 -0
- package/dist/src/accounts/adapters/nexus.d.ts.map +1 -0
- package/dist/src/accounts/adapters/nexus.js +212 -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 +3 -10
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/error.js +5 -11
- 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/types.js +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 +158 -0
- package/dist/src/actions/smart-sessions.d.ts +30 -6
- package/dist/src/actions/smart-sessions.d.ts.map +1 -1
- package/dist/src/actions/smart-sessions.js +69 -18
- 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 +637 -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-types.js +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/chains/non-evm.d.ts +26 -0
- 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/clients/orchestrator/chain-catalog.d.ts +36 -0
- package/dist/src/clients/orchestrator/chain-catalog.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/chain-catalog.js +67 -0
- 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/clients/orchestrator/errors.d.ts +238 -0
- package/dist/src/clients/orchestrator/errors.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/errors.js +525 -0
- 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} +115 -42
- package/dist/src/clients/orchestrator/public.d.ts.map +1 -0
- package/dist/src/clients/orchestrator/public.js +14 -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/clients/orchestrator/wire.gen.d.ts +6463 -0
- 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/config/account.d.ts +743 -0
- 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} +43 -12
- package/dist/src/errors/execution.d.ts.map +1 -0
- package/dist/src/errors/execution.js +123 -0
- package/dist/src/errors/index.d.ts +6 -4
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +7 -6
- package/dist/src/index.d.ts +14 -83
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -290
- package/dist/src/jwt-server/jcs.d.ts +1 -1
- package/dist/src/jwt-server/jcs.js +4 -2
- 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 +2 -1
- package/dist/src/modules/validators/permissions.d.ts.map +1 -1
- package/dist/src/modules/validators/permissions.js +192 -18
- package/dist/src/modules/validators/policies/claim/arbiters.d.ts +19 -0
- package/dist/src/modules/validators/policies/claim/arbiters.d.ts.map +1 -0
- package/dist/src/modules/validators/policies/claim/arbiters.js +82 -0
- 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 +16 -0
- package/dist/src/smart-sessions/index.d.ts.map +1 -0
- package/dist/src/smart-sessions/index.js +45 -0
- 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 +136 -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 +68 -4
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +113 -51
- package/package.json +6 -11
- package/dist/src/accounts/index.d.ts +0 -51
- package/dist/src/accounts/index.d.ts.map +0 -1
- package/dist/src/accounts/index.js +0 -589
- 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 -19
- package/dist/src/accounts/json-rpc/providers.d.ts +0 -5
- package/dist/src/accounts/json-rpc/providers.d.ts.map +0 -1
- package/dist/src/accounts/json-rpc/providers.js +0 -16
- package/dist/src/accounts/kernel.d.ts +0 -27
- package/dist/src/accounts/kernel.d.ts.map +0 -1
- package/dist/src/accounts/kernel.js +0 -272
- package/dist/src/accounts/nexus.d.ts +0 -33
- package/dist/src/accounts/nexus.d.ts.map +0 -1
- package/dist/src/accounts/nexus.js +0 -444
- package/dist/src/accounts/safe.d.ts +0 -33
- package/dist/src/accounts/safe.d.ts.map +0 -1
- package/dist/src/accounts/safe.js +0 -343
- package/dist/src/accounts/signing/common.d.ts +0 -32
- package/dist/src/accounts/signing/common.d.ts.map +0 -1
- package/dist/src/accounts/signing/common.js +0 -184
- 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 -45
- 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 -33
- package/dist/src/accounts/startale.d.ts +0 -26
- package/dist/src/accounts/startale.d.ts.map +0 -1
- package/dist/src/accounts/startale.js +0 -191
- 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/actions/recovery.d.ts +0 -33
- package/dist/src/actions/recovery.d.ts.map +0 -1
- package/dist/src/actions/recovery.js +0 -189
- 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/error.js +0 -85
- package/dist/src/execution/index.d.ts +0 -41
- package/dist/src/execution/index.d.ts.map +0 -1
- package/dist/src/execution/index.js +0 -202
- package/dist/src/execution/utils.d.ts +0 -126
- package/dist/src/execution/utils.d.ts.map +0 -1
- package/dist/src/execution/utils.js +0 -1054
- 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 -90
- 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 -10
- package/dist/src/modules/read.d.ts.map +0 -1
- package/dist/src/modules/read.js +0 -171
- 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 -266
- 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 -196
- package/dist/src/modules/validators/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/validators/smart-sessions.js +0 -772
- package/dist/src/orchestrator/caip2.d.ts +0 -7
- package/dist/src/orchestrator/caip2.d.ts.map +0 -1
- package/dist/src/orchestrator/caip2.js +0 -17
- package/dist/src/orchestrator/client.d.ts +0 -29
- package/dist/src/orchestrator/client.d.ts.map +0 -1
- package/dist/src/orchestrator/client.js +0 -291
- 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/error.d.ts +0 -97
- package/dist/src/orchestrator/error.d.ts.map +0 -1
- package/dist/src/orchestrator/error.js +0 -173
- package/dist/src/orchestrator/index.d.ts +0 -11
- 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 -16
- package/dist/src/orchestrator/registry.d.ts.map +0 -1
- package/dist/src/orchestrator/registry.js +0 -90
- package/dist/src/orchestrator/types.d.ts.map +0 -1
- package/dist/src/orchestrator/types.js +0 -15
- 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/types.d.ts +0 -446
- 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/{types.js → accounts/adapter.js} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
type Caip2ChainId = `eip155:${number}`;
|
|
2
|
-
declare function toCaip2(chainId: number): Caip2ChainId;
|
|
3
|
-
declare function fromCaip2(chainId: string): number;
|
|
4
|
-
declare function isCaip2(chainId: string): chainId is Caip2ChainId;
|
|
5
|
-
export type { Caip2ChainId };
|
|
6
|
-
export { fromCaip2, isCaip2, toCaip2 };
|
|
7
|
-
//# sourceMappingURL=caip2.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"caip2.d.ts","sourceRoot":"","sources":["../../../orchestrator/caip2.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG,UAAU,MAAM,EAAE,CAAA;AAItC,iBAAS,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAK9C;AAED,iBAAS,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAK1C;AAED,iBAAS,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,YAAY,CAEzD;AAED,YAAY,EAAE,YAAY,EAAE,CAAA;AAC5B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const EIP155_CAIP2_REGEX = /^eip155:\d+$/;
|
|
2
|
-
function toCaip2(chainId) {
|
|
3
|
-
if (!Number.isInteger(chainId) || chainId < 0) {
|
|
4
|
-
throw new Error(`Invalid EVM chain id: ${chainId}`);
|
|
5
|
-
}
|
|
6
|
-
return `eip155:${chainId}`;
|
|
7
|
-
}
|
|
8
|
-
function fromCaip2(chainId) {
|
|
9
|
-
if (!EIP155_CAIP2_REGEX.test(chainId)) {
|
|
10
|
-
throw new Error(`Invalid CAIP-2 chain id: ${chainId}`);
|
|
11
|
-
}
|
|
12
|
-
return Number(chainId.slice('eip155:'.length));
|
|
13
|
-
}
|
|
14
|
-
function isCaip2(chainId) {
|
|
15
|
-
return EIP155_CAIP2_REGEX.test(chainId);
|
|
16
|
-
}
|
|
17
|
-
export { fromCaip2, isCaip2, toCaip2 };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Address } from 'viem';
|
|
2
|
-
import type { AuthProvider } from '../auth/provider.js';
|
|
3
|
-
import type { IntentInput, IntentOpStatus, IntentSubmitRequestInternal, IntentSubmitResponse, Portfolio, QuoteResponse, SettlementLayerFilter, SplitIntentsInput, SplitIntentsResult } from './types.js';
|
|
4
|
-
interface PolicyContext {
|
|
5
|
-
intentInput: unknown;
|
|
6
|
-
isSponsored: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare class Orchestrator {
|
|
9
|
-
private serverUrl;
|
|
10
|
-
private authProvider;
|
|
11
|
-
private extraHeaders?;
|
|
12
|
-
constructor(serverUrl: string, authProvider: AuthProvider, headers?: Record<string, string>);
|
|
13
|
-
getPortfolio(accountAddress: Address, filter?: {
|
|
14
|
-
chainIds?: number[];
|
|
15
|
-
tokens?: {
|
|
16
|
-
[chainId: number]: Address[];
|
|
17
|
-
};
|
|
18
|
-
}): Promise<Portfolio>;
|
|
19
|
-
createQuote(input: IntentInput): Promise<QuoteResponse>;
|
|
20
|
-
getSplit(input: SplitIntentsInput): Promise<SplitIntentsResult>;
|
|
21
|
-
createIntent(request: IntentSubmitRequestInternal, policyContext?: PolicyContext): Promise<IntentSubmitResponse>;
|
|
22
|
-
getIntent(intentId: string): Promise<IntentOpStatus>;
|
|
23
|
-
private getHeaders;
|
|
24
|
-
private getSubmitHeaders;
|
|
25
|
-
private fetch;
|
|
26
|
-
}
|
|
27
|
-
export declare function encodeSettlementLayers(filter: SettlementLayerFilter): readonly string[];
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../orchestrator/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAQpD,OAAO,KAAK,EAMV,WAAW,EACX,cAAc,EAEd,2BAA2B,EAC3B,oBAAoB,EACpB,SAAS,EAET,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAEnB,MAAM,SAAS,CAAA;AAGhB,UAAU,aAAa;IACrB,WAAW,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,YAAY,CAAc;IAClC,OAAO,CAAC,YAAY,CAAC,CAAwB;gBAG3C,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,YAAY,EAC1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAO5B,YAAY,CAChB,cAAc,EAAE,OAAO,EACvB,MAAM,CAAC,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;QACnB,MAAM,CAAC,EAAE;YAAE,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,CAAA;SAAE,CAAA;KAC1C,GACA,OAAO,CAAC,SAAS,CAAC;IAyCf,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;IAUvD,QAAQ,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAoB/D,YAAY,CAChB,OAAO,EAAE,2BAA2B,EACpC,aAAa,CAAC,EAAE,aAAa,GAC5B,OAAO,CAAC,oBAAoB,CAAC;IAe1B,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;YAoB5C,UAAU;YAWV,gBAAgB;YAiBhB,KAAK;CAwBpB;AA2HD,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,qBAAqB,GAC5B,SAAS,MAAM,EAAE,CAInB"}
|
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
import { fromCaip2, toCaip2 } from './caip2.js';
|
|
2
|
-
import { API_VERSION, SDK_VERSION } from './consts.js';
|
|
3
|
-
import { OrchestratorError, parseErrorEnvelope, } from './error.js';
|
|
4
|
-
import { convertBigIntFields } from './utils.js';
|
|
5
|
-
export class Orchestrator {
|
|
6
|
-
serverUrl;
|
|
7
|
-
authProvider;
|
|
8
|
-
extraHeaders;
|
|
9
|
-
constructor(serverUrl, authProvider, headers) {
|
|
10
|
-
this.serverUrl = serverUrl;
|
|
11
|
-
this.authProvider = authProvider;
|
|
12
|
-
this.extraHeaders = headers;
|
|
13
|
-
}
|
|
14
|
-
async getPortfolio(accountAddress, filter) {
|
|
15
|
-
const params = new URLSearchParams();
|
|
16
|
-
if (filter?.chainIds) {
|
|
17
|
-
for (const id of filter.chainIds) {
|
|
18
|
-
params.append('chainIds', toCaip2(id));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
if (filter?.tokens) {
|
|
22
|
-
for (const [chainId, tokens] of Object.entries(filter.tokens)) {
|
|
23
|
-
for (const token of tokens) {
|
|
24
|
-
params.append('tokens', `${toCaip2(Number(chainId))}:${token}`);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const url = new URL(`${this.serverUrl}/accounts/${accountAddress}/portfolio`);
|
|
29
|
-
url.search = params.toString();
|
|
30
|
-
const json = await this.fetch(url.toString(), {
|
|
31
|
-
headers: await this.getHeaders(),
|
|
32
|
-
});
|
|
33
|
-
const portfolioWire = json.portfolio;
|
|
34
|
-
return portfolioWire.map((token) => ({
|
|
35
|
-
symbol: token.symbol,
|
|
36
|
-
chains: token.chains.map((c) => ({
|
|
37
|
-
chain: parseChainId(c.chainId),
|
|
38
|
-
address: c.address,
|
|
39
|
-
decimals: c.decimals,
|
|
40
|
-
amount: BigInt(c.amount),
|
|
41
|
-
})),
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
async createQuote(input) {
|
|
45
|
-
const body = encodeIntentInput(input);
|
|
46
|
-
const json = await this.fetch(`${this.serverUrl}/quotes`, {
|
|
47
|
-
method: 'POST',
|
|
48
|
-
headers: await this.getHeaders(),
|
|
49
|
-
body: JSON.stringify(body),
|
|
50
|
-
});
|
|
51
|
-
return decodeQuoteResponse(json);
|
|
52
|
-
}
|
|
53
|
-
async getSplit(input) {
|
|
54
|
-
const body = convertBigIntFields({
|
|
55
|
-
chainId: toCaip2(input.chain.id),
|
|
56
|
-
tokens: input.tokens,
|
|
57
|
-
settlementLayers: input.settlementLayers
|
|
58
|
-
? encodeSettlementLayers(input.settlementLayers)
|
|
59
|
-
: undefined,
|
|
60
|
-
});
|
|
61
|
-
const json = await this.fetch(`${this.serverUrl}/intents/splits`, {
|
|
62
|
-
method: 'POST',
|
|
63
|
-
headers: await this.getHeaders(),
|
|
64
|
-
body: JSON.stringify(body),
|
|
65
|
-
});
|
|
66
|
-
return {
|
|
67
|
-
intents: json.intents.map(parseTokenAmountsRecord),
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
async createIntent(request, policyContext) {
|
|
71
|
-
const body = convertBigIntFields(request);
|
|
72
|
-
const headers = policyContext
|
|
73
|
-
? await this.getSubmitHeaders(policyContext.intentInput, policyContext.isSponsored)
|
|
74
|
-
: await this.getHeaders();
|
|
75
|
-
return await this.fetch(`${this.serverUrl}/intents`, {
|
|
76
|
-
method: 'POST',
|
|
77
|
-
headers,
|
|
78
|
-
body: JSON.stringify(body),
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
async getIntent(intentId) {
|
|
82
|
-
const json = await this.fetch(`${this.serverUrl}/intents/${intentId}`, {
|
|
83
|
-
headers: await this.getHeaders(),
|
|
84
|
-
});
|
|
85
|
-
return {
|
|
86
|
-
status: json.status,
|
|
87
|
-
claims: (json.claims ?? []).map((claim) => ({
|
|
88
|
-
depositId: claim.depositId !== undefined ? BigInt(claim.depositId) : 0n,
|
|
89
|
-
chainId: parseChainId(claim.chainId),
|
|
90
|
-
status: claim.status,
|
|
91
|
-
claimTimestamp: claim.claimTimestamp,
|
|
92
|
-
claimTransactionHash: claim.claimTransactionHash,
|
|
93
|
-
})),
|
|
94
|
-
destinationChainId: parseChainId(json.destinationChainId),
|
|
95
|
-
accountAddress: json.accountAddress,
|
|
96
|
-
fillTimestamp: json.fillTimestamp,
|
|
97
|
-
fillTransactionHash: json.fillTransactionHash,
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
async getHeaders() {
|
|
101
|
-
const auth = await this.authProvider.getHeaders();
|
|
102
|
-
return {
|
|
103
|
-
'Content-Type': 'application/json',
|
|
104
|
-
'x-sdk-version': SDK_VERSION,
|
|
105
|
-
'x-api-version': API_VERSION,
|
|
106
|
-
...auth,
|
|
107
|
-
...this.extraHeaders,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
async getSubmitHeaders(intentInput, isSponsored) {
|
|
111
|
-
const auth = await this.authProvider.getSubmitHeaders(intentInput, isSponsored);
|
|
112
|
-
return {
|
|
113
|
-
'Content-Type': 'application/json',
|
|
114
|
-
'x-sdk-version': SDK_VERSION,
|
|
115
|
-
'x-api-version': API_VERSION,
|
|
116
|
-
...auth,
|
|
117
|
-
...this.extraHeaders,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
async fetch(url, options) {
|
|
121
|
-
const response = await fetch(url, options);
|
|
122
|
-
if (!response.ok) {
|
|
123
|
-
let body;
|
|
124
|
-
try {
|
|
125
|
-
body = await response.json();
|
|
126
|
-
}
|
|
127
|
-
catch {
|
|
128
|
-
body = {
|
|
129
|
-
code: 'INTERNAL_ERROR',
|
|
130
|
-
message: `Request failed with status ${response.status}`,
|
|
131
|
-
traceId: '',
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
const retryAfter = response.headers?.get?.('retry-after') ?? undefined;
|
|
135
|
-
throw parseErrorEnvelope(body, response.status, retryAfter ?? undefined);
|
|
136
|
-
}
|
|
137
|
-
return response.json();
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
function parseTokenAmountsRecord(record) {
|
|
141
|
-
return Object.fromEntries(Object.entries(record).map(([addr, amount]) => [
|
|
142
|
-
addr,
|
|
143
|
-
BigInt(amount),
|
|
144
|
-
]));
|
|
145
|
-
}
|
|
146
|
-
function parseChainId(value) {
|
|
147
|
-
if (typeof value === 'number')
|
|
148
|
-
return value;
|
|
149
|
-
if (typeof value === 'string') {
|
|
150
|
-
if (value.startsWith('eip155:'))
|
|
151
|
-
return fromCaip2(value);
|
|
152
|
-
return Number(value);
|
|
153
|
-
}
|
|
154
|
-
throw new OrchestratorError({
|
|
155
|
-
message: `Invalid chain id value: ${String(value)}`,
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
function encodeIntentInput(input) {
|
|
159
|
-
const { account, destinationChainId, destinationExecutions, destinationGasUnits, tokenRequests, recipient, accountAccessList, options, preClaimExecutions, } = input;
|
|
160
|
-
const wire = {
|
|
161
|
-
account,
|
|
162
|
-
destinationChainId: toCaip2(destinationChainId),
|
|
163
|
-
destinationExecutions,
|
|
164
|
-
tokenRequests,
|
|
165
|
-
recipient,
|
|
166
|
-
accountAccessList: encodeAccountAccessList(accountAccessList),
|
|
167
|
-
options: encodeOptions(options),
|
|
168
|
-
};
|
|
169
|
-
if (destinationGasUnits !== undefined) {
|
|
170
|
-
wire.destinationGasLimit = destinationGasUnits;
|
|
171
|
-
}
|
|
172
|
-
if (preClaimExecutions) {
|
|
173
|
-
wire.preClaimExecutions = Object.fromEntries(Object.entries(preClaimExecutions).map(([chainId, ops]) => [
|
|
174
|
-
toCaip2(Number(chainId)),
|
|
175
|
-
ops,
|
|
176
|
-
]));
|
|
177
|
-
}
|
|
178
|
-
return convertBigIntFields(wire);
|
|
179
|
-
}
|
|
180
|
-
function encodeAccountAccessList(list) {
|
|
181
|
-
if (!list)
|
|
182
|
-
return undefined;
|
|
183
|
-
const out = {};
|
|
184
|
-
if ('chainIds' in list && list.chainIds) {
|
|
185
|
-
out.chainIds = list.chainIds.map(toCaip2);
|
|
186
|
-
}
|
|
187
|
-
if ('tokens' in list && list.tokens) {
|
|
188
|
-
out.tokens = list.tokens;
|
|
189
|
-
}
|
|
190
|
-
if ('chainTokens' in list && list.chainTokens) {
|
|
191
|
-
out.chainTokens = Object.fromEntries(Object.entries(list.chainTokens).map(([chainId, tokens]) => [
|
|
192
|
-
toCaip2(Number(chainId)),
|
|
193
|
-
tokens,
|
|
194
|
-
]));
|
|
195
|
-
}
|
|
196
|
-
if ('chainTokenAmounts' in list && list.chainTokenAmounts) {
|
|
197
|
-
out.chainTokenAmounts = Object.fromEntries(Object.entries(list.chainTokenAmounts).map(([chainId, tokens]) => [
|
|
198
|
-
toCaip2(Number(chainId)),
|
|
199
|
-
tokens,
|
|
200
|
-
]));
|
|
201
|
-
}
|
|
202
|
-
return out;
|
|
203
|
-
}
|
|
204
|
-
function encodeAuxiliaryFunds(funds) {
|
|
205
|
-
return Object.fromEntries(Object.entries(funds).map(([chainId, balances]) => [
|
|
206
|
-
toCaip2(Number(chainId)),
|
|
207
|
-
balances,
|
|
208
|
-
]));
|
|
209
|
-
}
|
|
210
|
-
function encodeOptions(options) {
|
|
211
|
-
const wire = { ...options };
|
|
212
|
-
if (options.auxiliaryFunds) {
|
|
213
|
-
wire.auxiliaryFunds = encodeAuxiliaryFunds(options.auxiliaryFunds);
|
|
214
|
-
}
|
|
215
|
-
if (options.settlementLayers) {
|
|
216
|
-
wire.settlementLayers = encodeSettlementLayers(options.settlementLayers);
|
|
217
|
-
}
|
|
218
|
-
return wire;
|
|
219
|
-
}
|
|
220
|
-
// Inversion universe for `{ exclude }`. Drop once the orchestrator accepts the
|
|
221
|
-
// union natively; RHINO/CCTP are listed despite not being in `SettlementLayer`.
|
|
222
|
-
const KNOWN_SETTLEMENT_LAYERS = [
|
|
223
|
-
'ACROSS',
|
|
224
|
-
'ECO',
|
|
225
|
-
'RELAY',
|
|
226
|
-
'OFT',
|
|
227
|
-
'NEAR',
|
|
228
|
-
'RHINO',
|
|
229
|
-
'CCTP',
|
|
230
|
-
];
|
|
231
|
-
export function encodeSettlementLayers(filter) {
|
|
232
|
-
if ('include' in filter)
|
|
233
|
-
return filter.include;
|
|
234
|
-
const excluded = new Set(filter.exclude);
|
|
235
|
-
return KNOWN_SETTLEMENT_LAYERS.filter((layer) => !excluded.has(layer));
|
|
236
|
-
}
|
|
237
|
-
function decodeQuoteResponse(json) {
|
|
238
|
-
const routes = (json.routes ?? []);
|
|
239
|
-
return { routes: routes.map(decodeQuote) };
|
|
240
|
-
}
|
|
241
|
-
function decodeQuote(route) {
|
|
242
|
-
return {
|
|
243
|
-
intentId: route.intentId,
|
|
244
|
-
expiresAt: route.expiresAt,
|
|
245
|
-
estimatedFillTime: route.estimatedFillTime,
|
|
246
|
-
settlementLayer: route.settlementLayer,
|
|
247
|
-
signData: route.signData,
|
|
248
|
-
cost: decodeCost(route.cost),
|
|
249
|
-
tokenRequirements: route.tokenRequirements
|
|
250
|
-
? decodeTokenRequirements(route.tokenRequirements)
|
|
251
|
-
: undefined,
|
|
252
|
-
bridgeFill: decodeBridgeFill(route.bridgeFill),
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
// Normalizes CAIP-2 strings to numeric IDs for consistency with BridgeFill decodeCostTokenEntry, and getIntent
|
|
256
|
-
function decodeBridgeFill(bf) {
|
|
257
|
-
if (!bf)
|
|
258
|
-
return undefined;
|
|
259
|
-
return { ...bf, destinationChainId: parseChainId(bf.destinationChainId) };
|
|
260
|
-
}
|
|
261
|
-
function decodeCost(cost) {
|
|
262
|
-
return {
|
|
263
|
-
input: cost.input.map(decodeCostTokenEntry),
|
|
264
|
-
output: cost.output.map(decodeCostTokenEntry),
|
|
265
|
-
fees: cost.fees,
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
function decodeCostTokenEntry(entry) {
|
|
269
|
-
return {
|
|
270
|
-
chainId: parseChainId(entry.chainId),
|
|
271
|
-
tokenAddress: entry.tokenAddress,
|
|
272
|
-
symbol: entry.symbol,
|
|
273
|
-
decimals: entry.decimals,
|
|
274
|
-
price: entry.price,
|
|
275
|
-
amount: BigInt(entry.amount),
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
function decodeTokenRequirements(wire) {
|
|
279
|
-
const out = {};
|
|
280
|
-
for (const [chainKey, tokens] of Object.entries(wire)) {
|
|
281
|
-
const chainId = parseChainId(chainKey);
|
|
282
|
-
out[chainId] = {};
|
|
283
|
-
for (const [tokenAddress, requirement] of Object.entries(tokens)) {
|
|
284
|
-
out[chainId][tokenAddress] = {
|
|
285
|
-
...requirement,
|
|
286
|
-
amount: BigInt(requirement.amount),
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
return out;
|
|
291
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
declare const PROD_ORCHESTRATOR_URL = "https://v1.orchestrator.rhinestone.dev";
|
|
2
|
-
declare const RHINESTONE_SPOKE_POOL_ADDRESS = "0x000000000060f6e853447881951574cdd0663530";
|
|
3
|
-
declare const SDK_VERSION = "2.0.0-beta.8";
|
|
4
|
-
declare const API_VERSION = "2026-04.blanc";
|
|
5
|
-
export { PROD_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, SDK_VERSION, API_VERSION, };
|
|
6
|
-
//# sourceMappingURL=consts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../orchestrator/consts.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,qBAAqB,2CAA2C,CAAA;AACtE,QAAA,MAAM,6BAA6B,+CACW,CAAA;AAE9C,QAAA,MAAM,WAAW,iBAAiB,CAAA;AAClC,QAAA,MAAM,WAAW,kBAAkB,CAAA;AAEnC,OAAO,EACL,qBAAqB,EACrB,6BAA6B,EAC7B,WAAW,EACX,WAAW,GACZ,CAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const PROD_ORCHESTRATOR_URL = 'https://v1.orchestrator.rhinestone.dev';
|
|
2
|
-
const RHINESTONE_SPOKE_POOL_ADDRESS = '0x000000000060f6e853447881951574cdd0663530';
|
|
3
|
-
const SDK_VERSION = '2.0.0-beta.8';
|
|
4
|
-
const API_VERSION = '2026-04.blanc';
|
|
5
|
-
export { PROD_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, SDK_VERSION, API_VERSION, };
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
type ErrorCode = 'VALIDATION_ERROR' | 'INSUFFICIENT_LIQUIDITY' | 'NOT_FOUND' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'CONFLICT' | 'UNPROCESSABLE_CONTENT' | 'TOO_MANY_REQUESTS' | 'SETTLEMENT_QUOTE_ERROR' | 'SETTLEMENT_EXECUTION_ERROR' | 'EXTERNAL_SERVICE_TIMEOUT' | 'RELAYER_MARKET_UNAVAILABLE' | 'INTERNAL_ERROR';
|
|
2
|
-
interface ValidationIssue {
|
|
3
|
-
message: string;
|
|
4
|
-
context?: Record<string, unknown>;
|
|
5
|
-
}
|
|
6
|
-
interface BaseErrorParams {
|
|
7
|
-
message: string;
|
|
8
|
-
traceId?: string;
|
|
9
|
-
statusCode?: number;
|
|
10
|
-
}
|
|
11
|
-
declare class OrchestratorError extends Error {
|
|
12
|
-
readonly code: ErrorCode | 'UNKNOWN';
|
|
13
|
-
readonly traceId: string;
|
|
14
|
-
readonly statusCode?: number;
|
|
15
|
-
constructor(params: BaseErrorParams & {
|
|
16
|
-
code?: ErrorCode | 'UNKNOWN';
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
declare class ValidationError extends OrchestratorError {
|
|
20
|
-
readonly issues: ValidationIssue[];
|
|
21
|
-
constructor(params: BaseErrorParams & {
|
|
22
|
-
issues?: ValidationIssue[];
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
declare class InsufficientLiquidityError extends OrchestratorError {
|
|
26
|
-
readonly availableIntents: Record<string, bigint>[];
|
|
27
|
-
readonly unfillable: Record<string, bigint>;
|
|
28
|
-
constructor(params: BaseErrorParams & {
|
|
29
|
-
availableIntents: Record<string, bigint>[];
|
|
30
|
-
unfillable: Record<string, bigint>;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
declare class NotFoundError extends OrchestratorError {
|
|
34
|
-
constructor(params: BaseErrorParams);
|
|
35
|
-
}
|
|
36
|
-
declare class UnauthorizedError extends OrchestratorError {
|
|
37
|
-
constructor(params: BaseErrorParams);
|
|
38
|
-
}
|
|
39
|
-
declare class ForbiddenError extends OrchestratorError {
|
|
40
|
-
constructor(params: BaseErrorParams);
|
|
41
|
-
}
|
|
42
|
-
declare class ConflictError extends OrchestratorError {
|
|
43
|
-
constructor(params: BaseErrorParams);
|
|
44
|
-
}
|
|
45
|
-
declare class UnprocessableContentError extends OrchestratorError {
|
|
46
|
-
constructor(params: BaseErrorParams);
|
|
47
|
-
}
|
|
48
|
-
declare class RateLimitedError extends OrchestratorError {
|
|
49
|
-
readonly retryAfter?: string;
|
|
50
|
-
constructor(params: BaseErrorParams & {
|
|
51
|
-
retryAfter?: string;
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
declare class SettlementQuoteError extends OrchestratorError {
|
|
55
|
-
constructor(params: BaseErrorParams);
|
|
56
|
-
}
|
|
57
|
-
declare class SettlementExecutionError extends OrchestratorError {
|
|
58
|
-
constructor(params: BaseErrorParams);
|
|
59
|
-
}
|
|
60
|
-
declare class ExternalServiceTimeoutError extends OrchestratorError {
|
|
61
|
-
constructor(params: BaseErrorParams);
|
|
62
|
-
}
|
|
63
|
-
declare class RelayerMarketUnavailableError extends OrchestratorError {
|
|
64
|
-
constructor(params: BaseErrorParams);
|
|
65
|
-
}
|
|
66
|
-
declare class InternalServerError extends OrchestratorError {
|
|
67
|
-
constructor(params: BaseErrorParams);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Thrown by the SDK's local token/chain registry — not an orchestrator API
|
|
71
|
-
* error. Distinct from `OrchestratorError` so consumers can catch them
|
|
72
|
-
* separately from server-side failures.
|
|
73
|
-
*/
|
|
74
|
-
declare class UnsupportedChainError extends Error {
|
|
75
|
-
readonly chainId: number;
|
|
76
|
-
constructor(chainId: number);
|
|
77
|
-
}
|
|
78
|
-
declare class UnsupportedTokenError extends Error {
|
|
79
|
-
readonly tokenSymbol: string;
|
|
80
|
-
readonly chainId: number;
|
|
81
|
-
constructor(tokenSymbol: string, chainId: number);
|
|
82
|
-
}
|
|
83
|
-
interface ErrorEnvelope {
|
|
84
|
-
code: ErrorCode;
|
|
85
|
-
message: string;
|
|
86
|
-
traceId: string;
|
|
87
|
-
details?: unknown;
|
|
88
|
-
}
|
|
89
|
-
declare function parseErrorEnvelope(envelope: ErrorEnvelope, statusCode: number, retryAfter?: string): OrchestratorError;
|
|
90
|
-
declare function isOrchestratorError(error: unknown): error is OrchestratorError;
|
|
91
|
-
declare function isRateLimited(error: unknown): error is RateLimitedError;
|
|
92
|
-
declare function isValidationError(error: unknown): error is ValidationError;
|
|
93
|
-
declare function isAuthError(error: unknown): error is UnauthorizedError | ForbiddenError;
|
|
94
|
-
declare function isRetryable(error: unknown): boolean;
|
|
95
|
-
export type { ErrorCode, ErrorEnvelope, ValidationIssue };
|
|
96
|
-
export { parseErrorEnvelope, isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, OrchestratorError, ValidationError, InsufficientLiquidityError, NotFoundError, UnauthorizedError, ForbiddenError, ConflictError, UnprocessableContentError, RateLimitedError, SettlementQuoteError, SettlementExecutionError, ExternalServiceTimeoutError, RelayerMarketUnavailableError, InternalServerError, UnsupportedChainError, UnsupportedTokenError, };
|
|
97
|
-
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../orchestrator/error.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
class OrchestratorError extends Error {
|
|
2
|
-
code;
|
|
3
|
-
traceId;
|
|
4
|
-
statusCode;
|
|
5
|
-
constructor(params) {
|
|
6
|
-
super(params.message);
|
|
7
|
-
this.code = params.code ?? 'UNKNOWN';
|
|
8
|
-
this.traceId = params.traceId ?? '';
|
|
9
|
-
this.statusCode = params.statusCode;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
class ValidationError extends OrchestratorError {
|
|
13
|
-
issues;
|
|
14
|
-
constructor(params) {
|
|
15
|
-
super({ ...params, code: 'VALIDATION_ERROR' });
|
|
16
|
-
this.issues = params.issues ?? [];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
class InsufficientLiquidityError extends OrchestratorError {
|
|
20
|
-
availableIntents;
|
|
21
|
-
unfillable;
|
|
22
|
-
constructor(params) {
|
|
23
|
-
super({ ...params, code: 'INSUFFICIENT_LIQUIDITY' });
|
|
24
|
-
this.availableIntents = params.availableIntents;
|
|
25
|
-
this.unfillable = params.unfillable;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
class NotFoundError extends OrchestratorError {
|
|
29
|
-
constructor(params) {
|
|
30
|
-
super({ ...params, code: 'NOT_FOUND' });
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
class UnauthorizedError extends OrchestratorError {
|
|
34
|
-
constructor(params) {
|
|
35
|
-
super({ ...params, code: 'UNAUTHORIZED' });
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
class ForbiddenError extends OrchestratorError {
|
|
39
|
-
constructor(params) {
|
|
40
|
-
super({ ...params, code: 'FORBIDDEN' });
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
class ConflictError extends OrchestratorError {
|
|
44
|
-
constructor(params) {
|
|
45
|
-
super({ ...params, code: 'CONFLICT' });
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
class UnprocessableContentError extends OrchestratorError {
|
|
49
|
-
constructor(params) {
|
|
50
|
-
super({ ...params, code: 'UNPROCESSABLE_CONTENT' });
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
class RateLimitedError extends OrchestratorError {
|
|
54
|
-
retryAfter;
|
|
55
|
-
constructor(params) {
|
|
56
|
-
super({ ...params, code: 'TOO_MANY_REQUESTS' });
|
|
57
|
-
this.retryAfter = params.retryAfter;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
class SettlementQuoteError extends OrchestratorError {
|
|
61
|
-
constructor(params) {
|
|
62
|
-
super({ ...params, code: 'SETTLEMENT_QUOTE_ERROR' });
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
class SettlementExecutionError extends OrchestratorError {
|
|
66
|
-
constructor(params) {
|
|
67
|
-
super({ ...params, code: 'SETTLEMENT_EXECUTION_ERROR' });
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
class ExternalServiceTimeoutError extends OrchestratorError {
|
|
71
|
-
constructor(params) {
|
|
72
|
-
super({ ...params, code: 'EXTERNAL_SERVICE_TIMEOUT' });
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
class RelayerMarketUnavailableError extends OrchestratorError {
|
|
76
|
-
constructor(params) {
|
|
77
|
-
super({ ...params, code: 'RELAYER_MARKET_UNAVAILABLE' });
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
class InternalServerError extends OrchestratorError {
|
|
81
|
-
constructor(params) {
|
|
82
|
-
super({ ...params, code: 'INTERNAL_ERROR' });
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Thrown by the SDK's local token/chain registry — not an orchestrator API
|
|
87
|
-
* error. Distinct from `OrchestratorError` so consumers can catch them
|
|
88
|
-
* separately from server-side failures.
|
|
89
|
-
*/
|
|
90
|
-
class UnsupportedChainError extends Error {
|
|
91
|
-
chainId;
|
|
92
|
-
constructor(chainId) {
|
|
93
|
-
super(`Unsupported chain ${chainId}`);
|
|
94
|
-
this.chainId = chainId;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
class UnsupportedTokenError extends Error {
|
|
98
|
-
tokenSymbol;
|
|
99
|
-
chainId;
|
|
100
|
-
constructor(tokenSymbol, chainId) {
|
|
101
|
-
super(`Unsupported token ${tokenSymbol} for chain ${chainId}`);
|
|
102
|
-
this.tokenSymbol = tokenSymbol;
|
|
103
|
-
this.chainId = chainId;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
function parseTokenAmounts(record) {
|
|
107
|
-
return Object.fromEntries(Object.entries(record).map(([addr, amount]) => [addr, BigInt(amount)]));
|
|
108
|
-
}
|
|
109
|
-
function parseErrorEnvelope(envelope, statusCode, retryAfter) {
|
|
110
|
-
const base = {
|
|
111
|
-
message: envelope.message,
|
|
112
|
-
traceId: envelope.traceId,
|
|
113
|
-
statusCode,
|
|
114
|
-
};
|
|
115
|
-
switch (envelope.code) {
|
|
116
|
-
case 'VALIDATION_ERROR': {
|
|
117
|
-
const issues = Array.isArray(envelope.details)
|
|
118
|
-
? envelope.details
|
|
119
|
-
: [];
|
|
120
|
-
return new ValidationError({ ...base, issues });
|
|
121
|
-
}
|
|
122
|
-
case 'INSUFFICIENT_LIQUIDITY': {
|
|
123
|
-
const details = (envelope.details ?? {});
|
|
124
|
-
return new InsufficientLiquidityError({
|
|
125
|
-
...base,
|
|
126
|
-
availableIntents: (details.availableIntents ?? []).map(parseTokenAmounts),
|
|
127
|
-
unfillable: parseTokenAmounts(details.unfillable ?? {}),
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
case 'NOT_FOUND':
|
|
131
|
-
return new NotFoundError(base);
|
|
132
|
-
case 'UNAUTHORIZED':
|
|
133
|
-
return new UnauthorizedError(base);
|
|
134
|
-
case 'FORBIDDEN':
|
|
135
|
-
return new ForbiddenError(base);
|
|
136
|
-
case 'CONFLICT':
|
|
137
|
-
return new ConflictError(base);
|
|
138
|
-
case 'UNPROCESSABLE_CONTENT':
|
|
139
|
-
return new UnprocessableContentError(base);
|
|
140
|
-
case 'TOO_MANY_REQUESTS':
|
|
141
|
-
return new RateLimitedError({ ...base, retryAfter });
|
|
142
|
-
case 'SETTLEMENT_QUOTE_ERROR':
|
|
143
|
-
return new SettlementQuoteError(base);
|
|
144
|
-
case 'SETTLEMENT_EXECUTION_ERROR':
|
|
145
|
-
return new SettlementExecutionError(base);
|
|
146
|
-
case 'EXTERNAL_SERVICE_TIMEOUT':
|
|
147
|
-
return new ExternalServiceTimeoutError(base);
|
|
148
|
-
case 'RELAYER_MARKET_UNAVAILABLE':
|
|
149
|
-
return new RelayerMarketUnavailableError(base);
|
|
150
|
-
case 'INTERNAL_ERROR':
|
|
151
|
-
return new InternalServerError(base);
|
|
152
|
-
default:
|
|
153
|
-
return new OrchestratorError({ ...base, code: 'UNKNOWN' });
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
function isOrchestratorError(error) {
|
|
157
|
-
return error instanceof OrchestratorError;
|
|
158
|
-
}
|
|
159
|
-
function isRateLimited(error) {
|
|
160
|
-
return error instanceof RateLimitedError;
|
|
161
|
-
}
|
|
162
|
-
function isValidationError(error) {
|
|
163
|
-
return error instanceof ValidationError;
|
|
164
|
-
}
|
|
165
|
-
function isAuthError(error) {
|
|
166
|
-
return error instanceof UnauthorizedError || error instanceof ForbiddenError;
|
|
167
|
-
}
|
|
168
|
-
function isRetryable(error) {
|
|
169
|
-
return (error instanceof InternalServerError ||
|
|
170
|
-
error instanceof ExternalServiceTimeoutError ||
|
|
171
|
-
error instanceof RelayerMarketUnavailableError);
|
|
172
|
-
}
|
|
173
|
-
export { parseErrorEnvelope, isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, OrchestratorError, ValidationError, InsufficientLiquidityError, NotFoundError, UnauthorizedError, ForbiddenError, ConflictError, UnprocessableContentError, RateLimitedError, SettlementQuoteError, SettlementExecutionError, ExternalServiceTimeoutError, RelayerMarketUnavailableError, InternalServerError, UnsupportedChainError, UnsupportedTokenError, };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AuthProvider } from '../auth/provider.js';
|
|
2
|
-
import { Orchestrator } from './client.js';
|
|
3
|
-
import { RHINESTONE_SPOKE_POOL_ADDRESS } from './consts.js';
|
|
4
|
-
import { ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InternalServerError, isAuthError, isOrchestratorError, isRateLimited, isRetryable, isValidationError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SettlementExecutionError, SettlementQuoteError, UnauthorizedError, UnprocessableContentError, UnsupportedChainError, UnsupportedTokenError, ValidationError } from './error.js';
|
|
5
|
-
import { getTokenSymbol, getWethAddress, isTokenAddressSupported } from './registry.js';
|
|
6
|
-
import type { ApprovalRequired, AuxiliaryFunds, BridgeFill, Cost, CostTokenEntry, EstimatedFillTime, Execution, FeeBreakdown, Fees, IntentInput, IntentOpStatus, IntentOptions, IntentSubmitRequest, IntentSubmitResponse, Portfolio, Price, Quote, QuoteResponse, SettlementLayer, SettlementLayerFilter, SignatureMode, SignData, SignedAuthorization, SplitIntentsInput, SplitIntentsResult, SponsorSettings, SupportedChain, TokenConfig, TokenRequirements, TypedDataDefinition, UsdAmount, WrapRequired } from './types.js';
|
|
7
|
-
import { INTENT_STATUS_CLAIMED, INTENT_STATUS_COMPLETED, INTENT_STATUS_EXPIRED, INTENT_STATUS_FAILED, INTENT_STATUS_FILLED, INTENT_STATUS_PENDING, INTENT_STATUS_PRECONFIRMED } from './types.js';
|
|
8
|
-
declare function getOrchestrator(authProvider: AuthProvider, orchestratorUrl?: string, headers?: Record<string, string>): Orchestrator;
|
|
9
|
-
export type { ApprovalRequired, AuxiliaryFunds, BridgeFill, Cost, CostTokenEntry, EstimatedFillTime, Execution, FeeBreakdown, Fees, IntentInput, IntentOpStatus, IntentOptions, IntentSubmitRequest, IntentSubmitResponse, Portfolio, Price, Quote, QuoteResponse, SettlementLayer, SettlementLayerFilter, SignatureMode, SignData, SignedAuthorization, SplitIntentsInput, SplitIntentsResult, SponsorSettings, SupportedChain, TokenConfig, TokenRequirements, TypedDataDefinition, UsdAmount, WrapRequired, };
|
|
10
|
-
export { INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_FAILED, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_CLAIMED, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InternalServerError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SettlementExecutionError, SettlementQuoteError, UnauthorizedError, UnprocessableContentError, UnsupportedChainError, UnsupportedTokenError, ValidationError, getOrchestrator, getWethAddress, getTokenSymbol, isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, isTokenAddressSupported, };
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../orchestrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAyB,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,cAAc,EACd,0BAA0B,EAC1B,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,6BAA6B,EAC7B,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EAChB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,cAAc,EACd,cAAc,EACd,uBAAuB,EACxB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,IAAI,EACJ,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,IAAI,EACJ,WAAW,EACX,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACT,KAAK,EACL,KAAK,EACL,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,QAAQ,EACR,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,EACT,YAAY,EACb,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,SAAS,CAAA;AAEhB,iBAAS,eAAe,CACtB,YAAY,EAAE,YAAY,EAC1B,eAAe,CAAC,EAAE,MAAM,EACxB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,YAAY,CAMd;AAED,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,IAAI,EACJ,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,IAAI,EACJ,WAAW,EACX,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACT,KAAK,EACL,KAAK,EACL,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,QAAQ,EACR,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,EACT,YAAY,GACb,CAAA;AACD,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,6BAA6B,EAC7B,YAAY,EACZ,aAAa,EACb,2BAA2B,EAC3B,cAAc,EACd,0BAA0B,EAC1B,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,6BAA6B,EAC7B,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,uBAAuB,GACxB,CAAA"}
|