From 8cefcc67e30c37aed987ca271a195ad8dcf9ca38 Mon Sep 17 00:00:00 2001 From: Swenschaeferjohann Date: Thu, 22 Jan 2026 18:15:27 +0000 Subject: [PATCH 1/2] update routers.md --- light-token/defi/routers.mdx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/light-token/defi/routers.mdx b/light-token/defi/routers.mdx index 80e1d16..601989b 100644 --- a/light-token/defi/routers.mdx +++ b/light-token/defi/routers.mdx @@ -3,13 +3,16 @@ title: "Router Integration" description: "Add support for rent-free AMMs on Solana." --- -1. Use `get_account_interface` instead of `get_account` -2. Store `AccountInterface` in your cache -3. Prepend `create_load_instructions` when accounts are cold +1. Use `get_account_interface` instead of `get_account` to store `AccountInterface`. +2. Use the AMM's LightProgramInterface trait to dynamically prepend load + instructions if the market is cold. + ## Step 1: Use `get_account_interface` -`get_account_interface` is a new RPC endpoint that returns a superset of `get_account`. `AccountInterface` stores additional info `Option` that you will need later. +`get_account_interface` is a new RPC endpoint that returns a superset of +`get_account`. `AccountInterface` stores additional info `Option` +that you will need later.
@@ -37,7 +40,7 @@ pub struct AccountInterface {
-## Step 2: Store Account Interfaces in your cache. +## Step 2: Implement LightProgramInterface All rent-free programs implement the `LightProgramInterface` trait. This trait helps you: From aeb3e76c8fdd3dbead3fd7304377f2ff161b826a Mon Sep 17 00:00:00 2001 From: Swenschaeferjohann Date: Thu, 22 Jan 2026 18:17:12 +0000 Subject: [PATCH 2/2] get cold mint yaml openapi --- openapi/getColdMint.yaml | 222 +++++++++++++++++++++++ openapi/getColdMintsByAuthority.yaml | 254 +++++++++++++++++++++++++++ 2 files changed, 476 insertions(+) create mode 100644 openapi/getColdMint.yaml create mode 100644 openapi/getColdMintsByAuthority.yaml diff --git a/openapi/getColdMint.yaml b/openapi/getColdMint.yaml new file mode 100644 index 0000000..f20bc5a --- /dev/null +++ b/openapi/getColdMint.yaml @@ -0,0 +1,222 @@ +openapi: 3.0.3 +info: + title: photon-indexer + description: Solana indexer for general compression + license: + name: Apache-2.0 + version: 0.50.0 +servers: +- url: https://mainnet.helius-rpc.com +paths: + /getColdMint: + summary: getColdMint + post: + requestBody: + content: + application/json: + schema: + type: object + required: + - jsonrpc + - id + - method + - params + properties: + id: + type: string + description: An ID to identify the request. + enum: + - test-account + jsonrpc: + type: string + description: The version of the JSON-RPC protocol. + enum: + - '2.0' + method: + type: string + description: The name of the method to invoke. + enum: + - getColdMint + params: + type: object + description: Request for cold mint data. Provide either address or mintPda. + properties: + address: + allOf: + - $ref: '#/components/schemas/SerializablePubkey' + nullable: true + description: The cold account address. + mintPda: + allOf: + - $ref: '#/components/schemas/SerializablePubkey' + nullable: true + description: The mint PDA (decompressed account address). + additionalProperties: false + required: true + responses: + '200': + description: '' + content: + application/json: + schema: + type: object + required: + - context + properties: + context: + $ref: '#/components/schemas/Context' + value: + $ref: '#/components/schemas/ColdMint' + additionalProperties: false + '429': + description: Exceeded rate limit. + content: + application/json: + schema: + type: object + properties: + error: + type: string + '500': + description: The server encountered an unexpected condition that prevented it from fulfilling the request. + content: + application/json: + schema: + type: object + properties: + error: + type: string +components: + schemas: + ColdMint: + type: object + required: + - mint + - account + properties: + mint: + $ref: '#/components/schemas/MintData' + account: + $ref: '#/components/schemas/Account' + additionalProperties: false + MintData: + type: object + required: + - mintPda + - mintSigner + - supply + - decimals + - version + - mintDecompressed + properties: + mintPda: + $ref: '#/components/schemas/SerializablePubkey' + description: The PDA (decompressed account address) for this mint. + mintSigner: + $ref: '#/components/schemas/Hash' + description: The signer/seed used for PDA derivation. + mintAuthority: + allOf: + - $ref: '#/components/schemas/SerializablePubkey' + nullable: true + description: Authority that can mint new tokens. + freezeAuthority: + allOf: + - $ref: '#/components/schemas/SerializablePubkey' + nullable: true + description: Authority that can freeze accounts. + supply: + type: integer + format: int64 + minimum: 0 + description: Total supply of tokens. + decimals: + type: integer + minimum: 0 + maximum: 255 + description: Number of decimals. + version: + type: integer + minimum: 0 + maximum: 255 + description: Version of the mint. + mintDecompressed: + type: boolean + description: Whether the mint has been decompressed. + extensions: + allOf: + - $ref: '#/components/schemas/Base64String' + nullable: true + description: Serialized extensions. + additionalProperties: false + Account: + type: object + required: + - hash + - owner + - lamports + - tree + - leafIndex + - seq + - slotCreated + properties: + address: + $ref: '#/components/schemas/SerializablePubkey' + data: + $ref: '#/components/schemas/AccountData' + hash: + $ref: '#/components/schemas/Hash' + lamports: + $ref: '#/components/schemas/UnsignedInteger' + leafIndex: + $ref: '#/components/schemas/UnsignedInteger' + owner: + $ref: '#/components/schemas/SerializablePubkey' + seq: + $ref: '#/components/schemas/UnsignedInteger' + slotCreated: + $ref: '#/components/schemas/UnsignedInteger' + tree: + $ref: '#/components/schemas/SerializablePubkey' + additionalProperties: false + AccountData: + type: object + required: + - discriminator + - data + - dataHash + properties: + data: + $ref: '#/components/schemas/Base64String' + dataHash: + $ref: '#/components/schemas/Hash' + discriminator: + $ref: '#/components/schemas/UnsignedInteger' + additionalProperties: false + Base64String: + type: string + description: A base 64 encoded string. + default: SGVsbG8sIFdvcmxkIQ== + example: SGVsbG8sIFdvcmxkIQ== + Context: + type: object + required: + - slot + properties: + slot: + type: integer + default: 100 + example: 100 + Hash: + type: string + description: A 32-byte hash represented as a base58 string. + example: 11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP + SerializablePubkey: + type: string + description: A Solana public key represented as a base58 string. + default: 11111112D1oxKts8YPdTJRG5FzxTNpMtWmq8hkVx3 + example: 11111112D1oxKts8YPdTJRG5FzxTNpMtWmq8hkVx3 + UnsignedInteger: + type: integer + default: 100 + example: 100 diff --git a/openapi/getColdMintsByAuthority.yaml b/openapi/getColdMintsByAuthority.yaml new file mode 100644 index 0000000..0852abe --- /dev/null +++ b/openapi/getColdMintsByAuthority.yaml @@ -0,0 +1,254 @@ +openapi: 3.0.3 +info: + title: photon-indexer + description: Solana indexer for general compression + license: + name: Apache-2.0 + version: 0.50.0 +servers: +- url: https://mainnet.helius-rpc.com +paths: + /getColdMintsByAuthority: + summary: getColdMintsByAuthority + post: + requestBody: + content: + application/json: + schema: + type: object + required: + - jsonrpc + - id + - method + - params + properties: + id: + type: string + description: An ID to identify the request. + enum: + - test-account + jsonrpc: + type: string + description: The version of the JSON-RPC protocol. + enum: + - '2.0' + method: + type: string + description: The name of the method to invoke. + enum: + - getColdMintsByAuthority + params: + type: object + required: + - authority + properties: + authority: + $ref: '#/components/schemas/SerializablePubkey' + description: The authority pubkey to filter by. + authorityType: + type: string + enum: + - mintAuthority + - freezeAuthority + - either + default: either + description: Filter by authority type. Defaults to either. + cursor: + allOf: + - $ref: '#/components/schemas/Base58String' + nullable: true + limit: + allOf: + - $ref: '#/components/schemas/Limit' + nullable: true + additionalProperties: false + required: true + responses: + '200': + description: '' + content: + application/json: + schema: + type: object + required: + - context + - value + properties: + context: + $ref: '#/components/schemas/Context' + value: + $ref: '#/components/schemas/PaginatedColdMintList' + additionalProperties: false + '429': + description: Exceeded rate limit. + content: + application/json: + schema: + type: object + properties: + error: + type: string + '500': + description: The server encountered an unexpected condition that prevented it from fulfilling the request. + content: + application/json: + schema: + type: object + properties: + error: + type: string +components: + schemas: + PaginatedColdMintList: + type: object + required: + - items + properties: + cursor: + $ref: '#/components/schemas/Base58String' + items: + type: array + items: + $ref: '#/components/schemas/ColdMint' + additionalProperties: false + ColdMint: + type: object + required: + - mint + - account + properties: + mint: + $ref: '#/components/schemas/MintData' + account: + $ref: '#/components/schemas/Account' + additionalProperties: false + MintData: + type: object + required: + - mintPda + - mintSigner + - supply + - decimals + - version + - mintDecompressed + properties: + mintPda: + $ref: '#/components/schemas/SerializablePubkey' + description: The PDA (decompressed account address) for this mint. + mintSigner: + $ref: '#/components/schemas/Hash' + description: The signer/seed used for PDA derivation. + mintAuthority: + allOf: + - $ref: '#/components/schemas/SerializablePubkey' + nullable: true + description: Authority that can mint new tokens. + freezeAuthority: + allOf: + - $ref: '#/components/schemas/SerializablePubkey' + nullable: true + description: Authority that can freeze accounts. + supply: + type: integer + format: int64 + minimum: 0 + description: Total supply of tokens. + decimals: + type: integer + minimum: 0 + maximum: 255 + description: Number of decimals. + version: + type: integer + minimum: 0 + maximum: 255 + description: Version of the mint. + mintDecompressed: + type: boolean + description: Whether the mint has been decompressed. + extensions: + allOf: + - $ref: '#/components/schemas/Base64String' + nullable: true + description: Serialized extensions. + additionalProperties: false + Account: + type: object + required: + - hash + - owner + - lamports + - tree + - leafIndex + - seq + - slotCreated + properties: + address: + $ref: '#/components/schemas/SerializablePubkey' + data: + $ref: '#/components/schemas/AccountData' + hash: + $ref: '#/components/schemas/Hash' + lamports: + $ref: '#/components/schemas/UnsignedInteger' + leafIndex: + $ref: '#/components/schemas/UnsignedInteger' + owner: + $ref: '#/components/schemas/SerializablePubkey' + seq: + $ref: '#/components/schemas/UnsignedInteger' + slotCreated: + $ref: '#/components/schemas/UnsignedInteger' + tree: + $ref: '#/components/schemas/SerializablePubkey' + additionalProperties: false + AccountData: + type: object + required: + - discriminator + - data + - dataHash + properties: + data: + $ref: '#/components/schemas/Base64String' + dataHash: + $ref: '#/components/schemas/Hash' + discriminator: + $ref: '#/components/schemas/UnsignedInteger' + additionalProperties: false + Base58String: + type: string + description: A base 58 encoded string. + default: 3J98t1WpEZ73CNm + example: 3J98t1WpEZ73CNm + Base64String: + type: string + description: A base 64 encoded string. + default: SGVsbG8sIFdvcmxkIQ== + example: SGVsbG8sIFdvcmxkIQ== + Context: + type: object + required: + - slot + properties: + slot: + type: integer + default: 100 + example: 100 + Hash: + type: string + description: A 32-byte hash represented as a base58 string. + example: 11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP + Limit: + type: integer + format: int64 + minimum: 0 + SerializablePubkey: + type: string + description: A Solana public key represented as a base58 string. + default: 11111114d3RrygbPdAtMuFnDmzsN8T5fYKVQ7FVr7 + example: 11111114d3RrygbPdAtMuFnDmzsN8T5fYKVQ7FVr7 + UnsignedInteger: + type: integer + default: 100 + example: 100