dexbot 1.4.12 → 1.4.13
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 +15 -11
- package/claw/data/positions.json +144646 -0
- package/claw/docs/AI_BOT_LIBRARY_API.md +632 -0
- package/claw/docs/DEXBOT2_TUNING_CHEAT_SHEET.md +243 -0
- package/claw/docs/POSITION_HEALTH.md +117 -0
- package/claw/docs/RUNTIME_COMPARISON.md +256 -0
- package/claw/ecosystem.config.cjs +29 -0
- package/claw/examples/claw_consumer_example.ts +54 -0
- package/claw/examples/claw_infra_example.ts +53 -0
- package/claw/examples/claw_profiles_example.ts +44 -0
- package/claw/examples/connection_test.ts +40 -0
- package/claw/examples/honest_ecosystem_example.ts +35 -0
- package/claw/examples/memu_integration_example.ts +92 -0
- package/claw/examples/position_manager_cli.ts +129 -0
- package/claw/examples/short_mpa_bts_strategy.ts +127 -0
- package/claw/examples/tsconfig.json +28 -0
- package/claw/index.ts +64 -0
- package/claw/modules/bitshares_client.ts +97 -0
- package/claw/modules/chain_actions.ts +352 -0
- package/claw/modules/chain_broadcast.ts +353 -0
- package/claw/modules/chain_queries.ts +157 -0
- package/claw/modules/claw_bridge.ts +423 -0
- package/claw/modules/claw_catalog.ts +804 -0
- package/claw/modules/claw_infra.ts +326 -0
- package/claw/modules/claw_launcher.ts +452 -0
- package/claw/modules/claw_manifest.ts +55 -0
- package/claw/modules/claw_runtime_matrix.ts +104 -0
- package/claw/modules/claw_skill_md.ts +313 -0
- package/claw/modules/credit_runtime_adapter.ts +144 -0
- package/claw/modules/decision_loop.ts +184 -0
- package/claw/modules/dexbot_bridge.ts +82 -0
- package/claw/modules/dexbot_credential_client.ts +55 -0
- package/claw/modules/dexbot_profiles.ts +1340 -0
- package/claw/modules/feed_price_source.ts +134 -0
- package/claw/modules/honest_ecosystem.ts +337 -0
- package/claw/modules/kibana_price_source.ts +133 -0
- package/claw/modules/launcher_mode_detector.ts +192 -0
- package/claw/modules/launcher_paths.ts +69 -0
- package/claw/modules/liquidity_pools.ts +51 -0
- package/claw/modules/mcp_utils.ts +108 -0
- package/claw/modules/memu_bridge.ts +505 -0
- package/claw/modules/mpa_utils.ts +31 -0
- package/claw/modules/position_discovery.ts +163 -0
- package/claw/modules/position_health.ts +360 -0
- package/claw/modules/position_manager.ts +730 -0
- package/claw/modules/position_manager_watch.ts +252 -0
- package/claw/modules/short_mpa_strategy.ts +185 -0
- package/claw/modules/skill_utils.ts +74 -0
- package/claw/modules/types.ts +225 -0
- package/claw/modules/utils.ts +9 -0
- package/claw/node_modules/.package-lock.json +935 -0
- package/claw/node_modules/@babel/runtime/LICENSE +22 -0
- package/claw/node_modules/@babel/runtime/README.md +19 -0
- package/claw/node_modules/@babel/runtime/helpers/AwaitValue.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/OverloadYield.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js +9 -0
- package/claw/node_modules/@babel/runtime/helpers/applyDecs.js +236 -0
- package/claw/node_modules/@babel/runtime/helpers/applyDecs2203.js +184 -0
- package/claw/node_modules/@babel/runtime/helpers/applyDecs2203R.js +191 -0
- package/claw/node_modules/@babel/runtime/helpers/applyDecs2301.js +222 -0
- package/claw/node_modules/@babel/runtime/helpers/applyDecs2305.js +133 -0
- package/claw/node_modules/@babel/runtime/helpers/applyDecs2311.js +124 -0
- package/claw/node_modules/@babel/runtime/helpers/arrayLikeToArray.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/arrayWithHoles.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/assertClassBrand.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/assertThisInitialized.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js +24 -0
- package/claw/node_modules/@babel/runtime/helpers/asyncIterator.js +45 -0
- package/claw/node_modules/@babel/runtime/helpers/asyncToGenerator.js +26 -0
- package/claw/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/callSuper.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/checkInRHS.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/checkPrivateRedeclaration.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/classApplyDescriptorDestructureSet.js +10 -0
- package/claw/node_modules/@babel/runtime/helpers/classApplyDescriptorGet.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/classApplyDescriptorSet.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/classCallCheck.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/classCheckPrivateStaticAccess.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/classExtractFieldDescriptor.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/classNameTDZError.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/classPrivateFieldDestructureSet.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/classPrivateFieldGet2.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/classPrivateFieldInitSpec.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/classPrivateFieldSet2.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/classPrivateGetter.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/classPrivateMethodInitSpec.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/classPrivateSetter.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/classStaticPrivateFieldDestructureSet.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/construct.js +10 -0
- package/claw/node_modules/@babel/runtime/helpers/createClass.js +13 -0
- package/claw/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js +50 -0
- package/claw/node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js +19 -0
- package/claw/node_modules/@babel/runtime/helpers/createSuper.js +16 -0
- package/claw/node_modules/@babel/runtime/helpers/decorate.js +250 -0
- package/claw/node_modules/@babel/runtime/helpers/defaults.js +9 -0
- package/claw/node_modules/@babel/runtime/helpers/defineAccessor.js +8 -0
- package/claw/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js +12 -0
- package/claw/node_modules/@babel/runtime/helpers/defineProperty.js +10 -0
- package/claw/node_modules/@babel/runtime/helpers/dispose.js +28 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/AwaitValue.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/OverloadYield.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js +9 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/applyDecs.js +236 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/applyDecs2203.js +184 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/applyDecs2203R.js +191 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/applyDecs2301.js +222 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/applyDecs2305.js +133 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/applyDecs2311.js +124 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/assertClassBrand.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js +24 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/asyncIterator.js +45 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js +26 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/callSuper.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/checkInRHS.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorDestructureSet.js +10 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorGet.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorSet.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticAccess.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticFieldDescriptor.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classExtractFieldDescriptor.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet2.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet2.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateGetter.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classPrivateSetter.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldDestructureSet.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/construct.js +10 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/createClass.js +13 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js +50 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelperLoose.js +19 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/createSuper.js +16 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/decorate.js +250 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/defaults.js +9 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/defineAccessor.js +8 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js +12 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/defineProperty.js +10 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/dispose.js +28 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/extends.js +10 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/get.js +11 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/identity.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/importDeferProxy.js +27 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/inherits.js +14 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js +9 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/instanceof.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js +22 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js +8 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +9 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +28 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/jsx.js +22 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/maybeArrayLike.js +9 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/nullishReceiverError.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/objectSpread.js +14 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +23 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +13 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +10 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/package.json +3 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +8 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/readOnlyError.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/regenerator.js +89 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/regeneratorAsync.js +8 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/regeneratorAsyncGen.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/regeneratorAsyncIterator.js +33 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/regeneratorDefine.js +22 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/regeneratorKeys.js +10 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js +77 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/regeneratorValues.js +19 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/set.js +22 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/setFunctionName.js +12 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +8 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/superPropBase.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/superPropGet.js +9 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/superPropSet.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js +8 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/tdz.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/temporalRef.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js +2 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/toArray.js +8 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +8 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +12 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/toSetter.js +10 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/tsRewriteRelativeImportExtensions.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/typeof.js +10 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +9 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/using.js +12 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/usingCtx.js +59 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js +56 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js +27 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js +52 -0
- package/claw/node_modules/@babel/runtime/helpers/esm/writeOnlyError.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/extends.js +10 -0
- package/claw/node_modules/@babel/runtime/helpers/get.js +11 -0
- package/claw/node_modules/@babel/runtime/helpers/getPrototypeOf.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/identity.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/importDeferProxy.js +27 -0
- package/claw/node_modules/@babel/runtime/helpers/inherits.js +14 -0
- package/claw/node_modules/@babel/runtime/helpers/inheritsLoose.js +5 -0
- package/claw/node_modules/@babel/runtime/helpers/initializerDefineProperty.js +9 -0
- package/claw/node_modules/@babel/runtime/helpers/initializerWarningHelper.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/instanceof.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/interopRequireDefault.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/interopRequireWildcard.js +22 -0
- package/claw/node_modules/@babel/runtime/helpers/isNativeFunction.js +8 -0
- package/claw/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js +9 -0
- package/claw/node_modules/@babel/runtime/helpers/iterableToArray.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js +28 -0
- package/claw/node_modules/@babel/runtime/helpers/jsx.js +22 -0
- package/claw/node_modules/@babel/runtime/helpers/maybeArrayLike.js +9 -0
- package/claw/node_modules/@babel/runtime/helpers/newArrowCheck.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/nonIterableRest.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/nonIterableSpread.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/nullishReceiverError.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/objectSpread.js +14 -0
- package/claw/node_modules/@babel/runtime/helpers/objectSpread2.js +23 -0
- package/claw/node_modules/@babel/runtime/helpers/objectWithoutProperties.js +13 -0
- package/claw/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +10 -0
- package/claw/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js +8 -0
- package/claw/node_modules/@babel/runtime/helpers/readOnlyError.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/regenerator.js +89 -0
- package/claw/node_modules/@babel/runtime/helpers/regeneratorAsync.js +8 -0
- package/claw/node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js +33 -0
- package/claw/node_modules/@babel/runtime/helpers/regeneratorDefine.js +22 -0
- package/claw/node_modules/@babel/runtime/helpers/regeneratorKeys.js +10 -0
- package/claw/node_modules/@babel/runtime/helpers/regeneratorRuntime.js +77 -0
- package/claw/node_modules/@babel/runtime/helpers/regeneratorValues.js +19 -0
- package/claw/node_modules/@babel/runtime/helpers/set.js +22 -0
- package/claw/node_modules/@babel/runtime/helpers/setFunctionName.js +12 -0
- package/claw/node_modules/@babel/runtime/helpers/setPrototypeOf.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/slicedToArray.js +8 -0
- package/claw/node_modules/@babel/runtime/helpers/superPropBase.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/superPropGet.js +9 -0
- package/claw/node_modules/@babel/runtime/helpers/superPropSet.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js +8 -0
- package/claw/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/tdz.js +4 -0
- package/claw/node_modules/@babel/runtime/helpers/temporalRef.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/temporalUndefined.js +2 -0
- package/claw/node_modules/@babel/runtime/helpers/toArray.js +8 -0
- package/claw/node_modules/@babel/runtime/helpers/toConsumableArray.js +8 -0
- package/claw/node_modules/@babel/runtime/helpers/toPrimitive.js +12 -0
- package/claw/node_modules/@babel/runtime/helpers/toPropertyKey.js +7 -0
- package/claw/node_modules/@babel/runtime/helpers/toSetter.js +10 -0
- package/claw/node_modules/@babel/runtime/helpers/tsRewriteRelativeImportExtensions.js +6 -0
- package/claw/node_modules/@babel/runtime/helpers/typeof.js +10 -0
- package/claw/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js +9 -0
- package/claw/node_modules/@babel/runtime/helpers/using.js +12 -0
- package/claw/node_modules/@babel/runtime/helpers/usingCtx.js +59 -0
- package/claw/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js +56 -0
- package/claw/node_modules/@babel/runtime/helpers/wrapNativeSuper.js +27 -0
- package/claw/node_modules/@babel/runtime/helpers/wrapRegExp.js +52 -0
- package/claw/node_modules/@babel/runtime/helpers/writeOnlyError.js +4 -0
- package/claw/node_modules/@babel/runtime/package.json +1107 -0
- package/claw/node_modules/@babel/runtime/regenerator/index.js +15 -0
- package/claw/node_modules/assert/.github/FUNDING.yml +12 -0
- package/claw/node_modules/assert/.github/SECURITY.md +10 -0
- package/claw/node_modules/assert/.travis.yml +30 -0
- package/claw/node_modules/assert/.zuul.yml +13 -0
- package/claw/node_modules/assert/CHANGELOG.md +11 -0
- package/claw/node_modules/assert/LICENSE +18 -0
- package/claw/node_modules/assert/README.md +105 -0
- package/claw/node_modules/assert/assert.js +506 -0
- package/claw/node_modules/assert/package.json +32 -0
- package/claw/node_modules/assert/test.js +360 -0
- package/claw/node_modules/async-limiter/.eslintignore +2 -0
- package/claw/node_modules/async-limiter/.nycrc +10 -0
- package/claw/node_modules/async-limiter/.travis.yml +9 -0
- package/claw/node_modules/async-limiter/LICENSE +8 -0
- package/claw/node_modules/async-limiter/index.js +67 -0
- package/claw/node_modules/async-limiter/package.json +35 -0
- package/claw/node_modules/async-limiter/readme.md +132 -0
- package/claw/node_modules/available-typed-arrays/.eslintrc +5 -0
- package/claw/node_modules/available-typed-arrays/.github/FUNDING.yml +12 -0
- package/claw/node_modules/available-typed-arrays/.nycrc +9 -0
- package/claw/node_modules/available-typed-arrays/CHANGELOG.md +100 -0
- package/claw/node_modules/available-typed-arrays/LICENSE +21 -0
- package/claw/node_modules/available-typed-arrays/README.md +55 -0
- package/claw/node_modules/available-typed-arrays/index.d.ts +8 -0
- package/claw/node_modules/available-typed-arrays/index.js +17 -0
- package/claw/node_modules/available-typed-arrays/package.json +93 -0
- package/claw/node_modules/available-typed-arrays/test/index.js +18 -0
- package/claw/node_modules/available-typed-arrays/tsconfig.json +49 -0
- package/claw/node_modules/base-x/LICENSE.md +22 -0
- package/claw/node_modules/base-x/README.md +67 -0
- package/claw/node_modules/base-x/package.json +49 -0
- package/claw/node_modules/base-x/src/index.d.ts +10 -0
- package/claw/node_modules/base-x/src/index.js +123 -0
- package/claw/node_modules/bigi/CHANGELOG.md +85 -0
- package/claw/node_modules/bigi/LICENSE.md +30 -0
- package/claw/node_modules/bigi/README.md +14 -0
- package/claw/node_modules/bigi/lib/bigi.js +1509 -0
- package/claw/node_modules/bigi/lib/convert.js +91 -0
- package/claw/node_modules/bigi/lib/index.js +6 -0
- package/claw/node_modules/bigi/package.json +55 -0
- package/claw/node_modules/bignumber.js/CHANGELOG.md +222 -0
- package/claw/node_modules/bignumber.js/LICENCE +23 -0
- package/claw/node_modules/bignumber.js/README.md +266 -0
- package/claw/node_modules/bignumber.js/bignumber.d.ts +1797 -0
- package/claw/node_modules/bignumber.js/bignumber.js +2814 -0
- package/claw/node_modules/bignumber.js/bignumber.js.map +1 -0
- package/claw/node_modules/bignumber.js/bignumber.min.js +3 -0
- package/claw/node_modules/bignumber.js/bignumber.mjs +2793 -0
- package/claw/node_modules/bignumber.js/bower.json +36 -0
- package/claw/node_modules/bignumber.js/doc/API.html +2118 -0
- package/claw/node_modules/bignumber.js/package.json +39 -0
- package/claw/node_modules/bs58/CHANGELOG.md +61 -0
- package/claw/node_modules/bs58/README.md +71 -0
- package/claw/node_modules/bs58/index.js +4 -0
- package/claw/node_modules/bs58/package.json +37 -0
- package/claw/node_modules/btsdex/.babelrc +17 -0
- package/claw/node_modules/btsdex/.github/workflows/check-style.yml +16 -0
- package/claw/node_modules/btsdex/LICENSE +21 -0
- package/claw/node_modules/btsdex/README.md +467 -0
- package/claw/node_modules/btsdex/cli.js +165 -0
- package/claw/node_modules/btsdex/lib/account.js +60 -0
- package/claw/node_modules/btsdex/lib/asset.js +78 -0
- package/claw/node_modules/btsdex/lib/bitshares.js +363 -0
- package/claw/node_modules/btsdex/lib/event.js +137 -0
- package/claw/node_modules/btsdex/lib/fees.js +34 -0
- package/claw/node_modules/btsdex/lib/index.js +3 -0
- package/claw/node_modules/btsdex/lib/transaction/TransactionBuilder.js +797 -0
- package/claw/node_modules/btsdex/lib/transaction/index.js +64 -0
- package/claw/node_modules/btsdex/package.json +54 -0
- package/claw/node_modules/btsdex/yarn-error.log +3483 -0
- package/claw/node_modules/btsdex-api/.babelrc +14 -0
- package/claw/node_modules/btsdex-api/README.md +3 -0
- package/claw/node_modules/btsdex-api/lib/apis.js +59 -0
- package/claw/node_modules/btsdex-api/lib/config.js +39 -0
- package/claw/node_modules/btsdex-api/lib/connection.js +188 -0
- package/claw/node_modules/btsdex-api/lib/index.js +86 -0
- package/claw/node_modules/btsdex-api/lib/logger.js +45 -0
- package/claw/node_modules/btsdex-api/lib/servers.js +30 -0
- package/claw/node_modules/btsdex-api/package.json +29 -0
- package/claw/node_modules/btsdex-ecc/.babelrc +13 -0
- package/claw/node_modules/btsdex-ecc/lib/BrainKey.js +15 -0
- package/claw/node_modules/btsdex-ecc/lib/KeyUtils.js +205 -0
- package/claw/node_modules/btsdex-ecc/lib/PrivateKey.js +198 -0
- package/claw/node_modules/btsdex-ecc/lib/PublicKey.js +197 -0
- package/claw/node_modules/btsdex-ecc/lib/address.js +84 -0
- package/claw/node_modules/btsdex-ecc/lib/addressPrefix.js +15 -0
- package/claw/node_modules/btsdex-ecc/lib/aes.js +294 -0
- package/claw/node_modules/btsdex-ecc/lib/ecdsa.js +194 -0
- package/claw/node_modules/btsdex-ecc/lib/ecsignature.js +131 -0
- package/claw/node_modules/btsdex-ecc/lib/enforce_types.js +54 -0
- package/claw/node_modules/btsdex-ecc/lib/hash.js +60 -0
- package/claw/node_modules/btsdex-ecc/lib/index.js +84 -0
- package/claw/node_modules/btsdex-ecc/lib/signature.js +185 -0
- package/claw/node_modules/btsdex-ecc/package.json +37 -0
- package/claw/node_modules/btsdex-serializer/.babelrc +13 -0
- package/claw/node_modules/btsdex-serializer/lib/ChainTypes.js +154 -0
- package/claw/node_modules/btsdex-serializer/lib/FastParser.js +75 -0
- package/claw/node_modules/btsdex-serializer/lib/ObjectId.js +65 -0
- package/claw/node_modules/btsdex-serializer/lib/SerializerValidation.js +377 -0
- package/claw/node_modules/btsdex-serializer/lib/convert.js +54 -0
- package/claw/node_modules/btsdex-serializer/lib/error_with_cause.js +43 -0
- package/claw/node_modules/btsdex-serializer/lib/index.js +72 -0
- package/claw/node_modules/btsdex-serializer/lib/operations.js +1359 -0
- package/claw/node_modules/btsdex-serializer/lib/precision.js +108 -0
- package/claw/node_modules/btsdex-serializer/lib/serializer.js +205 -0
- package/claw/node_modules/btsdex-serializer/lib/template.js +23 -0
- package/claw/node_modules/btsdex-serializer/lib/types.js +1209 -0
- package/claw/node_modules/btsdex-serializer/package-lock.json +238 -0
- package/claw/node_modules/btsdex-serializer/package.json +32 -0
- package/claw/node_modules/bytebuffer/.travis.yml +5 -0
- package/claw/node_modules/bytebuffer/LICENSE +202 -0
- package/claw/node_modules/bytebuffer/README.md +64 -0
- package/claw/node_modules/bytebuffer/bower.json +12 -0
- package/claw/node_modules/bytebuffer/bytebuffer.png +0 -0
- package/claw/node_modules/bytebuffer/dist/README.md +47 -0
- package/claw/node_modules/bytebuffer/dist/bytebuffer-dataview.js +3461 -0
- package/claw/node_modules/bytebuffer/dist/bytebuffer-dataview.min.js +88 -0
- package/claw/node_modules/bytebuffer/dist/bytebuffer-dataview.min.js.gz +0 -0
- package/claw/node_modules/bytebuffer/dist/bytebuffer-dataview.min.map +8 -0
- package/claw/node_modules/bytebuffer/dist/bytebuffer-node.js +3454 -0
- package/claw/node_modules/bytebuffer/dist/bytebuffer.js +3746 -0
- package/claw/node_modules/bytebuffer/dist/bytebuffer.min.js +93 -0
- package/claw/node_modules/bytebuffer/dist/bytebuffer.min.js.gz +0 -0
- package/claw/node_modules/bytebuffer/dist/bytebuffer.min.map +8 -0
- package/claw/node_modules/bytebuffer/donate.png +0 -0
- package/claw/node_modules/bytebuffer/externs/bytebuffer.js +862 -0
- package/claw/node_modules/bytebuffer/externs/minimal-env.js +52 -0
- package/claw/node_modules/bytebuffer/index.js +1 -0
- package/claw/node_modules/bytebuffer/jsdoc.json +13 -0
- package/claw/node_modules/bytebuffer/package.json +51 -0
- package/claw/node_modules/bytebuffer/scripts/build.js +113 -0
- package/claw/node_modules/bytebuffer/src/bower.json +12 -0
- package/claw/node_modules/bytebuffer/src/bytebuffer.js +220 -0
- package/claw/node_modules/bytebuffer/src/encodings/base64.js +88 -0
- package/claw/node_modules/bytebuffer/src/encodings/binary.js +74 -0
- package/claw/node_modules/bytebuffer/src/encodings/debug.js +211 -0
- package/claw/node_modules/bytebuffer/src/encodings/hex.js +75 -0
- package/claw/node_modules/bytebuffer/src/encodings/impl/base64.js +3 -0
- package/claw/node_modules/bytebuffer/src/encodings/impl/binary.js +65 -0
- package/claw/node_modules/bytebuffer/src/encodings/impl/debug.js +3 -0
- package/claw/node_modules/bytebuffer/src/encodings/impl/hex.js +101 -0
- package/claw/node_modules/bytebuffer/src/encodings/impl/utf8.js +126 -0
- package/claw/node_modules/bytebuffer/src/encodings/utf8.js +71 -0
- package/claw/node_modules/bytebuffer/src/helpers.js +143 -0
- package/claw/node_modules/bytebuffer/src/macros.js +222 -0
- package/claw/node_modules/bytebuffer/src/methods/append.js +58 -0
- package/claw/node_modules/bytebuffer/src/methods/assert.js +12 -0
- package/claw/node_modules/bytebuffer/src/methods/capacity.js +8 -0
- package/claw/node_modules/bytebuffer/src/methods/clear.js +13 -0
- package/claw/node_modules/bytebuffer/src/methods/clone.js +34 -0
- package/claw/node_modules/bytebuffer/src/methods/compact.js +49 -0
- package/claw/node_modules/bytebuffer/src/methods/copy.js +73 -0
- package/claw/node_modules/bytebuffer/src/methods/ensureCapacity.js +15 -0
- package/claw/node_modules/bytebuffer/src/methods/fill.js +35 -0
- package/claw/node_modules/bytebuffer/src/methods/flip.js +11 -0
- package/claw/node_modules/bytebuffer/src/methods/mark.js +17 -0
- package/claw/node_modules/bytebuffer/src/methods/order.js +36 -0
- package/claw/node_modules/bytebuffer/src/methods/prepend.js +87 -0
- package/claw/node_modules/bytebuffer/src/methods/printDebug.js +16 -0
- package/claw/node_modules/bytebuffer/src/methods/remaining.js +9 -0
- package/claw/node_modules/bytebuffer/src/methods/reset.js +17 -0
- package/claw/node_modules/bytebuffer/src/methods/resize.js +39 -0
- package/claw/node_modules/bytebuffer/src/methods/reverse.js +25 -0
- package/claw/node_modules/bytebuffer/src/methods/skip.js +19 -0
- package/claw/node_modules/bytebuffer/src/methods/slice.js +18 -0
- package/claw/node_modules/bytebuffer/src/methods/static/accessor.js +13 -0
- package/claw/node_modules/bytebuffer/src/methods/static/allocate.js +14 -0
- package/claw/node_modules/bytebuffer/src/methods/static/concat.js +55 -0
- package/claw/node_modules/bytebuffer/src/methods/static/isByteBuffer.js +9 -0
- package/claw/node_modules/bytebuffer/src/methods/static/type.js +11 -0
- package/claw/node_modules/bytebuffer/src/methods/static/wrap.js +125 -0
- package/claw/node_modules/bytebuffer/src/methods/toBuffer.js +77 -0
- package/claw/node_modules/bytebuffer/src/methods/toString.js +43 -0
- package/claw/node_modules/bytebuffer/src/types/bytes/bitset.js +89 -0
- package/claw/node_modules/bytebuffer/src/types/bytes/bytes.js +34 -0
- package/claw/node_modules/bytebuffer/src/types/floats/float32.js +81 -0
- package/claw/node_modules/bytebuffer/src/types/floats/float64.js +77 -0
- package/claw/node_modules/bytebuffer/src/types/floats/ieee754.js +130 -0
- package/claw/node_modules/bytebuffer/src/types/ints/int16.js +167 -0
- package/claw/node_modules/bytebuffer/src/types/ints/int32.js +125 -0
- package/claw/node_modules/bytebuffer/src/types/ints/int64.js +194 -0
- package/claw/node_modules/bytebuffer/src/types/ints/int8.js +137 -0
- package/claw/node_modules/bytebuffer/src/types/strings/cstring.js +110 -0
- package/claw/node_modules/bytebuffer/src/types/strings/istring.js +81 -0
- package/claw/node_modules/bytebuffer/src/types/strings/utf8string.js +214 -0
- package/claw/node_modules/bytebuffer/src/types/strings/vstring.js +78 -0
- package/claw/node_modules/bytebuffer/src/types/varints/varint32.js +164 -0
- package/claw/node_modules/bytebuffer/src/types/varints/varint64.js +208 -0
- package/claw/node_modules/bytebuffer/src/wrap-node.js +50 -0
- package/claw/node_modules/bytebuffer/src/wrap.js +43 -0
- package/claw/node_modules/bytebuffer/tests/bench.js +99 -0
- package/claw/node_modules/bytebuffer/tests/suite.js +1005 -0
- package/claw/node_modules/call-bind/.eslintignore +1 -0
- package/claw/node_modules/call-bind/.eslintrc +16 -0
- package/claw/node_modules/call-bind/.github/FUNDING.yml +12 -0
- package/claw/node_modules/call-bind/.nycrc +9 -0
- package/claw/node_modules/call-bind/CHANGELOG.md +106 -0
- package/claw/node_modules/call-bind/LICENSE +21 -0
- package/claw/node_modules/call-bind/README.md +64 -0
- package/claw/node_modules/call-bind/callBound.js +15 -0
- package/claw/node_modules/call-bind/index.js +24 -0
- package/claw/node_modules/call-bind/package.json +93 -0
- package/claw/node_modules/call-bind/test/callBound.js +54 -0
- package/claw/node_modules/call-bind/test/index.js +74 -0
- package/claw/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
- package/claw/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- package/claw/node_modules/call-bind-apply-helpers/.nycrc +9 -0
- package/claw/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
- package/claw/node_modules/call-bind-apply-helpers/LICENSE +21 -0
- package/claw/node_modules/call-bind-apply-helpers/README.md +62 -0
- package/claw/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- package/claw/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/claw/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- package/claw/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/claw/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- package/claw/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/claw/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- package/claw/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/claw/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
- package/claw/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/claw/node_modules/call-bind-apply-helpers/package.json +85 -0
- package/claw/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- package/claw/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/claw/node_modules/call-bind-apply-helpers/test/index.js +63 -0
- package/claw/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- package/claw/node_modules/call-bound/.eslintrc +13 -0
- package/claw/node_modules/call-bound/.github/FUNDING.yml +12 -0
- package/claw/node_modules/call-bound/.nycrc +9 -0
- package/claw/node_modules/call-bound/CHANGELOG.md +42 -0
- package/claw/node_modules/call-bound/LICENSE +21 -0
- package/claw/node_modules/call-bound/README.md +53 -0
- package/claw/node_modules/call-bound/index.d.ts +94 -0
- package/claw/node_modules/call-bound/index.js +19 -0
- package/claw/node_modules/call-bound/package.json +99 -0
- package/claw/node_modules/call-bound/test/index.js +61 -0
- package/claw/node_modules/call-bound/tsconfig.json +10 -0
- package/claw/node_modules/cipher-base/.eslintrc +26 -0
- package/claw/node_modules/cipher-base/.github/FUNDING.yml +12 -0
- package/claw/node_modules/cipher-base/CHANGELOG.md +73 -0
- package/claw/node_modules/cipher-base/LICENSE +21 -0
- package/claw/node_modules/cipher-base/README.md +17 -0
- package/claw/node_modules/cipher-base/index.js +103 -0
- package/claw/node_modules/cipher-base/package.json +63 -0
- package/claw/node_modules/cipher-base/test/index.js +221 -0
- package/claw/node_modules/core-util-is/LICENSE +19 -0
- package/claw/node_modules/core-util-is/README.md +3 -0
- package/claw/node_modules/core-util-is/lib/util.js +107 -0
- package/claw/node_modules/core-util-is/package.json +38 -0
- package/claw/node_modules/create-hash/.travis.yml +17 -0
- package/claw/node_modules/create-hash/LICENSE +21 -0
- package/claw/node_modules/create-hash/README.md +19 -0
- package/claw/node_modules/create-hash/browser.js +30 -0
- package/claw/node_modules/create-hash/index.js +1 -0
- package/claw/node_modules/create-hash/md5.js +5 -0
- package/claw/node_modules/create-hash/package.json +39 -0
- package/claw/node_modules/create-hash/test.js +41 -0
- package/claw/node_modules/create-hmac/LICENSE +21 -0
- package/claw/node_modules/create-hmac/README.md +20 -0
- package/claw/node_modules/create-hmac/browser.js +62 -0
- package/claw/node_modules/create-hmac/index.js +1 -0
- package/claw/node_modules/create-hmac/legacy.js +46 -0
- package/claw/node_modules/create-hmac/package.json +45 -0
- package/claw/node_modules/crypto-js/CONTRIBUTING.md +28 -0
- package/claw/node_modules/crypto-js/LICENSE +24 -0
- package/claw/node_modules/crypto-js/README.md +241 -0
- package/claw/node_modules/crypto-js/aes.js +232 -0
- package/claw/node_modules/crypto-js/bower.json +35 -0
- package/claw/node_modules/crypto-js/cipher-core.js +880 -0
- package/claw/node_modules/crypto-js/core.js +760 -0
- package/claw/node_modules/crypto-js/crypto-js.js +5988 -0
- package/claw/node_modules/crypto-js/docs/QuickStartGuide.wiki +470 -0
- package/claw/node_modules/crypto-js/enc-base64.js +135 -0
- package/claw/node_modules/crypto-js/enc-hex.js +18 -0
- package/claw/node_modules/crypto-js/enc-latin1.js +18 -0
- package/claw/node_modules/crypto-js/enc-utf16.js +149 -0
- package/claw/node_modules/crypto-js/enc-utf8.js +18 -0
- package/claw/node_modules/crypto-js/evpkdf.js +132 -0
- package/claw/node_modules/crypto-js/format-hex.js +66 -0
- package/claw/node_modules/crypto-js/format-openssl.js +18 -0
- package/claw/node_modules/crypto-js/hmac-md5.js +18 -0
- package/claw/node_modules/crypto-js/hmac-ripemd160.js +18 -0
- package/claw/node_modules/crypto-js/hmac-sha1.js +18 -0
- package/claw/node_modules/crypto-js/hmac-sha224.js +18 -0
- package/claw/node_modules/crypto-js/hmac-sha256.js +18 -0
- package/claw/node_modules/crypto-js/hmac-sha3.js +18 -0
- package/claw/node_modules/crypto-js/hmac-sha384.js +18 -0
- package/claw/node_modules/crypto-js/hmac-sha512.js +18 -0
- package/claw/node_modules/crypto-js/hmac.js +143 -0
- package/claw/node_modules/crypto-js/index.js +18 -0
- package/claw/node_modules/crypto-js/lib-typedarrays.js +76 -0
- package/claw/node_modules/crypto-js/md5.js +268 -0
- package/claw/node_modules/crypto-js/mode-cfb.js +78 -0
- package/claw/node_modules/crypto-js/mode-ctr-gladman.js +116 -0
- package/claw/node_modules/crypto-js/mode-ctr.js +58 -0
- package/claw/node_modules/crypto-js/mode-ecb.js +40 -0
- package/claw/node_modules/crypto-js/mode-ofb.js +54 -0
- package/claw/node_modules/crypto-js/package.json +38 -0
- package/claw/node_modules/crypto-js/pad-ansix923.js +49 -0
- package/claw/node_modules/crypto-js/pad-iso10126.js +44 -0
- package/claw/node_modules/crypto-js/pad-iso97971.js +40 -0
- package/claw/node_modules/crypto-js/pad-nopadding.js +30 -0
- package/claw/node_modules/crypto-js/pad-pkcs7.js +18 -0
- package/claw/node_modules/crypto-js/pad-zeropadding.js +45 -0
- package/claw/node_modules/crypto-js/pbkdf2.js +145 -0
- package/claw/node_modules/crypto-js/rabbit-legacy.js +190 -0
- package/claw/node_modules/crypto-js/rabbit.js +192 -0
- package/claw/node_modules/crypto-js/rc4.js +139 -0
- package/claw/node_modules/crypto-js/ripemd160.js +267 -0
- package/claw/node_modules/crypto-js/sha1.js +150 -0
- package/claw/node_modules/crypto-js/sha224.js +80 -0
- package/claw/node_modules/crypto-js/sha256.js +199 -0
- package/claw/node_modules/crypto-js/sha3.js +323 -0
- package/claw/node_modules/crypto-js/sha384.js +83 -0
- package/claw/node_modules/crypto-js/sha512.js +323 -0
- package/claw/node_modules/crypto-js/tripledes.js +770 -0
- package/claw/node_modules/crypto-js/x64-core.js +304 -0
- package/claw/node_modules/deep-equal/.editorconfig +20 -0
- package/claw/node_modules/deep-equal/.eslintrc +28 -0
- package/claw/node_modules/deep-equal/.nycrc +17 -0
- package/claw/node_modules/deep-equal/.travis.yml +12 -0
- package/claw/node_modules/deep-equal/CHANGELOG.md +320 -0
- package/claw/node_modules/deep-equal/LICENSE +21 -0
- package/claw/node_modules/deep-equal/assert.js +3 -0
- package/claw/node_modules/deep-equal/example/cmp.js +11 -0
- package/claw/node_modules/deep-equal/index.js +112 -0
- package/claw/node_modules/deep-equal/lib/is_arguments.js +1 -0
- package/claw/node_modules/deep-equal/lib/keys.js +1 -0
- package/claw/node_modules/deep-equal/package.json +109 -0
- package/claw/node_modules/deep-equal/readme.markdown +73 -0
- package/claw/node_modules/deep-equal/test/_tape.js +42 -0
- package/claw/node_modules/deep-equal/test/cmp.js +1343 -0
- package/claw/node_modules/define-data-property/.eslintrc +24 -0
- package/claw/node_modules/define-data-property/.github/FUNDING.yml +12 -0
- package/claw/node_modules/define-data-property/.nycrc +13 -0
- package/claw/node_modules/define-data-property/CHANGELOG.md +70 -0
- package/claw/node_modules/define-data-property/LICENSE +21 -0
- package/claw/node_modules/define-data-property/README.md +67 -0
- package/claw/node_modules/define-data-property/index.d.ts +12 -0
- package/claw/node_modules/define-data-property/index.js +56 -0
- package/claw/node_modules/define-data-property/package.json +106 -0
- package/claw/node_modules/define-data-property/test/index.js +392 -0
- package/claw/node_modules/define-data-property/tsconfig.json +59 -0
- package/claw/node_modules/define-properties/.editorconfig +13 -0
- package/claw/node_modules/define-properties/.eslintrc +19 -0
- package/claw/node_modules/define-properties/.github/FUNDING.yml +12 -0
- package/claw/node_modules/define-properties/.nycrc +9 -0
- package/claw/node_modules/define-properties/CHANGELOG.md +91 -0
- package/claw/node_modules/define-properties/LICENSE +21 -0
- package/claw/node_modules/define-properties/README.md +84 -0
- package/claw/node_modules/define-properties/index.js +47 -0
- package/claw/node_modules/define-properties/package.json +88 -0
- package/claw/node_modules/dunder-proto/.eslintrc +5 -0
- package/claw/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
- package/claw/node_modules/dunder-proto/.nycrc +13 -0
- package/claw/node_modules/dunder-proto/CHANGELOG.md +24 -0
- package/claw/node_modules/dunder-proto/LICENSE +21 -0
- package/claw/node_modules/dunder-proto/README.md +54 -0
- package/claw/node_modules/dunder-proto/get.d.ts +5 -0
- package/claw/node_modules/dunder-proto/get.js +30 -0
- package/claw/node_modules/dunder-proto/package.json +76 -0
- package/claw/node_modules/dunder-proto/set.d.ts +5 -0
- package/claw/node_modules/dunder-proto/set.js +35 -0
- package/claw/node_modules/dunder-proto/test/get.js +34 -0
- package/claw/node_modules/dunder-proto/test/index.js +4 -0
- package/claw/node_modules/dunder-proto/test/set.js +50 -0
- package/claw/node_modules/dunder-proto/tsconfig.json +9 -0
- package/claw/node_modules/ecurve/.min-wd +7 -0
- package/claw/node_modules/ecurve/.travis.yml +14 -0
- package/claw/node_modules/ecurve/CHANGELOG.md +154 -0
- package/claw/node_modules/ecurve/README.md +11 -0
- package/claw/node_modules/ecurve/lib/curve.js +77 -0
- package/claw/node_modules/ecurve/lib/curves.json +65 -0
- package/claw/node_modules/ecurve/lib/index.js +10 -0
- package/claw/node_modules/ecurve/lib/names.js +21 -0
- package/claw/node_modules/ecurve/lib/point.js +244 -0
- package/claw/node_modules/ecurve/package.json +32 -0
- package/claw/node_modules/es-define-property/.eslintrc +13 -0
- package/claw/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/claw/node_modules/es-define-property/.nycrc +9 -0
- package/claw/node_modules/es-define-property/CHANGELOG.md +29 -0
- package/claw/node_modules/es-define-property/LICENSE +21 -0
- package/claw/node_modules/es-define-property/README.md +49 -0
- package/claw/node_modules/es-define-property/index.d.ts +3 -0
- package/claw/node_modules/es-define-property/index.js +14 -0
- package/claw/node_modules/es-define-property/package.json +81 -0
- package/claw/node_modules/es-define-property/test/index.js +56 -0
- package/claw/node_modules/es-define-property/tsconfig.json +10 -0
- package/claw/node_modules/es-errors/.eslintrc +5 -0
- package/claw/node_modules/es-errors/.github/FUNDING.yml +12 -0
- package/claw/node_modules/es-errors/CHANGELOG.md +40 -0
- package/claw/node_modules/es-errors/LICENSE +21 -0
- package/claw/node_modules/es-errors/README.md +55 -0
- package/claw/node_modules/es-errors/eval.d.ts +3 -0
- package/claw/node_modules/es-errors/eval.js +4 -0
- package/claw/node_modules/es-errors/index.d.ts +3 -0
- package/claw/node_modules/es-errors/index.js +4 -0
- package/claw/node_modules/es-errors/package.json +80 -0
- package/claw/node_modules/es-errors/range.d.ts +3 -0
- package/claw/node_modules/es-errors/range.js +4 -0
- package/claw/node_modules/es-errors/ref.d.ts +3 -0
- package/claw/node_modules/es-errors/ref.js +4 -0
- package/claw/node_modules/es-errors/syntax.d.ts +3 -0
- package/claw/node_modules/es-errors/syntax.js +4 -0
- package/claw/node_modules/es-errors/test/index.js +19 -0
- package/claw/node_modules/es-errors/tsconfig.json +49 -0
- package/claw/node_modules/es-errors/type.d.ts +3 -0
- package/claw/node_modules/es-errors/type.js +4 -0
- package/claw/node_modules/es-errors/uri.d.ts +3 -0
- package/claw/node_modules/es-errors/uri.js +4 -0
- package/claw/node_modules/es-object-atoms/.eslintrc +16 -0
- package/claw/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/claw/node_modules/es-object-atoms/CHANGELOG.md +37 -0
- package/claw/node_modules/es-object-atoms/LICENSE +21 -0
- package/claw/node_modules/es-object-atoms/README.md +63 -0
- package/claw/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- package/claw/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/claw/node_modules/es-object-atoms/ToObject.d.ts +7 -0
- package/claw/node_modules/es-object-atoms/ToObject.js +10 -0
- package/claw/node_modules/es-object-atoms/index.d.ts +3 -0
- package/claw/node_modules/es-object-atoms/index.js +4 -0
- package/claw/node_modules/es-object-atoms/isObject.d.ts +3 -0
- package/claw/node_modules/es-object-atoms/isObject.js +6 -0
- package/claw/node_modules/es-object-atoms/package.json +80 -0
- package/claw/node_modules/es-object-atoms/test/index.js +38 -0
- package/claw/node_modules/es-object-atoms/tsconfig.json +6 -0
- package/claw/node_modules/for-each/.editorconfig +20 -0
- package/claw/node_modules/for-each/.eslintrc +30 -0
- package/claw/node_modules/for-each/.github/FUNDING.yml +12 -0
- package/claw/node_modules/for-each/.github/SECURITY.md +3 -0
- package/claw/node_modules/for-each/.nycrc +8 -0
- package/claw/node_modules/for-each/CHANGELOG.md +107 -0
- package/claw/node_modules/for-each/LICENSE +22 -0
- package/claw/node_modules/for-each/README.md +39 -0
- package/claw/node_modules/for-each/index.d.ts +35 -0
- package/claw/node_modules/for-each/index.js +69 -0
- package/claw/node_modules/for-each/package.json +76 -0
- package/claw/node_modules/for-each/test/test.js +224 -0
- package/claw/node_modules/for-each/tsconfig.json +8 -0
- package/claw/node_modules/function-bind/.eslintrc +21 -0
- package/claw/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/claw/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/claw/node_modules/function-bind/.nycrc +13 -0
- package/claw/node_modules/function-bind/CHANGELOG.md +136 -0
- package/claw/node_modules/function-bind/LICENSE +20 -0
- package/claw/node_modules/function-bind/README.md +46 -0
- package/claw/node_modules/function-bind/implementation.js +84 -0
- package/claw/node_modules/function-bind/index.js +5 -0
- package/claw/node_modules/function-bind/package.json +87 -0
- package/claw/node_modules/function-bind/test/.eslintrc +9 -0
- package/claw/node_modules/function-bind/test/index.js +252 -0
- package/claw/node_modules/functions-have-names/.editorconfig +20 -0
- package/claw/node_modules/functions-have-names/.eslintrc +19 -0
- package/claw/node_modules/functions-have-names/.github/FUNDING.yml +12 -0
- package/claw/node_modules/functions-have-names/.nycrc +9 -0
- package/claw/node_modules/functions-have-names/CHANGELOG.md +89 -0
- package/claw/node_modules/functions-have-names/LICENSE +21 -0
- package/claw/node_modules/functions-have-names/README.md +40 -0
- package/claw/node_modules/functions-have-names/index.js +31 -0
- package/claw/node_modules/functions-have-names/package.json +55 -0
- package/claw/node_modules/functions-have-names/test/index.js +65 -0
- package/claw/node_modules/get-intrinsic/.eslintrc +42 -0
- package/claw/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/claw/node_modules/get-intrinsic/.nycrc +9 -0
- package/claw/node_modules/get-intrinsic/CHANGELOG.md +186 -0
- package/claw/node_modules/get-intrinsic/LICENSE +21 -0
- package/claw/node_modules/get-intrinsic/README.md +71 -0
- package/claw/node_modules/get-intrinsic/index.js +378 -0
- package/claw/node_modules/get-intrinsic/package.json +97 -0
- package/claw/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
- package/claw/node_modules/get-proto/.eslintrc +10 -0
- package/claw/node_modules/get-proto/.github/FUNDING.yml +12 -0
- package/claw/node_modules/get-proto/.nycrc +9 -0
- package/claw/node_modules/get-proto/CHANGELOG.md +21 -0
- package/claw/node_modules/get-proto/LICENSE +21 -0
- package/claw/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
- package/claw/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/claw/node_modules/get-proto/README.md +50 -0
- package/claw/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
- package/claw/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/claw/node_modules/get-proto/index.d.ts +5 -0
- package/claw/node_modules/get-proto/index.js +27 -0
- package/claw/node_modules/get-proto/package.json +81 -0
- package/claw/node_modules/get-proto/test/index.js +68 -0
- package/claw/node_modules/get-proto/tsconfig.json +9 -0
- package/claw/node_modules/gopd/.eslintrc +16 -0
- package/claw/node_modules/gopd/.github/FUNDING.yml +12 -0
- package/claw/node_modules/gopd/CHANGELOG.md +45 -0
- package/claw/node_modules/gopd/LICENSE +21 -0
- package/claw/node_modules/gopd/README.md +40 -0
- package/claw/node_modules/gopd/gOPD.d.ts +1 -0
- package/claw/node_modules/gopd/gOPD.js +4 -0
- package/claw/node_modules/gopd/index.d.ts +5 -0
- package/claw/node_modules/gopd/index.js +15 -0
- package/claw/node_modules/gopd/package.json +77 -0
- package/claw/node_modules/gopd/test/index.js +36 -0
- package/claw/node_modules/gopd/tsconfig.json +9 -0
- package/claw/node_modules/has-property-descriptors/.eslintrc +13 -0
- package/claw/node_modules/has-property-descriptors/.github/FUNDING.yml +12 -0
- package/claw/node_modules/has-property-descriptors/.nycrc +9 -0
- package/claw/node_modules/has-property-descriptors/CHANGELOG.md +35 -0
- package/claw/node_modules/has-property-descriptors/LICENSE +21 -0
- package/claw/node_modules/has-property-descriptors/README.md +43 -0
- package/claw/node_modules/has-property-descriptors/index.js +22 -0
- package/claw/node_modules/has-property-descriptors/package.json +77 -0
- package/claw/node_modules/has-property-descriptors/test/index.js +57 -0
- package/claw/node_modules/has-symbols/.eslintrc +11 -0
- package/claw/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/claw/node_modules/has-symbols/.nycrc +9 -0
- package/claw/node_modules/has-symbols/CHANGELOG.md +91 -0
- package/claw/node_modules/has-symbols/LICENSE +21 -0
- package/claw/node_modules/has-symbols/README.md +46 -0
- package/claw/node_modules/has-symbols/index.d.ts +3 -0
- package/claw/node_modules/has-symbols/index.js +14 -0
- package/claw/node_modules/has-symbols/package.json +111 -0
- package/claw/node_modules/has-symbols/shams.d.ts +3 -0
- package/claw/node_modules/has-symbols/shams.js +45 -0
- package/claw/node_modules/has-symbols/test/index.js +22 -0
- package/claw/node_modules/has-symbols/test/shams/core-js.js +29 -0
- package/claw/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
- package/claw/node_modules/has-symbols/test/tests.js +58 -0
- package/claw/node_modules/has-symbols/tsconfig.json +10 -0
- package/claw/node_modules/has-tostringtag/.eslintrc +5 -0
- package/claw/node_modules/has-tostringtag/.github/FUNDING.yml +12 -0
- package/claw/node_modules/has-tostringtag/.nycrc +13 -0
- package/claw/node_modules/has-tostringtag/CHANGELOG.md +42 -0
- package/claw/node_modules/has-tostringtag/LICENSE +21 -0
- package/claw/node_modules/has-tostringtag/README.md +46 -0
- package/claw/node_modules/has-tostringtag/index.d.ts +3 -0
- package/claw/node_modules/has-tostringtag/index.js +8 -0
- package/claw/node_modules/has-tostringtag/package.json +108 -0
- package/claw/node_modules/has-tostringtag/shams.d.ts +3 -0
- package/claw/node_modules/has-tostringtag/shams.js +8 -0
- package/claw/node_modules/has-tostringtag/test/index.js +21 -0
- package/claw/node_modules/has-tostringtag/test/shams/core-js.js +31 -0
- package/claw/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +30 -0
- package/claw/node_modules/has-tostringtag/test/tests.js +15 -0
- package/claw/node_modules/has-tostringtag/tsconfig.json +49 -0
- package/claw/node_modules/hash-base/.github/FUNDING.yml +12 -0
- package/claw/node_modules/hash-base/CHANGELOG.md +166 -0
- package/claw/node_modules/hash-base/LICENSE +21 -0
- package/claw/node_modules/hash-base/README.md +48 -0
- package/claw/node_modules/hash-base/index.js +109 -0
- package/claw/node_modules/hash-base/package.json +64 -0
- package/claw/node_modules/hash-base/to-buffer.js +20 -0
- package/claw/node_modules/hasown/.eslintrc +5 -0
- package/claw/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/claw/node_modules/hasown/.nycrc +13 -0
- package/claw/node_modules/hasown/CHANGELOG.md +40 -0
- package/claw/node_modules/hasown/LICENSE +21 -0
- package/claw/node_modules/hasown/README.md +40 -0
- package/claw/node_modules/hasown/index.d.ts +3 -0
- package/claw/node_modules/hasown/index.js +8 -0
- package/claw/node_modules/hasown/package.json +92 -0
- package/claw/node_modules/hasown/tsconfig.json +6 -0
- package/claw/node_modules/inherits/LICENSE +16 -0
- package/claw/node_modules/inherits/README.md +42 -0
- package/claw/node_modules/inherits/inherits.js +9 -0
- package/claw/node_modules/inherits/inherits_browser.js +27 -0
- package/claw/node_modules/inherits/package.json +29 -0
- package/claw/node_modules/is-arguments/.editorconfig +20 -0
- package/claw/node_modules/is-arguments/.eslintrc +9 -0
- package/claw/node_modules/is-arguments/.github/FUNDING.yml +12 -0
- package/claw/node_modules/is-arguments/.nycrc +9 -0
- package/claw/node_modules/is-arguments/CHANGELOG.md +201 -0
- package/claw/node_modules/is-arguments/LICENSE +20 -0
- package/claw/node_modules/is-arguments/README.md +47 -0
- package/claw/node_modules/is-arguments/index.d.ts +6 -0
- package/claw/node_modules/is-arguments/index.js +44 -0
- package/claw/node_modules/is-arguments/package.json +105 -0
- package/claw/node_modules/is-arguments/test/index.js +47 -0
- package/claw/node_modules/is-arguments/tsconfig.json +9 -0
- package/claw/node_modules/is-callable/.editorconfig +31 -0
- package/claw/node_modules/is-callable/.eslintrc +10 -0
- package/claw/node_modules/is-callable/.github/FUNDING.yml +12 -0
- package/claw/node_modules/is-callable/.nycrc +9 -0
- package/claw/node_modules/is-callable/CHANGELOG.md +158 -0
- package/claw/node_modules/is-callable/LICENSE +22 -0
- package/claw/node_modules/is-callable/README.md +83 -0
- package/claw/node_modules/is-callable/index.js +101 -0
- package/claw/node_modules/is-callable/package.json +106 -0
- package/claw/node_modules/is-callable/test/index.js +244 -0
- package/claw/node_modules/is-date-object/.editorconfig +20 -0
- package/claw/node_modules/is-date-object/.eslintrc +9 -0
- package/claw/node_modules/is-date-object/.github/FUNDING.yml +12 -0
- package/claw/node_modules/is-date-object/.nycrc +10 -0
- package/claw/node_modules/is-date-object/CHANGELOG.md +134 -0
- package/claw/node_modules/is-date-object/LICENSE +22 -0
- package/claw/node_modules/is-date-object/README.md +52 -0
- package/claw/node_modules/is-date-object/index.d.ts +3 -0
- package/claw/node_modules/is-date-object/index.js +27 -0
- package/claw/node_modules/is-date-object/package.json +99 -0
- package/claw/node_modules/is-date-object/test/index.js +38 -0
- package/claw/node_modules/is-date-object/tsconfig.json +6 -0
- package/claw/node_modules/is-regex/.editorconfig +23 -0
- package/claw/node_modules/is-regex/.eslintrc +10 -0
- package/claw/node_modules/is-regex/.nycrc +10 -0
- package/claw/node_modules/is-regex/CHANGELOG.md +233 -0
- package/claw/node_modules/is-regex/LICENSE +20 -0
- package/claw/node_modules/is-regex/README.md +52 -0
- package/claw/node_modules/is-regex/index.d.ts +3 -0
- package/claw/node_modules/is-regex/index.js +69 -0
- package/claw/node_modules/is-regex/package.json +104 -0
- package/claw/node_modules/is-regex/test/index.js +121 -0
- package/claw/node_modules/is-regex/tsconfig.json +9 -0
- package/claw/node_modules/is-typed-array/.editorconfig +20 -0
- package/claw/node_modules/is-typed-array/.eslintrc +13 -0
- package/claw/node_modules/is-typed-array/.github/FUNDING.yml +12 -0
- package/claw/node_modules/is-typed-array/.nycrc +9 -0
- package/claw/node_modules/is-typed-array/CHANGELOG.md +166 -0
- package/claw/node_modules/is-typed-array/LICENSE +22 -0
- package/claw/node_modules/is-typed-array/README.md +70 -0
- package/claw/node_modules/is-typed-array/index.d.ts +9 -0
- package/claw/node_modules/is-typed-array/index.js +8 -0
- package/claw/node_modules/is-typed-array/package.json +129 -0
- package/claw/node_modules/is-typed-array/test/index.js +111 -0
- package/claw/node_modules/is-typed-array/tsconfig.json +6 -0
- package/claw/node_modules/isarray/.travis.yml +4 -0
- package/claw/node_modules/isarray/Makefile +6 -0
- package/claw/node_modules/isarray/README.md +60 -0
- package/claw/node_modules/isarray/component.json +19 -0
- package/claw/node_modules/isarray/index.js +5 -0
- package/claw/node_modules/isarray/package.json +45 -0
- package/claw/node_modules/isarray/test.js +20 -0
- package/claw/node_modules/isomorphic-ws/LICENSE +21 -0
- package/claw/node_modules/isomorphic-ws/README.md +58 -0
- package/claw/node_modules/isomorphic-ws/browser.js +17 -0
- package/claw/node_modules/isomorphic-ws/index.d.ts +8 -0
- package/claw/node_modules/isomorphic-ws/node.js +3 -0
- package/claw/node_modules/isomorphic-ws/package.json +34 -0
- package/claw/node_modules/long/.travis.yml +5 -0
- package/claw/node_modules/long/LICENSE +202 -0
- package/claw/node_modules/long/README.md +513 -0
- package/claw/node_modules/long/bower.json +9 -0
- package/claw/node_modules/long/dist/README.md +16 -0
- package/claw/node_modules/long/dist/long.js +1209 -0
- package/claw/node_modules/long/dist/long.min.js +20 -0
- package/claw/node_modules/long/dist/long.min.js.gz +0 -0
- package/claw/node_modules/long/dist/long.min.map +8 -0
- package/claw/node_modules/long/doco/INDEX.md +6 -0
- package/claw/node_modules/long/doco/Long.md +473 -0
- package/claw/node_modules/long/donate.png +0 -0
- package/claw/node_modules/long/externs/long.js +416 -0
- package/claw/node_modules/long/index.js +1 -0
- package/claw/node_modules/long/jsdoc.json +13 -0
- package/claw/node_modules/long/long.png +0 -0
- package/claw/node_modules/long/package.json +33 -0
- package/claw/node_modules/long/scripts/build.js +28 -0
- package/claw/node_modules/long/src/bower.json +9 -0
- package/claw/node_modules/long/src/long.js +1172 -0
- package/claw/node_modules/long/src/wrap.js +38 -0
- package/claw/node_modules/long/tests/goog.math.long.js +807 -0
- package/claw/node_modules/long/tests/suite.js +195 -0
- package/claw/node_modules/lzma/.travis.yml +9 -0
- package/claw/node_modules/lzma/LICENSE +20 -0
- package/claw/node_modules/lzma/THANKS +7 -0
- package/claw/node_modules/lzma/bin/lzma.js +362 -0
- package/claw/node_modules/lzma/index.js +19 -0
- package/claw/node_modules/lzma/package.json +30 -0
- package/claw/node_modules/lzma/readme.md +149 -0
- package/claw/node_modules/lzma/src/lzma-c-min.js +1 -0
- package/claw/node_modules/lzma/src/lzma-c.js +2021 -0
- package/claw/node_modules/lzma/src/lzma-d-min.js +1 -0
- package/claw/node_modules/lzma/src/lzma-d.js +878 -0
- package/claw/node_modules/lzma/src/lzma-min.js +2 -0
- package/claw/node_modules/lzma/src/lzma.js +153 -0
- package/claw/node_modules/lzma/src/lzma_worker-min.js +2 -0
- package/claw/node_modules/lzma/src/lzma_worker.js +2668 -0
- package/claw/node_modules/math-intrinsics/.eslintrc +16 -0
- package/claw/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- package/claw/node_modules/math-intrinsics/CHANGELOG.md +24 -0
- package/claw/node_modules/math-intrinsics/LICENSE +21 -0
- package/claw/node_modules/math-intrinsics/README.md +50 -0
- package/claw/node_modules/math-intrinsics/abs.d.ts +1 -0
- package/claw/node_modules/math-intrinsics/abs.js +4 -0
- package/claw/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
- package/claw/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- package/claw/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
- package/claw/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- package/claw/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
- package/claw/node_modules/math-intrinsics/constants/maxValue.js +5 -0
- package/claw/node_modules/math-intrinsics/floor.d.ts +1 -0
- package/claw/node_modules/math-intrinsics/floor.js +4 -0
- package/claw/node_modules/math-intrinsics/isFinite.d.ts +3 -0
- package/claw/node_modules/math-intrinsics/isFinite.js +12 -0
- package/claw/node_modules/math-intrinsics/isInteger.d.ts +3 -0
- package/claw/node_modules/math-intrinsics/isInteger.js +16 -0
- package/claw/node_modules/math-intrinsics/isNaN.d.ts +1 -0
- package/claw/node_modules/math-intrinsics/isNaN.js +6 -0
- package/claw/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
- package/claw/node_modules/math-intrinsics/isNegativeZero.js +6 -0
- package/claw/node_modules/math-intrinsics/max.d.ts +1 -0
- package/claw/node_modules/math-intrinsics/max.js +4 -0
- package/claw/node_modules/math-intrinsics/min.d.ts +1 -0
- package/claw/node_modules/math-intrinsics/min.js +4 -0
- package/claw/node_modules/math-intrinsics/mod.d.ts +3 -0
- package/claw/node_modules/math-intrinsics/mod.js +9 -0
- package/claw/node_modules/math-intrinsics/package.json +86 -0
- package/claw/node_modules/math-intrinsics/pow.d.ts +1 -0
- package/claw/node_modules/math-intrinsics/pow.js +4 -0
- package/claw/node_modules/math-intrinsics/round.d.ts +1 -0
- package/claw/node_modules/math-intrinsics/round.js +4 -0
- package/claw/node_modules/math-intrinsics/sign.d.ts +3 -0
- package/claw/node_modules/math-intrinsics/sign.js +11 -0
- package/claw/node_modules/math-intrinsics/test/index.js +192 -0
- package/claw/node_modules/math-intrinsics/tsconfig.json +3 -0
- package/claw/node_modules/md5.js/LICENSE +21 -0
- package/claw/node_modules/md5.js/README.md +29 -0
- package/claw/node_modules/md5.js/index.js +146 -0
- package/claw/node_modules/md5.js/package.json +38 -0
- package/claw/node_modules/object-is/.eslintrc +5 -0
- package/claw/node_modules/object-is/.nycrc +9 -0
- package/claw/node_modules/object-is/CHANGELOG.md +175 -0
- package/claw/node_modules/object-is/LICENSE +20 -0
- package/claw/node_modules/object-is/README.md +60 -0
- package/claw/node_modules/object-is/auto.js +3 -0
- package/claw/node_modules/object-is/implementation.js +19 -0
- package/claw/node_modules/object-is/index.js +18 -0
- package/claw/node_modules/object-is/package.json +96 -0
- package/claw/node_modules/object-is/polyfill.js +7 -0
- package/claw/node_modules/object-is/shim.js +14 -0
- package/claw/node_modules/object-is/test/implementation.js +12 -0
- package/claw/node_modules/object-is/test/index.js +12 -0
- package/claw/node_modules/object-is/test/shimmed.js +28 -0
- package/claw/node_modules/object-is/test/tests.js +57 -0
- package/claw/node_modules/object-keys/.editorconfig +13 -0
- package/claw/node_modules/object-keys/.eslintrc +17 -0
- package/claw/node_modules/object-keys/.travis.yml +277 -0
- package/claw/node_modules/object-keys/CHANGELOG.md +232 -0
- package/claw/node_modules/object-keys/LICENSE +21 -0
- package/claw/node_modules/object-keys/README.md +76 -0
- package/claw/node_modules/object-keys/implementation.js +122 -0
- package/claw/node_modules/object-keys/index.js +32 -0
- package/claw/node_modules/object-keys/isArguments.js +17 -0
- package/claw/node_modules/object-keys/package.json +88 -0
- package/claw/node_modules/object-keys/test/index.js +5 -0
- package/claw/node_modules/object.assign/.editorconfig +20 -0
- package/claw/node_modules/object.assign/.eslintrc +28 -0
- package/claw/node_modules/object.assign/.github/FUNDING.yml +12 -0
- package/claw/node_modules/object.assign/.nycrc +9 -0
- package/claw/node_modules/object.assign/CHANGELOG.md +246 -0
- package/claw/node_modules/object.assign/LICENSE +21 -0
- package/claw/node_modules/object.assign/README.md +136 -0
- package/claw/node_modules/object.assign/auto.js +3 -0
- package/claw/node_modules/object.assign/dist/browser.js +1304 -0
- package/claw/node_modules/object.assign/hasSymbols.js +43 -0
- package/claw/node_modules/object.assign/implementation.js +46 -0
- package/claw/node_modules/object.assign/index.js +22 -0
- package/claw/node_modules/object.assign/package.json +96 -0
- package/claw/node_modules/object.assign/polyfill.js +55 -0
- package/claw/node_modules/object.assign/shim.js +14 -0
- package/claw/node_modules/object.assign/test/implementation.js +19 -0
- package/claw/node_modules/object.assign/test/index.js +17 -0
- package/claw/node_modules/object.assign/test/native.js +49 -0
- package/claw/node_modules/object.assign/test/ses-compat.js +12 -0
- package/claw/node_modules/object.assign/test/shimmed.js +52 -0
- package/claw/node_modules/object.assign/test/tests.js +232 -0
- package/claw/node_modules/possible-typed-array-names/.eslintrc +5 -0
- package/claw/node_modules/possible-typed-array-names/.github/FUNDING.yml +12 -0
- package/claw/node_modules/possible-typed-array-names/CHANGELOG.md +29 -0
- package/claw/node_modules/possible-typed-array-names/LICENSE +21 -0
- package/claw/node_modules/possible-typed-array-names/README.md +50 -0
- package/claw/node_modules/possible-typed-array-names/index.d.ts +16 -0
- package/claw/node_modules/possible-typed-array-names/index.js +17 -0
- package/claw/node_modules/possible-typed-array-names/package.json +84 -0
- package/claw/node_modules/possible-typed-array-names/test/index.js +19 -0
- package/claw/node_modules/possible-typed-array-names/tsconfig.json +9 -0
- package/claw/node_modules/process-nextick-args/index.js +45 -0
- package/claw/node_modules/process-nextick-args/license.md +19 -0
- package/claw/node_modules/process-nextick-args/package.json +25 -0
- package/claw/node_modules/process-nextick-args/readme.md +18 -0
- package/claw/node_modules/readable-stream/.travis.yml +34 -0
- package/claw/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/claw/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/claw/node_modules/readable-stream/LICENSE +47 -0
- package/claw/node_modules/readable-stream/README.md +58 -0
- package/claw/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
- package/claw/node_modules/readable-stream/duplex-browser.js +1 -0
- package/claw/node_modules/readable-stream/duplex.js +1 -0
- package/claw/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
- package/claw/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
- package/claw/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
- package/claw/node_modules/readable-stream/lib/_stream_transform.js +214 -0
- package/claw/node_modules/readable-stream/lib/_stream_writable.js +685 -0
- package/claw/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
- package/claw/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
- package/claw/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/claw/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/claw/node_modules/readable-stream/node_modules/safe-buffer/LICENSE +21 -0
- package/claw/node_modules/readable-stream/node_modules/safe-buffer/README.md +584 -0
- package/claw/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts +187 -0
- package/claw/node_modules/readable-stream/node_modules/safe-buffer/index.js +62 -0
- package/claw/node_modules/readable-stream/node_modules/safe-buffer/package.json +37 -0
- package/claw/node_modules/readable-stream/package.json +52 -0
- package/claw/node_modules/readable-stream/passthrough.js +1 -0
- package/claw/node_modules/readable-stream/readable-browser.js +7 -0
- package/claw/node_modules/readable-stream/readable.js +19 -0
- package/claw/node_modules/readable-stream/transform.js +1 -0
- package/claw/node_modules/readable-stream/writable-browser.js +1 -0
- package/claw/node_modules/readable-stream/writable.js +8 -0
- package/claw/node_modules/regexp.prototype.flags/.editorconfig +13 -0
- package/claw/node_modules/regexp.prototype.flags/.eslintrc +20 -0
- package/claw/node_modules/regexp.prototype.flags/.nycrc +9 -0
- package/claw/node_modules/regexp.prototype.flags/CHANGELOG.md +249 -0
- package/claw/node_modules/regexp.prototype.flags/LICENSE +22 -0
- package/claw/node_modules/regexp.prototype.flags/README.md +55 -0
- package/claw/node_modules/regexp.prototype.flags/auto.js +3 -0
- package/claw/node_modules/regexp.prototype.flags/implementation.js +39 -0
- package/claw/node_modules/regexp.prototype.flags/index.js +18 -0
- package/claw/node_modules/regexp.prototype.flags/package.json +105 -0
- package/claw/node_modules/regexp.prototype.flags/polyfill.js +39 -0
- package/claw/node_modules/regexp.prototype.flags/shim.js +26 -0
- package/claw/node_modules/regexp.prototype.flags/test/builtin.js +46 -0
- package/claw/node_modules/regexp.prototype.flags/test/implementation.js +20 -0
- package/claw/node_modules/regexp.prototype.flags/test/index.js +17 -0
- package/claw/node_modules/regexp.prototype.flags/test/shimmed.js +48 -0
- package/claw/node_modules/regexp.prototype.flags/test/tests.js +143 -0
- package/claw/node_modules/ripemd160/.github/FUNDING.yml +12 -0
- package/claw/node_modules/ripemd160/CHANGELOG.md +109 -0
- package/claw/node_modules/ripemd160/LICENSE +21 -0
- package/claw/node_modules/ripemd160/README.md +27 -0
- package/claw/node_modules/ripemd160/index.js +167 -0
- package/claw/node_modules/ripemd160/package.json +64 -0
- package/claw/node_modules/safe-buffer/LICENSE +21 -0
- package/claw/node_modules/safe-buffer/README.md +584 -0
- package/claw/node_modules/safe-buffer/index.d.ts +187 -0
- package/claw/node_modules/safe-buffer/index.js +65 -0
- package/claw/node_modules/safe-buffer/package.json +51 -0
- package/claw/node_modules/secure-random/CHANGELOG.md +51 -0
- package/claw/node_modules/secure-random/Makefile +8 -0
- package/claw/node_modules/secure-random/README.md +133 -0
- package/claw/node_modules/secure-random/lib/secure-random.js +83 -0
- package/claw/node_modules/secure-random/package.json +45 -0
- package/claw/node_modules/set-function-length/.eslintrc +27 -0
- package/claw/node_modules/set-function-length/.github/FUNDING.yml +12 -0
- package/claw/node_modules/set-function-length/.nycrc +13 -0
- package/claw/node_modules/set-function-length/CHANGELOG.md +70 -0
- package/claw/node_modules/set-function-length/LICENSE +21 -0
- package/claw/node_modules/set-function-length/README.md +56 -0
- package/claw/node_modules/set-function-length/env.d.ts +9 -0
- package/claw/node_modules/set-function-length/env.js +25 -0
- package/claw/node_modules/set-function-length/index.d.ts +7 -0
- package/claw/node_modules/set-function-length/index.js +42 -0
- package/claw/node_modules/set-function-length/package.json +102 -0
- package/claw/node_modules/set-function-length/tsconfig.json +9 -0
- package/claw/node_modules/set-function-name/.eslintrc +21 -0
- package/claw/node_modules/set-function-name/.github/FUNDING.yml +12 -0
- package/claw/node_modules/set-function-name/CHANGELOG.md +48 -0
- package/claw/node_modules/set-function-name/LICENSE +21 -0
- package/claw/node_modules/set-function-name/README.md +61 -0
- package/claw/node_modules/set-function-name/index.d.ts +5 -0
- package/claw/node_modules/set-function-name/index.js +23 -0
- package/claw/node_modules/set-function-name/package.json +99 -0
- package/claw/node_modules/set-function-name/tsconfig.json +59 -0
- package/claw/node_modules/sha.js/.eslintrc +76 -0
- package/claw/node_modules/sha.js/CHANGELOG.md +423 -0
- package/claw/node_modules/sha.js/LICENSE +49 -0
- package/claw/node_modules/sha.js/README.md +44 -0
- package/claw/node_modules/sha.js/bin.js +44 -0
- package/claw/node_modules/sha.js/hash.js +84 -0
- package/claw/node_modules/sha.js/index.js +19 -0
- package/claw/node_modules/sha.js/package.json +58 -0
- package/claw/node_modules/sha.js/sha.js +104 -0
- package/claw/node_modules/sha.js/sha1.js +109 -0
- package/claw/node_modules/sha.js/sha224.js +55 -0
- package/claw/node_modules/sha.js/sha256.js +189 -0
- package/claw/node_modules/sha.js/sha384.js +59 -0
- package/claw/node_modules/sha.js/sha512.js +382 -0
- package/claw/node_modules/sha.js/test/hash.js +80 -0
- package/claw/node_modules/sha.js/test/test.js +138 -0
- package/claw/node_modules/sha.js/test/vectors.js +72 -0
- package/claw/node_modules/string_decoder/.travis.yml +50 -0
- package/claw/node_modules/string_decoder/LICENSE +48 -0
- package/claw/node_modules/string_decoder/README.md +47 -0
- package/claw/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/claw/node_modules/string_decoder/node_modules/safe-buffer/LICENSE +21 -0
- package/claw/node_modules/string_decoder/node_modules/safe-buffer/README.md +584 -0
- package/claw/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts +187 -0
- package/claw/node_modules/string_decoder/node_modules/safe-buffer/index.js +62 -0
- package/claw/node_modules/string_decoder/node_modules/safe-buffer/package.json +37 -0
- package/claw/node_modules/string_decoder/package.json +31 -0
- package/claw/node_modules/to-buffer/.github/FUNDING.yml +12 -0
- package/claw/node_modules/to-buffer/CHANGELOG.md +81 -0
- package/claw/node_modules/to-buffer/LICENSE +21 -0
- package/claw/node_modules/to-buffer/README.md +44 -0
- package/claw/node_modules/to-buffer/index.js +109 -0
- package/claw/node_modules/to-buffer/node_modules/isarray/LICENSE +21 -0
- package/claw/node_modules/to-buffer/node_modules/isarray/README.md +38 -0
- package/claw/node_modules/to-buffer/node_modules/isarray/index.js +5 -0
- package/claw/node_modules/to-buffer/node_modules/isarray/package.json +48 -0
- package/claw/node_modules/to-buffer/package.json +62 -0
- package/claw/node_modules/typed-array-buffer/.eslintrc +13 -0
- package/claw/node_modules/typed-array-buffer/.github/FUNDING.yml +12 -0
- package/claw/node_modules/typed-array-buffer/.nycrc +13 -0
- package/claw/node_modules/typed-array-buffer/CHANGELOG.md +50 -0
- package/claw/node_modules/typed-array-buffer/LICENSE +21 -0
- package/claw/node_modules/typed-array-buffer/README.md +42 -0
- package/claw/node_modules/typed-array-buffer/index.d.ts +9 -0
- package/claw/node_modules/typed-array-buffer/index.js +19 -0
- package/claw/node_modules/typed-array-buffer/package.json +82 -0
- package/claw/node_modules/typed-array-buffer/test/index.js +23 -0
- package/claw/node_modules/typed-array-buffer/tsconfig.json +9 -0
- package/claw/node_modules/util/LICENSE +18 -0
- package/claw/node_modules/util/README.md +15 -0
- package/claw/node_modules/util/node_modules/inherits/LICENSE +16 -0
- package/claw/node_modules/util/node_modules/inherits/README.md +42 -0
- package/claw/node_modules/util/node_modules/inherits/inherits.js +7 -0
- package/claw/node_modules/util/node_modules/inherits/inherits_browser.js +23 -0
- package/claw/node_modules/util/node_modules/inherits/package.json +29 -0
- package/claw/node_modules/util/package.json +35 -0
- package/claw/node_modules/util/support/isBuffer.js +3 -0
- package/claw/node_modules/util/support/isBufferBrowser.js +6 -0
- package/claw/node_modules/util/util.js +586 -0
- package/claw/node_modules/util-deprecate/History.md +16 -0
- package/claw/node_modules/util-deprecate/LICENSE +24 -0
- package/claw/node_modules/util-deprecate/README.md +53 -0
- package/claw/node_modules/util-deprecate/browser.js +67 -0
- package/claw/node_modules/util-deprecate/node.js +6 -0
- package/claw/node_modules/util-deprecate/package.json +27 -0
- package/claw/node_modules/which-typed-array/.editorconfig +20 -0
- package/claw/node_modules/which-typed-array/.eslintrc +10 -0
- package/claw/node_modules/which-typed-array/.github/FUNDING.yml +12 -0
- package/claw/node_modules/which-typed-array/.nycrc +13 -0
- package/claw/node_modules/which-typed-array/CHANGELOG.md +269 -0
- package/claw/node_modules/which-typed-array/LICENSE +22 -0
- package/claw/node_modules/which-typed-array/README.md +70 -0
- package/claw/node_modules/which-typed-array/index.d.ts +66 -0
- package/claw/node_modules/which-typed-array/index.js +122 -0
- package/claw/node_modules/which-typed-array/package.json +130 -0
- package/claw/node_modules/which-typed-array/test/index.js +105 -0
- package/claw/node_modules/which-typed-array/tsconfig.json +9 -0
- package/claw/node_modules/ws/LICENSE +21 -0
- package/claw/node_modules/ws/README.md +449 -0
- package/claw/node_modules/ws/browser.js +8 -0
- package/claw/node_modules/ws/index.js +9 -0
- package/claw/node_modules/ws/lib/buffer-util.js +144 -0
- package/claw/node_modules/ws/lib/constants.js +10 -0
- package/claw/node_modules/ws/lib/event-target.js +170 -0
- package/claw/node_modules/ws/lib/extension.js +222 -0
- package/claw/node_modules/ws/lib/permessage-deflate.js +502 -0
- package/claw/node_modules/ws/lib/receiver.js +492 -0
- package/claw/node_modules/ws/lib/sender.js +358 -0
- package/claw/node_modules/ws/lib/validation.js +30 -0
- package/claw/node_modules/ws/lib/websocket-server.js +415 -0
- package/claw/node_modules/ws/lib/websocket.js +895 -0
- package/claw/node_modules/ws/package.json +45 -0
- package/claw/openclaw.plugin.json +13 -0
- package/claw/package.json +58 -0
- package/claw/runtimes/openclaw-plugin/index.ts +38 -0
- package/claw/runtimes/openclaw-plugin/openclaw.plugin.json +14 -0
- package/claw/runtimes/openclaw-plugin/package.json +7 -0
- package/claw/runtimes/openclaw-plugin/plugin-entry.d.ts +10 -0
- package/claw/runtimes/openclaw-plugin/skills/bitshares-claw/SKILL.md +20 -0
- package/claw/scripts/claw_bridge.ts +139 -0
- package/claw/scripts/claw_mcp_server.ts +133 -0
- package/claw/scripts/claw_skill_md.ts +92 -0
- package/claw/scripts/honest_assets_report.ts +405 -0
- package/claw/scripts/memu_mcp_server.ts +438 -0
- package/claw/tests/package.json +3 -0
- package/claw/tests/test_claw_bridge.ts +542 -0
- package/claw/tests/test_claw_catalog_and_credentials.ts +152 -0
- package/claw/tests/test_claw_chain_layer.ts +719 -0
- package/claw/tests/test_claw_data_flow.ts +515 -0
- package/claw/tests/test_claw_domain_logic.ts +465 -0
- package/claw/tests/test_claw_manifest_and_matrix.ts +202 -0
- package/claw/tests/test_claw_mcp_transport.ts +238 -0
- package/claw/tests/test_claw_regressions.ts +580 -0
- package/claw/tests/test_claw_skill_generation.ts +103 -0
- package/claw/tests/test_claw_state_store.ts +44 -0
- package/claw/tests/test_dexbot_profiles.ts +572 -0
- package/claw/tests/test_memu_bridge.ts +189 -0
- package/claw/tests/test_nullclaw_tmp_integration.ts +58 -0
- package/claw/tests/test_position_health.ts +419 -0
- package/claw/tests/test_position_manager.ts +427 -0
- package/claw/tests/test_position_manager_watch_health.ts +104 -0
- package/claw/tests/test_short_mpa_strategy.ts +229 -0
- package/claw/tsconfig.json +35 -0
- package/dist/credential-daemon.d.ts +1 -1
- package/dist/credential-daemon.js +1 -1
- package/dist/dexbot.js +9 -9
- package/dist/dexbot.js.map +1 -1
- package/dist/modules/constants.js +1 -1
- package/dist/modules/constants.js.map +1 -1
- package/dist/modules/dexbot_class.d.ts +19 -1
- package/dist/modules/dexbot_class.d.ts.map +1 -1
- package/dist/modules/dexbot_class.js +7 -0
- package/dist/modules/dexbot_class.js.map +1 -1
- package/dist/modules/dexbot_cow_runtime.d.ts +18 -1
- package/dist/modules/dexbot_cow_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_cow_runtime.js +72 -7
- package/dist/modules/dexbot_cow_runtime.js.map +1 -1
- package/dist/modules/dexbot_maintenance_runtime.d.ts +6 -0
- package/dist/modules/dexbot_maintenance_runtime.d.ts.map +1 -1
- package/dist/modules/dexbot_maintenance_runtime.js +26 -5
- package/dist/modules/dexbot_maintenance_runtime.js.map +1 -1
- package/dist/modules/launcher/foreign_cred_daemon.d.ts +1 -1
- package/dist/modules/launcher/foreign_cred_daemon.js +1 -1
- package/dist/modules/launcher/supervisor_control.js +1 -1
- package/dist/modules/launcher/supervisor_control.js.map +1 -1
- package/dist/modules/order/async_lock.d.ts +25 -1
- package/dist/modules/order/async_lock.d.ts.map +1 -1
- package/dist/modules/order/async_lock.js +67 -6
- package/dist/modules/order/async_lock.js.map +1 -1
- package/dist/scripts/update.js +6 -6
- package/dist/scripts/update.js.map +1 -1
- package/dist/unlock.d.ts.map +1 -1
- package/dist/unlock.js +15 -14
- package/dist/unlock.js.map +1 -1
- package/package.json +15 -4
- package/scripts/postinstall.js +1 -1
|
@@ -0,0 +1,1340 @@
|
|
|
1
|
+
|
|
2
|
+
import { path } from '../../modules/path_api.js';
|
|
3
|
+
import { getStorage } from '../../modules/storage/index.js';
|
|
4
|
+
import { DEFAULT_CONFIG, GRID_LIMITS, INCREMENT_BOUNDS } from '../../modules/constants.js';
|
|
5
|
+
import { resolveRelativePrice } from '../../modules/order/utils/math.js';
|
|
6
|
+
import { Config } from '../../modules/config.js';
|
|
7
|
+
import { PATHS, getRecalculateTriggerFile } from '../../modules/paths.js';
|
|
8
|
+
import { writeJsonFileAtomic as baseWriteJsonFileAtomic } from '../../modules/bots_file_lock.js';
|
|
9
|
+
import { acquireFileLock } from '../../market_adapter/utils/file_lock.js';
|
|
10
|
+
import { assertNoDuplicateBotKeys } from '../../modules/bot_settings.js';
|
|
11
|
+
import { clone } from './utils.js';
|
|
12
|
+
const storage = getStorage();
|
|
13
|
+
|
|
14
|
+
import type { BotSettings, ProfileOptions, Logger, ClawProfileBundle } from './types.js';
|
|
15
|
+
import { getErrorMessage } from '../../modules/utils/errors.js';
|
|
16
|
+
|
|
17
|
+
const DEFAULT_MANIFEST_FILE = 'config.json';
|
|
18
|
+
const DEFAULT_BOTS_FILE = 'bots.json';
|
|
19
|
+
const DEFAULT_GENERAL_SETTINGS_FILE = 'general.settings.json';
|
|
20
|
+
const DEFAULT_MARKET_PROFILES_FILE = 'market_profiles.json';
|
|
21
|
+
const DEFAULT_ORDERS_DIR = 'orders';
|
|
22
|
+
|
|
23
|
+
const KNOWN_BOT_KEYS = new Set([
|
|
24
|
+
'active', 'activeOrders', 'assetA', 'assetAId', 'assetB', 'assetBId',
|
|
25
|
+
'botFunds', 'debtPolicy', 'dryRun', 'gridPrice',
|
|
26
|
+
'incrementPercent', 'maxPrice',
|
|
27
|
+
'minPrice', 'name', 'preferredAccount', 'startPrice', 'strategy',
|
|
28
|
+
'targetSpreadPercent', 'weightDistribution',
|
|
29
|
+
// Added by normalization
|
|
30
|
+
'botIndex', 'botKey'
|
|
31
|
+
]);
|
|
32
|
+
const BOT_SETTINGS_READ_ONLY_KEYS = new Set(['botIndex', 'botKey']);
|
|
33
|
+
const BOT_SETTINGS_TRIGGER_KEYS = new Set([
|
|
34
|
+
'active',
|
|
35
|
+
'activeOrders',
|
|
36
|
+
'assetA',
|
|
37
|
+
'assetAId',
|
|
38
|
+
'assetB',
|
|
39
|
+
'assetBId',
|
|
40
|
+
'botFunds',
|
|
41
|
+
'debtPolicy',
|
|
42
|
+
'dryRun',
|
|
43
|
+
'gridPrice',
|
|
44
|
+
'incrementPercent',
|
|
45
|
+
'maxPrice',
|
|
46
|
+
'minPrice',
|
|
47
|
+
'preferredAccount',
|
|
48
|
+
'startPrice',
|
|
49
|
+
'strategy',
|
|
50
|
+
'targetSpreadPercent',
|
|
51
|
+
'weightDistribution'
|
|
52
|
+
]);
|
|
53
|
+
const REQUIRED_BOT_KEY_ALIASES = {
|
|
54
|
+
assetA: ['assetA', 'assetAId'],
|
|
55
|
+
assetB: ['assetB', 'assetBId']
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const BOT_SETTINGS_NESTED_KEYS = Object.freeze({
|
|
59
|
+
activeOrders: new Set(['buy', 'sell']),
|
|
60
|
+
botFunds: new Set(['buy', 'sell']),
|
|
61
|
+
weightDistribution: new Set(['buy', 'sell'])
|
|
62
|
+
});
|
|
63
|
+
const BOT_SETTINGS_STATE_FIELDS = Object.freeze({
|
|
64
|
+
numeric: [
|
|
65
|
+
'incrementPercent',
|
|
66
|
+
'targetSpreadPercent'
|
|
67
|
+
],
|
|
68
|
+
boolean: [
|
|
69
|
+
'active',
|
|
70
|
+
'dryRun'
|
|
71
|
+
],
|
|
72
|
+
priceLike: [
|
|
73
|
+
'startPrice',
|
|
74
|
+
'gridPrice',
|
|
75
|
+
'minPrice',
|
|
76
|
+
'maxPrice'
|
|
77
|
+
],
|
|
78
|
+
string: [
|
|
79
|
+
'name',
|
|
80
|
+
'preferredAccount',
|
|
81
|
+
'assetA',
|
|
82
|
+
'assetB',
|
|
83
|
+
'assetAId',
|
|
84
|
+
'assetBId',
|
|
85
|
+
'strategy'
|
|
86
|
+
]
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
function isPlainObject(value: any) {
|
|
90
|
+
return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function isFiniteNumber(value: any) {
|
|
94
|
+
return typeof value === 'number' && Number.isFinite(value);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function isNumericString(value: any) {
|
|
98
|
+
if (typeof value !== 'string') {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const trimmed = value.trim();
|
|
103
|
+
return trimmed !== '' && Number.isFinite(Number(trimmed));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function isPositiveNumericString(value: any) {
|
|
107
|
+
if (!isNumericString(value)) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return Number(value.trim()) > 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function isPositiveMultiplierString(value: any) {
|
|
115
|
+
if (typeof value !== 'string') {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const trimmed = value.trim();
|
|
120
|
+
if (!/^[0-9]+(?:\.[0-9]+)?x$/i.test(trimmed)) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return parseFloat(trimmed) > 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function isPositivePriceLike(value: any) {
|
|
128
|
+
return (
|
|
129
|
+
(typeof value === 'number' && Number.isFinite(value) && value > 0) ||
|
|
130
|
+
isPositiveNumericString(value) ||
|
|
131
|
+
isPositiveMultiplierString(value)
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function resolveComparablePriceValue(value: any, startPrice: any = null, mode: string = 'min') {
|
|
136
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
137
|
+
return value;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (isNumericString(value)) {
|
|
141
|
+
return Number(value.trim());
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (typeof value === 'string' && Number.isFinite(startPrice)) {
|
|
145
|
+
const resolved = resolveRelativePrice(value, startPrice, mode);
|
|
146
|
+
return Number.isFinite(resolved) ? resolved : null;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function validateNestedBotSettingKeys(field: any, value: any, errors: any[]) {
|
|
153
|
+
const allowedKeys = (BOT_SETTINGS_NESTED_KEYS as any)[field];
|
|
154
|
+
if (!allowedKeys || !isPlainObject(value)) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const unknownKeys = Object.keys(value).filter((key) => !allowedKeys.has(key));
|
|
159
|
+
if (unknownKeys.length > 0) {
|
|
160
|
+
errors.push(`${field} contains unrecognized keys: ${unknownKeys.join(', ')}`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function normalizeBooleanField(value: any, fallback: any) {
|
|
165
|
+
if (value === undefined || value === null) {
|
|
166
|
+
return fallback;
|
|
167
|
+
}
|
|
168
|
+
if (typeof value === 'boolean') {
|
|
169
|
+
return value;
|
|
170
|
+
}
|
|
171
|
+
if (typeof value === 'string') {
|
|
172
|
+
const lowered = value.trim().toLowerCase();
|
|
173
|
+
if (['1', 'true', 'yes', 'on'].includes(lowered)) return true;
|
|
174
|
+
if (['0', 'false', 'no', 'off'].includes(lowered)) return false;
|
|
175
|
+
}
|
|
176
|
+
return fallback;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function normalizeNumberField(value: any, fallback: any) {
|
|
180
|
+
const numeric = Number(value);
|
|
181
|
+
return Number.isFinite(numeric) ? numeric : fallback;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function isPercentageString(value: any) {
|
|
185
|
+
if (typeof value !== 'string') {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const trimmed = value.trim();
|
|
190
|
+
if (!trimmed.endsWith('%')) {
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const numeric = Number(trimmed.slice(0, -1).trim());
|
|
195
|
+
return Number.isFinite(numeric);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function cloneBotSettings(value: any) {
|
|
199
|
+
if (value === undefined) {
|
|
200
|
+
return undefined;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return JSON.parse(JSON.stringify(value));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Normalize a partial bot settings object with defaults.
|
|
208
|
+
* Fills missing fields from DEFAULT_CONFIG and clamps values within bounds.
|
|
209
|
+
*/
|
|
210
|
+
function normalizeBotSettings(bot: Partial<BotSettings> = {}) {
|
|
211
|
+
const normalized = cloneBotSettings(bot) || {};
|
|
212
|
+
|
|
213
|
+
normalized.active = normalizeBooleanField(normalized.active, DEFAULT_CONFIG.active);
|
|
214
|
+
normalized.dryRun = normalizeBooleanField(normalized.dryRun, DEFAULT_CONFIG.dryRun);
|
|
215
|
+
normalized.startPrice = normalized.startPrice === undefined ? DEFAULT_CONFIG.startPrice : normalized.startPrice;
|
|
216
|
+
normalized.minPrice = normalized.minPrice === undefined ? DEFAULT_CONFIG.minPrice : normalized.minPrice;
|
|
217
|
+
normalized.maxPrice = normalized.maxPrice === undefined ? DEFAULT_CONFIG.maxPrice : normalized.maxPrice;
|
|
218
|
+
normalized.gridPrice = normalized.gridPrice === undefined ? DEFAULT_CONFIG.gridPrice : normalized.gridPrice;
|
|
219
|
+
normalized.incrementPercent = normalized.incrementPercent === undefined
|
|
220
|
+
? DEFAULT_CONFIG.incrementPercent
|
|
221
|
+
: normalizeNumberField(normalized.incrementPercent, DEFAULT_CONFIG.incrementPercent);
|
|
222
|
+
normalized.targetSpreadPercent = normalized.targetSpreadPercent === undefined
|
|
223
|
+
? DEFAULT_CONFIG.targetSpreadPercent
|
|
224
|
+
: normalizeNumberField(normalized.targetSpreadPercent, DEFAULT_CONFIG.targetSpreadPercent);
|
|
225
|
+
normalized.weightDistribution = {
|
|
226
|
+
...cloneBotSettings(DEFAULT_CONFIG.weightDistribution),
|
|
227
|
+
...(isPlainObject(normalized.weightDistribution) ? normalized.weightDistribution : {})
|
|
228
|
+
};
|
|
229
|
+
normalized.botFunds = {
|
|
230
|
+
...cloneBotSettings(DEFAULT_CONFIG.botFunds),
|
|
231
|
+
...(isPlainObject(normalized.botFunds) ? normalized.botFunds : {})
|
|
232
|
+
};
|
|
233
|
+
normalized.activeOrders = {
|
|
234
|
+
...cloneBotSettings(DEFAULT_CONFIG.activeOrders),
|
|
235
|
+
...(isPlainObject(normalized.activeOrders) ? normalized.activeOrders : {})
|
|
236
|
+
};
|
|
237
|
+
return normalized;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function mergeBotSettingsPatch(currentBot: Record<string, any> = {}, patch: Record<string, any> = {}) {
|
|
241
|
+
const next = cloneBotSettings(currentBot) || {};
|
|
242
|
+
const patchKeys = Object.keys(patch || {});
|
|
243
|
+
|
|
244
|
+
for (const key of patchKeys) {
|
|
245
|
+
const value = patch[key];
|
|
246
|
+
if (value === undefined) {
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (['weightDistribution', 'botFunds', 'activeOrders'].includes(key) && isPlainObject(value)) {
|
|
251
|
+
next[key] = {
|
|
252
|
+
...(isPlainObject(next[key]) ? next[key] : {}),
|
|
253
|
+
...value
|
|
254
|
+
};
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
next[key] = value;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return next;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Describe which bot settings are read-only vs writable, and which trigger a recalc.
|
|
266
|
+
* Useful for tool-catalog generation and consumer-side validation.
|
|
267
|
+
*/
|
|
268
|
+
function describeBotSettingMutability() {
|
|
269
|
+
const readOnly = [...BOT_SETTINGS_READ_ONLY_KEYS].sort();
|
|
270
|
+
const writable = [...KNOWN_BOT_KEYS].filter((key) => !BOT_SETTINGS_READ_ONLY_KEYS.has(key)).sort();
|
|
271
|
+
|
|
272
|
+
return {
|
|
273
|
+
readOnly,
|
|
274
|
+
triggerOnChange: [...BOT_SETTINGS_TRIGGER_KEYS].sort(),
|
|
275
|
+
writable
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
function validateBotSettingsValue(field: any, value: any, errors: any[]) {
|
|
280
|
+
const push = (message: any) => errors.push(message);
|
|
281
|
+
|
|
282
|
+
switch (field) {
|
|
283
|
+
case 'active':
|
|
284
|
+
case 'dryRun':
|
|
285
|
+
if (typeof value !== 'boolean') {
|
|
286
|
+
push(`${field} must be a boolean`);
|
|
287
|
+
}
|
|
288
|
+
break;
|
|
289
|
+
|
|
290
|
+
case 'name':
|
|
291
|
+
case 'preferredAccount':
|
|
292
|
+
case 'assetA':
|
|
293
|
+
case 'assetB':
|
|
294
|
+
case 'strategy':
|
|
295
|
+
if (typeof value !== 'string' || value.trim() === '') {
|
|
296
|
+
push(`${field} must be a non-empty string`);
|
|
297
|
+
}
|
|
298
|
+
break;
|
|
299
|
+
|
|
300
|
+
case 'assetAId':
|
|
301
|
+
case 'assetBId':
|
|
302
|
+
if (typeof value !== 'string' || value.trim() === '') {
|
|
303
|
+
push(`${field} must be a non-empty string`);
|
|
304
|
+
}
|
|
305
|
+
break;
|
|
306
|
+
|
|
307
|
+
case 'incrementPercent': {
|
|
308
|
+
const increment = Number(value);
|
|
309
|
+
if (!Number.isFinite(increment) || increment <= 0) {
|
|
310
|
+
push('incrementPercent must be a positive number');
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
if (Number.isFinite(INCREMENT_BOUNDS.MIN_PERCENT) && increment < INCREMENT_BOUNDS.MIN_PERCENT) {
|
|
314
|
+
push(`incrementPercent must be >= ${INCREMENT_BOUNDS.MIN_PERCENT}`);
|
|
315
|
+
}
|
|
316
|
+
if (Number.isFinite(INCREMENT_BOUNDS.MAX_PERCENT) && increment > INCREMENT_BOUNDS.MAX_PERCENT) {
|
|
317
|
+
push(`incrementPercent must be <= ${INCREMENT_BOUNDS.MAX_PERCENT}`);
|
|
318
|
+
}
|
|
319
|
+
break;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
case 'targetSpreadPercent': {
|
|
323
|
+
const spread = Number(value);
|
|
324
|
+
if (!Number.isFinite(spread) || spread <= 0) {
|
|
325
|
+
push('targetSpreadPercent must be a positive number');
|
|
326
|
+
}
|
|
327
|
+
break;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
case 'startPrice':
|
|
331
|
+
if (!isPositivePriceLike(value)
|
|
332
|
+
&& !(typeof value === 'string' && ['pool', 'book'].includes(value.toLowerCase()))) {
|
|
333
|
+
push('startPrice must be a positive number, "pool", or "book"');
|
|
334
|
+
}
|
|
335
|
+
break;
|
|
336
|
+
|
|
337
|
+
case 'gridPrice':
|
|
338
|
+
if (value !== null
|
|
339
|
+
&& !isPositivePriceLike(value)
|
|
340
|
+
&& !(typeof value === 'string' && /^(pool|book|ama(?:[1-4])?)$/i.test(value))) {
|
|
341
|
+
push('gridPrice must be null, a positive number, or one of pool/book/ama/ama1..ama4');
|
|
342
|
+
}
|
|
343
|
+
break;
|
|
344
|
+
|
|
345
|
+
case 'minPrice':
|
|
346
|
+
case 'maxPrice':
|
|
347
|
+
if (!isPositivePriceLike(value)) {
|
|
348
|
+
push(`${field} must be a positive number or a multiplier string like 3x`);
|
|
349
|
+
}
|
|
350
|
+
break;
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
case 'weightDistribution':
|
|
355
|
+
if (!isPlainObject(value)) {
|
|
356
|
+
push('weightDistribution must be an object with sell and buy');
|
|
357
|
+
break;
|
|
358
|
+
}
|
|
359
|
+
validateNestedBotSettingKeys('weightDistribution', value, errors);
|
|
360
|
+
if (!isFiniteNumber(value.sell)) {
|
|
361
|
+
push('weightDistribution.sell must be a finite number');
|
|
362
|
+
}
|
|
363
|
+
if (!isFiniteNumber(value.buy)) {
|
|
364
|
+
push('weightDistribution.buy must be a finite number');
|
|
365
|
+
}
|
|
366
|
+
break;
|
|
367
|
+
|
|
368
|
+
case 'botFunds':
|
|
369
|
+
if (!isPlainObject(value)) {
|
|
370
|
+
push('botFunds must be an object with sell and buy');
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
validateNestedBotSettingKeys('botFunds', value, errors);
|
|
374
|
+
for (const side of ['sell', 'buy']) {
|
|
375
|
+
const sideValue = value[side];
|
|
376
|
+
if (sideValue === undefined) {
|
|
377
|
+
continue;
|
|
378
|
+
}
|
|
379
|
+
if (typeof sideValue === 'number') {
|
|
380
|
+
if (!Number.isFinite(sideValue) || sideValue < 0) {
|
|
381
|
+
push(`botFunds.${side} must be a finite number greater than or equal to 0`);
|
|
382
|
+
}
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
if (typeof sideValue === 'string' && isPercentageString(sideValue)) {
|
|
386
|
+
const numeric = Number(sideValue.trim().slice(0, -1).trim());
|
|
387
|
+
if (numeric < 0) {
|
|
388
|
+
push(`botFunds.${side} percentage must be greater than or equal to 0`);
|
|
389
|
+
}
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
push(`botFunds.${side} must be a finite number or a percentage string`);
|
|
393
|
+
}
|
|
394
|
+
break;
|
|
395
|
+
|
|
396
|
+
case 'activeOrders':
|
|
397
|
+
if (!isPlainObject(value)) {
|
|
398
|
+
push('activeOrders must be an object with sell and buy');
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
validateNestedBotSettingKeys('activeOrders', value, errors);
|
|
402
|
+
for (const side of ['sell', 'buy']) {
|
|
403
|
+
const sideValue = value[side];
|
|
404
|
+
if (sideValue === undefined) {
|
|
405
|
+
continue;
|
|
406
|
+
}
|
|
407
|
+
if (!Number.isInteger(Number(sideValue)) || Number(sideValue) < 0) {
|
|
408
|
+
push(`activeOrders.${side} must be an integer greater than or equal to 0`);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
break;
|
|
412
|
+
|
|
413
|
+
case 'debtPolicy':
|
|
414
|
+
if (value !== undefined && value !== null && typeof value !== 'object') {
|
|
415
|
+
push('debtPolicy must be an object');
|
|
416
|
+
break;
|
|
417
|
+
}
|
|
418
|
+
if (value && typeof value === 'object') {
|
|
419
|
+
const lending = Array.isArray(value.lending) ? value.lending : [];
|
|
420
|
+
for (let i = 0; i < lending.length; i++) {
|
|
421
|
+
const item = lending[i];
|
|
422
|
+
if (!item || typeof item !== 'object') {
|
|
423
|
+
push(`debtPolicy.lending[${i}] must be an object`);
|
|
424
|
+
continue;
|
|
425
|
+
}
|
|
426
|
+
if (!item.type || !['mpa', 'creditOffer'].includes(item.type)) {
|
|
427
|
+
push(`debtPolicy.lending[${i}].type must be "mpa" or "creditOffer"`);
|
|
428
|
+
}
|
|
429
|
+
if (!item.collateralAsset || typeof item.collateralAsset !== 'string') {
|
|
430
|
+
push(`debtPolicy.lending[${i}].collateralAsset must be a non-empty string`);
|
|
431
|
+
}
|
|
432
|
+
if (!item.asset || typeof item.asset !== 'string') {
|
|
433
|
+
push(`debtPolicy.lending[${i}].asset must be a non-empty string`);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
break;
|
|
438
|
+
|
|
439
|
+
case 'botIndex':
|
|
440
|
+
case 'botKey':
|
|
441
|
+
push(`${field} is read-only`);
|
|
442
|
+
break;
|
|
443
|
+
|
|
444
|
+
default:
|
|
445
|
+
break;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Validate a bot settings object against known keys, nested-key schemas, and bounds.
|
|
451
|
+
* Returns collected errors and warnings without mutating the input.
|
|
452
|
+
*/
|
|
453
|
+
function validateBotSettingsState(bot: Record<string, any> = {}) {
|
|
454
|
+
const errors: string[] = [];
|
|
455
|
+
const warnings = [];
|
|
456
|
+
|
|
457
|
+
for (const field of Object.keys(BOT_SETTINGS_NESTED_KEYS)) {
|
|
458
|
+
if (bot[field] !== undefined) {
|
|
459
|
+
validateBotSettingsValue(field, bot[field], errors);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
for (const field of [
|
|
464
|
+
...BOT_SETTINGS_STATE_FIELDS.boolean,
|
|
465
|
+
...BOT_SETTINGS_STATE_FIELDS.numeric,
|
|
466
|
+
...BOT_SETTINGS_STATE_FIELDS.priceLike
|
|
467
|
+
].filter((field) => !(BOT_SETTINGS_NESTED_KEYS as any)[field])) {
|
|
468
|
+
if (bot[field] !== undefined) {
|
|
469
|
+
validateBotSettingsValue(field, bot[field], errors);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
for (const field of BOT_SETTINGS_STATE_FIELDS.string.filter((field) => !(BOT_SETTINGS_NESTED_KEYS as any)[field])) {
|
|
474
|
+
if (bot[field] !== undefined) {
|
|
475
|
+
validateBotSettingsValue(field, bot[field], errors);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
const increment = Number(bot.incrementPercent);
|
|
480
|
+
const spread = Number(bot.targetSpreadPercent);
|
|
481
|
+
if (Number.isFinite(increment) && Number.isFinite(spread)) {
|
|
482
|
+
const minSpread = increment * GRID_LIMITS.MIN_SPREAD_FACTOR;
|
|
483
|
+
if (spread + Number.EPSILON < minSpread) {
|
|
484
|
+
errors.push(`targetSpreadPercent must be >= ${GRID_LIMITS.MIN_SPREAD_FACTOR}x incrementPercent (${minSpread.toFixed(6)})`);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
const resolvedStartPrice = resolveComparablePriceValue(bot.startPrice);
|
|
489
|
+
const resolvedMinPrice = resolveComparablePriceValue(bot.minPrice, resolvedStartPrice, 'min');
|
|
490
|
+
const resolvedMaxPrice = resolveComparablePriceValue(bot.maxPrice, resolvedStartPrice, 'max');
|
|
491
|
+
if (resolvedMinPrice !== null && resolvedMaxPrice !== null) {
|
|
492
|
+
if (resolvedMinPrice >= resolvedMaxPrice) {
|
|
493
|
+
errors.push('minPrice must be less than maxPrice');
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
if (resolvedStartPrice !== null) {
|
|
498
|
+
if (resolvedMinPrice !== null && resolvedStartPrice < resolvedMinPrice) {
|
|
499
|
+
errors.push('startPrice must be greater than or equal to minPrice');
|
|
500
|
+
}
|
|
501
|
+
if (resolvedMaxPrice !== null && resolvedStartPrice > resolvedMaxPrice) {
|
|
502
|
+
errors.push('startPrice must be less than or equal to maxPrice');
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
const unknownKeys = Object.keys(bot).filter((key) => !KNOWN_BOT_KEYS.has(key));
|
|
507
|
+
if (unknownKeys.length > 0) {
|
|
508
|
+
warnings.push(`unrecognized keys: ${unknownKeys.join(', ')}`);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
return {
|
|
512
|
+
errors,
|
|
513
|
+
warnings,
|
|
514
|
+
valid: errors.length === 0
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Validate a partial patch against a current bot's settings.
|
|
520
|
+
* Returns validation result with merged settings, errors, warnings, and trigger-required flag.
|
|
521
|
+
*/
|
|
522
|
+
function validateBotSettingsPatch(patch: Record<string, any> = {}, currentBot: Record<string, any> = {}, options: Partial<ProfileOptions> = {}) {
|
|
523
|
+
const errors: string[] = [];
|
|
524
|
+
const warnings = [];
|
|
525
|
+
const patchKeys = Object.keys(patch || {});
|
|
526
|
+
const allowUnknownKeys = Boolean(options.allowUnknownKeys);
|
|
527
|
+
|
|
528
|
+
if (!isPlainObject(patch)) {
|
|
529
|
+
return {
|
|
530
|
+
errors: ['patch must be a non-null object'],
|
|
531
|
+
merged: cloneBotSettings(currentBot) || {},
|
|
532
|
+
patchKeys: [],
|
|
533
|
+
triggerRequired: false,
|
|
534
|
+
valid: false,
|
|
535
|
+
warnings: []
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
for (const key of patchKeys) {
|
|
540
|
+
if (!KNOWN_BOT_KEYS.has(key)) {
|
|
541
|
+
if (allowUnknownKeys) {
|
|
542
|
+
warnings.push(`unrecognized patch key: ${key}`);
|
|
543
|
+
} else {
|
|
544
|
+
errors.push(`unrecognized patch key: ${key}`);
|
|
545
|
+
}
|
|
546
|
+
continue;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
if (['weightDistribution', 'botFunds', 'activeOrders'].includes(key) && isPlainObject(patch[key])) {
|
|
550
|
+
validateNestedBotSettingKeys(key, patch[key], errors);
|
|
551
|
+
const mergedField = {
|
|
552
|
+
...(isPlainObject(currentBot[key]) ? currentBot[key] : {}),
|
|
553
|
+
...patch[key]
|
|
554
|
+
};
|
|
555
|
+
validateBotSettingsValue(key, mergedField, errors);
|
|
556
|
+
continue;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
validateBotSettingsValue(key, patch[key], errors);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
const merged = mergeBotSettingsPatch(currentBot, patch);
|
|
563
|
+
const mergedValidation = validateBotSettingsState(normalizeBotSettings(merged));
|
|
564
|
+
errors.push(...mergedValidation.errors.filter((entry) => !errors.includes(entry)));
|
|
565
|
+
warnings.push(...mergedValidation.warnings);
|
|
566
|
+
|
|
567
|
+
const triggerRequired = patchKeys.some((key) => BOT_SETTINGS_TRIGGER_KEYS.has(key));
|
|
568
|
+
|
|
569
|
+
return {
|
|
570
|
+
errors,
|
|
571
|
+
merged,
|
|
572
|
+
patchKeys,
|
|
573
|
+
triggerRequired,
|
|
574
|
+
valid: errors.length === 0,
|
|
575
|
+
warnings
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
function buildBotSettingsView(bot: Record<string, any> | null, bundle: ClawProfileBundle | null, options: Record<string, any> = {}) {
|
|
580
|
+
const current = cloneBotSettings(bot) || null;
|
|
581
|
+
const effective = current ? normalizeBotSettings(current) : null;
|
|
582
|
+
const currentValidation = current ? validateBotSettingsState(current) : { errors: [], warnings: [], valid: true };
|
|
583
|
+
const effectiveValidation = effective ? validateBotSettingsState(effective) : { errors: [], warnings: [], valid: true };
|
|
584
|
+
const mutability = describeBotSettingMutability();
|
|
585
|
+
const b = bundle as any;
|
|
586
|
+
const selectedBotFiles = current && bundle ? {
|
|
587
|
+
gridPriceSnapshot: path.join(b.ordersDir || path.join(b.profilesDir, DEFAULT_ORDERS_DIR), `${current.botKey}.dynamicgrid.json`),
|
|
588
|
+
orderSnapshot: path.join(b.ordersDir || path.join(b.profilesDir, DEFAULT_ORDERS_DIR), `${current.botKey}.json`),
|
|
589
|
+
trigger: path.join(b.profilesDir, `recalculate.${current.botKey}.trigger`)
|
|
590
|
+
} : null;
|
|
591
|
+
|
|
592
|
+
return {
|
|
593
|
+
current,
|
|
594
|
+
defaults: cloneBotSettings(DEFAULT_CONFIG),
|
|
595
|
+
effective,
|
|
596
|
+
files: selectedBotFiles,
|
|
597
|
+
identifier: options.identifier || null,
|
|
598
|
+
mutability,
|
|
599
|
+
rawValidation: currentValidation,
|
|
600
|
+
validation: effectiveValidation
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Sanitize an arbitrary value into a lowercase, hyphenated bot-key string.
|
|
606
|
+
*/
|
|
607
|
+
function sanitizeKey(source: any) {
|
|
608
|
+
if (!source) return 'bot';
|
|
609
|
+
return String(source)
|
|
610
|
+
.trim()
|
|
611
|
+
.toLowerCase()
|
|
612
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
613
|
+
.replace(/^-+|-+$/g, '') || 'bot';
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
function createBotKey(bot: any, index: any) {
|
|
617
|
+
if (bot && bot.name) {
|
|
618
|
+
return sanitizeKey(bot.name);
|
|
619
|
+
}
|
|
620
|
+
const identifier = bot && bot.assetA && bot.assetB
|
|
621
|
+
? `${bot.assetA}/${bot.assetB}`
|
|
622
|
+
: bot && bot.assetAId && bot.assetBId
|
|
623
|
+
? `${bot.assetAId}/${bot.assetBId}`
|
|
624
|
+
: `bot-${index}`;
|
|
625
|
+
return `${sanitizeKey(identifier)}-${index}`;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Extract raw bot entries from a bots.json settings object.
|
|
630
|
+
* Handles both array format ({ bots: [...] }) and single-bot object format.
|
|
631
|
+
*/
|
|
632
|
+
function resolveRawBotEntries(settings: any) {
|
|
633
|
+
if (!settings || typeof settings !== 'object') return [];
|
|
634
|
+
if (Array.isArray(settings.bots)) return settings.bots;
|
|
635
|
+
if (Object.keys(settings).length > 0) return [settings];
|
|
636
|
+
return [];
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Validate a single bot entry for required keys and aliases.
|
|
641
|
+
* Emits warnings via logger for missing required fields.
|
|
642
|
+
*/
|
|
643
|
+
function validateBotEntry(entry: any, index: any, logger: any) {
|
|
644
|
+
const warnings = [];
|
|
645
|
+
|
|
646
|
+
for (const [label, aliases] of Object.entries(REQUIRED_BOT_KEY_ALIASES)) {
|
|
647
|
+
const hasAnyAlias = aliases.some((key) => {
|
|
648
|
+
const value = entry[key];
|
|
649
|
+
return value !== undefined && value !== null && value !== '';
|
|
650
|
+
});
|
|
651
|
+
if (!hasAnyAlias) {
|
|
652
|
+
warnings.push(`bot[${index}]: missing required key '${label}'`);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
const unrecognizedKeys = [];
|
|
657
|
+
for (const key of Object.keys(entry)) {
|
|
658
|
+
if (!KNOWN_BOT_KEYS.has(key)) {
|
|
659
|
+
unrecognizedKeys.push(key);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
if (logger && warnings.length > 0) {
|
|
664
|
+
const warnFn = (typeof logger?.warn === 'function' ? logger.warn : typeof logger?.log === 'function' ? logger.log : console.warn);
|
|
665
|
+
for (const warning of warnings) {
|
|
666
|
+
warnFn.call(logger, `[dexbot-profiles] ${warning}`);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
if (logger && unrecognizedKeys.length > 0) {
|
|
670
|
+
const debugFn = (typeof logger?.debug === 'function' ? logger.debug : typeof logger?.log === 'function' ? logger.log : console.debug);
|
|
671
|
+
debugFn.call(logger, `[dexbot-profiles] bot[${index}]: unrecognized keys: ${unrecognizedKeys.join(', ')}`);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
return warnings;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* Normalize an array of raw bot entries — clones, assigns keys and indices, applies defaults.
|
|
679
|
+
*/
|
|
680
|
+
async function normalizeBotEntries(rawEntries: Record<string, any>[], options: Partial<ProfileOptions> = {}) {
|
|
681
|
+
const logger = options.logger || null;
|
|
682
|
+
const results: any[] = [];
|
|
683
|
+
for (const [index, entry] of rawEntries.entries()) {
|
|
684
|
+
if (logger) {
|
|
685
|
+
validateBotEntry(entry, index, logger);
|
|
686
|
+
}
|
|
687
|
+
const normalized = { active: entry.active === undefined ? true : !!entry.active, ...entry };
|
|
688
|
+
results.push({ ...normalized, botIndex: index, botKey: createBotKey(normalized, index) });
|
|
689
|
+
}
|
|
690
|
+
return results;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
function isFileLike(targetPath: any) {
|
|
695
|
+
try {
|
|
696
|
+
return storage.exists(targetPath) && storage.stat(targetPath).isFile();
|
|
697
|
+
} catch {
|
|
698
|
+
return false;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
function isDirectoryLike(targetPath: any) {
|
|
703
|
+
try {
|
|
704
|
+
return storage.exists(targetPath) && storage.stat(targetPath).isDirectory();
|
|
705
|
+
} catch {
|
|
706
|
+
return false;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Resolve the profiles directory from a profile root path.
|
|
712
|
+
* Checks root itself, root/profiles, and returns the first match.
|
|
713
|
+
*/
|
|
714
|
+
function resolveProfilesDir(profileRoot: any) {
|
|
715
|
+
const candidates = [];
|
|
716
|
+
const root = profileRoot ? path.resolve(profileRoot) : null;
|
|
717
|
+
|
|
718
|
+
if (root) {
|
|
719
|
+
candidates.push(root);
|
|
720
|
+
candidates.push(path.join(root, 'profiles'));
|
|
721
|
+
if (path.basename(root) === 'profiles') {
|
|
722
|
+
candidates.push(path.dirname(root));
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
if (Config.DEXBOT_PROFILE_ROOT) {
|
|
727
|
+
const envRoot = path.resolve(Config.DEXBOT_PROFILE_ROOT);
|
|
728
|
+
candidates.push(envRoot);
|
|
729
|
+
candidates.push(path.join(envRoot, 'profiles'));
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
if (Config.CWD) candidates.push(path.resolve(Config.CWD, 'profiles'));
|
|
733
|
+
|
|
734
|
+
for (const candidate of candidates) {
|
|
735
|
+
if (isFileLike(candidate)) {
|
|
736
|
+
return path.dirname(candidate);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
if (!isDirectoryLike(candidate)) {
|
|
740
|
+
continue;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
const manifestFile = path.join(candidate, DEFAULT_MANIFEST_FILE);
|
|
744
|
+
const botsFile = path.join(candidate, DEFAULT_BOTS_FILE);
|
|
745
|
+
const generalSettingsFile = path.join(candidate, DEFAULT_GENERAL_SETTINGS_FILE);
|
|
746
|
+
const marketProfilesFile = path.join(candidate, DEFAULT_MARKET_PROFILES_FILE);
|
|
747
|
+
|
|
748
|
+
if (
|
|
749
|
+
storage.exists(manifestFile) ||
|
|
750
|
+
storage.exists(botsFile) ||
|
|
751
|
+
storage.exists(generalSettingsFile) ||
|
|
752
|
+
storage.exists(marketProfilesFile)
|
|
753
|
+
) {
|
|
754
|
+
return candidate;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
if (root && isDirectoryLike(root)) {
|
|
759
|
+
return root;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
return Config.CWD ? path.resolve(Config.CWD, 'profiles') : PATHS.PROFILES_DIR;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
function readJsonFile(filePath: any) {
|
|
766
|
+
try {
|
|
767
|
+
return storage.readJSON(filePath);
|
|
768
|
+
} catch (error: any) {
|
|
769
|
+
if (error && error.code === 'ENOENT') {
|
|
770
|
+
return null;
|
|
771
|
+
}
|
|
772
|
+
throw new Error(`Failed to read ${filePath}: ${getErrorMessage(error)}`);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
function writeTextPayload(filePath: any, content: any) {
|
|
777
|
+
storage.writeFile(filePath, `${content}\n`, 'utf8');
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* Write JSON data atomically via file lock.
|
|
782
|
+
* Acquires a lock on the target path, delegates to the shared atomic-write helper, then releases.
|
|
783
|
+
*/
|
|
784
|
+
async function writeJsonFileAtomic(filePath: any, data: any) {
|
|
785
|
+
const release = await acquireFileLock(filePath);
|
|
786
|
+
try {
|
|
787
|
+
baseWriteJsonFileAtomic(filePath, data);
|
|
788
|
+
} finally {
|
|
789
|
+
await release();
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* Read a recalculate-trigger file and return its parsed payload.
|
|
795
|
+
* Returns { exists, payload } — payload is null if empty or unparseable.
|
|
796
|
+
*/
|
|
797
|
+
function readTriggerFile(triggerPath: any) {
|
|
798
|
+
try {
|
|
799
|
+
const raw = storage.readFile(triggerPath, 'utf8');
|
|
800
|
+
const trimmed = raw.trim();
|
|
801
|
+
if (!trimmed) return { exists: true, payload: null };
|
|
802
|
+
try {
|
|
803
|
+
return { exists: true, payload: JSON.parse(trimmed) };
|
|
804
|
+
} catch {
|
|
805
|
+
return { exists: true, payload: trimmed };
|
|
806
|
+
}
|
|
807
|
+
} catch (err: any) {
|
|
808
|
+
if (err.code === 'ENOENT') return { exists: false, payload: null };
|
|
809
|
+
throw err;
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
function listFiles(dirPath: any) {
|
|
814
|
+
try {
|
|
815
|
+
return storage.readdir(dirPath).filter((name: string) => {
|
|
816
|
+
const stat = storage.stat(path.join(dirPath, name));
|
|
817
|
+
return stat.isFile();
|
|
818
|
+
}).sort();
|
|
819
|
+
} catch (error: any) {
|
|
820
|
+
if (error && error.code === 'ENOENT') {
|
|
821
|
+
return [];
|
|
822
|
+
}
|
|
823
|
+
throw new Error(`Failed to list ${dirPath}: ${getErrorMessage(error)}`);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* Match a bot entry against an identifier (string key, numeric index, or object ref).
|
|
829
|
+
*/
|
|
830
|
+
function matchBotIdentifier(bot: any, identifier: any) {
|
|
831
|
+
if (!bot || identifier === null || identifier === undefined) {
|
|
832
|
+
return false;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
if (typeof identifier === 'object') {
|
|
836
|
+
if (identifier.botKey && bot.botKey === identifier.botKey) {
|
|
837
|
+
return true;
|
|
838
|
+
}
|
|
839
|
+
if (identifier.name && bot.name === identifier.name) {
|
|
840
|
+
return true;
|
|
841
|
+
}
|
|
842
|
+
if (identifier.assetA && identifier.assetB && bot.assetA === identifier.assetA && bot.assetB === identifier.assetB) {
|
|
843
|
+
return true;
|
|
844
|
+
}
|
|
845
|
+
if (identifier.assetAId && identifier.assetBId) {
|
|
846
|
+
const botAId = bot.assetAId || null;
|
|
847
|
+
const botBId = bot.assetBId || null;
|
|
848
|
+
if (botAId === identifier.assetAId && botBId === identifier.assetBId) {
|
|
849
|
+
return true;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
return false;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
const value = String(identifier).trim();
|
|
856
|
+
if (!value) {
|
|
857
|
+
return false;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
if (bot.botKey === value || bot.name === value) {
|
|
861
|
+
return true;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
if (bot.assetA && bot.assetB && `${bot.assetA}/${bot.assetB}` === value) {
|
|
865
|
+
return true;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
if (bot.assetAId && bot.assetBId && `${bot.assetAId}/${bot.assetBId}` === value) {
|
|
869
|
+
return true;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
// Cross-match: identifier may use IDs while bot has symbols, or vice versa
|
|
873
|
+
const [pairA, pairB] = value.includes('/') ? value.split('/', 2) : [null, null];
|
|
874
|
+
if (pairA && pairB) {
|
|
875
|
+
const botA = bot.assetA || bot.assetAId || null;
|
|
876
|
+
const botB = bot.assetB || bot.assetBId || null;
|
|
877
|
+
if (botA && botB && pairA === botA && pairB === botB) {
|
|
878
|
+
return true;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
return sanitizeKey(bot.name) === sanitizeKey(value);
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
function findAmaProfile(bundle: any, bot: any) {
|
|
886
|
+
const profiles = Array.isArray(bundle?.amaProfiles?.profiles) ? bundle.amaProfiles.profiles : [];
|
|
887
|
+
if (profiles.length === 0 || !bot) {
|
|
888
|
+
return null;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
const botAssetA = bot.assetAId || bot.assetA || null;
|
|
892
|
+
const botAssetB = bot.assetBId || bot.assetB || null;
|
|
893
|
+
|
|
894
|
+
const match = profiles.find((profile: any) => {
|
|
895
|
+
if (!profile || typeof profile !== 'object') {
|
|
896
|
+
return false;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
const profileAssetA = profile.assetAId || profile.assetA || null;
|
|
900
|
+
const profileAssetB = profile.assetBId || profile.assetB || null;
|
|
901
|
+
|
|
902
|
+
return profileAssetA === botAssetA && profileAssetB === botAssetB;
|
|
903
|
+
});
|
|
904
|
+
|
|
905
|
+
return match ? clone(match) : null;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
/**
|
|
909
|
+
* Build a profile context object for a specific bot from a loaded bundle.
|
|
910
|
+
* Returns the current settings view, active state, and market context.
|
|
911
|
+
*/
|
|
912
|
+
function buildClawProfileContext(bundle: Record<string, any>, options: Partial<ProfileOptions> = {}) {
|
|
913
|
+
if (!bundle || typeof bundle !== 'object') {
|
|
914
|
+
return null;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
const botIdentifier = options.botIdentifier || options.botRef || options.botKey || options.name || null;
|
|
918
|
+
const selectedBot =
|
|
919
|
+
options.selectedBot ||
|
|
920
|
+
(botIdentifier ? bundle.bots.find((bot: any) => matchBotIdentifier(bot, botIdentifier)) : null) ||
|
|
921
|
+
bundle.activeBots[0] ||
|
|
922
|
+
bundle.bots[0] ||
|
|
923
|
+
null;
|
|
924
|
+
|
|
925
|
+
const selectedAmaProfile = findAmaProfile(bundle, selectedBot);
|
|
926
|
+
const selectedOrderSnapshotPath = selectedBot ? path.join(bundle.ordersDir, `${selectedBot.botKey}.json`) : null;
|
|
927
|
+
const selectedGridPriceSnapshotPath = selectedBot ? path.join(bundle.ordersDir, `${selectedBot.botKey}.dynamicgrid.json`) : null;
|
|
928
|
+
const selectedTriggerPath = selectedBot ? path.join(bundle.profilesDir, `recalculate.${selectedBot.botKey}.trigger`) : null;
|
|
929
|
+
const selectedOrderSnapshot = selectedBot
|
|
930
|
+
? clone(options.orderSnapshot !== undefined ? options.orderSnapshot : null)
|
|
931
|
+
: null;
|
|
932
|
+
const selectedGridPriceSnapshot = selectedBot
|
|
933
|
+
? clone(options.gridPriceSnapshot !== undefined ? options.gridPriceSnapshot : null)
|
|
934
|
+
: null;
|
|
935
|
+
|
|
936
|
+
return {
|
|
937
|
+
profileRoot: bundle.profilesDir,
|
|
938
|
+
runtime: {
|
|
939
|
+
loadedAt: new Date().toISOString(),
|
|
940
|
+
selectedBotRef: botIdentifier,
|
|
941
|
+
sourceFiles: clone(bundle.files)
|
|
942
|
+
},
|
|
943
|
+
settings: {
|
|
944
|
+
amaProfiles: clone(bundle.amaProfiles),
|
|
945
|
+
bots: clone(bundle.bots),
|
|
946
|
+
general: clone(bundle.generalSettings),
|
|
947
|
+
manifest: clone(bundle.manifest)
|
|
948
|
+
},
|
|
949
|
+
selectedBot: selectedBot ? clone(selectedBot) : null,
|
|
950
|
+
selectedBotFiles: selectedBot ? {
|
|
951
|
+
gridPriceSnapshot: selectedGridPriceSnapshotPath,
|
|
952
|
+
orderSnapshot: selectedOrderSnapshotPath,
|
|
953
|
+
trigger: selectedTriggerPath
|
|
954
|
+
} : null,
|
|
955
|
+
selectedBotState: selectedBot ? {
|
|
956
|
+
gridPriceSnapshot: selectedGridPriceSnapshot,
|
|
957
|
+
orderSnapshot: selectedOrderSnapshot,
|
|
958
|
+
selectedAmaProfile,
|
|
959
|
+
triggerExists: selectedTriggerPath ? storage.exists(selectedTriggerPath) : false,
|
|
960
|
+
triggerPayload: options.triggerPayload !== undefined ? options.triggerPayload : null
|
|
961
|
+
} : null,
|
|
962
|
+
summary: {
|
|
963
|
+
activeBotCount: bundle.activeBots.length,
|
|
964
|
+
amaProfileCount: Array.isArray(bundle.amaProfiles?.profiles) ? bundle.amaProfiles.profiles.length : 0,
|
|
965
|
+
botCount: bundle.bots.length,
|
|
966
|
+
hasAmaProfiles: Boolean(bundle.amaProfiles),
|
|
967
|
+
hasGeneralSettings: Boolean(bundle.generalSettings),
|
|
968
|
+
hasManifest: Boolean(bundle.manifest),
|
|
969
|
+
orderFileCount: bundle.orderFiles.length
|
|
970
|
+
}
|
|
971
|
+
};
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* Load the full DEXBot2 profile bundle from disk: bots.json, general.settings.json,
|
|
976
|
+
* market_profiles.json, and order snapshots. Returns normalized parsings of each.
|
|
977
|
+
*/
|
|
978
|
+
async function loadDexbotProfileBundle(profileRoot: string | null, options: Partial<ProfileOptions> = {}) {
|
|
979
|
+
const profilesDir = resolveProfilesDir(profileRoot || options.profileRoot);
|
|
980
|
+
const ordersDir = path.join(profilesDir, DEFAULT_ORDERS_DIR);
|
|
981
|
+
const manifestFile = options.manifestFile || path.join(profilesDir, DEFAULT_MANIFEST_FILE);
|
|
982
|
+
const botsFile = options.botsFile || path.join(profilesDir, DEFAULT_BOTS_FILE);
|
|
983
|
+
const generalSettingsFile = options.generalSettingsFile || path.join(profilesDir, DEFAULT_GENERAL_SETTINGS_FILE);
|
|
984
|
+
const marketProfilesFile = options.marketProfilesFile || path.join(profilesDir, DEFAULT_MARKET_PROFILES_FILE);
|
|
985
|
+
|
|
986
|
+
const [manifest, botsConfig, generalSettings, marketProfiles, orderFiles] = await Promise.all([
|
|
987
|
+
readJsonFile(manifestFile),
|
|
988
|
+
readJsonFile(botsFile),
|
|
989
|
+
readJsonFile(generalSettingsFile),
|
|
990
|
+
readJsonFile(marketProfilesFile),
|
|
991
|
+
listFiles(ordersDir)
|
|
992
|
+
]);
|
|
993
|
+
|
|
994
|
+
const bots = await normalizeBotEntries(resolveRawBotEntries(botsConfig), { logger: options.logger });
|
|
995
|
+
const activeBots = bots.filter((bot) => bot.active !== false);
|
|
996
|
+
const botsByKey = Object.fromEntries(bots.map((bot) => [bot.botKey, bot]));
|
|
997
|
+
const botsByName = Object.fromEntries(bots.filter((bot) => bot.name).map((bot) => [bot.name, bot]));
|
|
998
|
+
|
|
999
|
+
return {
|
|
1000
|
+
marketProfiles,
|
|
1001
|
+
amaProfiles: marketProfiles,
|
|
1002
|
+
activeBots,
|
|
1003
|
+
bots,
|
|
1004
|
+
botsByKey,
|
|
1005
|
+
botsByName,
|
|
1006
|
+
botsConfig,
|
|
1007
|
+
files: {
|
|
1008
|
+
marketProfiles: marketProfilesFile,
|
|
1009
|
+
amaProfiles: marketProfilesFile,
|
|
1010
|
+
bots: botsFile,
|
|
1011
|
+
generalSettings: generalSettingsFile,
|
|
1012
|
+
manifest: manifestFile,
|
|
1013
|
+
ordersDir
|
|
1014
|
+
},
|
|
1015
|
+
generalSettings,
|
|
1016
|
+
manifest,
|
|
1017
|
+
orderFiles,
|
|
1018
|
+
ordersDir,
|
|
1019
|
+
profilesDir
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
/**
|
|
1024
|
+
* Create a locked profile adapter for reading, previewing, and applying bot settings.
|
|
1025
|
+
*
|
|
1026
|
+
* The adapter wraps bundle loading, settings validation, and atomic writes behind
|
|
1027
|
+
* per-file locks so concurrent updates do not clobber each other.
|
|
1028
|
+
*
|
|
1029
|
+
* @returns {Object} Adapter with loadBundle, listBots, findBot, getBotBundle,
|
|
1030
|
+
* getBotSettings, previewBotSettingsUpdate, applyBotSettingsPatch, getProfilesDir
|
|
1031
|
+
*/
|
|
1032
|
+
function createDexbotProfileAdapter(profileRoot: string | null, options: Partial<ProfileOptions> = {}) {
|
|
1033
|
+
let cachedBundle: any = null;
|
|
1034
|
+
|
|
1035
|
+
async function loadBundle(forceReload = false) {
|
|
1036
|
+
if (!cachedBundle || forceReload) {
|
|
1037
|
+
cachedBundle = await loadDexbotProfileBundle(profileRoot, options);
|
|
1038
|
+
}
|
|
1039
|
+
return cachedBundle;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
function getProfilesDir() {
|
|
1043
|
+
return resolveProfilesDir(profileRoot || options.profileRoot);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
async function listBots({ activeOnly = false, forceReload = false } = {}) {
|
|
1047
|
+
const bundle = await loadBundle(forceReload);
|
|
1048
|
+
return activeOnly ? bundle.activeBots : bundle.bots;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
async function findBot(identifier: any, forceReload = false) {
|
|
1052
|
+
const bundle = await loadBundle(forceReload);
|
|
1053
|
+
return bundle.bots.find((bot: any) => matchBotIdentifier(bot, identifier)) || null;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
async function getBotBundle(identifier: any, forceReload = false) {
|
|
1057
|
+
const bundle = await loadBundle(forceReload);
|
|
1058
|
+
const bot = bundle.bots.find((entry: any) => matchBotIdentifier(entry, identifier)) || null;
|
|
1059
|
+
if (!bot) {
|
|
1060
|
+
return null;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
const orderSnapshotPath = path.join(bundle.ordersDir, `${bot.botKey}.json`);
|
|
1064
|
+
const gridPriceSnapshotPath = path.join(bundle.ordersDir, `${bot.botKey}.dynamicgrid.json`);
|
|
1065
|
+
const triggerPath = path.join(getProfilesDir(), `recalculate.${bot.botKey}.trigger`);
|
|
1066
|
+
|
|
1067
|
+
const [orderSnapshot, gridPriceSnapshot, trigger] = await Promise.all([
|
|
1068
|
+
readJsonFile(orderSnapshotPath),
|
|
1069
|
+
readJsonFile(gridPriceSnapshotPath),
|
|
1070
|
+
readTriggerFile(triggerPath)
|
|
1071
|
+
]);
|
|
1072
|
+
|
|
1073
|
+
return {
|
|
1074
|
+
bot,
|
|
1075
|
+
files: {
|
|
1076
|
+
gridPriceSnapshot: gridPriceSnapshotPath,
|
|
1077
|
+
orderSnapshot: orderSnapshotPath,
|
|
1078
|
+
trigger: triggerPath
|
|
1079
|
+
},
|
|
1080
|
+
gridPriceSnapshot,
|
|
1081
|
+
orderSnapshot,
|
|
1082
|
+
triggerExists: trigger.exists,
|
|
1083
|
+
triggerPayload: trigger.payload
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
async function getBotSettings(identifier: any, forceReload = false) {
|
|
1088
|
+
const bundle = await loadBundle(forceReload);
|
|
1089
|
+
const bot = identifier
|
|
1090
|
+
? bundle.bots.find((entry: any) => matchBotIdentifier(entry, identifier)) || null
|
|
1091
|
+
: bundle.activeBots[0] || bundle.bots[0] || null;
|
|
1092
|
+
|
|
1093
|
+
return buildBotSettingsView(bot, bundle, {
|
|
1094
|
+
identifier
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
/**
|
|
1099
|
+
* Preview a bot settings patch without applying it.
|
|
1100
|
+
* Returns the current view, next view, validation errors/warnings, and whether a recalc trigger is required.
|
|
1101
|
+
*/
|
|
1102
|
+
async function previewBotSettingsUpdate(identifier: any, patch: any, options: Record<string, any> = {}) {
|
|
1103
|
+
const bundle = await loadBundle(Boolean(options.forceReload));
|
|
1104
|
+
const bot = identifier
|
|
1105
|
+
? bundle.bots.find((entry: any) => matchBotIdentifier(entry, identifier)) || null
|
|
1106
|
+
: bundle.activeBots[0] || bundle.bots[0] || null;
|
|
1107
|
+
if (!bot) {
|
|
1108
|
+
throw new Error(`Bot not found: ${identifier}`);
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
const validation = validateBotSettingsPatch(patch, bot, options);
|
|
1112
|
+
const nextBot = validation.merged;
|
|
1113
|
+
const currentValidation = validateBotSettingsState(bot);
|
|
1114
|
+
|
|
1115
|
+
return {
|
|
1116
|
+
bot: cloneBotSettings(bot),
|
|
1117
|
+
changedKeys: validation.patchKeys,
|
|
1118
|
+
current: buildBotSettingsView(bot, bundle, { identifier }),
|
|
1119
|
+
errors: validation.errors,
|
|
1120
|
+
next: buildBotSettingsView(nextBot, bundle, { identifier }),
|
|
1121
|
+
patch: cloneBotSettings(patch) || {},
|
|
1122
|
+
triggerRequired: validation.triggerRequired,
|
|
1123
|
+
valid: validation.valid,
|
|
1124
|
+
warnings: [...currentValidation.warnings, ...validation.warnings]
|
|
1125
|
+
};
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
/**
|
|
1129
|
+
* Apply a bot settings patch atomically.
|
|
1130
|
+
* Acquires a file lock, validates the patch against current state, writes updated bots.json,
|
|
1131
|
+
* and writes the recalc trigger if the changed keys require one.
|
|
1132
|
+
*/
|
|
1133
|
+
async function applyBotSettingsPatch(identifier: any, patch: any, options: Record<string, any> = {}) {
|
|
1134
|
+
if (!isPlainObject(patch)) {
|
|
1135
|
+
throw new Error('patch must be a non-null object');
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
const bundle = await loadBundle(true);
|
|
1139
|
+
const release = await acquireFileLock(bundle.files.bots);
|
|
1140
|
+
|
|
1141
|
+
try {
|
|
1142
|
+
const currentBotsConfig = await readJsonFile(bundle.files.bots);
|
|
1143
|
+
const currentRawEntries = resolveRawBotEntries(currentBotsConfig);
|
|
1144
|
+
const currentBots = await normalizeBotEntries(currentRawEntries, { logger: options.logger });
|
|
1145
|
+
const bot = identifier
|
|
1146
|
+
? currentBots.find((entry: any) => matchBotIdentifier(entry, identifier))
|
|
1147
|
+
: currentBots.find((entry: any) => entry.active !== false) || currentBots[0] || null;
|
|
1148
|
+
if (!bot) {
|
|
1149
|
+
throw new Error(`Bot not found: ${identifier}`);
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
if (!currentRawEntries[bot.botIndex]) {
|
|
1153
|
+
throw new Error(`Bot index ${bot.botIndex} out of range`);
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
const validation = validateBotSettingsPatch(patch, currentRawEntries[bot.botIndex], options);
|
|
1157
|
+
if (!validation.valid) {
|
|
1158
|
+
const error: any = new Error(`Bot settings validation failed:\n${validation.errors.map((entry) => ` - ${entry}`).join('\n')}`);
|
|
1159
|
+
error.validation = validation;
|
|
1160
|
+
throw error;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
const nextEntry = validation.merged;
|
|
1164
|
+
const nextRawEntries = currentRawEntries.slice();
|
|
1165
|
+
nextRawEntries[bot.botIndex] = nextEntry;
|
|
1166
|
+
|
|
1167
|
+
const dataToWrite = Array.isArray(currentBotsConfig)
|
|
1168
|
+
? nextRawEntries
|
|
1169
|
+
: Array.isArray(currentBotsConfig?.bots)
|
|
1170
|
+
? { ...currentBotsConfig, bots: nextRawEntries }
|
|
1171
|
+
: nextEntry;
|
|
1172
|
+
|
|
1173
|
+
assertNoDuplicateBotKeys(nextRawEntries, 'applyBotSettingsPatch');
|
|
1174
|
+
|
|
1175
|
+
await baseWriteJsonFileAtomic(bundle.files.bots, dataToWrite);
|
|
1176
|
+
|
|
1177
|
+
let triggerPayload = null;
|
|
1178
|
+
let triggerPath = null;
|
|
1179
|
+
const shouldWriteTrigger = options.writeTrigger === true
|
|
1180
|
+
|| options.trigger === true
|
|
1181
|
+
|| (options.trigger === undefined && (
|
|
1182
|
+
options.triggerPayload !== undefined
|
|
1183
|
+
|| validation.patchKeys.some((key) => BOT_SETTINGS_TRIGGER_KEYS.has(key))
|
|
1184
|
+
));
|
|
1185
|
+
if (shouldWriteTrigger) {
|
|
1186
|
+
triggerPath = path.join(getProfilesDir(), `recalculate.${bot.botKey}.trigger`);
|
|
1187
|
+
triggerPayload = options.triggerPayload !== undefined
|
|
1188
|
+
? options.triggerPayload
|
|
1189
|
+
: {
|
|
1190
|
+
botKey: bot.botKey,
|
|
1191
|
+
changedKeys: validation.patchKeys,
|
|
1192
|
+
reason: options.triggerReason || 'settings_update',
|
|
1193
|
+
updatedAt: new Date().toISOString()
|
|
1194
|
+
};
|
|
1195
|
+
const content = triggerPayload ? JSON.stringify(triggerPayload, null, 2) : '';
|
|
1196
|
+
storage.ensureDir(path.dirname(triggerPath));
|
|
1197
|
+
writeTextPayload(triggerPath, content);
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
cachedBundle = null;
|
|
1201
|
+
const freshBundle = await loadBundle(true);
|
|
1202
|
+
const updatedBot = freshBundle.bots.find((entry: any) => entry.botIndex === bot.botIndex) || null;
|
|
1203
|
+
|
|
1204
|
+
return {
|
|
1205
|
+
changedKeys: validation.patchKeys,
|
|
1206
|
+
current: buildBotSettingsView(bot, bundle, { identifier }),
|
|
1207
|
+
errors: [],
|
|
1208
|
+
next: buildBotSettingsView(updatedBot || nextEntry, freshBundle, { identifier }),
|
|
1209
|
+
patch: cloneBotSettings(patch) || {},
|
|
1210
|
+
reasoning: options.reasoning || [],
|
|
1211
|
+
triggerPath,
|
|
1212
|
+
triggerPayload,
|
|
1213
|
+
updatedBot: updatedBot ? cloneBotSettings(updatedBot) : cloneBotSettings(nextEntry),
|
|
1214
|
+
valid: true,
|
|
1215
|
+
warnings: validation.warnings
|
|
1216
|
+
};
|
|
1217
|
+
} finally {
|
|
1218
|
+
await release();
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
async function getClawProfileContext(identifier: any, options: Record<string, any> = {}) {
|
|
1224
|
+
const bundle = await loadBundle(Boolean(options.forceReload));
|
|
1225
|
+
const bot = identifier ? bundle.bots.find((entry: any) => matchBotIdentifier(entry, identifier)) || null : null;
|
|
1226
|
+
const selectedBot = options.selectedBot || bot || bundle.activeBots[0] || bundle.bots[0] || null;
|
|
1227
|
+
const selectedBotBundle = selectedBot ? await getBotBundle(selectedBot.botKey, Boolean(options.forceReload)) : null;
|
|
1228
|
+
return buildClawProfileContext(bundle, {
|
|
1229
|
+
...options,
|
|
1230
|
+
botIdentifier: identifier,
|
|
1231
|
+
gridPriceSnapshot: selectedBotBundle ? selectedBotBundle.gridPriceSnapshot : null,
|
|
1232
|
+
orderSnapshot: selectedBotBundle ? selectedBotBundle.orderSnapshot : null,
|
|
1233
|
+
selectedBot,
|
|
1234
|
+
triggerPayload: selectedBotBundle ? selectedBotBundle.triggerPayload : null
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
async function listOrderArtifacts(forceReload = false) {
|
|
1239
|
+
const bundle = await loadBundle(forceReload);
|
|
1240
|
+
return Promise.all(bundle.orderFiles.map(async (fileName: any) => {
|
|
1241
|
+
const fullPath = path.join(bundle.ordersDir, fileName);
|
|
1242
|
+
if (fileName.endsWith('.json')) {
|
|
1243
|
+
return { fileName, fullPath, json: await readJsonFile(fullPath) };
|
|
1244
|
+
}
|
|
1245
|
+
return { fileName, fullPath, json: null };
|
|
1246
|
+
}));
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
function consumeTrigger(botKey: any) {
|
|
1250
|
+
const triggerPath = path.join(getProfilesDir(), `recalculate.${botKey}.trigger`);
|
|
1251
|
+
const trigger = readTriggerFile(triggerPath);
|
|
1252
|
+
if (!trigger.exists) {
|
|
1253
|
+
return { consumed: false, payload: null };
|
|
1254
|
+
}
|
|
1255
|
+
storage.unlink(triggerPath);
|
|
1256
|
+
return { consumed: true, payload: trigger.payload };
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
function writeTrigger(botKey: any, payload: any = null) {
|
|
1260
|
+
const triggerPath = path.join(getProfilesDir(), `recalculate.${botKey}.trigger`);
|
|
1261
|
+
const content = payload ? JSON.stringify(payload, null, 2) : '';
|
|
1262
|
+
storage.ensureDir(path.dirname(triggerPath));
|
|
1263
|
+
writeTextPayload(triggerPath, content);
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
async function updateBotSettings(identifier: any, patch: any) {
|
|
1267
|
+
if (!isPlainObject(patch)) {
|
|
1268
|
+
throw new Error('patch must be a non-null object');
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
const bundle = await loadBundle(true);
|
|
1272
|
+
const release = await acquireFileLock(bundle.files.bots);
|
|
1273
|
+
let selectedBotIndex = null;
|
|
1274
|
+
|
|
1275
|
+
try {
|
|
1276
|
+
const currentBotsConfig = await readJsonFile(bundle.files.bots);
|
|
1277
|
+
const currentRawEntries = resolveRawBotEntries(currentBotsConfig);
|
|
1278
|
+
const currentBots = await normalizeBotEntries(currentRawEntries, { logger: options.logger });
|
|
1279
|
+
const bot = identifier
|
|
1280
|
+
? currentBots.find((entry: any) => matchBotIdentifier(entry, identifier))
|
|
1281
|
+
: currentBots.find((entry: any) => entry.active !== false) || currentBots[0] || null;
|
|
1282
|
+
if (!bot) {
|
|
1283
|
+
throw new Error(`Bot not found: ${identifier}`);
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
if (!currentRawEntries[bot.botIndex]) {
|
|
1287
|
+
throw new Error(`Bot index ${bot.botIndex} out of range`);
|
|
1288
|
+
}
|
|
1289
|
+
selectedBotIndex = bot.botIndex;
|
|
1290
|
+
|
|
1291
|
+
const validation = validateBotSettingsPatch(patch, currentRawEntries[bot.botIndex], {});
|
|
1292
|
+
if (!validation.valid) {
|
|
1293
|
+
const error: any = new Error(`Bot settings validation failed:\n${validation.errors.map((entry) => ` - ${entry}`).join('\n')}`);
|
|
1294
|
+
error.validation = validation;
|
|
1295
|
+
throw error;
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
const nextEntry = validation.merged;
|
|
1299
|
+
const nextRawEntries = currentRawEntries.slice();
|
|
1300
|
+
nextRawEntries[bot.botIndex] = nextEntry;
|
|
1301
|
+
|
|
1302
|
+
const dataToWrite = Array.isArray(currentBotsConfig)
|
|
1303
|
+
? nextRawEntries
|
|
1304
|
+
: Array.isArray(currentBotsConfig?.bots)
|
|
1305
|
+
? { ...currentBotsConfig, bots: nextRawEntries }
|
|
1306
|
+
: nextEntry;
|
|
1307
|
+
|
|
1308
|
+
assertNoDuplicateBotKeys(nextRawEntries, 'updateBotSettings');
|
|
1309
|
+
|
|
1310
|
+
await baseWriteJsonFileAtomic(bundle.files.bots, dataToWrite);
|
|
1311
|
+
} finally {
|
|
1312
|
+
await release();
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
cachedBundle = null;
|
|
1316
|
+
const freshBundle = await loadBundle(true);
|
|
1317
|
+
return freshBundle.bots.find((entry: any) => entry.botIndex === selectedBotIndex) || null;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
return {
|
|
1321
|
+
buildClawProfileContext: (bundle: any, contextOptions = {}) => buildClawProfileContext(bundle, contextOptions),
|
|
1322
|
+
applyBotSettingsPatch,
|
|
1323
|
+
consumeTrigger,
|
|
1324
|
+
findBot,
|
|
1325
|
+
getBotBundle,
|
|
1326
|
+
getBotSettings,
|
|
1327
|
+
getClawProfileContext,
|
|
1328
|
+
getProfilesDir,
|
|
1329
|
+
listBots,
|
|
1330
|
+
listOrderArtifacts,
|
|
1331
|
+
loadBundle,
|
|
1332
|
+
previewBotSettingsUpdate,
|
|
1333
|
+
resolveProfilesDir: () => resolveProfilesDir(profileRoot || options.profileRoot),
|
|
1334
|
+
updateBotSettings,
|
|
1335
|
+
writeTrigger
|
|
1336
|
+
};
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
export { buildBotSettingsView, createBotKey, createDexbotProfileAdapter, buildClawProfileContext, describeBotSettingMutability, loadDexbotProfileBundle, matchBotIdentifier, normalizeBotSettings, normalizeBotEntries, readTriggerFile, resolveProfilesDir, resolveRawBotEntries, sanitizeKey, validateBotEntry, validateBotSettingsPatch, validateBotSettingsState, writeJsonFileAtomic }
|
|
1340
|
+
|