@mysten-incubation/devstack 0.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/LICENSE +189 -0
- package/README.md +94 -0
- package/dist/_virtual/_rolldown/runtime.mjs +13 -0
- package/dist/api/define-capabilities.d.mts +25 -0
- package/dist/api/define-capabilities.mjs +19 -0
- package/dist/api/define-capabilities.mjs.map +1 -0
- package/dist/api/define-devstack-with.d.mts +41 -0
- package/dist/api/define-devstack-with.mjs +24 -0
- package/dist/api/define-devstack-with.mjs.map +1 -0
- package/dist/api/define-devstack.d.mts +62 -0
- package/dist/api/define-devstack.mjs +108 -0
- package/dist/api/define-devstack.mjs.map +1 -0
- package/dist/api/define-plugin.d.mts +1 -0
- package/dist/api/inference-network.mjs +122 -0
- package/dist/api/inference-network.mjs.map +1 -0
- package/dist/api/mode-narrowed-factory.d.mts +26 -0
- package/dist/api/mode-narrowed-factory.mjs +8 -0
- package/dist/api/mode-narrowed-factory.mjs.map +1 -0
- package/dist/api/plugin-errors.mjs +10 -0
- package/dist/api/plugin-errors.mjs.map +1 -0
- package/dist/api/run-stack.d.mts +82 -0
- package/dist/api/run-stack.mjs +127 -0
- package/dist/api/run-stack.mjs.map +1 -0
- package/dist/build-integrations/playwright/config.d.mts +92 -0
- package/dist/build-integrations/playwright/config.mjs +71 -0
- package/dist/build-integrations/playwright/config.mjs.map +1 -0
- package/dist/build-integrations/playwright/errors.d.mts +82 -0
- package/dist/build-integrations/playwright/errors.mjs +43 -0
- package/dist/build-integrations/playwright/errors.mjs.map +1 -0
- package/dist/build-integrations/playwright/global-setup.d.mts +64 -0
- package/dist/build-integrations/playwright/global-setup.mjs +44 -0
- package/dist/build-integrations/playwright/global-setup.mjs.map +1 -0
- package/dist/build-integrations/playwright/index.d.mts +6 -0
- package/dist/build-integrations/playwright/index.mjs +6 -0
- package/dist/build-integrations/playwright/stack-context.d.mts +95 -0
- package/dist/build-integrations/playwright/stack-context.mjs +277 -0
- package/dist/build-integrations/playwright/stack-context.mjs.map +1 -0
- package/dist/build-integrations/playwright/wallet-context.d.mts +87 -0
- package/dist/build-integrations/playwright/wallet-context.mjs +148 -0
- package/dist/build-integrations/playwright/wallet-context.mjs.map +1 -0
- package/dist/build-integrations/runtime/cold-start-url.d.mts +67 -0
- package/dist/build-integrations/runtime/cold-start-url.mjs +56 -0
- package/dist/build-integrations/runtime/cold-start-url.mjs.map +1 -0
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs +10 -0
- package/dist/build-integrations/runtime/dapp-kit-slot.mjs.map +1 -0
- package/dist/build-integrations/runtime/discover.d.mts +78 -0
- package/dist/build-integrations/runtime/discover.mjs +124 -0
- package/dist/build-integrations/runtime/discover.mjs.map +1 -0
- package/dist/build-integrations/runtime/endpoint-registry.d.mts +26 -0
- package/dist/build-integrations/runtime/endpoint-registry.mjs +41 -0
- package/dist/build-integrations/runtime/endpoint-registry.mjs.map +1 -0
- package/dist/build-integrations/runtime/errors.d.mts +64 -0
- package/dist/build-integrations/runtime/errors.mjs +51 -0
- package/dist/build-integrations/runtime/errors.mjs.map +1 -0
- package/dist/build-integrations/runtime/index.d.mts +7 -0
- package/dist/build-integrations/runtime/index.mjs +6 -0
- package/dist/build-integrations/runtime/read-stack-context.d.mts +38 -0
- package/dist/build-integrations/runtime/read-stack-context.mjs +130 -0
- package/dist/build-integrations/runtime/read-stack-context.mjs.map +1 -0
- package/dist/build-integrations/runtime/stack-context.d.mts +53 -0
- package/dist/build-integrations/vitest/config.d.mts +62 -0
- package/dist/build-integrations/vitest/config.mjs +80 -0
- package/dist/build-integrations/vitest/config.mjs.map +1 -0
- package/dist/build-integrations/vitest/env.d.mts +48 -0
- package/dist/build-integrations/vitest/env.mjs +50 -0
- package/dist/build-integrations/vitest/env.mjs.map +1 -0
- package/dist/build-integrations/vitest/errors.d.mts +44 -0
- package/dist/build-integrations/vitest/errors.mjs +18 -0
- package/dist/build-integrations/vitest/errors.mjs.map +1 -0
- package/dist/build-integrations/vitest/index.d.mts +6 -0
- package/dist/build-integrations/vitest/index.mjs +6 -0
- package/dist/build-integrations/vitest/setup.d.mts +53 -0
- package/dist/build-integrations/vitest/setup.mjs +56 -0
- package/dist/build-integrations/vitest/setup.mjs.map +1 -0
- package/dist/build-integrations/vitest/stack-context.d.mts +58 -0
- package/dist/build-integrations/vitest/stack-context.mjs +67 -0
- package/dist/build-integrations/vitest/stack-context.mjs.map +1 -0
- package/dist/cli/main.d.mts +5 -0
- package/dist/cli/main.mjs +586 -0
- package/dist/cli/main.mjs.map +1 -0
- package/dist/cli/prune-direct.mjs +216 -0
- package/dist/cli/prune-direct.mjs.map +1 -0
- package/dist/cli/snapshot-reader.mjs +73 -0
- package/dist/cli/snapshot-reader.mjs.map +1 -0
- package/dist/cli/up-lifecycle.mjs +28 -0
- package/dist/cli/up-lifecycle.mjs.map +1 -0
- package/dist/contracts/capability-decl.d.mts +42 -0
- package/dist/contracts/chain-probe.d.mts +26 -0
- package/dist/contracts/chain-probe.mjs +8 -0
- package/dist/contracts/chain-probe.mjs.map +1 -0
- package/dist/contracts/codegenable.d.mts +43 -0
- package/dist/contracts/container-runtime.d.mts +245 -0
- package/dist/contracts/liveness-classifier.d.mts +19 -0
- package/dist/contracts/network-resolver.d.mts +15 -0
- package/dist/contracts/network-resolver.mjs +7 -0
- package/dist/contracts/network-resolver.mjs.map +1 -0
- package/dist/contracts/projection.d.mts +15 -0
- package/dist/contracts/routable.d.mts +53 -0
- package/dist/contracts/snapshotable.d.mts +39 -0
- package/dist/contracts/strategy-contributor.d.mts +26 -0
- package/dist/index.d.mts +89 -0
- package/dist/index.mjs +37 -0
- package/dist/orchestrators/codegen/bindings.d.mts +2 -0
- package/dist/orchestrators/codegen/bindings.mjs +340 -0
- package/dist/orchestrators/codegen/bindings.mjs.map +1 -0
- package/dist/orchestrators/codegen/emit.mjs +56 -0
- package/dist/orchestrators/codegen/emit.mjs.map +1 -0
- package/dist/orchestrators/codegen/errors.d.mts +1 -0
- package/dist/orchestrators/codegen/errors.mjs +66 -0
- package/dist/orchestrators/codegen/errors.mjs.map +1 -0
- package/dist/orchestrators/codegen/extras.mjs +16 -0
- package/dist/orchestrators/codegen/extras.mjs.map +1 -0
- package/dist/orchestrators/codegen/format.mjs +109 -0
- package/dist/orchestrators/codegen/format.mjs.map +1 -0
- package/dist/orchestrators/codegen/gitignore.mjs +67 -0
- package/dist/orchestrators/codegen/gitignore.mjs.map +1 -0
- package/dist/orchestrators/codegen/paths.d.mts +1 -0
- package/dist/orchestrators/codegen/paths.mjs +33 -0
- package/dist/orchestrators/codegen/paths.mjs.map +1 -0
- package/dist/orchestrators/codegen/permissions.mjs +6 -0
- package/dist/orchestrators/codegen/permissions.mjs.map +1 -0
- package/dist/orchestrators/codegen/service.d.mts +1 -0
- package/dist/orchestrators/codegen/service.mjs +276 -0
- package/dist/orchestrators/codegen/service.mjs.map +1 -0
- package/dist/orchestrators/router/cleanup.mjs +58 -0
- package/dist/orchestrators/router/cleanup.mjs.map +1 -0
- package/dist/orchestrators/router/cors.mjs +31 -0
- package/dist/orchestrators/router/cors.mjs.map +1 -0
- package/dist/orchestrators/router/entrypoints.d.mts +1 -0
- package/dist/orchestrators/router/entrypoints.mjs +80 -0
- package/dist/orchestrators/router/entrypoints.mjs.map +1 -0
- package/dist/orchestrators/router/errors.d.mts +1 -0
- package/dist/orchestrators/router/errors.mjs +103 -0
- package/dist/orchestrators/router/errors.mjs.map +1 -0
- package/dist/orchestrators/router/file-provider.d.mts +1 -0
- package/dist/orchestrators/router/file-provider.mjs +320 -0
- package/dist/orchestrators/router/file-provider.mjs.map +1 -0
- package/dist/orchestrators/router/hostname.d.mts +1 -0
- package/dist/orchestrators/router/hostname.mjs +107 -0
- package/dist/orchestrators/router/hostname.mjs.map +1 -0
- package/dist/orchestrators/router/index.d.mts +1 -0
- package/dist/orchestrators/router/profile.d.mts +1 -0
- package/dist/orchestrators/router/profile.mjs +109 -0
- package/dist/orchestrators/router/profile.mjs.map +1 -0
- package/dist/orchestrators/router/service.d.mts +3 -0
- package/dist/orchestrators/router/service.mjs +421 -0
- package/dist/orchestrators/router/service.mjs.map +1 -0
- package/dist/orchestrators/router/traefik-container.d.mts +1 -0
- package/dist/orchestrators/router/traefik-container.mjs +229 -0
- package/dist/orchestrators/router/traefik-container.mjs.map +1 -0
- package/dist/orchestrators/runtime-composition.d.mts +10 -0
- package/dist/orchestrators/runtime-composition.mjs +168 -0
- package/dist/orchestrators/runtime-composition.mjs.map +1 -0
- package/dist/orchestrators/snapshot/capture.d.mts +1 -0
- package/dist/orchestrators/snapshot/capture.mjs +350 -0
- package/dist/orchestrators/snapshot/capture.mjs.map +1 -0
- package/dist/orchestrators/snapshot/descriptor.d.mts +1 -0
- package/dist/orchestrators/snapshot/descriptor.mjs +109 -0
- package/dist/orchestrators/snapshot/descriptor.mjs.map +1 -0
- package/dist/orchestrators/snapshot/identity-guard.d.mts +1 -0
- package/dist/orchestrators/snapshot/identity-guard.mjs +132 -0
- package/dist/orchestrators/snapshot/identity-guard.mjs.map +1 -0
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs +207 -0
- package/dist/orchestrators/snapshot/image-bundle-tags.mjs.map +1 -0
- package/dist/orchestrators/snapshot/index.d.mts +1 -0
- package/dist/orchestrators/snapshot/integrity.d.mts +1 -0
- package/dist/orchestrators/snapshot/integrity.mjs +74 -0
- package/dist/orchestrators/snapshot/integrity.mjs.map +1 -0
- package/dist/orchestrators/snapshot/prune.d.mts +1 -0
- package/dist/orchestrators/snapshot/prune.mjs +110 -0
- package/dist/orchestrators/snapshot/prune.mjs.map +1 -0
- package/dist/orchestrators/snapshot/restore.d.mts +1 -0
- package/dist/orchestrators/snapshot/restore.mjs +404 -0
- package/dist/orchestrators/snapshot/restore.mjs.map +1 -0
- package/dist/orchestrators/snapshot/service.d.mts +1 -0
- package/dist/orchestrators/snapshot/service.mjs +296 -0
- package/dist/orchestrators/snapshot/service.mjs.map +1 -0
- package/dist/orchestrators/snapshot/state-document.mjs +18 -0
- package/dist/orchestrators/snapshot/state-document.mjs.map +1 -0
- package/dist/orchestrators/snapshot/wipe.d.mts +1 -0
- package/dist/orchestrators/snapshot/wipe.mjs +59 -0
- package/dist/orchestrators/snapshot/wipe.mjs.map +1 -0
- package/dist/plugins/account/codegen.d.mts +12 -0
- package/dist/plugins/account/codegen.mjs +22 -0
- package/dist/plugins/account/codegen.mjs.map +1 -0
- package/dist/plugins/account/errors.d.mts +44 -0
- package/dist/plugins/account/errors.mjs +16 -0
- package/dist/plugins/account/errors.mjs.map +1 -0
- package/dist/plugins/account/funding.d.mts +94 -0
- package/dist/plugins/account/funding.mjs +199 -0
- package/dist/plugins/account/funding.mjs.map +1 -0
- package/dist/plugins/account/index.d.mts +54 -0
- package/dist/plugins/account/index.mjs +151 -0
- package/dist/plugins/account/index.mjs.map +1 -0
- package/dist/plugins/account/keypair.d.mts +32 -0
- package/dist/plugins/account/keypair.mjs +99 -0
- package/dist/plugins/account/keypair.mjs.map +1 -0
- package/dist/plugins/account/lease.mjs +21 -0
- package/dist/plugins/account/lease.mjs.map +1 -0
- package/dist/plugins/account/registry.d.mts +33 -0
- package/dist/plugins/account/registry.mjs +36 -0
- package/dist/plugins/account/registry.mjs.map +1 -0
- package/dist/plugins/account/service.d.mts +104 -0
- package/dist/plugins/account/service.mjs +405 -0
- package/dist/plugins/account/service.mjs.map +1 -0
- package/dist/plugins/account/snapshot.mjs +33 -0
- package/dist/plugins/account/snapshot.mjs.map +1 -0
- package/dist/plugins/account/variants/env.mjs +24 -0
- package/dist/plugins/account/variants/env.mjs.map +1 -0
- package/dist/plugins/account/variants/ephemeral.mjs +72 -0
- package/dist/plugins/account/variants/ephemeral.mjs.map +1 -0
- package/dist/plugins/account/variants/impersonate.d.mts +16 -0
- package/dist/plugins/account/variants/impersonate.mjs +48 -0
- package/dist/plugins/account/variants/impersonate.mjs.map +1 -0
- package/dist/plugins/account/variants/inline.mjs +13 -0
- package/dist/plugins/account/variants/inline.mjs.map +1 -0
- package/dist/plugins/account/variants/keystore.mjs +93 -0
- package/dist/plugins/account/variants/keystore.mjs.map +1 -0
- package/dist/plugins/account/variants/signer.mjs +31 -0
- package/dist/plugins/account/variants/signer.mjs.map +1 -0
- package/dist/plugins/action/build-context.d.mts +41 -0
- package/dist/plugins/action/discriminator.d.mts +20 -0
- package/dist/plugins/action/discriminator.mjs +13 -0
- package/dist/plugins/action/discriminator.mjs.map +1 -0
- package/dist/plugins/action/errors.d.mts +31 -0
- package/dist/plugins/action/errors.mjs +13 -0
- package/dist/plugins/action/errors.mjs.map +1 -0
- package/dist/plugins/action/execute.d.mts +2 -0
- package/dist/plugins/action/execute.mjs +145 -0
- package/dist/plugins/action/execute.mjs.map +1 -0
- package/dist/plugins/action/index.d.mts +56 -0
- package/dist/plugins/action/index.mjs +82 -0
- package/dist/plugins/action/index.mjs.map +1 -0
- package/dist/plugins/action/service.d.mts +26 -0
- package/dist/plugins/action/service.mjs +84 -0
- package/dist/plugins/action/service.mjs.map +1 -0
- package/dist/plugins/coin/address-resolution.d.mts +34 -0
- package/dist/plugins/coin/address-resolution.mjs +80 -0
- package/dist/plugins/coin/address-resolution.mjs.map +1 -0
- package/dist/plugins/coin/codegen.d.mts +16 -0
- package/dist/plugins/coin/codegen.mjs +21 -0
- package/dist/plugins/coin/codegen.mjs.map +1 -0
- package/dist/plugins/coin/discovery.d.mts +26 -0
- package/dist/plugins/coin/discovery.mjs +112 -0
- package/dist/plugins/coin/discovery.mjs.map +1 -0
- package/dist/plugins/coin/errors.d.mts +48 -0
- package/dist/plugins/coin/errors.mjs +13 -0
- package/dist/plugins/coin/errors.mjs.map +1 -0
- package/dist/plugins/coin/index.d.mts +95 -0
- package/dist/plugins/coin/index.mjs +172 -0
- package/dist/plugins/coin/index.mjs.map +1 -0
- package/dist/plugins/coin/metadata.d.mts +15 -0
- package/dist/plugins/coin/metadata.mjs +99 -0
- package/dist/plugins/coin/metadata.mjs.map +1 -0
- package/dist/plugins/coin/mint.d.mts +34 -0
- package/dist/plugins/coin/mint.mjs +164 -0
- package/dist/plugins/coin/mint.mjs.map +1 -0
- package/dist/plugins/coin/registry.d.mts +1 -0
- package/dist/plugins/coin/registry.mjs +37 -0
- package/dist/plugins/coin/registry.mjs.map +1 -0
- package/dist/plugins/coin/service.d.mts +47 -0
- package/dist/plugins/coin/service.mjs +51 -0
- package/dist/plugins/coin/service.mjs.map +1 -0
- package/dist/plugins/coin/snapshot.mjs +19 -0
- package/dist/plugins/coin/snapshot.mjs.map +1 -0
- package/dist/plugins/coin/type-strings.mjs +49 -0
- package/dist/plugins/coin/type-strings.mjs.map +1 -0
- package/dist/plugins/deepbook/codegen.d.mts +39 -0
- package/dist/plugins/deepbook/codegen.mjs +15 -0
- package/dist/plugins/deepbook/codegen.mjs.map +1 -0
- package/dist/plugins/deepbook/deploy.mjs +437 -0
- package/dist/plugins/deepbook/deploy.mjs.map +1 -0
- package/dist/plugins/deepbook/errors.d.mts +29 -0
- package/dist/plugins/deepbook/errors.mjs +26 -0
- package/dist/plugins/deepbook/errors.mjs.map +1 -0
- package/dist/plugins/deepbook/faucet-strategy.d.mts +8 -0
- package/dist/plugins/deepbook/faucet-strategy.mjs +81 -0
- package/dist/plugins/deepbook/faucet-strategy.mjs.map +1 -0
- package/dist/plugins/deepbook/index.d.mts +171 -0
- package/dist/plugins/deepbook/index.mjs +359 -0
- package/dist/plugins/deepbook/index.mjs.map +1 -0
- package/dist/plugins/deepbook/plugin-key.mjs +7 -0
- package/dist/plugins/deepbook/plugin-key.mjs.map +1 -0
- package/dist/plugins/deepbook/pyth/index.mjs +226 -0
- package/dist/plugins/deepbook/pyth/index.mjs.map +1 -0
- package/dist/plugins/deepbook/routable.mjs +21 -0
- package/dist/plugins/deepbook/routable.mjs.map +1 -0
- package/dist/plugins/deepbook/snapshot.mjs +49 -0
- package/dist/plugins/deepbook/snapshot.mjs.map +1 -0
- package/dist/plugins/deepbook/types.d.mts +125 -0
- package/dist/plugins/deepbook/types.mjs +12 -0
- package/dist/plugins/deepbook/types.mjs.map +1 -0
- package/dist/plugins/faucet/dispatcher.d.mts +9 -0
- package/dist/plugins/faucet/dispatcher.mjs +13 -0
- package/dist/plugins/faucet/dispatcher.mjs.map +1 -0
- package/dist/plugins/faucet/errors.d.mts +86 -0
- package/dist/plugins/faucet/errors.mjs +19 -0
- package/dist/plugins/faucet/errors.mjs.map +1 -0
- package/dist/plugins/faucet/http.mjs +127 -0
- package/dist/plugins/faucet/http.mjs.map +1 -0
- package/dist/plugins/faucet/index.d.mts +43 -0
- package/dist/plugins/faucet/index.mjs +42 -0
- package/dist/plugins/faucet/index.mjs.map +1 -0
- package/dist/plugins/faucet/service.d.mts +20 -0
- package/dist/plugins/faucet/strategies/sui-local.d.mts +23 -0
- package/dist/plugins/faucet/strategies/sui-local.mjs +29 -0
- package/dist/plugins/faucet/strategies/sui-local.mjs.map +1 -0
- package/dist/plugins/host-service/errors.d.mts +27 -0
- package/dist/plugins/host-service/errors.mjs +14 -0
- package/dist/plugins/host-service/errors.mjs.map +1 -0
- package/dist/plugins/host-service/index.d.mts +10 -0
- package/dist/plugins/host-service/index.mjs +48 -0
- package/dist/plugins/host-service/index.mjs.map +1 -0
- package/dist/plugins/host-service/routable.mjs +24 -0
- package/dist/plugins/host-service/routable.mjs.map +1 -0
- package/dist/plugins/host-service/service.d.mts +49 -0
- package/dist/plugins/host-service/service.mjs +375 -0
- package/dist/plugins/host-service/service.mjs.map +1 -0
- package/dist/plugins/package/build.d.mts +1 -0
- package/dist/plugins/package/build.mjs +24 -0
- package/dist/plugins/package/build.mjs.map +1 -0
- package/dist/plugins/package/codegen.d.mts +19 -0
- package/dist/plugins/package/codegen.mjs +41 -0
- package/dist/plugins/package/codegen.mjs.map +1 -0
- package/dist/plugins/package/dep-resolution.mjs +10 -0
- package/dist/plugins/package/dep-resolution.mjs.map +1 -0
- package/dist/plugins/package/errors.d.mts +34 -0
- package/dist/plugins/package/errors.mjs +13 -0
- package/dist/plugins/package/errors.mjs.map +1 -0
- package/dist/plugins/package/index.d.mts +109 -0
- package/dist/plugins/package/index.mjs +207 -0
- package/dist/plugins/package/index.mjs.map +1 -0
- package/dist/plugins/package/mode-known.mjs +41 -0
- package/dist/plugins/package/mode-known.mjs.map +1 -0
- package/dist/plugins/package/mode-local.d.mts +1 -0
- package/dist/plugins/package/mode-local.mjs +183 -0
- package/dist/plugins/package/mode-local.mjs.map +1 -0
- package/dist/plugins/package/publish-executor.mjs +202 -0
- package/dist/plugins/package/publish-executor.mjs.map +1 -0
- package/dist/plugins/package/publish-output.d.mts +28 -0
- package/dist/plugins/package/publish-output.mjs +45 -0
- package/dist/plugins/package/publish-output.mjs.map +1 -0
- package/dist/plugins/package/registry.d.mts +25 -0
- package/dist/plugins/package/registry.mjs +30 -0
- package/dist/plugins/package/registry.mjs.map +1 -0
- package/dist/plugins/package/service.mjs +20 -0
- package/dist/plugins/package/service.mjs.map +1 -0
- package/dist/plugins/package/snapshot.mjs +25 -0
- package/dist/plugins/package/snapshot.mjs.map +1 -0
- package/dist/plugins/postgres/codegen.mjs +42 -0
- package/dist/plugins/postgres/codegen.mjs.map +1 -0
- package/dist/plugins/postgres/connection.d.mts +33 -0
- package/dist/plugins/postgres/connection.mjs +19 -0
- package/dist/plugins/postgres/connection.mjs.map +1 -0
- package/dist/plugins/postgres/db-ensure.mjs +100 -0
- package/dist/plugins/postgres/db-ensure.mjs.map +1 -0
- package/dist/plugins/postgres/errors.d.mts +55 -0
- package/dist/plugins/postgres/errors.mjs +29 -0
- package/dist/plugins/postgres/errors.mjs.map +1 -0
- package/dist/plugins/postgres/index.d.mts +37 -0
- package/dist/plugins/postgres/index.mjs +75 -0
- package/dist/plugins/postgres/index.mjs.map +1 -0
- package/dist/plugins/postgres/routable.mjs +33 -0
- package/dist/plugins/postgres/routable.mjs.map +1 -0
- package/dist/plugins/postgres/service.d.mts +50 -0
- package/dist/plugins/postgres/service.mjs +145 -0
- package/dist/plugins/postgres/service.mjs.map +1 -0
- package/dist/plugins/postgres/snapshot.d.mts +1 -0
- package/dist/plugins/postgres/snapshot.mjs +32 -0
- package/dist/plugins/postgres/snapshot.mjs.map +1 -0
- package/dist/plugins/router-entrypoints.mjs +21 -0
- package/dist/plugins/router-entrypoints.mjs.map +1 -0
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs +59 -0
- package/dist/plugins/seal/bootstrap-assets/cargo-image.mjs.map +1 -0
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs +132 -0
- package/dist/plugins/seal/bootstrap-assets/source-fetch.mjs.map +1 -0
- package/dist/plugins/seal/codegen.d.mts +19 -0
- package/dist/plugins/seal/codegen.mjs +16 -0
- package/dist/plugins/seal/codegen.mjs.map +1 -0
- package/dist/plugins/seal/config-render.mjs +82 -0
- package/dist/plugins/seal/config-render.mjs.map +1 -0
- package/dist/plugins/seal/deploy.mjs +198 -0
- package/dist/plugins/seal/deploy.mjs.map +1 -0
- package/dist/plugins/seal/errors.d.mts +52 -0
- package/dist/plugins/seal/errors.mjs +19 -0
- package/dist/plugins/seal/errors.mjs.map +1 -0
- package/dist/plugins/seal/index.d.mts +161 -0
- package/dist/plugins/seal/index.mjs +235 -0
- package/dist/plugins/seal/index.mjs.map +1 -0
- package/dist/plugins/seal/key-manager.d.mts +22 -0
- package/dist/plugins/seal/key-manager.mjs +22 -0
- package/dist/plugins/seal/key-manager.mjs.map +1 -0
- package/dist/plugins/seal/key-server.mjs +175 -0
- package/dist/plugins/seal/key-server.mjs.map +1 -0
- package/dist/plugins/seal/keygen.mjs +96 -0
- package/dist/plugins/seal/keygen.mjs.map +1 -0
- package/dist/plugins/seal/mode/fork-known.d.mts +8 -0
- package/dist/plugins/seal/mode/fork-known.mjs +23 -0
- package/dist/plugins/seal/mode/fork-known.mjs.map +1 -0
- package/dist/plugins/seal/mode/live.d.mts +18 -0
- package/dist/plugins/seal/mode/live.mjs +64 -0
- package/dist/plugins/seal/mode/live.mjs.map +1 -0
- package/dist/plugins/seal/mode/local-keygen.mjs +180 -0
- package/dist/plugins/seal/mode/local-keygen.mjs.map +1 -0
- package/dist/plugins/seal/plugin-key.mjs +7 -0
- package/dist/plugins/seal/plugin-key.mjs.map +1 -0
- package/dist/plugins/seal/registry-publish.d.mts +43 -0
- package/dist/plugins/seal/registry-publish.mjs +9 -0
- package/dist/plugins/seal/registry-publish.mjs.map +1 -0
- package/dist/plugins/seal/routable.mjs +57 -0
- package/dist/plugins/seal/routable.mjs.map +1 -0
- package/dist/plugins/seal/service.mjs +17 -0
- package/dist/plugins/seal/service.mjs.map +1 -0
- package/dist/plugins/seal/snapshot.mjs +51 -0
- package/dist/plugins/seal/snapshot.mjs.map +1 -0
- package/dist/plugins/sui/auto-tick.mjs +45 -0
- package/dist/plugins/sui/auto-tick.mjs.map +1 -0
- package/dist/plugins/sui/chain-build-container.d.mts +1 -0
- package/dist/plugins/sui/chain-probe.d.mts +85 -0
- package/dist/plugins/sui/chain-probe.mjs +104 -0
- package/dist/plugins/sui/chain-probe.mjs.map +1 -0
- package/dist/plugins/sui/codegen.d.mts +14 -0
- package/dist/plugins/sui/codegen.mjs +26 -0
- package/dist/plugins/sui/codegen.mjs.map +1 -0
- package/dist/plugins/sui/errors.d.mts +74 -0
- package/dist/plugins/sui/errors.mjs +28 -0
- package/dist/plugins/sui/errors.mjs.map +1 -0
- package/dist/plugins/sui/fork-orchestration.mjs +24 -0
- package/dist/plugins/sui/fork-orchestration.mjs.map +1 -0
- package/dist/plugins/sui/fork-transaction.mjs +96 -0
- package/dist/plugins/sui/fork-transaction.mjs.map +1 -0
- package/dist/plugins/sui/index.d.mts +318 -0
- package/dist/plugins/sui/index.mjs +182 -0
- package/dist/plugins/sui/index.mjs.map +1 -0
- package/dist/plugins/sui/mode/external.mjs +60 -0
- package/dist/plugins/sui/mode/external.mjs.map +1 -0
- package/dist/plugins/sui/mode/fork.mjs +283 -0
- package/dist/plugins/sui/mode/fork.mjs.map +1 -0
- package/dist/plugins/sui/mode/live.mjs +103 -0
- package/dist/plugins/sui/mode/live.mjs.map +1 -0
- package/dist/plugins/sui/mode/local.mjs +293 -0
- package/dist/plugins/sui/mode/local.mjs.map +1 -0
- package/dist/plugins/sui/mode/shared-boot.mjs +254 -0
- package/dist/plugins/sui/mode/shared-boot.mjs.map +1 -0
- package/dist/plugins/sui/mode/shared.d.mts +103 -0
- package/dist/plugins/sui/mode/shared.mjs +12 -0
- package/dist/plugins/sui/mode/shared.mjs.map +1 -0
- package/dist/plugins/sui/mode/spec.d.mts +94 -0
- package/dist/plugins/sui/network-resolver.d.mts +23 -0
- package/dist/plugins/sui/routable.mjs +88 -0
- package/dist/plugins/sui/routable.mjs.map +1 -0
- package/dist/plugins/sui/seed-objects.d.mts +18 -0
- package/dist/plugins/sui/seed-objects.mjs +25 -0
- package/dist/plugins/sui/seed-objects.mjs.map +1 -0
- package/dist/plugins/sui/service.mjs +38 -0
- package/dist/plugins/sui/service.mjs.map +1 -0
- package/dist/plugins/sui/snapshot.mjs +53 -0
- package/dist/plugins/sui/snapshot.mjs.map +1 -0
- package/dist/plugins/wallet/codegen.d.mts +33 -0
- package/dist/plugins/wallet/codegen.mjs +34 -0
- package/dist/plugins/wallet/codegen.mjs.map +1 -0
- package/dist/plugins/wallet/errors.d.mts +66 -0
- package/dist/plugins/wallet/errors.mjs +16 -0
- package/dist/plugins/wallet/errors.mjs.map +1 -0
- package/dist/plugins/wallet/index.d.mts +63 -0
- package/dist/plugins/wallet/index.mjs +126 -0
- package/dist/plugins/wallet/index.mjs.map +1 -0
- package/dist/plugins/wallet/origin-policy.d.mts +1 -0
- package/dist/plugins/wallet/origin-policy.mjs +65 -0
- package/dist/plugins/wallet/origin-policy.mjs.map +1 -0
- package/dist/plugins/wallet/pairing.d.mts +11 -0
- package/dist/plugins/wallet/pairing.mjs +125 -0
- package/dist/plugins/wallet/pairing.mjs.map +1 -0
- package/dist/plugins/wallet/protocol.d.mts +1 -0
- package/dist/plugins/wallet/protocol.mjs +96 -0
- package/dist/plugins/wallet/protocol.mjs.map +1 -0
- package/dist/plugins/wallet/routable.mjs +32 -0
- package/dist/plugins/wallet/routable.mjs.map +1 -0
- package/dist/plugins/wallet/server.d.mts +12 -0
- package/dist/plugins/wallet/server.mjs +317 -0
- package/dist/plugins/wallet/server.mjs.map +1 -0
- package/dist/plugins/wallet/service.d.mts +68 -0
- package/dist/plugins/wallet/service.mjs +97 -0
- package/dist/plugins/wallet/service.mjs.map +1 -0
- package/dist/plugins/wallet/snapshot.d.mts +1 -0
- package/dist/plugins/wallet/snapshot.mjs +14 -0
- package/dist/plugins/wallet/snapshot.mjs.map +1 -0
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs +42 -0
- package/dist/plugins/walrus/bootstrap-assets/cargo-image.mjs.map +1 -0
- package/dist/plugins/walrus/codegen.d.mts +38 -0
- package/dist/plugins/walrus/codegen.mjs +34 -0
- package/dist/plugins/walrus/codegen.mjs.map +1 -0
- package/dist/plugins/walrus/deploy-paths.mjs +14 -0
- package/dist/plugins/walrus/deploy-paths.mjs.map +1 -0
- package/dist/plugins/walrus/deploy.d.mts +1 -0
- package/dist/plugins/walrus/deploy.mjs +224 -0
- package/dist/plugins/walrus/deploy.mjs.map +1 -0
- package/dist/plugins/walrus/errors.d.mts +38 -0
- package/dist/plugins/walrus/errors.mjs +26 -0
- package/dist/plugins/walrus/errors.mjs.map +1 -0
- package/dist/plugins/walrus/faucet-strategy.d.mts +12 -0
- package/dist/plugins/walrus/faucet-strategy.mjs +62 -0
- package/dist/plugins/walrus/faucet-strategy.mjs.map +1 -0
- package/dist/plugins/walrus/index.d.mts +177 -0
- package/dist/plugins/walrus/index.mjs +284 -0
- package/dist/plugins/walrus/index.mjs.map +1 -0
- package/dist/plugins/walrus/mode/known-deploy.d.mts +25 -0
- package/dist/plugins/walrus/mode/known-deploy.mjs +71 -0
- package/dist/plugins/walrus/mode/known-deploy.mjs.map +1 -0
- package/dist/plugins/walrus/mode/local-cluster.d.mts +34 -0
- package/dist/plugins/walrus/mode/local-cluster.mjs +153 -0
- package/dist/plugins/walrus/mode/local-cluster.mjs.map +1 -0
- package/dist/plugins/walrus/plugin-key.mjs +7 -0
- package/dist/plugins/walrus/plugin-key.mjs.map +1 -0
- package/dist/plugins/walrus/registry-publish.d.mts +24 -0
- package/dist/plugins/walrus/registry-publish.mjs +7 -0
- package/dist/plugins/walrus/registry-publish.mjs.map +1 -0
- package/dist/plugins/walrus/routable.mjs +99 -0
- package/dist/plugins/walrus/routable.mjs.map +1 -0
- package/dist/plugins/walrus/service.mjs +20 -0
- package/dist/plugins/walrus/service.mjs.map +1 -0
- package/dist/plugins/walrus/snapshot.mjs +53 -0
- package/dist/plugins/walrus/snapshot.mjs.map +1 -0
- package/dist/plugins/walrus/storage-nodes.d.mts +15 -0
- package/dist/plugins/walrus/storage-nodes.mjs +154 -0
- package/dist/plugins/walrus/storage-nodes.mjs.map +1 -0
- package/dist/plugins/walrus/wal-swap.d.mts +2 -0
- package/dist/plugins/walrus/wal-swap.mjs +58 -0
- package/dist/plugins/walrus/wal-swap.mjs.map +1 -0
- package/dist/primitives/artifact-publisher.d.mts +12 -0
- package/dist/primitives/cache.d.mts +1 -0
- package/dist/runtime/built-in-plugin-layers.mjs +49 -0
- package/dist/runtime/built-in-plugin-layers.mjs.map +1 -0
- package/dist/runtime/docker/client.d.mts +2 -0
- package/dist/runtime/docker/client.mjs +54 -0
- package/dist/runtime/docker/client.mjs.map +1 -0
- package/dist/runtime/docker/container.d.mts +1 -0
- package/dist/runtime/docker/container.mjs +562 -0
- package/dist/runtime/docker/container.mjs.map +1 -0
- package/dist/runtime/docker/errors.d.mts +1 -0
- package/dist/runtime/docker/errors.mjs +187 -0
- package/dist/runtime/docker/errors.mjs.map +1 -0
- package/dist/runtime/docker/exec.d.mts +1 -0
- package/dist/runtime/docker/exec.mjs +63 -0
- package/dist/runtime/docker/exec.mjs.map +1 -0
- package/dist/runtime/docker/image.d.mts +1 -0
- package/dist/runtime/docker/image.mjs +278 -0
- package/dist/runtime/docker/image.mjs.map +1 -0
- package/dist/runtime/docker/index.d.mts +1 -0
- package/dist/runtime/docker/inventory.d.mts +1 -0
- package/dist/runtime/docker/inventory.mjs +167 -0
- package/dist/runtime/docker/inventory.mjs.map +1 -0
- package/dist/runtime/docker/labels.d.mts +1 -0
- package/dist/runtime/docker/labels.mjs +97 -0
- package/dist/runtime/docker/labels.mjs.map +1 -0
- package/dist/runtime/docker/logs.d.mts +1 -0
- package/dist/runtime/docker/logs.mjs +34 -0
- package/dist/runtime/docker/logs.mjs.map +1 -0
- package/dist/runtime/docker/network.d.mts +1 -0
- package/dist/runtime/docker/network.mjs +168 -0
- package/dist/runtime/docker/network.mjs.map +1 -0
- package/dist/runtime/docker/service.d.mts +9 -0
- package/dist/runtime/docker/service.mjs +266 -0
- package/dist/runtime/docker/service.mjs.map +1 -0
- package/dist/runtime/docker/sweep.d.mts +1 -0
- package/dist/runtime/docker/sweep.mjs +220 -0
- package/dist/runtime/docker/sweep.mjs.map +1 -0
- package/dist/runtime/docker/volume.d.mts +1 -0
- package/dist/runtime/docker/volume.mjs +24 -0
- package/dist/runtime/docker/volume.mjs.map +1 -0
- package/dist/runtime/docker/wrap.d.mts +1 -0
- package/dist/runtime/docker/wrap.mjs +131 -0
- package/dist/runtime/docker/wrap.mjs.map +1 -0
- package/dist/substrate/brand.d.mts +24 -0
- package/dist/substrate/brand.mjs +14 -0
- package/dist/substrate/brand.mjs.map +1 -0
- package/dist/substrate/cross-process.d.mts +1 -0
- package/dist/substrate/cross-process.mjs +28 -0
- package/dist/substrate/cross-process.mjs.map +1 -0
- package/dist/substrate/events.d.mts +117 -0
- package/dist/substrate/identity.d.mts +13 -0
- package/dist/substrate/lifecycle.d.mts +12 -0
- package/dist/substrate/manifest.d.mts +39 -0
- package/dist/substrate/manifest.mjs +33 -0
- package/dist/substrate/manifest.mjs.map +1 -0
- package/dist/substrate/network.d.mts +34 -0
- package/dist/substrate/options.d.mts +23 -0
- package/dist/substrate/plugin.d.mts +101 -0
- package/dist/substrate/plugin.mjs +61 -0
- package/dist/substrate/plugin.mjs.map +1 -0
- package/dist/substrate/projection.d.mts +100 -0
- package/dist/substrate/runtime/artifact-publisher/index.mjs +76 -0
- package/dist/substrate/runtime/artifact-publisher/index.mjs.map +1 -0
- package/dist/substrate/runtime/atomic-write.mjs +106 -0
- package/dist/substrate/runtime/atomic-write.mjs.map +1 -0
- package/dist/substrate/runtime/cache/index.d.mts +1 -0
- package/dist/substrate/runtime/cache/schema.d.mts +1 -0
- package/dist/substrate/runtime/cache/schema.mjs +22 -0
- package/dist/substrate/runtime/cache/schema.mjs.map +1 -0
- package/dist/substrate/runtime/cache/service.d.mts +1 -0
- package/dist/substrate/runtime/cache/service.mjs +89 -0
- package/dist/substrate/runtime/cache/service.mjs.map +1 -0
- package/dist/substrate/runtime/capability-sinks/index.d.mts +1 -0
- package/dist/substrate/runtime/capability-sinks/layer.d.mts +1 -0
- package/dist/substrate/runtime/capability-sinks/layer.mjs +31 -0
- package/dist/substrate/runtime/capability-sinks/layer.mjs.map +1 -0
- package/dist/substrate/runtime/capability-sinks/service.d.mts +36 -0
- package/dist/substrate/runtime/capability-sinks/service.mjs +74 -0
- package/dist/substrate/runtime/capability-sinks/service.mjs.map +1 -0
- package/dist/substrate/runtime/config-validation.d.mts +38 -0
- package/dist/substrate/runtime/config-validation.mjs +137 -0
- package/dist/substrate/runtime/config-validation.mjs.map +1 -0
- package/dist/substrate/runtime/context-helpers.mjs +32 -0
- package/dist/substrate/runtime/context-helpers.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs +128 -0
- package/dist/substrate/runtime/cross-process/command-channel/channel.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs +136 -0
- package/dist/substrate/runtime/cross-process/command-channel/file-channel.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs +49 -0
- package/dist/substrate/runtime/cross-process/command-channel/protocol.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs +9 -0
- package/dist/substrate/runtime/cross-process/command-channel/runtime-control-lock.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/liveness.mjs +119 -0
- package/dist/substrate/runtime/cross-process/liveness.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/roster.mjs +275 -0
- package/dist/substrate/runtime/cross-process/roster.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.d.mts +1 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs +117 -0
- package/dist/substrate/runtime/cross-process/snapshot-reservation.mjs.map +1 -0
- package/dist/substrate/runtime/cross-process/stack-lock.d.mts +1 -0
- package/dist/substrate/runtime/cross-process/stack-lock.mjs +142 -0
- package/dist/substrate/runtime/cross-process/stack-lock.mjs.map +1 -0
- package/dist/substrate/runtime/current-plugin.mjs +15 -0
- package/dist/substrate/runtime/current-plugin.mjs.map +1 -0
- package/dist/substrate/runtime/errors.d.mts +1 -0
- package/dist/substrate/runtime/errors.mjs +76 -0
- package/dist/substrate/runtime/errors.mjs.map +1 -0
- package/dist/substrate/runtime/host-tree-tar/index.mjs +364 -0
- package/dist/substrate/runtime/host-tree-tar/index.mjs.map +1 -0
- package/dist/substrate/runtime/http-probe.d.mts +35 -0
- package/dist/substrate/runtime/http-probe.mjs +65 -0
- package/dist/substrate/runtime/http-probe.mjs.map +1 -0
- package/dist/substrate/runtime/lease-broker/index.d.mts +1 -0
- package/dist/substrate/runtime/lease-broker/service.d.mts +64 -0
- package/dist/substrate/runtime/lease-broker/service.mjs +155 -0
- package/dist/substrate/runtime/lease-broker/service.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs +138 -0
- package/dist/substrate/runtime/lifecycle/dep-graph.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/index.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs +31 -0
- package/dist/substrate/runtime/lifecycle/lifecycle-fact.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs +133 -0
- package/dist/substrate/runtime/lifecycle/plugin-registry.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs +34 -0
- package/dist/substrate/runtime/lifecycle/ready-gate.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs +43 -0
- package/dist/substrate/runtime/lifecycle/selective-restart.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/signals.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/signals.mjs +64 -0
- package/dist/substrate/runtime/lifecycle/signals.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/state-machine.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/state-machine.mjs +38 -0
- package/dist/substrate/runtime/lifecycle/state-machine.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +27 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -0
- package/dist/substrate/runtime/managed-container.d.mts +30 -0
- package/dist/substrate/runtime/managed-container.mjs +32 -0
- package/dist/substrate/runtime/managed-container.mjs.map +1 -0
- package/dist/substrate/runtime/manifest/manifest.mjs +73 -0
- package/dist/substrate/runtime/manifest/manifest.mjs.map +1 -0
- package/dist/substrate/runtime/mode-errors.d.mts +36 -0
- package/dist/substrate/runtime/observability/cascade-formatter.d.mts +1 -0
- package/dist/substrate/runtime/observability/cascade-formatter.mjs +135 -0
- package/dist/substrate/runtime/observability/cascade-formatter.mjs.map +1 -0
- package/dist/substrate/runtime/observability/formatter-registry.d.mts +1 -0
- package/dist/substrate/runtime/observability/formatter-registry.mjs +65 -0
- package/dist/substrate/runtime/observability/formatter-registry.mjs.map +1 -0
- package/dist/substrate/runtime/observability/index.d.mts +3 -0
- package/dist/substrate/runtime/observability/logger.d.mts +58 -0
- package/dist/substrate/runtime/observability/logger.mjs +89 -0
- package/dist/substrate/runtime/observability/logger.mjs.map +1 -0
- package/dist/substrate/runtime/observability/pretty-error.d.mts +1 -0
- package/dist/substrate/runtime/observability/pretty-error.mjs +119 -0
- package/dist/substrate/runtime/observability/pretty-error.mjs.map +1 -0
- package/dist/substrate/runtime/observability/process-lines.d.mts +31 -0
- package/dist/substrate/runtime/observability/process-lines.mjs +40 -0
- package/dist/substrate/runtime/observability/process-lines.mjs.map +1 -0
- package/dist/substrate/runtime/observability/redaction.d.mts +28 -0
- package/dist/substrate/runtime/observability/redaction.mjs +45 -0
- package/dist/substrate/runtime/observability/redaction.mjs.map +1 -0
- package/dist/substrate/runtime/observability/spans.d.mts +1 -0
- package/dist/substrate/runtime/observability/spans.mjs +87 -0
- package/dist/substrate/runtime/observability/spans.mjs.map +1 -0
- package/dist/substrate/runtime/observability/subprocess-capture.d.mts +2 -0
- package/dist/substrate/runtime/observability/subprocess-capture.mjs +82 -0
- package/dist/substrate/runtime/observability/subprocess-capture.mjs.map +1 -0
- package/dist/substrate/runtime/paths.d.mts +17 -0
- package/dist/substrate/runtime/paths.mjs +61 -0
- package/dist/substrate/runtime/paths.mjs.map +1 -0
- package/dist/substrate/runtime/port-broker/index.d.mts +1 -0
- package/dist/substrate/runtime/port-broker/service.d.mts +1 -0
- package/dist/substrate/runtime/port-broker/service.mjs +319 -0
- package/dist/substrate/runtime/port-broker/service.mjs.map +1 -0
- package/dist/substrate/runtime/post-acquire-tasks.d.mts +1 -0
- package/dist/substrate/runtime/post-acquire-tasks.mjs +34 -0
- package/dist/substrate/runtime/post-acquire-tasks.mjs.map +1 -0
- package/dist/substrate/runtime/probes.d.mts +51 -0
- package/dist/substrate/runtime/probes.mjs +84 -0
- package/dist/substrate/runtime/probes.mjs.map +1 -0
- package/dist/substrate/runtime/process-supervisor.d.mts +57 -0
- package/dist/substrate/runtime/process-supervisor.mjs +73 -0
- package/dist/substrate/runtime/process-supervisor.mjs.map +1 -0
- package/dist/substrate/runtime/projection/operational-endpoints.mjs +44 -0
- package/dist/substrate/runtime/projection/operational-endpoints.mjs.map +1 -0
- package/dist/substrate/runtime/projection/persisted.mjs +195 -0
- package/dist/substrate/runtime/projection/persisted.mjs.map +1 -0
- package/dist/substrate/runtime/projection/state-ref.mjs +48 -0
- package/dist/substrate/runtime/projection/state-ref.mjs.map +1 -0
- package/dist/substrate/runtime/projection/update.mjs +200 -0
- package/dist/substrate/runtime/projection/update.mjs.map +1 -0
- package/dist/substrate/runtime/retry-policy.d.mts +18 -0
- package/dist/substrate/runtime/retry-policy.mjs +16 -0
- package/dist/substrate/runtime/retry-policy.mjs.map +1 -0
- package/dist/substrate/runtime/run.mjs +86 -0
- package/dist/substrate/runtime/run.mjs.map +1 -0
- package/dist/substrate/runtime/runtime-decode.d.mts +32 -0
- package/dist/substrate/runtime/runtime-decode.mjs +53 -0
- package/dist/substrate/runtime/runtime-decode.mjs.map +1 -0
- package/dist/substrate/runtime/scoped-http-server.mjs +36 -0
- package/dist/substrate/runtime/scoped-http-server.mjs.map +1 -0
- package/dist/substrate/runtime/scoped-ref-map/service.mjs +83 -0
- package/dist/substrate/runtime/scoped-ref-map/service.mjs.map +1 -0
- package/dist/substrate/runtime/stage-and-swap/index.d.mts +1 -0
- package/dist/substrate/runtime/stage-and-swap/index.mjs +131 -0
- package/dist/substrate/runtime/stage-and-swap/index.mjs.map +1 -0
- package/dist/substrate/runtime/state-store/schema.mjs +36 -0
- package/dist/substrate/runtime/state-store/schema.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs +22 -0
- package/dist/substrate/runtime/strategy-registry/chain-probe-for.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs +30 -0
- package/dist/substrate/runtime/strategy-registry/faucet-capability-for.mjs.map +1 -0
- package/dist/substrate/runtime/strategy-registry/index.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/service.d.mts +1 -0
- package/dist/substrate/runtime/strategy-registry/service.mjs +67 -0
- package/dist/substrate/runtime/strategy-registry/service.mjs.map +1 -0
- package/dist/substrate/runtime/sui-execute/index.d.mts +11 -0
- package/dist/substrate/runtime/sui-execute/index.mjs +144 -0
- package/dist/substrate/runtime/sui-execute/index.mjs.map +1 -0
- package/dist/substrate/runtime/sui-move-build/index.d.mts +1 -0
- package/dist/substrate/runtime/sui-move-build/index.mjs +283 -0
- package/dist/substrate/runtime/sui-move-build/index.mjs.map +1 -0
- package/dist/substrate/runtime/supervisor.d.mts +1 -0
- package/dist/substrate/runtime/supervisor.mjs +831 -0
- package/dist/substrate/runtime/supervisor.mjs.map +1 -0
- package/dist/surfaces/cli/command-tree.mjs +276 -0
- package/dist/surfaces/cli/command-tree.mjs.map +1 -0
- package/dist/surfaces/cli/commands/config.mjs +31 -0
- package/dist/surfaces/cli/commands/config.mjs.map +1 -0
- package/dist/surfaces/cli/commands/confirm-node.mjs +26 -0
- package/dist/surfaces/cli/commands/confirm-node.mjs.map +1 -0
- package/dist/surfaces/cli/commands/confirm.mjs +26 -0
- package/dist/surfaces/cli/commands/confirm.mjs.map +1 -0
- package/dist/surfaces/cli/commands/doctor-probes.mjs +452 -0
- package/dist/surfaces/cli/commands/doctor-probes.mjs.map +1 -0
- package/dist/surfaces/cli/commands/doctor.mjs +38 -0
- package/dist/surfaces/cli/commands/doctor.mjs.map +1 -0
- package/dist/surfaces/cli/commands/prune-picker.mjs +347 -0
- package/dist/surfaces/cli/commands/prune-picker.mjs.map +1 -0
- package/dist/surfaces/cli/commands/prune.mjs +178 -0
- package/dist/surfaces/cli/commands/prune.mjs.map +1 -0
- package/dist/surfaces/cli/commands/snapshot.mjs +141 -0
- package/dist/surfaces/cli/commands/snapshot.mjs.map +1 -0
- package/dist/surfaces/cli/commands/status.mjs +95 -0
- package/dist/surfaces/cli/commands/status.mjs.map +1 -0
- package/dist/surfaces/cli/commands/supervisor-presence.mjs +33 -0
- package/dist/surfaces/cli/commands/supervisor-presence.mjs.map +1 -0
- package/dist/surfaces/cli/commands/wipe.mjs +28 -0
- package/dist/surfaces/cli/commands/wipe.mjs.map +1 -0
- package/dist/surfaces/cli/envelope.mjs +43 -0
- package/dist/surfaces/cli/envelope.mjs.map +1 -0
- package/dist/surfaces/cli/errors.mjs +110 -0
- package/dist/surfaces/cli/errors.mjs.map +1 -0
- package/dist/surfaces/cli/flags.mjs +56 -0
- package/dist/surfaces/cli/flags.mjs.map +1 -0
- package/dist/surfaces/cli/index.mjs +418 -0
- package/dist/surfaces/cli/index.mjs.map +1 -0
- package/dist/surfaces/cli/output.mjs +115 -0
- package/dist/surfaces/cli/output.mjs.map +1 -0
- package/dist/surfaces/cli/sysexits.mjs +139 -0
- package/dist/surfaces/cli/sysexits.mjs.map +1 -0
- package/dist/surfaces/tui/app.mjs +104 -0
- package/dist/surfaces/tui/app.mjs.map +1 -0
- package/dist/surfaces/tui/dashboard.mjs +261 -0
- package/dist/surfaces/tui/dashboard.mjs.map +1 -0
- package/dist/surfaces/tui/display-derivation.mjs +395 -0
- package/dist/surfaces/tui/display-derivation.mjs.map +1 -0
- package/dist/surfaces/tui/errors.mjs +11 -0
- package/dist/surfaces/tui/errors.mjs.map +1 -0
- package/dist/surfaces/tui/event-log.mjs +155 -0
- package/dist/surfaces/tui/event-log.mjs.map +1 -0
- package/dist/surfaces/tui/heartbeat.mjs +33 -0
- package/dist/surfaces/tui/heartbeat.mjs.map +1 -0
- package/dist/surfaces/tui/index.mjs +50 -0
- package/dist/surfaces/tui/index.mjs.map +1 -0
- package/dist/surfaces/tui/input.mjs +104 -0
- package/dist/surfaces/tui/input.mjs.map +1 -0
- package/dist/surfaces/tui/mode-detect.mjs +32 -0
- package/dist/surfaces/tui/mode-detect.mjs.map +1 -0
- package/dist/surfaces/tui/mount-ink.mjs +31 -0
- package/dist/surfaces/tui/mount-ink.mjs.map +1 -0
- package/dist/surfaces/tui/plain-renderer.mjs +170 -0
- package/dist/surfaces/tui/plain-renderer.mjs.map +1 -0
- package/dist/surfaces/tui/resource-table.mjs +507 -0
- package/dist/surfaces/tui/resource-table.mjs.map +1 -0
- package/images/_shared/signal-forward.sh +77 -0
- package/images/postgres/Dockerfile +32 -0
- package/images/seal/Dockerfile +68 -0
- package/images/seal/entrypoint.sh +65 -0
- package/images/sui/Dockerfile +73 -0
- package/images/sui/entrypoint.sh +244 -0
- package/images/sui-fork/Dockerfile +53 -0
- package/images/sui-fork/entrypoint.sh +51 -0
- package/images/walrus/Dockerfile +122 -0
- package/images/walrus/deploy-walrus.sh +305 -0
- package/images/walrus/run-walrus.sh +53 -0
- package/package.json +94 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ephemeral.mjs","names":[],"sources":["../../../../src/plugins/account/variants/ephemeral.ts"],"sourcesContent":["// Account variant — ephemeral (generate-or-recover, fund-by-default).\n//\n// Distilled-doc invariants:\n//\n// - \"Concurrent first-time keypair persistence\": EXCL-create write.\n// Two parallel generators must not both win; the loser falls\n// back to reading the winner's persisted key.\n// - \"Restrictive file permissions\": 0o600 secret + 0o700 parent.\n// - \"Bare form equals ephemeral-funded\": this resolver is what the\n// bare `account('alice')` factory call lands on.\n// - \"Auto-promotion to fork-impersonate funding\": handled in\n// `funding.ts`; this file just hands off the address. The\n// promotion event is emitted there (loud-by-default).\n//\n// Persistence note: these accounts are \"ephemeral\" relative to user-\n// managed key material, but they are stable inside a devstack runtime\n// root. Package cache keys and wallet accounts depend on that stability\n// across warm starts.\n\nimport { dirname } from 'node:path';\nimport * as nodeFs from 'node:fs/promises';\n\nimport { Effect } from 'effect';\n\nimport { decodeBech32Secret, generateEd25519Keypair, type ResolvedKeypair } from '../keypair.ts';\nimport { accountAcquireError, type AccountAcquireError } from '../errors.ts';\n\nexport interface EphemeralVariantArgs {\n\treadonly name: string;\n\t/** Filesystem path where the bech32 secret will be persisted by\n\t * the resolver and covered by the account snapshot capability. */\n\treadonly secretFilePath: string;\n}\n\ntype WriteResult = 'wrote' | 'exists';\n\nconst isErrnoCode = (cause: unknown, code: string): boolean =>\n\ttypeof cause === 'object' &&\n\tcause !== null &&\n\t'code' in cause &&\n\t(cause as { readonly code?: unknown }).code === code;\n\nconst bestEffortChmod = (path: string, mode: number): Effect.Effect<void> =>\n\tEffect.promise(() => nodeFs.chmod(path, mode)).pipe(Effect.ignore);\n\nconst readPersistedKeypair = (\n\targs: EphemeralVariantArgs,\n\tmessage: string,\n): Effect.Effect<ResolvedKeypair, AccountAcquireError> =>\n\tEffect.gen(function* () {\n\t\tconst raw = yield* Effect.tryPromise({\n\t\t\ttry: () => nodeFs.readFile(args.secretFilePath, 'utf8'),\n\t\t\tcatch: (cause): AccountAcquireError =>\n\t\t\t\taccountAcquireError({\n\t\t\t\t\tphase: 'read-persisted-keypair',\n\t\t\t\t\taccountName: args.name,\n\t\t\t\t\tvariant: 'ephemeral',\n\t\t\t\t\tmessage,\n\t\t\t\t\tcause,\n\t\t\t\t}),\n\t\t});\n\t\tyield* bestEffortChmod(args.secretFilePath, 0o600);\n\t\treturn yield* decodeBech32Secret(raw.trim(), args.name, 'ephemeral');\n\t});\n\nconst readPersistedKeypairIfPresent = (\n\targs: EphemeralVariantArgs,\n): Effect.Effect<ResolvedKeypair | null, AccountAcquireError> =>\n\treadPersistedKeypair(\n\t\targs,\n\t\t`Account '${args.name}': failed to read persisted ephemeral keypair at ${args.secretFilePath}.`,\n\t).pipe(\n\t\tEffect.catch((cause: AccountAcquireError) =>\n\t\t\tisErrnoCode(cause.cause, 'ENOENT') ? Effect.succeed(null) : Effect.fail(cause),\n\t\t),\n\t);\n\nconst persistGeneratedSecret = (\n\targs: EphemeralVariantArgs,\n\tsecret: string,\n): Effect.Effect<WriteResult, AccountAcquireError> =>\n\tEffect.tryPromise({\n\t\ttry: async () => {\n\t\t\tawait nodeFs.mkdir(dirname(args.secretFilePath), { recursive: true, mode: 0o700 });\n\t\t\tawait nodeFs.chmod(dirname(args.secretFilePath), 0o700).catch(() => {});\n\t\t\ttry {\n\t\t\t\tawait nodeFs.writeFile(args.secretFilePath, secret, { flag: 'wx', mode: 0o600 });\n\t\t\t\treturn 'wrote';\n\t\t\t} catch (cause) {\n\t\t\t\tif (isErrnoCode(cause, 'EEXIST')) return 'exists';\n\t\t\t\tthrow cause;\n\t\t\t}\n\t\t},\n\t\tcatch: (cause): AccountAcquireError =>\n\t\t\taccountAcquireError({\n\t\t\t\tphase: 'persist-keypair',\n\t\t\t\taccountName: args.name,\n\t\t\t\tvariant: 'ephemeral',\n\t\t\t\tmessage: `Account '${args.name}': failed to persist ephemeral keypair at ${args.secretFilePath}.`,\n\t\t\t\tcause,\n\t\t\t}),\n\t});\n\n/** Resolve the ephemeral variant — read or generate an Ed25519 keypair.\n *\n * First-time writes use O_EXCL so parallel acquires for the same\n * account cannot both publish different addresses; the loser re-reads\n * the winner's file and returns the persisted identity. */\nexport const resolveEphemeralVariant = (\n\targs: EphemeralVariantArgs,\n): Effect.Effect<ResolvedKeypair, AccountAcquireError> =>\n\tEffect.gen(function* () {\n\t\tconst persisted = yield* readPersistedKeypairIfPresent(args);\n\t\tif (persisted !== null) return persisted;\n\n\t\tconst generated = yield* generateEd25519Keypair(args.name);\n\t\tif (generated.bech32Secret === null) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\taccountAcquireError({\n\t\t\t\t\tphase: 'generate-keypair',\n\t\t\t\t\taccountName: args.name,\n\t\t\t\t\tvariant: 'ephemeral',\n\t\t\t\t\tmessage: `Account '${args.name}': generated keypair did not expose a bech32 secret.`,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\n\t\tconst writeResult = yield* persistGeneratedSecret(args, generated.bech32Secret);\n\t\tif (writeResult === 'exists') {\n\t\t\treturn yield* readPersistedKeypair(\n\t\t\t\targs,\n\t\t\t\t`Account '${args.name}': lost ephemeral keypair write race at ${args.secretFilePath} and failed to read the winner.`,\n\t\t\t);\n\t\t}\n\n\t\tyield* bestEffortChmod(args.secretFilePath, 0o600);\n\t\treturn generated;\n\t});\n"],"mappings":";;;;;;AAoCA,MAAM,eAAe,OAAgB,SACpC,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACT,MAAsC,SAAS;AAEjD,MAAM,mBAAmB,MAAc,SACtC,OAAO,cAAc,OAAO,MAAM,MAAM,KAAK,CAAC,CAAC,KAAK,OAAO,OAAO;AAEnE,MAAM,wBACL,MACA,YAEA,OAAO,IAAI,aAAa;CACvB,MAAM,MAAM,OAAO,OAAO,WAAW;EACpC,WAAW,OAAO,SAAS,KAAK,gBAAgB,OAAO;EACvD,QAAQ,UACP,oBAAoB;GACnB,OAAO;GACP,aAAa,KAAK;GAClB,SAAS;GACT;GACA;GACA,CAAC;EACH,CAAC;AACF,QAAO,gBAAgB,KAAK,gBAAgB,IAAM;AAClD,QAAO,OAAO,mBAAmB,IAAI,MAAM,EAAE,KAAK,MAAM,YAAY;EACnE;AAEH,MAAM,iCACL,SAEA,qBACC,MACA,YAAY,KAAK,KAAK,mDAAmD,KAAK,eAAe,GAC7F,CAAC,KACD,OAAO,OAAO,UACb,YAAY,MAAM,OAAO,SAAS,GAAG,OAAO,QAAQ,KAAK,GAAG,OAAO,KAAK,MAAM,CAC9E,CACD;AAEF,MAAM,0BACL,MACA,WAEA,OAAO,WAAW;CACjB,KAAK,YAAY;AAChB,QAAM,OAAO,MAAM,QAAQ,KAAK,eAAe,EAAE;GAAE,WAAW;GAAM,MAAM;GAAO,CAAC;AAClF,QAAM,OAAO,MAAM,QAAQ,KAAK,eAAe,EAAE,IAAM,CAAC,YAAY,GAAG;AACvE,MAAI;AACH,SAAM,OAAO,UAAU,KAAK,gBAAgB,QAAQ;IAAE,MAAM;IAAM,MAAM;IAAO,CAAC;AAChF,UAAO;WACC,OAAO;AACf,OAAI,YAAY,OAAO,SAAS,CAAE,QAAO;AACzC,SAAM;;;CAGR,QAAQ,UACP,oBAAoB;EACnB,OAAO;EACP,aAAa,KAAK;EAClB,SAAS;EACT,SAAS,YAAY,KAAK,KAAK,4CAA4C,KAAK,eAAe;EAC/F;EACA,CAAC;CACH,CAAC;;;;;;AAOH,MAAa,2BACZ,SAEA,OAAO,IAAI,aAAa;CACvB,MAAM,YAAY,OAAO,8BAA8B,KAAK;AAC5D,KAAI,cAAc,KAAM,QAAO;CAE/B,MAAM,YAAY,OAAO,uBAAuB,KAAK,KAAK;AAC1D,KAAI,UAAU,iBAAiB,KAC9B,QAAO,OAAO,OAAO,KACpB,oBAAoB;EACnB,OAAO;EACP,aAAa,KAAK;EAClB,SAAS;EACT,SAAS,YAAY,KAAK,KAAK;EAC/B,CAAC,CACF;AAIF,MAAI,OADuB,uBAAuB,MAAM,UAAU,aAAa,MAC3D,SACnB,QAAO,OAAO,qBACb,MACA,YAAY,KAAK,KAAK,0CAA0C,KAAK,eAAe,iCACpF;AAGF,QAAO,gBAAgB,KAAK,gBAAgB,IAAM;AAClD,QAAO;EACN"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/plugins/account/variants/impersonate.d.ts
|
|
4
|
+
/** The synthetic impersonation signer object. THROWS SYNCHRONOUSLY
|
|
5
|
+
* on direct sign calls; routes `signAndExecute` through the fork's
|
|
6
|
+
* empty-signature submit path (wired in `service.ts`). */
|
|
7
|
+
interface SyntheticImpersonationSigner {
|
|
8
|
+
readonly _kind: 'impersonate';
|
|
9
|
+
readonly toSuiAddress: () => string;
|
|
10
|
+
readonly getKeyScheme: () => 'ed25519';
|
|
11
|
+
readonly signTransaction: () => never;
|
|
12
|
+
readonly signPersonalMessage: () => never;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { SyntheticImpersonationSigner };
|
|
16
|
+
//# sourceMappingURL=impersonate.d.mts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { accountAcquireError, accountSignError } from "../errors.mjs";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
//#region src/plugins/account/variants/impersonate.ts
|
|
4
|
+
const makeSyntheticSigner = (accountName, address) => ({
|
|
5
|
+
_kind: "impersonate",
|
|
6
|
+
toSuiAddress: () => address,
|
|
7
|
+
getKeyScheme: () => "ed25519",
|
|
8
|
+
signTransaction: () => {
|
|
9
|
+
throw accountSignError({
|
|
10
|
+
phase: "impersonation-bypass-attempt",
|
|
11
|
+
accountName,
|
|
12
|
+
address,
|
|
13
|
+
message: `Account '${accountName}' is an impersonation account — direct sign calls are forbidden. Route through signAndExecute (which goes via the fork's impersonation submit path).`
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
signPersonalMessage: () => {
|
|
17
|
+
throw accountSignError({
|
|
18
|
+
phase: "impersonation-bypass-attempt",
|
|
19
|
+
accountName,
|
|
20
|
+
address,
|
|
21
|
+
message: `Account '${accountName}' is an impersonation account — signPersonalMessage is not supported.`
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
/** Resolve the impersonate variant.
|
|
26
|
+
*
|
|
27
|
+
* Distilled-doc invariant: refuse outside fork mode. The refusal
|
|
28
|
+
* is a typed acquisition error pointing at the runtime requirement. */
|
|
29
|
+
const resolveImpersonateVariant = (args) => {
|
|
30
|
+
if (args.suiMode !== "fork") return Effect.fail(accountAcquireError({
|
|
31
|
+
phase: "bind-impersonation-slot",
|
|
32
|
+
accountName: args.name,
|
|
33
|
+
variant: "impersonate",
|
|
34
|
+
message: `Account '${args.name}' uses {kind:'impersonate'} but Sui runtime is '${args.suiMode}'. Impersonation only works on fork-mode networks.`,
|
|
35
|
+
hint: `Switch to suiFor(network).fork.{mainnet|testnet|devnet}(...) — or use a different account variant.`
|
|
36
|
+
}));
|
|
37
|
+
return Effect.succeed({
|
|
38
|
+
address: args.address,
|
|
39
|
+
scheme: "ed25519",
|
|
40
|
+
publicKey: new Uint8Array(32),
|
|
41
|
+
signer: makeSyntheticSigner(args.name, args.address),
|
|
42
|
+
bech32Secret: null
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { resolveImpersonateVariant };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=impersonate.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impersonate.mjs","names":[],"sources":["../../../../src/plugins/account/variants/impersonate.ts"],"sourcesContent":["// Account variant — impersonate (fork-mode only).\n//\n// Distilled-doc invariants:\n//\n// - \"Impersonation only on fork\": the variant must refuse outside\n// fork-runtime. The refusal lands at variant-resolution time\n// (typed AccountAcquireError, phase: bind-impersonation-slot).\n//\n// - \"Sign-and-execute is the only execution surface for\n// impersonation\": synthetic impersonation signers must THROW\n// SYNCHRONOUSLY on direct sign calls so accidental bypass is\n// loud, not silent. We surface this through the\n// `SyntheticImpersonationSigner` object's `signTransaction` /\n// `signPersonalMessage` methods.\n//\n// - \"publicKey caveat\": the resolved value's `publicKey` is a\n// zero buffer. The resolved-account TYPE (in `service.ts`)\n// encodes the source discriminator so consumers can't accidentally\n// treat an impersonation publicKey as authoritative.\n//\n// Distilled-doc opportunity: \"Move the synthetic impersonation\n// signer next to the other fork-only helpers\". For now, it stays\n// here because the variant resolver is the only construction site —\n// if Wallet ever needs to materialize impersonation signers directly,\n// we lift this into `plugins/sui/fork-orchestration.ts`.\n\nimport { Effect } from 'effect';\n\nimport { accountAcquireError, accountSignError, type AccountAcquireError } from '../errors.ts';\nimport type { ResolvedKeypair } from '../keypair.ts';\n\nexport interface ImpersonateVariantArgs {\n\treadonly name: string;\n\t/** The address to execute AS. Must appear in the fork's seed\n\t * manifest's owned-object index (typically by being listed\n\t * in `Sui({fork:{seed:{addresses}}})`). */\n\treadonly address: string;\n\t/** Sui's resolved runtime mode — gates the refusal-outside-fork\n\t * check. */\n\treadonly suiMode: 'local' | 'local-rpc' | 'live' | 'fork';\n}\n\n/** The synthetic impersonation signer object. THROWS SYNCHRONOUSLY\n * on direct sign calls; routes `signAndExecute` through the fork's\n * empty-signature submit path (wired in `service.ts`). */\nexport interface SyntheticImpersonationSigner {\n\treadonly _kind: 'impersonate';\n\treadonly toSuiAddress: () => string;\n\treadonly getKeyScheme: () => 'ed25519';\n\treadonly signTransaction: () => never;\n\treadonly signPersonalMessage: () => never;\n}\n\nconst makeSyntheticSigner = (\n\taccountName: string,\n\taddress: string,\n): SyntheticImpersonationSigner => ({\n\t_kind: 'impersonate',\n\ttoSuiAddress: () => address,\n\t// Stable lie: report ed25519 so manifest serialization doesn't\n\t// have to branch. Consumers that need the truth read `source`\n\t// off the resolved-account value (architecture-distilled\n\t// invariant).\n\tgetKeyScheme: () => 'ed25519',\n\tsignTransaction: () => {\n\t\tthrow accountSignError({\n\t\t\tphase: 'impersonation-bypass-attempt',\n\t\t\taccountName,\n\t\t\taddress,\n\t\t\tmessage: `Account '${accountName}' is an impersonation account — direct sign calls are forbidden. Route through signAndExecute (which goes via the fork's impersonation submit path).`,\n\t\t});\n\t},\n\tsignPersonalMessage: () => {\n\t\tthrow accountSignError({\n\t\t\tphase: 'impersonation-bypass-attempt',\n\t\t\taccountName,\n\t\t\taddress,\n\t\t\tmessage: `Account '${accountName}' is an impersonation account — signPersonalMessage is not supported.`,\n\t\t});\n\t},\n});\n\n/** Resolve the impersonate variant.\n *\n * Distilled-doc invariant: refuse outside fork mode. The refusal\n * is a typed acquisition error pointing at the runtime requirement. */\nexport const resolveImpersonateVariant = (\n\targs: ImpersonateVariantArgs,\n): Effect.Effect<ResolvedKeypair, AccountAcquireError> => {\n\tif (args.suiMode !== 'fork') {\n\t\treturn Effect.fail(\n\t\t\taccountAcquireError({\n\t\t\t\tphase: 'bind-impersonation-slot',\n\t\t\t\taccountName: args.name,\n\t\t\t\tvariant: 'impersonate',\n\t\t\t\tmessage: `Account '${args.name}' uses {kind:'impersonate'} but Sui runtime is '${args.suiMode}'. Impersonation only works on fork-mode networks.`,\n\t\t\t\thint: `Switch to suiFor(network).fork.{mainnet|testnet|devnet}(...) — or use a different account variant.`,\n\t\t\t}),\n\t\t);\n\t}\n\treturn Effect.succeed({\n\t\taddress: args.address,\n\t\tscheme: 'ed25519',\n\t\t// Zero-buffer publicKey — the type-level lie. The `source`\n\t\t// discriminator on the resolved AccountValue is the\n\t\t// trustworthy signal.\n\t\tpublicKey: new Uint8Array(32),\n\t\tsigner: makeSyntheticSigner(args.name, args.address),\n\t\tbech32Secret: null,\n\t} satisfies ResolvedKeypair);\n};\n"],"mappings":";;;AAqDA,MAAM,uBACL,aACA,aACmC;CACnC,OAAO;CACP,oBAAoB;CAKpB,oBAAoB;CACpB,uBAAuB;AACtB,QAAM,iBAAiB;GACtB,OAAO;GACP;GACA;GACA,SAAS,YAAY,YAAY;GACjC,CAAC;;CAEH,2BAA2B;AAC1B,QAAM,iBAAiB;GACtB,OAAO;GACP;GACA;GACA,SAAS,YAAY,YAAY;GACjC,CAAC;;CAEH;;;;;AAMD,MAAa,6BACZ,SACyD;AACzD,KAAI,KAAK,YAAY,OACpB,QAAO,OAAO,KACb,oBAAoB;EACnB,OAAO;EACP,aAAa,KAAK;EAClB,SAAS;EACT,SAAS,YAAY,KAAK,KAAK,kDAAkD,KAAK,QAAQ;EAC9F,MAAM;EACN,CAAC,CACF;AAEF,QAAO,OAAO,QAAQ;EACrB,SAAS,KAAK;EACd,QAAQ;EAIR,WAAW,IAAI,WAAW,GAAG;EAC7B,QAAQ,oBAAoB,KAAK,MAAM,KAAK,QAAQ;EACpD,cAAc;EACd,CAA2B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { decodeBech32Secret, resolvedKeypairFromEd25519Bytes } from "../keypair.mjs";
|
|
2
|
+
import "effect";
|
|
3
|
+
//#region src/plugins/account/variants/inline.ts
|
|
4
|
+
/** Resolve the inline variant. String input takes the bech32 decode
|
|
5
|
+
* path; Uint8Array input takes the raw-bytes-into-Ed25519 path. */
|
|
6
|
+
const resolveInlineVariant = (args) => {
|
|
7
|
+
if (typeof args.privateKey === "string") return decodeBech32Secret(args.privateKey, args.name, "inline");
|
|
8
|
+
return resolvedKeypairFromEd25519Bytes(args.privateKey, args.name, "inline");
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { resolveInlineVariant };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=inline.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline.mjs","names":[],"sources":["../../../../src/plugins/account/variants/inline.ts"],"sourcesContent":["// Account variant — inline (literal bech32 secret in config).\n//\n// Distilled-doc warning: TESTS AND DEMOS ONLY. The key is serialized\n// as part of the user's devstack config; if that file is committed,\n// the key is in their git history. The user-facing factory in\n// `index.ts` mirrors the warning in JSDoc.\n//\n// This file accepts either a `string` (bech32 form) or a `Uint8Array`\n// (raw 32-byte secret key). Both funnel through Ed25519 construction\n// so downstream paths are uniform.\n\nimport { Effect } from 'effect';\n\nimport {\n\tdecodeBech32Secret,\n\tresolvedKeypairFromEd25519Bytes,\n\ttype ResolvedKeypair,\n} from '../keypair.ts';\nimport type { AccountAcquireError } from '../errors.ts';\n\nexport interface InlineVariantArgs {\n\treadonly name: string;\n\treadonly privateKey: string | Uint8Array;\n}\n\n/** Resolve the inline variant. String input takes the bech32 decode\n * path; Uint8Array input takes the raw-bytes-into-Ed25519 path. */\nexport const resolveInlineVariant = (\n\targs: InlineVariantArgs,\n): Effect.Effect<ResolvedKeypair, AccountAcquireError> => {\n\tif (typeof args.privateKey === 'string') {\n\t\treturn decodeBech32Secret(args.privateKey, args.name, 'inline');\n\t}\n\treturn resolvedKeypairFromEd25519Bytes(args.privateKey, args.name, 'inline');\n};\n"],"mappings":";;;;;AA2BA,MAAa,wBACZ,SACyD;AACzD,KAAI,OAAO,KAAK,eAAe,SAC9B,QAAO,mBAAmB,KAAK,YAAY,KAAK,MAAM,SAAS;AAEhE,QAAO,gCAAgC,KAAK,YAAY,KAAK,MAAM,SAAS"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { decodeJsonText } from "../../../substrate/runtime/runtime-decode.mjs";
|
|
2
|
+
import { accountAcquireError } from "../errors.mjs";
|
|
3
|
+
import { decodeBech32Secret } from "../keypair.mjs";
|
|
4
|
+
import { Effect, Schema } from "effect";
|
|
5
|
+
import { promises } from "node:fs";
|
|
6
|
+
import { decodeSuiPrivateKey } from "@mysten/sui/cryptography";
|
|
7
|
+
import { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519";
|
|
8
|
+
//#region src/plugins/account/variants/keystore.ts
|
|
9
|
+
const AliasesShape = Schema.Array(Schema.Struct({
|
|
10
|
+
alias: Schema.String,
|
|
11
|
+
public_key_base64: Schema.optional(Schema.String)
|
|
12
|
+
}));
|
|
13
|
+
const KeystoreShape = Schema.Array(Schema.String);
|
|
14
|
+
/** Resolve the keystore variant. */
|
|
15
|
+
const resolveKeystoreVariant = (args) => Effect.gen(function* () {
|
|
16
|
+
const rows = yield* decodeJsonText(KeystoreShape, yield* Effect.tryPromise({
|
|
17
|
+
try: () => promises.readFile(args.path, "utf-8"),
|
|
18
|
+
catch: (cause) => accountAcquireError({
|
|
19
|
+
phase: "load-keystore",
|
|
20
|
+
accountName: args.name,
|
|
21
|
+
variant: "keystore",
|
|
22
|
+
message: `Account '${args.name}': failed to read keystore at '${args.path}'.`,
|
|
23
|
+
hint: "Verify the path exists and is readable. The Sui CLI default is `~/.sui/sui_config/sui.keystore`.",
|
|
24
|
+
cause
|
|
25
|
+
})
|
|
26
|
+
}), {
|
|
27
|
+
source: args.path,
|
|
28
|
+
mkError: (issue) => accountAcquireError({
|
|
29
|
+
phase: "load-keystore",
|
|
30
|
+
accountName: args.name,
|
|
31
|
+
variant: "keystore",
|
|
32
|
+
message: issue.message === "failed to parse JSON" ? `Account '${args.name}': keystore at '${args.path}' is not valid JSON.` : `Account '${args.name}': keystore at '${args.path}' did not match the expected schema (array of bech32 strings).`,
|
|
33
|
+
cause: issue.cause
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
const aliasIdx = yield* resolveAliasIndex(`${args.path.replace(/\.keystore$/, "")}.aliases`, args.aliasOrAddress).pipe(Effect.orElseSucceed(() => -1));
|
|
37
|
+
if (aliasIdx >= 0 && aliasIdx < rows.length) {
|
|
38
|
+
const bech32 = rows[aliasIdx];
|
|
39
|
+
return yield* decodeBech32Secret(bech32, args.name, "keystore");
|
|
40
|
+
}
|
|
41
|
+
const wantAddr = normalizeAddress(args.aliasOrAddress);
|
|
42
|
+
for (const bech32 of rows) {
|
|
43
|
+
const addr = yield* tryDeriveAddress(bech32).pipe(Effect.orElseSucceed(() => null));
|
|
44
|
+
if (addr !== null && normalizeAddress(addr) === wantAddr) return yield* decodeBech32Secret(bech32, args.name, "keystore");
|
|
45
|
+
}
|
|
46
|
+
return yield* Effect.fail(accountAcquireError({
|
|
47
|
+
phase: "load-keystore",
|
|
48
|
+
accountName: args.name,
|
|
49
|
+
variant: "keystore",
|
|
50
|
+
message: `Account '${args.name}': keystore at '${args.path}' has no entry matching alias-or-address '${args.aliasOrAddress}'.`,
|
|
51
|
+
hint: "Check the sibling sui.aliases file for the alias spelling, or pass the on-chain address (0x-prefixed) directly."
|
|
52
|
+
}));
|
|
53
|
+
});
|
|
54
|
+
const resolveAliasIndex = (aliasesPath, want) => Effect.gen(function* () {
|
|
55
|
+
return (yield* decodeJsonText(AliasesShape, yield* Effect.tryPromise({
|
|
56
|
+
try: () => promises.readFile(aliasesPath, "utf-8"),
|
|
57
|
+
catch: (cause) => accountAcquireError({
|
|
58
|
+
phase: "load-keystore",
|
|
59
|
+
accountName: "<keystore>",
|
|
60
|
+
variant: "keystore",
|
|
61
|
+
message: `aliases file '${aliasesPath}' missing or unreadable`,
|
|
62
|
+
cause
|
|
63
|
+
})
|
|
64
|
+
}), {
|
|
65
|
+
source: aliasesPath,
|
|
66
|
+
mkError: (issue) => accountAcquireError({
|
|
67
|
+
phase: "load-keystore",
|
|
68
|
+
accountName: "<keystore>",
|
|
69
|
+
variant: "keystore",
|
|
70
|
+
message: issue.message === "failed to parse JSON" ? `aliases file '${aliasesPath}' is not valid JSON` : `aliases file '${aliasesPath}' did not match the expected schema`,
|
|
71
|
+
cause: issue.cause
|
|
72
|
+
})
|
|
73
|
+
})).findIndex((row) => row.alias === want);
|
|
74
|
+
});
|
|
75
|
+
/** Derive the on-chain address from a bech32 secret without
|
|
76
|
+
* surfacing a typed error — used by the by-address scan, which
|
|
77
|
+
* swallows per-row failures and moves on. */
|
|
78
|
+
const tryDeriveAddress = (bech32) => Effect.try({
|
|
79
|
+
try: () => {
|
|
80
|
+
const parsed = decodeSuiPrivateKey(bech32);
|
|
81
|
+
if (parsed.scheme !== "ED25519") throw new Error(`scheme ${parsed.scheme} not yet derivable here`);
|
|
82
|
+
return Ed25519Keypair.fromSecretKey(parsed.secretKey).toSuiAddress();
|
|
83
|
+
},
|
|
84
|
+
catch: (cause) => cause instanceof Error ? cause : new Error(String(cause))
|
|
85
|
+
});
|
|
86
|
+
const normalizeAddress = (addr) => {
|
|
87
|
+
const lower = addr.toLowerCase();
|
|
88
|
+
return lower.startsWith("0x") ? lower : `0x${lower}`;
|
|
89
|
+
};
|
|
90
|
+
//#endregion
|
|
91
|
+
export { resolveKeystoreVariant };
|
|
92
|
+
|
|
93
|
+
//# sourceMappingURL=keystore.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keystore.mjs","names":["fs"],"sources":["../../../../src/plugins/account/variants/keystore.ts"],"sourcesContent":["// Account variant — keystore (read from Sui CLI keystore file).\n//\n// Distilled-doc surface: read a `suiprivkey1...` entry by alias or\n// by address from a CLI-shape keystore file. Devstack NEVER copies\n// the keystore — only reads. Persistence stays with the user's\n// CLI tooling.\n//\n// Keystore file shape (canonical sui-cli output):\n// `<path>` — a JSON array of bech32 `suiprivkey1...` strings\n// `<path>.aliases` — a sibling JSON array of `{alias, public_key_base64}`\n// entries; the array's index matches the keystore.\n//\n// Lookup precedence: alias match first (case-sensitive), then by-address\n// match (the resolver decodes each bech32 row, derives the address,\n// and compares). The address path is intentionally O(n) — keystores\n// are small and the alternative is a side-table the CLI doesn't\n// maintain.\n\nimport { Effect, Schema } from 'effect';\nimport { promises as fs } from 'node:fs';\n\nimport { decodeJsonText } from '../../../substrate/runtime/runtime-decode.ts';\nimport { accountAcquireError, type AccountAcquireError } from '../errors.ts';\nimport { decodeBech32Secret, type ResolvedKeypair } from '../keypair.ts';\nimport { decodeSuiPrivateKey } from '@mysten/sui/cryptography';\nimport { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';\n\nexport interface KeystoreVariantArgs {\n\treadonly name: string;\n\t/** Absolute path to the keystore file. Defaults at the factory\n\t * boundary to `~/.sui/sui_config/sui.keystore`. */\n\treadonly path: string;\n\t/** Alias name (from the sibling `sui.aliases` file) OR the\n\t * on-chain address — the resolver tries alias first, then a\n\t * by-address lookup. */\n\treadonly aliasOrAddress: string;\n}\n\nconst AliasesShape = Schema.Array(\n\tSchema.Struct({\n\t\talias: Schema.String,\n\t\t// Optional because some CLI versions omit it for newer rows;\n\t\t// we only need the alias for the alias-path.\n\t\tpublic_key_base64: Schema.optional(Schema.String),\n\t}),\n);\n\nconst KeystoreShape = Schema.Array(Schema.String);\n\n/** Resolve the keystore variant. */\nexport const resolveKeystoreVariant = (\n\targs: KeystoreVariantArgs,\n): Effect.Effect<ResolvedKeypair, AccountAcquireError> =>\n\tEffect.gen(function* () {\n\t\t// --- read + parse the keystore ----------------------------------\n\t\tconst raw = yield* Effect.tryPromise({\n\t\t\ttry: () => fs.readFile(args.path, 'utf-8'),\n\t\t\tcatch: (cause): AccountAcquireError =>\n\t\t\t\taccountAcquireError({\n\t\t\t\t\tphase: 'load-keystore',\n\t\t\t\t\taccountName: args.name,\n\t\t\t\t\tvariant: 'keystore',\n\t\t\t\t\tmessage: `Account '${args.name}': failed to read keystore at '${args.path}'.`,\n\t\t\t\t\thint: 'Verify the path exists and is readable. The Sui CLI default is `~/.sui/sui_config/sui.keystore`.',\n\t\t\t\t\tcause,\n\t\t\t\t}),\n\t\t});\n\t\tconst rows = yield* decodeJsonText(KeystoreShape, raw, {\n\t\t\tsource: args.path,\n\t\t\tmkError: (issue): AccountAcquireError =>\n\t\t\t\taccountAcquireError({\n\t\t\t\t\tphase: 'load-keystore',\n\t\t\t\t\taccountName: args.name,\n\t\t\t\t\tvariant: 'keystore',\n\t\t\t\t\tmessage:\n\t\t\t\t\t\tissue.message === 'failed to parse JSON'\n\t\t\t\t\t\t\t? `Account '${args.name}': keystore at '${args.path}' is not valid JSON.`\n\t\t\t\t\t\t\t: `Account '${args.name}': keystore at '${args.path}' did not match the expected schema (array of bech32 strings).`,\n\t\t\t\t\tcause: issue.cause,\n\t\t\t\t}),\n\t\t});\n\n\t\t// --- alias path -------------------------------------------------\n\t\t// Best-effort: missing aliases file is not fatal — fall through\n\t\t// to the by-address path.\n\t\tconst aliasesPath = `${args.path.replace(/\\.keystore$/, '')}.aliases`;\n\t\tconst aliasIdx = yield* resolveAliasIndex(aliasesPath, args.aliasOrAddress).pipe(\n\t\t\tEffect.orElseSucceed(() => -1),\n\t\t);\n\t\tif (aliasIdx >= 0 && aliasIdx < rows.length) {\n\t\t\tconst bech32 = rows[aliasIdx]!;\n\t\t\treturn yield* decodeBech32Secret(bech32, args.name, 'keystore');\n\t\t}\n\n\t\t// --- by-address path -------------------------------------------\n\t\t// Normalize the lookup key to a lowercased 0x-prefixed string so\n\t\t// comparisons match regardless of caller casing.\n\t\tconst wantAddr = normalizeAddress(args.aliasOrAddress);\n\t\tfor (const bech32 of rows) {\n\t\t\tconst addr = yield* tryDeriveAddress(bech32).pipe(Effect.orElseSucceed(() => null));\n\t\t\tif (addr !== null && normalizeAddress(addr) === wantAddr) {\n\t\t\t\treturn yield* decodeBech32Secret(bech32, args.name, 'keystore');\n\t\t\t}\n\t\t}\n\n\t\treturn yield* Effect.fail(\n\t\t\taccountAcquireError({\n\t\t\t\tphase: 'load-keystore',\n\t\t\t\taccountName: args.name,\n\t\t\t\tvariant: 'keystore',\n\t\t\t\tmessage: `Account '${args.name}': keystore at '${args.path}' has no entry matching alias-or-address '${args.aliasOrAddress}'.`,\n\t\t\t\thint: 'Check the sibling sui.aliases file for the alias spelling, or pass the on-chain address (0x-prefixed) directly.',\n\t\t\t}),\n\t\t);\n\t});\n\nconst resolveAliasIndex = (\n\taliasesPath: string,\n\twant: string,\n): Effect.Effect<number, AccountAcquireError> =>\n\tEffect.gen(function* () {\n\t\tconst raw = yield* Effect.tryPromise({\n\t\t\ttry: () => fs.readFile(aliasesPath, 'utf-8'),\n\t\t\tcatch: (cause): AccountAcquireError =>\n\t\t\t\taccountAcquireError({\n\t\t\t\t\tphase: 'load-keystore',\n\t\t\t\t\taccountName: '<keystore>',\n\t\t\t\t\tvariant: 'keystore',\n\t\t\t\t\tmessage: `aliases file '${aliasesPath}' missing or unreadable`,\n\t\t\t\t\tcause,\n\t\t\t\t}),\n\t\t});\n\t\tconst aliases = yield* decodeJsonText(AliasesShape, raw, {\n\t\t\tsource: aliasesPath,\n\t\t\tmkError: (issue): AccountAcquireError =>\n\t\t\t\taccountAcquireError({\n\t\t\t\t\tphase: 'load-keystore',\n\t\t\t\t\taccountName: '<keystore>',\n\t\t\t\t\tvariant: 'keystore',\n\t\t\t\t\tmessage:\n\t\t\t\t\t\tissue.message === 'failed to parse JSON'\n\t\t\t\t\t\t\t? `aliases file '${aliasesPath}' is not valid JSON`\n\t\t\t\t\t\t\t: `aliases file '${aliasesPath}' did not match the expected schema`,\n\t\t\t\t\tcause: issue.cause,\n\t\t\t\t}),\n\t\t});\n\t\treturn aliases.findIndex((row) => row.alias === want);\n\t});\n\n/** Derive the on-chain address from a bech32 secret without\n * surfacing a typed error — used by the by-address scan, which\n * swallows per-row failures and moves on. */\nconst tryDeriveAddress = (bech32: string): Effect.Effect<string, Error> =>\n\tEffect.try({\n\t\ttry: () => {\n\t\t\tconst parsed = decodeSuiPrivateKey(bech32);\n\t\t\tif (parsed.scheme !== 'ED25519') {\n\t\t\t\tthrow new Error(`scheme ${parsed.scheme} not yet derivable here`);\n\t\t\t}\n\t\t\treturn Ed25519Keypair.fromSecretKey(parsed.secretKey).toSuiAddress();\n\t\t},\n\t\tcatch: (cause) => (cause instanceof Error ? cause : new Error(String(cause))),\n\t});\n\nconst normalizeAddress = (addr: string): string => {\n\tconst lower = addr.toLowerCase();\n\treturn lower.startsWith('0x') ? lower : `0x${lower}`;\n};\n"],"mappings":";;;;;;;;AAsCA,MAAM,eAAe,OAAO,MAC3B,OAAO,OAAO;CACb,OAAO,OAAO;CAGd,mBAAmB,OAAO,SAAS,OAAO,OAAO;CACjD,CAAC,CACF;AAED,MAAM,gBAAgB,OAAO,MAAM,OAAO,OAAO;;AAGjD,MAAa,0BACZ,SAEA,OAAO,IAAI,aAAa;CAcvB,MAAM,OAAO,OAAO,eAAe,eAAe,OAZ/B,OAAO,WAAW;EACpC,WAAWA,SAAG,SAAS,KAAK,MAAM,QAAQ;EAC1C,QAAQ,UACP,oBAAoB;GACnB,OAAO;GACP,aAAa,KAAK;GAClB,SAAS;GACT,SAAS,YAAY,KAAK,KAAK,iCAAiC,KAAK,KAAK;GAC1E,MAAM;GACN;GACA,CAAC;EACH,CAAC,EACqD;EACtD,QAAQ,KAAK;EACb,UAAU,UACT,oBAAoB;GACnB,OAAO;GACP,aAAa,KAAK;GAClB,SAAS;GACT,SACC,MAAM,YAAY,yBACf,YAAY,KAAK,KAAK,kBAAkB,KAAK,KAAK,wBAClD,YAAY,KAAK,KAAK,kBAAkB,KAAK,KAAK;GACtD,OAAO,MAAM;GACb,CAAC;EACH,CAAC;CAMF,MAAM,WAAW,OAAO,kBAAkB,GADnB,KAAK,KAAK,QAAQ,eAAe,GAAG,CAAC,WACL,KAAK,eAAe,CAAC,KAC3E,OAAO,oBAAoB,GAAG,CAC9B;AACD,KAAI,YAAY,KAAK,WAAW,KAAK,QAAQ;EAC5C,MAAM,SAAS,KAAK;AACpB,SAAO,OAAO,mBAAmB,QAAQ,KAAK,MAAM,WAAW;;CAMhE,MAAM,WAAW,iBAAiB,KAAK,eAAe;AACtD,MAAK,MAAM,UAAU,MAAM;EAC1B,MAAM,OAAO,OAAO,iBAAiB,OAAO,CAAC,KAAK,OAAO,oBAAoB,KAAK,CAAC;AACnF,MAAI,SAAS,QAAQ,iBAAiB,KAAK,KAAK,SAC/C,QAAO,OAAO,mBAAmB,QAAQ,KAAK,MAAM,WAAW;;AAIjE,QAAO,OAAO,OAAO,KACpB,oBAAoB;EACnB,OAAO;EACP,aAAa,KAAK;EAClB,SAAS;EACT,SAAS,YAAY,KAAK,KAAK,kBAAkB,KAAK,KAAK,4CAA4C,KAAK,eAAe;EAC3H,MAAM;EACN,CAAC,CACF;EACA;AAEH,MAAM,qBACL,aACA,SAEA,OAAO,IAAI,aAAa;AA0BvB,SAAO,OAdgB,eAAe,cAAc,OAXjC,OAAO,WAAW;EACpC,WAAWA,SAAG,SAAS,aAAa,QAAQ;EAC5C,QAAQ,UACP,oBAAoB;GACnB,OAAO;GACP,aAAa;GACb,SAAS;GACT,SAAS,iBAAiB,YAAY;GACtC;GACA,CAAC;EACH,CAAC,EACuD;EACxD,QAAQ;EACR,UAAU,UACT,oBAAoB;GACnB,OAAO;GACP,aAAa;GACb,SAAS;GACT,SACC,MAAM,YAAY,yBACf,iBAAiB,YAAY,uBAC7B,iBAAiB,YAAY;GACjC,OAAO,MAAM;GACb,CAAC;EACH,CAAC,EACa,WAAW,QAAQ,IAAI,UAAU,KAAK;EACpD;;;;AAKH,MAAM,oBAAoB,WACzB,OAAO,IAAI;CACV,WAAW;EACV,MAAM,SAAS,oBAAoB,OAAO;AAC1C,MAAI,OAAO,WAAW,UACrB,OAAM,IAAI,MAAM,UAAU,OAAO,OAAO,yBAAyB;AAElE,SAAO,eAAe,cAAc,OAAO,UAAU,CAAC,cAAc;;CAErE,QAAQ,UAAW,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,CAAC;CAC5E,CAAC;AAEH,MAAM,oBAAoB,SAAyB;CAClD,MAAM,QAAQ,KAAK,aAAa;AAChC,QAAO,MAAM,WAAW,KAAK,GAAG,QAAQ,KAAK"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { accountAcquireError } from "../errors.mjs";
|
|
2
|
+
import { normalizeScheme } from "../keypair.mjs";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
//#region src/plugins/account/variants/signer.ts
|
|
5
|
+
/** Resolve the signer variant.
|
|
6
|
+
*
|
|
7
|
+
* The body reads the address + scheme via the SDK shim and hands
|
|
8
|
+
* back the resolved-keypair view. The `bech32Secret` field is
|
|
9
|
+
* `null` — we never fish the secret out of an external signer. */
|
|
10
|
+
const resolveSignerVariant = (args) => Effect.gen(function* () {
|
|
11
|
+
return {
|
|
12
|
+
address: args.addressOverride ?? args.signer.toSuiAddress(),
|
|
13
|
+
scheme: yield* normalizeScheme(args.signer.getKeyScheme(), args.name, "signer"),
|
|
14
|
+
publicKey: yield* Effect.try({
|
|
15
|
+
try: () => args.signer.getPublicKey().toRawBytes(),
|
|
16
|
+
catch: (cause) => accountAcquireError({
|
|
17
|
+
phase: "bind-signer",
|
|
18
|
+
accountName: args.name,
|
|
19
|
+
variant: "signer",
|
|
20
|
+
message: `Account '${args.name}': signer.getPublicKey().toRawBytes() threw.`,
|
|
21
|
+
cause
|
|
22
|
+
})
|
|
23
|
+
}),
|
|
24
|
+
signer: args.signer,
|
|
25
|
+
bech32Secret: null
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
export { resolveSignerVariant };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=signer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signer.mjs","names":[],"sources":["../../../../src/plugins/account/variants/signer.ts"],"sourcesContent":["// Account variant — signer (provided as a Signer object directly).\n//\n// Distilled-doc surface: the escape hatch for hardware wallets,\n// custom KMS adapters, and dApp-side signers. Devstack NEVER calls\n// `getSecretKey()` on this branch — the supplied signer's\n// `signTransaction` / `signPersonalMessage` / `signAndExecuteTransaction`\n// methods are called directly.\n//\n// Type-encoded contract: the `signer` field is the @mysten/sui\n// abstract `Signer` shape. We accept `unknown` here at the variant\n// boundary (the substrate's import surface stays SDK-free for tree-\n// shaking and version-pinning); the user-facing factory in `index.ts`\n// pins `Signer` from `@mysten/sui/cryptography`.\n\nimport { Effect } from 'effect';\n\nimport { accountAcquireError, type AccountAcquireError } from '../errors.ts';\nimport { normalizeScheme, type ResolvedKeypair } from '../keypair.ts';\n\nexport interface SignerVariantArgs {\n\treadonly name: string;\n\t/** A `@mysten/sui/cryptography` `Signer` instance. Typed loosely\n\t * here; the user-facing factory pins the SDK type. */\n\treadonly signer: {\n\t\treadonly toSuiAddress: () => string;\n\t\treadonly getKeyScheme: () => string;\n\t\treadonly getPublicKey: () => { readonly toRawBytes: () => Uint8Array };\n\t};\n\t/** Optional address override. When omitted, `signer.toSuiAddress()`\n\t * is called. Useful for signers whose address is more expensive\n\t * to derive than to memoize. */\n\treadonly addressOverride?: string;\n}\n\n/** Resolve the signer variant.\n *\n * The body reads the address + scheme via the SDK shim and hands\n * back the resolved-keypair view. The `bech32Secret` field is\n * `null` — we never fish the secret out of an external signer. */\nexport const resolveSignerVariant = (\n\targs: SignerVariantArgs,\n): Effect.Effect<ResolvedKeypair, AccountAcquireError> =>\n\tEffect.gen(function* () {\n\t\tconst address = args.addressOverride ?? args.signer.toSuiAddress();\n\t\tconst rawScheme = args.signer.getKeyScheme();\n\t\tconst scheme = yield* normalizeScheme(rawScheme, args.name, 'signer');\n\t\tconst publicKey = yield* Effect.try({\n\t\t\ttry: () => args.signer.getPublicKey().toRawBytes(),\n\t\t\tcatch: (cause) =>\n\t\t\t\taccountAcquireError({\n\t\t\t\t\tphase: 'bind-signer',\n\t\t\t\t\taccountName: args.name,\n\t\t\t\t\tvariant: 'signer',\n\t\t\t\t\tmessage: `Account '${args.name}': signer.getPublicKey().toRawBytes() threw.`,\n\t\t\t\t\tcause,\n\t\t\t\t}),\n\t\t});\n\t\treturn {\n\t\t\taddress,\n\t\t\tscheme,\n\t\t\tpublicKey,\n\t\t\tsigner: args.signer,\n\t\t\tbech32Secret: null,\n\t\t} satisfies ResolvedKeypair;\n\t});\n"],"mappings":";;;;;;;;;AAuCA,MAAa,wBACZ,SAEA,OAAO,IAAI,aAAa;AAevB,QAAO;EACN,SAfe,KAAK,mBAAmB,KAAK,OAAO,cAAc;EAgBjE,QAAA,OAdqB,gBADJ,KAAK,OAAO,cACiB,EAAE,KAAK,MAAM,SAAS;EAepE,WAAA,OAdwB,OAAO,IAAI;GACnC,WAAW,KAAK,OAAO,cAAc,CAAC,YAAY;GAClD,QAAQ,UACP,oBAAoB;IACnB,OAAO;IACP,aAAa,KAAK;IAClB,SAAS;IACT,SAAS,YAAY,KAAK,KAAK;IAC/B;IACA,CAAC;GACH,CAAC;EAKD,QAAQ,KAAK;EACb,cAAc;EACd;EACA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { SuiClient } from "../sui/mode/shared.mjs";
|
|
2
|
+
import { AccountValue } from "../account/service.mjs";
|
|
3
|
+
import { ActionError } from "./errors.mjs";
|
|
4
|
+
import { ActionReceipt } from "./service.mjs";
|
|
5
|
+
import { Effect, Scope } from "effect";
|
|
6
|
+
import { Transaction } from "@mysten/sui/transactions";
|
|
7
|
+
|
|
8
|
+
//#region src/plugins/action/build-context.d.ts
|
|
9
|
+
/** Build-time context handed to the user's `body` callback (and the
|
|
10
|
+
* optional `discriminator` callback).
|
|
11
|
+
*
|
|
12
|
+
* Carries:
|
|
13
|
+
*
|
|
14
|
+
* - `sui` — the resolved `SuiClient` (sdk shim + chain id + opaque
|
|
15
|
+
* `client` for `Transaction.build({client})`). Threaded eagerly
|
|
16
|
+
* because suiResource is always part of the action's hard upstream.
|
|
17
|
+
* - `signAndExecute(account, build)` — high-level helper. Drives
|
|
18
|
+
* the full build → sign → execute → wait → project pipeline
|
|
19
|
+
* against the supplied account, returning a parsed
|
|
20
|
+
* `ActionReceipt`. Folds the SDK boundary cast +
|
|
21
|
+
* `include: {effects, objectTypes}` execute + finality wait +
|
|
22
|
+
* envelope projection into a single call. Errors surface as
|
|
23
|
+
* `ActionError` (phase `sign` for transport / RPC failures;
|
|
24
|
+
* `parse` for envelope-shape failures). */
|
|
25
|
+
interface ActionBuildContext {
|
|
26
|
+
/** Resolved SuiClient. suiResource is part of action's hard upstream so
|
|
27
|
+
* this is always populated. */
|
|
28
|
+
readonly sui: SuiClient;
|
|
29
|
+
/** High-level: build + sign + execute + wait + project the
|
|
30
|
+
* transaction in one call. The `account` is the signer, usually
|
|
31
|
+
* from the resolved dependency values passed to the action body.
|
|
32
|
+
* The `build` callback populates the fresh `Transaction`; the
|
|
33
|
+
* sender is set automatically to `account.address`. Returns a
|
|
34
|
+
* parsed `ActionReceipt` whose `objectChanges` array is non-empty
|
|
35
|
+
* when the transaction created or mutated on-chain objects (the
|
|
36
|
+
* SDK is invoked with `include: { effects, objectTypes }`). */
|
|
37
|
+
readonly signAndExecute: (account: AccountValue, build: (tx: Transaction) => void) => Effect.Effect<ActionReceipt, ActionError, Scope.Scope>;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { ActionBuildContext };
|
|
41
|
+
//# sourceMappingURL=build-context.d.mts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ActionError } from "./errors.mjs";
|
|
2
|
+
import { ActionBuildContext } from "./build-context.mjs";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
|
|
5
|
+
//#region src/plugins/action/discriminator.d.ts
|
|
6
|
+
/** Dynamic portion (resolved at acquire time). Two accepted shapes:
|
|
7
|
+
*
|
|
8
|
+
* - `string` — literal cache-key fragment, used verbatim.
|
|
9
|
+
* - `(ctx, deps) => Effect<string, ActionError>` — callback receiving
|
|
10
|
+
* action helpers and resolved deps in the same shape
|
|
11
|
+
* as the body callback. The Effect is yielded at
|
|
12
|
+
* acquire time so the callback can derive the
|
|
13
|
+
* discriminator from upstream resolved values (e.g.
|
|
14
|
+
* fold in a freshly-published package id). Re-runs
|
|
15
|
+
* on EVERY acquire (hit OR miss). User errors
|
|
16
|
+
* propagate as `ActionError({phase: 'discriminator'})`. */
|
|
17
|
+
type DynamicDiscriminator<Deps = unknown> = string | ((ctx: ActionBuildContext, deps: Deps) => Effect.Effect<string, ActionError>);
|
|
18
|
+
//#endregion
|
|
19
|
+
export { DynamicDiscriminator };
|
|
20
|
+
//# sourceMappingURL=discriminator.d.mts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/plugins/action/discriminator.ts
|
|
2
|
+
/** Build the content-hash input string from static + resolved-dynamic
|
|
3
|
+
* pieces. Canonical shape: newline-delimited so two strings with
|
|
4
|
+
* shared prefixes hash differently. */
|
|
5
|
+
const composeDiscriminatorMaterial = (staticParts, resolvedDynamic) => {
|
|
6
|
+
const lines = [`action=${staticParts.actionName}`, `dependencies=${JSON.stringify(staticParts.dependencyResourceIds)}`];
|
|
7
|
+
if (resolvedDynamic !== void 0) lines.push(`discriminator=${resolvedDynamic}`);
|
|
8
|
+
return lines.join("\n");
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { composeDiscriminatorMaterial };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=discriminator.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discriminator.mjs","names":[],"sources":["../../../src/plugins/action/discriminator.ts"],"sourcesContent":["// Action plugin — discriminator types.\n//\n// An action's cache key is `action/<chainId>/<contentHash>` where the\n// content hash folds in:\n//\n// - `actionName` — symbolic action name (drives namespace + TUI\n// attribution).\n// - `chainId` — substrate-folded automatically (substrate-side\n// of the artifact publisher cache key).\n// - `consumedKeys` — the literal resource ids of every entry in\n// `dependsOn`. Folded so reordering/changing\n// upstream deps invalidates the cache. Static —\n// resolved at factory construction time.\n// - `discriminator` — OPTIONAL caller-supplied extra material. Two\n// accepted shapes: a literal `string`, or a\n// callback `(ctx, deps) => Effect<string>`\n// receiving action helpers and resolved deps\n// shaped by `dependsOn`. The callback form re-runs\n// on EVERY acquire (hit OR miss) — mirrors v3's `cacheKey:\n// Effect<string>` semantics (16-action.md\n// invariant 5/6).\n//\n// The dynamic discriminator covers the common case where the action's\n// idempotency hinges on a value not known until upstream resolution\n// completes. The v3 example: `cacheKey: Effect.gen(function* () {\n// const pkg = yield* connectFour; return pkg.packageId; })`.\n\nimport type { Effect } from 'effect';\n\nimport type { ActionError } from './errors.ts';\nimport type { ActionBuildContext } from './build-context.ts';\n\n/** Static portion of the discriminator (known at factory construction\n * time). The substrate folds this into the content-hash so the\n * cache key changes when these fields do. */\nexport interface StaticDiscriminator {\n\t/** Symbolic action name. */\n\treadonly actionName: string;\n\t/** Resource-id literals of every entry in `dependsOn`, in declaration\n\t * order. Reordering MUST invalidate the cache (this is the v3\n\t * behavior — `needs.map(n => n.key)` was folded in order). */\n\treadonly dependencyResourceIds: ReadonlyArray<string>;\n}\n\n/** Dynamic portion (resolved at acquire time). Two accepted shapes:\n *\n * - `string` — literal cache-key fragment, used verbatim.\n * - `(ctx, deps) => Effect<string, ActionError>` — callback receiving\n * action helpers and resolved deps in the same shape\n * as the body callback. The Effect is yielded at\n * acquire time so the callback can derive the\n * discriminator from upstream resolved values (e.g.\n * fold in a freshly-published package id). Re-runs\n * on EVERY acquire (hit OR miss). User errors\n * propagate as `ActionError({phase: 'discriminator'})`. */\nexport type DynamicDiscriminator<Deps = unknown> =\n\t| string\n\t| ((ctx: ActionBuildContext, deps: Deps) => Effect.Effect<string, ActionError>);\n\n/** Build the content-hash input string from static + resolved-dynamic\n * pieces. Canonical shape: newline-delimited so two strings with\n * shared prefixes hash differently. */\nexport const composeDiscriminatorMaterial = (\n\tstaticParts: StaticDiscriminator,\n\tresolvedDynamic: string | undefined,\n): string => {\n\tconst lines: string[] = [\n\t\t`action=${staticParts.actionName}`,\n\t\t`dependencies=${JSON.stringify(staticParts.dependencyResourceIds)}`,\n\t];\n\tif (resolvedDynamic !== undefined) {\n\t\tlines.push(`discriminator=${resolvedDynamic}`);\n\t}\n\treturn lines.join('\\n');\n};\n"],"mappings":";;;;AA8DA,MAAa,gCACZ,aACA,oBACY;CACZ,MAAM,QAAkB,CACvB,UAAU,YAAY,cACtB,gBAAgB,KAAK,UAAU,YAAY,sBAAsB,GACjE;AACD,KAAI,oBAAoB,KAAA,EACvB,OAAM,KAAK,iBAAiB,kBAAkB;AAE/C,QAAO,MAAM,KAAK,KAAK"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/plugins/action/errors.d.ts
|
|
2
|
+
/** Phases for `ActionError`. Closed sum — adding a phase requires
|
|
3
|
+
* editing this file (and the plugin doc's catalog).
|
|
4
|
+
*
|
|
5
|
+
* Phase semantics:
|
|
6
|
+
* - `discriminator` — `opts.discriminator` Effect evaluation failed.
|
|
7
|
+
* User-code defect or yielded upstream raised.
|
|
8
|
+
* - `build` — `opts.body`'s build phase (the user-supplied
|
|
9
|
+
* Effect) failed before producing a transaction.
|
|
10
|
+
* - `sign` — `signAndExecute` failed (gas, bytecode
|
|
11
|
+
* verification, RPC).
|
|
12
|
+
* - `parse` — the action's receipt projection (digest /
|
|
13
|
+
* objectChanges) was malformed.
|
|
14
|
+
* - `verify` — verify probe authoritatively raised (transient
|
|
15
|
+
* is masked by the lenient probe — does NOT raise
|
|
16
|
+
* this).
|
|
17
|
+
*/
|
|
18
|
+
type ActionPhase = 'discriminator' | 'build' | 'sign' | 'parse' | 'verify';
|
|
19
|
+
/** Single tagged action error. */
|
|
20
|
+
interface ActionError {
|
|
21
|
+
readonly _tag: 'ActionError';
|
|
22
|
+
readonly phase: ActionPhase;
|
|
23
|
+
/** Symbolic action name (the user-declared `action.name`). Flows
|
|
24
|
+
* into the cache key namespace and the TUI row title. */
|
|
25
|
+
readonly actionName: string;
|
|
26
|
+
readonly message: string;
|
|
27
|
+
readonly cause?: unknown;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { ActionError, ActionPhase };
|
|
31
|
+
//# sourceMappingURL=errors.d.mts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/plugins/action/errors.ts
|
|
2
|
+
const actionError = (phase, parts) => ({
|
|
3
|
+
_tag: "ActionError",
|
|
4
|
+
phase,
|
|
5
|
+
...parts
|
|
6
|
+
});
|
|
7
|
+
/** Error tags this plugin contributes — surfaced to the cause walker
|
|
8
|
+
* via `PluginErrorContribution`. */
|
|
9
|
+
const ACTION_ERROR_TAGS = ["ActionError"];
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ACTION_ERROR_TAGS, actionError };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=errors.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.mjs","names":[],"sources":["../../../src/plugins/action/errors.ts"],"sourcesContent":["// Action plugin — typed errors.\n//\n// Distilled doc 16-action.md \"Failure modes\": signing failure routes\n// through `PublishError({ phase: 'publish-tx' })`. The rewrite splits\n// the user-facing action error from `package`'s `PublishError` because\n// action-specific phases (build, sign, parse) carry different semantics\n// — `build` here is the user-supplied transaction-builder Effect,\n// `sign` is the `signAndExecute` invocation, `parse` covers downstream\n// receipt projection.\n//\n// Per architecture §Effect, errors are plain interfaces with a `_tag`\n// discriminator; `Effect.catchTag` / `catchTags` match on the literal.\n\n/** Phases for `ActionError`. Closed sum — adding a phase requires\n * editing this file (and the plugin doc's catalog).\n *\n * Phase semantics:\n * - `discriminator` — `opts.discriminator` Effect evaluation failed.\n * User-code defect or yielded upstream raised.\n * - `build` — `opts.body`'s build phase (the user-supplied\n * Effect) failed before producing a transaction.\n * - `sign` — `signAndExecute` failed (gas, bytecode\n * verification, RPC).\n * - `parse` — the action's receipt projection (digest /\n * objectChanges) was malformed.\n * - `verify` — verify probe authoritatively raised (transient\n * is masked by the lenient probe — does NOT raise\n * this).\n */\nexport type ActionPhase = 'discriminator' | 'build' | 'sign' | 'parse' | 'verify';\n\n/** Single tagged action error. */\nexport interface ActionError {\n\treadonly _tag: 'ActionError';\n\treadonly phase: ActionPhase;\n\t/** Symbolic action name (the user-declared `action.name`). Flows\n\t * into the cache key namespace and the TUI row title. */\n\treadonly actionName: string;\n\treadonly message: string;\n\treadonly cause?: unknown;\n}\n\nexport const actionError = (\n\tphase: ActionPhase,\n\tparts: Omit<ActionError, '_tag' | 'phase'>,\n): ActionError => ({ _tag: 'ActionError', phase, ...parts });\n\n/** Error tags this plugin contributes — surfaced to the cause walker\n * via `PluginErrorContribution`. */\nexport const ACTION_ERROR_TAGS = ['ActionError'] as const;\n"],"mappings":";AA0CA,MAAa,eACZ,OACA,WACkB;CAAE,MAAM;CAAe;CAAO,GAAG;CAAO;;;AAI3D,MAAa,oBAAoB,CAAC,cAAc"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { buildForkImpersonationTransactionBytes } from "../sui/fork-transaction.mjs";
|
|
2
|
+
import { actionError } from "./errors.mjs";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
import { Transaction } from "@mysten/sui/transactions";
|
|
5
|
+
//#region src/plugins/action/execute.ts
|
|
6
|
+
const projectAccountObjectChanges = (changes) => changes.filter((change) => typeof change === "object" && change !== null && typeof change.objectId === "string").map((change) => {
|
|
7
|
+
const entry = {
|
|
8
|
+
kind: change.type === "created" || change.kind === "created" ? "created" : "mutated",
|
|
9
|
+
objectId: change.objectId
|
|
10
|
+
};
|
|
11
|
+
if (typeof change.objectType === "string") entry.objectType = change.objectType;
|
|
12
|
+
if (typeof change.outputState === "string") entry.outputState = change.outputState;
|
|
13
|
+
if (typeof change.idOperation === "string") entry.idOperation = change.idOperation;
|
|
14
|
+
return entry;
|
|
15
|
+
});
|
|
16
|
+
const receiptFromAccountTx = (tx) => ({
|
|
17
|
+
digest: tx.digest,
|
|
18
|
+
objectChanges: projectAccountObjectChanges(tx.objectChanges),
|
|
19
|
+
balanceChanges: tx.balanceChanges
|
|
20
|
+
});
|
|
21
|
+
/** Drive the full build → sign → execute → wait → project pipeline.
|
|
22
|
+
*
|
|
23
|
+
* Allocates a fresh `Transaction`, sets the sender to the account's
|
|
24
|
+
* address, lets the caller populate it via the `build` callback,
|
|
25
|
+
* serialises via `Transaction.build({ client })`, signs via the
|
|
26
|
+
* account's transaction-signer scope, executes via the SDK's
|
|
27
|
+
* `executeTransaction` (with `include: { effects: true, objectTypes:
|
|
28
|
+
* true }` so the SDK surfaces `changedObjects` + types), waits for
|
|
29
|
+
* finality, and projects the envelope into an `ActionReceipt`.
|
|
30
|
+
*
|
|
31
|
+
* All failures surface as `ActionError`:
|
|
32
|
+
* - `build` callback throws → `phase: 'sign'` (matches the existing
|
|
33
|
+
* catch-all phase for body-side failures).
|
|
34
|
+
* - `Transaction.build` rejects → `phase: 'sign'`.
|
|
35
|
+
* - `signTransaction` rejects → `phase: 'sign'`.
|
|
36
|
+
* - `executeTransaction` rejects → `phase: 'sign'`.
|
|
37
|
+
* - SDK returns `FailedTransaction` → `phase: 'sign'`.
|
|
38
|
+
* - SDK returns no digest → `phase: 'parse'`.
|
|
39
|
+
* - `waitForTransaction` rejects → `phase: 'sign'`.
|
|
40
|
+
*
|
|
41
|
+
* The `actionName` parameter threads into every error's `actionName`
|
|
42
|
+
* field so cause-walker output stays attributable.
|
|
43
|
+
*/
|
|
44
|
+
const signAndExecute = (params) => Effect.gen(function* () {
|
|
45
|
+
const { actionName, sui, account, build } = params;
|
|
46
|
+
return yield* account.withTransactionSigner((lockedSigner) => Effect.gen(function* () {
|
|
47
|
+
const tx = new Transaction();
|
|
48
|
+
tx.setSender(account.address);
|
|
49
|
+
yield* Effect.try({
|
|
50
|
+
try: () => build(tx),
|
|
51
|
+
catch: (cause) => actionError("sign", {
|
|
52
|
+
actionName,
|
|
53
|
+
message: `Action '${actionName}': build callback threw before serialisation.`,
|
|
54
|
+
cause
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
const txBytes = account.source === "impersonate" ? yield* buildForkImpersonationTransactionBytes(tx, account.address, sui.sdk.core).pipe(Effect.mapError((cause) => actionError("sign", {
|
|
58
|
+
actionName,
|
|
59
|
+
message: `Action '${actionName}': fork impersonation Transaction.build failed — ${cause.message}.`,
|
|
60
|
+
cause
|
|
61
|
+
}))) : yield* Effect.tryPromise({
|
|
62
|
+
try: () => tx.build({ client: sui.sdk.client }),
|
|
63
|
+
catch: (cause) => actionError("sign", {
|
|
64
|
+
actionName,
|
|
65
|
+
message: `Action '${actionName}': Transaction.build failed — ${cause instanceof Error ? cause.message : String(cause)}.`,
|
|
66
|
+
cause
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
if (account.source === "impersonate") return receiptFromAccountTx(yield* lockedSigner.signAndExecute(txBytes).pipe(Effect.mapError((cause) => actionError("sign", {
|
|
70
|
+
actionName,
|
|
71
|
+
message: `Action '${actionName}': account.signAndExecute failed for '${account.name}' (address=${account.address}): ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
72
|
+
cause
|
|
73
|
+
}))));
|
|
74
|
+
const signed = yield* lockedSigner.signTransaction(txBytes).pipe(Effect.mapError((cause) => actionError("sign", {
|
|
75
|
+
actionName,
|
|
76
|
+
message: `Action '${actionName}': account.signTransaction failed for '${account.name}' (address=${account.address}): ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
77
|
+
cause
|
|
78
|
+
})));
|
|
79
|
+
const sdkClient = sui.sdk.client;
|
|
80
|
+
const env = yield* Effect.tryPromise({
|
|
81
|
+
try: () => sdkClient.executeTransaction({
|
|
82
|
+
transaction: txBytes,
|
|
83
|
+
signatures: [signed.signature],
|
|
84
|
+
include: {
|
|
85
|
+
effects: true,
|
|
86
|
+
objectTypes: true
|
|
87
|
+
}
|
|
88
|
+
}),
|
|
89
|
+
catch: (cause) => actionError("sign", {
|
|
90
|
+
actionName,
|
|
91
|
+
message: `Action '${actionName}': executeTransaction failed — ` + (cause instanceof Error ? cause.message : String(cause)),
|
|
92
|
+
cause
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
if (env.$kind === "FailedTransaction") {
|
|
96
|
+
const failedDigest = env.FailedTransaction?.digest;
|
|
97
|
+
if (failedDigest !== void 0) yield* Effect.tryPromise({
|
|
98
|
+
try: () => sdkClient.waitForTransaction({ digest: failedDigest }),
|
|
99
|
+
catch: (cause) => actionError("sign", {
|
|
100
|
+
actionName,
|
|
101
|
+
message: `Action '${actionName}': waitForTransaction(${failedDigest}) failed.`,
|
|
102
|
+
cause
|
|
103
|
+
})
|
|
104
|
+
});
|
|
105
|
+
return yield* Effect.fail(actionError("sign", {
|
|
106
|
+
actionName,
|
|
107
|
+
message: `Action '${actionName}': FailedTransaction (digest=${env.FailedTransaction?.digest ?? "<unknown>"}): ${env.FailedTransaction?.status?.error ?? "<no error>"}`
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
const txOk = env.Transaction;
|
|
111
|
+
if (txOk?.digest === void 0) return yield* Effect.fail(actionError("parse", {
|
|
112
|
+
actionName,
|
|
113
|
+
message: `Action '${actionName}': executeTransaction returned no digest.`
|
|
114
|
+
}));
|
|
115
|
+
yield* Effect.tryPromise({
|
|
116
|
+
try: () => sdkClient.waitForTransaction({ digest: txOk.digest }),
|
|
117
|
+
catch: (cause) => actionError("sign", {
|
|
118
|
+
actionName,
|
|
119
|
+
message: `Action '${actionName}': waitForTransaction(${txOk.digest}) failed.`,
|
|
120
|
+
cause
|
|
121
|
+
})
|
|
122
|
+
});
|
|
123
|
+
const objectTypes = txOk.objectTypes ?? {};
|
|
124
|
+
const objectChanges = (txOk.effects?.changedObjects ?? []).filter((c) => typeof c.objectId === "string").map((c) => {
|
|
125
|
+
const objectType = objectTypes[c.objectId];
|
|
126
|
+
const entry = {
|
|
127
|
+
kind: c.idOperation === "Created" ? "created" : "mutated",
|
|
128
|
+
objectId: c.objectId
|
|
129
|
+
};
|
|
130
|
+
if (objectType !== void 0) entry.objectType = objectType;
|
|
131
|
+
if (c.outputState !== void 0) entry.outputState = c.outputState;
|
|
132
|
+
if (c.idOperation !== void 0) entry.idOperation = c.idOperation;
|
|
133
|
+
return entry;
|
|
134
|
+
});
|
|
135
|
+
return {
|
|
136
|
+
digest: txOk.digest,
|
|
137
|
+
objectChanges,
|
|
138
|
+
balanceChanges: []
|
|
139
|
+
};
|
|
140
|
+
}));
|
|
141
|
+
}).pipe(Effect.withSpan("devstack.plugin.action.signAndExecute", { attributes: { "action.name": params.actionName } }));
|
|
142
|
+
//#endregion
|
|
143
|
+
export { signAndExecute };
|
|
144
|
+
|
|
145
|
+
//# sourceMappingURL=execute.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.mjs","names":[],"sources":["../../../src/plugins/action/execute.ts"],"sourcesContent":["// Action plugin — `signAndExecute` helper.\n//\n// This module encapsulates the \"build → sign → execute → wait → project\"\n// roundtrip that every action body needs to perform a Move call against\n// the booted Sui chain. Without it, every action body re-implements the\n// SDK boundary cast on `sdk.client.executeTransaction` + the SDK envelope\n// projection + the post-submit `waitForTransaction` gate.\n//\n// The same wiring lives in `plugins/package/publish-executor.ts` — both\n// sites cast the opaque `sdk.client` to call `executeTransaction({\n// include: { effects: true, objectTypes: true }})` so they recover\n// `changedObjects` + their fully-qualified types. Both run through the\n// Account plugin's transaction-signer scope so `Transaction.build`,\n// signing, execute, and finality wait serialize per address.\n//\n// What this helper extracts: the SDK-envelope projection + the\n// finality-wait. Per call sites:\n//\n// - The user supplies a `build(tx)` callback that populates the\n// `Transaction` synchronously (moveCalls, transferObjects, etc.).\n// - The user supplies the signing `account` (an `AccountValue` from\n// the action's resolved dependency values); we sign with the\n// locked transaction signer and drive the SDK's\n// `executeTransaction` directly.\n// - The helper returns an `ActionReceipt` projection: `{ digest,\n// objectChanges }`. The `objectChanges` array is shaped uniformly so\n// downstream consumers can pick by `objectType` substring.\n//\n// All failures route through `ActionError` (phase: `sign` for transport\n// / RPC failures; `parse` for \"no digest\" / \"wrong envelope shape\"\n// situations). The action plugin's outer wrap collapses these into the\n// substrate's artifact publisher `produce-failed` channel.\n\nimport { Effect, type Scope } from 'effect';\n\nimport { Transaction } from '@mysten/sui/transactions';\n\nimport type { AccountValue, TxResult } from '../account/service.ts';\nimport type { SuiClient } from '../sui/index.ts';\nimport { buildForkImpersonationTransactionBytes } from '../sui/fork-transaction.ts';\n\nimport { actionError, type ActionError } from './errors.ts';\nimport type { ActionReceipt } from './service.ts';\n\n// ---------------------------------------------------------------------------\n// Receipt object-change projection\n// ---------------------------------------------------------------------------\n\n/** Flat object-change record surfaced on an `ActionReceipt`. Mirrors\n * the package plugin's `PublishObjectChange` shape so consumers can\n * reuse `findCreatedByType`-style helpers across the two surfaces.\n *\n * - `kind`: 'created' when `idOperation === 'Created'`, else 'mutated'\n * (we expose the same two buckets the package plugin uses; finer\n * distinctions are recoverable from the raw `idOperation` /\n * `outputState` fields preserved alongside).\n * - `objectType`: optional fully-qualified type string\n * (`<packageId>::<module>::<Name>`) — present when the SDK's\n * `objectTypes` map carries the id. */\nexport interface ActionObjectChange {\n\treadonly kind: 'created' | 'mutated';\n\treadonly objectId: string;\n\treadonly objectType?: string;\n\treadonly outputState?: string;\n\treadonly idOperation?: string;\n}\n\n// ---------------------------------------------------------------------------\n// SDK shape — kept narrow, mirrors the cast in publish-executor.ts\n// ---------------------------------------------------------------------------\n\ninterface SdkExecuteClient {\n\treadonly executeTransaction: (args: {\n\t\treadonly transaction: Uint8Array;\n\t\treadonly signatures: ReadonlyArray<string>;\n\t\treadonly include?: {\n\t\t\treadonly effects?: boolean;\n\t\t\treadonly objectTypes?: boolean;\n\t\t};\n\t}) => Promise<unknown>;\n\treadonly waitForTransaction: (args: {\n\t\treadonly digest: string;\n\t\treadonly include?: { readonly effects?: boolean };\n\t\treadonly timeout?: number;\n\t}) => Promise<unknown>;\n}\n\ninterface RawExecuteEnvelope {\n\treadonly $kind?: 'Transaction' | 'FailedTransaction';\n\treadonly Transaction?: {\n\t\treadonly digest?: string;\n\t\treadonly effects?: {\n\t\t\treadonly changedObjects?: ReadonlyArray<{\n\t\t\t\treadonly objectId?: string;\n\t\t\t\treadonly outputState?: string;\n\t\t\t\treadonly idOperation?: string;\n\t\t\t}>;\n\t\t};\n\t\treadonly objectTypes?: Readonly<Record<string, string>>;\n\t};\n\treadonly FailedTransaction?: {\n\t\treadonly digest?: string;\n\t\treadonly status?: { readonly error?: string };\n\t};\n}\n\nconst projectAccountObjectChanges = (\n\tchanges: ReadonlyArray<unknown>,\n): ReadonlyArray<ActionObjectChange> =>\n\tchanges\n\t\t.filter(\n\t\t\t(\n\t\t\t\tchange,\n\t\t\t): change is {\n\t\t\t\treadonly type?: string;\n\t\t\t\treadonly kind?: string;\n\t\t\t\treadonly objectId: string;\n\t\t\t\treadonly objectType?: string;\n\t\t\t\treadonly outputState?: string;\n\t\t\t\treadonly idOperation?: string;\n\t\t\t} =>\n\t\t\t\ttypeof change === 'object' &&\n\t\t\t\tchange !== null &&\n\t\t\t\ttypeof (change as { readonly objectId?: unknown }).objectId === 'string',\n\t\t)\n\t\t.map((change) => {\n\t\t\tconst entry: {\n\t\t\t\t-readonly [K in keyof ActionObjectChange]: ActionObjectChange[K];\n\t\t\t} = {\n\t\t\t\tkind: change.type === 'created' || change.kind === 'created' ? 'created' : 'mutated',\n\t\t\t\tobjectId: change.objectId,\n\t\t\t};\n\t\t\tif (typeof change.objectType === 'string') entry.objectType = change.objectType;\n\t\t\tif (typeof change.outputState === 'string') entry.outputState = change.outputState;\n\t\t\tif (typeof change.idOperation === 'string') entry.idOperation = change.idOperation;\n\t\t\treturn entry;\n\t\t});\n\nconst receiptFromAccountTx = (tx: TxResult): ActionReceipt => ({\n\tdigest: tx.digest,\n\tobjectChanges: projectAccountObjectChanges(tx.objectChanges),\n\tbalanceChanges: tx.balanceChanges,\n});\n\n// ---------------------------------------------------------------------------\n// `signAndExecute` helper\n// ---------------------------------------------------------------------------\n\n/** Drive the full build → sign → execute → wait → project pipeline.\n *\n * Allocates a fresh `Transaction`, sets the sender to the account's\n * address, lets the caller populate it via the `build` callback,\n * serialises via `Transaction.build({ client })`, signs via the\n * account's transaction-signer scope, executes via the SDK's\n * `executeTransaction` (with `include: { effects: true, objectTypes:\n * true }` so the SDK surfaces `changedObjects` + types), waits for\n * finality, and projects the envelope into an `ActionReceipt`.\n *\n * All failures surface as `ActionError`:\n * - `build` callback throws → `phase: 'sign'` (matches the existing\n * catch-all phase for body-side failures).\n * - `Transaction.build` rejects → `phase: 'sign'`.\n * - `signTransaction` rejects → `phase: 'sign'`.\n * - `executeTransaction` rejects → `phase: 'sign'`.\n * - SDK returns `FailedTransaction` → `phase: 'sign'`.\n * - SDK returns no digest → `phase: 'parse'`.\n * - `waitForTransaction` rejects → `phase: 'sign'`.\n *\n * The `actionName` parameter threads into every error's `actionName`\n * field so cause-walker output stays attributable.\n */\nexport const signAndExecute = (params: {\n\treadonly actionName: string;\n\treadonly sui: SuiClient;\n\treadonly account: AccountValue;\n\treadonly build: (tx: Transaction) => void;\n}): Effect.Effect<ActionReceipt, ActionError, Scope.Scope> =>\n\tEffect.gen(function* () {\n\t\tconst { actionName, sui, account, build } = params;\n\t\treturn yield* account.withTransactionSigner((lockedSigner) =>\n\t\t\tEffect.gen(function* () {\n\t\t\t\t// --- 1. Allocate + populate the Transaction ------------------\n\t\t\t\tconst tx = new Transaction();\n\t\t\t\ttx.setSender(account.address);\n\t\t\t\tyield* Effect.try({\n\t\t\t\t\ttry: () => build(tx),\n\t\t\t\t\tcatch: (cause): ActionError =>\n\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\tmessage: `Action '${actionName}': build callback threw before serialisation.`,\n\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t}),\n\t\t\t\t});\n\n\t\t\t\t// --- 2. Serialise via the mode-appropriate path --------------\n\t\t\t\tconst txBytes =\n\t\t\t\t\taccount.source === 'impersonate'\n\t\t\t\t\t\t? yield* buildForkImpersonationTransactionBytes(tx, account.address, sui.sdk.core).pipe(\n\t\t\t\t\t\t\t\tEffect.mapError(\n\t\t\t\t\t\t\t\t\t(cause): ActionError =>\n\t\t\t\t\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\t\t\t\t\tmessage: `Action '${actionName}': fork impersonation Transaction.build failed — ${cause.message}.`,\n\t\t\t\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t: yield* Effect.tryPromise({\n\t\t\t\t\t\t\t\ttry: () =>\n\t\t\t\t\t\t\t\t\ttx.build({\n\t\t\t\t\t\t\t\t\t\tclient: sui.sdk.client as Parameters<typeof tx.build>[0] extends\n\t\t\t\t\t\t\t\t\t\t\t| { client?: infer C }\n\t\t\t\t\t\t\t\t\t\t\t| undefined\n\t\t\t\t\t\t\t\t\t\t\t? C\n\t\t\t\t\t\t\t\t\t\t\t: never,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\tcatch: (cause): ActionError =>\n\t\t\t\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\t\t\t\tmessage: `Action '${actionName}': Transaction.build failed — ${\n\t\t\t\t\t\t\t\t\t\t\tcause instanceof Error ? cause.message : String(cause)\n\t\t\t\t\t\t\t\t\t\t}.`,\n\t\t\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t});\n\n\t\t\t\tif (account.source === 'impersonate') {\n\t\t\t\t\tconst executed = yield* lockedSigner.signAndExecute(txBytes).pipe(\n\t\t\t\t\t\tEffect.mapError(\n\t\t\t\t\t\t\t(cause): ActionError =>\n\t\t\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\t`Action '${actionName}': account.signAndExecute failed for ` +\n\t\t\t\t\t\t\t\t\t\t`'${account.name}' (address=${account.address}): ${\n\t\t\t\t\t\t\t\t\t\t\tcause instanceof Error ? cause.message : String(cause)\n\t\t\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\treturn receiptFromAccountTx(executed);\n\t\t\t\t}\n\n\t\t\t\t// --- 3. Sign with the account -------------------------------\n\t\t\t\tconst signed = yield* lockedSigner.signTransaction(txBytes).pipe(\n\t\t\t\t\tEffect.mapError(\n\t\t\t\t\t\t(cause): ActionError =>\n\t\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t`Action '${actionName}': account.signTransaction failed for ` +\n\t\t\t\t\t\t\t\t\t`'${account.name}' (address=${account.address}): ${\n\t\t\t\t\t\t\t\t\t\tcause instanceof Error ? cause.message : String(cause)\n\t\t\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\t// --- 4. Execute via the SDK (with effects+objectTypes) ------\n\t\t\t\tconst sdkClient = sui.sdk.client as SdkExecuteClient;\n\t\t\t\tconst raw = yield* Effect.tryPromise({\n\t\t\t\t\ttry: () =>\n\t\t\t\t\t\tsdkClient.executeTransaction({\n\t\t\t\t\t\t\ttransaction: txBytes,\n\t\t\t\t\t\t\tsignatures: [signed.signature],\n\t\t\t\t\t\t\tinclude: { effects: true, objectTypes: true },\n\t\t\t\t\t\t}),\n\t\t\t\t\tcatch: (cause): ActionError =>\n\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Action '${actionName}': executeTransaction failed — ` +\n\t\t\t\t\t\t\t\t(cause instanceof Error ? cause.message : String(cause)),\n\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t}),\n\t\t\t\t});\n\n\t\t\t\t// --- 5. Project the envelope --------------------------------\n\t\t\t\tconst env = raw as RawExecuteEnvelope;\n\t\t\t\tif (env.$kind === 'FailedTransaction') {\n\t\t\t\t\tconst failedDigest = env.FailedTransaction?.digest;\n\t\t\t\t\tif (failedDigest !== undefined) {\n\t\t\t\t\t\tyield* Effect.tryPromise({\n\t\t\t\t\t\t\ttry: () => sdkClient.waitForTransaction({ digest: failedDigest }),\n\t\t\t\t\t\t\tcatch: (cause): ActionError =>\n\t\t\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\t\t\tmessage: `Action '${actionName}': waitForTransaction(${failedDigest}) failed.`,\n\t\t\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t`Action '${actionName}': FailedTransaction ` +\n\t\t\t\t\t\t\t\t`(digest=${env.FailedTransaction?.digest ?? '<unknown>'}): ` +\n\t\t\t\t\t\t\t\t`${env.FailedTransaction?.status?.error ?? '<no error>'}`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst txOk = env.Transaction;\n\t\t\t\tif (txOk?.digest === undefined) {\n\t\t\t\t\treturn yield* Effect.fail(\n\t\t\t\t\t\tactionError('parse', {\n\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\tmessage: `Action '${actionName}': executeTransaction returned no digest.`,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// --- 6. Wait for finality -----------------------------------\n\t\t\t\tyield* Effect.tryPromise({\n\t\t\t\t\ttry: () => sdkClient.waitForTransaction({ digest: txOk.digest! }),\n\t\t\t\t\tcatch: (cause): ActionError =>\n\t\t\t\t\t\tactionError('sign', {\n\t\t\t\t\t\t\tactionName,\n\t\t\t\t\t\t\tmessage: `Action '${actionName}': waitForTransaction(${txOk.digest}) failed.`,\n\t\t\t\t\t\t\tcause,\n\t\t\t\t\t\t}),\n\t\t\t\t});\n\n\t\t\t\t// --- 7. Project changedObjects into the receipt's objectChanges\n\t\t\t\tconst objectTypes = txOk.objectTypes ?? {};\n\t\t\t\tconst objectChanges: ReadonlyArray<ActionObjectChange> = (\n\t\t\t\t\ttxOk.effects?.changedObjects ?? []\n\t\t\t\t)\n\t\t\t\t\t.filter(\n\t\t\t\t\t\t(c): c is { objectId: string; outputState?: string; idOperation?: string } =>\n\t\t\t\t\t\t\ttypeof c.objectId === 'string',\n\t\t\t\t\t)\n\t\t\t\t\t.map((c) => {\n\t\t\t\t\t\tconst objectType = objectTypes[c.objectId];\n\t\t\t\t\t\tconst entry: {\n\t\t\t\t\t\t\t-readonly [K in keyof ActionObjectChange]: ActionObjectChange[K];\n\t\t\t\t\t\t} = {\n\t\t\t\t\t\t\tkind: c.idOperation === 'Created' ? 'created' : 'mutated',\n\t\t\t\t\t\t\tobjectId: c.objectId,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (objectType !== undefined) entry.objectType = objectType;\n\t\t\t\t\t\tif (c.outputState !== undefined) entry.outputState = c.outputState;\n\t\t\t\t\t\tif (c.idOperation !== undefined) entry.idOperation = c.idOperation;\n\t\t\t\t\t\treturn entry;\n\t\t\t\t\t});\n\n\t\t\t\tconst receipt: ActionReceipt = {\n\t\t\t\t\tdigest: txOk.digest,\n\t\t\t\t\tobjectChanges,\n\t\t\t\t\tbalanceChanges: [],\n\t\t\t\t};\n\t\t\t\treturn receipt;\n\t\t\t}),\n\t\t);\n\t}).pipe(\n\t\tEffect.withSpan('devstack.plugin.action.signAndExecute', {\n\t\t\tattributes: { 'action.name': params.actionName },\n\t\t}),\n\t);\n"],"mappings":";;;;;AA0GA,MAAM,+BACL,YAEA,QACE,QAEC,WASA,OAAO,WAAW,YAClB,WAAW,QACX,OAAQ,OAA2C,aAAa,SACjE,CACA,KAAK,WAAW;CAChB,MAAM,QAEF;EACH,MAAM,OAAO,SAAS,aAAa,OAAO,SAAS,YAAY,YAAY;EAC3E,UAAU,OAAO;EACjB;AACD,KAAI,OAAO,OAAO,eAAe,SAAU,OAAM,aAAa,OAAO;AACrE,KAAI,OAAO,OAAO,gBAAgB,SAAU,OAAM,cAAc,OAAO;AACvE,KAAI,OAAO,OAAO,gBAAgB,SAAU,OAAM,cAAc,OAAO;AACvE,QAAO;EACN;AAEJ,MAAM,wBAAwB,QAAiC;CAC9D,QAAQ,GAAG;CACX,eAAe,4BAA4B,GAAG,cAAc;CAC5D,gBAAgB,GAAG;CACnB;;;;;;;;;;;;;;;;;;;;;;;;AA6BD,MAAa,kBAAkB,WAM9B,OAAO,IAAI,aAAa;CACvB,MAAM,EAAE,YAAY,KAAK,SAAS,UAAU;AAC5C,QAAO,OAAO,QAAQ,uBAAuB,iBAC5C,OAAO,IAAI,aAAa;EAEvB,MAAM,KAAK,IAAI,aAAa;AAC5B,KAAG,UAAU,QAAQ,QAAQ;AAC7B,SAAO,OAAO,IAAI;GACjB,WAAW,MAAM,GAAG;GACpB,QAAQ,UACP,YAAY,QAAQ;IACnB;IACA,SAAS,WAAW,WAAW;IAC/B;IACA,CAAC;GACH,CAAC;EAGF,MAAM,UACL,QAAQ,WAAW,gBAChB,OAAO,uCAAuC,IAAI,QAAQ,SAAS,IAAI,IAAI,KAAK,CAAC,KACjF,OAAO,UACL,UACA,YAAY,QAAQ;GACnB;GACA,SAAS,WAAW,WAAW,mDAAmD,MAAM,QAAQ;GAChG;GACA,CAAC,CACH,CACD,GACA,OAAO,OAAO,WAAW;GACzB,WACC,GAAG,MAAM,EACR,QAAQ,IAAI,IAAI,QAKhB,CAAC;GACH,QAAQ,UACP,YAAY,QAAQ;IACnB;IACA,SAAS,WAAW,WAAW,gCAC9B,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CACtD;IACD;IACA,CAAC;GACH,CAAC;AAEL,MAAI,QAAQ,WAAW,cAetB,QAAO,qBAAqB,OAdJ,aAAa,eAAe,QAAQ,CAAC,KAC5D,OAAO,UACL,UACA,YAAY,QAAQ;GACnB;GACA,SACC,WAAW,WAAW,wCAClB,QAAQ,KAAK,aAAa,QAAQ,QAAQ,KAC7C,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;GAExD;GACA,CAAC,CACH,CACD,CACoC;EAItC,MAAM,SAAS,OAAO,aAAa,gBAAgB,QAAQ,CAAC,KAC3D,OAAO,UACL,UACA,YAAY,QAAQ;GACnB;GACA,SACC,WAAW,WAAW,yCAClB,QAAQ,KAAK,aAAa,QAAQ,QAAQ,KAC7C,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;GAExD;GACA,CAAC,CACH,CACD;EAGD,MAAM,YAAY,IAAI,IAAI;EAmB1B,MAAM,MAAM,OAlBO,OAAO,WAAW;GACpC,WACC,UAAU,mBAAmB;IAC5B,aAAa;IACb,YAAY,CAAC,OAAO,UAAU;IAC9B,SAAS;KAAE,SAAS;KAAM,aAAa;KAAM;IAC7C,CAAC;GACH,QAAQ,UACP,YAAY,QAAQ;IACnB;IACA,SACC,WAAW,WAAW,oCACrB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;IACxD;IACA,CAAC;GACH,CAAC;AAIF,MAAI,IAAI,UAAU,qBAAqB;GACtC,MAAM,eAAe,IAAI,mBAAmB;AAC5C,OAAI,iBAAiB,KAAA,EACpB,QAAO,OAAO,WAAW;IACxB,WAAW,UAAU,mBAAmB,EAAE,QAAQ,cAAc,CAAC;IACjE,QAAQ,UACP,YAAY,QAAQ;KACnB;KACA,SAAS,WAAW,WAAW,wBAAwB,aAAa;KACpE;KACA,CAAC;IACH,CAAC;AAEH,UAAO,OAAO,OAAO,KACpB,YAAY,QAAQ;IACnB;IACA,SACC,WAAW,WAAW,+BACX,IAAI,mBAAmB,UAAU,YAAY,KACrD,IAAI,mBAAmB,QAAQ,SAAS;IAC5C,CAAC,CACF;;EAEF,MAAM,OAAO,IAAI;AACjB,MAAI,MAAM,WAAW,KAAA,EACpB,QAAO,OAAO,OAAO,KACpB,YAAY,SAAS;GACpB;GACA,SAAS,WAAW,WAAW;GAC/B,CAAC,CACF;AAIF,SAAO,OAAO,WAAW;GACxB,WAAW,UAAU,mBAAmB,EAAE,QAAQ,KAAK,QAAS,CAAC;GACjE,QAAQ,UACP,YAAY,QAAQ;IACnB;IACA,SAAS,WAAW,WAAW,wBAAwB,KAAK,OAAO;IACnE;IACA,CAAC;GACH,CAAC;EAGF,MAAM,cAAc,KAAK,eAAe,EAAE;EAC1C,MAAM,iBACL,KAAK,SAAS,kBAAkB,EAAE,EAEjC,QACC,MACA,OAAO,EAAE,aAAa,SACvB,CACA,KAAK,MAAM;GACX,MAAM,aAAa,YAAY,EAAE;GACjC,MAAM,QAEF;IACH,MAAM,EAAE,gBAAgB,YAAY,YAAY;IAChD,UAAU,EAAE;IACZ;AACD,OAAI,eAAe,KAAA,EAAW,OAAM,aAAa;AACjD,OAAI,EAAE,gBAAgB,KAAA,EAAW,OAAM,cAAc,EAAE;AACvD,OAAI,EAAE,gBAAgB,KAAA,EAAW,OAAM,cAAc,EAAE;AACvD,UAAO;IACN;AAOH,SAAO;GAJN,QAAQ,KAAK;GACb;GACA,gBAAgB,EAAE;GAEL;GACb,CACF;EACA,CAAC,KACF,OAAO,SAAS,yCAAyC,EACxD,YAAY,EAAE,eAAe,OAAO,YAAY,EAChD,CAAC,CACF"}
|