### Installation Source: https://docs.reflect.money/api-reference/proxy Instructions on how to install the Reflect Whitelabel SDK using yarn, npm, or pnpm. ```APIDOC ## Installation To install Reflect Whitelabel SDK within your development environment, run the following command: ```bash yarn add @reflectmoney/proxy.ts ``` ```bash npm install @reflectmoney/proxy.ts ``` ```bash pnpm install @reflectmoney/proxy.ts ``` ``` -------------------------------- ### Install Reflect Restaking SDK Source: https://docs.reflect.money/api-reference/restaking Install the Reflect Restaking SDK using your preferred package manager (Yarn, npm, or pnpm). This step is necessary to include the SDK in your project's dependencies. ```bash yarn add @reflectmoney/restaking ``` ```bash npm install @reflectmoney/restaking ``` ```bash pnpm install @reflectmoney/restaking ``` -------------------------------- ### Install Reflect Oracle SDK using Yarn, npm, or pnpm Source: https://docs.reflect.money/api-reference/oracle Install the Reflect Oracle SDK in your development environment using your preferred package manager. This SDK enables interaction with the Doppler oracle on Solana. ```bash yarn add @reflectmoney/oracle.ts ``` ```bash npm install @reflectmoney/oracle.ts ``` ```bash pnpm install @reflectmoney/oracle.ts ``` -------------------------------- ### Install Reflect Stablecoin SDK (Yarn, npm, pnpm) Source: https://docs.reflect.money/api-reference/stablecoin Instructions for installing the Reflect Stablecoin SDK using popular package managers: Yarn, npm, and pnpm. This SDK allows integration with yield-bearing stablecoins for fintech applications. ```bash yarn add @reflectmoney/stable.ts ``` ```bash npm install @reflectmoney/stable.ts ``` ```bash pnpm install @reflectmoney/stable.ts ``` -------------------------------- ### Install Reflect Whitelabel SDK using Yarn, npm, or pnpm Source: https://docs.reflect.money/api-reference/proxy These commands demonstrate how to add the Reflect Whitelabel SDK to your project using different package managers. Ensure you have Node.js and a package manager installed. ```bash yarn add @reflectmoney/proxy.ts ``` ```bash npm install @reflectmoney/proxy.ts ``` ```bash pnpm install @reflectmoney/proxy.ts ``` -------------------------------- ### Proxy Initialization Source: https://docs.reflect.money/api-reference/proxy Guide on how to initialize a new proxy instance using the SDK's static `initialize` method. ```APIDOC ## Initialize New Proxy To create a new proxy, use the static `initialize` method on the `Proxy` class. ### Method `Proxy.initialize(params)` ### Parameters #### Request Body - **signer** (TransactionSigner) - Required - The transaction signer who will pay for the transaction - **authority** (Address) - Optional - Optional authority address (defaults to signer address) - **brandedMint** (Address) - Required - The mint address of the branded token - **feeBps** (number) - Required - The fee in basis points (e.g., 100 = 1%) - **stablecoinMint** (Address) - Required - The mint address of the underlying stablecoin ### Request Example ```typescript import { Proxy, USDC_PLUS_MINT } from "@reflectmoney/proxy.ts"; import { createSolanaRpc, address } from "@solana/kit"; // Initialize connection const connection = createSolanaRpc("https://api.mainnet-beta.solana.com"); // Create a new proxy const createProxyIx = await Proxy.initialize({ signer, brandedMint: address(""), feeBps: 100, // 1% fee stablecoinMint: address(USDC_PLUS_MINT) }); // Transaction sign & send logic ``` ### Returns - `Promise` - A create proxy instruction ``` -------------------------------- ### GET /websites/reflect_money Source: https://docs.reflect.money/reflect-api/integration/get-integration-configuration Retrieves the configuration details for a specific website integration. ```APIDOC ## GET /websites/reflect_money ### Description Retrieves the configuration details for a specific website integration, including its name, symbol, description, and logos. ### Method GET ### Endpoint /websites/reflect_money ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **name** (string) - The name of the integration. - **symbol** (string) - The symbol representing the integration. - **description** (string) - A description of the integration. - **logoUrl** (string) - The URL of the integration's logo. - **websiteUrl** (string) - The URL of the integration's website. #### Response Example ```json { "name": "My Integration", "symbol": "MI", "description": "A custom integration stablecoin", "logoUrl": "https://example.com/logo.png", "websiteUrl": "https://example.com" } ``` #### Error Responses - **400 Bad Request**: Returned when the request data is invalid. Example: ```json { "success": false, "message": "Invalid request data: depositAmount must be positive" } ``` - **500 Internal Server Error**: Returned for unexpected server errors. Example: ```json { "success": false, "message": "Internal server error" } ``` ``` -------------------------------- ### GET /stablecoin/apy Source: https://docs.reflect.money/reflect-api/stablecoin/get-apy-for-all-stablecoins Retrieve real-time APY data for all available stablecoins. ```APIDOC ## GET /stablecoin/apy ### Description Retrieve real-time APY data for all available stablecoins. ### Method GET ### Endpoint https://prod.api.reflect.money/stablecoin/apy ### Parameters #### Query Parameters This endpoint does not have any query parameters. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **success** (boolean) - Whether the request was successful - **data** (array) - Array of stablecoin APY data - **index** (integer) - Stablecoin index (0: USDC+) - **apy** (number) - APY as a number - **timestamp** (string) - Timestamp of the data point #### Response Example ```json { "success": true, "data": [ { "index": 0, "apy": 5.25, "timestamp": "2023-11-07T05:31:56Z" } ] } ``` #### Error Response (404) - **success** (boolean) - Whether the request was successful - **message** (string) - Error message describing what went wrong with the request #### Response Example ```json { "success": false, "message": "Invalid request data: depositAmount must be positive" } ``` #### Error Response (500) - **success** (boolean) - Whether the request was successful - **message** (string) - Error message describing the server error #### Response Example ```json { "success": false, "message": "Internal server error" } ``` ``` -------------------------------- ### Load an Existing Proxy Instance using Constructor Source: https://docs.reflect.money/api-reference/proxy This TypeScript example demonstrates loading an existing proxy instance using the `Proxy` constructor. It requires the Solana RPC connection and the proxy state address. The SDK lazily loads the on-chain state upon instantiation. ```typescript import { Proxy } from "@reflectmoney/proxy.ts"; import { createSolanaRpc, address } from "@solana/kit"; // Initialize connection const connection = createSolanaRpc("https://api.mainnet-beta.solana.com"); // Create an instance of existing proxy const proxy = new Proxy({ connection, proxyStateAddress: address("") }); ``` -------------------------------- ### Create Deposit Instruction for Stablecoins Source: https://docs.reflect.money/api-reference/proxy This TypeScript example illustrates how to generate a deposit instruction using the `proxy.deposit` method. This instruction facilitates the conversion of stablecoins into branded tokens within the Reflect ecosystem. It requires the signer's address and the amount of stablecoins to deposit. ```typescript const depositIx = await proxy.deposit({ signer, amount: 1000 // amount of stablecoins }); ``` -------------------------------- ### GET /integration/{id}/config Source: https://docs.reflect.money/reflect-api/integration/get-integration-configuration Retrieves the configuration details for a specific integration. This includes permissions, administrators, yield breakdown, underlying stablecoin information, and metadata. ```APIDOC ## GET /integration/{id}/config ### Description Retrieves the configuration details for a specific integration. This includes permissions, administrators, yield breakdown, underlying stablecoin information, and metadata. ### Method GET ### Endpoint https://prod.api.reflect.money/integration/{id}/config ### Parameters #### Path Parameters - **id** (string) - Required - Integration ID #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **success** (boolean) - Whether the request was successful - **data** (object) - Contains the integration configuration details - **permissions** (array of strings) - List of available permissions (e.g., "mint", "redeem", "claim") - **administrators** (array of objects) - List of administrators for the integration - **publicKey** (string) - Administrator's Solana public key - **permissionLevel** (string) - Administrator's permission level (e.g., "superadmin", "manager", "viewer") - **yieldBreakdownBps** (object) - Yield breakdown in basis points - **integrator** (number) - Integrator's share in basis points - **user** (number) - User's share in basis points - **underlyingStablecoin** (string) - Address of the underlying stablecoin - **integrationIndex** (number) - Index of the integration - **metadata** (object) - Metadata related to the integration - **name** (string) - Name of the integration - **symbol** (string) - Symbol of the integration - **description** (string) - Description of the integration - **logoUrl** (string) - URL for the integration's logo - **websiteUrl** (string) - URL for the integration's website #### Response Example ```json { "success": true, "data": { "permissions": [ "mint", "redeem", "claim" ], "administrators": [ { "publicKey": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM", "permissionLevel": "superadmin" } ], "yieldBreakdownBps": { "integrator": 200, "user": 9800 }, "underlyingStablecoin": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "integrationIndex": 1, "metadata": { "name": "My Integration", "symbol": "MI", "description": "A custom integration stablecoin", "logoUrl": "https://example.com/logo.png", "websiteUrl": "https://example.com" } } } ``` ``` -------------------------------- ### Deposit Stablecoins into Proxy Source: https://docs.reflect.money/api-reference/proxy Provides an example of depositing stablecoins into a proxy instance. It requires the signer's wallet and the amount to deposit, specifying the stablecoin and its decimal places for accurate conversion. ```typescript const depositInstruction = await proxy.deposit({ signer: myWallet, amount: 1_000_000 // 1 USDC+ (6 decimals) }); ``` -------------------------------- ### GET /stablecoin/exchange-rates Source: https://docs.reflect.money/reflect-api/stablecoin/get-latest-exchange-rates-for-all-stablecoins Retrieves the latest base and receipt exchange rates for all supported stablecoins. ```APIDOC ## GET /stablecoin/exchange-rates ### Description Retrieve the latest base and receipt exchange rates for all supported stablecoins (USDC+). ### Method GET ### Endpoint /stablecoin/exchange-rates ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (array) - An array of stablecoin exchange rate objects. - **id** (integer) - The unique identifier for the exchange rate entry. - **stablecoin** (integer) - The identifier for the stablecoin (e.g., 0 for USDC). - **base_usd_value_bps** (number) - Base exchange rate in basis points. - **receipt_usd_value_bps** (number) - Receipt exchange rate in basis points. - **timestamp** (string) - The date and time when the rates were recorded (ISO 8601 format). #### Response Example ```json { "success": true, "data": [ { "id": 123, "stablecoin": 0, "base_usd_value_bps": 123, "receipt_usd_value_bps": 123, "timestamp": "2023-11-07T05:31:56Z" } ] } ``` #### Error Response (500) - **success** (boolean) - Indicates if the request was successful (always false for errors). - **message** (string) - Error message describing the server error. #### Response Example ```json { "success": false, "message": "Internal server error" } ``` ``` -------------------------------- ### Get Stablecoin Exchange Rates (OpenAPI) Source: https://docs.reflect.money/reflect-api/stablecoin/get-latest-exchange-rates-for-all-stablecoins This OpenAPI definition details the GET /stablecoin/exchange-rates endpoint. It specifies request and response structures for retrieving base and receipt USD values in basis points (bps) for stablecoins, along with timestamps. Includes success and error response schemas. ```yaml paths: path: /stablecoin/exchange-rates method: get servers: - url: https://prod.api.reflect.money description: Production environment request: security: [] parameters: path: {} query: {} header: {} cookie: {} body: {} response: '200': application/json: schemaArray: - type: object properties: success: allOf: - type: boolean example: true data: allOf: - type: array items: type: object properties: id: type: integer stablecoin: type: integer enum: - 0 base_usd_value_bps: type: number description: Base exchange rate in bps receipt_usd_value_bps: type: number description: Receipt exchange rate in bps timestamp: type: string format: date-time required: - id - stablecoin - base_usd_value_bps - receipt_usd_value_bps - timestamp requiredProperties: - success - data examples: example: value: success: true data: - id: 123 stablecoin: 0 base_usd_value_bps: 123 receipt_usd_value_bps: 123 timestamp: '2023-11-07T05:31:56Z' description: Latest exchange rates for all stablecoins retrieved successfully '500': application/json: schemaArray: - type: object properties: success: allOf: - type: boolean description: Whether the request was successful example: false message: allOf: - type: string description: Error message describing the server error example: Internal server error refIdentifier: '#/components/schemas/InternalServerErrorResponse' requiredProperties: - success - message examples: example: value: success: false message: Internal server error description: Internal server error deprecated: false type: path components: schemas: {} ``` -------------------------------- ### Initialize a New Proxy Instance Source: https://docs.reflect.money/api-reference/proxy Demonstrates how to create a new proxy instance by providing necessary parameters like wallet signer, authority, branded mint, fee basis points, and the stablecoin mint. This function returns an instruction to initialize the proxy. ```typescript import { Proxy, USDC_PLUS_MINT } from "@reflectmoney/proxy.ts"; import { address } from "@solana/kit"; const createInstruction = await Proxy.initialize({ signer: myWallet, authority: address("AuthorityAddress"), brandedMint: address("BrandedTokenMint"), feeBps: 50, // 0.5% fee stablecoinMint: address(USDC_PLUS_MINT) // USDC+ }); ``` -------------------------------- ### Create a New Proxy Instance with Reflect Whitelabel SDK Source: https://docs.reflect.money/api-reference/proxy This TypeScript code snippet shows how to initialize a new proxy instance using the `Proxy.initialize` static method. It requires a signer, branded mint address, fee basis points, and the stablecoin mint address. The output is a transaction instruction for creating the proxy. ```typescript import { Proxy, USDC_PLUS_MINT } from "@reflectmoney/proxy.ts"; import { createSolanaRpc, address } from "@solana/kit"; // Initialize connection const connection = createSolanaRpc("https://api.mainnet-beta.solana.com"); // Create a new proxy const createProxyIx = await Proxy.initialize({ signer, brandedMint: address(""), feeBps: 100, // 1% fee stablecoinMint: address(USDC_PLUS_MINT) }); // Transaction sign & send logic ``` -------------------------------- ### Initialize Restaking SDK Source: https://docs.reflect.money/api-reference/restaking Initialize the Restaking SDK by creating a new instance of the `RLP` class. This requires a Solana connection object, typically pointing to a network endpoint like the mainnet-beta. ```typescript import { RLP } from "@reflectmoney/restaking" import { Connection } from "@solana/web3.js" const connection = new Connection("https://api.mainnet-beta.solana.com"); const rlp = new RLP(connection); ``` -------------------------------- ### Load Existing Proxy Source: https://docs.reflect.money/api-reference/proxy Instructions for loading an existing proxy instance using the constructor or `loadFromMint` method. ```APIDOC ## Load Existing Proxy To load an existing proxy, use the constructor or the `loadFromMint` method. ### Constructor Usage ```typescript import { Proxy } from "@reflectmoney/proxy.ts"; import { createSolanaRpc, address } from "@solana/kit"; // Initialize connection const connection = createSolanaRpc("https://api.mainnet-beta.solana.com"); // Create an instance of existing proxy const proxy = new Proxy({ connection, proxyStateAddress: address("") }); ``` ### `loadFromMint` Usage ```typescript import { Proxy } from "@reflectmoney/proxy.ts"; import { createSolanaRpc, address } from "@solana/kit"; // Initialize connection const connection = createSolanaRpc("https://api.mainnet-beta.solana.com"); // Create an instance of existing proxy from mint const proxy = Proxy.loadFromMint({ connection, brandedMint: address("") }); ``` #### `Proxy` Constructor Parameters * `connection` (Rpc) - The Solana RPC connection. * `proxyStateAddress` (Address) - The address of the proxy state account. #### `Proxy.loadFromMint` Parameters * `connection` (Rpc) - The Solana RPC connection. * `brandedMint` (Address) - The address of the branded mint. ### Returns - `Promise` - A new Proxy instance with loaded state data ``` -------------------------------- ### Initialize and Restake Assets with Reflect Money SDK (TypeScript) Source: https://docs.reflect.money/api-reference/restaking Demonstrates initializing the RLP (Reflect Lending Protocol) and creating a restake instruction using the Reflect Money SDK. Requires the '@reflectmoney/restaking' and '@solana/web3.js' libraries. ```typescript import { RLP } from "@reflectmoney/restaking" import { Connection } from "@solana/web3.js" const connection = new Connection("https://api.mainnet-beta.solana.com"); const rlp = new RLP(connection); const signer = Keypair.generate(); const amount = new BN(1000 * Math.pow(10, 6)); const lockupId = new BN(0); const ix = rlp.restake(signer.publicKey, amount, lockupId); ``` -------------------------------- ### Get Protocol Statistics (OpenAPI) Source: https://docs.reflect.money/reflect-api/stats/get-protocol-statistics This OpenAPI definition describes the GET /stats endpoint for the Reflect Money API. It outlines the request and response structures for retrieving protocol statistics, including success and error scenarios. The response contains data on users, supply, cumulative volume, TVL, and total yield distributed. ```yaml paths: /stats: get: summary: Retrieve overall protocol statistics servers: - url: https://prod.api.reflect.money description: Production environment request: security: [] parameters: path: {} query: {} header: {} cookie: {} body: {} response: '200': description: Protocol statistics retrieved successfully content: application/json: schema: type: object properties: success: type: boolean example: true data: type: object properties: users: type: integer description: Total number of users/holders example: 1250 supply: type: string description: Total supply as string example: '50000000000000' cumulativeVolume: type: string description: Cumulative volume as string example: '100000000000000' tvl: type: number description: Total Value Locked in USD example: 50000000 totalYieldDistributed: type: number description: Total yield distributed to users example: 2500000 required: - users - supply - cumulativeVolume - tvl - totalYieldDistributed example: value: success: true data: users: 1250 supply: '50000000000000' cumulativeVolume: '100000000000000' tvl: 50000000 totalYieldDistributed: 2500000 '500': description: Internal server error content: application/json: schema: type: object properties: success: type: boolean description: Whether the request was successful example: false message: type: string description: Error message describing the server error example: Internal server error example: value: success: false message: Internal server error deprecated: false type: path components: schemas: {} ``` -------------------------------- ### POST /stablecoin/quote/{type} - Get Stablecoin Quote Source: https://docs.reflect.money/reflect-api/stablecoin/get-quote-for-mint-or-redeem This endpoint retrieves a quote for minting or redeeming stablecoins. It requires the quote type (mint or redeem) as a path parameter and expects the stablecoin index and deposit amount in the request body. The response includes a success status and the quote amount or an error message. ```yaml paths: /stablecoin/quote/{type}: post: summary: Get a quote for minting or redeeming stablecoins parameters: - name: type in: path required: true schema: type: string enum: [mint, redeem] description: Quote type requestBody: required: true content: application/json: schema: type: object properties: stablecoinIndex: type: integer description: Stablecoin index (0: USDC+) example: 0 depositAmount: type: number description: Amount to quote example: 1000000 required: - stablecoinIndex - depositAmount examples: example: value: stablecoinIndex: 0 depositAmount: 1000000 responses: '200': description: Quote retrieved successfully content: application/json: schema: type: object properties: success: type: boolean example: true data: type: number description: Quote amount example: 999000 examples: example: value: success: true data: 999000 '400': description: Invalid request data content: application/json: schema: type: object properties: success: type: boolean example: false message: type: string example: 'Invalid request data: depositAmount must be positive' examples: example: value: success: false message: 'Invalid request data: depositAmount must be positive' '404': description: Stablecoin with the specified index not found content: application/json: schema: type: object properties: success: type: boolean example: false message: type: string example: 'Invalid request data: depositAmount must be positive' examples: example: value: success: false message: 'Invalid request data: depositAmount must be positive' '500': description: Internal server error content: application/json: schema: type: object properties: success: type: boolean example: false message: type: string example: Internal server error examples: example: value: success: false message: Internal server error servers: - url: https://prod.api.reflect.money description: Production environment deprecated: false tags: - Stablecoin ``` -------------------------------- ### GET /stablecoin/{index}/apy/historical Source: https://docs.reflect.money/reflect-api/stablecoin/get-historical-apy-data-for-specific-stablecoin Retrieve historical APY data for a specific stablecoin over a specified number of days. ```APIDOC ## GET /stablecoin/{index}/apy/historical ### Description Retrieve historical APY data for a specific stablecoin over a specified number of days. ### Method GET ### Endpoint https://prod.api.reflect.money/stablecoin/{index}/apy/historical ### Parameters #### Path Parameters - **index** (enum) - Required - Stablecoin index (0: USDC+) #### Query Parameters - **days** (integer) - Optional - Number of days for historical data (default: 365). Minimum: 1 ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **success** (boolean) - Whether the request was successful - **data** (object) - Contains the APY data - **index** (integer) - Stablecoin index (0: USDC+) - **apy** (number) - APY as a number - **timestamp** (string) - Timestamp of the data point #### Response Example ```json { "success": true, "data": { "index": 0, "apy": 5.25, "timestamp": "2023-11-07T05:31:56Z" } } ``` #### Error Response (400) - **success** (boolean) - Whether the request was successful - **message** (string) - Error message describing what went wrong with the request #### Error Response Example (400) ```json { "success": false, "message": "Invalid request data: depositAmount must be positive" } ``` #### Error Response (500) - **success** (boolean) - Whether the request was successful - **message** (string) - Error message describing the server error #### Error Response Example (500) ```json { "success": false, "message": "Internal server error" } ``` ``` -------------------------------- ### GET /integration/{id}/stats/historical Source: https://docs.reflect.money/reflect-api/integration/get-historical-integration-statistics Retrieves historical statistics for a specific integration. You can specify a time period for the data. ```APIDOC ## GET /integration/{id}/stats/historical ### Description Retrieves historical statistics for a specific integration, allowing you to query data over different time periods. ### Method GET ### Endpoint https://prod.api.reflect.money/integration/{id}/stats/historical ### Parameters #### Path Parameters - **id** (string) - Required - Integration ID #### Query Parameters - **period** (enum) - Optional - Time period for historical data. Available options: '7d', '30d', '90d', '1y'. Defaults to '30d'. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (object) - Contains the historical data. - **period** (string) - The requested time period. - **historicalData** (array) - An array of historical data points. - **date** (string) - The date of the data point. - **supply** (number) - The supply value for the date. - **users** (number) - The number of users for the date. - **principal** (number) - The principal value for the date. - **yield** (number) - The yield value for the date. #### Response Example ```json { "success": true, "data": { "period": "30d", "historicalData": [ { "date": "2024-01-01", "supply": 1000000000, "users": 1500, "principal": 950000000, "yield": 50000000 } ] } } ``` #### Error Response (400) - **success** (boolean) - Indicates if the request was successful (always false). - **message** (string) - Error message describing what went wrong with the request. #### Error Response Example (400) ```json { "success": false, "message": "Invalid request data: depositAmount must be positive" } ``` #### Error Response (500) - **success** (boolean) - Indicates if the request was successful (always false). - **message** (string) - Error message describing the server error. #### Error Response Example (500) ```json { "success": false, "message": "Internal server error" } ``` ``` -------------------------------- ### POST /integration/initialize Source: https://docs.reflect.money/reflect-api/integration/initialize-an-integration Initializes a new integration with custom branded mint and fee configuration. This endpoint generates a transaction to set up the integration. ```APIDOC ## POST /integration/initialize ### Description Initializes a new integration with branded mint and fee configuration. This endpoint generates a transaction to set up the integration. ### Method POST ### Endpoint https://prod.api.reflect.money/integration/initialize ### Parameters #### Request Body - **signer** (string) - Required - Initializer's Solana address - **authority** (string) - Required - Authority Solana address - **stablecoin** (integer) - Required - Stablecoin index (0: USDC+) - **feeBps** (integer) - Required - Fee in basis points (0-10000) - **brandedMint** (string) - Required - Branded token mint address - **feePayer** (string) - Required - Fee payer Solana address ### Request Example ```json { "signer": "", "authority": "", "stablecoin": 0, "feeBps": 5000, "brandedMint": "", "feePayer": "" } ``` ### Response #### Success Response (200) - **success** (boolean) - Whether the request was successful - **data** (object) - Contains the transaction details - **transaction** (string) - Base64 encoded transaction #### Response Example ```json { "success": true, "data": { "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAED..." } } ``` #### Error Response (400) - **success** (boolean) - Whether the request was successful - **message** (string) - Error message describing what went wrong with the request #### Error Response Example (400) ```json { "success": false, "message": "Invalid request data: depositAmount must be positive" } ``` #### Error Response (500) - **success** (boolean) - Whether the request was successful - **message** (string) - Error message describing the server error #### Error Response Example (500) ```json { "success": false, "message": "Internal server error" } ``` ``` -------------------------------- ### GET /stablecoin/{index}/exchange-rate Source: https://docs.reflect.money/reflect-api/stablecoin/get-realtime-exchange-rate-for-a-stablecoin Retrieve the current exchange rate for the specified stablecoin. The 'index' parameter identifies the stablecoin. ```APIDOC ## GET /stablecoin/{index}/exchange-rate ### Description Retrieve the current exchange rate for the specified stablecoin. ### Method GET ### Endpoint https://prod.api.reflect.money/stablecoin/{index}/exchange-rate ### Parameters #### Path Parameters - **index** (enum) - Required - Stablecoin index (0: USDC+) #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (object) - Contains the exchange rate data. Additional properties are allowed. #### Response Example ```json { "success": true, "data": {} } ``` #### Error Response (400) - **success** (boolean) - Indicates if the request was successful (false). - **message** (string) - Error message describing what went wrong with the request. #### Response Example (400) ```json { "success": false, "message": "Invalid request data: depositAmount must be positive" } ``` #### Error Response (500) - **success** (boolean) - Indicates if the request was successful (false). - **message** (string) - Error message describing the server error. #### Response Example (500) ```json { "success": false, "message": "Internal server error" } ``` ``` -------------------------------- ### Initialize Doppler SDK with Solana Connection and Keypair Source: https://docs.reflect.money/api-reference/oracle Initialize the Doppler SDK by providing a Solana Connection object and an authority Keypair. This sets up the connection to the Solana network and defines the administrative identity for interacting with oracles. ```typescript import { Doppler } from "@reflectmoney/oracle.ts"; import { Connection, Keypair } from "@solana/web3.js"; const connection = new Connection("https://api.mainnet-beta.solana.com"); const admin = Keypair.fromSecretKey(/* admin secret key bytes */); const doppler = new Doppler(connection, admin); ``` -------------------------------- ### GET /integration/{id}/stats Source: https://docs.reflect.money/reflect-api/integration/get-integration-statistics Retrieves statistical data for a specific integration, including supply, users, principal, and yield. ```APIDOC ## GET /integration/{id}/stats ### Description Retrieves statistical data for a specific integration. This includes total supply, total users, total principal amount, total yield generated, and historical data. ### Method GET ### Endpoint https://prod.api.reflect.money/integration/{id}/stats ### Parameters #### Path Parameters - **id** (string) - Required - Integration ID #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **success** (boolean) - Whether the request was successful - **data** (object) - Contains the statistical data for the integration: - **totalSupply** (number) - Total supply of integration stablecoins - **totalUsers** (number) - Total number of users - **totalPrincipal** (number) - Total principal amount - **totalYieldGenerated** (number) - Total yield generated - **historicalData** (array) - Array of historical data points: - **date** (string) - The date of the historical data - **supply** (number) - Supply on that date - **users** (number) - Number of users on that date - **principal** (number) - Principal amount on that date - **yield** (number) - Yield generated on that date #### Response Example ```json { "success": true, "data": { "totalSupply": 1000000000, "totalUsers": 1500, "totalPrincipal": 950000000, "totalYieldGenerated": 50000000, "historicalData": [ { "date": "2024-01-01", "supply": 1000000000, "users": 1500, "principal": 950000000, "yield": 50000000 } ] } } ``` #### Error Response (400) - **success** (boolean) - Whether the request was successful (always false) - **message** (string) - Error message describing what went wrong with the request #### Error Response Example (400) ```json { "success": false, "message": "Invalid request data: depositAmount must be positive" } ``` #### Error Response (500) - **success** (boolean) - Whether the request was successful (always false) - **message** (string) - Error message describing the internal server error. ``` -------------------------------- ### Proxy Initialization Source: https://docs.reflect.money/api-reference/proxy Initializes a new proxy state on the blockchain. This involves setting up the proxy with authority, branded mint, fee, and stablecoin details. ```APIDOC ## POST /proxy/initialize ### Description Creates a new proxy state by initializing it with the provided details. ### Method POST ### Endpoint `/proxy/initialize` ### Parameters #### Request Body - **signer** (Wallet) - Required - The wallet signing the transaction. - **authority** (Address) - Required - The authority address for the proxy. - **brandedMint** (Address) - Required - The branded token mint address. - **feeBps** (number) - Required - The fee in basis points (e.g., 50 for 0.5%). - **stablecoinMint** (Address) - Required - The stablecoin mint address. ### Request Example ```json { "signer": "", "authority": "", "brandedMint": "", "feeBps": 50, "stablecoinMint": "" } ``` ### Response #### Success Response (200) - **transactionSignature** (string) - The signature of the transaction. #### Response Example ```json { "transactionSignature": "" } ``` ``` -------------------------------- ### GET /stablecoin/exchange-rates/historical Source: https://docs.reflect.money/reflect-api/stablecoin/get-historical-exchange-rates-for-a-stablecoin Retrieves historical exchange rates for a specified stablecoin. You can define the number of past days for which you want to fetch data. ```APIDOC ## GET /stablecoin/exchange-rates/historical ### Description Retrieves historical exchange rates for a specified stablecoin. You can define the number of past days for which you want to fetch data. ### Method GET ### Endpoint /stablecoin/exchange-rates/historical ### Parameters #### Query Parameters - **stablecoin** (enum) - Required - Stablecoin index (0: USDC+) - **days** (integer) - Optional - Number of days for historical data (default: 365). Minimum: 1. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **success** (boolean) - Whether the request was successful - **data** (array) - Historical exchange rate data. Each item contains: - **id** (integer) - Unique identifier for the record - **stablecoin** (integer) - Stablecoin index (0: USDC+) - **base_usd_value_bps** (number) - Base exchange rate in basis points - **receipt_usd_value_bps** (number) - Receipt exchange rate in basis points - **timestamp** (string) - Timestamp of the exchange rate record (format: date-time) #### Response Example ```json { "success": true, "data": [ { "id": 123, "stablecoin": 0, "base_usd_value_bps": 123, "receipt_usd_value_bps": 123, "timestamp": "2023-11-07T05:31:56Z" } ] } ``` #### Error Response (400) - **success** (boolean) - Whether the request was successful (false) - **message** (string) - Error message describing what went wrong with the request #### Error Response Example (400) ```json { "success": false, "message": "Invalid request data: depositAmount must be positive" } ``` #### Error Response (404) - **success** (boolean) - Whether the request was successful (false) - **message** (string) - Error message describing what went wrong with the request #### Error Response Example (404) ```json { "success": false, "message": "Invalid request data: depositAmount must be positive" } ``` #### Error Response (500) - **success** (boolean) - Whether the request was successful (false) - **message** (string) - Error message describing the server error #### Error Response Example (500) ```json { "success": false, "message": "Internal server error" } ``` ``` -------------------------------- ### GET /events/all/{limit} Source: https://docs.reflect.money/reflect-api/events/get-recent-events Retrieves a list of recent events. You can specify the maximum number of events to return. ```APIDOC ## GET /events/all/{limit} ### Description Retrieves a list of recent events. You can specify the maximum number of events to return. ### Method GET ### Endpoint /events/all/{limit} ### Parameters #### Path Parameters - **limit** (integer) - Required - Max events to return ### Request Example ```bash curl --request GET \ --url https://prod.api.reflect.money/events/all/{limit} ``` ### Response #### Success Response (200) - **success** (boolean) - Required - Indicates if the request was successful. - **events** (object[]) - Required - An array of event objects. #### Response Example ```json { "success": true, "events": [ {} ] } ``` ``` -------------------------------- ### Load Existing Proxy Instance Source: https://docs.reflect.money/api-reference/proxy Shows two methods for loading an existing proxy instance: directly from its branded mint address or by creating a new instance and manually loading its state. This is useful for interacting with already deployed proxies. ```typescript // Method 1: Load from mint address const proxy = await Proxy.loadFromMint({ connection: myConnection, brandedMint: address("BrandedTokenMint") }); // Method 2: Create instance and re-load manually const proxy2 = new Proxy({ connection: myConnection, proxyAddress: address("ProxyStateAddress") }); await proxy2.load(); ``` -------------------------------- ### GET /stablecoin/{index}/apy Source: https://docs.reflect.money/reflect-api/stablecoin/get-apy-for-specific-stablecoin Retrieves the Annual Percentage Yield (APY) for a specified stablecoin. This endpoint provides real-time APY data. ```APIDOC ## GET /stablecoin/{index}/apy ### Description Retrieves the Annual Percentage Yield (APY) for a specified stablecoin. This endpoint provides real-time APY data. ### Method GET ### Endpoint https://prod.api.reflect.money/stablecoin/{index}/apy ### Parameters #### Path Parameters - **index** (integer) - Required - Stablecoin index (0: USDC+) #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **success** (boolean) - Whether the request was successful - **data** (object) - APY data for the stablecoin - **index** (integer) - Stablecoin index (0: USDC+) - **apy** (number) - APY as a number - **timestamp** (string) - Timestamp of the data point #### Response Example ```json { "success": true, "data": { "index": 0, "apy": 5.25, "timestamp": "2023-11-07T05:31:56Z" } } ``` #### Error Response (400) - **success** (boolean) - Whether the request was successful (false) - **message** (string) - Error message describing what went wrong with the request (e.g., 'Invalid request data: depositAmount must be positive') #### Error Response (404) - **success** (boolean) - Whether the request was successful (false) - **message** (string) - Error message describing what went wrong with the request (e.g., 'Invalid request data: depositAmount must be positive') #### Error Response (500) - **success** (boolean) - Whether the request was successful (false) - **message** (string) - Error message describing the server error (e.g., Internal server error) ```