project-cpu-mcp 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -35
- package/dist/api/authentication-required.error.d.ts +6 -0
- package/dist/api/authentication-required.error.d.ts.map +1 -0
- package/dist/api/authentication-required.error.js +9 -0
- package/dist/api/authentication-required.error.js.map +1 -0
- package/dist/api/client.d.ts +7 -5
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +29 -14
- package/dist/api/client.js.map +1 -1
- package/dist/api/constants.d.ts +2 -0
- package/dist/api/constants.d.ts.map +1 -1
- package/dist/api/constants.js +6 -0
- package/dist/api/constants.js.map +1 -1
- package/dist/api/types.d.ts +189 -220
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/types.js +43 -29
- package/dist/api/types.js.map +1 -1
- package/dist/config/constants.d.ts +6 -2
- package/dist/config/constants.d.ts.map +1 -1
- package/dist/config/constants.js +6 -2
- package/dist/config/constants.js.map +1 -1
- package/dist/config/types.js +2 -2
- package/dist/config/types.js.map +1 -1
- package/dist/contracts/cell.abi.d.ts +26 -2
- package/dist/contracts/cell.abi.d.ts.map +1 -1
- package/dist/contracts/cell.abi.js +21 -2
- package/dist/contracts/cell.abi.js.map +1 -1
- package/dist/contracts/erc20.abi.d.ts.map +1 -1
- package/dist/contracts/erc20.abi.js +1 -2
- package/dist/contracts/erc20.abi.js.map +1 -1
- package/dist/contracts/trade.abi.d.ts +341 -0
- package/dist/contracts/trade.abi.d.ts.map +1 -1
- package/dist/contracts/trade.abi.js +163 -0
- package/dist/contracts/trade.abi.js.map +1 -1
- package/dist/contracts/trade.types.d.ts +14 -0
- package/dist/contracts/trade.types.d.ts.map +1 -0
- package/dist/contracts/trade.types.js +15 -0
- package/dist/contracts/trade.types.js.map +1 -0
- package/dist/contracts/transport.abi.d.ts +4 -0
- package/dist/contracts/transport.abi.d.ts.map +1 -1
- package/dist/contracts/transport.abi.js +1 -0
- package/dist/contracts/transport.abi.js.map +1 -1
- package/dist/index.js +40 -3
- package/dist/index.js.map +1 -1
- package/dist/logger/constants.d.ts +7 -0
- package/dist/logger/constants.d.ts.map +1 -1
- package/dist/logger/constants.js +11 -0
- package/dist/logger/constants.js.map +1 -1
- package/dist/logger/file-log.utils.d.ts +4 -0
- package/dist/logger/file-log.utils.d.ts.map +1 -0
- package/dist/logger/file-log.utils.js +23 -0
- package/dist/logger/file-log.utils.js.map +1 -0
- package/dist/logger/index.d.ts +1 -1
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +5 -3
- package/dist/logger/index.js.map +1 -1
- package/dist/logger/logger.d.ts +4 -0
- package/dist/logger/logger.d.ts.map +1 -1
- package/dist/logger/logger.js +48 -3
- package/dist/logger/logger.js.map +1 -1
- package/dist/logger/redact.utils.d.ts.map +1 -1
- package/dist/logger/redact.utils.js +7 -2
- package/dist/logger/redact.utils.js.map +1 -1
- package/dist/logger/types.d.ts +8 -0
- package/dist/logger/types.d.ts.map +1 -1
- package/dist/map/attention.utils.d.ts.map +1 -1
- package/dist/map/attention.utils.js +1 -0
- package/dist/map/attention.utils.js.map +1 -1
- package/dist/map/cell-view.utils.d.ts.map +1 -1
- package/dist/map/cell-view.utils.js +5 -3
- package/dist/map/cell-view.utils.js.map +1 -1
- package/dist/map/process-projection.utils.js +2 -2
- package/dist/map/process-projection.utils.js.map +1 -1
- package/dist/map/reader.utils.d.ts.map +1 -1
- package/dist/map/reader.utils.js +3 -2
- package/dist/map/reader.utils.js.map +1 -1
- package/dist/map/storage.utils.d.ts.map +1 -1
- package/dist/map/storage.utils.js +5 -1
- package/dist/map/storage.utils.js.map +1 -1
- package/dist/map/types.d.ts +21 -0
- package/dist/map/types.d.ts.map +1 -1
- package/dist/map/types.js +6 -0
- package/dist/map/types.js.map +1 -1
- package/dist/paybox/auth/authority.d.ts +46 -0
- package/dist/paybox/auth/authority.d.ts.map +1 -0
- package/dist/paybox/auth/authority.js +410 -0
- package/dist/paybox/auth/authority.js.map +1 -0
- package/dist/paybox/auth/browser-opener.d.ts +8 -0
- package/dist/paybox/auth/browser-opener.d.ts.map +1 -0
- package/dist/paybox/auth/browser-opener.js +22 -0
- package/dist/paybox/auth/browser-opener.js.map +1 -0
- package/dist/paybox/auth/browser-opener.utils.d.ts +2 -0
- package/dist/paybox/auth/browser-opener.utils.d.ts.map +1 -0
- package/dist/paybox/auth/browser-opener.utils.js +10 -0
- package/dist/paybox/auth/browser-opener.utils.js.map +1 -0
- package/dist/paybox/auth/constants.d.ts +16 -0
- package/dist/paybox/auth/constants.d.ts.map +1 -0
- package/dist/paybox/auth/constants.js +16 -0
- package/dist/paybox/auth/constants.js.map +1 -0
- package/dist/paybox/auth/coordinator.d.ts +21 -0
- package/dist/paybox/auth/coordinator.d.ts.map +1 -0
- package/dist/paybox/auth/coordinator.factory.d.ts +5 -0
- package/dist/paybox/auth/coordinator.factory.d.ts.map +1 -0
- package/dist/paybox/auth/coordinator.factory.js +5 -0
- package/dist/paybox/auth/coordinator.factory.js.map +1 -0
- package/dist/paybox/auth/coordinator.js +87 -0
- package/dist/paybox/auth/coordinator.js.map +1 -0
- package/dist/paybox/auth/coordinator.utils.d.ts +4 -0
- package/dist/paybox/auth/coordinator.utils.d.ts.map +1 -0
- package/dist/paybox/auth/coordinator.utils.js +8 -0
- package/dist/paybox/auth/coordinator.utils.js.map +1 -0
- package/dist/paybox/auth/flow-session.d.ts +24 -0
- package/dist/paybox/auth/flow-session.d.ts.map +1 -0
- package/dist/paybox/auth/flow-session.js +155 -0
- package/dist/paybox/auth/flow-session.js.map +1 -0
- package/dist/paybox/auth/loopback-flow.d.ts +49 -0
- package/dist/paybox/auth/loopback-flow.d.ts.map +1 -0
- package/dist/paybox/auth/loopback-flow.js +381 -0
- package/dist/paybox/auth/loopback-flow.js.map +1 -0
- package/dist/paybox/auth/loopback-flow.utils.d.ts +7 -0
- package/dist/paybox/auth/loopback-flow.utils.d.ts.map +1 -0
- package/dist/paybox/auth/loopback-flow.utils.js +47 -0
- package/dist/paybox/auth/loopback-flow.utils.js.map +1 -0
- package/dist/paybox/auth/loopback-page-fonts.constants.d.ts +3 -0
- package/dist/paybox/auth/loopback-page-fonts.constants.d.ts.map +1 -0
- package/dist/paybox/auth/loopback-page-fonts.constants.js +228 -0
- package/dist/paybox/auth/loopback-page-fonts.constants.js.map +1 -0
- package/dist/paybox/auth/loopback-page.utils.d.ts +4 -0
- package/dist/paybox/auth/loopback-page.utils.d.ts.map +1 -0
- package/dist/paybox/auth/loopback-page.utils.js +261 -0
- package/dist/paybox/auth/loopback-page.utils.js.map +1 -0
- package/dist/paybox/auth/provisioning.utils.d.ts +3 -0
- package/dist/paybox/auth/provisioning.utils.d.ts.map +1 -0
- package/dist/paybox/auth/provisioning.utils.js +27 -0
- package/dist/paybox/auth/provisioning.utils.js.map +1 -0
- package/dist/paybox/auth/signing-key.utils.d.ts +2 -0
- package/dist/paybox/auth/signing-key.utils.d.ts.map +1 -0
- package/dist/paybox/auth/signing-key.utils.js +14 -0
- package/dist/paybox/auth/signing-key.utils.js.map +1 -0
- package/dist/paybox/auth/types.d.ts +18 -0
- package/dist/paybox/auth/types.d.ts.map +1 -0
- package/dist/paybox/auth/types.js +6 -0
- package/dist/paybox/auth/types.js.map +1 -0
- package/dist/paybox/auth/utils.d.ts +5 -0
- package/dist/paybox/auth/utils.d.ts.map +1 -0
- package/dist/paybox/auth/utils.js +17 -0
- package/dist/paybox/auth/utils.js.map +1 -0
- package/dist/paybox/constants.d.ts +11 -0
- package/dist/paybox/constants.d.ts.map +1 -0
- package/dist/paybox/constants.js +11 -0
- package/dist/paybox/constants.js.map +1 -0
- package/dist/paybox/errors.d.ts +43 -0
- package/dist/paybox/errors.d.ts.map +1 -0
- package/dist/paybox/errors.js +141 -0
- package/dist/paybox/errors.js.map +1 -0
- package/dist/paybox/sdk/adapter.d.ts +16 -0
- package/dist/paybox/sdk/adapter.d.ts.map +1 -0
- package/dist/paybox/sdk/adapter.js +127 -0
- package/dist/paybox/sdk/adapter.js.map +1 -0
- package/dist/paybox/sdk/constants.d.ts +14 -0
- package/dist/paybox/sdk/constants.d.ts.map +1 -0
- package/dist/paybox/sdk/constants.js +23 -0
- package/dist/paybox/sdk/constants.js.map +1 -0
- package/dist/paybox/sdk/factory.d.ts +4 -0
- package/dist/paybox/sdk/factory.d.ts.map +1 -0
- package/dist/paybox/sdk/factory.js +24 -0
- package/dist/paybox/sdk/factory.js.map +1 -0
- package/dist/paybox/sdk/logging.utils.d.ts +4 -0
- package/dist/paybox/sdk/logging.utils.d.ts.map +1 -0
- package/dist/paybox/sdk/logging.utils.js +19 -0
- package/dist/paybox/sdk/logging.utils.js.map +1 -0
- package/dist/paybox/sdk/utils.d.ts +7 -0
- package/dist/paybox/sdk/utils.d.ts.map +1 -0
- package/dist/paybox/sdk/utils.js +182 -0
- package/dist/paybox/sdk/utils.js.map +1 -0
- package/dist/paybox/storage.d.ts +17 -0
- package/dist/paybox/storage.d.ts.map +1 -0
- package/dist/paybox/storage.js +87 -0
- package/dist/paybox/storage.js.map +1 -0
- package/dist/paybox/types.d.ts +481 -0
- package/dist/paybox/types.d.ts.map +1 -0
- package/dist/paybox/types.js +144 -0
- package/dist/paybox/types.js.map +1 -0
- package/dist/paybox/wallet/manager.d.ts +22 -0
- package/dist/paybox/wallet/manager.d.ts.map +1 -0
- package/dist/paybox/wallet/manager.js +111 -0
- package/dist/paybox/wallet/manager.js.map +1 -0
- package/dist/paybox/wallet/rpc.client.d.ts +16 -0
- package/dist/paybox/wallet/rpc.client.d.ts.map +1 -0
- package/dist/paybox/wallet/rpc.client.js +53 -0
- package/dist/paybox/wallet/rpc.client.js.map +1 -0
- package/dist/paybox/wallet/utils.d.ts +5 -0
- package/dist/paybox/wallet/utils.d.ts.map +1 -0
- package/dist/paybox/wallet/utils.js +82 -0
- package/dist/paybox/wallet/utils.js.map +1 -0
- package/dist/server.constants.d.ts.map +1 -1
- package/dist/server.constants.js +5 -2
- package/dist/server.constants.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +8 -2
- package/dist/server.js.map +1 -1
- package/dist/services/app-config.utils.d.ts.map +1 -1
- package/dist/services/app-config.utils.js +22 -11
- package/dist/services/app-config.utils.js.map +1 -1
- package/dist/services/auth.service.d.ts +3 -5
- package/dist/services/auth.service.d.ts.map +1 -1
- package/dist/services/auth.service.js +20 -77
- package/dist/services/auth.service.js.map +1 -1
- package/dist/services/cell.client.d.ts.map +1 -1
- package/dist/services/cell.client.js +22 -9
- package/dist/services/cell.client.js.map +1 -1
- package/dist/services/lot-return.constants.d.ts +3 -0
- package/dist/services/lot-return.constants.d.ts.map +1 -0
- package/dist/services/lot-return.constants.js +35 -0
- package/dist/services/lot-return.constants.js.map +1 -0
- package/dist/services/lot-return.service.d.ts +25 -0
- package/dist/services/lot-return.service.d.ts.map +1 -0
- package/dist/services/lot-return.service.js +151 -0
- package/dist/services/lot-return.service.js.map +1 -0
- package/dist/services/lot-return.types.d.ts +19 -0
- package/dist/services/lot-return.types.d.ts.map +1 -0
- package/dist/services/lot-return.types.js +2 -0
- package/dist/services/lot-return.types.js.map +1 -0
- package/dist/services/lot-return.utils.d.ts +33 -0
- package/dist/services/lot-return.utils.d.ts.map +1 -0
- package/dist/services/lot-return.utils.js +128 -0
- package/dist/services/lot-return.utils.js.map +1 -0
- package/dist/services/lot-terms.constants.d.ts +4 -0
- package/dist/services/lot-terms.constants.d.ts.map +1 -0
- package/dist/services/lot-terms.constants.js +5 -0
- package/dist/services/lot-terms.constants.js.map +1 -0
- package/dist/services/lot-terms.helpers.d.ts +11 -0
- package/dist/services/lot-terms.helpers.d.ts.map +1 -0
- package/dist/services/lot-terms.helpers.js +45 -0
- package/dist/services/lot-terms.helpers.js.map +1 -0
- package/dist/services/lot-terms.service.d.ts +20 -0
- package/dist/services/lot-terms.service.d.ts.map +1 -0
- package/dist/services/lot-terms.service.js +119 -0
- package/dist/services/lot-terms.service.js.map +1 -0
- package/dist/services/lot-terms.types.d.ts +25 -0
- package/dist/services/lot-terms.types.d.ts.map +1 -0
- package/dist/services/lot-terms.types.js +2 -0
- package/dist/services/lot-terms.types.js.map +1 -0
- package/dist/services/reveal-revert.utils.d.ts +1 -0
- package/dist/services/reveal-revert.utils.d.ts.map +1 -1
- package/dist/services/reveal-revert.utils.js +20 -0
- package/dist/services/reveal-revert.utils.js.map +1 -1
- package/dist/services/reveal.constants.d.ts +1 -1
- package/dist/services/reveal.constants.d.ts.map +1 -1
- package/dist/services/reveal.constants.js +1 -1
- package/dist/services/reveal.constants.js.map +1 -1
- package/dist/services/reveal.service.d.ts +4 -3
- package/dist/services/reveal.service.d.ts.map +1 -1
- package/dist/services/reveal.service.js +35 -10
- package/dist/services/reveal.service.js.map +1 -1
- package/dist/services/reveal.utils.d.ts +7 -8
- package/dist/services/reveal.utils.d.ts.map +1 -1
- package/dist/services/reveal.utils.js +15 -8
- package/dist/services/reveal.utils.js.map +1 -1
- package/dist/services/route.constants.d.ts +12 -1
- package/dist/services/route.constants.d.ts.map +1 -1
- package/dist/services/route.constants.js +66 -15
- package/dist/services/route.constants.js.map +1 -1
- package/dist/services/route.lots.d.ts +18 -0
- package/dist/services/route.lots.d.ts.map +1 -0
- package/dist/services/route.lots.js +33 -0
- package/dist/services/route.lots.js.map +1 -0
- package/dist/services/route.service.d.ts +13 -4
- package/dist/services/route.service.d.ts.map +1 -1
- package/dist/services/route.service.js +95 -13
- package/dist/services/route.service.js.map +1 -1
- package/dist/services/route.types.d.ts +76 -0
- package/dist/services/route.types.d.ts.map +1 -0
- package/dist/services/route.types.js +8 -0
- package/dist/services/route.types.js.map +1 -0
- package/dist/services/route.utils.d.ts +19 -0
- package/dist/services/route.utils.d.ts.map +1 -1
- package/dist/services/route.utils.js +35 -0
- package/dist/services/route.utils.js.map +1 -1
- package/dist/services/trade-eviction.constants.d.ts +12 -0
- package/dist/services/trade-eviction.constants.d.ts.map +1 -0
- package/dist/services/trade-eviction.constants.js +25 -0
- package/dist/services/trade-eviction.constants.js.map +1 -0
- package/dist/services/trade-eviction.service.d.ts +22 -0
- package/dist/services/trade-eviction.service.d.ts.map +1 -0
- package/dist/services/trade-eviction.service.js +101 -0
- package/dist/services/trade-eviction.service.js.map +1 -0
- package/dist/services/trade-eviction.types.d.ts +30 -0
- package/dist/services/trade-eviction.types.d.ts.map +1 -0
- package/dist/services/trade-eviction.types.js +2 -0
- package/dist/services/trade-eviction.types.js.map +1 -0
- package/dist/services/trade-eviction.utils.d.ts +9 -0
- package/dist/services/trade-eviction.utils.d.ts.map +1 -0
- package/dist/services/trade-eviction.utils.js +38 -0
- package/dist/services/trade-eviction.utils.js.map +1 -0
- package/dist/services/trade-rules.service.d.ts +15 -0
- package/dist/services/trade-rules.service.d.ts.map +1 -0
- package/dist/services/trade-rules.service.js +45 -0
- package/dist/services/trade-rules.service.js.map +1 -0
- package/dist/services/trade.client.d.ts +11 -1
- package/dist/services/trade.client.d.ts.map +1 -1
- package/dist/services/trade.client.js +87 -0
- package/dist/services/trade.client.js.map +1 -1
- package/dist/services/trade.constants.d.ts +9 -0
- package/dist/services/trade.constants.d.ts.map +1 -0
- package/dist/services/trade.constants.js +28 -0
- package/dist/services/trade.constants.js.map +1 -0
- package/dist/services/trade.helpers.d.ts +9 -1
- package/dist/services/trade.helpers.d.ts.map +1 -1
- package/dist/services/trade.helpers.js +40 -27
- package/dist/services/trade.helpers.js.map +1 -1
- package/dist/services/transport-revert.utils.d.ts +3 -0
- package/dist/services/transport-revert.utils.d.ts.map +1 -0
- package/dist/services/transport-revert.utils.js +15 -0
- package/dist/services/transport-revert.utils.js.map +1 -0
- package/dist/services/transport.client.d.ts.map +1 -1
- package/dist/services/transport.client.js +14 -6
- package/dist/services/transport.client.js.map +1 -1
- package/dist/services/types.d.ts +249 -21
- package/dist/services/types.d.ts.map +1 -1
- package/dist/services/types.js +25 -0
- package/dist/services/types.js.map +1 -1
- package/dist/services/warehouse.utils.d.ts +8 -0
- package/dist/services/warehouse.utils.d.ts.map +1 -1
- package/dist/services/warehouse.utils.js +25 -0
- package/dist/services/warehouse.utils.js.map +1 -1
- package/dist/session/manager.d.ts +1 -0
- package/dist/session/manager.d.ts.map +1 -1
- package/dist/session/manager.js +13 -0
- package/dist/session/manager.js.map +1 -1
- package/dist/session/storage.d.ts +0 -3
- package/dist/session/storage.d.ts.map +1 -1
- package/dist/session/storage.js +6 -43
- package/dist/session/storage.js.map +1 -1
- package/dist/session/types.d.ts +4 -98
- package/dist/session/types.d.ts.map +1 -1
- package/dist/session/types.js +0 -15
- package/dist/session/types.js.map +1 -1
- package/dist/tools/authenticate.d.ts +1 -1
- package/dist/tools/authenticate.d.ts.map +1 -1
- package/dist/tools/authenticate.js +19 -45
- package/dist/tools/authenticate.js.map +1 -1
- package/dist/tools/config/get-game-config/constants.d.ts +3 -0
- package/dist/tools/config/get-game-config/constants.d.ts.map +1 -1
- package/dist/tools/config/get-game-config/constants.js +13 -2
- package/dist/tools/config/get-game-config/constants.js.map +1 -1
- package/dist/tools/config/get-game-config/get-game-config.d.ts.map +1 -1
- package/dist/tools/config/get-game-config/get-game-config.js +6 -3
- package/dist/tools/config/get-game-config/get-game-config.js.map +1 -1
- package/dist/tools/config/get-game-config/get-game-config.utils.d.ts +4 -4
- package/dist/tools/config/get-game-config/get-game-config.utils.d.ts.map +1 -1
- package/dist/tools/config/get-game-config/get-game-config.utils.js +26 -9
- package/dist/tools/config/get-game-config/get-game-config.utils.js.map +1 -1
- package/dist/tools/config/get-game-config/types.d.ts +6 -2
- package/dist/tools/config/get-game-config/types.d.ts.map +1 -1
- package/dist/tools/config/resource-lens/resource-lens.utils.d.ts.map +1 -1
- package/dist/tools/config/resource-lens/resource-lens.utils.js +5 -4
- package/dist/tools/config/resource-lens/resource-lens.utils.js.map +1 -1
- package/dist/tools/map/attention/attention.d.ts.map +1 -1
- package/dist/tools/map/attention/attention.js +16 -5
- package/dist/tools/map/attention/attention.js.map +1 -1
- package/dist/tools/map/attention/constants.d.ts +6 -0
- package/dist/tools/map/attention/constants.d.ts.map +1 -1
- package/dist/tools/map/attention/constants.js +16 -2
- package/dist/tools/map/attention/constants.js.map +1 -1
- package/dist/tools/map/attention/evicted.service.d.ts +19 -0
- package/dist/tools/map/attention/evicted.service.d.ts.map +1 -0
- package/dist/tools/map/attention/evicted.service.js +73 -0
- package/dist/tools/map/attention/evicted.service.js.map +1 -0
- package/dist/tools/map/attention/evicted.utils.d.ts +16 -0
- package/dist/tools/map/attention/evicted.utils.d.ts.map +1 -0
- package/dist/tools/map/attention/evicted.utils.js +72 -0
- package/dist/tools/map/attention/evicted.utils.js.map +1 -0
- package/dist/tools/map/attention/panel.utils.d.ts.map +1 -1
- package/dist/tools/map/attention/panel.utils.js +1 -0
- package/dist/tools/map/attention/panel.utils.js.map +1 -1
- package/dist/tools/map/attention/types.d.ts +17 -0
- package/dist/tools/map/attention/types.d.ts.map +1 -1
- package/dist/tools/map/attention/types.js.map +1 -1
- package/dist/tools/map/get-map/constants.d.ts.map +1 -1
- package/dist/tools/map/get-map/constants.js +4 -2
- package/dist/tools/map/get-map/constants.js.map +1 -1
- package/dist/tools/reveal/constants.d.ts.map +1 -1
- package/dist/tools/reveal/constants.js +3 -1
- package/dist/tools/reveal/constants.js.map +1 -1
- package/dist/tools/trade/buy-lot/buy-lot.d.ts.map +1 -1
- package/dist/tools/trade/buy-lot/buy-lot.js +2 -0
- package/dist/tools/trade/buy-lot/buy-lot.js.map +1 -1
- package/dist/tools/trade/buy-lot/constants.d.ts.map +1 -1
- package/dist/tools/trade/buy-lot/constants.js +2 -0
- package/dist/tools/trade/buy-lot/constants.js.map +1 -1
- package/dist/tools/trade/buyer-guard/constants.d.ts +4 -0
- package/dist/tools/trade/buyer-guard/constants.d.ts.map +1 -0
- package/dist/tools/trade/buyer-guard/constants.js +11 -0
- package/dist/tools/trade/buyer-guard/constants.js.map +1 -0
- package/dist/tools/trade/buyer-guard/lot-open.guard.d.ts +9 -0
- package/dist/tools/trade/buyer-guard/lot-open.guard.d.ts.map +1 -0
- package/dist/tools/trade/buyer-guard/lot-open.guard.js +15 -0
- package/dist/tools/trade/buyer-guard/lot-open.guard.js.map +1 -0
- package/dist/tools/trade/buyer-guard/types.d.ts +6 -0
- package/dist/tools/trade/buyer-guard/types.d.ts.map +1 -0
- package/dist/tools/trade/buyer-guard/types.js +2 -0
- package/dist/tools/trade/buyer-guard/types.js.map +1 -0
- package/dist/tools/trade/constants.d.ts +5 -0
- package/dist/tools/trade/constants.d.ts.map +1 -0
- package/dist/tools/trade/constants.js +14 -0
- package/dist/tools/trade/constants.js.map +1 -0
- package/dist/tools/trade/create-lot/constants.d.ts.map +1 -1
- package/dist/tools/trade/create-lot/constants.js +4 -1
- package/dist/tools/trade/create-lot/constants.js.map +1 -1
- package/dist/tools/trade/create-lot/create-lot.d.ts +2 -1
- package/dist/tools/trade/create-lot/create-lot.d.ts.map +1 -1
- package/dist/tools/trade/create-lot/create-lot.js +15 -1
- package/dist/tools/trade/create-lot/create-lot.js.map +1 -1
- package/dist/tools/trade/evict-lot/constants.d.ts +4 -0
- package/dist/tools/trade/evict-lot/constants.d.ts.map +1 -0
- package/dist/tools/trade/evict-lot/constants.js +13 -0
- package/dist/tools/trade/evict-lot/constants.js.map +1 -0
- package/dist/tools/trade/evict-lot/evict-lot.d.ts +6 -0
- package/dist/tools/trade/evict-lot/evict-lot.d.ts.map +1 -0
- package/dist/tools/trade/evict-lot/evict-lot.js +35 -0
- package/dist/tools/trade/evict-lot/evict-lot.js.map +1 -0
- package/dist/tools/trade/evict-lot/format.utils.d.ts +5 -0
- package/dist/tools/trade/evict-lot/format.utils.d.ts.map +1 -0
- package/dist/tools/trade/evict-lot/format.utils.js +10 -0
- package/dist/tools/trade/evict-lot/format.utils.js.map +1 -0
- package/dist/tools/trade/evict-lot/types.d.ts +5 -0
- package/dist/tools/trade/evict-lot/types.d.ts.map +1 -0
- package/dist/tools/trade/evict-lot/types.js +8 -0
- package/dist/tools/trade/evict-lot/types.js.map +1 -0
- package/dist/tools/trade/format.utils.d.ts +2 -4
- package/dist/tools/trade/format.utils.d.ts.map +1 -1
- package/dist/tools/trade/format.utils.js +11 -13
- package/dist/tools/trade/format.utils.js.map +1 -1
- package/dist/tools/trade/get-lot/constants.d.ts.map +1 -1
- package/dist/tools/trade/get-lot/constants.js +2 -1
- package/dist/tools/trade/get-lot/constants.js.map +1 -1
- package/dist/tools/trade/list-lots/constants.d.ts +2 -0
- package/dist/tools/trade/list-lots/constants.d.ts.map +1 -1
- package/dist/tools/trade/list-lots/constants.js +5 -1
- package/dist/tools/trade/list-lots/constants.js.map +1 -1
- package/dist/tools/trade/list-lots/list-lots.d.ts.map +1 -1
- package/dist/tools/trade/list-lots/list-lots.js +2 -1
- package/dist/tools/trade/list-lots/list-lots.js.map +1 -1
- package/dist/tools/trade/list-lots/list-lots.utils.d.ts +8 -0
- package/dist/tools/trade/list-lots/list-lots.utils.d.ts.map +1 -0
- package/dist/tools/trade/list-lots/list-lots.utils.js +10 -0
- package/dist/tools/trade/list-lots/list-lots.utils.js.map +1 -0
- package/dist/tools/trade/list-mine/constants.d.ts.map +1 -1
- package/dist/tools/trade/list-mine/constants.js +3 -1
- package/dist/tools/trade/list-mine/constants.js.map +1 -1
- package/dist/tools/trade/lot-terms/constants.d.ts +5 -0
- package/dist/tools/trade/lot-terms/constants.d.ts.map +1 -0
- package/dist/tools/trade/lot-terms/constants.js +13 -0
- package/dist/tools/trade/lot-terms/constants.js.map +1 -0
- package/dist/tools/trade/lot-terms/factory.d.ts +4 -0
- package/dist/tools/trade/lot-terms/factory.d.ts.map +1 -0
- package/dist/tools/trade/lot-terms/factory.js +14 -0
- package/dist/tools/trade/lot-terms/factory.js.map +1 -0
- package/dist/tools/trade/lot-terms/format.utils.d.ts +4 -0
- package/dist/tools/trade/lot-terms/format.utils.d.ts.map +1 -0
- package/dist/tools/trade/lot-terms/format.utils.js +30 -0
- package/dist/tools/trade/lot-terms/format.utils.js.map +1 -0
- package/dist/tools/trade/lot-terms/lot-terms.d.ts +5 -0
- package/dist/tools/trade/lot-terms/lot-terms.d.ts.map +1 -0
- package/dist/tools/trade/lot-terms/lot-terms.js +23 -0
- package/dist/tools/trade/lot-terms/lot-terms.js.map +1 -0
- package/dist/tools/trade/lot-terms/types.d.ts +6 -0
- package/dist/tools/trade/lot-terms/types.d.ts.map +1 -0
- package/dist/tools/trade/lot-terms/types.js +7 -0
- package/dist/tools/trade/lot-terms/types.js.map +1 -0
- package/dist/tools/trade/market-index/constants.d.ts.map +1 -1
- package/dist/tools/trade/market-index/constants.js +2 -0
- package/dist/tools/trade/market-index/constants.js.map +1 -1
- package/dist/tools/trade/markets/constants.d.ts.map +1 -1
- package/dist/tools/trade/markets/constants.js +2 -1
- package/dist/tools/trade/markets/constants.js.map +1 -1
- package/dist/tools/trade/quote-buy/constants.d.ts.map +1 -1
- package/dist/tools/trade/quote-buy/constants.js +4 -2
- package/dist/tools/trade/quote-buy/constants.js.map +1 -1
- package/dist/tools/trade/quote-buy/quote-buy.d.ts.map +1 -1
- package/dist/tools/trade/quote-buy/quote-buy.js +2 -0
- package/dist/tools/trade/quote-buy/quote-buy.js.map +1 -1
- package/dist/tools/trade/quote-lot-return/constants.d.ts +2 -0
- package/dist/tools/trade/quote-lot-return/constants.d.ts.map +1 -0
- package/dist/tools/trade/quote-lot-return/constants.js +11 -0
- package/dist/tools/trade/quote-lot-return/constants.js.map +1 -0
- package/dist/tools/trade/quote-lot-return/quote-lot-return.d.ts +5 -0
- package/dist/tools/trade/quote-lot-return/quote-lot-return.d.ts.map +1 -0
- package/dist/tools/trade/quote-lot-return/quote-lot-return.js +20 -0
- package/dist/tools/trade/quote-lot-return/quote-lot-return.js.map +1 -0
- package/dist/tools/trade/return-lot/constants.d.ts +5 -0
- package/dist/tools/trade/return-lot/constants.d.ts.map +1 -0
- package/dist/tools/trade/return-lot/constants.js +26 -0
- package/dist/tools/trade/return-lot/constants.js.map +1 -0
- package/dist/tools/trade/return-lot/factory.d.ts +4 -0
- package/dist/tools/trade/return-lot/factory.d.ts.map +1 -0
- package/dist/tools/trade/return-lot/factory.js +18 -0
- package/dist/tools/trade/return-lot/factory.js.map +1 -0
- package/dist/tools/trade/return-lot/format.utils.d.ts +5 -0
- package/dist/tools/trade/return-lot/format.utils.d.ts.map +1 -0
- package/dist/tools/trade/return-lot/format.utils.js +39 -0
- package/dist/tools/trade/return-lot/format.utils.js.map +1 -0
- package/dist/tools/trade/return-lot/return-lot.d.ts +5 -0
- package/dist/tools/trade/return-lot/return-lot.d.ts.map +1 -0
- package/dist/tools/trade/return-lot/return-lot.js +25 -0
- package/dist/tools/trade/return-lot/return-lot.js.map +1 -0
- package/dist/tools/trade/return-lot/types.d.ts +11 -0
- package/dist/tools/trade/return-lot/types.d.ts.map +1 -0
- package/dist/tools/trade/return-lot/types.js +21 -0
- package/dist/tools/trade/return-lot/types.js.map +1 -0
- package/dist/tools/trade/types.d.ts +0 -4
- package/dist/tools/trade/types.d.ts.map +1 -1
- package/dist/tools/trade/types.js +4 -12
- package/dist/tools/trade/types.js.map +1 -1
- package/dist/tools/transport/constants.d.ts.map +1 -1
- package/dist/tools/transport/constants.js +9 -0
- package/dist/tools/transport/constants.js.map +1 -1
- package/dist/tools/transport/network/constants.d.ts +2 -0
- package/dist/tools/transport/network/constants.d.ts.map +1 -1
- package/dist/tools/transport/network/constants.js +2 -0
- package/dist/tools/transport/network/constants.js.map +1 -1
- package/dist/tools/transport/network/panel.utils.d.ts +2 -2
- package/dist/tools/transport/network/panel.utils.d.ts.map +1 -1
- package/dist/tools/transport/network/panel.utils.js +20 -0
- package/dist/tools/transport/network/panel.utils.js.map +1 -1
- package/dist/tools/transport/network/route-network.d.ts.map +1 -1
- package/dist/tools/transport/network/route-network.js +1 -1
- package/dist/tools/transport/network/route-network.js.map +1 -1
- package/dist/tools/transport/next-hops/next-hops.d.ts.map +1 -1
- package/dist/tools/transport/next-hops/next-hops.js +13 -3
- package/dist/tools/transport/next-hops/next-hops.js.map +1 -1
- package/dist/tools/transport/quote/constants.d.ts.map +1 -1
- package/dist/tools/transport/quote/constants.js +5 -3
- package/dist/tools/transport/quote/constants.js.map +1 -1
- package/dist/tools/transport/types.d.ts +2 -0
- package/dist/tools/transport/types.d.ts.map +1 -1
- package/dist/tools/transport/types.js +16 -0
- package/dist/tools/transport/types.js.map +1 -1
- package/dist/tools/types.d.ts +7 -1
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js +16 -1
- package/dist/tools/types.js.map +1 -1
- package/dist/types.d.ts +3 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/wei.constants.d.ts +6 -0
- package/dist/utils/wei.constants.d.ts.map +1 -0
- package/dist/utils/wei.constants.js +6 -0
- package/dist/utils/wei.constants.js.map +1 -0
- package/dist/wallet/index.d.ts.map +1 -1
- package/dist/wallet/index.js +2 -3
- package/dist/wallet/index.js.map +1 -1
- package/dist/wallet/types.d.ts +0 -9
- package/dist/wallet/types.d.ts.map +1 -1
- package/dist/wallet/types.js.map +1 -1
- package/package.json +2 -2
- package/dist/tools/trade/cancel-lot/cancel-lot.d.ts +0 -4
- package/dist/tools/trade/cancel-lot/cancel-lot.d.ts.map +0 -1
- package/dist/tools/trade/cancel-lot/cancel-lot.js +0 -20
- package/dist/tools/trade/cancel-lot/cancel-lot.js.map +0 -1
- package/dist/tools/trade/cancel-lot/constants.d.ts +0 -2
- package/dist/tools/trade/cancel-lot/constants.d.ts.map +0 -1
- package/dist/tools/trade/cancel-lot/constants.js +0 -8
- package/dist/tools/trade/cancel-lot/constants.js.map +0 -1
- package/dist/wallet/agw.manager.d.ts +0 -20
- package/dist/wallet/agw.manager.d.ts.map +0 -1
- package/dist/wallet/agw.manager.js +0 -90
- package/dist/wallet/agw.manager.js.map +0 -1
- package/dist/wallet/agw.provider.d.ts +0 -14
- package/dist/wallet/agw.provider.d.ts.map +0 -1
- package/dist/wallet/agw.provider.js +0 -48
- package/dist/wallet/agw.provider.js.map +0 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { EVICTED_COUNT_UNREADABLE, EVICTED_LISTING_BLOCK, EVICTED_LOT_NOT_SELLING } from './constants.js';
|
|
2
|
+
import { LotState } from '../../../api/types.js';
|
|
3
|
+
import { attentionItem } from '../../../map/attention.utils.js';
|
|
4
|
+
import { AttentionReason } from '../../../map/types.js';
|
|
5
|
+
const LIVE_STATES = [LotState.Delivering, LotState.Open, LotState.Evicted];
|
|
6
|
+
function plural(count, one, many) {
|
|
7
|
+
return count === 1 ? one : many;
|
|
8
|
+
}
|
|
9
|
+
function outstanding(count) {
|
|
10
|
+
return count === null
|
|
11
|
+
? EVICTED_COUNT_UNREADABLE
|
|
12
|
+
: `The hub reports ${count} evicted ${plural(count, 'lot', 'lots')} of yours outstanding. ` +
|
|
13
|
+
EVICTED_LISTING_BLOCK;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Hubs worth asking the chain about. Every hub the seller still has a live lot on qualifies, not only the
|
|
17
|
+
* ones with a visible evicted row: a hub whose evicted rows have not been projected yet is exactly the
|
|
18
|
+
* case the count has to catch.
|
|
19
|
+
*/
|
|
20
|
+
export function liveHubTokenIds(lots) {
|
|
21
|
+
return [...new Set(lots.filter((lot) => LIVE_STATES.includes(lot.state)).map((lot) => lot.hubTokenId))];
|
|
22
|
+
}
|
|
23
|
+
function lotItem(lot, count) {
|
|
24
|
+
return attentionItem({ tokenId: lot.hubTokenId }, AttentionReason.LotEvicted, {
|
|
25
|
+
resourceId: lot.resourceId,
|
|
26
|
+
lotId: lot.id,
|
|
27
|
+
message: `Evicted: lot ${lot.id} was thrown out of hub ${lot.hubTokenId} with ${lot.remaining} of its ` +
|
|
28
|
+
`resource still yours. ${EVICTED_LOT_NOT_SELLING} ${outstanding(count)} Each evicted lot is ` +
|
|
29
|
+
`returned on its own — returning this one does not clear the others.`,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function hubItem(hubTokenId, count, visible) {
|
|
33
|
+
return attentionItem({ tokenId: hubTokenId }, AttentionReason.LotEvicted, {
|
|
34
|
+
message: `Evicted backlog: hub ${hubTokenId} reports ${count} evicted ${plural(count, 'lot', 'lots')} of ` +
|
|
35
|
+
`yours outstanding, but only ${visible} of them ${plural(visible, 'is', 'are')} listed here — the ` +
|
|
36
|
+
`lot list is still catching up with the chain, so this hub is not clear. ${EVICTED_LISTING_BLOCK}`,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Reconciles the seller's evicted rows against the authoritative per-hub count. A zero count is the one
|
|
41
|
+
* thing that may drop a row; a count above what is listed keeps the hub blocked with an item of its own,
|
|
42
|
+
* so a lagging list never reads as a clear hub.
|
|
43
|
+
*/
|
|
44
|
+
export function evictedAttentionItems(lots, counts) {
|
|
45
|
+
const countByHub = new Map(counts.map((entry) => [entry.hubTokenId, entry.count]));
|
|
46
|
+
const rowsByHub = new Map();
|
|
47
|
+
for (const lot of lots) {
|
|
48
|
+
if (lot.state !== LotState.Evicted) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const rows = rowsByHub.get(lot.hubTokenId) ?? [];
|
|
52
|
+
rows.push(lot);
|
|
53
|
+
rowsByHub.set(lot.hubTokenId, rows);
|
|
54
|
+
}
|
|
55
|
+
const hubTokenIds = [...new Set([...rowsByHub.keys(), ...countByHub.keys()])].sort((a, b) => a.localeCompare(b));
|
|
56
|
+
const items = [];
|
|
57
|
+
for (const hubTokenId of hubTokenIds) {
|
|
58
|
+
const count = countByHub.get(hubTokenId) ?? null;
|
|
59
|
+
if (count === 0) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
const rows = rowsByHub.get(hubTokenId) ?? [];
|
|
63
|
+
for (const lot of rows) {
|
|
64
|
+
items.push(lotItem(lot, count));
|
|
65
|
+
}
|
|
66
|
+
if (count !== null && count > rows.length) {
|
|
67
|
+
items.push(hubItem(hubTokenId, count, rows.length));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return items;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=evicted.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evicted.utils.js","sourceRoot":"","sources":["../../../../src/tools/map/attention/evicted.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE1G,OAAO,EAAE,QAAQ,EAAgB,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAsB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE5E,MAAM,WAAW,GAA4B,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;AAEpG,SAAS,MAAM,CAAC,KAAa,EAAE,GAAW,EAAE,IAAY;IACpD,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACpC,CAAC;AAED,SAAS,WAAW,CAAC,KAAoB;IACrC,OAAO,KAAK,KAAK,IAAI;QACjB,CAAC,CAAC,wBAAwB;QAC1B,CAAC,CAAC,mBAAmB,KAAK,YAAY,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,yBAAyB;YACrF,qBAAqB,CAAC;AACpC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,IAA4B;IACxD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAC5G,CAAC;AAED,SAAS,OAAO,CAAC,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],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AA4BzD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"panel.utils.d.ts","sourceRoot":"","sources":["../../../../src/tools/map/attention/panel.utils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AA4BzD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CA+B5E"}
|
|
@@ -49,6 +49,7 @@ export function warehousePressurePanel(input) {
|
|
|
49
49
|
},
|
|
50
50
|
{ label: labels.peakFill, value: peakFill(input.items, input.resources) },
|
|
51
51
|
{ label: labels.stalled, value: `${countReasons(input.items, STALLED_REASONS)}` },
|
|
52
|
+
{ label: labels.evicted, value: `${countReasons(input.items, [AttentionReason.LotEvicted])}` },
|
|
52
53
|
],
|
|
53
54
|
[{ label: labels.note, value: input.ownerKnown ? input.note : WAREHOUSE_PRESSURE_NO_OWNER_NOTE }],
|
|
54
55
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel.utils.js","sourceRoot":"","sources":["../../../../src/tools/map/attention/panel.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,yBAAyB,EACzB,gCAAgC,EAChC,iCAAiC,EACjC,6BAA6B,EAC7B,wBAAwB,GAC3B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAsB,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAsB,MAAM,gCAAgC,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,SAAS,YAAY,CAAC,KAAmC,EAAE,OAAuC;IAC9F,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,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AAE,eAAe,CAAC,EAAE,EAAE;gBACjF,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE;aACjG;YACD,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,gCAAgC,EAAE,CAAC;SACpG;KACJ,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { ILogger } from '../../../logger/types.js';
|
|
2
3
|
import { type AttentionItem, AttentionSeverity } from '../../../map/types.js';
|
|
4
|
+
import type { IAppConfig, ITradeClient } from '../../../services/types.js';
|
|
3
5
|
import type { ResourceNames } from '../../../utils/format.utils.js';
|
|
6
|
+
import type { WalletProvider } from '../../../wallet/types.js';
|
|
4
7
|
export declare const getAttentionInputSchema: {
|
|
5
8
|
minSeverity: z.ZodDefault<z.ZodNullable<z.ZodNativeEnum<typeof AttentionSeverity>>>;
|
|
6
9
|
owner: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
7
10
|
};
|
|
11
|
+
/** `count: null` means the chain could not be asked — never that the hub is clear. */
|
|
12
|
+
export interface EvictedHubCount {
|
|
13
|
+
hubTokenId: string;
|
|
14
|
+
count: number | null;
|
|
15
|
+
}
|
|
16
|
+
export interface IEvictedLotCounts {
|
|
17
|
+
forHubs(hubTokenIds: ReadonlyArray<string>): Promise<Array<EvictedHubCount>>;
|
|
18
|
+
}
|
|
19
|
+
export interface EvictedLotCountServiceOptions {
|
|
20
|
+
appConfig: IAppConfig;
|
|
21
|
+
wallet: WalletProvider;
|
|
22
|
+
tradeClient: ITradeClient;
|
|
23
|
+
logger: ILogger;
|
|
24
|
+
}
|
|
8
25
|
export interface WarehousePressureInput {
|
|
9
26
|
scouting: boolean;
|
|
10
27
|
owner: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tools/map/attention/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,aAAa,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tools/map/attention/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,KAAK,aAAa,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,eAAO,MAAM,uBAAuB;;;CAcnC,CAAC;AAEF,sFAAsF;AACtF,MAAM,WAAW,eAAe;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAC9B,OAAO,CAAC,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;CAChF;AAED,MAAM,WAAW,6BAA6B;IAC1C,SAAS,EAAE,UAAU,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC;IACvB,WAAW,EAAE,YAAY,CAAC;IAC1B,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAC1C,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IACpC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,aAAa,CAAC;CAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/tools/map/attention/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/tools/map/attention/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAsB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAK9E,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACnC,WAAW,EAAE,CAAC;SACT,UAAU,CAAC,iBAAiB,CAAC;SAC7B,QAAQ,EAAE;SACV,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CAAC,uFAAuF,CAAC;IACtG,KAAK,EAAE,CAAC;SACH,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CACL,kGAAkG;QAC9F,sFAAsF,CAC7F;CACR,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/map/get-map/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/map/get-map/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,QAWrB,CAAC"}
|
|
@@ -3,9 +3,11 @@ export const GET_MAP_DESCRIPTION = [
|
|
|
3
3
|
'tokenId — no coordinates: navigate via each cell’s `neighbors` (6 adjacent, 5 next to a pentagon vertex;',
|
|
4
4
|
'owned/other/empty, empty = unminted) and `cpu_next_hops`; `pos {face,i,j}` is only a rough hint (wraps at',
|
|
5
5
|
'face seams). Returns a `summary`, a `resourceIndex` of your cells, and per-resource `storage`',
|
|
6
|
-
'(used/cap/full; a box with room for less than one whole cycle halts that resource’s production
|
|
7
|
-
'= uncapped). Scopes: mine | around',
|
|
6
|
+
'(used/cap/full; a box with room for less than one whole cycle halts that resource’s production; cap null',
|
|
7
|
+
'= uncapped WCPU, while every other missing/zero cap means no room). Scopes: mine | around',
|
|
8
8
|
'(grid radius from aroundTokenId) | cells | all | summary. version/updated are epoch ms, serverTime/startAt',
|
|
9
9
|
'unix seconds. `server.reachable` false means actions will fail; your to-do list is `cpu_get_attention`.',
|
|
10
|
+
'This is land and storage, not the marketplace: `storage.reserved.lots` is how much of a hub box lot escrow',
|
|
11
|
+
'holds, never an offer you can buy. For offers use `cpu_get_markets` and `cpu_list_lots`.',
|
|
10
12
|
].join(' ');
|
|
11
13
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/map/get-map/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,6GAA6G;IAC7G,0GAA0G;IAC1G,2GAA2G;IAC3G,+FAA+F;IAC/F,0GAA0G;IAC1G,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/map/get-map/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,6GAA6G;IAC7G,0GAA0G;IAC1G,2GAA2G;IAC3G,+FAA+F;IAC/F,0GAA0G;IAC1G,2FAA2F;IAC3F,4GAA4G;IAC5G,yGAAyG;IACzG,4GAA4G;IAC5G,0FAA0F;CAC7F,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/reveal/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/reveal/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,QAUpB,CAAC;AAEZ,eAAO,MAAM,0BAA0B,QAQ5B,CAAC"}
|
|
@@ -5,7 +5,9 @@ export const REVEAL_DESCRIPTION = [
|
|
|
5
5
|
'cell a second time additionally needs all its deposits depleted. How the draw arrives depends on the network’s',
|
|
6
6
|
'randomness mode — see `cpu_get_game_config`. On a self-service network this call also settles the draw and',
|
|
7
7
|
'returns the deposits it rolled; call it again on a cell whose reveal is still pending to finish that one,',
|
|
8
|
-
'which pays for no second reveal.',
|
|
8
|
+
'which pays for no second reveal. If the wallet lacks the quoted $CPU, this call sends no approval or reveal,',
|
|
9
|
+
'reports the exact shortfall, and gives the recovery path: `cpu_quote_swap`, then `cpu_swap` selling ETH, then',
|
|
10
|
+
'retry `cpu_reveal` so the price is quoted again.',
|
|
9
11
|
].join(' ');
|
|
10
12
|
export const FULFILL_REVEAL_DESCRIPTION = [
|
|
11
13
|
'Finish reveal requests you already opened that have not delivered their draw yet (call `cpu_authenticate`',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/tools/reveal/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B,6GAA6G;IAC7G,4GAA4G;IAC5G,0GAA0G;IAC1G,gHAAgH;IAChH,4GAA4G;IAC5G,2GAA2G;IAC3G,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/tools/reveal/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAC9B,6GAA6G;IAC7G,4GAA4G;IAC5G,0GAA0G;IAC1G,gHAAgH;IAChH,4GAA4G;IAC5G,2GAA2G;IAC3G,8GAA8G;IAC9G,+GAA+G;IAC/G,kDAAkD;CACrD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACtC,2GAA2G;IAC3G,8GAA8G;IAC9G,uHAAuH;IACvH,+GAA+G;IAC/G,+GAA+G;IAC/G,+GAA+G;IAC/G,qDAAqD;CACxD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buy-lot.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/buy-lot/buy-lot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"buy-lot.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/buy-lot/buy-lot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKnE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI,CAqBnF"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { BUY_LOT_DESCRIPTION } from './constants.js';
|
|
2
2
|
import { ToolEventType } from '../../types.js';
|
|
3
|
+
import { requireOpenLot } from '../buyer-guard/lot-open.guard.js';
|
|
3
4
|
import { summarizeBuyLot } from '../format.utils.js';
|
|
4
5
|
import { buyLotInputSchema } from '../types.js';
|
|
5
6
|
export function registerBuyLotTool(server, context) {
|
|
6
7
|
server.registerTool('cpu_buy_lot', { description: BUY_LOT_DESCRIPTION, inputSchema: buyLotInputSchema }, async (args) => {
|
|
8
|
+
await requireOpenLot(context.trade, args.lotId);
|
|
7
9
|
const result = await context.trade.buyLot({
|
|
8
10
|
lotId: args.lotId,
|
|
9
11
|
chain: args.chain,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buy-lot.js","sourceRoot":"","sources":["../../../../src/tools/trade/buy-lot/buy-lot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAsB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,UAAU,kBAAkB,CAAC,MAAqB,EAAE,OAAmB;IACzE,MAAM,CAAC,YAAY,CACf,aAAa,EACb,EAAE,WAAW,EAAE,mBAAmB,EAAE,WAAW,EAAE,iBAAiB,EAAE,EACpE,KAAK,EAAE,IAAI,EAAE,EAAE;QACX,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;YACtC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;SACpB,CAAC,CAAC;QACH,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QAErD,OAAO;YACH,OAAO,EAAE;gBACL,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE;gBAC1D,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,I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CAAC,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,SAAS,EAAE,CAAC,EAAE;aAC5F;SACJ,CAAC;IACN,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/buy-lot/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/buy-lot/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,QAcrB,CAAC"}
|
|
@@ -10,5 +10,7 @@ export const BUY_LOT_DESCRIPTION = [
|
|
|
10
10
|
'debited for the sale (= `sale` − `discount`, the syndicate discount when buyer and seller share a syndicate),',
|
|
11
11
|
"while `tax` is the clan tax carved from the hub fee to the owner's syndicate manager and `ownerNet` is the hub",
|
|
12
12
|
"owner's net proceeds.",
|
|
13
|
+
'The lot state is re-read first: anything other than open — evicted, still delivering, sold out, cancelled —',
|
|
14
|
+
'stops the call before a single token is approved and before any transaction is sent.',
|
|
13
15
|
].join(' ');
|
|
14
16
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/buy-lot/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,gHAAgH;IAChH,0GAA0G;IAC1G,+GAA+G;IAC/G,gHAAgH;IAChH,sGAAsG;IACtG,0GAA0G;IAC1G,4GAA4G;IAC5G,kHAAkH;IAClH,+GAA+G;IAC/G,gHAAgH;IAChH,uBAAuB;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/buy-lot/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,gHAAgH;IAChH,0GAA0G;IAC1G,+GAA+G;IAC/G,gHAAgH;IAChH,sGAAsG;IACtG,0GAA0G;IAC1G,4GAA4G;IAC5G,kHAAkH;IAClH,+GAA+G;IAC/G,gHAAgH;IAChH,uBAAuB;IACvB,6GAA6G;IAC7G,sFAAsF;CACzF,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/buyer-guard/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,eAAO,MAAM,oBAAoB,yDAAyD,CAAC;AAE3F,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAQ/D,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LotState } from '../../../api/types.js';
|
|
2
|
+
export const NO_SIDE_EFFECTS_NOTE = 'No tokens were approved and no transaction was sent.';
|
|
3
|
+
export const LOT_STATE_ADVICE = {
|
|
4
|
+
[LotState.Open]: '',
|
|
5
|
+
[LotState.Delivering]: 'Its goods are still en route to the hub; it opens once the delivery is finalized.',
|
|
6
|
+
[LotState.Evicted]: "The hub owner threw it out: the units are still the seller's and owe a lot return home, and nobody " +
|
|
7
|
+
'can buy them. Browse cpu_list_lots or cpu_get_markets for a lot that is actually on sale.',
|
|
8
|
+
[LotState.Sold]: 'It sold out — nothing remains on it.',
|
|
9
|
+
[LotState.Cancelled]: 'The seller took it off the market and sent the remainder home.',
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/buyer-guard/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,MAAM,CAAC,MAAM,oBAAoB,GAAG,sDAAsD,CAAC;AAE3F,MAAM,CAAC,MAAM,gBAAgB,GAAuC;IAChE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE;IACnB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,mFAAmF;IAC1G,CAAC,QAAQ,CAAC,OAAO,CAAC,EACd,qGAAqG;QACrG,2FAA2F;IAC/F,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,sCAAsC;IACvD,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,gEAAgE;CACzF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LotStateReader } from './types.js';
|
|
2
|
+
import { type LotView } from '../../../api/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Re-reads the lot every time instead of trusting whatever the caller last saw: the whole point is to
|
|
5
|
+
* refuse on the state observed now, before the buy path can approve $CPU or send anything. A lot that
|
|
6
|
+
* turns unbuyable between this read and the transaction is the contract's race to lose, not ours.
|
|
7
|
+
*/
|
|
8
|
+
export declare function requireOpenLot(reader: LotStateReader, lotId: string): Promise<LotView>;
|
|
9
|
+
//# sourceMappingURL=lot-open.guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lot-open.guard.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/buyer-guard/lot-open.guard.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,KAAK,OAAO,EAAY,MAAM,uBAAuB,CAAC;AAE/D;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ5F"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LOT_STATE_ADVICE, NO_SIDE_EFFECTS_NOTE } from './constants.js';
|
|
2
|
+
import { LotState } from '../../../api/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Re-reads the lot every time instead of trusting whatever the caller last saw: the whole point is to
|
|
5
|
+
* refuse on the state observed now, before the buy path can approve $CPU or send anything. A lot that
|
|
6
|
+
* turns unbuyable between this read and the transaction is the contract's race to lose, not ours.
|
|
7
|
+
*/
|
|
8
|
+
export async function requireOpenLot(reader, lotId) {
|
|
9
|
+
const lot = await reader.getLot(lotId);
|
|
10
|
+
if (lot.state === LotState.Open) {
|
|
11
|
+
return lot;
|
|
12
|
+
}
|
|
13
|
+
throw new Error(`Lot ${lotId} is not open — it is ${lot.state}. ${LOT_STATE_ADVICE[lot.state]} ${NO_SIDE_EFFECTS_NOTE}`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=lot-open.guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lot-open.guard.js","sourceRoot":"","sources":["../../../../src/tools/trade/buyer-guard/lot-open.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAExE,OAAO,EAAgB,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAsB,EAAE,KAAa;IACtE,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC9B,OAAO,GAAG,CAAC;IACf,CAAC;IACD,MAAM,IAAI,KAAK,CACX,OAAO,KAAK,wBAAwB,GAAG,CAAC,KAAK,KAAK,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,oBAAoB,EAAE,CAC1G,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LotView } from '../../../api/types.js';
|
|
2
|
+
/** The narrow read a buyer guard needs: one authoritative look at the lot it is about to spend on. */
|
|
3
|
+
export interface LotStateReader {
|
|
4
|
+
getLot(lotId: string): Promise<LotView>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/buyer-guard/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,sGAAsG;AACtG,MAAM,WAAW,cAAc;IAC3B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/tools/trade/buyer-guard/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Vocabulary more than one trade tool renders; a tool's own wording stays in its own `constants.ts`. */
|
|
2
|
+
export declare const EVICTED_LOT_HEADLINE = "EVICTED \u2014 not for sale";
|
|
3
|
+
export declare const EVICTED_LOT_EXPLANATION: string;
|
|
4
|
+
export declare const FROZEN_LOT_RETURN_NOTE: string;
|
|
5
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/trade/constants.ts"],"names":[],"mappings":"AAAA,yGAAyG;AAEzG,eAAO,MAAM,oBAAoB,gCAA2B,CAAC;AAE7D,eAAO,MAAM,uBAAuB,QAMzB,CAAC;AAEZ,eAAO,MAAM,sBAAsB,QAGxB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Vocabulary more than one trade tool renders; a tool's own wording stays in its own `constants.ts`. */
|
|
2
|
+
export const EVICTED_LOT_HEADLINE = 'EVICTED — not for sale';
|
|
3
|
+
export const EVICTED_LOT_EXPLANATION = [
|
|
4
|
+
'Evicted: the hub owner threw this lot out of their hub. The units are still yours and still escrowed,',
|
|
5
|
+
'but the lot is not selling and nobody can buy it, it earns nothing, and it no longer occupies hub',
|
|
6
|
+
'storage. It stays that way until you schedule its lot return — the whole remainder shipped home over a',
|
|
7
|
+
'route you choose. Until every evicted remainder on that hub has a return scheduled, you cannot create a',
|
|
8
|
+
'new lot on that hub for any resource; other hubs are unaffected.',
|
|
9
|
+
].join(' ');
|
|
10
|
+
export const FROZEN_LOT_RETURN_NOTE = [
|
|
11
|
+
'Returning it costs no sale fee, but the route home still owes transit fees for every foreign hub it',
|
|
12
|
+
'passes through.',
|
|
13
|
+
].join(' ');
|
|
14
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/tools/trade/constants.ts"],"names":[],"mappings":"AAAA,yGAAyG;AAEzG,MAAM,CAAC,MAAM,oBAAoB,GAAG,wBAAwB,CAAC;AAE7D,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACnC,uGAAuG;IACvG,mGAAmG;IACnG,wGAAwG;IACxG,yGAAyG;IACzG,kEAAkE;CACrE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,qGAAqG;IACrG,iBAAiB;CACpB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/create-lot/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/create-lot/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,QAcxB,CAAC"}
|
|
@@ -6,7 +6,10 @@ export const CREATE_LOT_DESCRIPTION = [
|
|
|
6
6
|
'seller proceeds (the buyer still pays exactly price × value). `maxSaleFeePercent` is your tolerance: the highest',
|
|
7
7
|
'rate you accept — omit it to lock in the live rate at listing (read on-chain). The hub settles its live rate',
|
|
8
8
|
'each sale (never above your tolerance); if it later rises above the tolerance the lot freezes and buys revert',
|
|
9
|
-
'until the hub lowers it —
|
|
9
|
+
'until the hub lowers it — you can send the unsold remainder home at any time, which owes no sale fee but still',
|
|
10
|
+
'owes transit for the route you pick. Read the live window, your live-lot count and any evicted remainder you owe',
|
|
11
|
+
'with `cpu_get_lot_terms` first: this tool re-reads the same terms and refuses before any approval or transaction.',
|
|
12
|
+
'The lot is DELIVERING and',
|
|
10
13
|
'becomes buyable (OPEN) only after its escrow arrives — call `cpu_finalize_delivery` on the returned deliveryId',
|
|
11
14
|
'(or wait). Returns the lotId and the locked-in `maxSaleFeePercent`; track with `cpu_list_my_lots` / `cpu_get_lot`.',
|
|
12
15
|
].join(' ');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/create-lot/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,+GAA+G;IAC/G,gHAAgH;IAChH,+GAA+G;IAC/G,+GAA+G;IAC/G,kHAAkH;IAClH,8GAA8G;IAC9G,+GAA+G;IAC/G,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/create-lot/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,+GAA+G;IAC/G,gHAAgH;IAChH,+GAA+G;IAC/G,+GAA+G;IAC/G,kHAAkH;IAClH,8GAA8G;IAC9G,+GAA+G;IAC/G,gHAAgH;IAChH,kHAAkH;IAClH,mHAAmH;IACnH,2BAA2B;IAC3B,gHAAgH;IAChH,oHAAoH;CACvH,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import type { ILotTerms } from '../../../services/lot-terms.types.js';
|
|
1
2
|
import type { AppContext } from '../../../types.js';
|
|
2
3
|
import { type ToolRegistrar } from '../../types.js';
|
|
3
|
-
export declare function registerCreateLotTool(server: ToolRegistrar, context: AppContext): void;
|
|
4
|
+
export declare function registerCreateLotTool(server: ToolRegistrar, context: AppContext, injected?: ILotTerms | null): void;
|
|
4
5
|
//# sourceMappingURL=create-lot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-lot.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/create-lot/create-lot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"create-lot.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/create-lot/create-lot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKnE,wBAAgB,qBAAqB,CACjC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,UAAU,EACnB,QAAQ,GAAE,SAAS,GAAG,IAAW,GAClC,IAAI,CAqCN"}
|
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
import { CREATE_LOT_DESCRIPTION } from './constants.js';
|
|
2
2
|
import { ToolEventType } from '../../types.js';
|
|
3
3
|
import { summarizeCreateLot } from '../format.utils.js';
|
|
4
|
+
import { createLotTermsService } from '../lot-terms/factory.js';
|
|
4
5
|
import { createLotInputSchema } from '../types.js';
|
|
5
|
-
export function registerCreateLotTool(server, context) {
|
|
6
|
+
export function registerCreateLotTool(server, context, injected = null) {
|
|
7
|
+
// Built on first use, not at registration: registering a tool must not reach for the wallet.
|
|
8
|
+
let lotTerms = injected;
|
|
9
|
+
const terms = () => (lotTerms ??= createLotTermsService(context));
|
|
6
10
|
server.registerTool('cpu_create_lot', { description: CREATE_LOT_DESCRIPTION, inputSchema: createLotInputSchema }, async (args) => {
|
|
11
|
+
const hubTokenId = String(args.chain[args.chain.length - 1]);
|
|
12
|
+
// Past this line the route is quoted, the transit fee approved and the transaction sent, so every
|
|
13
|
+
// deterministic refusal has to happen before it or it has already cost the seller money.
|
|
14
|
+
await terms().assertListingAllowed({
|
|
15
|
+
hubTokenId,
|
|
16
|
+
resourceId: args.resourceId,
|
|
17
|
+
value: args.value,
|
|
18
|
+
pricePerUnit: args.pricePerUnit,
|
|
19
|
+
maxSaleFeePercent: args.maxSaleFeePercent,
|
|
20
|
+
});
|
|
7
21
|
const result = await context.trade.createLot({
|
|
8
22
|
chain: args.chain,
|
|
9
23
|
resourceId: args.resourceId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-lot.js","sourceRoot":"","sources":["../../../../src/tools/trade/create-lot/create-lot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"create-lot.js","sourceRoot":"","sources":["../../../../src/tools/trade/create-lot/create-lot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAGxD,OAAO,EAAE,aAAa,EAAsB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,UAAU,qBAAqB,CACjC,MAAqB,EACrB,OAAmB,EACnB,WAA6B,IAAI;IAEjC,6FAA6F;IAC7F,IAAI,QAAQ,GAAG,QAAQ,CAAC;IAC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,EAAE;aAC7F;SACJ,CAAC;IACN,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/evict-lot/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,QAOvB,CAAC;AAEZ,eAAO,MAAM,uBAAuB,QAEb,CAAC;AAExB,eAAO,MAAM,2BAA2B,QAEkD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const EVICT_LOT_DESCRIPTION = [
|
|
2
|
+
'Throw one foreign OPEN lot off a Hub you own, on-chain. Requires a session. It moves no goods and seizes',
|
|
3
|
+
'nothing: the units stay the seller’s and stay escrowed, the lot simply stops selling and stops occupying',
|
|
4
|
+
'your Hub storage, and it stops counting against the Hub — a Hub demolishes only once no lot of any kind',
|
|
5
|
+
'stands on it, and one still delivering into it counts even though its goods have not landed yet. It never',
|
|
6
|
+
'finalizes a delivery, never touches more than the one lot you name, and never brings anything home —',
|
|
7
|
+
'only the seller can do that, with `cpu_return_lot`. Your own lot cannot be evicted: return it instead.',
|
|
8
|
+
].join(' ');
|
|
9
|
+
export const EVICT_LOT_NO_GOODS_NOTE = 'No goods moved and nothing was seized: every unit is still the seller’s, still escrowed, and only they ' +
|
|
10
|
+
'can ship it home.';
|
|
11
|
+
export const EVICT_LOT_SELLER_BLOCK_NOTE = 'It has not vanished: it stays on the books as an evicted lot, still holding one of that seller’s lot ' +
|
|
12
|
+
'slots, and they cannot list any resource on this Hub until they schedule its return.';
|
|
13
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/evict-lot/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,0GAA0G;IAC1G,0GAA0G;IAC1G,yGAAyG;IACzG,2GAA2G;IAC3G,sGAAsG;IACtG,wGAAwG;CAC3G,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,uBAAuB,GAChC,yGAAyG;IACzG,mBAAmB,CAAC;AAExB,MAAM,CAAC,MAAM,2BAA2B,GACpC,uGAAuG;IACvG,sFAAsF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ILotEviction } from '../../../services/trade-eviction.types.js';
|
|
2
|
+
import type { AppContext } from '../../../types.js';
|
|
3
|
+
import { type ToolRegistrar } from '../../types.js';
|
|
4
|
+
export declare function createLotEvictionService(context: AppContext): ILotEviction;
|
|
5
|
+
export declare function registerEvictLotTool(server: ToolRegistrar, context: AppContext, injected?: ILotEviction | null): void;
|
|
6
|
+
//# sourceMappingURL=evict-lot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evict-lot.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/evict-lot/evict-lot.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAE9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEnE,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,UAAU,GAAG,YAAY,CAW1E;AAED,wBAAgB,oBAAoB,CAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,UAAU,EACnB,QAAQ,GAAE,YAAY,GAAG,IAAW,GACrC,IAAI,CAoBN"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { EVICT_LOT_DESCRIPTION } from './constants.js';
|
|
2
|
+
import { summarizeEvictLot } from './format.utils.js';
|
|
3
|
+
import { evictLotInputSchema } from './types.js';
|
|
4
|
+
import { LotEvictionService } from '../../../services/trade-eviction.service.js';
|
|
5
|
+
import { TradeClient } from '../../../services/trade.client.js';
|
|
6
|
+
import { ContractClient } from '../../../wallet/contract-client.js';
|
|
7
|
+
import { ToolEventType } from '../../types.js';
|
|
8
|
+
export function createLotEvictionService(context) {
|
|
9
|
+
const logger = context.logger.child('trade:eviction');
|
|
10
|
+
const contracts = new ContractClient({ wallet: context.wallet, logger, retry: null });
|
|
11
|
+
return new LotEvictionService({
|
|
12
|
+
wallet: context.wallet,
|
|
13
|
+
appConfig: context.appConfig,
|
|
14
|
+
tradeClient: new TradeClient({ contracts, logger }),
|
|
15
|
+
contracts,
|
|
16
|
+
mapReader: context.mapReader,
|
|
17
|
+
logger,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export function registerEvictLotTool(server, context, injected = null) {
|
|
21
|
+
// Built on first use, not at registration: registering a tool must not reach for the wallet.
|
|
22
|
+
let evictionService = injected;
|
|
23
|
+
const eviction = () => (evictionService ??= createLotEvictionService(context));
|
|
24
|
+
server.registerTool('cpu_evict_lot', { description: EVICT_LOT_DESCRIPTION, inputSchema: evictLotInputSchema }, async (args) => {
|
|
25
|
+
const result = await eviction().evictLot({ lotId: args.lotId });
|
|
26
|
+
const { resources } = await context.appConfig.load();
|
|
27
|
+
return {
|
|
28
|
+
content: [
|
|
29
|
+
{ type: 'text', text: summarizeEvictLot(result, resources) },
|
|
30
|
+
{ type: 'text', text: JSON.stringify({ ...result, eventType: ToolEventType.LotEvicted }) },
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=evict-lot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evict-lot.js","sourceRoot":"","sources":["../../../../src/tools/trade/evict-lot/evict-lot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC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AE,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QAErD,OAAO;YACH,OAAO,EAAE;gBACL,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE;gBAC5D,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,UAAU,EAAE,CAAC,EAAE;aAC7F;SACJ,CAAC;IACN,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EvictLotResult } from '../../../services/types.js';
|
|
2
|
+
import { type ResourceNames } from '../../../utils/format.utils.js';
|
|
3
|
+
/** Human header for a confirmed `evict_lot`. */
|
|
4
|
+
export declare function summarizeEvictLot(result: EvictLotResult, resources: ResourceNames): string;
|
|
5
|
+
//# sourceMappingURL=format.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.utils.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/evict-lot/format.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEnF,gDAAgD;AAChD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAO1F"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EVICT_LOT_NO_GOODS_NOTE, EVICT_LOT_SELLER_BLOCK_NOTE } from './constants.js';
|
|
2
|
+
import { resourceLabel } from '../../../utils/format.utils.js';
|
|
3
|
+
/** Human header for a confirmed `evict_lot`. */
|
|
4
|
+
export function summarizeEvictLot(result, resources) {
|
|
5
|
+
return (`Evicted lot ${result.lotId} from Hub ${result.hubTokenId}: ${result.remaining} ` +
|
|
6
|
+
`${resourceLabel(resources, result.resourceId)} listed by ${result.sellerAddress} are off your shelf and ` +
|
|
7
|
+
`no longer for sale (state ${result.state}). ${EVICT_LOT_NO_GOODS_NOTE} ${EVICT_LOT_SELLER_BLOCK_NOTE} ` +
|
|
8
|
+
`evict tx ${result.txHash} in block ${result.blockNumber}.`);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=format.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.utils.js","sourceRoot":"","sources":["../../../../src/tools/trade/evict-lot/format.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAEtF,OAAO,EAAE,aAAa,EAAsB,MAAM,gCAAgC,CAAC;AAEnF,gDAAgD;AAChD,MAAM,UAAU,iBAAiB,CAAC,MAAsB,EAAE,SAAwB;IAC9E,OAAO,CACH,eAAe,MAAM,CAAC,KAAK,aAAa,MAAM,CAAC,UAAU,KAAK,MAAM,CAAC,SAAS,GAAG;QACjF,GAAG,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,cAAc,MAAM,CAAC,aAAa,0BAA0B;QAC1G,6BAA6B,MAAM,CAAC,KAAK,MAAM,uBAAuB,IAAI,2BAA2B,GAAG;QACxG,YAAY,MAAM,CAAC,MAAM,aAAa,MAAM,CAAC,WAAW,GAAG,CAC9D,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/evict-lot/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB;;CAO/B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const evictLotInputSchema = {
|
|
3
|
+
lotId: z
|
|
4
|
+
.string()
|
|
5
|
+
.describe('The id of the foreign lot to evict (from cpu_get_markets / cpu_list_lots / cpu_get_lot). It must be ' +
|
|
6
|
+
'open, it must belong to someone else, and it must sit on a Hub you own. One lot per call.'),
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/tools/trade/evict-lot/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,KAAK,EAAE,CAAC;SACH,MAAM,EAAE;SACR,QAAQ,CACL,sGAAsG;QAClG,2FAA2F,CAClG;CACR,CAAC"}
|