lynx-client 0.0.1-beta.9 → 0.0.3
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 +391 -3
- package/dist/cjs/index.js +9 -0
- package/dist/cjs/lib/addresses/lensAddresses.js +16 -16
- package/dist/cjs/lib/chains/chainMappings.js +17 -0
- package/dist/cjs/lib/constants/contractEnums.js +1 -0
- package/dist/cjs/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.js +2 -0
- package/dist/cjs/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.js +22 -0
- package/dist/cjs/lib/contractsIntegration/IntentsVerifierLensService/index.js +18 -0
- package/dist/cjs/lib/contractsIntegration/LexLensService/ILexLensService.js +137 -0
- package/dist/cjs/lib/contractsIntegration/LexLensService/LexLensService.js +250 -0
- package/dist/cjs/lib/contractsIntegration/LexLensService/index.js +18 -0
- package/dist/cjs/lib/contractsIntegration/OrderBookService/IOrderBookService.js +2 -0
- package/dist/cjs/lib/contractsIntegration/OrderBookService/OrderBookService.js +92 -0
- package/dist/cjs/lib/contractsIntegration/TradersPortalService/ITradersPortalService.js +2 -0
- package/dist/cjs/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.js +157 -0
- package/dist/cjs/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.js +63 -0
- package/dist/cjs/lib/contractsIntegration/TradersPortalService/index.js +19 -0
- package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +57 -0
- package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +111 -0
- package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/index.js +18 -0
- package/dist/cjs/lib/contractsIntegration/TradingFloorService/ITradingFloorService.js +2 -0
- package/dist/cjs/lib/contractsIntegration/TradingFloorService/TradingFloorService.js +177 -0
- package/dist/cjs/lib/contractsIntegration/TradingFloorService/index.js +5 -0
- package/dist/cjs/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.js +30 -0
- package/dist/cjs/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.js +58 -0
- package/dist/cjs/lib/contractsIntegration/TriggersAndPortalLensService/index.js +18 -0
- package/dist/cjs/lib/contractsIntegration/TriggersService/ITriggersService.js +2 -0
- package/dist/cjs/lib/contractsIntegration/TriggersService/TriggersService.js +188 -0
- package/dist/cjs/lib/contractsIntegration/deployedContractsConnector.js +119 -8
- package/dist/cjs/lib/devex/getChainAddresses.js +65 -0
- package/dist/cjs/lib/devex/getSupportedEngineChains.js +45 -0
- package/dist/cjs/lib/devex/index.js +9 -0
- package/dist/cjs/lib/devex/types.js +2 -0
- package/dist/cjs/lib/lynxSystem/hashes.js +9 -0
- package/dist/cjs/lib/lynxSystem/lynxScalesUtils.js +8 -0
- package/dist/cjs/lib/lynxSystem/registry/registryReading.js +38 -0
- package/dist/cjs/lib/priceFeeds/pyth/pythFeedConstants.js +1 -2
- package/dist/cjs/lib/typechain/contracts/Lynx/Lex/LexPool/LexPoolV1.js +2 -0
- package/dist/cjs/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.js +2 -0
- package/dist/cjs/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.js +2 -0
- package/dist/cjs/lib/typechain/contracts/Lynx/Registry/RegistryProxy.js +2 -0
- package/dist/cjs/lib/typechain/contracts/Lynx/Registry/RegistryV1.js +2 -0
- package/dist/cjs/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.js +2 -0
- package/dist/cjs/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.js +2 -0
- package/dist/cjs/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.js +2 -0
- package/dist/cjs/lib/typechain/contracts/Lynx/Triggers/TriggersV1.js +2 -0
- package/dist/cjs/lib/typechain/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor.js +2 -0
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.js +1854 -0
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.js +258 -0
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.js +539 -0
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.js +226 -0
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.js +1108 -0
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.js +1038 -0
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.js +258 -0
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.js +1991 -0
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.js +1459 -0
- package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.js +10 -109
- package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +51 -594
- package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor__factory.js +334 -0
- package/dist/cjs/lib/utils/ethersTypes.js +29 -6
- package/dist/esm/index.d.ts +8 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +9 -0
- package/dist/esm/lib/addresses/lensAddresses.d.ts +16 -16
- package/dist/esm/lib/addresses/lensAddresses.js +16 -16
- package/dist/esm/lib/chains/chainMappings.d.ts +13 -0
- package/dist/esm/lib/chains/chainMappings.d.ts.map +1 -0
- package/dist/esm/lib/chains/chainMappings.js +17 -0
- package/dist/esm/lib/chains/chainTypes.d.ts +3 -0
- package/dist/esm/lib/chains/chainTypes.d.ts.map +1 -1
- package/dist/esm/lib/constants/contractEnums.d.ts.map +1 -1
- package/dist/esm/lib/constants/contractEnums.js +1 -0
- package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.d.ts +7 -0
- package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.js +2 -0
- package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.d.ts +11 -0
- package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.js +22 -0
- package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/index.d.ts +3 -0
- package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/index.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/index.js +18 -0
- package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.d.ts +85 -0
- package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.js +137 -0
- package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.d.ts +34 -0
- package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.js +250 -0
- package/dist/esm/lib/contractsIntegration/LexLensService/index.d.ts +3 -0
- package/dist/esm/lib/contractsIntegration/LexLensService/index.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/LexLensService/index.js +18 -0
- package/dist/esm/lib/contractsIntegration/OrderBookService/IOrderBookService.d.ts +40 -0
- package/dist/esm/lib/contractsIntegration/OrderBookService/IOrderBookService.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/OrderBookService/IOrderBookService.js +2 -0
- package/dist/esm/lib/contractsIntegration/OrderBookService/OrderBookService.d.ts +12 -0
- package/dist/esm/lib/contractsIntegration/OrderBookService/OrderBookService.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/OrderBookService/OrderBookService.js +92 -0
- package/dist/esm/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts +61 -0
- package/dist/esm/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/TradersPortalService/ITradersPortalService.js +2 -0
- package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.d.ts +14 -0
- package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.js +157 -0
- package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.d.ts +31 -0
- package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.js +63 -0
- package/dist/esm/lib/contractsIntegration/TradersPortalService/index.d.ts +4 -0
- package/dist/esm/lib/contractsIntegration/TradersPortalService/index.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/TradersPortalService/index.js +19 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +65 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +57 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts +13 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +111 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/index.d.ts +3 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/index.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/index.js +18 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts +89 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.js +2 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts +86 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.js +177 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorService/index.d.ts +3 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorService/index.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorService/index.js +5 -0
- package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.d.ts +33 -0
- package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.js +30 -0
- package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.d.ts +11 -0
- package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.js +58 -0
- package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/index.d.ts +3 -0
- package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/index.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/index.js +18 -0
- package/dist/esm/lib/contractsIntegration/TriggersService/ITriggersService.d.ts +73 -0
- package/dist/esm/lib/contractsIntegration/TriggersService/ITriggersService.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/TriggersService/ITriggersService.js +2 -0
- package/dist/esm/lib/contractsIntegration/TriggersService/TriggersService.d.ts +18 -0
- package/dist/esm/lib/contractsIntegration/TriggersService/TriggersService.d.ts.map +1 -0
- package/dist/esm/lib/contractsIntegration/TriggersService/TriggersService.js +188 -0
- package/dist/esm/lib/contractsIntegration/deployedContractsConnector.d.ts +44 -5
- package/dist/esm/lib/contractsIntegration/deployedContractsConnector.d.ts.map +1 -1
- package/dist/esm/lib/contractsIntegration/deployedContractsConnector.js +119 -8
- package/dist/esm/lib/devex/getChainAddresses.d.ts +20 -0
- package/dist/esm/lib/devex/getChainAddresses.d.ts.map +1 -0
- package/dist/esm/lib/devex/getChainAddresses.js +65 -0
- package/dist/esm/lib/devex/getSupportedEngineChains.d.ts +37 -0
- package/dist/esm/lib/devex/getSupportedEngineChains.d.ts.map +1 -0
- package/dist/esm/lib/devex/getSupportedEngineChains.js +45 -0
- package/dist/esm/lib/devex/index.d.ts +5 -0
- package/dist/esm/lib/devex/index.d.ts.map +1 -0
- package/dist/esm/lib/devex/index.js +9 -0
- package/dist/esm/lib/devex/types.d.ts +20 -0
- package/dist/esm/lib/devex/types.d.ts.map +1 -0
- package/dist/esm/lib/devex/types.js +2 -0
- package/dist/esm/lib/lynxSystem/hashes.d.ts +6 -0
- package/dist/esm/lib/lynxSystem/hashes.d.ts.map +1 -1
- package/dist/esm/lib/lynxSystem/hashes.js +9 -0
- package/dist/esm/lib/lynxSystem/lynxScalesUtils.d.ts +2 -0
- package/dist/esm/lib/lynxSystem/lynxScalesUtils.d.ts.map +1 -1
- package/dist/esm/lib/lynxSystem/lynxScalesUtils.js +8 -0
- package/dist/esm/lib/lynxSystem/registry/registryReading.d.ts +9 -0
- package/dist/esm/lib/lynxSystem/registry/registryReading.d.ts.map +1 -0
- package/dist/esm/lib/lynxSystem/registry/registryReading.js +38 -0
- package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.d.ts.map +1 -1
- package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.js +1 -2
- package/dist/esm/lib/typechain/common.d.ts.map +1 -1
- package/dist/esm/lib/typechain/contracts/Lynx/Lex/LexPool/LexPoolV1.d.ts +1084 -0
- package/dist/esm/lib/typechain/contracts/Lynx/Lex/LexPool/LexPoolV1.d.ts.map +1 -0
- package/dist/esm/lib/typechain/contracts/Lynx/Lex/LexPool/LexPoolV1.js +2 -0
- package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.d.ts +151 -0
- package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.d.ts.map +1 -0
- package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.js +2 -0
- package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.d.ts +268 -0
- package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.d.ts.map +1 -0
- package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.js +2 -0
- package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryProxy.d.ts +143 -0
- package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryProxy.d.ts.map +1 -0
- package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryProxy.js +2 -0
- package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryV1.d.ts +603 -0
- package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryV1.d.ts.map +1 -0
- package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryV1.js +2 -0
- package/dist/esm/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.d.ts +607 -0
- package/dist/esm/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.d.ts.map +1 -0
- package/dist/esm/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.js +2 -0
- package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.d.ts +151 -0
- package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.d.ts.map +1 -0
- package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.js +2 -0
- package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts +1251 -0
- package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts.map +1 -0
- package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.js +2 -0
- package/dist/esm/lib/typechain/contracts/Lynx/Triggers/TriggersV1.d.ts +977 -0
- package/dist/esm/lib/typechain/contracts/Lynx/Triggers/TriggersV1.d.ts.map +1 -0
- package/dist/esm/lib/typechain/contracts/Lynx/Triggers/TriggersV1.js +2 -0
- package/dist/esm/lib/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.d.ts +10 -65
- package/dist/esm/lib/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.d.ts.map +1 -1
- package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +34 -114
- package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -1
- package/dist/esm/lib/typechain/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor.d.ts +158 -0
- package/dist/esm/lib/typechain/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor.d.ts.map +1 -0
- package/dist/esm/lib/typechain/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor.js +2 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.d.ts +1425 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.d.ts.map +1 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.js +1854 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.d.ts +193 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.d.ts.map +1 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.js +258 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts +407 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts.map +1 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.js +539 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.d.ts +169 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.d.ts.map +1 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.js +226 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts +841 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts.map +1 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.js +1108 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts +800 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts.map +1 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.js +1038 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.d.ts +193 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.d.ts.map +1 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.js +258 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts +1536 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts.map +1 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.js +1991 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts +1135 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts.map +1 -0
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.js +1459 -0
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.d.ts +10 -85
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.d.ts.map +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.js +10 -109
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +13 -442
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts.map +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +51 -594
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor__factory.d.ts +251 -0
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor__factory.d.ts.map +1 -0
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor__factory.js +334 -0
- package/dist/esm/lib/utils/ethersTypes.d.ts +2 -2
- package/dist/esm/lib/utils/ethersTypes.d.ts.map +1 -1
- package/dist/esm/lib/utils/ethersTypes.js +29 -6
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/addresses/lensAddresses.d.ts +16 -16
- package/dist/types/lib/chains/chainMappings.d.ts +13 -0
- package/dist/types/lib/chains/chainMappings.d.ts.map +1 -0
- package/dist/types/lib/chains/chainTypes.d.ts +3 -0
- package/dist/types/lib/chains/chainTypes.d.ts.map +1 -1
- package/dist/types/lib/constants/contractEnums.d.ts.map +1 -1
- package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.d.ts +7 -0
- package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.d.ts +11 -0
- package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/index.d.ts +3 -0
- package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/index.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/LexLensService/ILexLensService.d.ts +85 -0
- package/dist/types/lib/contractsIntegration/LexLensService/ILexLensService.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/LexLensService/LexLensService.d.ts +34 -0
- package/dist/types/lib/contractsIntegration/LexLensService/LexLensService.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/LexLensService/index.d.ts +3 -0
- package/dist/types/lib/contractsIntegration/LexLensService/index.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/OrderBookService/IOrderBookService.d.ts +40 -0
- package/dist/types/lib/contractsIntegration/OrderBookService/IOrderBookService.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/OrderBookService/OrderBookService.d.ts +12 -0
- package/dist/types/lib/contractsIntegration/OrderBookService/OrderBookService.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts +61 -0
- package/dist/types/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.d.ts +14 -0
- package/dist/types/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.d.ts +31 -0
- package/dist/types/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/TradersPortalService/index.d.ts +4 -0
- package/dist/types/lib/contractsIntegration/TradersPortalService/index.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +65 -0
- package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts +13 -0
- package/dist/types/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/TradingFloorLensService/index.d.ts +3 -0
- package/dist/types/lib/contractsIntegration/TradingFloorLensService/index.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts +89 -0
- package/dist/types/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts +86 -0
- package/dist/types/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/TradingFloorService/index.d.ts +3 -0
- package/dist/types/lib/contractsIntegration/TradingFloorService/index.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.d.ts +33 -0
- package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.d.ts +11 -0
- package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/index.d.ts +3 -0
- package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/index.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/TriggersService/ITriggersService.d.ts +73 -0
- package/dist/types/lib/contractsIntegration/TriggersService/ITriggersService.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/TriggersService/TriggersService.d.ts +18 -0
- package/dist/types/lib/contractsIntegration/TriggersService/TriggersService.d.ts.map +1 -0
- package/dist/types/lib/contractsIntegration/deployedContractsConnector.d.ts +44 -5
- package/dist/types/lib/contractsIntegration/deployedContractsConnector.d.ts.map +1 -1
- package/dist/types/lib/devex/getChainAddresses.d.ts +20 -0
- package/dist/types/lib/devex/getChainAddresses.d.ts.map +1 -0
- package/dist/types/lib/devex/getSupportedEngineChains.d.ts +37 -0
- package/dist/types/lib/devex/getSupportedEngineChains.d.ts.map +1 -0
- package/dist/types/lib/devex/index.d.ts +5 -0
- package/dist/types/lib/devex/index.d.ts.map +1 -0
- package/dist/types/lib/devex/types.d.ts +20 -0
- package/dist/types/lib/devex/types.d.ts.map +1 -0
- package/dist/types/lib/lynxSystem/hashes.d.ts +6 -0
- package/dist/types/lib/lynxSystem/hashes.d.ts.map +1 -1
- package/dist/types/lib/lynxSystem/lynxScalesUtils.d.ts +2 -0
- package/dist/types/lib/lynxSystem/lynxScalesUtils.d.ts.map +1 -1
- package/dist/types/lib/lynxSystem/registry/registryReading.d.ts +9 -0
- package/dist/types/lib/lynxSystem/registry/registryReading.d.ts.map +1 -0
- package/dist/types/lib/priceFeeds/pyth/pythFeedConstants.d.ts.map +1 -1
- package/dist/types/lib/typechain/common.d.ts.map +1 -1
- package/dist/types/lib/typechain/contracts/Lynx/Lex/LexPool/LexPoolV1.d.ts +1084 -0
- package/dist/types/lib/typechain/contracts/Lynx/Lex/LexPool/LexPoolV1.d.ts.map +1 -0
- package/dist/types/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.d.ts +151 -0
- package/dist/types/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.d.ts.map +1 -0
- package/dist/types/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.d.ts +268 -0
- package/dist/types/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.d.ts.map +1 -0
- package/dist/types/lib/typechain/contracts/Lynx/Registry/RegistryProxy.d.ts +143 -0
- package/dist/types/lib/typechain/contracts/Lynx/Registry/RegistryProxy.d.ts.map +1 -0
- package/dist/types/lib/typechain/contracts/Lynx/Registry/RegistryV1.d.ts +603 -0
- package/dist/types/lib/typechain/contracts/Lynx/Registry/RegistryV1.d.ts.map +1 -0
- package/dist/types/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.d.ts +607 -0
- package/dist/types/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.d.ts.map +1 -0
- package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.d.ts +151 -0
- package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.d.ts.map +1 -0
- package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts +1251 -0
- package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts.map +1 -0
- package/dist/types/lib/typechain/contracts/Lynx/Triggers/TriggersV1.d.ts +977 -0
- package/dist/types/lib/typechain/contracts/Lynx/Triggers/TriggersV1.d.ts.map +1 -0
- package/dist/types/lib/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.d.ts +10 -65
- package/dist/types/lib/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.d.ts.map +1 -1
- package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +34 -114
- package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -1
- package/dist/types/lib/typechain/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor.d.ts +158 -0
- package/dist/types/lib/typechain/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor.d.ts.map +1 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.d.ts +1425 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.d.ts.map +1 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.d.ts +193 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.d.ts.map +1 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts +407 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts.map +1 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.d.ts +169 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.d.ts.map +1 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts +841 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts.map +1 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts +800 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts.map +1 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.d.ts +193 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.d.ts.map +1 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts +1536 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts.map +1 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts +1135 -0
- package/dist/types/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts.map +1 -0
- package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.d.ts +10 -85
- package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.d.ts.map +1 -1
- package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +13 -442
- package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts.map +1 -1
- package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor__factory.d.ts +251 -0
- package/dist/types/lib/typechain/factories/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor__factory.d.ts.map +1 -0
- package/dist/types/lib/utils/ethersTypes.d.ts +2 -2
- package/dist/types/lib/utils/ethersTypes.d.ts.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,4 +1,392 @@
|
|
|
1
|
-
# Lynx Client
|
|
1
|
+
# Lynx Client SDK
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
A TypeScript SDK for interacting with the Lynx trading protocol across multiple EVM-compatible blockchains.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🔒 Type-safe interfaces for all Lynx smart contracts
|
|
8
|
+
- 🌐 Multi-chain support (16+ EVM chains)
|
|
9
|
+
- 📊 Built-in utilities for price, leverage, and fraction conversions
|
|
10
|
+
- 🏗️ Support for both CommonJS and ESM module systems
|
|
11
|
+
- 🔍 Read-only lens contracts for efficient data aggregation
|
|
12
|
+
- 💼 Complete trading lifecycle management
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install lynx-client
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
yarn add lynx-client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Quick Start
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import {
|
|
28
|
+
connectToLatestRegistry,
|
|
29
|
+
LynxSystemAddresses,
|
|
30
|
+
createTradersPortalService,
|
|
31
|
+
buildPositionRequestIdentifier,
|
|
32
|
+
buildPositionRequestParams
|
|
33
|
+
} from 'lynx-client';
|
|
34
|
+
import { ethers } from 'ethers';
|
|
35
|
+
|
|
36
|
+
// Initialize provider
|
|
37
|
+
const provider = new ethers.JsonRpcProvider('YOUR_RPC_URL');
|
|
38
|
+
const signer = await provider.getSigner();
|
|
39
|
+
|
|
40
|
+
// Get chain-specific addresses
|
|
41
|
+
const addresses = LynxSystemAddresses.arbitrum; // or .sonic, .base, etc.
|
|
42
|
+
|
|
43
|
+
// Connect to contracts
|
|
44
|
+
const registry = connectToLatestRegistry(provider, addresses.registryProxyAddress);
|
|
45
|
+
|
|
46
|
+
// Create a service for trader operations
|
|
47
|
+
const tradersPortal = createTradersPortalService(signer, addresses.tradersPortalAddress);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Core Concepts
|
|
51
|
+
|
|
52
|
+
### Supported Chains
|
|
53
|
+
|
|
54
|
+
#### Engine Chains
|
|
55
|
+
The Lynx protocol is deployed on the following chains:
|
|
56
|
+
|
|
57
|
+
- **Sonic** (146)
|
|
58
|
+
- **Boba** (288)
|
|
59
|
+
- **Flare** (14)
|
|
60
|
+
- **Fantom** (250)
|
|
61
|
+
|
|
62
|
+
#### Source Chains
|
|
63
|
+
Assets can be bridged from these additional chains:
|
|
64
|
+
|
|
65
|
+
- Ethereum Mainnet (1)
|
|
66
|
+
- Optimism (10)
|
|
67
|
+
- BSC (56)
|
|
68
|
+
- Polygon (137)
|
|
69
|
+
- Fuse (122)
|
|
70
|
+
- Goat (2345)
|
|
71
|
+
- Mantle (5000)
|
|
72
|
+
- Base (8453)
|
|
73
|
+
- Mode (34443)
|
|
74
|
+
- Arbitrum (42161)
|
|
75
|
+
- Celo (42220)
|
|
76
|
+
- Linea (59144)
|
|
77
|
+
- Zircuit (48900)
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
import { LynxSystemAddresses, TSupportedChainIds } from 'lynx-client';
|
|
81
|
+
|
|
82
|
+
// Get addresses for a specific chain
|
|
83
|
+
const sonicAddresses = LynxSystemAddresses.sonic;
|
|
84
|
+
const arbitrumAddresses = LynxSystemAddresses.arbitrum;
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Contract Services
|
|
88
|
+
|
|
89
|
+
The SDK provides service wrappers for all Lynx contracts:
|
|
90
|
+
|
|
91
|
+
#### Trading Operations
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
import {
|
|
95
|
+
createTradersPortalService,
|
|
96
|
+
buildPositionRequestIdentifier,
|
|
97
|
+
buildPositionRequestParams,
|
|
98
|
+
TOpenOrderType
|
|
99
|
+
} from 'lynx-client';
|
|
100
|
+
|
|
101
|
+
const tradersPortal = createTradersPortalService(signer, tradersPortalAddress);
|
|
102
|
+
|
|
103
|
+
// Build position parameters using human-readable values
|
|
104
|
+
const identifier = buildPositionRequestIdentifier({
|
|
105
|
+
trader: await signer.getAddress(),
|
|
106
|
+
pairId: 1, // BTC/USD
|
|
107
|
+
settlementAsset: "0x...", // USDC address
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
const params = buildPositionRequestParams({
|
|
111
|
+
isLong: true,
|
|
112
|
+
collateral: 100, // 100 USDC
|
|
113
|
+
leverage: 25, // 25x leverage
|
|
114
|
+
minPrice: 50000, // $50,000
|
|
115
|
+
maxPrice: 50100, // $50,100
|
|
116
|
+
takeProfit: 55000, // $55,000
|
|
117
|
+
stopLoss: 48000 // $48,000
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// Open a position
|
|
121
|
+
await tradersPortal.traderRequests.openNewPosition(
|
|
122
|
+
identifier,
|
|
123
|
+
params,
|
|
124
|
+
TOpenOrderType.MARKET,
|
|
125
|
+
"0x", // referrer domain
|
|
126
|
+
"0x", // referrer code
|
|
127
|
+
true, // run cap tests
|
|
128
|
+
ethers.parseEther("0.01") // native fee
|
|
129
|
+
);
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
#### Lens Services (Read-Only Data)
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
import { createLexLensService, createTradingFloorLensService } from 'lynx-client';
|
|
136
|
+
|
|
137
|
+
// LEX Pool data (accepts both provider and signer)
|
|
138
|
+
const lexLens = createLexLensService(signerOrProvider, lexLensAddress);
|
|
139
|
+
const poolState = await lexLens.getLexPoolState(lexPoolAddress);
|
|
140
|
+
const pairConfigs = await lexLens.getAllPairConfigurationsInLex(lexPoolAddress);
|
|
141
|
+
|
|
142
|
+
// Trading floor data (accepts both provider and signer)
|
|
143
|
+
const tradingFloorLens = createTradingFloorLensService(signerOrProvider, tradingFloorLensAddress);
|
|
144
|
+
const position = await tradingFloorLens.getCompletePositionData(tradingFloorAddress, positionId);
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Utility Functions
|
|
148
|
+
|
|
149
|
+
#### Price Conversions
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
import { floatToPriceBn, priceBnToFloat } from 'lynx-client';
|
|
153
|
+
|
|
154
|
+
// Convert human-readable price to contract format (8 decimals)
|
|
155
|
+
const priceBn = floatToPriceBn(50000.50); // $50,000.50 → BigInt
|
|
156
|
+
|
|
157
|
+
// Convert contract price to human-readable
|
|
158
|
+
const price = priceBnToFloat(priceBn); // BigInt → 50000.50
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
#### Leverage Conversions
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
import { floatUnitsToScaledLeverage, scaledLeverageToUnits } from 'lynx-client';
|
|
165
|
+
|
|
166
|
+
// Convert human leverage to contract format
|
|
167
|
+
const scaledLeverage = floatUnitsToScaledLeverage(25); // 25x → 2500
|
|
168
|
+
|
|
169
|
+
// Convert contract leverage to human-readable
|
|
170
|
+
const leverage = scaledLeverageToUnits(2500); // 2500 → 25x
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
#### Collateral Conversions
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
import { floatToChipsBn, chipsBnToUnits } from 'lynx-client';
|
|
177
|
+
|
|
178
|
+
// Convert human-readable amount to contract format (18 decimals)
|
|
179
|
+
const collateralBn = floatToChipsBn(100.5); // 100.5 tokens → BigInt
|
|
180
|
+
|
|
181
|
+
// Convert contract amount to human-readable
|
|
182
|
+
const collateral = chipsBnToUnits(collateralBn); // BigInt → 100.5
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
#### Fraction Conversions
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
import { floatToFractionBn, fractionBnToFloat } from 'lynx-client';
|
|
189
|
+
|
|
190
|
+
// Convert percentage to contract format
|
|
191
|
+
const fractionBn = floatToFractionBn(0.05); // 5% → 5000
|
|
192
|
+
|
|
193
|
+
// Convert contract fraction to percentage
|
|
194
|
+
const fraction = fractionBnToFloat(5000n); // 5000 → 0.05 (5%)
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Advanced Usage
|
|
198
|
+
|
|
199
|
+
### Position Management
|
|
200
|
+
|
|
201
|
+
```typescript
|
|
202
|
+
// Update position with new TP/SL
|
|
203
|
+
await tradersPortal.traderRequests.updatePositionDoubleFieldTpAndSl(
|
|
204
|
+
positionId,
|
|
205
|
+
floatToPriceBn(55000), // New TP: $55,000
|
|
206
|
+
floatToPriceBn(48000), // New SL: $48,000
|
|
207
|
+
ethers.parseEther("0.01") // Fee
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
// Close position at market
|
|
211
|
+
await tradersPortal.traderRequests.setExistingPositionToMarketClose(
|
|
212
|
+
positionId,
|
|
213
|
+
floatToPriceBn(49900), // Min acceptable price
|
|
214
|
+
floatToPriceBn(50100), // Max acceptable price
|
|
215
|
+
ethers.parseEther("0.01") // Fee
|
|
216
|
+
);
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Working with Triggers
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
import { createTriggersService } from 'lynx-client';
|
|
223
|
+
|
|
224
|
+
const triggers = createTriggersService(signer, triggersAddress);
|
|
225
|
+
|
|
226
|
+
// Get trigger configurations
|
|
227
|
+
const configs = await triggers.getTriggersConfigurations();
|
|
228
|
+
const pairConfigs = await triggers.getPairConfigsInTriggers(1); // Pair ID 1
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### LEX Pool Operations
|
|
232
|
+
|
|
233
|
+
```typescript
|
|
234
|
+
// Get complete LEX pool state
|
|
235
|
+
const completeState = await lexLens.getCompleteStateForLex(lexPoolAddress);
|
|
236
|
+
|
|
237
|
+
// Get supplier state
|
|
238
|
+
const supplierState = await lexLens.getLexPoolSupplierState(
|
|
239
|
+
lexPoolAddress,
|
|
240
|
+
supplierAddress
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
// Get all fee configurations
|
|
244
|
+
const feeConfigs = await lexLens.getAllFeeConfigurationsInLex(lexPoolAddress);
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## Type Safety
|
|
248
|
+
|
|
249
|
+
The SDK provides comprehensive TypeScript types for all contract interactions:
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
import {
|
|
253
|
+
TPositionRequestIdentifierStruct,
|
|
254
|
+
TPositionRequestParamsStruct,
|
|
255
|
+
TSinglePositionStruct,
|
|
256
|
+
TPairConfigsInTriggersStruct
|
|
257
|
+
} from 'lynx-client';
|
|
258
|
+
|
|
259
|
+
// All contract structs are properly typed
|
|
260
|
+
const position = await tradingFloorLens.getCompletePositionData(tradingFloorAddress, id);
|
|
261
|
+
console.log(position.trader); // string
|
|
262
|
+
console.log(position.collateral); // bigint
|
|
263
|
+
console.log(position.leverage); // bigint
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## Error Handling
|
|
267
|
+
|
|
268
|
+
The SDK validates inputs to prevent common errors:
|
|
269
|
+
|
|
270
|
+
```typescript
|
|
271
|
+
try {
|
|
272
|
+
// This will throw an error - can't use both price and fraction TP
|
|
273
|
+
const params = buildPositionRequestParams({
|
|
274
|
+
isLong: true,
|
|
275
|
+
collateral: 100,
|
|
276
|
+
leverage: 25,
|
|
277
|
+
minPrice: 50000,
|
|
278
|
+
maxPrice: 50100,
|
|
279
|
+
takeProfit: 55000, // Price-based TP
|
|
280
|
+
takeProfitByFraction: 0.1 // Fraction-based TP - ERROR!
|
|
281
|
+
});
|
|
282
|
+
} catch (error) {
|
|
283
|
+
console.error("Cannot specify both takeProfit and takeProfitByFraction");
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
## Type Safety
|
|
288
|
+
|
|
289
|
+
The SDK provides strong type safety with clear distinctions between different numeric types:
|
|
290
|
+
|
|
291
|
+
### Return Type Conventions
|
|
292
|
+
- **`bigint`**: Used for asset amounts, collateral, and values requiring high precision
|
|
293
|
+
- **`number`**: Used for IDs, timestamps, prices, leverage, and human-readable values
|
|
294
|
+
- **`string`**: Used for addresses and text values
|
|
295
|
+
- **`boolean`**: Used for flags and states
|
|
296
|
+
|
|
297
|
+
### Lens Service Types
|
|
298
|
+
All Lens services return properly typed data structures:
|
|
299
|
+
|
|
300
|
+
```typescript
|
|
301
|
+
// Example: TradingFloorLens returns typed position data
|
|
302
|
+
const position = await lensService.getCompletePositionData(tradingFloor, positionId);
|
|
303
|
+
// position.pairId: number (not bigint)
|
|
304
|
+
// position.collateral: bigint (asset amount)
|
|
305
|
+
// position.leverage: number (human-readable)
|
|
306
|
+
// position.openPrice: number (human-readable price)
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## Constants and Enums
|
|
310
|
+
|
|
311
|
+
```typescript
|
|
312
|
+
import {
|
|
313
|
+
TOpenOrderType,
|
|
314
|
+
TOrderCloseType,
|
|
315
|
+
TPositionField,
|
|
316
|
+
TPairIds,
|
|
317
|
+
CHIP_DECIMALS,
|
|
318
|
+
PRICES_SCALE,
|
|
319
|
+
LEVERAGE_MULTIPLIER_SCALE
|
|
320
|
+
} from 'lynx-client';
|
|
321
|
+
|
|
322
|
+
// Order types
|
|
323
|
+
const marketOrder = TOpenOrderType.MARKET;
|
|
324
|
+
const limitOrder = TOpenOrderType.LIMIT;
|
|
325
|
+
|
|
326
|
+
// Pair IDs
|
|
327
|
+
const btcUsd = TPairIds.BTC_USD;
|
|
328
|
+
const ethUsd = TPairIds.ETH_USD;
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
## Best Practices
|
|
332
|
+
|
|
333
|
+
1. **Always use builder functions** for creating position requests:
|
|
334
|
+
```typescript
|
|
335
|
+
// ✅ Good
|
|
336
|
+
const params = buildPositionRequestParams({ ... });
|
|
337
|
+
|
|
338
|
+
// ❌ Avoid manual construction
|
|
339
|
+
const params = { long: true, collateral: 100n, ... };
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
2. **Use utility functions** for conversions:
|
|
343
|
+
```typescript
|
|
344
|
+
// ✅ Good
|
|
345
|
+
const priceBn = floatToPriceBn(50000);
|
|
346
|
+
|
|
347
|
+
// ❌ Avoid manual calculations
|
|
348
|
+
const priceBn = BigInt(50000 * 10**8);
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
3. **Handle contract errors** appropriately:
|
|
352
|
+
```typescript
|
|
353
|
+
try {
|
|
354
|
+
await tradersPortal.traderRequests.openNewPosition(...);
|
|
355
|
+
} catch (error) {
|
|
356
|
+
if (error.reason === "Insufficient collateral") {
|
|
357
|
+
// Handle specific error
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
## Development
|
|
363
|
+
|
|
364
|
+
### Building
|
|
365
|
+
|
|
366
|
+
```bash
|
|
367
|
+
npm run build
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Testing
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
npm test
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
### Contributing
|
|
377
|
+
|
|
378
|
+
1. Fork the repository
|
|
379
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
380
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
381
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
382
|
+
5. Open a Pull Request
|
|
383
|
+
|
|
384
|
+
## License
|
|
385
|
+
|
|
386
|
+
ISC
|
|
387
|
+
|
|
388
|
+
## Support
|
|
389
|
+
|
|
390
|
+
- [GitHub Issues](https://github.com/lynx-protocol/lynx-client/issues)
|
|
391
|
+
- [Documentation](https://lynx-finance.gitbook.io/lynx-finance/)
|
|
392
|
+
- [Discord](https://discord.gg/4CGxEYwrF2)
|
package/dist/cjs/index.js
CHANGED
|
@@ -26,6 +26,7 @@ __exportStar(require("./lib/utils/ethersTypes"), exports);
|
|
|
26
26
|
__exportStar(require("./lib/lynxSystem/hashes"), exports);
|
|
27
27
|
__exportStar(require("./lib/lynxSystem/lynxScalesUtils"), exports);
|
|
28
28
|
__exportStar(require("./lib/utils/types"), exports);
|
|
29
|
+
__exportStar(require("./lib/lynxSystem/registry/registryReading"), exports);
|
|
29
30
|
__exportStar(require("./lib/constants/contractEnums"), exports);
|
|
30
31
|
__exportStar(require("./lib/constants/generalConstants"), exports);
|
|
31
32
|
__exportStar(require("./lib/constants/scales"), exports);
|
|
@@ -37,6 +38,12 @@ __exportStar(require("./lib/priceFeeds/pyth/pythFeedFunctions"), exports);
|
|
|
37
38
|
__exportStar(require("./lib/addresses/lensAddresses"), exports);
|
|
38
39
|
__exportStar(require("./lib/addresses/systemAddresses"), exports);
|
|
39
40
|
__exportStar(require("./lib/contractsIntegration/deployedContractsConnector"), exports);
|
|
41
|
+
__exportStar(require("./lib/contractsIntegration/TradersPortalService"), exports);
|
|
42
|
+
__exportStar(require("./lib/contractsIntegration/TradingFloorService"), exports);
|
|
43
|
+
__exportStar(require("./lib/contractsIntegration/IntentsVerifierLensService"), exports);
|
|
44
|
+
__exportStar(require("./lib/contractsIntegration/TriggersAndPortalLensService"), exports);
|
|
45
|
+
__exportStar(require("./lib/contractsIntegration/TradingFloorLensService"), exports);
|
|
46
|
+
__exportStar(require("./lib/contractsIntegration/LexLensService"), exports);
|
|
40
47
|
__exportStar(require("./lib/typechain/contracts/Peripheral/Lens/IntentsVerifierLens"), exports);
|
|
41
48
|
__exportStar(require("./lib/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens"), exports);
|
|
42
49
|
__exportStar(require("./lib/typechain/contracts/Peripheral/Lens/LexLens"), exports);
|
|
@@ -45,3 +52,5 @@ __exportStar(require("./lib/typechain/factories/contracts/Peripheral/Lens/Intent
|
|
|
45
52
|
__exportStar(require("./lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory"), exports);
|
|
46
53
|
__exportStar(require("./lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory"), exports);
|
|
47
54
|
__exportStar(require("./lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory"), exports);
|
|
55
|
+
// Developer Experience utilities
|
|
56
|
+
__exportStar(require("./lib/devex"), exports);
|
|
@@ -3,27 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LensAddresses = void 0;
|
|
4
4
|
exports.LensAddresses = {
|
|
5
5
|
boba: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
triggersAndPortalLens: "
|
|
6
|
+
intentsVerifierLens: "0x7DfA2F609573AB8eD8cA231498FF4E8f1e7d31Fa",
|
|
7
|
+
lexLens: "0xE4Ebc518A2Fb771057E8E1e85296a72a4587e11E",
|
|
8
|
+
tradingFloorLensLens: "0x7f68e8Ba4176683594342d9C39De22b93daC45E3",
|
|
9
|
+
triggersAndPortalLens: "0x5c3d344C24e4Cd7DDCdd15C660095FFb160d42e5",
|
|
10
10
|
},
|
|
11
11
|
sonic: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
triggersAndPortalLens: "
|
|
12
|
+
intentsVerifierLens: "0x0C1Fcd85856b5564a87ae378336b7CC0c139C5f7",
|
|
13
|
+
lexLens: "0xc8939875FeC9a0A2f1757272165f8F53659C47c4",
|
|
14
|
+
tradingFloorLensLens: "0x50631a46BEe1E63e46C3eDceE3d5af33E5904681",
|
|
15
|
+
triggersAndPortalLens: "0x7976e6E8145a11aB17D61497dfa0524999Ab6d3c",
|
|
16
16
|
},
|
|
17
17
|
fantom: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
triggersAndPortalLens: "
|
|
18
|
+
intentsVerifierLens: "",
|
|
19
|
+
lexLens: "",
|
|
20
|
+
tradingFloorLensLens: "",
|
|
21
|
+
triggersAndPortalLens: "",
|
|
22
22
|
},
|
|
23
23
|
flare: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
triggersAndPortalLens: "
|
|
24
|
+
intentsVerifierLens: "0x1CdA9C57526e0CDF97f63c2c0CD460a16f9855F5",
|
|
25
|
+
lexLens: "0x76CDbA9107a89af6Dda81655f26FBE67e1d4a749",
|
|
26
|
+
tradingFloorLensLens: "0x731cDbfF121a313c9af0146826E2A78cCBE9FF66",
|
|
27
|
+
triggersAndPortalLens: "0x36D550DbA557a930f0Dfcb4796c593b2215D52Af",
|
|
28
28
|
},
|
|
29
29
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ENGINE_CHAIN_DISPLAY_NAME = exports.ENGINE_CHAIN_ID_BY_NAME = void 0;
|
|
4
|
+
const chainConstants_1 = require("./chainConstants");
|
|
5
|
+
// Engine chain mappings
|
|
6
|
+
exports.ENGINE_CHAIN_ID_BY_NAME = {
|
|
7
|
+
sonic: chainConstants_1.CHAIN_ID_SONIC,
|
|
8
|
+
boba: chainConstants_1.CHAIN_ID_BOBA,
|
|
9
|
+
flare: chainConstants_1.CHAIN_ID_FLARE,
|
|
10
|
+
fantom: chainConstants_1.CHAIN_ID_FANTOM,
|
|
11
|
+
};
|
|
12
|
+
exports.ENGINE_CHAIN_DISPLAY_NAME = {
|
|
13
|
+
sonic: "Sonic",
|
|
14
|
+
boba: "Boba",
|
|
15
|
+
flare: "Flare",
|
|
16
|
+
fantom: "Fantom",
|
|
17
|
+
};
|
package/dist/cjs/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntentsVerifierLensService = void 0;
|
|
4
|
+
const IntentsVerifierLens__factory_1 = require("../../typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory");
|
|
5
|
+
class IntentsVerifierLensService {
|
|
6
|
+
constructor(signerOrProvider, address) {
|
|
7
|
+
this.contract = IntentsVerifierLens__factory_1.IntentsVerifierLens__factory.connect(address, signerOrProvider);
|
|
8
|
+
}
|
|
9
|
+
async getRequestBuildingInfoForChipsIntentsVerifier() {
|
|
10
|
+
return await this.contract.getRequestBuildingInfoForChipsIntentsVerifier();
|
|
11
|
+
}
|
|
12
|
+
async getRequestBuildingInfoForLiquidityIntentsVerifier() {
|
|
13
|
+
return await this.contract.getRequestBuildingInfoForLiquidityIntentsVerifier();
|
|
14
|
+
}
|
|
15
|
+
async getRequestBuildingInfoForTradeIntentsVerifier() {
|
|
16
|
+
return await this.contract.getRequestBuildingInfoForTradeIntentsVerifier();
|
|
17
|
+
}
|
|
18
|
+
async registry() {
|
|
19
|
+
return await this.contract.registry();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.IntentsVerifierLensService = IntentsVerifierLensService;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./IIntentsVerifierLensService"), exports);
|
|
18
|
+
__exportStar(require("./IntentsVerifierLensService"), exports);
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EMPTY_SINGLE_POSITION_OUTPUT = exports.EMPTY_COMPLETE_LEX_CONFIGS = exports.EMPTY_COMPLETE_LEX_STATE = exports.EMPTY_POOL_ACCOUNTANT_CONFIGURATIONS_LENS = exports.EMPTY_POOL_ACCOUNTANT_STATE_LENS = exports.EMPTY_LEX_POOL_SUPPLIER_LENS_STATE = exports.EMPTY_LEX_GROUP_STATE_LENS = exports.EMPTY_LEX_PAIR_STATE_LENS = exports.EMPTY_GROUP_CONFIGS_LENS = exports.EMPTY_FEE_CONFIGS_LENS = exports.EMPTY_PAIR_CONFIGS_LENS = exports.EMPTY_LEX_POOL_LENS_CONFIGS = exports.EMPTY_LEX_POOL_LENS_STATE = exports.EMPTY_LEX_POOL_LENS_PARAMS = exports.EMPTY_PENDING_EPOCH_REDEEM = exports.EMPTY_PENDING_EPOCH_DEPOSIT = void 0;
|
|
4
|
+
// Empty constants
|
|
5
|
+
exports.EMPTY_PENDING_EPOCH_DEPOSIT = {
|
|
6
|
+
account: "",
|
|
7
|
+
amount: 0n,
|
|
8
|
+
epochNumber: 0n,
|
|
9
|
+
minAmountOut: 0n,
|
|
10
|
+
};
|
|
11
|
+
exports.EMPTY_PENDING_EPOCH_REDEEM = {
|
|
12
|
+
account: "",
|
|
13
|
+
amount: 0n,
|
|
14
|
+
epochNumber: 0n,
|
|
15
|
+
maxAmountOut: 0n,
|
|
16
|
+
minAmountOut: 0n,
|
|
17
|
+
};
|
|
18
|
+
exports.EMPTY_LEX_POOL_LENS_PARAMS = {
|
|
19
|
+
lexToken: "",
|
|
20
|
+
name: "",
|
|
21
|
+
symbol: "",
|
|
22
|
+
underlying: "",
|
|
23
|
+
};
|
|
24
|
+
exports.EMPTY_LEX_POOL_LENS_STATE = {
|
|
25
|
+
currentVirtualUtilization: 0n,
|
|
26
|
+
nextEpochStartMin: 0n,
|
|
27
|
+
poolBalance: 0n,
|
|
28
|
+
totalPendingDeposits: 0n,
|
|
29
|
+
totalPendingWithdrawals: 0n,
|
|
30
|
+
totalSupply: 0n,
|
|
31
|
+
virtualBalanceForUtilization: 0n,
|
|
32
|
+
lexPool: "",
|
|
33
|
+
cash: 0n,
|
|
34
|
+
connectedToCenter: false,
|
|
35
|
+
currentEpochNumber: 0n,
|
|
36
|
+
currentExchangeRate: 0n,
|
|
37
|
+
};
|
|
38
|
+
exports.EMPTY_LEX_POOL_LENS_CONFIGS = {
|
|
39
|
+
lexPool: "",
|
|
40
|
+
epochLength: 0n,
|
|
41
|
+
minDepositAmount: 0n,
|
|
42
|
+
epochsDelayDeposit: 0n,
|
|
43
|
+
epochsDelayRedeem: 0n,
|
|
44
|
+
immediateDepositAllowed: false,
|
|
45
|
+
};
|
|
46
|
+
exports.EMPTY_PAIR_CONFIGS_LENS = {
|
|
47
|
+
feeId: 0,
|
|
48
|
+
groupId: 0,
|
|
49
|
+
maxBorrowF: 0n,
|
|
50
|
+
maxGain: 0n,
|
|
51
|
+
maxLeverage: 0n,
|
|
52
|
+
maxOpenInterest: 0n,
|
|
53
|
+
maxPositionSize: 0n,
|
|
54
|
+
maxSkew: 0n,
|
|
55
|
+
minLeverage: 0n,
|
|
56
|
+
pairId: 0,
|
|
57
|
+
minPerformanceFee: 0n,
|
|
58
|
+
minOpenFee: 0n,
|
|
59
|
+
};
|
|
60
|
+
exports.EMPTY_FEE_CONFIGS_LENS = {
|
|
61
|
+
feeId: 0,
|
|
62
|
+
openFeeF: 0,
|
|
63
|
+
closeFeeF: 0,
|
|
64
|
+
performanceFeeF: 0,
|
|
65
|
+
};
|
|
66
|
+
exports.EMPTY_GROUP_CONFIGS_LENS = {
|
|
67
|
+
groupId: 0,
|
|
68
|
+
maxBorrowF: 0,
|
|
69
|
+
maxLeverage: 0n,
|
|
70
|
+
maxPositionSize: 0n,
|
|
71
|
+
minLeverage: 0n,
|
|
72
|
+
};
|
|
73
|
+
exports.EMPTY_LEX_PAIR_STATE_LENS = {
|
|
74
|
+
fundingRate: 0n,
|
|
75
|
+
lexPool: "",
|
|
76
|
+
openInterestLong: 0n,
|
|
77
|
+
openInterestShort: 0n,
|
|
78
|
+
pairId: 0,
|
|
79
|
+
tradersPairGains: 0n,
|
|
80
|
+
pairBorrows: 0n,
|
|
81
|
+
};
|
|
82
|
+
exports.EMPTY_LEX_GROUP_STATE_LENS = {
|
|
83
|
+
lexPool: "",
|
|
84
|
+
groupId: 0,
|
|
85
|
+
groupBorrows: 0n,
|
|
86
|
+
};
|
|
87
|
+
exports.EMPTY_LEX_POOL_SUPPLIER_LENS_STATE = {
|
|
88
|
+
allowanceForLexPool: 0n,
|
|
89
|
+
lexPool: "",
|
|
90
|
+
lxpBalance: 0n,
|
|
91
|
+
lxpBalanceInUnderlying: 0n,
|
|
92
|
+
pendingEpochDeposits: [],
|
|
93
|
+
pendingEpochRedeems: [],
|
|
94
|
+
supplier: "",
|
|
95
|
+
underlyingBalance: 0n,
|
|
96
|
+
};
|
|
97
|
+
exports.EMPTY_POOL_ACCOUNTANT_STATE_LENS = {
|
|
98
|
+
accountant: "",
|
|
99
|
+
borrowRatePerSecond: 0n,
|
|
100
|
+
interestShare: 0n,
|
|
101
|
+
matchingPool: "",
|
|
102
|
+
totalBorrows: 0n,
|
|
103
|
+
unrealizedFunding: 0n,
|
|
104
|
+
fundingShare: 0n,
|
|
105
|
+
};
|
|
106
|
+
exports.EMPTY_POOL_ACCOUNTANT_CONFIGURATIONS_LENS = {
|
|
107
|
+
accountant: "",
|
|
108
|
+
fundingRateModel: "",
|
|
109
|
+
interestRateModel: "",
|
|
110
|
+
interestShareFactor: 0n,
|
|
111
|
+
matchingPool: "",
|
|
112
|
+
minOpenFee: 0n,
|
|
113
|
+
lexPartF: 0n,
|
|
114
|
+
liquidationThresholdF: 0n,
|
|
115
|
+
liquidationFeeF: 0n,
|
|
116
|
+
supportedPairIds: [],
|
|
117
|
+
};
|
|
118
|
+
exports.EMPTY_COMPLETE_LEX_STATE = {
|
|
119
|
+
lexPoolState: exports.EMPTY_LEX_POOL_LENS_STATE,
|
|
120
|
+
poolAccountantState: exports.EMPTY_POOL_ACCOUNTANT_STATE_LENS,
|
|
121
|
+
pairsStates: [],
|
|
122
|
+
groupsStates: [],
|
|
123
|
+
};
|
|
124
|
+
exports.EMPTY_COMPLETE_LEX_CONFIGS = {
|
|
125
|
+
lexPoolParams: exports.EMPTY_LEX_POOL_LENS_PARAMS,
|
|
126
|
+
lexPoolConfigurations: exports.EMPTY_LEX_POOL_LENS_CONFIGS,
|
|
127
|
+
poolAccountantConfigurations: exports.EMPTY_POOL_ACCOUNTANT_CONFIGURATIONS_LENS,
|
|
128
|
+
groupsConfigs: [],
|
|
129
|
+
pairsConfigs: [],
|
|
130
|
+
feesConfigs: [],
|
|
131
|
+
};
|
|
132
|
+
exports.EMPTY_SINGLE_POSITION_OUTPUT = {
|
|
133
|
+
totalValue: 0n,
|
|
134
|
+
safeClosingFee: 0n,
|
|
135
|
+
interest: 0n,
|
|
136
|
+
funding: 0n,
|
|
137
|
+
};
|