### API Coverage Examples for @ramaris/sdk Source: https://github.com/ramaris-app/sdk/blob/main/README.md Illustrates various API calls available through the RamarisClient for different tiers. Includes functions for listing and getting strategies, wallets, user profiles, and checking API health. Requires the '@ramaris/sdk' package. ```typescript client.strategies.list({ page, pageSize }) // List strategies client.strategies.get(shareId) // Strategy details client.strategies.watchlist({ page, pageSize }) // Your followed strategies client.wallets.list({ page, pageSize }) // List wallets client.wallets.get(id) // Wallet details client.me.profile() // Your profile client.me.subscription() // Your subscription client.health() // API health check ``` -------------------------------- ### Install @ramaris/sdk Package Source: https://github.com/ramaris-app/sdk/blob/main/README.md Installs the @ramaris/sdk package using npm. This is the first step to integrate the Ramaris SDK into your project. ```bash npm install @ramaris/sdk ``` -------------------------------- ### GET /me/subscription Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Retrieves the subscription details for the currently authenticated user. ```APIDOC ## GET /me/subscription ### Description Get the authenticated user's subscription information. ### Method GET ### Endpoint /me/subscription ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **data** (object) - Subscription details. - **tier** (string) - The subscription tier (e.g., "PRO"). - **status** (string) - The subscription status (e.g., "active"). - **currentPeriodEnd** (string) - The end date of the current subscription period in ISO 8601 format. - **cancelAtPeriodEnd** (boolean) - Indicates if the subscription is set to cancel at the end of the period. - **isFounder** (boolean) - Indicates if the user is a founder. - **createdAt** (string) - The date the subscription was created in ISO 8601 format. #### Response Example ```json { "data": { "tier": "PRO", "status": "active", "currentPeriodEnd": "2026-02-15T00:00:00Z", "cancelAtPeriodEnd": false, "isFounder": false, "createdAt": "2025-01-15T10:00:00Z" } } ``` ``` -------------------------------- ### Get User Profile (GET /me/profile) Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Retrieves the authenticated user's profile information, including their nickname, name, email, and account creation date. It also provides statistics on their activity within the platform. ```json { "data": { "id": "user_abc123", "nickname": "cryptotrader", "name": "John Doe", "email": "john@example.com", "createdAt": "2025-01-15T10:00:00Z", "isFounder": false, "stats": { "strategiesCreated": 3, "walletsFollowed": 12, "strategiesFollowed": 5 } } } ``` -------------------------------- ### Quick Start: Initialize Client and Fetch Data with @ramaris/sdk Source: https://github.com/ramaris-app/sdk/blob/main/README.md Demonstrates how to initialize the RamarisClient with an API key and perform basic operations like listing top strategies and retrieving strategy details. Requires the '@ramaris/sdk' package. ```typescript import { RamarisClient } from '@ramaris/sdk'; const client = new RamarisClient({ apiKey: 'rms_your_api_key', }); // List top strategies const strategies = await client.strategies.list({ pageSize: 10 }); console.log(strategies.data); // Get strategy details const strategy = await client.strategies.get('abc123def'); console.log(strategy.name, strategy.roiPercent); ``` -------------------------------- ### List Trading Strategies (GET /strategies) Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Retrieves a list of trading strategies, sorted by their last activity. This endpoint supports pagination to manage large result sets. The response includes strategy details and pagination information. ```json { "data": [ { "id": 123, "shareId": "abc123def", "name": "DeFi Alpha Hunter", "description": "Tracking top DeFi wallets on Base", "roiPercent": 45.2, "lastActivityAt": "2026-01-15T10:30:00Z", "createdAt": "2025-06-01T08:00:00Z", "creator": { "nickname": "cryptowhale" }, "stats": { "walletsTracked": 5, "totalSwaps": 847 } } ], "pagination": { "page": 1, "pageSize": 20, "totalItems": 156, "totalPages": 8 } } ``` -------------------------------- ### Get User Profile Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Retrieves the profile information for the authenticated user. ```APIDOC ## GET /me/profile ### Description Gets the authenticated user's profile information. Requires authentication. ### Method GET ### Endpoint /api/v1/me/profile ### Response #### Success Response (200) - **data** (object) - User profile details. - **id** (string) - Unique identifier for the user. - **nickname** (string) - User's nickname. - **name** (string) - User's full name. - **email** (string) - User's email address. - **createdAt** (string) - Timestamp when the user account was created. - **isFounder** (boolean) - Indicates if the user is a founder. - **stats** (object) - User statistics. - **strategiesCreated** (integer) - Number of strategies created by the user. - **walletsFollowed** (integer) - Number of wallets followed by the user. - **strategiesFollowed** (integer) - Number of strategies followed by the user. ### Response Example ```json { "data": { "id": "user_abc123", "nickname": "cryptotrader", "name": "John Doe", "email": "john@example.com", "createdAt": "2025-01-15T10:00:00Z", "isFounder": false, "stats": { "strategiesCreated": 3, "walletsFollowed": 12, "strategiesFollowed": 5 } } } ``` ``` -------------------------------- ### Get Specific Strategy (GET /strategies/{shareId}) Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Fetches detailed information for a single trading strategy using its unique 'shareId'. The response provides comprehensive data including status, extended statistics, and associated tags. ```json { "id": 123, "shareId": "abc123def", "name": "DeFi Alpha Hunter", "description": "Tracking top DeFi wallets on Base", "roiPercent": 45.2, "lastActivityAt": "2026-01-15T10:30:00Z", "createdAt": "2025-06-01T08:00:00Z", "creator": { "nickname": "cryptowhale" }, "stats": { "walletsTracked": 5, "totalSwaps": 847, "totalNotifications": 120 }, "tags": ["defi", "base"], "status": "ACTIVE" } ``` -------------------------------- ### List Tracked Wallets (GET /wallets) Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Retrieves a list of tracked blockchain wallets on Base, sorted by their realized Profit and Loss (PnL). This endpoint supports pagination and provides key performance metrics for each wallet. ```json { "data": [ { "id": 456, "winRate": 0.72, "realizedPnL": 125000.50, "createdAt": "2025-03-15T09:00:00Z", "stats": { "totalSwaps": 1234, "openPositions": 8 }, "tags": ["whale", "defi"] } ], "pagination": { "page": 1, "pageSize": 20, "totalItems": 500, "totalPages": 25 } } ``` -------------------------------- ### Get Specific Wallet (GET /wallets/{id}) Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Fetches detailed information for a specific tracked wallet using its numeric ID. The response includes wallet status, follower count, and a list of its most profitable tokens. ```json { "id": 456, "winRate": 0.72, "realizedPnL": 125000.50, "createdAt": "2025-03-15T09:00:00Z", "stats": { "totalSwaps": 1234, "openPositions": 8, "followers": 500 }, "tags": ["whale", "defi"], "status": "ACTIVE", "topTokens": [ { "symbol": "WETH", "pnlPercent": 15.5 }, { "symbol": "USDC", "pnlPercent": 2.1 } ] } ``` -------------------------------- ### Get User Subscription Info (JSON) Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Retrieves the subscription details for the currently authenticated user. This endpoint returns information about the user's subscription tier, status, and relevant dates. No specific dependencies are required beyond authentication. ```json { "data": { "tier": "PRO", "status": "active", "currentPeriodEnd": "2026-02-15T00:00:00Z", "cancelAtPeriodEnd": false, "isFounder": false, "createdAt": "2025-01-15T10:00:00Z" } } ``` -------------------------------- ### Get Specific Strategy Details Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Retrieves detailed information about a specific trading strategy using its unique share ID. ```APIDOC ## GET /strategies/{shareId} ### Description Gets detailed information about a specific strategy using its share ID. ### Method GET ### Endpoint /api/v1/strategies/{shareId} ### Parameters #### Path Parameters - **shareId** (string, required) - The strategy's unique share ID. ### Response #### Success Response (200) - **id** (integer) - Unique identifier for the strategy. - **shareId** (string) - Unique shareable ID for the strategy. - **name** (string) - Name of the strategy. - **description** (string) - Description of the strategy. - **roiPercent** (number) - Return on Investment percentage. - **lastActivityAt** (string) - Timestamp of the last activity. - **createdAt** (string) - Timestamp when the strategy was created. - **creator** (object) - Information about the strategy creator. - **nickname** (string) - Creator's nickname. - **stats** (object) - Statistics related to the strategy. - **walletsTracked** (integer) - Number of wallets tracked in the strategy. - **totalSwaps** (integer) - Total number of swaps made by wallets in the strategy. - **totalNotifications** (integer) - Total notifications sent for this strategy. - **status** (string) - Status of the strategy (e.g., ACTIVE, INACTIVE, DELETED). - **tags** (array of strings) - Array of tags associated with the strategy. ``` -------------------------------- ### GET /health Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Checks the health status of the API. Useful for monitoring purposes. ```APIDOC ## GET /health ### Description API health check. Useful for monitoring. ### Method GET ### Endpoint /health ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **status** (string) - The health status of the API (e.g., "ok"). - **version** (string) - The API version. - **timestamp** (string) - The timestamp of the health check in ISO 8601 format. - **user** (string) - Identifier for the user associated with the request. - **rateLimit** (object) - Information about the current rate limit. - **limit** (integer) - The maximum number of requests allowed. - **keyPrefix** (string) - A prefix for the rate limit key. #### Response Example ```json { "status": "ok", "version": "v1", "timestamp": "2026-01-15T10:30:00Z", "user": "user_abc123", "rateLimit": { "limit": 1000, "keyPrefix": "rms_abc1" } } ``` ``` -------------------------------- ### Get Specific Wallet Details Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Retrieves detailed information about a specific tracked wallet using its numeric ID. ```APIDOC ## GET /wallets/{id} ### Description Gets detailed information about a specific tracked wallet using its numeric ID. ### Method GET ### Endpoint /api/v1/wallets/{id} ### Parameters #### Path Parameters - **id** (integer, required) - The wallet's numeric ID. ### Response #### Success Response (200) - **id** (integer) - Unique identifier for the wallet. - **winRate** (number) - Percentage of profitable trades (0-1). - **realizedPnL** (number) - Total profit/loss in USD from closed positions. - **createdAt** (string) - Timestamp when the wallet started being tracked. - **stats** (object) - Statistics related to the wallet. - **totalSwaps** (integer) - Total number of swaps made by the wallet. - **openPositions** (integer) - Number of current open positions. - **followers** (integer) - Number of users following this wallet. - **tags** (array of strings) - User-assigned categories for the wallet. - **status** (string) - Status of the wallet. - **topTokens** (array) - Array of most profitable tokens traded by the wallet. ``` -------------------------------- ### Get Wallet Details Source: https://context7.com/ramaris-app/sdk/llms.txt Retrieves detailed information about a specific wallet by ID. Requires PRO tier or higher. ```APIDOC ## Get Wallet Details ### Description Retrieves detailed information about a specific wallet by ID. Requires PRO tier or higher. Returns extended metrics including follower count and top performing tokens. ### Method GET ### Endpoint /wallets/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the wallet. #### Response #### Success Response (200) - **id** (string) - The unique identifier for the wallet. - **status** (string) - The current status of the wallet. - **winRate** (number) - The win rate of the wallet. - **realizedPnL** (number) - The realized profit and loss of the wallet. - **stats** (object) - Wallet statistics. - **followers** (integer) - Number of followers. - **totalSwaps** (integer) - Total number of swaps made. - **openPositions** (integer) - Number of open positions. - **tags** (array) - Array of tags associated with the wallet. - **topTokens** (array) - Array of top performing tokens. - **symbol** (string) - The symbol of the token. - **realizedProfitUsd** (number) - The realized profit in USD. - **tradeCount** (integer) - The number of trades for the token. ### Request Example ```typescript import { RamarisClient } from '@ramaris/sdk'; const client = new RamarisClient({ apiKey: 'rms_your_pro_api_key' }); const wallet = await client.wallets.get(456); ``` ### Response Example ```json { "id": "456", "status": "active", "winRate": 0.72, "realizedPnL": 125000.50, "stats": { "followers": 42, "totalSwaps": 1234, "openPositions": 8 }, "tags": ["whale"], "topTokens": [ { "symbol": "USDC", "realizedProfitUsd": 45000, "tradeCount": 156 } ] } ``` ``` -------------------------------- ### Get Specific Strategy Details Source: https://context7.com/ramaris-app/sdk/llms.txt Fetches detailed information for a single trading strategy using its unique share ID. This endpoint provides extended data and is also available on the FREE tier. ```typescript import { RamarisClient } from '@ramaris/sdk'; const client = new RamarisClient({ apiKey: 'rms_your_api_key' }); const strategy = await client.strategies.get('abc123def'); console.log(`Strategy: ${strategy.name}`); console.log(`Status: ${strategy.status}`); console.log(`Description: ${strategy.description}`); console.log(`ROI: ${strategy.roiPercent}%`); console.log(`Created: ${strategy.createdAt}`); console.log(`Last activity: ${strategy.lastActivityAt}`); console.log(`Tags: ${strategy.tags.join(', ')}`); console.log(`Stats:`); console.log(` Wallets tracked: ${strategy.stats.walletsTracked}`); console.log(` Total swaps: ${strategy.stats.totalSwaps}`); console.log(` Total notifications: ${strategy.stats.totalNotifications}`); // Output: // Strategy: DeFi Alpha // Status: ACTIVE // Description: Top wallets on Base // ROI: 45.2% // Created: 2025-06-01T08:00:00Z // Last activity: 2026-01-15T10:30:00Z // Tags: defi, base // Stats: // Wallets tracked: 5 // Total swaps: 847 // Total notifications: 234 ``` -------------------------------- ### Get User Subscription Details (TypeScript) Source: https://context7.com/ramaris-app/sdk/llms.txt Retrieves the subscription details for the authenticated user. This function requires the PRO tier or higher and returns information about the user's tier level, subscription status, billing period, and founder status. It does not require any input parameters. ```typescript import { RamarisClient } from '@ramaris/sdk'; const client = new RamarisClient({ apiKey: 'rms_your_pro_api_key' }); const subscription = await client.me.subscription(); console.log(`Tier: ${subscription.tier}`); console.log(`Status: ${subscription.status}`); console.log(`Founder: ${subscription.isFounder}`); console.log(`Current period ends: ${subscription.currentPeriodEnd}`); console.log(`Cancel at period end: ${subscription.cancelAtPeriodEnd}`); console.log(`Subscription created: ${subscription.createdAt}`); ``` -------------------------------- ### Get Authenticated User Profile (TypeScript) Source: https://context7.com/ramaris-app/sdk/llms.txt Retrieves the profile information of the currently authenticated user. This function requires the PRO tier or higher and returns user metadata along with statistics about their created and followed strategies and wallets. It does not require any input parameters. ```typescript import { RamarisClient } from '@ramaris/sdk'; const client = new RamarisClient({ apiKey: 'rms_your_pro_api_key' }); const profile = await client.me.profile(); console.log(`User ID: ${profile.id}`); console.log(`Nickname: ${profile.nickname}`); console.log(`Name: ${profile.name}`); console.log(`Email: ${profile.email}`); console.log(`Founder: ${profile.isFounder}`); console.log(`Created: ${profile.createdAt}`); console.log(`Stats:`); console.log(` Strategies created: ${profile.stats.strategiesCreated}`); console.log(` Strategies followed: ${profile.stats.strategiesFollowed}`); console.log(` Wallets followed: ${profile.stats.walletsFollowed}`); ``` -------------------------------- ### Get Specific Wallet Details (TypeScript) Source: https://context7.com/ramaris-app/sdk/llms.txt Retrieves detailed information for a specific wallet using its ID. This function requires the PRO tier or higher and provides extended metrics including follower count, top performing tokens, and trading statistics. It takes a wallet ID as input. ```typescript import { RamarisClient } from '@ramaris/sdk'; const client = new RamarisClient({ apiKey: 'rms_your_pro_api_key' }); const wallet = await client.wallets.get(456); console.log(`Wallet #${wallet.id}`); console.log(`Status: ${wallet.status}`); console.log(`Win rate: ${(wallet.winRate! * 100).toFixed(1)}%`); console.log(`Realized PnL: $${wallet.realizedPnL?.toLocaleString()}`); console.log(`Followers: ${wallet.stats.followers}`); console.log(`Total swaps: ${wallet.stats.totalSwaps}`); console.log(`Open positions: ${wallet.stats.openPositions}`); console.log(`Tags: ${wallet.tags.join(', ')}`); console.log(`Top tokens:`); for (const token of wallet.topTokens) { console.log(` ${token.symbol}: $${token.realizedProfitUsd.toLocaleString()} (${token.tradeCount} trades)`); } ``` -------------------------------- ### Initialize RamarisClient Source: https://context7.com/ramaris-app/sdk/llms.txt Demonstrates how to create an instance of the RamarisClient. Requires an API key and optionally accepts a custom base URL for connecting to different API environments like staging. ```typescript import { RamarisClient } from '@ramaris/sdk'; // Basic initialization with API key const client = new RamarisClient({ apiKey: 'rms_your_api_key', }); // With custom base URL for staging environment const stagingClient = new RamarisClient({ apiKey: 'rms_your_api_key', baseUrl: 'https://staging.ramaris.app/api/v1', }); ``` -------------------------------- ### Configure RamarisClient with API Key and Base URL Source: https://github.com/ramaris-app/sdk/blob/main/README.md Illustrates how to configure the RamarisClient during initialization, specifying the required `apiKey` and an optional `baseUrl`. The `baseUrl` defaults to the official Ramaris API endpoint if not provided. ```typescript const client = new RamarisClient({ apiKey: 'rms_...', // Required baseUrl: 'https://...', // Optional, defaults to https://www.ramaris.app/api/v1 }); ``` -------------------------------- ### Track API Rate Limits with Ramaris SDK (TypeScript) Source: https://context7.com/ramaris-app/sdk/llms.txt Demonstrates how to initialize the Ramaris client and access rate limit information from API response headers. The `rateLimit` property provides details on the current limit, remaining requests, and the reset timestamp after each request. ```typescript import { RamarisClient } from '@ramaris/sdk'; const client = new RamarisClient({ apiKey: 'rms_your_api_key' }); // Rate limit is null before first request console.log(client.rateLimit); // null // Make a request await client.strategies.list(); // Rate limit info is now available console.log(`Limit: ${client.rateLimit?.limit}`); console.log(`Remaining: ${client.rateLimit?.remaining}`); console.log(`Reset at: ${new Date(client.rateLimit!.reset * 1000).toISOString()}`); // Output: // Limit: 1000 // Remaining: 999 // Reset at: 2026-01-15T12:00:00.000Z ``` -------------------------------- ### List Wallets Source: https://context7.com/ramaris-app/sdk/llms.txt Retrieves a paginated list of tracked wallets with performance metrics. Requires PRO tier or higher. ```APIDOC ## List Wallets ### Description Retrieves a paginated list of tracked wallets with performance metrics. Requires PRO tier or higher. Returns wallet analytics including win rate, realized PnL, swap counts, and open positions. ### Method GET ### Endpoint /wallets ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number to retrieve. - **pageSize** (integer) - Optional - The number of items to return per page. ### Request Example ```typescript import { RamarisClient } from '@ramaris/sdk'; const client = new RamarisClient({ apiKey: 'rms_your_pro_api_key' }); const wallets = await client.wallets.list({ page: 1, pageSize: 10 }); ``` ### Response #### Success Response (200) - **pagination** (object) - Pagination details. - **totalItems** (integer) - Total number of items available. - **data** (array) - Array of wallet objects. - **id** (string) - The unique identifier for the wallet. - **winRate** (number) - The win rate of the wallet. - **realizedPnL** (number) - The realized profit and loss of the wallet. - **stats** (object) - Wallet statistics. - **totalSwaps** (integer) - Total number of swaps made. - **openPositions** (integer) - Number of open positions. - **tags** (array) - Array of tags associated with the wallet. #### Response Example ```json { "pagination": { "totalItems": 500 }, "data": [ { "id": "456", "winRate": 0.72, "realizedPnL": 125000.50, "stats": { "totalSwaps": 1234, "openPositions": 8 }, "tags": ["whale", "defi"] } ] } ``` ``` -------------------------------- ### List Trading Strategies Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Retrieves a list of trading strategies, sorted by their last activity. Supports pagination. ```APIDOC ## GET /strategies ### Description Lists trading strategies sorted by last activity. Supports pagination. ### Method GET ### Endpoint /api/v1/strategies ### Parameters #### Query Parameters - **page** (integer, optional) - Page number (default: 1) - **pageSize** (integer, optional) - Items per page (default: 20, max: 100) ### Response #### Success Response (200) - **data** (array) - Array of strategy objects. - **id** (integer) - Unique identifier for the strategy. - **shareId** (string) - Unique shareable ID for the strategy. - **name** (string) - Name of the strategy. - **description** (string) - Description of the strategy. - **roiPercent** (number) - Return on Investment percentage. - **lastActivityAt** (string) - Timestamp of the last activity. - **createdAt** (string) - Timestamp when the strategy was created. - **creator** (object) - Information about the strategy creator. - **nickname** (string) - Creator's nickname. - **stats** (object) - Statistics related to the strategy. - **walletsTracked** (integer) - Number of wallets tracked in the strategy. - **totalSwaps** (integer) - Total number of swaps made by wallets in the strategy. - **pagination** (object) - Pagination details. - **page** (integer) - Current page number. - **pageSize** (integer) - Items per page. - **totalItems** (integer) - Total number of items available. - **totalPages** (integer) - Total number of pages. ### Response Example ```json { "data": [ { "id": 123, "shareId": "abc123def", "name": "DeFi Alpha Hunter", "description": "Tracking top DeFi wallets on Base", "roiPercent": 45.2, "lastActivityAt": "2026-01-15T10:30:00Z", "createdAt": "2025-06-01T08:00:00Z", "creator": { "nickname": "cryptowhale" }, "stats": { "walletsTracked": 5, "totalSwaps": 847 } } ], "pagination": { "page": 1, "pageSize": 20, "totalItems": 156, "totalPages": 8 } } ``` ``` -------------------------------- ### List Followed Strategies Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Retrieves a list of trading strategies that the authenticated user is currently following. ```APIDOC ## GET /me/strategies/copying ### Description Lists trading strategies that the authenticated user is following. Requires authentication. ### Method GET ### Endpoint /api/v1/me/strategies/copying ### Response #### Success Response (200) - **data** (array) - Array of strategy objects the user is following. - Includes all fields from `GET /strategies` response, plus: - **copiedAt** (string) - Timestamp indicating when the user started following the strategy. ``` -------------------------------- ### List Wallets with Performance Metrics (TypeScript) Source: https://context7.com/ramaris-app/sdk/llms.txt Retrieves a paginated list of tracked wallets with their performance metrics. This function requires the PRO tier or higher and returns wallet analytics such as win rate, realized PnL, swap counts, and open positions. It takes pagination parameters like page number and page size as input. ```typescript import { RamarisClient } from '@ramaris/sdk'; const client = new RamarisClient({ apiKey: 'rms_your_pro_api_key' }); const wallets = await client.wallets.list({ page: 1, pageSize: 10 }); console.log(`Total wallets: ${wallets.pagination.totalItems}`); for (const wallet of wallets.data) { console.log(`Wallet #${wallet.id}`); console.log(` Win rate: ${(wallet.winRate! * 100).toFixed(1)}%`); console.log(` Realized PnL: $${wallet.realizedPnL?.toLocaleString()}`); console.log(` Total swaps: ${wallet.stats.totalSwaps}`); console.log(` Open positions: ${wallet.stats.openPositions}`); console.log(` Tags: ${wallet.tags.join(', ')}`); } ``` -------------------------------- ### Retrieve Rate Limit Information with @ramaris/sdk Source: https://github.com/ramaris-app/sdk/blob/main/README.md Shows how to access rate limit details after making an API request using the RamarisClient. The `rateLimit` property on the client object provides information about the API usage limits. Requires the '@ramaris/sdk' package. ```typescript await client.strategies.list(); console.log(client.rateLimit); // { limit: 100, remaining: 99, reset: 1707667200 } ``` -------------------------------- ### Subscription Info API Source: https://context7.com/ramaris-app/sdk/llms.txt Retrieves the authenticated user's subscription details. Requires PRO tier or higher. ```APIDOC ## Get Subscription Info ### Description Retrieves the authenticated user's subscription details. Requires PRO tier or higher. Returns tier level, status, billing period, and founder status. ### Method GET ### Endpoint /me/subscription ### Response #### Success Response (200) - **tier** (string) - The subscription tier (e.g., 'PRO'). - **status** (string) - The subscription status (e.g., 'active'). - **isFounder** (boolean) - Indicates if the user has founder status. - **currentPeriodEnd** (string) - The end date of the current billing period. - **cancelAtPeriodEnd** (boolean) - Indicates if the subscription is set to cancel at the end of the period. - **createdAt** (string) - The timestamp when the subscription was created. ### Request Example ```typescript import { RamarisClient } from '@ramaris/sdk'; const client = new RamarisClient({ apiKey: 'rms_your_pro_api_key' }); const subscription = await client.me.subscription(); ``` ### Response Example ```json { "tier": "PRO", "status": "active", "isFounder": false, "currentPeriodEnd": "2026-02-15T00:00:00Z", "cancelAtPeriodEnd": false, "createdAt": "2025-01-15T10:00:00Z" } ``` ``` -------------------------------- ### List Trading Strategies with Pagination Source: https://context7.com/ramaris-app/sdk/llms.txt Retrieves a paginated list of trading strategies. This function is available on the FREE tier and returns strategy metadata, including pagination details. It supports filtering by page and page size. ```typescript import { RamarisClient } from '@ramaris/sdk'; const client = new RamarisClient({ apiKey: 'rms_your_api_key' }); // List strategies with pagination const strategies = await client.strategies.list({ page: 1, pageSize: 10 }); console.log(`Total strategies: ${strategies.pagination.totalItems}`); console.log(`Pages: ${strategies.pagination.totalPages}`); for (const strategy of strategies.data) { console.log(`${strategy.name} (${strategy.shareId})`); console.log(` Creator: ${strategy.creator.nickname}`); console.log(` ROI: ${strategy.roiPercent}%`); console.log(` Wallets tracked: ${strategy.stats.walletsTracked}`); console.log(` Total swaps: ${strategy.stats.totalSwaps}`); } // Output: // Total strategies: 100 // Pages: 10 // DeFi Alpha (abc123) // Creator: cryptowhale // ROI: 45.2% // Wallets tracked: 5 // Total swaps: 847 ``` -------------------------------- ### Retrieve User's Strategy Watchlist Source: https://context7.com/ramaris-app/sdk/llms.txt Fetches the list of strategies that the authenticated user is currently following or has copied. This feature is available on the FREE tier and includes pagination. ```typescript import { RamarisClient } from '@ramaris/sdk'; const client = new RamarisClient({ apiKey: 'rms_your_api_key' }); const watchlist = await client.strategies.watchlist({ page: 1, pageSize: 20 }); console.log(`Following ${watchlist.pagination.totalItems} strategies`); for (const strategy of watchlist.data) { console.log(`${strategy.name} by ${strategy.creator.nickname}`); console.log(` ROI: ${strategy.roiPercent}%`); console.log(` Copied at: ${strategy.copiedAt}`); } // Output: // Following 5 strategies // DeFi Alpha by cryptowhale // ROI: 45.2% // Copied at: 2025-12-01T14:00:00Z ``` -------------------------------- ### List Tracked Wallets Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Retrieves a list of tracked wallets on the Base blockchain, sorted by realized PnL. Supports pagination. ```APIDOC ## GET /wallets ### Description Lists tracked wallets sorted by realized PnL. Supports pagination. Wallet addresses are only visible to PRO tier and above. ### Method GET ### Endpoint /api/v1/wallets ### Parameters #### Query Parameters - **page** (integer, optional) - Page number (default: 1) - **pageSize** (integer, optional) - Items per page (default: 20, max: 100) ### Response #### Success Response (200) - **data** (array) - Array of wallet objects. - **id** (integer) - Unique identifier for the wallet. - **winRate** (number) - Percentage of profitable trades (0-1). - **realizedPnL** (number) - Total profit/loss in USD from closed positions. - **createdAt** (string) - Timestamp when the wallet started being tracked. - **stats** (object) - Statistics related to the wallet. - **totalSwaps** (integer) - Total number of swaps made by the wallet. - **openPositions** (integer) - Number of current open positions. - **tags** (array of strings) - User-assigned categories for the wallet. - **pagination** (object) - Pagination details. ### Response Example ```json { "data": [ { "id": 456, "winRate": 0.72, "realizedPnL": 125000.50, "createdAt": "2025-03-15T09:00:00Z", "stats": { "totalSwaps": 1234, "openPositions": 8 }, "tags": ["whale", "defi"] } ], "pagination": { "page": 1, "pageSize": 20, "totalItems": 500, "totalPages": 25 } } ``` ``` -------------------------------- ### Error Handling with @ramaris/sdk Source: https://github.com/ramaris-app/sdk/blob/main/README.md Demonstrates robust error handling for API requests made with the RamarisClient. It specifically catches `RateLimitError` and general `RamarisError`, providing specific messages based on the error type. Requires the '@ramaris/sdk' package. ```typescript import { RamarisError, RateLimitError } from '@ramaris/sdk'; try { await client.wallets.list(); } catch (err) { if (err instanceof RateLimitError) { console.log(`Rate limited. Retry after ${err.retryAfter}s`); } else if (err instanceof RamarisError) { console.log(err.code, err.message); // e.g. "INSUFFICIENT_SCOPE" } } ``` -------------------------------- ### Handle API Errors with Ramaris SDK (TypeScript) Source: https://context7.com/ramaris-app/sdk/llms.txt Illustrates how to use typed error classes provided by the SDK to handle API errors. It shows specific handling for `RateLimitError` with a `retryAfter` property and general `RamarisError` for other API-related issues. ```typescript import { RamarisClient, RamarisError, RateLimitError } from '@ramaris/sdk'; const client = new RamarisClient({ apiKey: 'rms_your_api_key' }); try { // Attempt to access PRO-only endpoint with FREE tier key await client.wallets.list(); } catch (err) { if (err instanceof RateLimitError) { // Handle rate limiting with exponential backoff console.log(`Rate limited! Retry after ${err.retryAfter} seconds`); console.log(`Error code: ${err.code}`); // RATE_LIMITED console.log(`HTTP status: ${err.status}`); // 429 // Wait and retry await new Promise(resolve => setTimeout(resolve, err.retryAfter * 1000)); } else if (err instanceof RamarisError) { // Handle other API errors console.log(`API Error: ${err.message}`); console.log(`Error code: ${err.code}`); // e.g., INSUFFICIENT_SCOPE, UNAUTHORIZED console.log(`HTTP status: ${err.status}`); // e.g., 403, 401 } else { // Handle unexpected errors throw err; } } // Output (for insufficient scope): // API Error: Insufficient scope for this endpoint // Error code: INSUFFICIENT_SCOPE // HTTP status: 403 ``` -------------------------------- ### Error Responses Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Standardized error response format and common error codes. ```APIDOC ## Error Responses All errors follow this format: ```json { "error": { "code": "ERROR_CODE", "message": "Human-readable error message", "retryAfter": 1800 } } ``` Common error codes: - `MISSING_AUTH`: Missing Authorization header - `INVALID_API_KEY`: Invalid or expired API key - `INSUFFICIENT_SCOPE`: API key lacks required permissions - `NOT_FOUND`: Resource not found - `RATE_LIMITED`: Rate limit exceeded (includes `retryAfter` in seconds) - `INTERNAL_ERROR`: Server error ``` -------------------------------- ### User Profile API Source: https://context7.com/ramaris-app/sdk/llms.txt Retrieves the authenticated user's profile information. Requires PRO tier or higher. ```APIDOC ## Get User Profile ### Description Retrieves the authenticated user's profile information. Requires PRO tier or higher. Returns user metadata and statistics about created/followed strategies and wallets. ### Method GET ### Endpoint /me/profile ### Response #### Success Response (200) - **id** (string) - The user's unique identifier. - **nickname** (string) - The user's nickname. - **name** (string) - The user's full name. - **email** (string) - The user's email address. - **isFounder** (boolean) - Indicates if the user is a founder. - **createdAt** (string) - The timestamp when the user account was created. - **stats** (object) - User statistics. - **strategiesCreated** (integer) - Number of strategies created by the user. - **strategiesFollowed** (integer) - Number of strategies followed by the user. - **walletsFollowed** (integer) - Number of wallets followed by the user. ### Request Example ```typescript import { RamarisClient } from '@ramaris/sdk'; const client = new RamarisClient({ apiKey: 'rms_your_pro_api_key' }); const profile = await client.me.profile(); ``` ### Response Example ```json { "id": "user_abc123", "nickname": "cryptotrader", "name": "John Doe", "email": "john@example.com", "isFounder": false, "createdAt": "2025-01-15T10:00:00Z", "stats": { "strategiesCreated": 3, "strategiesFollowed": 5, "walletsFollowed": 12 } } ``` ``` -------------------------------- ### API Authentication Header Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt All API requests to Ramaris require a Bearer token for authentication. This token, your API key, must be included in the 'Authorization' header of your requests. ```http Authorization: Bearer rms_your_api_key_here ``` -------------------------------- ### Standard Error Response Format (JSON) Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Defines the standard format for error responses from the Ramaris App API. This structure includes an error code, a human-readable message, and an optional 'retryAfter' field for rate-limited errors. ```json { "error": { "code": "ERROR_CODE", "message": "Human-readable error message", "retryAfter": 1800 } } ``` -------------------------------- ### Health Check API Source: https://context7.com/ramaris-app/sdk/llms.txt Performs an API health check. Returns API status, version, timestamp, and rate limit configuration. Available on all tiers. ```APIDOC ## Health Check ### Description Performs an API health check. Returns API status, version, timestamp, and rate limit configuration. Available on all tiers. ### Method GET ### Endpoint /health ### Response #### Success Response (200) - **status** (string) - The health status of the API (e.g., 'ok'). - **version** (string) - The API version. - **timestamp** (string) - The current timestamp. - **user** (string) - The authenticated user's ID (if applicable). - **rateLimit** (object) - Rate limit configuration. - **limit** (integer) - The maximum number of requests allowed per hour. ### Request Example ```typescript import { RamarisClient } from '@ramaris/sdk'; const client = new RamarisClient({ apiKey: 'rms_your_api_key' }); const health = await client.health(); ``` ### Response Example ```json { "status": "ok", "version": "v1", "timestamp": "2026-01-15T10:30:00Z", "user": "user_abc123", "rateLimit": { "limit": 1000 } } ``` ``` -------------------------------- ### Perform API Health Check (TypeScript) Source: https://context7.com/ramaris-app/sdk/llms.txt Performs a health check on the Ramaris API. This function is available on all tiers and returns the API status, version, current timestamp, and rate limit configuration. It does not require any input parameters. ```typescript import { RamarisClient } from '@ramaris/sdk'; const client = new RamarisClient({ apiKey: 'rms_your_api_key' }); const health = await client.health(); console.log(`Status: ${health.status}`); console.log(`API Version: ${health.version}`); console.log(`Timestamp: ${health.timestamp}`); console.log(`User: ${health.user}`); console.log(`Rate limit: ${health.rateLimit.limit} req/hr`); ``` -------------------------------- ### API Health Check (JSON) Source: https://github.com/ramaris-app/sdk/blob/main/llms-full.txt Performs a health check on the API to ensure it is operational. This endpoint is useful for monitoring and returns the API's status, version, and current timestamp. It may also include rate limit information. ```json { "status": "ok", "version": "v1", "timestamp": "2026-01-15T10:30:00Z", "user": "user_abc123", "rateLimit": { "limit": 1000, "keyPrefix": "rms_abc1" } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.