keyring-agent-core 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6692 -27
- package/dist/index.js +877 -70
- package/package.json +4 -3
- package/dist/agent/AgentCore.d.ts +0 -256
- package/dist/agent/AgentCore.d.ts.map +0 -1
- package/dist/agent/AgentCore.js +0 -1093
- package/dist/agent/AgentCore.js.map +0 -1
- package/dist/agent/QueryRewriter.d.ts +0 -84
- package/dist/agent/QueryRewriter.d.ts.map +0 -1
- package/dist/agent/QueryRewriter.js +0 -306
- package/dist/agent/QueryRewriter.js.map +0 -1
- package/dist/agent/Router.d.ts +0 -33
- package/dist/agent/Router.d.ts.map +0 -1
- package/dist/agent/Router.js +0 -229
- package/dist/agent/Router.js.map +0 -1
- package/dist/agent/Subagent.d.ts +0 -80
- package/dist/agent/Subagent.d.ts.map +0 -1
- package/dist/agent/Subagent.js +0 -272
- package/dist/agent/Subagent.js.map +0 -1
- package/dist/agent/Synthesizer.d.ts +0 -11
- package/dist/agent/Synthesizer.d.ts.map +0 -1
- package/dist/agent/Synthesizer.js +0 -86
- package/dist/agent/Synthesizer.js.map +0 -1
- package/dist/agent/chatGraph.d.ts +0 -364
- package/dist/agent/chatGraph.d.ts.map +0 -1
- package/dist/agent/chatGraph.js +0 -184
- package/dist/agent/chatGraph.js.map +0 -1
- package/dist/agent/index.d.ts +0 -10
- package/dist/agent/index.d.ts.map +0 -1
- package/dist/agent/index.js +0 -24
- package/dist/agent/index.js.map +0 -1
- package/dist/agent/subagents/AiAgent.d.ts +0 -6
- package/dist/agent/subagents/AiAgent.d.ts.map +0 -1
- package/dist/agent/subagents/AiAgent.js +0 -52
- package/dist/agent/subagents/AiAgent.js.map +0 -1
- package/dist/agent/subagents/NftAgent.d.ts +0 -6
- package/dist/agent/subagents/NftAgent.d.ts.map +0 -1
- package/dist/agent/subagents/NftAgent.js +0 -79
- package/dist/agent/subagents/NftAgent.js.map +0 -1
- package/dist/agent/subagents/PoolAgent.d.ts +0 -6
- package/dist/agent/subagents/PoolAgent.d.ts.map +0 -1
- package/dist/agent/subagents/PoolAgent.js +0 -184
- package/dist/agent/subagents/PoolAgent.js.map +0 -1
- package/dist/agent/subagents/PoolSubgraphAgent.d.ts +0 -6
- package/dist/agent/subagents/PoolSubgraphAgent.d.ts.map +0 -1
- package/dist/agent/subagents/PoolSubgraphAgent.js +0 -117
- package/dist/agent/subagents/PoolSubgraphAgent.js.map +0 -1
- package/dist/agent/subagents/TokenAgent.d.ts +0 -6
- package/dist/agent/subagents/TokenAgent.d.ts.map +0 -1
- package/dist/agent/subagents/TokenAgent.js +0 -76
- package/dist/agent/subagents/TokenAgent.js.map +0 -1
- package/dist/agent/subagents/WalletActionAgent.d.ts +0 -6
- package/dist/agent/subagents/WalletActionAgent.d.ts.map +0 -1
- package/dist/agent/subagents/WalletActionAgent.js +0 -55
- package/dist/agent/subagents/WalletActionAgent.js.map +0 -1
- package/dist/agent/subagents/WalletAgent.d.ts +0 -6
- package/dist/agent/subagents/WalletAgent.d.ts.map +0 -1
- package/dist/agent/subagents/WalletAgent.js +0 -93
- package/dist/agent/subagents/WalletAgent.js.map +0 -1
- package/dist/agent/subagents/index.d.ts +0 -34
- package/dist/agent/subagents/index.d.ts.map +0 -1
- package/dist/agent/subagents/index.js +0 -69
- package/dist/agent/subagents/index.js.map +0 -1
- package/dist/constants/abi.d.ts +0 -551
- package/dist/constants/abi.d.ts.map +0 -1
- package/dist/constants/abi.js +0 -690
- package/dist/constants/abi.js.map +0 -1
- package/dist/functions/pool.d.ts +0 -25
- package/dist/functions/pool.d.ts.map +0 -1
- package/dist/functions/pool.js +0 -151
- package/dist/functions/pool.js.map +0 -1
- package/dist/functions/web3.d.ts +0 -31
- package/dist/functions/web3.d.ts.map +0 -1
- package/dist/functions/web3.js +0 -232
- package/dist/functions/web3.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/llm/GeminiProvider.d.ts +0 -16
- package/dist/llm/GeminiProvider.d.ts.map +0 -1
- package/dist/llm/GeminiProvider.js +0 -329
- package/dist/llm/GeminiProvider.js.map +0 -1
- package/dist/llm/index.d.ts +0 -2
- package/dist/llm/index.d.ts.map +0 -1
- package/dist/llm/index.js +0 -6
- package/dist/llm/index.js.map +0 -1
- package/dist/memory/ChatHistory.d.ts +0 -83
- package/dist/memory/ChatHistory.d.ts.map +0 -1
- package/dist/memory/ChatHistory.js +0 -143
- package/dist/memory/ChatHistory.js.map +0 -1
- package/dist/memory/KnowledgeBase.d.ts +0 -38
- package/dist/memory/KnowledgeBase.d.ts.map +0 -1
- package/dist/memory/KnowledgeBase.js +0 -139
- package/dist/memory/KnowledgeBase.js.map +0 -1
- package/dist/memory/Summarizer.d.ts +0 -12
- package/dist/memory/Summarizer.d.ts.map +0 -1
- package/dist/memory/Summarizer.js +0 -39
- package/dist/memory/Summarizer.js.map +0 -1
- package/dist/memory/UpstashKnowledgeBase.d.ts +0 -124
- package/dist/memory/UpstashKnowledgeBase.d.ts.map +0 -1
- package/dist/memory/UpstashKnowledgeBase.js +0 -152
- package/dist/memory/UpstashKnowledgeBase.js.map +0 -1
- package/dist/memory/historyUtils.d.ts +0 -58
- package/dist/memory/historyUtils.d.ts.map +0 -1
- package/dist/memory/historyUtils.js +0 -190
- package/dist/memory/historyUtils.js.map +0 -1
- package/dist/memory/index.d.ts +0 -7
- package/dist/memory/index.d.ts.map +0 -1
- package/dist/memory/index.js +0 -12
- package/dist/memory/index.js.map +0 -1
- package/dist/memory/ingestKnowledgeBase.d.ts +0 -17
- package/dist/memory/ingestKnowledgeBase.d.ts.map +0 -1
- package/dist/memory/ingestKnowledgeBase.js +0 -35
- package/dist/memory/ingestKnowledgeBase.js.map +0 -1
- package/dist/services/MoralisService.d.ts +0 -1328
- package/dist/services/MoralisService.d.ts.map +0 -1
- package/dist/services/MoralisService.js +0 -1239
- package/dist/services/MoralisService.js.map +0 -1
- package/dist/services/PantographService.d.ts +0 -98
- package/dist/services/PantographService.d.ts.map +0 -1
- package/dist/services/PantographService.js +0 -451
- package/dist/services/PantographService.js.map +0 -1
- package/dist/services/PoolService.d.ts +0 -238
- package/dist/services/PoolService.d.ts.map +0 -1
- package/dist/services/PoolService.js +0 -485
- package/dist/services/PoolService.js.map +0 -1
- package/dist/services/UniswapService.d.ts +0 -289
- package/dist/services/UniswapService.d.ts.map +0 -1
- package/dist/services/UniswapService.js +0 -585
- package/dist/services/UniswapService.js.map +0 -1
- package/dist/services/UniswapSubgraphService.d.ts +0 -144
- package/dist/services/UniswapSubgraphService.d.ts.map +0 -1
- package/dist/services/UniswapSubgraphService.js +0 -606
- package/dist/services/UniswapSubgraphService.js.map +0 -1
- package/dist/services/rpc.d.ts +0 -35
- package/dist/services/rpc.d.ts.map +0 -1
- package/dist/services/rpc.js +0 -110
- package/dist/services/rpc.js.map +0 -1
- package/dist/services/swap/BaseSwapService.d.ts +0 -17
- package/dist/services/swap/BaseSwapService.d.ts.map +0 -1
- package/dist/services/swap/BaseSwapService.js +0 -19
- package/dist/services/swap/BaseSwapService.js.map +0 -1
- package/dist/services/swap/DebridgeAdapter.d.ts +0 -37
- package/dist/services/swap/DebridgeAdapter.d.ts.map +0 -1
- package/dist/services/swap/DebridgeAdapter.js +0 -243
- package/dist/services/swap/DebridgeAdapter.js.map +0 -1
- package/dist/services/swap/RelayAdapter.d.ts +0 -19
- package/dist/services/swap/RelayAdapter.d.ts.map +0 -1
- package/dist/services/swap/RelayAdapter.js +0 -189
- package/dist/services/swap/RelayAdapter.js.map +0 -1
- package/dist/services/swap/SwapServiceFactory.d.ts +0 -25
- package/dist/services/swap/SwapServiceFactory.d.ts.map +0 -1
- package/dist/services/swap/SwapServiceFactory.js +0 -79
- package/dist/services/swap/SwapServiceFactory.js.map +0 -1
- package/dist/services/swap/addresses.d.ts +0 -3
- package/dist/services/swap/addresses.d.ts.map +0 -1
- package/dist/services/swap/addresses.js +0 -68
- package/dist/services/swap/addresses.js.map +0 -1
- package/dist/services/swap/affiliate.d.ts +0 -17
- package/dist/services/swap/affiliate.d.ts.map +0 -1
- package/dist/services/swap/affiliate.js +0 -126
- package/dist/services/swap/affiliate.js.map +0 -1
- package/dist/services/swap/config.d.ts +0 -9
- package/dist/services/swap/config.d.ts.map +0 -1
- package/dist/services/swap/config.js +0 -19
- package/dist/services/swap/config.js.map +0 -1
- package/dist/services/swap/index.d.ts +0 -10
- package/dist/services/swap/index.d.ts.map +0 -1
- package/dist/services/swap/index.js +0 -22
- package/dist/services/swap/index.js.map +0 -1
- package/dist/services/swap/types.d.ts +0 -89
- package/dist/services/swap/types.d.ts.map +0 -1
- package/dist/services/swap/types.js +0 -6
- package/dist/services/swap/types.js.map +0 -1
- package/dist/tools/BaseTool.d.ts +0 -15
- package/dist/tools/BaseTool.d.ts.map +0 -1
- package/dist/tools/BaseTool.js +0 -35
- package/dist/tools/BaseTool.js.map +0 -1
- package/dist/tools/ToolRegistry.d.ts +0 -27
- package/dist/tools/ToolRegistry.d.ts.map +0 -1
- package/dist/tools/ToolRegistry.js +0 -80
- package/dist/tools/ToolRegistry.js.map +0 -1
- package/dist/tools/builtin/ai/GeminiSearchAiTool.d.ts +0 -36
- package/dist/tools/builtin/ai/GeminiSearchAiTool.d.ts.map +0 -1
- package/dist/tools/builtin/ai/GeminiSearchAiTool.js +0 -91
- package/dist/tools/builtin/ai/GeminiSearchAiTool.js.map +0 -1
- package/dist/tools/builtin/ai/index.d.ts +0 -3
- package/dist/tools/builtin/ai/index.d.ts.map +0 -1
- package/dist/tools/builtin/ai/index.js +0 -6
- package/dist/tools/builtin/ai/index.js.map +0 -1
- package/dist/tools/builtin/index.d.ts +0 -8
- package/dist/tools/builtin/index.d.ts.map +0 -1
- package/dist/tools/builtin/index.js +0 -24
- package/dist/tools/builtin/index.js.map +0 -1
- package/dist/tools/builtin/nft/BaseNftMessageTool.d.ts +0 -35
- package/dist/tools/builtin/nft/BaseNftMessageTool.d.ts.map +0 -1
- package/dist/tools/builtin/nft/BaseNftMessageTool.js +0 -45
- package/dist/tools/builtin/nft/BaseNftMessageTool.js.map +0 -1
- package/dist/tools/builtin/nft/NFTContractInfoTool.d.ts +0 -15
- package/dist/tools/builtin/nft/NFTContractInfoTool.d.ts.map +0 -1
- package/dist/tools/builtin/nft/NFTContractInfoTool.js +0 -19
- package/dist/tools/builtin/nft/NFTContractInfoTool.js.map +0 -1
- package/dist/tools/builtin/nft/NFTMetadataTool.d.ts +0 -15
- package/dist/tools/builtin/nft/NFTMetadataTool.d.ts.map +0 -1
- package/dist/tools/builtin/nft/NFTMetadataTool.js +0 -20
- package/dist/tools/builtin/nft/NFTMetadataTool.js.map +0 -1
- package/dist/tools/builtin/nft/SendNftTool.d.ts +0 -14
- package/dist/tools/builtin/nft/SendNftTool.d.ts.map +0 -1
- package/dist/tools/builtin/nft/SendNftTool.js +0 -20
- package/dist/tools/builtin/nft/SendNftTool.js.map +0 -1
- package/dist/tools/builtin/nft/WalletNFTsTool.d.ts +0 -15
- package/dist/tools/builtin/nft/WalletNFTsTool.d.ts.map +0 -1
- package/dist/tools/builtin/nft/WalletNFTsTool.js +0 -20
- package/dist/tools/builtin/nft/WalletNFTsTool.js.map +0 -1
- package/dist/tools/builtin/nft/index.d.ts +0 -7
- package/dist/tools/builtin/nft/index.d.ts.map +0 -1
- package/dist/tools/builtin/nft/index.js +0 -10
- package/dist/tools/builtin/nft/index.js.map +0 -1
- package/dist/tools/builtin/pool/EstimatePoolYieldTool.d.ts +0 -124
- package/dist/tools/builtin/pool/EstimatePoolYieldTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool/EstimatePoolYieldTool.js +0 -236
- package/dist/tools/builtin/pool/EstimatePoolYieldTool.js.map +0 -1
- package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.d.ts +0 -128
- package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.js +0 -520
- package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.js.map +0 -1
- package/dist/tools/builtin/pool/PoolByAddressTool.d.ts +0 -127
- package/dist/tools/builtin/pool/PoolByAddressTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool/PoolByAddressTool.js +0 -238
- package/dist/tools/builtin/pool/PoolByAddressTool.js.map +0 -1
- package/dist/tools/builtin/pool/PoolDetailTool.d.ts +0 -127
- package/dist/tools/builtin/pool/PoolDetailTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool/PoolDetailTool.js +0 -273
- package/dist/tools/builtin/pool/PoolDetailTool.js.map +0 -1
- package/dist/tools/builtin/pool/PoolSearchTool.d.ts +0 -50
- package/dist/tools/builtin/pool/PoolSearchTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool/PoolSearchTool.js +0 -160
- package/dist/tools/builtin/pool/PoolSearchTool.js.map +0 -1
- package/dist/tools/builtin/pool/PreviewAddLiquidityTool.d.ts +0 -124
- package/dist/tools/builtin/pool/PreviewAddLiquidityTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool/PreviewAddLiquidityTool.js +0 -382
- package/dist/tools/builtin/pool/PreviewAddLiquidityTool.js.map +0 -1
- package/dist/tools/builtin/pool/TopPoolsTool.d.ts +0 -68
- package/dist/tools/builtin/pool/TopPoolsTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool/TopPoolsTool.js +0 -159
- package/dist/tools/builtin/pool/TopPoolsTool.js.map +0 -1
- package/dist/tools/builtin/pool/index.d.ts +0 -15
- package/dist/tools/builtin/pool/index.d.ts.map +0 -1
- package/dist/tools/builtin/pool/index.js +0 -18
- package/dist/tools/builtin/pool/index.js.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.d.ts +0 -54
- package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.js +0 -98
- package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.js.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.d.ts +0 -63
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.js +0 -82
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.js.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.d.ts +0 -79
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.js +0 -97
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.js.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.d.ts +0 -77
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.js +0 -190
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.js.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.d.ts +0 -107
- package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.js +0 -92
- package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.js.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.d.ts +0 -56
- package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.js +0 -94
- package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.js.map +0 -1
- package/dist/tools/builtin/pool-subgraph/index.d.ts +0 -13
- package/dist/tools/builtin/pool-subgraph/index.d.ts.map +0 -1
- package/dist/tools/builtin/pool-subgraph/index.js +0 -18
- package/dist/tools/builtin/pool-subgraph/index.js.map +0 -1
- package/dist/tools/builtin/token/TokenAnalyticsTool.d.ts +0 -71
- package/dist/tools/builtin/token/TokenAnalyticsTool.d.ts.map +0 -1
- package/dist/tools/builtin/token/TokenAnalyticsTool.js +0 -147
- package/dist/tools/builtin/token/TokenAnalyticsTool.js.map +0 -1
- package/dist/tools/builtin/token/TokenHoldersTool.d.ts +0 -81
- package/dist/tools/builtin/token/TokenHoldersTool.d.ts.map +0 -1
- package/dist/tools/builtin/token/TokenHoldersTool.js +0 -139
- package/dist/tools/builtin/token/TokenHoldersTool.js.map +0 -1
- package/dist/tools/builtin/token/TokenInfoTool.d.ts +0 -40
- package/dist/tools/builtin/token/TokenInfoTool.d.ts.map +0 -1
- package/dist/tools/builtin/token/TokenInfoTool.js +0 -221
- package/dist/tools/builtin/token/TokenInfoTool.js.map +0 -1
- package/dist/tools/builtin/token/TokenScoreTool.d.ts +0 -63
- package/dist/tools/builtin/token/TokenScoreTool.d.ts.map +0 -1
- package/dist/tools/builtin/token/TokenScoreTool.js +0 -148
- package/dist/tools/builtin/token/TokenScoreTool.js.map +0 -1
- package/dist/tools/builtin/token/TopGainersTool.d.ts +0 -37
- package/dist/tools/builtin/token/TopGainersTool.d.ts.map +0 -1
- package/dist/tools/builtin/token/TopGainersTool.js +0 -100
- package/dist/tools/builtin/token/TopGainersTool.js.map +0 -1
- package/dist/tools/builtin/token/TopLosersTool.d.ts +0 -66
- package/dist/tools/builtin/token/TopLosersTool.d.ts.map +0 -1
- package/dist/tools/builtin/token/TopLosersTool.js +0 -129
- package/dist/tools/builtin/token/TopLosersTool.js.map +0 -1
- package/dist/tools/builtin/token/TrendingTokensTool.d.ts +0 -39
- package/dist/tools/builtin/token/TrendingTokensTool.d.ts.map +0 -1
- package/dist/tools/builtin/token/TrendingTokensTool.js +0 -83
- package/dist/tools/builtin/token/TrendingTokensTool.js.map +0 -1
- package/dist/tools/builtin/token/index.d.ts +0 -13
- package/dist/tools/builtin/token/index.d.ts.map +0 -1
- package/dist/tools/builtin/token/index.js +0 -16
- package/dist/tools/builtin/token/index.js.map +0 -1
- package/dist/tools/builtin/wallet/TransactionByHashTool.d.ts +0 -70
- package/dist/tools/builtin/wallet/TransactionByHashTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/TransactionByHashTool.js +0 -111
- package/dist/tools/builtin/wallet/TransactionByHashTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletApprovalsTool.d.ts +0 -107
- package/dist/tools/builtin/wallet/WalletApprovalsTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletApprovalsTool.js +0 -164
- package/dist/tools/builtin/wallet/WalletApprovalsTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletDefiPositionsTool.d.ts +0 -61
- package/dist/tools/builtin/wallet/WalletDefiPositionsTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletDefiPositionsTool.js +0 -100
- package/dist/tools/builtin/wallet/WalletDefiPositionsTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.d.ts +0 -68
- package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.js +0 -115
- package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletDefiSummaryTool.d.ts +0 -50
- package/dist/tools/builtin/wallet/WalletDefiSummaryTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletDefiSummaryTool.js +0 -80
- package/dist/tools/builtin/wallet/WalletDefiSummaryTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletHistoryTool.d.ts +0 -31
- package/dist/tools/builtin/wallet/WalletHistoryTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletHistoryTool.js +0 -154
- package/dist/tools/builtin/wallet/WalletHistoryTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletNetWorthTool.d.ts +0 -44
- package/dist/tools/builtin/wallet/WalletNetWorthTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletNetWorthTool.js +0 -122
- package/dist/tools/builtin/wallet/WalletNetWorthTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletNftTransfersTool.d.ts +0 -86
- package/dist/tools/builtin/wallet/WalletNftTransfersTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletNftTransfersTool.js +0 -265
- package/dist/tools/builtin/wallet/WalletNftTransfersTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletPnlSummaryTool.d.ts +0 -43
- package/dist/tools/builtin/wallet/WalletPnlSummaryTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletPnlSummaryTool.js +0 -89
- package/dist/tools/builtin/wallet/WalletPnlSummaryTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletPnlTool.d.ts +0 -43
- package/dist/tools/builtin/wallet/WalletPnlTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletPnlTool.js +0 -175
- package/dist/tools/builtin/wallet/WalletPnlTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletTokenBalancesTool.d.ts +0 -35
- package/dist/tools/builtin/wallet/WalletTokenBalancesTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletTokenBalancesTool.js +0 -68
- package/dist/tools/builtin/wallet/WalletTokenBalancesTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletTokenTransfersTool.d.ts +0 -109
- package/dist/tools/builtin/wallet/WalletTokenTransfersTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletTokenTransfersTool.js +0 -354
- package/dist/tools/builtin/wallet/WalletTokenTransfersTool.js.map +0 -1
- package/dist/tools/builtin/wallet/index.d.ts +0 -28
- package/dist/tools/builtin/wallet/index.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/index.js +0 -32
- package/dist/tools/builtin/wallet/index.js.map +0 -1
- package/dist/tools/builtin/wallet-action/ApproveTokenTool.d.ts +0 -25
- package/dist/tools/builtin/wallet-action/ApproveTokenTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/ApproveTokenTool.js +0 -98
- package/dist/tools/builtin/wallet-action/ApproveTokenTool.js.map +0 -1
- package/dist/tools/builtin/wallet-action/BaseWalletActionTool.d.ts +0 -211
- package/dist/tools/builtin/wallet-action/BaseWalletActionTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/BaseWalletActionTool.js +0 -499
- package/dist/tools/builtin/wallet-action/BaseWalletActionTool.js.map +0 -1
- package/dist/tools/builtin/wallet-action/BuyTokenTool.d.ts +0 -240
- package/dist/tools/builtin/wallet-action/BuyTokenTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/BuyTokenTool.js +0 -1257
- package/dist/tools/builtin/wallet-action/BuyTokenTool.js.map +0 -1
- package/dist/tools/builtin/wallet-action/SendNativeTool.d.ts +0 -41
- package/dist/tools/builtin/wallet-action/SendNativeTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/SendNativeTool.js +0 -127
- package/dist/tools/builtin/wallet-action/SendNativeTool.js.map +0 -1
- package/dist/tools/builtin/wallet-action/SendTokenTool.d.ts +0 -63
- package/dist/tools/builtin/wallet-action/SendTokenTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/SendTokenTool.js +0 -294
- package/dist/tools/builtin/wallet-action/SendTokenTool.js.map +0 -1
- package/dist/tools/builtin/wallet-action/SwapTokenTool.d.ts +0 -247
- package/dist/tools/builtin/wallet-action/SwapTokenTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/SwapTokenTool.js +0 -1258
- package/dist/tools/builtin/wallet-action/SwapTokenTool.js.map +0 -1
- package/dist/tools/builtin/wallet-action/UnwrapNativeTool.d.ts +0 -20
- package/dist/tools/builtin/wallet-action/UnwrapNativeTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/UnwrapNativeTool.js +0 -36
- package/dist/tools/builtin/wallet-action/UnwrapNativeTool.js.map +0 -1
- package/dist/tools/builtin/wallet-action/WrapNativeTool.d.ts +0 -23
- package/dist/tools/builtin/wallet-action/WrapNativeTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/WrapNativeTool.js +0 -54
- package/dist/tools/builtin/wallet-action/WrapNativeTool.js.map +0 -1
- package/dist/tools/builtin/wallet-action/amountSpec.d.ts +0 -62
- package/dist/tools/builtin/wallet-action/amountSpec.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/amountSpec.js +0 -93
- package/dist/tools/builtin/wallet-action/amountSpec.js.map +0 -1
- package/dist/tools/builtin/wallet-action/gasReserve.d.ts +0 -42
- package/dist/tools/builtin/wallet-action/gasReserve.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/gasReserve.js +0 -103
- package/dist/tools/builtin/wallet-action/gasReserve.js.map +0 -1
- package/dist/tools/builtin/wallet-action/index.d.ts +0 -9
- package/dist/tools/builtin/wallet-action/index.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/index.js +0 -20
- package/dist/tools/builtin/wallet-action/index.js.map +0 -1
- package/dist/tools/chainResolver.d.ts +0 -98
- package/dist/tools/chainResolver.d.ts.map +0 -1
- package/dist/tools/chainResolver.js +0 -302
- package/dist/tools/chainResolver.js.map +0 -1
- package/dist/tools/index.d.ts +0 -4
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -23
- package/dist/tools/index.js.map +0 -1
- package/dist/types/index.d.ts +0 -777
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -6
- package/dist/types/index.js.map +0 -1
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RelayAdapter = void 0;
|
|
4
|
-
const BaseSwapService_1 = require("./BaseSwapService");
|
|
5
|
-
const affiliate_1 = require("./affiliate");
|
|
6
|
-
const DEFAULT_BASE_URL = 'https://api.relay.link';
|
|
7
|
-
/** Relay uses its own Solana chain id; keep this mapping isolated to the adapter. */
|
|
8
|
-
function convertChainId(chainId) {
|
|
9
|
-
if (chainId === 7565164 || chainId === '7565164')
|
|
10
|
-
return 792703809;
|
|
11
|
-
return chainId;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Relay.link adapter. Relay bundles approval + swap into a single quote (one
|
|
15
|
-
* "approve" step + one "swap"/"deposit" step), so `hasIntegratedApproval` is true.
|
|
16
|
-
*/
|
|
17
|
-
class RelayAdapter extends BaseSwapService_1.BaseSwapService {
|
|
18
|
-
apiBaseUrl;
|
|
19
|
-
apiKey;
|
|
20
|
-
constructor(config = {}) {
|
|
21
|
-
super(config);
|
|
22
|
-
this.apiBaseUrl = config.apiBaseUrl ?? DEFAULT_BASE_URL;
|
|
23
|
-
this.apiKey = config.apiKey;
|
|
24
|
-
}
|
|
25
|
-
getProviderName() {
|
|
26
|
-
return 'relay';
|
|
27
|
-
}
|
|
28
|
-
hasIntegratedApproval() {
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
async getQuote(params) {
|
|
32
|
-
const { srcChainId, srcTokenAddress, srcTokenAmount, dstChainId, dstTokenAddress, recipientAddress, senderAddress, slippage, } = params;
|
|
33
|
-
const affiliate = await (0, affiliate_1.getAffiliateFee)(this.getProviderName(), srcChainId);
|
|
34
|
-
const body = {
|
|
35
|
-
user: recipientAddress || senderAddress,
|
|
36
|
-
originChainId: convertChainId(srcChainId),
|
|
37
|
-
destinationChainId: convertChainId(dstChainId),
|
|
38
|
-
originCurrency: srcTokenAddress,
|
|
39
|
-
destinationCurrency: dstTokenAddress,
|
|
40
|
-
amount: srcTokenAmount,
|
|
41
|
-
recipient: recipientAddress || senderAddress,
|
|
42
|
-
tradeType: 'EXACT_INPUT',
|
|
43
|
-
};
|
|
44
|
-
if (affiliate) {
|
|
45
|
-
body.appFees = [
|
|
46
|
-
{
|
|
47
|
-
recipient: affiliate.affiliateFeeRecipient,
|
|
48
|
-
fee: Math.floor(affiliate.affiliateFeePercent * 100),
|
|
49
|
-
},
|
|
50
|
-
];
|
|
51
|
-
}
|
|
52
|
-
if (typeof slippage === 'number' && Number.isFinite(slippage)) {
|
|
53
|
-
body.slippageTolerance = Math.floor(slippage * 100).toString();
|
|
54
|
-
}
|
|
55
|
-
// slippage === 'auto' (or undefined): omit the field, Relay applies its server-side default.
|
|
56
|
-
try {
|
|
57
|
-
const res = await this.request('/quote/v2', 'POST', body);
|
|
58
|
-
if (!res || res.error) {
|
|
59
|
-
return {
|
|
60
|
-
success: false,
|
|
61
|
-
error: res?.error ?? 'Unknown error',
|
|
62
|
-
errorMessage: res?.message ?? 'Failed to fetch quote from Relay',
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
const approveStep = res.steps?.find((s) => s.id === 'approve');
|
|
66
|
-
const swapStep = res.steps?.find((s) => s.id === 'swap' || s.id === 'deposit');
|
|
67
|
-
const swapTxData = swapStep?.items?.[0]?.data;
|
|
68
|
-
const isSolanaTx = Array.isArray(swapTxData?.instructions);
|
|
69
|
-
const tx = swapTxData
|
|
70
|
-
? isSolanaTx
|
|
71
|
-
? {
|
|
72
|
-
data: {
|
|
73
|
-
instructions: swapTxData.instructions ?? [],
|
|
74
|
-
addressLookupTableAddresses: swapTxData.addressLookupTableAddresses ?? [],
|
|
75
|
-
},
|
|
76
|
-
chainId: swapTxData.chainId,
|
|
77
|
-
}
|
|
78
|
-
: {
|
|
79
|
-
from: swapTxData.from,
|
|
80
|
-
to: swapTxData.to,
|
|
81
|
-
data: swapTxData.data,
|
|
82
|
-
value: swapTxData.value,
|
|
83
|
-
chainId: swapTxData.chainId,
|
|
84
|
-
maxFeePerGas: swapTxData.maxFeePerGas,
|
|
85
|
-
maxPriorityFeePerGas: swapTxData.maxPriorityFeePerGas,
|
|
86
|
-
}
|
|
87
|
-
: null;
|
|
88
|
-
return {
|
|
89
|
-
success: true,
|
|
90
|
-
provider: 'relay',
|
|
91
|
-
tx,
|
|
92
|
-
isCrossChain: srcChainId !== dstChainId,
|
|
93
|
-
srcChainId,
|
|
94
|
-
dstChainId,
|
|
95
|
-
raw: {
|
|
96
|
-
steps: res.steps,
|
|
97
|
-
fees: res.fees,
|
|
98
|
-
details: res.details,
|
|
99
|
-
approveStep,
|
|
100
|
-
requestId: swapStep?.requestId,
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
catch (error) {
|
|
105
|
-
return {
|
|
106
|
-
success: false,
|
|
107
|
-
error,
|
|
108
|
-
errorMessage: error instanceof Error ? error.message : 'Failed to fetch quote',
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
async checkApproval(params) {
|
|
113
|
-
const approveStep = params.quoteData?.raw?.approveStep;
|
|
114
|
-
if (approveStep) {
|
|
115
|
-
const approvalTxData = approveStep.items?.[0]?.data;
|
|
116
|
-
return {
|
|
117
|
-
isNeeded: true,
|
|
118
|
-
integrated: true,
|
|
119
|
-
approvalData: approvalTxData,
|
|
120
|
-
contractAddress: approvalTxData?.to,
|
|
121
|
-
message: 'Approval step is included in quote and will be executed first.',
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
return {
|
|
125
|
-
isNeeded: false,
|
|
126
|
-
integrated: true,
|
|
127
|
-
message: 'No approval needed or already approved',
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
async executeSwap(params) {
|
|
131
|
-
const { quoteData } = params;
|
|
132
|
-
const raw = quoteData.raw;
|
|
133
|
-
if (!raw?.steps) {
|
|
134
|
-
return { success: false, error: 'Invalid quote data' };
|
|
135
|
-
}
|
|
136
|
-
return {
|
|
137
|
-
success: true,
|
|
138
|
-
provider: 'relay',
|
|
139
|
-
steps: raw.steps,
|
|
140
|
-
estimation: quoteData.estimation,
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
async trackTransaction(params) {
|
|
144
|
-
try {
|
|
145
|
-
const res = await this.request('/intents/status/v3', 'GET', {
|
|
146
|
-
requestId: params.requestIdOrTxHash,
|
|
147
|
-
});
|
|
148
|
-
const status = res.status ?? '';
|
|
149
|
-
if (status === 'success' || status === 'refunded') {
|
|
150
|
-
return { success: true, status: 'COMPLETED' };
|
|
151
|
-
}
|
|
152
|
-
if (status === 'failure' || status === 'expired') {
|
|
153
|
-
return { success: true, status: 'FAILED' };
|
|
154
|
-
}
|
|
155
|
-
return { success: true, status: 'PENDING' };
|
|
156
|
-
}
|
|
157
|
-
catch (error) {
|
|
158
|
-
return {
|
|
159
|
-
success: false,
|
|
160
|
-
status: 'ERROR',
|
|
161
|
-
error: error instanceof Error ? error.message : String(error),
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
async request(endpoint, method, payload) {
|
|
166
|
-
const headers = { 'Content-Type': 'application/json' };
|
|
167
|
-
if (this.apiKey)
|
|
168
|
-
headers['x-api-key'] = this.apiKey;
|
|
169
|
-
let url = `${this.apiBaseUrl}${endpoint}`;
|
|
170
|
-
const init = { method, headers };
|
|
171
|
-
if (method === 'GET' && payload) {
|
|
172
|
-
const qs = Object.entries(payload)
|
|
173
|
-
.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(String(v))}`)
|
|
174
|
-
.join('&');
|
|
175
|
-
url = `${url}?${qs}`;
|
|
176
|
-
}
|
|
177
|
-
else if (method === 'POST' && payload) {
|
|
178
|
-
init.body = JSON.stringify(payload);
|
|
179
|
-
}
|
|
180
|
-
const response = await fetch(url, init);
|
|
181
|
-
if (!response.ok) {
|
|
182
|
-
const errorData = (await response.json().catch(() => ({})));
|
|
183
|
-
throw new Error(errorData.message ?? `HTTP ${response.status}`);
|
|
184
|
-
}
|
|
185
|
-
return (await response.json());
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
exports.RelayAdapter = RelayAdapter;
|
|
189
|
-
//# sourceMappingURL=RelayAdapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RelayA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,EAAE,CAAC;QACvB,CAAC;aAAM,IAAI,MAAM,KAAK,MAAM,IAAI,OAAO,EAAE,CAAC;YACxC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,SAAS,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAyB,CAAC;YACpF,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,IAAI,QAAQ,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QAClE,CAAC;QACD,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAM,CAAC;IACtC,CAAC;CACF;AAtMD,oCAsMC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { BaseSwapService } from './BaseSwapService';
|
|
2
|
-
import type { ExchangeProviderConfig, ProviderName } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Picks the right swap adapter based on the source chain.
|
|
5
|
-
*
|
|
6
|
-
* Resolution: query the exchange settings API's `bridgeProviderByChain` map.
|
|
7
|
-
* Falls back to `DEFAULT_PROVIDER` when the API is unreachable or the chain
|
|
8
|
-
* has no mapping. Adapter instances are cached per provider name.
|
|
9
|
-
*/
|
|
10
|
-
export declare class SwapServiceFactory {
|
|
11
|
-
private readonly providerConfig;
|
|
12
|
-
private readonly isProduction;
|
|
13
|
-
private readonly cache;
|
|
14
|
-
constructor(providerConfig?: ExchangeProviderConfig, isProduction?: boolean);
|
|
15
|
-
getService(srcChainId?: number | string | null): Promise<BaseSwapService>;
|
|
16
|
-
getServiceByProvider(provider: ProviderName): Promise<BaseSwapService>;
|
|
17
|
-
getActiveProvider(srcChainId?: number | string | null): Promise<ProviderName>;
|
|
18
|
-
isProviderActive(name: ProviderName, srcChainId?: number | string | null): Promise<boolean>;
|
|
19
|
-
getAvailableProviders(): ProviderName[];
|
|
20
|
-
clearCache(): void;
|
|
21
|
-
private createService;
|
|
22
|
-
}
|
|
23
|
-
/** Default singleton. */
|
|
24
|
-
export declare const swapServiceFactory: SwapServiceFactory;
|
|
25
|
-
//# sourceMappingURL=SwapServiceFactory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SwapServiceFactory.d.ts","sourceRoot":"","sources":["../../../src/services/swap/SwapServiceFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAQpE;;;;;;GAMG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAyB;IACxD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAU;IACvC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA4C;gBAEtD,cAAc,GAAE,sBAA6C,EAAE,YAAY,UAAO;IAKxF,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,eAAe,CAAC;IAUzE,oBAAoB,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC;IAStE,iBAAiB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC;IAO7E,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC;IAIjG,qBAAqB,IAAI,YAAY,EAAE;IAIvC,UAAU,IAAI,IAAI;IAIlB,OAAO,CAAC,aAAa;CAatB;AAED,yBAAyB;AACzB,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.swapServiceFactory = exports.SwapServiceFactory = void 0;
|
|
4
|
-
const DebridgeAdapter_1 = require("./DebridgeAdapter");
|
|
5
|
-
const RelayAdapter_1 = require("./RelayAdapter");
|
|
6
|
-
const affiliate_1 = require("./affiliate");
|
|
7
|
-
const config_1 = require("./config");
|
|
8
|
-
function normalizeChainId(chainId) {
|
|
9
|
-
if (chainId === null || chainId === undefined)
|
|
10
|
-
return null;
|
|
11
|
-
const n = typeof chainId === 'number' ? chainId : Number(chainId);
|
|
12
|
-
return Number.isFinite(n) ? n : null;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Picks the right swap adapter based on the source chain.
|
|
16
|
-
*
|
|
17
|
-
* Resolution: query the exchange settings API's `bridgeProviderByChain` map.
|
|
18
|
-
* Falls back to `DEFAULT_PROVIDER` when the API is unreachable or the chain
|
|
19
|
-
* has no mapping. Adapter instances are cached per provider name.
|
|
20
|
-
*/
|
|
21
|
-
class SwapServiceFactory {
|
|
22
|
-
providerConfig;
|
|
23
|
-
isProduction;
|
|
24
|
-
cache = new Map();
|
|
25
|
-
constructor(providerConfig = config_1.SWAP_PROVIDER_CONFIG, isProduction = true) {
|
|
26
|
-
this.providerConfig = providerConfig;
|
|
27
|
-
this.isProduction = isProduction;
|
|
28
|
-
}
|
|
29
|
-
async getService(srcChainId) {
|
|
30
|
-
const provider = await this.getActiveProvider(srcChainId);
|
|
31
|
-
const cached = this.cache.get(provider);
|
|
32
|
-
if (cached)
|
|
33
|
-
return cached;
|
|
34
|
-
const service = this.createService(provider);
|
|
35
|
-
this.cache.set(provider, service);
|
|
36
|
-
return service;
|
|
37
|
-
}
|
|
38
|
-
async getServiceByProvider(provider) {
|
|
39
|
-
const cached = this.cache.get(provider);
|
|
40
|
-
if (cached)
|
|
41
|
-
return cached;
|
|
42
|
-
const service = this.createService(provider);
|
|
43
|
-
this.cache.set(provider, service);
|
|
44
|
-
return service;
|
|
45
|
-
}
|
|
46
|
-
async getActiveProvider(srcChainId) {
|
|
47
|
-
const src = normalizeChainId(srcChainId);
|
|
48
|
-
if (src === null)
|
|
49
|
-
return config_1.DEFAULT_PROVIDER;
|
|
50
|
-
const mapped = await (0, affiliate_1.getProviderByChain)(src, this.isProduction);
|
|
51
|
-
return mapped ?? config_1.DEFAULT_PROVIDER;
|
|
52
|
-
}
|
|
53
|
-
async isProviderActive(name, srcChainId) {
|
|
54
|
-
return (await this.getActiveProvider(srcChainId)) === name;
|
|
55
|
-
}
|
|
56
|
-
getAvailableProviders() {
|
|
57
|
-
return Object.keys(this.providerConfig);
|
|
58
|
-
}
|
|
59
|
-
clearCache() {
|
|
60
|
-
this.cache.clear();
|
|
61
|
-
}
|
|
62
|
-
createService(name) {
|
|
63
|
-
const cfg = this.providerConfig[name] ?? {};
|
|
64
|
-
switch (name) {
|
|
65
|
-
case 'debridge':
|
|
66
|
-
return new DebridgeAdapter_1.DebridgeAdapter(cfg);
|
|
67
|
-
case 'relay':
|
|
68
|
-
return new RelayAdapter_1.RelayAdapter(cfg);
|
|
69
|
-
default: {
|
|
70
|
-
const exhaustive = name;
|
|
71
|
-
throw new Error(`Unknown swap provider: ${String(exhaustive)}`);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
exports.SwapServiceFactory = SwapServiceFactory;
|
|
77
|
-
/** Default singleton. */
|
|
78
|
-
exports.swapServiceFactory = new SwapServiceFactory();
|
|
79
|
-
//# sourceMappingURL=SwapServiceFactory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SwapServiceFactory.js","sourceRoot":"","sources":["../../../src/services/swap/SwapServiceFactory.ts"],"names":[],"mappings":";;;AACA,uDAAoD;AACpD,iDAA8C;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AAC;CACF;AA7DD,gDA6DC;AAED,yBAAyB;AACZ,QAAA,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../../src/services/swap/addresses.ts"],"names":[],"mappings":"AAmEA,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE3G;AAED,wBAAsB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAEnH"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getGatewayAddress = getGatewayAddress;
|
|
4
|
-
exports.getPositionManagerAddress = getPositionManagerAddress;
|
|
5
|
-
const PROD_URL = 'https://api.coinpool.app/config/addresses';
|
|
6
|
-
const DEV_URL = 'https://coinpool-api-op.bacoor-test001.xyz/config/addresses';
|
|
7
|
-
const cache = {
|
|
8
|
-
prod: null,
|
|
9
|
-
dev: null,
|
|
10
|
-
};
|
|
11
|
-
const pending = {
|
|
12
|
-
prod: null,
|
|
13
|
-
dev: null,
|
|
14
|
-
};
|
|
15
|
-
async function fetchAddresses(isProduction) {
|
|
16
|
-
const key = isProduction ? 'prod' : 'dev';
|
|
17
|
-
if (cache[key])
|
|
18
|
-
return cache[key];
|
|
19
|
-
if (pending[key])
|
|
20
|
-
return pending[key];
|
|
21
|
-
const url = isProduction ? PROD_URL : DEV_URL;
|
|
22
|
-
pending[key] = (async () => {
|
|
23
|
-
try {
|
|
24
|
-
const res = await fetch(url, {
|
|
25
|
-
method: 'GET',
|
|
26
|
-
headers: { Accept: 'application/json' },
|
|
27
|
-
});
|
|
28
|
-
const json = (await res.json());
|
|
29
|
-
cache[key] = json?.data ?? null;
|
|
30
|
-
return cache[key];
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
finally {
|
|
36
|
-
pending[key] = null;
|
|
37
|
-
}
|
|
38
|
-
})();
|
|
39
|
-
return pending[key];
|
|
40
|
-
}
|
|
41
|
-
/** Normalize a hex chain id ("0x2105") or decimal string to a decimal string key. */
|
|
42
|
-
function toDecimalChainKey(chainId) {
|
|
43
|
-
const trimmed = chainId.trim();
|
|
44
|
-
if (/^0x[0-9a-fA-F]+$/.test(trimmed)) {
|
|
45
|
-
const n = Number.parseInt(trimmed, 16);
|
|
46
|
-
return Number.isFinite(n) ? String(n) : null;
|
|
47
|
-
}
|
|
48
|
-
return /^\d+$/.test(trimmed) ? trimmed : null;
|
|
49
|
-
}
|
|
50
|
-
async function getAddressFor(key, chainId, isProduction) {
|
|
51
|
-
const data = await fetchAddresses(isProduction);
|
|
52
|
-
if (!data)
|
|
53
|
-
return undefined;
|
|
54
|
-
const decimal = toDecimalChainKey(chainId);
|
|
55
|
-
if (!decimal)
|
|
56
|
-
return undefined;
|
|
57
|
-
const entry = data[key]?.[decimal];
|
|
58
|
-
if (Array.isArray(entry))
|
|
59
|
-
return entry[0];
|
|
60
|
-
return typeof entry === 'string' ? entry : undefined;
|
|
61
|
-
}
|
|
62
|
-
async function getGatewayAddress(chainId, isProduction) {
|
|
63
|
-
return getAddressFor('createPoolProxyV3', chainId, isProduction);
|
|
64
|
-
}
|
|
65
|
-
async function getPositionManagerAddress(chainId, isProduction) {
|
|
66
|
-
return getAddressFor('nftPositionUniswap', chainId, isProduction);
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=addresses.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addresses.js","sourceRoot":"","sources":["../../../src/services/swap/addresses.ts"],"names":[],"mappings":";;AAmEA,8CAEC;AAED,8DAEC;AAzED,MAAM,QAAQ,GAAG,2CA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,oBAAoB,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ProviderName } from './types';
|
|
2
|
-
export interface AffiliateFee {
|
|
3
|
-
affiliateFeeRecipient: string;
|
|
4
|
-
affiliateFeePercent: number;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Returns the active provider for `chainId` from the coinpool config API, or
|
|
8
|
-
* `null` when the API is unreachable or the chain has no mapping (caller should
|
|
9
|
-
* fall back to a default).
|
|
10
|
-
*/
|
|
11
|
-
export declare function getProviderByChain(chainId: number | string, isProduction: boolean): Promise<ProviderName | null>;
|
|
12
|
-
/**
|
|
13
|
-
* Returns the affiliate fee tuple for the given provider+chain, or `null` when
|
|
14
|
-
* no fee should be attached (missing recipient or percent <= 0).
|
|
15
|
-
*/
|
|
16
|
-
export declare function getAffiliateFee(provider: ProviderName, chainId: number | string): Promise<AffiliateFee | null>;
|
|
17
|
-
//# sourceMappingURL=affiliate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"affiliate.d.ts","sourceRoot":"","sources":["../../../src/services/swap/affiliate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAqB5C,MAAM,WAAW,YAAY;IAC3B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAyFD;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAI9B;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAqBpH"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getProviderByChain = getProviderByChain;
|
|
4
|
-
exports.getAffiliateFee = getAffiliateFee;
|
|
5
|
-
const AFFILIATE_SETTING_URL = 'https://exchange-api.keyring.app/admin/setting?configs=others';
|
|
6
|
-
const PROVIDER_MAP_URL_PROD = 'https://api.coinpool.app/config/bridgeProviderByChain';
|
|
7
|
-
const PROVIDER_MAP_URL_DEV = 'https://coinpool-api-op.bacoor-test001.xyz/config/bridgeProviderByChain';
|
|
8
|
-
function memoize(loader) {
|
|
9
|
-
let cached = null;
|
|
10
|
-
let pending = null;
|
|
11
|
-
return async () => {
|
|
12
|
-
if (cached)
|
|
13
|
-
return cached;
|
|
14
|
-
if (pending)
|
|
15
|
-
return pending;
|
|
16
|
-
pending = (async () => {
|
|
17
|
-
try {
|
|
18
|
-
const result = await loader();
|
|
19
|
-
cached = result;
|
|
20
|
-
return cached;
|
|
21
|
-
}
|
|
22
|
-
catch {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
finally {
|
|
26
|
-
pending = null;
|
|
27
|
-
}
|
|
28
|
-
})();
|
|
29
|
-
return pending;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
async function fetchJson(url) {
|
|
33
|
-
const res = await fetch(url, {
|
|
34
|
-
method: 'GET',
|
|
35
|
-
headers: { Accept: 'application/json' },
|
|
36
|
-
});
|
|
37
|
-
return (await res.json());
|
|
38
|
-
}
|
|
39
|
-
const fetchAffiliateOthers = memoize(async () => {
|
|
40
|
-
const json = await fetchJson(AFFILIATE_SETTING_URL);
|
|
41
|
-
return json?.others ?? null;
|
|
42
|
-
});
|
|
43
|
-
const providerMapCache = {
|
|
44
|
-
prod: null,
|
|
45
|
-
dev: null,
|
|
46
|
-
};
|
|
47
|
-
const providerMapPending = { prod: null, dev: null };
|
|
48
|
-
async function fetchProviderMap(isProduction) {
|
|
49
|
-
const key = isProduction ? 'prod' : 'dev';
|
|
50
|
-
if (providerMapCache[key])
|
|
51
|
-
return providerMapCache[key];
|
|
52
|
-
if (providerMapPending[key])
|
|
53
|
-
return providerMapPending[key];
|
|
54
|
-
const url = isProduction ? PROVIDER_MAP_URL_PROD : PROVIDER_MAP_URL_DEV;
|
|
55
|
-
providerMapPending[key] = (async () => {
|
|
56
|
-
try {
|
|
57
|
-
const json = await fetchJson(url);
|
|
58
|
-
providerMapCache[key] = json?.data ?? null;
|
|
59
|
-
return providerMapCache[key];
|
|
60
|
-
}
|
|
61
|
-
catch {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
finally {
|
|
65
|
-
providerMapPending[key] = null;
|
|
66
|
-
}
|
|
67
|
-
})();
|
|
68
|
-
return providerMapPending[key];
|
|
69
|
-
}
|
|
70
|
-
function parseRecipientMap(raw) {
|
|
71
|
-
if (!raw)
|
|
72
|
-
return null;
|
|
73
|
-
try {
|
|
74
|
-
const parsed = JSON.parse(raw);
|
|
75
|
-
return parsed && typeof parsed === 'object' ? parsed : null;
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
function toPercent(value) {
|
|
82
|
-
if (value === undefined || value === null)
|
|
83
|
-
return 0;
|
|
84
|
-
const n = typeof value === 'number' ? value : Number(value);
|
|
85
|
-
return Number.isFinite(n) ? n : 0;
|
|
86
|
-
}
|
|
87
|
-
function isProviderName(value) {
|
|
88
|
-
return value === 'debridge' || value === 'relay';
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Returns the active provider for `chainId` from the coinpool config API, or
|
|
92
|
-
* `null` when the API is unreachable or the chain has no mapping (caller should
|
|
93
|
-
* fall back to a default).
|
|
94
|
-
*/
|
|
95
|
-
async function getProviderByChain(chainId, isProduction) {
|
|
96
|
-
const map = await fetchProviderMap(isProduction);
|
|
97
|
-
const candidate = map?.[String(chainId)];
|
|
98
|
-
return isProviderName(candidate) ? candidate : null;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Returns the affiliate fee tuple for the given provider+chain, or `null` when
|
|
102
|
-
* no fee should be attached (missing recipient or percent <= 0).
|
|
103
|
-
*/
|
|
104
|
-
async function getAffiliateFee(provider, chainId) {
|
|
105
|
-
const others = await fetchAffiliateOthers();
|
|
106
|
-
if (!others)
|
|
107
|
-
return null;
|
|
108
|
-
let recipient;
|
|
109
|
-
let percent;
|
|
110
|
-
if (provider === 'debridge') {
|
|
111
|
-
const map = parseRecipientMap(others.affiliateRecipient);
|
|
112
|
-
recipient = map?.[String(chainId)];
|
|
113
|
-
percent = toPercent(others.AFFILIATE_FEE_PERENT);
|
|
114
|
-
}
|
|
115
|
-
else if (provider === 'relay') {
|
|
116
|
-
recipient = others.RELAY_AFFILIATE_FEE_RECIPIENT;
|
|
117
|
-
percent = toPercent(others.RELAY_AFFILIATE_FEE_PERCENT);
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
if (!recipient || percent <= 0)
|
|
123
|
-
return null;
|
|
124
|
-
return { affiliateFeeRecipient: recipient, affiliateFeePercent: percent };
|
|
125
|
-
}
|
|
126
|
-
//# sourceMappingURL=affiliate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"affiliate.js","sourceRoot":"","sources":["../../../src/services/swap/affiliate.ts"],"names":[],"mappings":";;AAsHA,gDAOC;AAMD,0CAqBC;AAtJD,MAAM,qBAAqB,GAAG,+DAA+D,CAAC;AAC9F,MAAM,qBAAqB,GAAG,uDAAuD,CAAC;AACtF,MAAM,oBAAoB,GAAG,yEAAyE,CAAC;AAsBvG,SAAS,OAAO,CAAI,MAA+B;IACjD,IAAI,MAAM,GAAa,IAAI,CAAC;IAC5B,IAAI,OAAO,GAA6B,IAAI,CAAC;IAE7C,OAAO,KAAK,IAAI,EAAE;QAChB,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;QAC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AAI,CAAC,SAAS,IAAI,OAAO,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAE5C,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,CAAC;AAC5E,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ExchangeProviderConfig, ProviderName } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Per-provider client config. The active provider for a given chain is decided
|
|
4
|
-
* at runtime by the exchange settings API (`bridgeProviderByChain`); this map
|
|
5
|
-
* only holds connection-level config (base URLs, tokens) for each provider.
|
|
6
|
-
*/
|
|
7
|
-
export declare const SWAP_PROVIDER_CONFIG: ExchangeProviderConfig;
|
|
8
|
-
export declare const DEFAULT_PROVIDER: ProviderName;
|
|
9
|
-
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/services/swap/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,sBAQlC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,YAAyB,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_PROVIDER = exports.SWAP_PROVIDER_CONFIG = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Per-provider client config. The active provider for a given chain is decided
|
|
6
|
-
* at runtime by the exchange settings API (`bridgeProviderByChain`); this map
|
|
7
|
-
* only holds connection-level config (base URLs, tokens) for each provider.
|
|
8
|
-
*/
|
|
9
|
-
exports.SWAP_PROVIDER_CONFIG = {
|
|
10
|
-
debridge: {
|
|
11
|
-
apiBaseUrl: 'https://dln.debridge.finance/v1.0',
|
|
12
|
-
accessToken: 'd6c45897b8f6',
|
|
13
|
-
},
|
|
14
|
-
relay: {
|
|
15
|
-
apiBaseUrl: 'https://api.relay.link',
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
exports.DEFAULT_PROVIDER = 'debridge';
|
|
19
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/services/swap/config.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACU,QAAA,oBAAoB,GAA2B;IAC1D,QAAQ,EAAE;QACR,UAAU,EAAE,mCAAmC;QAC/C,WAAW,EAAE,cAAc;KAC5B;IACD,KAAK,EAAE;QACL,UAAU,EAAE,wBAAwB;KACrC;CACF,CAAC;AAEW,QAAA,gBAAgB,GAAiB,UAAU,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { BaseSwapService } from './BaseSwapService';
|
|
2
|
-
export { DebridgeAdapter } from './DebridgeAdapter';
|
|
3
|
-
export { RelayAdapter } from './RelayAdapter';
|
|
4
|
-
export { SwapServiceFactory, swapServiceFactory } from './SwapServiceFactory';
|
|
5
|
-
export { SWAP_PROVIDER_CONFIG, DEFAULT_PROVIDER } from './config';
|
|
6
|
-
export { getAffiliateFee, getProviderByChain } from './affiliate';
|
|
7
|
-
export type { AffiliateFee } from './affiliate';
|
|
8
|
-
export { getGatewayAddress, getPositionManagerAddress } from './addresses';
|
|
9
|
-
export type { CheckApprovalParams, CheckApprovalResult, ExchangeProviderConfig, ExecuteSwapParams, ExecuteSwapResult, ProviderName, SwapQuoteParams, SwapQuoteResult, SwapServiceConfig, SwapTxData, TrackStatus, TrackTransactionParams, TrackTransactionResult, } from './types';
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/swap/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAClE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAC3E,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,SAAS,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPositionManagerAddress = exports.getGatewayAddress = exports.getProviderByChain = exports.getAffiliateFee = exports.DEFAULT_PROVIDER = exports.SWAP_PROVIDER_CONFIG = exports.swapServiceFactory = exports.SwapServiceFactory = exports.RelayAdapter = exports.DebridgeAdapter = exports.BaseSwapService = void 0;
|
|
4
|
-
var BaseSwapService_1 = require("./BaseSwapService");
|
|
5
|
-
Object.defineProperty(exports, "BaseSwapService", { enumerable: true, get: function () { return BaseSwapService_1.BaseSwapService; } });
|
|
6
|
-
var DebridgeAdapter_1 = require("./DebridgeAdapter");
|
|
7
|
-
Object.defineProperty(exports, "DebridgeAdapter", { enumerable: true, get: function () { return DebridgeAdapter_1.DebridgeAdapter; } });
|
|
8
|
-
var RelayAdapter_1 = require("./RelayAdapter");
|
|
9
|
-
Object.defineProperty(exports, "RelayAdapter", { enumerable: true, get: function () { return RelayAdapter_1.RelayAdapter; } });
|
|
10
|
-
var SwapServiceFactory_1 = require("./SwapServiceFactory");
|
|
11
|
-
Object.defineProperty(exports, "SwapServiceFactory", { enumerable: true, get: function () { return SwapServiceFactory_1.SwapServiceFactory; } });
|
|
12
|
-
Object.defineProperty(exports, "swapServiceFactory", { enumerable: true, get: function () { return SwapServiceFactory_1.swapServiceFactory; } });
|
|
13
|
-
var config_1 = require("./config");
|
|
14
|
-
Object.defineProperty(exports, "SWAP_PROVIDER_CONFIG", { enumerable: true, get: function () { return config_1.SWAP_PROVIDER_CONFIG; } });
|
|
15
|
-
Object.defineProperty(exports, "DEFAULT_PROVIDER", { enumerable: true, get: function () { return config_1.DEFAULT_PROVIDER; } });
|
|
16
|
-
var affiliate_1 = require("./affiliate");
|
|
17
|
-
Object.defineProperty(exports, "getAffiliateFee", { enumerable: true, get: function () { return affiliate_1.getAffiliateFee; } });
|
|
18
|
-
Object.defineProperty(exports, "getProviderByChain", { enumerable: true, get: function () { return affiliate_1.getProviderByChain; } });
|
|
19
|
-
var addresses_1 = require("./addresses");
|
|
20
|
-
Object.defineProperty(exports, "getGatewayAddress", { enumerable: true, get: function () { return addresses_1.getGatewayAddress; } });
|
|
21
|
-
Object.defineProperty(exports, "getPositionManagerAddress", { enumerable: true, get: function () { return addresses_1.getPositionManagerAddress; } });
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/swap/index.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,2DAA8E;AAArE,wHAAA,kBAAkB,OAAA;AAAE,wHAAA,kBAAkB,OAAA;AAC/C,mCAAkE;AAAzD,8GAAA,oBAAoB,OAAA;AAAE,0GAAA,gBAAgB,OAAA;AAC/C,yCAAkE;AAAzD,4GAAA,eAAe,OAAA;AAAE,+GAAA,kBAAkB,OAAA;AAE5C,yCAA2E;AAAlE,8GAAA,iBAAiB,OAAA;AAAE,sHAAA,yBAAyB,OAAA"}
|