@waiaas/daemon 2.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/error-hints.d.ts +15 -0
- package/dist/api/error-hints.d.ts.map +1 -0
- package/dist/api/error-hints.js +71 -0
- package/dist/api/error-hints.js.map +1 -0
- package/dist/api/index.d.ts +11 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +14 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/middleware/address-validation.d.ts +38 -0
- package/dist/api/middleware/address-validation.d.ts.map +1 -0
- package/dist/api/middleware/address-validation.js +134 -0
- package/dist/api/middleware/address-validation.js.map +1 -0
- package/dist/api/middleware/csp.d.ts +17 -0
- package/dist/api/middleware/csp.d.ts.map +1 -0
- package/dist/api/middleware/csp.js +31 -0
- package/dist/api/middleware/csp.js.map +1 -0
- package/dist/api/middleware/error-handler.d.ts +16 -0
- package/dist/api/middleware/error-handler.d.ts.map +1 -0
- package/dist/api/middleware/error-handler.js +46 -0
- package/dist/api/middleware/error-handler.js.map +1 -0
- package/dist/api/middleware/host-guard.d.ts +11 -0
- package/dist/api/middleware/host-guard.d.ts.map +1 -0
- package/dist/api/middleware/host-guard.js +25 -0
- package/dist/api/middleware/host-guard.js.map +1 -0
- package/dist/api/middleware/index.d.ts +13 -0
- package/dist/api/middleware/index.d.ts.map +1 -0
- package/dist/api/middleware/index.js +13 -0
- package/dist/api/middleware/index.js.map +1 -0
- package/dist/api/middleware/kill-switch-guard.d.ts +19 -0
- package/dist/api/middleware/kill-switch-guard.d.ts.map +1 -0
- package/dist/api/middleware/kill-switch-guard.js +49 -0
- package/dist/api/middleware/kill-switch-guard.js.map +1 -0
- package/dist/api/middleware/master-auth.d.ts +15 -0
- package/dist/api/middleware/master-auth.d.ts.map +1 -0
- package/dist/api/middleware/master-auth.js +35 -0
- package/dist/api/middleware/master-auth.js.map +1 -0
- package/dist/api/middleware/owner-auth.d.ts +30 -0
- package/dist/api/middleware/owner-auth.d.ts.map +1 -0
- package/dist/api/middleware/owner-auth.js +133 -0
- package/dist/api/middleware/owner-auth.js.map +1 -0
- package/dist/api/middleware/request-id.d.ts +10 -0
- package/dist/api/middleware/request-id.d.ts.map +1 -0
- package/dist/api/middleware/request-id.js +18 -0
- package/dist/api/middleware/request-id.js.map +1 -0
- package/dist/api/middleware/request-logger.d.ts +9 -0
- package/dist/api/middleware/request-logger.d.ts.map +1 -0
- package/dist/api/middleware/request-logger.js +18 -0
- package/dist/api/middleware/request-logger.js.map +1 -0
- package/dist/api/middleware/session-auth.d.ts +21 -0
- package/dist/api/middleware/session-auth.d.ts.map +1 -0
- package/dist/api/middleware/session-auth.js +51 -0
- package/dist/api/middleware/session-auth.js.map +1 -0
- package/dist/api/middleware/siwe-verify.d.ts +31 -0
- package/dist/api/middleware/siwe-verify.d.ts.map +1 -0
- package/dist/api/middleware/siwe-verify.js +55 -0
- package/dist/api/middleware/siwe-verify.js.map +1 -0
- package/dist/api/routes/actions.d.ts +56 -0
- package/dist/api/routes/actions.d.ts.map +1 -0
- package/dist/api/routes/actions.js +291 -0
- package/dist/api/routes/actions.js.map +1 -0
- package/dist/api/routes/admin.d.ts +99 -0
- package/dist/api/routes/admin.d.ts.map +1 -0
- package/dist/api/routes/admin.js +1304 -0
- package/dist/api/routes/admin.js.map +1 -0
- package/dist/api/routes/display-currency-helper.d.ts +26 -0
- package/dist/api/routes/display-currency-helper.d.ts.map +1 -0
- package/dist/api/routes/display-currency-helper.js +47 -0
- package/dist/api/routes/display-currency-helper.js.map +1 -0
- package/dist/api/routes/health.d.ts +14 -0
- package/dist/api/routes/health.d.ts.map +1 -0
- package/dist/api/routes/health.js +47 -0
- package/dist/api/routes/health.js.map +1 -0
- package/dist/api/routes/index.d.ts +15 -0
- package/dist/api/routes/index.d.ts.map +1 -0
- package/dist/api/routes/index.js +15 -0
- package/dist/api/routes/index.js.map +1 -0
- package/dist/api/routes/mcp.d.ts +30 -0
- package/dist/api/routes/mcp.d.ts.map +1 -0
- package/dist/api/routes/mcp.js +156 -0
- package/dist/api/routes/mcp.js.map +1 -0
- package/dist/api/routes/nonce.d.ts +20 -0
- package/dist/api/routes/nonce.d.ts.map +1 -0
- package/dist/api/routes/nonce.js +48 -0
- package/dist/api/routes/nonce.js.map +1 -0
- package/dist/api/routes/openapi-schemas.d.ts +2281 -0
- package/dist/api/routes/openapi-schemas.d.ts.map +1 -0
- package/dist/api/routes/openapi-schemas.js +770 -0
- package/dist/api/routes/openapi-schemas.js.map +1 -0
- package/dist/api/routes/policies.d.ts +29 -0
- package/dist/api/routes/policies.d.ts.map +1 -0
- package/dist/api/routes/policies.js +332 -0
- package/dist/api/routes/policies.js.map +1 -0
- package/dist/api/routes/sessions.d.ts +35 -0
- package/dist/api/routes/sessions.d.ts.map +1 -0
- package/dist/api/routes/sessions.js +347 -0
- package/dist/api/routes/sessions.js.map +1 -0
- package/dist/api/routes/skills.d.ts +9 -0
- package/dist/api/routes/skills.d.ts.map +1 -0
- package/dist/api/routes/skills.js +59 -0
- package/dist/api/routes/skills.js.map +1 -0
- package/dist/api/routes/tokens.d.ts +25 -0
- package/dist/api/routes/tokens.d.ts.map +1 -0
- package/dist/api/routes/tokens.js +161 -0
- package/dist/api/routes/tokens.js.map +1 -0
- package/dist/api/routes/transactions.d.ts +68 -0
- package/dist/api/routes/transactions.d.ts.map +1 -0
- package/dist/api/routes/transactions.js +576 -0
- package/dist/api/routes/transactions.js.map +1 -0
- package/dist/api/routes/utils.d.ts +9 -0
- package/dist/api/routes/utils.d.ts.map +1 -0
- package/dist/api/routes/utils.js +52 -0
- package/dist/api/routes/utils.js.map +1 -0
- package/dist/api/routes/wallet.d.ts +36 -0
- package/dist/api/routes/wallet.d.ts.map +1 -0
- package/dist/api/routes/wallet.js +358 -0
- package/dist/api/routes/wallet.js.map +1 -0
- package/dist/api/routes/wallets.d.ts +43 -0
- package/dist/api/routes/wallets.d.ts.map +1 -0
- package/dist/api/routes/wallets.js +630 -0
- package/dist/api/routes/wallets.js.map +1 -0
- package/dist/api/routes/wc.d.ts +46 -0
- package/dist/api/routes/wc.d.ts.map +1 -0
- package/dist/api/routes/wc.js +354 -0
- package/dist/api/routes/wc.js.map +1 -0
- package/dist/api/routes/x402.d.ts +61 -0
- package/dist/api/routes/x402.d.ts.map +1 -0
- package/dist/api/routes/x402.js +493 -0
- package/dist/api/routes/x402.js.map +1 -0
- package/dist/api/server.d.ts +81 -0
- package/dist/api/server.d.ts.map +1 -0
- package/dist/api/server.js +406 -0
- package/dist/api/server.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/action/action-provider-registry.d.ts +77 -0
- package/dist/infrastructure/action/action-provider-registry.d.ts.map +1 -0
- package/dist/infrastructure/action/action-provider-registry.js +239 -0
- package/dist/infrastructure/action/action-provider-registry.js.map +1 -0
- package/dist/infrastructure/action/api-key-store.d.ts +60 -0
- package/dist/infrastructure/action/api-key-store.d.ts.map +1 -0
- package/dist/infrastructure/action/api-key-store.js +130 -0
- package/dist/infrastructure/action/api-key-store.js.map +1 -0
- package/dist/infrastructure/action/index.d.ts +10 -0
- package/dist/infrastructure/action/index.d.ts.map +1 -0
- package/dist/infrastructure/action/index.js +9 -0
- package/dist/infrastructure/action/index.js.map +1 -0
- package/dist/infrastructure/adapter-pool.d.ts +50 -0
- package/dist/infrastructure/adapter-pool.d.ts.map +1 -0
- package/dist/infrastructure/adapter-pool.js +110 -0
- package/dist/infrastructure/adapter-pool.js.map +1 -0
- package/dist/infrastructure/backup/backup-service.d.ts +53 -0
- package/dist/infrastructure/backup/backup-service.d.ts.map +1 -0
- package/dist/infrastructure/backup/backup-service.js +158 -0
- package/dist/infrastructure/backup/backup-service.js.map +1 -0
- package/dist/infrastructure/backup/index.d.ts +2 -0
- package/dist/infrastructure/backup/index.d.ts.map +1 -0
- package/dist/infrastructure/backup/index.js +2 -0
- package/dist/infrastructure/backup/index.js.map +1 -0
- package/dist/infrastructure/config/index.d.ts +8 -0
- package/dist/infrastructure/config/index.d.ts.map +1 -0
- package/dist/infrastructure/config/index.js +7 -0
- package/dist/infrastructure/config/index.js.map +1 -0
- package/dist/infrastructure/config/loader.d.ts +555 -0
- package/dist/infrastructure/config/loader.d.ts.map +1 -0
- package/dist/infrastructure/config/loader.js +311 -0
- package/dist/infrastructure/config/loader.js.map +1 -0
- package/dist/infrastructure/database/checks.d.ts +19 -0
- package/dist/infrastructure/database/checks.d.ts.map +1 -0
- package/dist/infrastructure/database/checks.js +27 -0
- package/dist/infrastructure/database/checks.js.map +1 -0
- package/dist/infrastructure/database/compatibility.d.ts +36 -0
- package/dist/infrastructure/database/compatibility.d.ts.map +1 -0
- package/dist/infrastructure/database/compatibility.js +75 -0
- package/dist/infrastructure/database/compatibility.js.map +1 -0
- package/dist/infrastructure/database/connection.d.ts +36 -0
- package/dist/infrastructure/database/connection.d.ts.map +1 -0
- package/dist/infrastructure/database/connection.js +47 -0
- package/dist/infrastructure/database/connection.js.map +1 -0
- package/dist/infrastructure/database/id.d.ts +17 -0
- package/dist/infrastructure/database/id.d.ts.map +1 -0
- package/dist/infrastructure/database/id.js +20 -0
- package/dist/infrastructure/database/id.js.map +1 -0
- package/dist/infrastructure/database/index.d.ts +15 -0
- package/dist/infrastructure/database/index.d.ts.map +1 -0
- package/dist/infrastructure/database/index.js +12 -0
- package/dist/infrastructure/database/index.js.map +1 -0
- package/dist/infrastructure/database/migrate.d.ts +76 -0
- package/dist/infrastructure/database/migrate.d.ts.map +1 -0
- package/dist/infrastructure/database/migrate.js +1214 -0
- package/dist/infrastructure/database/migrate.js.map +1 -0
- package/dist/infrastructure/database/schema.d.ts +2352 -0
- package/dist/infrastructure/database/schema.d.ts.map +1 -0
- package/dist/infrastructure/database/schema.js +288 -0
- package/dist/infrastructure/database/schema.js.map +1 -0
- package/dist/infrastructure/jwt/index.d.ts +2 -0
- package/dist/infrastructure/jwt/index.d.ts.map +1 -0
- package/dist/infrastructure/jwt/index.js +2 -0
- package/dist/infrastructure/jwt/index.js.map +1 -0
- package/dist/infrastructure/jwt/jwt-secret-manager.d.ts +58 -0
- package/dist/infrastructure/jwt/jwt-secret-manager.d.ts.map +1 -0
- package/dist/infrastructure/jwt/jwt-secret-manager.js +222 -0
- package/dist/infrastructure/jwt/jwt-secret-manager.js.map +1 -0
- package/dist/infrastructure/keystore/crypto.d.ts +62 -0
- package/dist/infrastructure/keystore/crypto.d.ts.map +1 -0
- package/dist/infrastructure/keystore/crypto.js +89 -0
- package/dist/infrastructure/keystore/crypto.js.map +1 -0
- package/dist/infrastructure/keystore/index.d.ts +4 -0
- package/dist/infrastructure/keystore/index.d.ts.map +1 -0
- package/dist/infrastructure/keystore/index.js +5 -0
- package/dist/infrastructure/keystore/index.js.map +1 -0
- package/dist/infrastructure/keystore/keystore.d.ts +115 -0
- package/dist/infrastructure/keystore/keystore.d.ts.map +1 -0
- package/dist/infrastructure/keystore/keystore.js +327 -0
- package/dist/infrastructure/keystore/keystore.js.map +1 -0
- package/dist/infrastructure/keystore/memory.d.ts +45 -0
- package/dist/infrastructure/keystore/memory.d.ts.map +1 -0
- package/dist/infrastructure/keystore/memory.js +105 -0
- package/dist/infrastructure/keystore/memory.js.map +1 -0
- package/dist/infrastructure/oracle/coingecko-forex.d.ts +35 -0
- package/dist/infrastructure/oracle/coingecko-forex.d.ts.map +1 -0
- package/dist/infrastructure/oracle/coingecko-forex.js +69 -0
- package/dist/infrastructure/oracle/coingecko-forex.js.map +1 -0
- package/dist/infrastructure/oracle/coingecko-oracle.d.ts +73 -0
- package/dist/infrastructure/oracle/coingecko-oracle.d.ts.map +1 -0
- package/dist/infrastructure/oracle/coingecko-oracle.js +199 -0
- package/dist/infrastructure/oracle/coingecko-oracle.js.map +1 -0
- package/dist/infrastructure/oracle/coingecko-platform-ids.d.ts +32 -0
- package/dist/infrastructure/oracle/coingecko-platform-ids.d.ts.map +1 -0
- package/dist/infrastructure/oracle/coingecko-platform-ids.js +30 -0
- package/dist/infrastructure/oracle/coingecko-platform-ids.js.map +1 -0
- package/dist/infrastructure/oracle/forex-currencies.d.ts +36 -0
- package/dist/infrastructure/oracle/forex-currencies.d.ts.map +1 -0
- package/dist/infrastructure/oracle/forex-currencies.js +71 -0
- package/dist/infrastructure/oracle/forex-currencies.js.map +1 -0
- package/dist/infrastructure/oracle/forex-rate-service.d.ts +51 -0
- package/dist/infrastructure/oracle/forex-rate-service.d.ts.map +1 -0
- package/dist/infrastructure/oracle/forex-rate-service.js +149 -0
- package/dist/infrastructure/oracle/forex-rate-service.js.map +1 -0
- package/dist/infrastructure/oracle/index.d.ts +18 -0
- package/dist/infrastructure/oracle/index.d.ts.map +1 -0
- package/dist/infrastructure/oracle/index.js +19 -0
- package/dist/infrastructure/oracle/index.js.map +1 -0
- package/dist/infrastructure/oracle/oracle-chain.d.ts +101 -0
- package/dist/infrastructure/oracle/oracle-chain.d.ts.map +1 -0
- package/dist/infrastructure/oracle/oracle-chain.js +163 -0
- package/dist/infrastructure/oracle/oracle-chain.js.map +1 -0
- package/dist/infrastructure/oracle/oracle-errors.d.ts +42 -0
- package/dist/infrastructure/oracle/oracle-errors.d.ts.map +1 -0
- package/dist/infrastructure/oracle/oracle-errors.js +53 -0
- package/dist/infrastructure/oracle/oracle-errors.js.map +1 -0
- package/dist/infrastructure/oracle/price-age.d.ts +38 -0
- package/dist/infrastructure/oracle/price-age.d.ts.map +1 -0
- package/dist/infrastructure/oracle/price-age.js +44 -0
- package/dist/infrastructure/oracle/price-age.js.map +1 -0
- package/dist/infrastructure/oracle/price-cache.d.ts +99 -0
- package/dist/infrastructure/oracle/price-cache.d.ts.map +1 -0
- package/dist/infrastructure/oracle/price-cache.js +173 -0
- package/dist/infrastructure/oracle/price-cache.js.map +1 -0
- package/dist/infrastructure/oracle/pyth-feed-ids.d.ts +31 -0
- package/dist/infrastructure/oracle/pyth-feed-ids.d.ts.map +1 -0
- package/dist/infrastructure/oracle/pyth-feed-ids.js +44 -0
- package/dist/infrastructure/oracle/pyth-feed-ids.js.map +1 -0
- package/dist/infrastructure/oracle/pyth-oracle.d.ts +69 -0
- package/dist/infrastructure/oracle/pyth-oracle.d.ts.map +1 -0
- package/dist/infrastructure/oracle/pyth-oracle.js +149 -0
- package/dist/infrastructure/oracle/pyth-oracle.js.map +1 -0
- package/dist/infrastructure/settings/hot-reload.d.ts +71 -0
- package/dist/infrastructure/settings/hot-reload.d.ts.map +1 -0
- package/dist/infrastructure/settings/hot-reload.js +315 -0
- package/dist/infrastructure/settings/hot-reload.js.map +1 -0
- package/dist/infrastructure/settings/index.d.ts +13 -0
- package/dist/infrastructure/settings/index.d.ts.map +1 -0
- package/dist/infrastructure/settings/index.js +10 -0
- package/dist/infrastructure/settings/index.js.map +1 -0
- package/dist/infrastructure/settings/setting-keys.d.ts +28 -0
- package/dist/infrastructure/settings/setting-keys.d.ts.map +1 -0
- package/dist/infrastructure/settings/setting-keys.js +105 -0
- package/dist/infrastructure/settings/setting-keys.js.map +1 -0
- package/dist/infrastructure/settings/settings-crypto.d.ts +39 -0
- package/dist/infrastructure/settings/settings-crypto.d.ts.map +1 -0
- package/dist/infrastructure/settings/settings-crypto.js +73 -0
- package/dist/infrastructure/settings/settings-crypto.js.map +1 -0
- package/dist/infrastructure/settings/settings-service.d.ts +82 -0
- package/dist/infrastructure/settings/settings-service.d.ts.map +1 -0
- package/dist/infrastructure/settings/settings-service.js +267 -0
- package/dist/infrastructure/settings/settings-service.js.map +1 -0
- package/dist/infrastructure/telegram/index.d.ts +6 -0
- package/dist/infrastructure/telegram/index.d.ts.map +1 -0
- package/dist/infrastructure/telegram/index.js +5 -0
- package/dist/infrastructure/telegram/index.js.map +1 -0
- package/dist/infrastructure/telegram/telegram-api.d.ts +35 -0
- package/dist/infrastructure/telegram/telegram-api.d.ts.map +1 -0
- package/dist/infrastructure/telegram/telegram-api.js +82 -0
- package/dist/infrastructure/telegram/telegram-api.js.map +1 -0
- package/dist/infrastructure/telegram/telegram-auth.d.ts +57 -0
- package/dist/infrastructure/telegram/telegram-auth.d.ts.map +1 -0
- package/dist/infrastructure/telegram/telegram-auth.js +88 -0
- package/dist/infrastructure/telegram/telegram-auth.js.map +1 -0
- package/dist/infrastructure/telegram/telegram-bot-service.d.ts +95 -0
- package/dist/infrastructure/telegram/telegram-bot-service.d.ts.map +1 -0
- package/dist/infrastructure/telegram/telegram-bot-service.js +564 -0
- package/dist/infrastructure/telegram/telegram-bot-service.js.map +1 -0
- package/dist/infrastructure/telegram/telegram-keyboard.d.ts +27 -0
- package/dist/infrastructure/telegram/telegram-keyboard.d.ts.map +1 -0
- package/dist/infrastructure/telegram/telegram-keyboard.js +52 -0
- package/dist/infrastructure/telegram/telegram-keyboard.js.map +1 -0
- package/dist/infrastructure/telegram/telegram-types.d.ts +43 -0
- package/dist/infrastructure/telegram/telegram-types.d.ts.map +1 -0
- package/dist/infrastructure/telegram/telegram-types.js +8 -0
- package/dist/infrastructure/telegram/telegram-types.js.map +1 -0
- package/dist/infrastructure/token-registry/builtin-tokens.d.ts +39 -0
- package/dist/infrastructure/token-registry/builtin-tokens.d.ts.map +1 -0
- package/dist/infrastructure/token-registry/builtin-tokens.js +135 -0
- package/dist/infrastructure/token-registry/builtin-tokens.js.map +1 -0
- package/dist/infrastructure/token-registry/index.d.ts +8 -0
- package/dist/infrastructure/token-registry/index.d.ts.map +1 -0
- package/dist/infrastructure/token-registry/index.js +8 -0
- package/dist/infrastructure/token-registry/index.js.map +1 -0
- package/dist/infrastructure/token-registry/token-registry-service.d.ts +49 -0
- package/dist/infrastructure/token-registry/token-registry-service.d.ts.map +1 -0
- package/dist/infrastructure/token-registry/token-registry-service.js +93 -0
- package/dist/infrastructure/token-registry/token-registry-service.js.map +1 -0
- package/dist/infrastructure/version/index.d.ts +5 -0
- package/dist/infrastructure/version/index.d.ts.map +1 -0
- package/dist/infrastructure/version/index.js +5 -0
- package/dist/infrastructure/version/index.js.map +1 -0
- package/dist/infrastructure/version/version-check-service.d.ts +35 -0
- package/dist/infrastructure/version/version-check-service.d.ts.map +1 -0
- package/dist/infrastructure/version/version-check-service.js +92 -0
- package/dist/infrastructure/version/version-check-service.js.map +1 -0
- package/dist/lifecycle/daemon.d.ts +103 -0
- package/dist/lifecycle/daemon.d.ts.map +1 -0
- package/dist/lifecycle/daemon.js +934 -0
- package/dist/lifecycle/daemon.js.map +1 -0
- package/dist/lifecycle/index.d.ts +9 -0
- package/dist/lifecycle/index.d.ts.map +1 -0
- package/dist/lifecycle/index.js +9 -0
- package/dist/lifecycle/index.js.map +1 -0
- package/dist/lifecycle/signal-handler.d.ts +18 -0
- package/dist/lifecycle/signal-handler.d.ts.map +1 -0
- package/dist/lifecycle/signal-handler.js +37 -0
- package/dist/lifecycle/signal-handler.js.map +1 -0
- package/dist/lifecycle/workers.d.ts +46 -0
- package/dist/lifecycle/workers.d.ts.map +1 -0
- package/dist/lifecycle/workers.js +101 -0
- package/dist/lifecycle/workers.js.map +1 -0
- package/dist/notifications/channels/discord.d.ts +10 -0
- package/dist/notifications/channels/discord.d.ts.map +1 -0
- package/dist/notifications/channels/discord.js +54 -0
- package/dist/notifications/channels/discord.js.map +1 -0
- package/dist/notifications/channels/ntfy.d.ts +13 -0
- package/dist/notifications/channels/ntfy.d.ts.map +1 -0
- package/dist/notifications/channels/ntfy.js +58 -0
- package/dist/notifications/channels/ntfy.js.map +1 -0
- package/dist/notifications/channels/slack.d.ts +10 -0
- package/dist/notifications/channels/slack.d.ts.map +1 -0
- package/dist/notifications/channels/slack.js +55 -0
- package/dist/notifications/channels/slack.js.map +1 -0
- package/dist/notifications/channels/telegram.d.ts +10 -0
- package/dist/notifications/channels/telegram.d.ts.map +1 -0
- package/dist/notifications/channels/telegram.js +40 -0
- package/dist/notifications/channels/telegram.js.map +1 -0
- package/dist/notifications/index.d.ts +9 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/index.js +7 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/notifications/notification-service.d.ts +75 -0
- package/dist/notifications/notification-service.d.ts.map +1 -0
- package/dist/notifications/notification-service.js +213 -0
- package/dist/notifications/notification-service.js.map +1 -0
- package/dist/notifications/templates/message-templates.d.ts +12 -0
- package/dist/notifications/templates/message-templates.d.ts.map +1 -0
- package/dist/notifications/templates/message-templates.js +22 -0
- package/dist/notifications/templates/message-templates.js.map +1 -0
- package/dist/pipeline/database-policy-engine.d.ts +286 -0
- package/dist/pipeline/database-policy-engine.d.ts.map +1 -0
- package/dist/pipeline/database-policy-engine.js +992 -0
- package/dist/pipeline/database-policy-engine.js.map +1 -0
- package/dist/pipeline/default-policy-engine.d.ts +26 -0
- package/dist/pipeline/default-policy-engine.d.ts.map +1 -0
- package/dist/pipeline/default-policy-engine.js +25 -0
- package/dist/pipeline/default-policy-engine.js.map +1 -0
- package/dist/pipeline/index.d.ts +9 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +9 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/network-resolver.d.ts +22 -0
- package/dist/pipeline/network-resolver.d.ts.map +1 -0
- package/dist/pipeline/network-resolver.js +32 -0
- package/dist/pipeline/network-resolver.js.map +1 -0
- package/dist/pipeline/pipeline.d.ts +72 -0
- package/dist/pipeline/pipeline.d.ts.map +1 -0
- package/dist/pipeline/pipeline.js +87 -0
- package/dist/pipeline/pipeline.js.map +1 -0
- package/dist/pipeline/resolve-effective-amount-usd.d.ts +41 -0
- package/dist/pipeline/resolve-effective-amount-usd.d.ts.map +1 -0
- package/dist/pipeline/resolve-effective-amount-usd.js +208 -0
- package/dist/pipeline/resolve-effective-amount-usd.js.map +1 -0
- package/dist/pipeline/sign-only.d.ts +99 -0
- package/dist/pipeline/sign-only.d.ts.map +1 -0
- package/dist/pipeline/sign-only.js +267 -0
- package/dist/pipeline/sign-only.js.map +1 -0
- package/dist/pipeline/sleep.d.ts +6 -0
- package/dist/pipeline/sleep.d.ts.map +1 -0
- package/dist/pipeline/sleep.js +8 -0
- package/dist/pipeline/sleep.js.map +1 -0
- package/dist/pipeline/stages.d.ts +82 -0
- package/dist/pipeline/stages.d.ts.map +1 -0
- package/dist/pipeline/stages.js +784 -0
- package/dist/pipeline/stages.js.map +1 -0
- package/dist/services/autostop-rules.d.ts +79 -0
- package/dist/services/autostop-rules.d.ts.map +1 -0
- package/dist/services/autostop-rules.js +174 -0
- package/dist/services/autostop-rules.js.map +1 -0
- package/dist/services/autostop-service.d.ts +82 -0
- package/dist/services/autostop-service.d.ts.map +1 -0
- package/dist/services/autostop-service.js +223 -0
- package/dist/services/autostop-service.js.map +1 -0
- package/dist/services/kill-switch-service.d.ts +118 -0
- package/dist/services/kill-switch-service.d.ts.map +1 -0
- package/dist/services/kill-switch-service.js +291 -0
- package/dist/services/kill-switch-service.js.map +1 -0
- package/dist/services/monitoring/balance-monitor-service.d.ts +65 -0
- package/dist/services/monitoring/balance-monitor-service.d.ts.map +1 -0
- package/dist/services/monitoring/balance-monitor-service.js +207 -0
- package/dist/services/monitoring/balance-monitor-service.js.map +1 -0
- package/dist/services/wc-session-service.d.ts +123 -0
- package/dist/services/wc-session-service.d.ts.map +1 -0
- package/dist/services/wc-session-service.js +363 -0
- package/dist/services/wc-session-service.js.map +1 -0
- package/dist/services/wc-signing-bridge.d.ts +60 -0
- package/dist/services/wc-signing-bridge.d.ts.map +1 -0
- package/dist/services/wc-signing-bridge.js +334 -0
- package/dist/services/wc-signing-bridge.js.map +1 -0
- package/dist/services/wc-storage.d.ts +32 -0
- package/dist/services/wc-storage.d.ts.map +1 -0
- package/dist/services/wc-storage.js +64 -0
- package/dist/services/wc-storage.js.map +1 -0
- package/dist/services/x402/payment-signer.d.ts +88 -0
- package/dist/services/x402/payment-signer.d.ts.map +1 -0
- package/dist/services/x402/payment-signer.js +311 -0
- package/dist/services/x402/payment-signer.js.map +1 -0
- package/dist/services/x402/ssrf-guard.d.ts +27 -0
- package/dist/services/x402/ssrf-guard.d.ts.map +1 -0
- package/dist/services/x402/ssrf-guard.js +236 -0
- package/dist/services/x402/ssrf-guard.js.map +1 -0
- package/dist/services/x402/x402-domain-policy.d.ts +50 -0
- package/dist/services/x402/x402-domain-policy.d.ts.map +1 -0
- package/dist/services/x402/x402-domain-policy.js +78 -0
- package/dist/services/x402/x402-domain-policy.js.map +1 -0
- package/dist/services/x402/x402-handler.d.ts +71 -0
- package/dist/services/x402/x402-handler.d.ts.map +1 -0
- package/dist/services/x402/x402-handler.js +195 -0
- package/dist/services/x402/x402-handler.js.map +1 -0
- package/dist/services/x402/x402-usd-resolver.d.ts +26 -0
- package/dist/services/x402/x402-usd-resolver.d.ts.map +1 -0
- package/dist/services/x402/x402-usd-resolver.js +79 -0
- package/dist/services/x402/x402-usd-resolver.js.map +1 -0
- package/dist/workflow/approval-workflow.d.ts +103 -0
- package/dist/workflow/approval-workflow.d.ts.map +1 -0
- package/dist/workflow/approval-workflow.js +202 -0
- package/dist/workflow/approval-workflow.js.map +1 -0
- package/dist/workflow/delay-queue.d.ts +78 -0
- package/dist/workflow/delay-queue.d.ts.map +1 -0
- package/dist/workflow/delay-queue.js +174 -0
- package/dist/workflow/delay-queue.js.map +1 -0
- package/dist/workflow/index.d.ts +11 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +9 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/owner-state.d.ts +97 -0
- package/dist/workflow/owner-state.d.ts.map +1 -0
- package/dist/workflow/owner-state.js +168 -0
- package/dist/workflow/owner-state.js.map +1 -0
- package/package.json +71 -0
- package/public/admin/assets/index-BPoUSH8W.css +1 -0
- package/public/admin/assets/index-CDi1qoXB.js +1 -0
- package/public/admin/index.html +13 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transaction routes: POST /v1/transactions/send, POST /v1/transactions/sign,
|
|
3
|
+
* GET /v1/transactions/:id, POST /v1/transactions/:id/approve,
|
|
4
|
+
* POST /v1/transactions/:id/reject, POST /v1/transactions/:id/cancel.
|
|
5
|
+
*
|
|
6
|
+
* POST /v1/transactions/send:
|
|
7
|
+
* - Requires sessionAuth (Authorization: Bearer wai_sess_<token>),
|
|
8
|
+
* applied at server level in createApp()
|
|
9
|
+
* - Parses body with SendTransactionRequestSchema
|
|
10
|
+
* - Stage 1 runs synchronously (DB INSERT -> returns 201 with txId)
|
|
11
|
+
* - Stages 2-6 run asynchronously (fire-and-forget with error catching)
|
|
12
|
+
*
|
|
13
|
+
* GET /v1/transactions/:id:
|
|
14
|
+
* - Requires sessionAuth
|
|
15
|
+
* - Returns transaction status JSON
|
|
16
|
+
* - 404 if not found
|
|
17
|
+
*
|
|
18
|
+
* v1.2: Wallet identification via JWT walletId from sessionAuth context.
|
|
19
|
+
*
|
|
20
|
+
* @see docs/37-rest-api-complete-spec.md
|
|
21
|
+
*/
|
|
22
|
+
import { OpenAPIHono } from '@hono/zod-openapi';
|
|
23
|
+
import type { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
|
|
24
|
+
import type { Database as SQLiteDatabase } from 'better-sqlite3';
|
|
25
|
+
import type { IPolicyEngine } from '@waiaas/core';
|
|
26
|
+
import type { AdapterPool } from '../../infrastructure/adapter-pool.js';
|
|
27
|
+
import type { DaemonConfig } from '../../infrastructure/config/loader.js';
|
|
28
|
+
import type { LocalKeyStore } from '../../infrastructure/keystore/keystore.js';
|
|
29
|
+
import type * as schema from '../../infrastructure/database/schema.js';
|
|
30
|
+
import type { ApprovalWorkflow } from '../../workflow/approval-workflow.js';
|
|
31
|
+
import type { DelayQueue } from '../../workflow/delay-queue.js';
|
|
32
|
+
import type { OwnerLifecycleService } from '../../workflow/owner-state.js';
|
|
33
|
+
import type { NotificationService } from '../../notifications/notification-service.js';
|
|
34
|
+
import type { IPriceOracle, IForexRateService, EventBus } from '@waiaas/core';
|
|
35
|
+
import type { SettingsService } from '../../infrastructure/settings/settings-service.js';
|
|
36
|
+
import type { WcSigningBridge } from '../../services/wc-signing-bridge.js';
|
|
37
|
+
export interface TransactionRouteDeps {
|
|
38
|
+
db: BetterSQLite3Database<typeof schema>;
|
|
39
|
+
adapterPool: AdapterPool;
|
|
40
|
+
config: DaemonConfig;
|
|
41
|
+
keyStore: LocalKeyStore;
|
|
42
|
+
policyEngine: IPolicyEngine;
|
|
43
|
+
masterPassword: string;
|
|
44
|
+
approvalWorkflow?: ApprovalWorkflow;
|
|
45
|
+
delayQueue?: DelayQueue;
|
|
46
|
+
ownerLifecycle?: OwnerLifecycleService;
|
|
47
|
+
sqlite?: SQLiteDatabase;
|
|
48
|
+
notificationService?: NotificationService;
|
|
49
|
+
priceOracle?: IPriceOracle;
|
|
50
|
+
settingsService?: SettingsService;
|
|
51
|
+
forexRateService?: IForexRateService;
|
|
52
|
+
eventBus?: EventBus;
|
|
53
|
+
wcSigningBridge?: WcSigningBridge;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Create transaction route sub-router.
|
|
57
|
+
*
|
|
58
|
+
* POST /transactions/send -> submits to pipeline, returns 201 with txId
|
|
59
|
+
* POST /transactions/sign -> sign external unsigned tx, returns 200 with signed tx
|
|
60
|
+
* GET /transactions -> list transactions with cursor pagination
|
|
61
|
+
* GET /transactions/pending -> list QUEUED/DELAYED/PENDING_APPROVAL txs
|
|
62
|
+
* GET /transactions/:id -> returns transaction status
|
|
63
|
+
* POST /transactions/:id/approve -> approve pending tx (ownerAuth)
|
|
64
|
+
* POST /transactions/:id/reject -> reject pending tx (ownerAuth)
|
|
65
|
+
* POST /transactions/:id/cancel -> cancel delayed tx (sessionAuth)
|
|
66
|
+
*/
|
|
67
|
+
export declare function transactionRoutes(deps: TransactionRouteDeps): OpenAPIHono;
|
|
68
|
+
//# sourceMappingURL=transactions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../../src/api/routes/transactions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,WAAW,EAAkB,MAAM,mBAAmB,CAAC;AAEhE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,KAAK,EAA2C,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAE1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,KAAK,KAAK,MAAM,MAAM,yCAAyC,CAAC;AAWvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAwB3E,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,qBAAqB,CAAC,OAAO,MAAM,CAAC,CAAC;IACzC,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,aAAa,CAAC;IACxB,YAAY,EAAE,aAAa,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAmKD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,oBAAoB,GAAG,WAAW,CAufzE"}
|
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transaction routes: POST /v1/transactions/send, POST /v1/transactions/sign,
|
|
3
|
+
* GET /v1/transactions/:id, POST /v1/transactions/:id/approve,
|
|
4
|
+
* POST /v1/transactions/:id/reject, POST /v1/transactions/:id/cancel.
|
|
5
|
+
*
|
|
6
|
+
* POST /v1/transactions/send:
|
|
7
|
+
* - Requires sessionAuth (Authorization: Bearer wai_sess_<token>),
|
|
8
|
+
* applied at server level in createApp()
|
|
9
|
+
* - Parses body with SendTransactionRequestSchema
|
|
10
|
+
* - Stage 1 runs synchronously (DB INSERT -> returns 201 with txId)
|
|
11
|
+
* - Stages 2-6 run asynchronously (fire-and-forget with error catching)
|
|
12
|
+
*
|
|
13
|
+
* GET /v1/transactions/:id:
|
|
14
|
+
* - Requires sessionAuth
|
|
15
|
+
* - Returns transaction status JSON
|
|
16
|
+
* - 404 if not found
|
|
17
|
+
*
|
|
18
|
+
* v1.2: Wallet identification via JWT walletId from sessionAuth context.
|
|
19
|
+
*
|
|
20
|
+
* @see docs/37-rest-api-complete-spec.md
|
|
21
|
+
*/
|
|
22
|
+
import { OpenAPIHono, createRoute, z } from '@hono/zod-openapi';
|
|
23
|
+
import { eq, and, inArray, lt, desc } from 'drizzle-orm';
|
|
24
|
+
import { WAIaaSError } from '@waiaas/core';
|
|
25
|
+
import { resolveRpcUrl } from '../../infrastructure/adapter-pool.js';
|
|
26
|
+
import { wallets, transactions } from '../../infrastructure/database/schema.js';
|
|
27
|
+
import { stage1Validate, stage2Auth, stage3Policy, stage4Wait, stage5Execute, stage6Confirm, } from '../../pipeline/stages.js';
|
|
28
|
+
import { resolveNetwork } from '../../pipeline/network-resolver.js';
|
|
29
|
+
import { TransactionRequestOpenAPI, TransferRequestOpenAPI, TokenTransferRequestOpenAPI, ContractCallRequestOpenAPI, ApproveRequestOpenAPI, BatchRequestOpenAPI, SendTransactionRequestOpenAPI, TxSendResponseSchema, TxDetailResponseSchema, TxListResponseSchema, TxPendingListResponseSchema, TxApproveResponseSchema, TxRejectResponseSchema, TxCancelResponseSchema, TxSignRequestSchema, TxSignResponseSchema, buildErrorResponses, openApiValidationHook, } from './openapi-schemas.js';
|
|
30
|
+
import { executeSignOnly } from '../../pipeline/sign-only.js';
|
|
31
|
+
import { resolveDisplayCurrencyCode, fetchDisplayRate, toDisplayAmount } from './display-currency-helper.js';
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
// Route definitions
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
const sendTransactionRoute = createRoute({
|
|
36
|
+
method: 'post',
|
|
37
|
+
path: '/transactions/send',
|
|
38
|
+
tags: ['Transactions'],
|
|
39
|
+
summary: 'Send a transaction',
|
|
40
|
+
request: {
|
|
41
|
+
body: {
|
|
42
|
+
content: {
|
|
43
|
+
'application/json': { schema: TransactionRequestOpenAPI },
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
responses: {
|
|
48
|
+
201: {
|
|
49
|
+
description: 'Transaction submitted to pipeline',
|
|
50
|
+
content: { 'application/json': { schema: TxSendResponseSchema } },
|
|
51
|
+
},
|
|
52
|
+
...buildErrorResponses(['WALLET_NOT_FOUND']),
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
const signTransactionRoute = createRoute({
|
|
56
|
+
method: 'post',
|
|
57
|
+
path: '/transactions/sign',
|
|
58
|
+
tags: ['Transactions'],
|
|
59
|
+
summary: 'Sign an external unsigned transaction',
|
|
60
|
+
description: 'Parse, evaluate against policies, and sign an unsigned transaction built by an external dApp. Returns the signed transaction synchronously. DELAY/APPROVAL tier requests are immediately rejected.',
|
|
61
|
+
request: {
|
|
62
|
+
body: {
|
|
63
|
+
content: {
|
|
64
|
+
'application/json': { schema: TxSignRequestSchema },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
responses: {
|
|
69
|
+
200: {
|
|
70
|
+
description: 'Transaction signed successfully',
|
|
71
|
+
content: { 'application/json': { schema: TxSignResponseSchema } },
|
|
72
|
+
},
|
|
73
|
+
...buildErrorResponses([
|
|
74
|
+
'INVALID_TRANSACTION',
|
|
75
|
+
'WALLET_NOT_SIGNER',
|
|
76
|
+
'POLICY_DENIED',
|
|
77
|
+
'WALLET_NOT_FOUND',
|
|
78
|
+
]),
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
const getTransactionRoute = createRoute({
|
|
82
|
+
method: 'get',
|
|
83
|
+
path: '/transactions/{id}',
|
|
84
|
+
tags: ['Transactions'],
|
|
85
|
+
summary: 'Get transaction details',
|
|
86
|
+
request: {
|
|
87
|
+
params: z.object({ id: z.string().uuid() }),
|
|
88
|
+
query: z.object({
|
|
89
|
+
display_currency: z.string().optional().describe('Display currency code (e.g. KRW, EUR). Defaults to server setting.'),
|
|
90
|
+
}),
|
|
91
|
+
},
|
|
92
|
+
responses: {
|
|
93
|
+
200: {
|
|
94
|
+
description: 'Transaction details',
|
|
95
|
+
content: { 'application/json': { schema: TxDetailResponseSchema } },
|
|
96
|
+
},
|
|
97
|
+
...buildErrorResponses(['TX_NOT_FOUND']),
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
const approveTransactionRoute = createRoute({
|
|
101
|
+
method: 'post',
|
|
102
|
+
path: '/transactions/{id}/approve',
|
|
103
|
+
tags: ['Transactions'],
|
|
104
|
+
summary: 'Approve a pending transaction (ownerAuth)',
|
|
105
|
+
request: {
|
|
106
|
+
params: z.object({ id: z.string().uuid() }),
|
|
107
|
+
},
|
|
108
|
+
responses: {
|
|
109
|
+
200: {
|
|
110
|
+
description: 'Transaction approved',
|
|
111
|
+
content: { 'application/json': { schema: TxApproveResponseSchema } },
|
|
112
|
+
},
|
|
113
|
+
...buildErrorResponses(['TX_NOT_FOUND']),
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
const rejectTransactionRoute = createRoute({
|
|
117
|
+
method: 'post',
|
|
118
|
+
path: '/transactions/{id}/reject',
|
|
119
|
+
tags: ['Transactions'],
|
|
120
|
+
summary: 'Reject a pending transaction (ownerAuth)',
|
|
121
|
+
request: {
|
|
122
|
+
params: z.object({ id: z.string().uuid() }),
|
|
123
|
+
},
|
|
124
|
+
responses: {
|
|
125
|
+
200: {
|
|
126
|
+
description: 'Transaction rejected',
|
|
127
|
+
content: { 'application/json': { schema: TxRejectResponseSchema } },
|
|
128
|
+
},
|
|
129
|
+
...buildErrorResponses(['TX_NOT_FOUND']),
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
const cancelTransactionRoute = createRoute({
|
|
133
|
+
method: 'post',
|
|
134
|
+
path: '/transactions/{id}/cancel',
|
|
135
|
+
tags: ['Transactions'],
|
|
136
|
+
summary: 'Cancel a delayed transaction (sessionAuth)',
|
|
137
|
+
request: {
|
|
138
|
+
params: z.object({ id: z.string().uuid() }),
|
|
139
|
+
},
|
|
140
|
+
responses: {
|
|
141
|
+
200: {
|
|
142
|
+
description: 'Transaction cancelled',
|
|
143
|
+
content: { 'application/json': { schema: TxCancelResponseSchema } },
|
|
144
|
+
},
|
|
145
|
+
...buildErrorResponses(['TX_NOT_FOUND']),
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
const listTransactionsRoute = createRoute({
|
|
149
|
+
method: 'get',
|
|
150
|
+
path: '/transactions',
|
|
151
|
+
tags: ['Transactions'],
|
|
152
|
+
summary: 'List transactions',
|
|
153
|
+
request: {
|
|
154
|
+
query: z.object({
|
|
155
|
+
limit: z.coerce.number().int().min(1).max(100).default(20).optional(),
|
|
156
|
+
cursor: z.string().uuid().optional(),
|
|
157
|
+
display_currency: z.string().optional().describe('Display currency code (e.g. KRW, EUR). Defaults to server setting.'),
|
|
158
|
+
}),
|
|
159
|
+
},
|
|
160
|
+
responses: {
|
|
161
|
+
200: {
|
|
162
|
+
description: 'Paginated transaction list',
|
|
163
|
+
content: { 'application/json': { schema: TxListResponseSchema } },
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
const pendingTransactionsRoute = createRoute({
|
|
168
|
+
method: 'get',
|
|
169
|
+
path: '/transactions/pending',
|
|
170
|
+
tags: ['Transactions'],
|
|
171
|
+
summary: 'List pending transactions',
|
|
172
|
+
responses: {
|
|
173
|
+
200: {
|
|
174
|
+
description: 'Pending transactions (PENDING/QUEUED)',
|
|
175
|
+
content: { 'application/json': { schema: TxPendingListResponseSchema } },
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
// ---------------------------------------------------------------------------
|
|
180
|
+
// Route factory
|
|
181
|
+
// ---------------------------------------------------------------------------
|
|
182
|
+
/**
|
|
183
|
+
* Create transaction route sub-router.
|
|
184
|
+
*
|
|
185
|
+
* POST /transactions/send -> submits to pipeline, returns 201 with txId
|
|
186
|
+
* POST /transactions/sign -> sign external unsigned tx, returns 200 with signed tx
|
|
187
|
+
* GET /transactions -> list transactions with cursor pagination
|
|
188
|
+
* GET /transactions/pending -> list QUEUED/DELAYED/PENDING_APPROVAL txs
|
|
189
|
+
* GET /transactions/:id -> returns transaction status
|
|
190
|
+
* POST /transactions/:id/approve -> approve pending tx (ownerAuth)
|
|
191
|
+
* POST /transactions/:id/reject -> reject pending tx (ownerAuth)
|
|
192
|
+
* POST /transactions/:id/cancel -> cancel delayed tx (sessionAuth)
|
|
193
|
+
*/
|
|
194
|
+
export function transactionRoutes(deps) {
|
|
195
|
+
const router = new OpenAPIHono({ defaultHook: openApiValidationHook });
|
|
196
|
+
// Register 5-type transaction request schemas as OpenAPI components.
|
|
197
|
+
// These are referenced by TransactionRequestOpenAPI's oneOf $ref entries
|
|
198
|
+
// but aren't directly used by route definitions, so we register them
|
|
199
|
+
// explicitly to ensure they appear in GET /doc components/schemas.
|
|
200
|
+
router.openAPIRegistry.register('TransferRequest', TransferRequestOpenAPI);
|
|
201
|
+
router.openAPIRegistry.register('TokenTransferRequest', TokenTransferRequestOpenAPI);
|
|
202
|
+
router.openAPIRegistry.register('ContractCallRequest', ContractCallRequestOpenAPI);
|
|
203
|
+
router.openAPIRegistry.register('ApproveRequest', ApproveRequestOpenAPI);
|
|
204
|
+
router.openAPIRegistry.register('BatchRequest', BatchRequestOpenAPI);
|
|
205
|
+
router.openAPIRegistry.register('SendTransactionRequest', SendTransactionRequestOpenAPI);
|
|
206
|
+
// ---------------------------------------------------------------------------
|
|
207
|
+
// POST /transactions/send
|
|
208
|
+
// ---------------------------------------------------------------------------
|
|
209
|
+
router.openapi(sendTransactionRoute, async (c) => {
|
|
210
|
+
// Get walletId from sessionAuth context (set by middleware at server level)
|
|
211
|
+
const walletId = c.get('walletId');
|
|
212
|
+
// Look up wallet
|
|
213
|
+
const wallet = await deps.db.select().from(wallets).where(eq(wallets.id, walletId)).get();
|
|
214
|
+
if (!wallet) {
|
|
215
|
+
throw new WAIaaSError('WALLET_NOT_FOUND', {
|
|
216
|
+
message: `Wallet '${walletId}' not found`,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
if (wallet.status === 'TERMINATED') {
|
|
220
|
+
throw new WAIaaSError('WALLET_TERMINATED');
|
|
221
|
+
}
|
|
222
|
+
// Raw JSON body -- bypass Hono Zod validation (z.any() passthrough).
|
|
223
|
+
// Actual Zod validation is delegated to stage1Validate (5-type or legacy).
|
|
224
|
+
const request = await c.req.json();
|
|
225
|
+
// Resolve network: request > wallet.defaultNetwork > environment default
|
|
226
|
+
let resolvedNetwork;
|
|
227
|
+
try {
|
|
228
|
+
resolvedNetwork = resolveNetwork(request.network, wallet.defaultNetwork, wallet.environment, wallet.chain);
|
|
229
|
+
}
|
|
230
|
+
catch (err) {
|
|
231
|
+
if (err instanceof Error && err.message.includes('environment')) {
|
|
232
|
+
console.warn(`[SECURITY] Environment-network mismatch attempt: ` +
|
|
233
|
+
`wallet=${walletId}, chain=${wallet.chain}, env=${wallet.environment}, ` +
|
|
234
|
+
`requestedNetwork=${request.network ?? 'null'}`);
|
|
235
|
+
throw new WAIaaSError('ENVIRONMENT_NETWORK_MISMATCH', {
|
|
236
|
+
message: err.message,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
throw new WAIaaSError('ACTION_VALIDATION_FAILED', {
|
|
240
|
+
message: err instanceof Error ? err.message : 'Network validation failed',
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
// Resolve adapter from pool for this wallet's chain:resolvedNetwork
|
|
244
|
+
const rpcUrl = resolveRpcUrl(deps.config.rpc, wallet.chain, resolvedNetwork);
|
|
245
|
+
const adapter = await deps.adapterPool.resolve(wallet.chain, resolvedNetwork, rpcUrl);
|
|
246
|
+
// Build pipeline context
|
|
247
|
+
const ctx = {
|
|
248
|
+
db: deps.db,
|
|
249
|
+
adapter,
|
|
250
|
+
keyStore: deps.keyStore,
|
|
251
|
+
policyEngine: deps.policyEngine,
|
|
252
|
+
masterPassword: deps.masterPassword,
|
|
253
|
+
walletId,
|
|
254
|
+
wallet: {
|
|
255
|
+
publicKey: wallet.publicKey,
|
|
256
|
+
chain: wallet.chain,
|
|
257
|
+
environment: wallet.environment,
|
|
258
|
+
defaultNetwork: wallet.defaultNetwork ?? null,
|
|
259
|
+
},
|
|
260
|
+
resolvedNetwork,
|
|
261
|
+
request,
|
|
262
|
+
txId: '', // stage1Validate will assign
|
|
263
|
+
sessionId: c.get('sessionId'),
|
|
264
|
+
sqlite: deps.sqlite,
|
|
265
|
+
delayQueue: deps.delayQueue,
|
|
266
|
+
approvalWorkflow: deps.approvalWorkflow,
|
|
267
|
+
config: {
|
|
268
|
+
policy_defaults_delay_seconds: deps.config.security.policy_defaults_delay_seconds,
|
|
269
|
+
policy_defaults_approval_timeout: deps.config.security.policy_defaults_approval_timeout,
|
|
270
|
+
},
|
|
271
|
+
notificationService: deps.notificationService,
|
|
272
|
+
priceOracle: deps.priceOracle,
|
|
273
|
+
settingsService: deps.settingsService,
|
|
274
|
+
forexRateService: deps.forexRateService,
|
|
275
|
+
eventBus: deps.eventBus,
|
|
276
|
+
wcSigningBridge: deps.wcSigningBridge,
|
|
277
|
+
};
|
|
278
|
+
// Stage 1: Validate + DB INSERT (synchronous -- assigns ctx.txId)
|
|
279
|
+
await stage1Validate(ctx);
|
|
280
|
+
// Return 201 immediately with txId (Stage 1 complete)
|
|
281
|
+
const response = c.json({
|
|
282
|
+
id: ctx.txId,
|
|
283
|
+
status: 'PENDING',
|
|
284
|
+
}, 201);
|
|
285
|
+
// Stages 2-6 run asynchronously (fire-and-forget)
|
|
286
|
+
void (async () => {
|
|
287
|
+
try {
|
|
288
|
+
await stage2Auth(ctx);
|
|
289
|
+
await stage3Policy(ctx);
|
|
290
|
+
await stage4Wait(ctx);
|
|
291
|
+
await stage5Execute(ctx);
|
|
292
|
+
await stage6Confirm(ctx);
|
|
293
|
+
}
|
|
294
|
+
catch (error) {
|
|
295
|
+
// PIPELINE_HALTED is intentional -- do NOT mark as FAILED
|
|
296
|
+
// Transaction is QUEUED, waiting for delay expiry or owner approval
|
|
297
|
+
if (error instanceof WAIaaSError && error.code === 'PIPELINE_HALTED') {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
// If stages 2-6 fail and DB hasn't been updated yet, mark as FAILED
|
|
301
|
+
try {
|
|
302
|
+
const tx = await deps.db
|
|
303
|
+
.select()
|
|
304
|
+
.from(transactions)
|
|
305
|
+
.where(eq(transactions.id, ctx.txId))
|
|
306
|
+
.get();
|
|
307
|
+
if (tx && tx.status !== 'CONFIRMED' && tx.status !== 'FAILED' && tx.status !== 'CANCELLED') {
|
|
308
|
+
const errorMessage = error instanceof Error ? error.message : 'Pipeline execution failed';
|
|
309
|
+
await deps.db
|
|
310
|
+
.update(transactions)
|
|
311
|
+
.set({ status: 'FAILED', error: errorMessage })
|
|
312
|
+
.where(eq(transactions.id, ctx.txId));
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
catch {
|
|
316
|
+
// Swallow DB update errors in background
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
})();
|
|
320
|
+
return response;
|
|
321
|
+
});
|
|
322
|
+
// ---------------------------------------------------------------------------
|
|
323
|
+
// POST /transactions/sign (sessionAuth -- sign external unsigned tx)
|
|
324
|
+
// ---------------------------------------------------------------------------
|
|
325
|
+
router.openapi(signTransactionRoute, async (c) => {
|
|
326
|
+
const walletId = c.get('walletId');
|
|
327
|
+
const sessionId = c.get('sessionId');
|
|
328
|
+
const body = c.req.valid('json');
|
|
329
|
+
// Look up wallet
|
|
330
|
+
const wallet = await deps.db.select().from(wallets).where(eq(wallets.id, walletId)).get();
|
|
331
|
+
if (!wallet) {
|
|
332
|
+
throw new WAIaaSError('WALLET_NOT_FOUND', { message: `Wallet '${walletId}' not found` });
|
|
333
|
+
}
|
|
334
|
+
if (wallet.status === 'TERMINATED') {
|
|
335
|
+
throw new WAIaaSError('WALLET_TERMINATED');
|
|
336
|
+
}
|
|
337
|
+
// Resolve network (same pattern as POST /transactions/send)
|
|
338
|
+
const resolvedNetwork = resolveNetwork(body.network, wallet.defaultNetwork, wallet.environment, wallet.chain);
|
|
339
|
+
// Resolve adapter
|
|
340
|
+
const rpcUrl = resolveRpcUrl(deps.config.rpc, wallet.chain, resolvedNetwork);
|
|
341
|
+
const adapter = await deps.adapterPool.resolve(wallet.chain, resolvedNetwork, rpcUrl);
|
|
342
|
+
// Execute sign-only pipeline (fully synchronous within request)
|
|
343
|
+
const result = await executeSignOnly({
|
|
344
|
+
db: deps.db,
|
|
345
|
+
sqlite: deps.sqlite,
|
|
346
|
+
adapter,
|
|
347
|
+
keyStore: deps.keyStore,
|
|
348
|
+
policyEngine: deps.policyEngine,
|
|
349
|
+
masterPassword: deps.masterPassword,
|
|
350
|
+
notificationService: deps.notificationService,
|
|
351
|
+
eventBus: deps.eventBus,
|
|
352
|
+
}, walletId, { transaction: body.transaction, chain: wallet.chain, network: resolvedNetwork }, sessionId);
|
|
353
|
+
// Transform to match OpenAPI schema (txHash: string | null, not undefined)
|
|
354
|
+
return c.json({
|
|
355
|
+
...result,
|
|
356
|
+
txHash: result.txHash ?? null,
|
|
357
|
+
}, 200);
|
|
358
|
+
});
|
|
359
|
+
// ---------------------------------------------------------------------------
|
|
360
|
+
// GET /transactions (list with cursor pagination)
|
|
361
|
+
// ---------------------------------------------------------------------------
|
|
362
|
+
router.openapi(listTransactionsRoute, async (c) => {
|
|
363
|
+
const walletId = c.get('walletId');
|
|
364
|
+
const { limit: rawLimit, cursor, display_currency: queryCurrency } = c.req.valid('query');
|
|
365
|
+
const limit = rawLimit ?? 20;
|
|
366
|
+
// Resolve display currency from query param or server setting
|
|
367
|
+
const currencyCode = resolveDisplayCurrencyCode(queryCurrency, deps.settingsService);
|
|
368
|
+
const displayRate = await fetchDisplayRate(currencyCode, deps.forexRateService);
|
|
369
|
+
// Build conditions
|
|
370
|
+
const conditions = [eq(transactions.walletId, walletId)];
|
|
371
|
+
if (cursor) {
|
|
372
|
+
conditions.push(lt(transactions.id, cursor));
|
|
373
|
+
}
|
|
374
|
+
// Fetch limit + 1 to detect hasMore
|
|
375
|
+
const rows = await deps.db
|
|
376
|
+
.select()
|
|
377
|
+
.from(transactions)
|
|
378
|
+
.where(and(...conditions))
|
|
379
|
+
.orderBy(desc(transactions.id))
|
|
380
|
+
.limit(limit + 1);
|
|
381
|
+
const hasMore = rows.length > limit;
|
|
382
|
+
const items = hasMore ? rows.slice(0, limit) : rows;
|
|
383
|
+
const nextCursor = items.length > 0 ? items[items.length - 1].id : null;
|
|
384
|
+
return c.json({
|
|
385
|
+
items: items.map((tx) => ({
|
|
386
|
+
id: tx.id,
|
|
387
|
+
walletId: tx.walletId,
|
|
388
|
+
type: tx.type,
|
|
389
|
+
status: tx.status,
|
|
390
|
+
tier: tx.tier,
|
|
391
|
+
chain: tx.chain,
|
|
392
|
+
network: tx.network ?? null,
|
|
393
|
+
toAddress: tx.toAddress,
|
|
394
|
+
amount: tx.amount,
|
|
395
|
+
txHash: tx.txHash,
|
|
396
|
+
error: tx.error,
|
|
397
|
+
createdAt: tx.createdAt ? Math.floor(tx.createdAt.getTime() / 1000) : null,
|
|
398
|
+
displayAmount: toDisplayAmount(tx.amountUsd, currencyCode, displayRate),
|
|
399
|
+
displayCurrency: currencyCode ?? null,
|
|
400
|
+
})),
|
|
401
|
+
cursor: hasMore ? nextCursor : null,
|
|
402
|
+
hasMore,
|
|
403
|
+
}, 200);
|
|
404
|
+
});
|
|
405
|
+
// ---------------------------------------------------------------------------
|
|
406
|
+
// GET /transactions/pending
|
|
407
|
+
// ---------------------------------------------------------------------------
|
|
408
|
+
router.openapi(pendingTransactionsRoute, async (c) => {
|
|
409
|
+
const walletId = c.get('walletId');
|
|
410
|
+
const rows = await deps.db
|
|
411
|
+
.select()
|
|
412
|
+
.from(transactions)
|
|
413
|
+
.where(and(eq(transactions.walletId, walletId), inArray(transactions.status, ['PENDING', 'QUEUED'])))
|
|
414
|
+
.orderBy(desc(transactions.id));
|
|
415
|
+
return c.json({
|
|
416
|
+
items: rows.map((tx) => ({
|
|
417
|
+
id: tx.id,
|
|
418
|
+
walletId: tx.walletId,
|
|
419
|
+
type: tx.type,
|
|
420
|
+
status: tx.status,
|
|
421
|
+
tier: tx.tier,
|
|
422
|
+
chain: tx.chain,
|
|
423
|
+
network: tx.network ?? null,
|
|
424
|
+
toAddress: tx.toAddress,
|
|
425
|
+
amount: tx.amount,
|
|
426
|
+
txHash: tx.txHash,
|
|
427
|
+
error: tx.error,
|
|
428
|
+
createdAt: tx.createdAt ? Math.floor(tx.createdAt.getTime() / 1000) : null,
|
|
429
|
+
})),
|
|
430
|
+
}, 200);
|
|
431
|
+
});
|
|
432
|
+
// ---------------------------------------------------------------------------
|
|
433
|
+
// GET /transactions/:id
|
|
434
|
+
// ---------------------------------------------------------------------------
|
|
435
|
+
router.openapi(getTransactionRoute, async (c) => {
|
|
436
|
+
const { id: txId } = c.req.valid('param');
|
|
437
|
+
const { display_currency: queryCurrency } = c.req.valid('query');
|
|
438
|
+
if (!txId) {
|
|
439
|
+
throw new WAIaaSError('TX_NOT_FOUND', {
|
|
440
|
+
message: 'Transaction ID is required',
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
const tx = await deps.db
|
|
444
|
+
.select()
|
|
445
|
+
.from(transactions)
|
|
446
|
+
.where(eq(transactions.id, txId))
|
|
447
|
+
.get();
|
|
448
|
+
if (!tx) {
|
|
449
|
+
throw new WAIaaSError('TX_NOT_FOUND', {
|
|
450
|
+
message: `Transaction '${txId}' not found`,
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
// Resolve display currency from query param or server setting
|
|
454
|
+
const currencyCode = resolveDisplayCurrencyCode(queryCurrency, deps.settingsService);
|
|
455
|
+
const displayRate = await fetchDisplayRate(currencyCode, deps.forexRateService);
|
|
456
|
+
return c.json({
|
|
457
|
+
id: tx.id,
|
|
458
|
+
walletId: tx.walletId,
|
|
459
|
+
type: tx.type,
|
|
460
|
+
status: tx.status,
|
|
461
|
+
tier: tx.tier,
|
|
462
|
+
chain: tx.chain,
|
|
463
|
+
network: tx.network ?? null,
|
|
464
|
+
toAddress: tx.toAddress,
|
|
465
|
+
amount: tx.amount,
|
|
466
|
+
txHash: tx.txHash,
|
|
467
|
+
error: tx.error,
|
|
468
|
+
createdAt: tx.createdAt ? Math.floor(tx.createdAt.getTime() / 1000) : null,
|
|
469
|
+
displayAmount: toDisplayAmount(tx.amountUsd, currencyCode, displayRate),
|
|
470
|
+
displayCurrency: currencyCode ?? null,
|
|
471
|
+
}, 200);
|
|
472
|
+
});
|
|
473
|
+
// ---------------------------------------------------------------------------
|
|
474
|
+
// POST /transactions/:id/approve (ownerAuth)
|
|
475
|
+
// ---------------------------------------------------------------------------
|
|
476
|
+
if (deps.approvalWorkflow && deps.ownerLifecycle) {
|
|
477
|
+
const approvalWorkflow = deps.approvalWorkflow;
|
|
478
|
+
const ownerLifecycle = deps.ownerLifecycle;
|
|
479
|
+
router.openapi(approveTransactionRoute, async (c) => {
|
|
480
|
+
const { id: txId } = c.req.valid('param');
|
|
481
|
+
// Verify the tx exists and get walletId for ownerAuth verification
|
|
482
|
+
const tx = await deps.db
|
|
483
|
+
.select()
|
|
484
|
+
.from(transactions)
|
|
485
|
+
.where(eq(transactions.id, txId))
|
|
486
|
+
.get();
|
|
487
|
+
if (!tx) {
|
|
488
|
+
throw new WAIaaSError('TX_NOT_FOUND', {
|
|
489
|
+
message: `Transaction '${txId}' not found`,
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
// Get owner signature from header (set by ownerAuth middleware)
|
|
493
|
+
const ownerSignature = c.req.header('X-Owner-Signature') ?? '';
|
|
494
|
+
// Approve the transaction
|
|
495
|
+
const result = approvalWorkflow.approve(txId, ownerSignature);
|
|
496
|
+
// ownerAuth success -> mark owner verified (GRACE -> LOCKED auto-transition)
|
|
497
|
+
try {
|
|
498
|
+
ownerLifecycle.markOwnerVerified(tx.walletId);
|
|
499
|
+
}
|
|
500
|
+
catch {
|
|
501
|
+
// If markOwnerVerified fails (e.g., NONE state), don't fail the approval
|
|
502
|
+
}
|
|
503
|
+
return c.json({
|
|
504
|
+
id: txId,
|
|
505
|
+
status: 'EXECUTING',
|
|
506
|
+
approvedAt: result.approvedAt,
|
|
507
|
+
}, 200);
|
|
508
|
+
});
|
|
509
|
+
// ---------------------------------------------------------------------------
|
|
510
|
+
// POST /transactions/:id/reject (ownerAuth)
|
|
511
|
+
// ---------------------------------------------------------------------------
|
|
512
|
+
router.openapi(rejectTransactionRoute, async (c) => {
|
|
513
|
+
const { id: txId } = c.req.valid('param');
|
|
514
|
+
// Verify the tx exists
|
|
515
|
+
const tx = await deps.db
|
|
516
|
+
.select()
|
|
517
|
+
.from(transactions)
|
|
518
|
+
.where(eq(transactions.id, txId))
|
|
519
|
+
.get();
|
|
520
|
+
if (!tx) {
|
|
521
|
+
throw new WAIaaSError('TX_NOT_FOUND', {
|
|
522
|
+
message: `Transaction '${txId}' not found`,
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
// Reject the transaction
|
|
526
|
+
const result = approvalWorkflow.reject(txId);
|
|
527
|
+
// ownerAuth success -> mark owner verified (GRACE -> LOCKED auto-transition)
|
|
528
|
+
try {
|
|
529
|
+
ownerLifecycle.markOwnerVerified(tx.walletId);
|
|
530
|
+
}
|
|
531
|
+
catch {
|
|
532
|
+
// If markOwnerVerified fails (e.g., NONE state), don't fail the rejection
|
|
533
|
+
}
|
|
534
|
+
return c.json({
|
|
535
|
+
id: txId,
|
|
536
|
+
status: 'CANCELLED',
|
|
537
|
+
rejectedAt: result.rejectedAt,
|
|
538
|
+
}, 200);
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
// ---------------------------------------------------------------------------
|
|
542
|
+
// POST /transactions/:id/cancel (sessionAuth -- wallet cancels own DELAY tx)
|
|
543
|
+
// ---------------------------------------------------------------------------
|
|
544
|
+
if (deps.delayQueue) {
|
|
545
|
+
const delayQueue = deps.delayQueue;
|
|
546
|
+
router.openapi(cancelTransactionRoute, async (c) => {
|
|
547
|
+
const { id: txId } = c.req.valid('param');
|
|
548
|
+
// Get walletId from sessionAuth context
|
|
549
|
+
const sessionWalletId = c.get('walletId');
|
|
550
|
+
// Verify the tx exists and belongs to this wallet
|
|
551
|
+
const tx = await deps.db
|
|
552
|
+
.select()
|
|
553
|
+
.from(transactions)
|
|
554
|
+
.where(eq(transactions.id, txId))
|
|
555
|
+
.get();
|
|
556
|
+
if (!tx) {
|
|
557
|
+
throw new WAIaaSError('TX_NOT_FOUND', {
|
|
558
|
+
message: `Transaction '${txId}' not found`,
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
if (tx.walletId !== sessionWalletId) {
|
|
562
|
+
throw new WAIaaSError('TX_NOT_FOUND', {
|
|
563
|
+
message: `Transaction '${txId}' not found`,
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
// Cancel the delay
|
|
567
|
+
delayQueue.cancelDelay(txId);
|
|
568
|
+
return c.json({
|
|
569
|
+
id: txId,
|
|
570
|
+
status: 'CANCELLED',
|
|
571
|
+
}, 200);
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
return router;
|
|
575
|
+
}
|
|
576
|
+
//# sourceMappingURL=transactions.js.map
|