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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EnrichedMarketSummary } from './types.js';
|
|
2
|
-
import type
|
|
3
|
-
import type { BuyLotResult,
|
|
2
|
+
import { type FillView, type LotView, type MarketIndex } from '../../api/types.js';
|
|
3
|
+
import type { BuyLotResult, CreateLotResult, SetSaleFeeResult, TradeQuote } from '../../services/types.js';
|
|
4
4
|
import { type ResourceNames } from '../../utils/format.utils.js';
|
|
5
5
|
/** Human header for a confirmed `create_lot`. */
|
|
6
6
|
export declare function summarizeCreateLot(result: CreateLotResult, resources: ResourceNames): string;
|
|
@@ -8,8 +8,6 @@ export declare function summarizeCreateLot(result: CreateLotResult, resources: R
|
|
|
8
8
|
export declare function summarizeSetSaleFee(result: SetSaleFeeResult, resources: ResourceNames): string;
|
|
9
9
|
/** Human header for a confirmed `buy_lot`. */
|
|
10
10
|
export declare function summarizeBuyLot(result: BuyLotResult, resources: ResourceNames): string;
|
|
11
|
-
/** Human header for a confirmed `cancel_lot`. */
|
|
12
|
-
export declare function summarizeCancelLot(result: CancelLotResult, resources: ResourceNames): string;
|
|
13
11
|
export declare function summarizeMarkets(markets: Array<EnrichedMarketSummary>, resources: ResourceNames): string;
|
|
14
12
|
export declare function summarizeFills(fills: Array<FillView>, resources: ResourceNames): string;
|
|
15
13
|
export declare function summarizeMarketIndex(index: MarketIndex, resources: ResourceNames): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.utils.d.ts","sourceRoot":"","sources":["../../../src/tools/trade/format.utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"format.utils.d.ts","sourceRoot":"","sources":["../../../src/tools/trade/format.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAiC,MAAM,oBAAoB,CAAC;AAClH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC3G,OAAO,EAAsD,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAErH,iDAAiD;AACjD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAa5F;AAED,mDAAmD;AACnD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAQ9F;AAED,8CAA8C;AAC9C,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAgBtF;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,qBAAqB,CAAC,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAkBxG;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAevF;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAWzF;AAYD,wBAAgB,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAKpF;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAa3E;AAaD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAiBrF"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { EVICTED_LOT_EXPLANATION, EVICTED_LOT_HEADLINE, FROZEN_LOT_RETURN_NOTE } from './constants.js';
|
|
2
|
+
import { LotState } from '../../api/types.js';
|
|
1
3
|
import { formatUnixSeconds, resourceLabel, summarizeTransit } from '../../utils/format.utils.js';
|
|
2
4
|
/** Human header for a confirmed `create_lot`. */
|
|
3
5
|
export function summarizeCreateLot(result, resources) {
|
|
@@ -5,7 +7,8 @@ export function summarizeCreateLot(result, resources) {
|
|
|
5
7
|
return (`Listed lot ${result.lotId}: ${result.value} ${resourceLabel(resources, result.resourceId)} @ ` +
|
|
6
8
|
`${result.pricePerUnit} $CPU/u at Hub ${result.hubTokenId} (sale-fee tolerance ${result.maxSaleFeePercent}% ` +
|
|
7
9
|
`locked in — the hub settles its live rate on each sale, but if it ever rises above your tolerance the lot ` +
|
|
8
|
-
`freezes and buys revert until the hub lowers it;
|
|
10
|
+
`freezes and buys revert until the hub lowers it; you can send the remainder home at any time, paying no ` +
|
|
11
|
+
`sale fee but still paying transit for the route). ` +
|
|
9
12
|
`Escrow shipping to the Hub (delivery ${result.deliveryId}, ETA ${formatUnixSeconds(result.arrivalAt)}); the ` +
|
|
10
13
|
`lot opens once it arrives — run finalize_delivery on ${result.deliveryId} after the ETA (or wait). Transit ` +
|
|
11
14
|
`fee ${summarizeTransit(result.transitPaid, result.transitDiscount)}. ${approve}create tx ${result.txHash} ` +
|
|
@@ -35,15 +38,6 @@ export function summarizeBuyLot(result, resources) {
|
|
|
35
38
|
`${formatUnixSeconds(result.arrivalAt)}) — run finalize_delivery on ${result.deliveryId} after the ETA. ` +
|
|
36
39
|
`${approve}buy tx ${result.txHash} in block ${result.blockNumber}.`);
|
|
37
40
|
}
|
|
38
|
-
/** Human header for a confirmed `cancel_lot`. */
|
|
39
|
-
export function summarizeCancelLot(result, resources) {
|
|
40
|
-
const approve = result.approveTxHash !== null ? `approve tx ${result.approveTxHash}, ` : '';
|
|
41
|
-
return (`Cancelled lot ${result.lotId}: ${result.returned} ${resourceLabel(resources, result.resourceId)} ` +
|
|
42
|
-
`returning to you (delivery ${result.deliveryId}, ETA ${formatUnixSeconds(result.arrivalAt)}) — run ` +
|
|
43
|
-
`finalize_delivery on ${result.deliveryId} after the ETA to reclaim them. Transit fee ` +
|
|
44
|
-
`${summarizeTransit(result.transitPaid, result.transitDiscount)}. ${approve}cancel tx ${result.txHash} ` +
|
|
45
|
-
`in block ${result.blockNumber}.`);
|
|
46
|
-
}
|
|
47
41
|
export function summarizeMarkets(markets, resources) {
|
|
48
42
|
if (markets.length === 0) {
|
|
49
43
|
return 'No markets match.';
|
|
@@ -102,19 +96,23 @@ export function summarizeLots(lots, resources) {
|
|
|
102
96
|
}
|
|
103
97
|
export function summarizeLot(lot, resources) {
|
|
104
98
|
const line = summarizeLotLine(lot, resources);
|
|
99
|
+
if (lot.state === LotState.Evicted) {
|
|
100
|
+
return `${line}\n${EVICTED_LOT_EXPLANATION}`;
|
|
101
|
+
}
|
|
105
102
|
if (!lot.frozen) {
|
|
106
103
|
return line;
|
|
107
104
|
}
|
|
108
105
|
return (`${line}\nFrozen: the hub's live sale fee (${lot.saleFeePercent}%) exceeds your tolerance ` +
|
|
109
106
|
`(${lot.maxSaleFeePercent}%), so every buy reverts until the hub owner lowers the rate to your tolerance ` +
|
|
110
|
-
`or below — or you
|
|
107
|
+
`or below — or you send the remainder home. ${FROZEN_LOT_RETURN_NOTE}`);
|
|
111
108
|
}
|
|
112
109
|
function summarizeLotLine(lot, resources) {
|
|
113
110
|
const dist = lot.distanceFromAnchor !== null ? `, ${lot.distanceFromAnchor} grid steps away` : '';
|
|
114
111
|
const frozen = lot.frozen ? ` · FROZEN (live ${lot.saleFeePercent}% > tolerance ${lot.maxSaleFeePercent}%)` : '';
|
|
112
|
+
const evicted = lot.state === LotState.Evicted ? ` · ${EVICTED_LOT_HEADLINE}` : '';
|
|
115
113
|
return (`lot ${lot.id} [${lot.state}] · ${resourceLabel(resources, lot.resourceId)} · ${lot.remaining}/${lot.listed} ` +
|
|
116
|
-
`left @ ${lot.pricePerUnit} $CPU/u (sale fee ${lot.saleFeePercent}%)${frozen}
|
|
117
|
-
`seller ${lot.sellerAddress}`);
|
|
114
|
+
`left @ ${lot.pricePerUnit} $CPU/u (sale fee ${lot.saleFeePercent}%)${frozen}${evicted} · ` +
|
|
115
|
+
`Hub ${lot.hubTokenId}${dist} · seller ${lot.sellerAddress}`);
|
|
118
116
|
}
|
|
119
117
|
export function summarizeQuoteBuy(quote, resources) {
|
|
120
118
|
const goods = `${quote.value} ${resourceLabel(resources, quote.resourceId)} @ ${quote.pricePerUnit} $CPU/u`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.utils.js","sourceRoot":"","sources":["../../../src/tools/trade/format.utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"format.utils.js","sourceRoot":"","sources":["../../../src/tools/trade/format.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEvG,OAAO,EAAsE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAElH,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,gBAAgB,EAAsB,MAAM,6BAA6B,CAAC;AAErH,iDAAiD;AACjD,MAAM,UAAU,kBAAkB,CAAC,MAAuB,EAAE,SAAwB;IAChF,MAAM,OAAO,GAAG,MAAM,CAAC,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,cAAc,MAAM,CAAC,aAAa,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5F,OAAO,CACH,cAAc,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,IAAI,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK;QAC/F,GAAG,MAAM,CAAC,YAAY,kBAAkB,MAAM,CAAC,UAAU,wBAAwB,MAAM,CAAC,iBAAiB,IAAI;QAC7G,4GAA4G;QAC5G,0GAA0G;QAC1G,oDAAoD;QACpD,wCAAwC,MAAM,CAAC,UAAU,SAAS,iBAAiB,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS;QAC9G,wDAAwD,MAAM,CAAC,UAAU,oCAAoC;QAC7G,OAAO,gBAAgB,CA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oC;YACtG,gCAAgC,KAAK,CAAC,SAAS,iBAAiB,MAAM,EAAE,CAC3E,CAAC;IACN,CAAC;IACD,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,iBAAiB,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1F,OAAO,CACH,qBAAqB,KAAK,CAAC,KAAK,KAAK,KAAK,MAAM,OAAO,MAAM,KAAK,CAAC,UAAU,IAAI,GAAG,WAAW;QAC/F,GAAG,KAAK,CAAC,eAAe,KAAK,IAAI,IAAI,KAAK,CAAC,eAAe,KAAK,GAAG,CAAC,CAAC,CAAC,UAAU,KAAK,CAAC,eAAe,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QAC/G,KAAK,KAAK,CAAC,KAAK,cAAc,GAAG,KAAK,KAAK,CAAC,SAAS,sCAAsC,MAAM,EAAE,CACtG,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/get-lot/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/get-lot/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,QAIrB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const GET_LOT_DESCRIPTION = [
|
|
2
2
|
'Inspect a single lot by id — resource, remaining/listed units, price per unit, Hub location, seller, and',
|
|
3
|
-
'lifecycle state. Public read.',
|
|
3
|
+
'lifecycle state. Public read. It resolves a lot in any state, including an evicted one; observing a lot is',
|
|
4
|
+
'not the same as being able to buy it, and only an `open` lot is buyable.',
|
|
4
5
|
].join(' ');
|
|
5
6
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/get-lot/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,0GAA0G;IAC1G
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/get-lot/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,0GAA0G;IAC1G,4GAA4G;IAC5G,0EAA0E;CAC7E,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/list-lots/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/list-lots/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,eAAO,MAAM,wBAAwB,EAAE,aAAa,CAAC,QAAQ,CAAwC,CAAC;AAEtG,eAAO,MAAM,qBAAqB,QAOvB,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { LotState } from '../../../api/types.js';
|
|
2
|
+
export const BUYER_VISIBLE_LOT_STATES = [LotState.Open, LotState.Delivering];
|
|
1
3
|
export const LIST_LOTS_DESCRIPTION = [
|
|
2
4
|
'Browse marketplace lots with filters (hub, resourceId, seller, minPrice/maxPrice), sort',
|
|
3
5
|
'(price_asc | recent | nearest — nearest needs a zone), pagination (limit ≤ 200, offset), and an optional',
|
|
4
6
|
'zone (aroundTokenId + radius in grid steps). `availability` defaults to open (buyable now); use incoming for',
|
|
5
|
-
'en-route lots or all
|
|
7
|
+
'en-route lots or all — `all` means open plus incoming, never a sold, cancelled or evicted lot. An evicted lot',
|
|
8
|
+
'is not an offer and never shows up here; its seller finds it with `cpu_list_my_lots`.',
|
|
9
|
+
'Public read — start with `cpu_get_markets` for a compact overview, then drill in here.',
|
|
6
10
|
].join(' ');
|
|
7
11
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/list-lots/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,yFAAyF;IACzF,0GAA0G;IAC1G,8GAA8G;IAC9G,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/list-lots/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,MAAM,CAAC,MAAM,wBAAwB,GAA4B,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;AAEtG,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,yFAAyF;IACzF,0GAA0G;IAC1G,8GAA8G;IAC9G,+GAA+G;IAC/G,uFAAuF;IACvF,wFAAwF;CAC3F,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-lots.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/list-lots/list-lots.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-lots.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/list-lots/list-lots.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAIpD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI,CAgBrF"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { LIST_LOTS_DESCRIPTION } from './constants.js';
|
|
2
|
+
import { buyerVisibleLots } from './list-lots.utils.js';
|
|
2
3
|
import { summarizeLots } from '../format.utils.js';
|
|
3
4
|
import { listLotsInputSchema } from '../types.js';
|
|
4
5
|
export function registerListLotsTool(server, context) {
|
|
5
6
|
server.registerTool('cpu_list_lots', { description: LIST_LOTS_DESCRIPTION, inputSchema: listLotsInputSchema }, async (args) => {
|
|
6
|
-
const lots = await context.trade.listLots(args);
|
|
7
|
+
const lots = buyerVisibleLots(await context.trade.listLots(args));
|
|
7
8
|
const { resources } = await context.appConfig.load();
|
|
8
9
|
return {
|
|
9
10
|
content: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-lots.js","sourceRoot":"","sources":["../../../../src/tools/trade/list-lots/list-lots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"list-lots.js","sourceRoot":"","sources":["../../../../src/tools/trade/list-lots/list-lots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,UAAU,oBAAoB,CAAC,MAAqB,EAAE,OAAmB;IAC3E,MAAM,CAAC,YAAY,CACf,eAAe,EACf,EAAE,WAAW,EAAE,qBAAqB,EAAE,WAAW,EAAE,mBAAmB,EAAE,EACxE,KAAK,EAAE,IAAI,EAAE,EAAE;QACX,MAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QAClE,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,GAAG,IAAI,CAAC,MAAM,YAAY,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE;gBAClF,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;aAC/C;SACJ,CAAC;IACN,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LotView } from '../../../api/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Buyer discovery answers "what can I buy, now or once it lands" — so it carries Open and Delivering
|
|
4
|
+
* and nothing else. Filtering here as well as server-side is deliberate: an Evicted lot reaching a
|
|
5
|
+
* buyer's book reads as an offer, and an offer that cannot be filled is worse than a missing row.
|
|
6
|
+
*/
|
|
7
|
+
export declare function buyerVisibleLots(lots: Array<LotView>): Array<LotView>;
|
|
8
|
+
//# sourceMappingURL=list-lots.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-lots.utils.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/list-lots/list-lots.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAErE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BUYER_VISIBLE_LOT_STATES } from './constants.js';
|
|
2
|
+
/**
|
|
3
|
+
* Buyer discovery answers "what can I buy, now or once it lands" — so it carries Open and Delivering
|
|
4
|
+
* and nothing else. Filtering here as well as server-side is deliberate: an Evicted lot reaching a
|
|
5
|
+
* buyer's book reads as an offer, and an offer that cannot be filled is worse than a missing row.
|
|
6
|
+
*/
|
|
7
|
+
export function buyerVisibleLots(lots) {
|
|
8
|
+
return lots.filter((lot) => BUYER_VISIBLE_LOT_STATES.includes(lot.state));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=list-lots.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-lots.utils.js","sourceRoot":"","sources":["../../../../src/tools/trade/list-lots/list-lots.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAG1D;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAoB;IACjD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,wBAAwB,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/list-mine/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/list-mine/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,QAK1B,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export const LIST_MY_LOTS_DESCRIPTION = [
|
|
2
2
|
'List the lots you have created, across all lifecycle states (optionally filtered by `state`). Requires a',
|
|
3
|
-
'session. Use this to find your lotIds and track
|
|
3
|
+
'session. Use this to find your lotIds and track listing and return progress. Evicted lots — thrown out of',
|
|
4
|
+
'their hub by its owner, still yours, unbuyable, and owing a return home — are included by default and can',
|
|
5
|
+
'be isolated with `state=evicted`.',
|
|
4
6
|
].join(' ');
|
|
5
7
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/list-mine/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACpC,0GAA0G;IAC1G,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/list-mine/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACpC,0GAA0G;IAC1G,2GAA2G;IAC3G,2GAA2G;IAC3G,mCAAmC;CACtC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const GET_LOT_TERMS_DESCRIPTION: string;
|
|
2
|
+
export declare const CAN_LIST_LINE = "You can list here now.";
|
|
3
|
+
export declare const CANNOT_LIST_LINE = "You cannot list here right now:";
|
|
4
|
+
export declare const NO_EVICTED_LINE = "No evicted remainders owed on this hub.";
|
|
5
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/lot-terms/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,QAQ3B,CAAC;AAEZ,eAAO,MAAM,aAAa,2BAA2B,CAAC;AAEtD,eAAO,MAAM,gBAAgB,oCAAoC,CAAC;AAElE,eAAO,MAAM,eAAe,4CAA4C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const GET_LOT_TERMS_DESCRIPTION = [
|
|
2
|
+
'Read the live terms for listing one resource on one Hub, before you spend anything (needs a session —',
|
|
3
|
+
'`cpu_authenticate` first). Returns the effective minimum and maximum units one new lot may hold there,',
|
|
4
|
+
'how many live lots you already hold for that Hub and resource against your limit (delivering, open and',
|
|
5
|
+
'evicted ones all count), how many evicted remainders you still owe a return on at that Hub, and a plain',
|
|
6
|
+
'`canList` verdict with the blockers behind it. Every number is read from the Trade contract itself for',
|
|
7
|
+
'this exact Hub and resource. `cpu_create_lot` checks the same terms again before it spends, so a listing',
|
|
8
|
+
'these terms refuse never costs you an approval or gas.',
|
|
9
|
+
].join(' ');
|
|
10
|
+
export const CAN_LIST_LINE = 'You can list here now.';
|
|
11
|
+
export const CANNOT_LIST_LINE = 'You cannot list here right now:';
|
|
12
|
+
export const NO_EVICTED_LINE = 'No evicted remainders owed on this hub.';
|
|
13
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/lot-terms/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACrC,uGAAuG;IACvG,wGAAwG;IACxG,wGAAwG;IACxG,yGAAyG;IACzG,wGAAwG;IACxG,0GAA0G;IAC1G,wDAAwD;CAC3D,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,aAAa,GAAG,wBAAwB,CAAC;AAEtD,MAAM,CAAC,MAAM,gBAAgB,GAAG,iCAAiC,CAAC;AAElE,MAAM,CAAC,MAAM,eAAe,GAAG,yCAAyC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/lot-terms/factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,CASpE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LotTermsService } from '../../../services/lot-terms.service.js';
|
|
2
|
+
import { TradeClient } from '../../../services/trade.client.js';
|
|
3
|
+
import { ContractClient } from '../../../wallet/contract-client.js';
|
|
4
|
+
export function createLotTermsService(context) {
|
|
5
|
+
const logger = context.logger.child('trade:lot-terms');
|
|
6
|
+
const contracts = new ContractClient({ wallet: context.wallet, logger: logger.child('contract'), retry: null });
|
|
7
|
+
return new LotTermsService({
|
|
8
|
+
appConfig: context.appConfig,
|
|
9
|
+
wallet: context.wallet,
|
|
10
|
+
tradeClient: new TradeClient({ contracts, logger: logger.child('client') }),
|
|
11
|
+
logger,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../src/tools/trade/lot-terms/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,MAAM,UAAU,qBAAqB,CAAC,OAAmB;IACrD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,IAAI,cAAc,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAChH,OAAO,IAAI,eAAe,CAAC;QACvB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,WAAW,EAAE,IAAI,WAAW,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3E,MAAM;KACT,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type LotTermsResult } from '../../../services/types.js';
|
|
2
|
+
import { type ResourceNames } from '../../../utils/format.utils.js';
|
|
3
|
+
export declare function summarizeLotTerms(terms: LotTermsResult, resources: ResourceNames): string;
|
|
4
|
+
//# sourceMappingURL=format.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.utils.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/lot-terms/format.utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAsBnF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAezF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CANNOT_LIST_LINE, CAN_LIST_LINE, NO_EVICTED_LINE } from './constants.js';
|
|
2
|
+
import { LotListingBlocker } from '../../../services/types.js';
|
|
3
|
+
import { resourceLabel } from '../../../utils/format.utils.js';
|
|
4
|
+
function describeBlocker(blocker, terms) {
|
|
5
|
+
switch (blocker) {
|
|
6
|
+
case LotListingBlocker.EvictedPending:
|
|
7
|
+
return (`${terms.outstandingEvictedCount} evicted remainder(s) of yours on this hub still owe a return ` +
|
|
8
|
+
`home — schedule each one and the hub takes your lots again, for every resource.`);
|
|
9
|
+
case LotListingBlocker.EmptyWindow:
|
|
10
|
+
return (`the hub has no room for a lot of this resource: its window runs from ${terms.effectiveMin} to ` +
|
|
11
|
+
`${terms.effectiveMax} units, so no amount fits — list elsewhere.`);
|
|
12
|
+
case LotListingBlocker.SellerLotLimit:
|
|
13
|
+
return (`you already hold ${terms.sellerLotCount} of ${terms.sellerLotLimit} live lots here — wait for ` +
|
|
14
|
+
`one to sell out, or return one remainder home.`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export function summarizeLotTerms(terms, resources) {
|
|
18
|
+
const header = `Hub ${terms.hubTokenId}, ${resourceLabel(resources, terms.resourceId)}: one new lot may hold ` +
|
|
19
|
+
`${terms.effectiveMin}–${terms.effectiveMax} units (read from the Trade contract for this hub and ` +
|
|
20
|
+
`resource). You hold ${terms.sellerLotCount} of ${terms.sellerLotLimit} live lots here — delivering, ` +
|
|
21
|
+
`open and evicted ones all count.`;
|
|
22
|
+
const evicted = terms.outstandingEvictedCount === 0
|
|
23
|
+
? NO_EVICTED_LINE
|
|
24
|
+
: `${terms.outstandingEvictedCount} evicted remainder(s) owed a return on this hub.`;
|
|
25
|
+
const verdict = terms.canList
|
|
26
|
+
? CAN_LIST_LINE
|
|
27
|
+
: [CANNOT_LIST_LINE, ...terms.blockers.map((blocker) => `- ${describeBlocker(blocker, terms)}`)].join('\n');
|
|
28
|
+
return `${header} ${evicted}\n${verdict}`;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=format.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.utils.js","sourceRoot":"","sources":["../../../../src/tools/trade/lot-terms/format.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAuB,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,aAAa,EAAsB,MAAM,gCAAgC,CAAC;AAEnF,SAAS,eAAe,CAAC,OAA0B,EAAE,KAAqB;IACtE,QAAQ,OAAO,EAAE,CAAC;QACd,KAAK,iBAAiB,CAAC,cAAc;YACjC,OAAO,CACH,GAAG,KAAK,CAAC,uBAAuB,gEAAgE;gBAChG,iFAAiF,CACpF,CAAC;QACN,KAAK,iBAAiB,CAAC,WAAW;YAC9B,OAAO,CACH,wEAAwE,KAAK,CAAC,YAAY,MAAM;gBAChG,GAAG,KAAK,CAAC,YAAY,6CAA6C,CACrE,CAAC;QACN,KAAK,iBAAiB,CAAC,cAAc;YACjC,OAAO,CACH,oBAAoB,KAAK,CAAC,cAAc,OAAO,KAAK,CAAC,cAAc,6BAA6B;gBAChG,gDAAgD,CACnD,CAAC;IACV,CAAC;AACL,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAqB,EAAE,SAAwB;IAC7E,MAAM,MAAM,GACR,OAAO,KAAK,CAAC,UAAU,KAAK,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC,yBAAyB;QAC/F,GAAG,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,YAAY,wDAAwD;QACnG,uBAAuB,KAAK,CAAC,cAAc,OAAO,KAAK,CAAC,cAAc,gCAAgC;QACtG,kCAAkC,CAAC;IACvC,MAAM,OAAO,GACT,KAAK,CAAC,uBAAuB,KAAK,CAAC;QAC/B,CAAC,CAAC,eAAe;QACjB,CAAC,CAAC,GAAG,KAAK,CAAC,uBAAuB,kDAAkD,CAAC;IAC7F,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO;QACzB,CAAC,CAAC,aAAa;QACf,CAAC,CAAC,CAAC,gBAAgB,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,eAAe,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEhH,OAAO,GAAG,MAAM,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ILotTerms } from '../../../services/lot-terms.types.js';
|
|
2
|
+
import type { AppContext } from '../../../types.js';
|
|
3
|
+
import type { ToolRegistrar } from '../../types.js';
|
|
4
|
+
export declare function registerGetLotTermsTool(server: ToolRegistrar, context: AppContext, injected?: ILotTerms | null): void;
|
|
5
|
+
//# sourceMappingURL=lot-terms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lot-terms.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/lot-terms/lot-terms.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,wBAAgB,uBAAuB,CACnC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,UAAU,EACnB,QAAQ,GAAE,SAAS,GAAG,IAAW,GAClC,IAAI,CAuBN"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GET_LOT_TERMS_DESCRIPTION } from './constants.js';
|
|
2
|
+
import { createLotTermsService } from './factory.js';
|
|
3
|
+
import { summarizeLotTerms } from './format.utils.js';
|
|
4
|
+
import { getLotTermsInputSchema } from './types.js';
|
|
5
|
+
export function registerGetLotTermsTool(server, context, injected = null) {
|
|
6
|
+
// Built on first use, not at registration: registering a tool must not reach for the wallet.
|
|
7
|
+
let lotTerms = injected;
|
|
8
|
+
const terms = () => (lotTerms ??= createLotTermsService(context));
|
|
9
|
+
server.registerTool('cpu_get_lot_terms', { description: GET_LOT_TERMS_DESCRIPTION, inputSchema: getLotTermsInputSchema }, async (args) => {
|
|
10
|
+
const live = await terms().getLotTerms({
|
|
11
|
+
hubTokenId: String(args.hubTokenId),
|
|
12
|
+
resourceId: args.resourceId,
|
|
13
|
+
});
|
|
14
|
+
const { resources } = await context.appConfig.load();
|
|
15
|
+
return {
|
|
16
|
+
content: [
|
|
17
|
+
{ type: 'text', text: summarizeLotTerms(live, resources) },
|
|
18
|
+
{ type: 'text', text: JSON.stringify(live) },
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=lot-terms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lot-terms.js","sourceRoot":"","sources":["../../../../src/tools/trade/lot-terms/lot-terms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MA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+1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { tokenIdSchema } from '../../../geometry/types.js';
|
|
3
|
+
export const getLotTermsInputSchema = {
|
|
4
|
+
hubTokenId: tokenIdSchema.describe('The Hub cell token id you want to list on.'),
|
|
5
|
+
resourceId: z.number().int().describe('Resource type id you want to list there.'),
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/tools/trade/lot-terms/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,UAAU,EAAE,aAAa,CAAC,QAAQ,CAAC,4CAA4C,CAAC;IAChF,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;CACpF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/market-index/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/market-index/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,QAY9B,CAAC"}
|
|
@@ -8,5 +8,7 @@ export const GET_MARKET_INDEX_DESCRIPTION = [
|
|
|
8
8
|
'This answers a different question than `cpu_get_markets` (the cheapest ask available right now, per hub):',
|
|
9
9
|
'that is what you could buy at this instant; this is what the world actually paid, on average, over the last',
|
|
10
10
|
'day. The two are never combined into one call — mixing them would read as one price when it is really two.',
|
|
11
|
+
'It aggregates settled trades, so a trade stays in the window no matter what became of its lot afterwards —',
|
|
12
|
+
'sold out, cancelled, or evicted by the hub owner. History here is never rewritten backwards.',
|
|
11
13
|
].join(' ');
|
|
12
14
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/market-index/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,4BAA4B,GAAG;IACxC,sGAAsG;IACtG,6GAA6G;IAC7G,uGAAuG;IACvG,oGAAoG;IACpG,4GAA4G;IAC5G,wCAAwC;IACxC,2GAA2G;IAC3G,6GAA6G;IAC7G,4GAA4G;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/market-index/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,4BAA4B,GAAG;IACxC,sGAAsG;IACtG,6GAA6G;IAC7G,uGAAuG;IACvG,oGAAoG;IACpG,4GAA4G;IAC5G,wCAAwC;IACxC,2GAA2G;IAC3G,6GAA6G;IAC7G,4GAA4G;IAC5G,4GAA4G;IAC5G,8FAA8F;CACjG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/markets/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/markets/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,QASzB,CAAC"}
|
|
@@ -4,7 +4,8 @@ export const GET_MARKETS_DESCRIPTION = [
|
|
|
4
4
|
'the local world map — advisory, may trail the chain; `null` when the rate is unknown, i.e. the map has no',
|
|
5
5
|
"read on the hub or it isn't serving sale fees yet). The",
|
|
6
6
|
'recommended first look at what is for sale and where — compare hubs by fee in one call, then drill into',
|
|
7
|
-
'specific lots with `cpu_list_lots`.
|
|
7
|
+
'specific lots with `cpu_list_lots`. Every bucket here counts offers — open, incoming or frozen; an evicted',
|
|
8
|
+
'lot is not for sale and is in none of them. Public read; supports hub / resourceId filters and an optional zone',
|
|
8
9
|
'(aroundTokenId + radius in grid steps).',
|
|
9
10
|
].join(' ');
|
|
10
11
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/markets/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACnC,qGAAqG;IACrG,6GAA6G;IAC7G,2GAA2G;IAC3G,yDAAyD;IACzD,yGAAyG;IACzG,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/markets/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACnC,qGAAqG;IACrG,6GAA6G;IAC7G,2GAA2G;IAC3G,yDAAyD;IACzD,yGAAyG;IACzG,4GAA4G;IAC5G,iHAAiH;IACjH,yCAAyC;CAC5C,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/quote-buy/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/quote-buy/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,QAcvB,CAAC"}
|
|
@@ -7,8 +7,10 @@ export const QUOTE_BUY_DESCRIPTION = [
|
|
|
7
7
|
'`transitFee`/`transitDiscount` and `arrivalAt` when routed, with `total` = the actual full debit. The hub',
|
|
8
8
|
'sale fee and burn come out of the seller proceeds, not on top. Because the quote runs the same checks as the',
|
|
9
9
|
'buy, a failed quote explains why the purchase would revert (lot closed, amount exceeds remaining, a',
|
|
10
|
-
'sale-fee-tolerance freeze, a
|
|
10
|
+
'sale-fee-tolerance freeze, a hub on the route that cannot serve as a live node right now — temporarily',
|
|
11
|
+
'unroutable, not frozen). It does NOT check pause, $CPU balance, or',
|
|
11
12
|
'allowance — a fill can still revert on those. `cpu_buy_lot` re-quotes transit on-chain and authorizes ~10%',
|
|
12
|
-
'over as headroom (a ceiling, not an extra charge). Use before `cpu_buy_lot`.',
|
|
13
|
+
'over as headroom (a ceiling, not an extra charge). Use before `cpu_buy_lot`. It re-reads the lot first and',
|
|
14
|
+
"refuses without quoting when it is not open — an evicted lot is the seller's to bring home, not yours to buy.",
|
|
13
15
|
].join(' ');
|
|
14
16
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/quote-buy/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,uGAAuG;IACvG,wGAAwG;IACxG,wGAAwG;IACxG,yGAAyG;IACzG,mGAAmG;IACnG,2GAA2G;IAC3G,8GAA8G;IAC9G,qGAAqG;IACrG,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/quote-buy/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,uGAAuG;IACvG,wGAAwG;IACxG,wGAAwG;IACxG,yGAAyG;IACzG,mGAAmG;IACnG,2GAA2G;IAC3G,8GAA8G;IAC9G,qGAAqG;IACrG,wGAAwG;IACxG,oEAAoE;IACpE,4GAA4G;IAC5G,4GAA4G;IAC5G,+GAA+G;CAClH,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote-buy.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/quote-buy/quote-buy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"quote-buy.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/quote-buy/quote-buy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI,CAqBrF"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { QUOTE_BUY_DESCRIPTION } from './constants.js';
|
|
2
|
+
import { requireOpenLot } from '../buyer-guard/lot-open.guard.js';
|
|
2
3
|
import { summarizeQuoteBuy } from '../format.utils.js';
|
|
3
4
|
import { quoteBuyInputSchema } from '../types.js';
|
|
4
5
|
export function registerQuoteBuyTool(server, context) {
|
|
5
6
|
server.registerTool('cpu_quote_buy', { description: QUOTE_BUY_DESCRIPTION, inputSchema: quoteBuyInputSchema }, async (args) => {
|
|
7
|
+
await requireOpenLot(context.trade, args.lotId);
|
|
6
8
|
const quote = await context.trade.quoteBuy({
|
|
7
9
|
lotId: args.lotId,
|
|
8
10
|
value: args.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote-buy.js","sourceRoot":"","sources":["../../../../src/tools/trade/quote-buy/quote-buy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,UAAU,oBAAoB,CAAC,MAAqB,EAAE,OAAmB;IAC3E,MAAM,CAAC,YAAY,CACf,eAAe,EACf,EAAE,WAAW,EAAE,qBAAqB,EA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C,QAAQ,CAAC;YACvC,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,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE;gBAC3D,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;aAChD;SACJ,CAAC;IACN,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/quote-lot-return/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,QAS9B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const QUOTE_LOT_RETURN_DESCRIPTION = [
|
|
2
|
+
'Preview sending one of your lots home — the whole unsold remainder, from its hub to a cell you own —',
|
|
3
|
+
'without spending anything. Requires a session. Works on an OPEN lot and on an EVICTED one. Pass',
|
|
4
|
+
'chain = [hub, ...waypoints, your destination cell] for the whole route (required). Answers with the exact',
|
|
5
|
+
'remainder, the destination, the transit fee and syndicate discount, the total distance, the arrival time,',
|
|
6
|
+
'and whether the destination can still take the whole remainder right now. The fee it names is the ceiling',
|
|
7
|
+
'to hand `cpu_return_lot` as its `maxTransitFeeWei`: that call re-prices the route and refuses rather than',
|
|
8
|
+
'pay above the figure you pass it, so run this immediately before the return and pass the wei field back',
|
|
9
|
+
'unchanged.',
|
|
10
|
+
].join(' ');
|
|
11
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/tools/trade/quote-lot-return/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,4BAA4B,GAAG;IACxC,sGAAsG;IACtG,iGAAiG;IACjG,2GAA2G;IAC3G,2GAA2G;IAC3G,2GAA2G;IAC3G,2GAA2G;IAC3G,yGAAyG;IACzG,YAAY;CACf,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ILotReturnService } from '../../../services/lot-return.types.js';
|
|
2
|
+
import type { AppContext } from '../../../types.js';
|
|
3
|
+
import type { ToolRegistrar } from '../../types.js';
|
|
4
|
+
export declare function registerQuoteLotReturnTool(server: ToolRegistrar, context: AppContext, service?: Pick<ILotReturnService, 'quoteReturn'> | null): void;
|
|
5
|
+
//# sourceMappingURL=quote-lot-return.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote-lot-return.d.ts","sourceRoot":"","sources":["../../../../src/tools/trade/quote-lot-return/quote-lot-return.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD,wBAAgB,0BAA0B,CACtC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,UAAU,EACnB,OAAO,GAAE,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,GAAG,IAAW,GAC9D,IAAI,CAoBN"}
|