Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
"prepare": "pnpm husky"
},
"dependencies": {
"@aiquant/lucid-cardano": "^0.10.11",
"@aiquant/minswap-sdk": "^0.0.0",
"@aiquant/sundaeswap-core": "^1.2.10",
"@blockfrost/blockfrost-js": "^5.7.0",
"@coral-xyz/anchor": "^0.29.0",
"@ethersproject/abstract-provider": "5.7.0",
"@ethersproject/address": "5.7.0",
Expand Down Expand Up @@ -73,6 +77,7 @@
"@solflare-wallet/utl-sdk": "^1.4.0",
"@uniswap/permit2-sdk": "^1.3.1",
"@uniswap/router-sdk": "^2.0.4",
"@sundaeswap/asset": "^1.0.10",
"@uniswap/sdk": "3.0.3",
"@uniswap/sdk-core": "^5.9.0",
"@uniswap/smart-order-router": "^3.59.0",
Expand All @@ -88,6 +93,7 @@
"bigint-buffer": "1.1.5",
"bn.js": "5.2.1",
"brotli": "1.3.2",
"core-js": "^3.43.0",
"dayjs": "^1.11.13",
"decimal.js": "^10.5.0",
"decimal.js-light": "^2.5.1",
Expand Down
5,107 changes: 2,733 additions & 2,374 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ import Fastify, { FastifyInstance } from 'fastify';
// Internal dependencies

// Routes
import { cardanoRoutes } from './chains/cardano/cardano.routes';
import { ethereumRoutes } from './chains/ethereum/ethereum.routes';
import { solanaRoutes } from './chains/solana/solana.routes';
import { configRoutes } from './config/config.routes';
import { register0xRoutes } from './connectors/0x/0x.routes';
import { jupiterRoutes } from './connectors/jupiter/jupiter.routes';
import { meteoraRoutes } from './connectors/meteora/meteora.routes';
import { minswapRoutes } from './connectors/minswap/minswap.routes';
import { pancakeswapRoutes } from './connectors/pancakeswap/pancakeswap.routes';
import { raydiumRoutes } from './connectors/raydium/raydium.routes';
import { sundaeswapRoutes } from './connectors/sundaeswap/sundaeswap.routes';
import { uniswapRoutes } from './connectors/uniswap/uniswap.routes';
import { getHttpsOptions } from './https';
import { poolRoutes } from './pools/pools.routes';
Expand Down Expand Up @@ -71,6 +74,10 @@ const swaggerOptions = {
name: '/chain/ethereum',
description: 'Ethereum and EVM-based chain endpoints',
},
{
name: '/chain/cardano',
description: 'Cardano chain endpoints',
},

// Connectors
{
Expand All @@ -90,6 +97,14 @@ const swaggerOptions = {
description: 'Uniswap connector endpoints',
},
{ name: '/connector/0x', description: '0x connector endpoints' },
{
name: '/connector/minswap/amm',
description: 'Minswap pool connector (Cardano)',
},
{
name: '/connector/sundaeswap/amm',
description: 'Sundaeswap pool connector (Cardano)',
},
],
components: {
parameters: {
Expand Down Expand Up @@ -216,6 +231,7 @@ const configureGatewayServer = () => {
// Register chain routes
app.register(solanaRoutes, { prefix: '/chains/solana' });
app.register(ethereumRoutes, { prefix: '/chains/ethereum' });
app.register(cardanoRoutes, { prefix: '/chains/cardano' });

// Register DEX connector routes - organized by connector

Expand All @@ -238,6 +254,14 @@ const configureGatewayServer = () => {
app.register(uniswapRoutes.amm, { prefix: '/connectors/uniswap/amm' });
app.register(uniswapRoutes.clmm, { prefix: '/connectors/uniswap/clmm' });

// Minswap routes
app.register(minswapRoutes.amm, { prefix: '/connectors/minswap/amm' });

// Sundaeswap routes
app.register(sundaeswapRoutes.amm, {
prefix: '/connectors/sundaeswap/amm',
});

// 0x routes
app.register(register0xRoutes);

Expand Down
19 changes: 19 additions & 0 deletions src/chains/cardano/cardano.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ConfigManagerV2 } from '../../services/config-manager-v2';

export interface Config {
chainID: number;
nativeCurrencySymbol: string;
apiurl: string;
projectId: string;
}

export function getCardanoConfig(networkName: string): Config {
const namespaceId = `cardano-${networkName}`;
return {
chainID: ConfigManagerV2.getInstance().get(namespaceId + '.chainID'),
nativeCurrencySymbol: ConfigManagerV2.getInstance().get(namespaceId + '.nativeCurrencySymbol'),
apiurl: ConfigManagerV2.getInstance().get(namespaceId + '.apiurl'),
projectId: ConfigManagerV2.getInstance().get(namespaceId + '.projectId'),
// Additional Cardano-specific configurations can be added here
};
}
16 changes: 16 additions & 0 deletions src/chains/cardano/cardano.routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { FastifyPluginAsync } from 'fastify';

import { balancesRoute } from './routes/balances';
import { pollRoute } from './routes/poll';
import { statusRoute } from './routes/status';
import { tokensRoute } from './routes/tokens';

export const cardanoRoutes: FastifyPluginAsync = async (fastify) => {
// Register all the route handlers
fastify.register(statusRoute);
fastify.register(tokensRoute);
fastify.register(balancesRoute);
fastify.register(pollRoute);
};

export default cardanoRoutes;
Loading