diff --git a/README.md b/README.md index 76823af..6ff4c9c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Photon: the Indexer for ZK Compression on Solana -Photon is the core indexer for [ZK Compression](zkcompression.com) on the Solana blockchain. It offers rapid indexing capabilities, snapshot support, and flexible database options to cater to local and production deployments. +Photon is the core indexer for [ZK Compression](https://www.zkcompression.com) on the Solana blockchain. It offers rapid indexing capabilities, snapshot support, and flexible database options to cater to local and production deployments. ## 🚀 Quick Start diff --git a/src/api/api.rs b/src/api/api.rs index b11556b..e92d317 100644 --- a/src/api/api.rs +++ b/src/api/api.rs @@ -5,6 +5,7 @@ use solana_client::nonblocking::rpc_client::RpcClient; use utoipa::openapi::{ObjectBuilder, RefOr, Schema, SchemaType}; use utoipa::ToSchema; +use crate::api::method::get_validity_proof::GetValidityProofRequestDocumentation; use crate::api::method::utils::GetNonPaginatedSignaturesResponse; use crate::common::typedefs::unsigned_integer::UnsignedInteger; @@ -382,7 +383,7 @@ impl PhotonApi { }, OpenApiSpec { name: "getValidityProof".to_string(), - request: Some(GetValidityProofRequest::schema().1), + request: Some(GetValidityProofRequestDocumentation::schema().1), response: GetValidityProofResponse::schema().1, }, OpenApiSpec { diff --git a/src/api/method/get_validity_proof.rs b/src/api/method/get_validity_proof.rs index aeb4fe4..b5b322f 100644 --- a/src/api/method/get_validity_proof.rs +++ b/src/api/method/get_validity_proof.rs @@ -252,11 +252,23 @@ pub struct GetValidityProofRequest { #[serde(default)] pub hashes: Vec, #[serde(default)] + #[schema(deprecated = true)] pub newAddresses: Vec, #[serde(default)] pub newAddressesWithTrees: Vec, } +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, ToSchema)] +#[serde(deny_unknown_fields, rename_all = "camelCase")] +#[allow(non_snake_case)] +// Create to hide the deprecated newAddresses field from the documentation +pub struct GetValidityProofRequestDocumentation { + #[serde(default)] + pub hashes: Vec, + #[serde(default)] + pub newAddressesWithTrees: Vec, +} + #[derive(Serialize, Deserialize, ToSchema)] #[serde(deny_unknown_fields, rename_all = "camelCase")] pub struct GetValidityProofResponse { @@ -273,12 +285,12 @@ pub async fn get_validity_proof( && request.newAddresses.is_empty() && request.newAddressesWithTrees.is_empty() { - return Err(PhotonApiError::UnexpectedError( + return Err(PhotonApiError::ValidationError( "No hashes or new addresses provided for proof generation".to_string(), )); } if !request.newAddressesWithTrees.is_empty() && !request.newAddresses.is_empty() { - return Err(PhotonApiError::UnexpectedError( + return Err(PhotonApiError::ValidationError( "Cannot provide both newAddresses and newAddressesWithTree".to_string(), )); } diff --git a/src/openapi/specs/getCompressedAccount.yaml b/src/openapi/specs/getCompressedAccount.yaml index 9a73050..f7b529d 100644 --- a/src/openapi/specs/getCompressedAccount.yaml +++ b/src/openapi/specs/getCompressedAccount.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedAccountBalance.yaml b/src/openapi/specs/getCompressedAccountBalance.yaml index a93ce98..c81337b 100644 --- a/src/openapi/specs/getCompressedAccountBalance.yaml +++ b/src/openapi/specs/getCompressedAccountBalance.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedAccountProof.yaml b/src/openapi/specs/getCompressedAccountProof.yaml index 73e1f67..3fe5e36 100644 --- a/src/openapi/specs/getCompressedAccountProof.yaml +++ b/src/openapi/specs/getCompressedAccountProof.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedAccountsByOwner.yaml b/src/openapi/specs/getCompressedAccountsByOwner.yaml index e18c67c..0a33557 100644 --- a/src/openapi/specs/getCompressedAccountsByOwner.yaml +++ b/src/openapi/specs/getCompressedAccountsByOwner.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedBalanceByOwner.yaml b/src/openapi/specs/getCompressedBalanceByOwner.yaml index 3219896..7c7e92e 100644 --- a/src/openapi/specs/getCompressedBalanceByOwner.yaml +++ b/src/openapi/specs/getCompressedBalanceByOwner.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedMintTokenHolders.yaml b/src/openapi/specs/getCompressedMintTokenHolders.yaml index c276a2a..dcc1ad4 100644 --- a/src/openapi/specs/getCompressedMintTokenHolders.yaml +++ b/src/openapi/specs/getCompressedMintTokenHolders.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedTokenAccountBalance.yaml b/src/openapi/specs/getCompressedTokenAccountBalance.yaml index 30ea264..252f4dc 100644 --- a/src/openapi/specs/getCompressedTokenAccountBalance.yaml +++ b/src/openapi/specs/getCompressedTokenAccountBalance.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedTokenAccountsByDelegate.yaml b/src/openapi/specs/getCompressedTokenAccountsByDelegate.yaml index 4971599..b5f8a0e 100644 --- a/src/openapi/specs/getCompressedTokenAccountsByDelegate.yaml +++ b/src/openapi/specs/getCompressedTokenAccountsByDelegate.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedTokenAccountsByOwner.yaml b/src/openapi/specs/getCompressedTokenAccountsByOwner.yaml index 004cf20..4a9b227 100644 --- a/src/openapi/specs/getCompressedTokenAccountsByOwner.yaml +++ b/src/openapi/specs/getCompressedTokenAccountsByOwner.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedTokenBalancesByOwner.yaml b/src/openapi/specs/getCompressedTokenBalancesByOwner.yaml index 7d01cad..9ca3728 100644 --- a/src/openapi/specs/getCompressedTokenBalancesByOwner.yaml +++ b/src/openapi/specs/getCompressedTokenBalancesByOwner.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressedTokenBalancesByOwnerV2.yaml b/src/openapi/specs/getCompressedTokenBalancesByOwnerV2.yaml index ad4e039..71d1ddd 100644 --- a/src/openapi/specs/getCompressedTokenBalancesByOwnerV2.yaml +++ b/src/openapi/specs/getCompressedTokenBalancesByOwnerV2.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressionSignaturesForAccount.yaml b/src/openapi/specs/getCompressionSignaturesForAccount.yaml index b6d5f07..e62acec 100644 --- a/src/openapi/specs/getCompressionSignaturesForAccount.yaml +++ b/src/openapi/specs/getCompressionSignaturesForAccount.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressionSignaturesForAddress.yaml b/src/openapi/specs/getCompressionSignaturesForAddress.yaml index eeb0256..2b9bccf 100644 --- a/src/openapi/specs/getCompressionSignaturesForAddress.yaml +++ b/src/openapi/specs/getCompressionSignaturesForAddress.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressionSignaturesForOwner.yaml b/src/openapi/specs/getCompressionSignaturesForOwner.yaml index 21ff2fb..d19fe11 100644 --- a/src/openapi/specs/getCompressionSignaturesForOwner.yaml +++ b/src/openapi/specs/getCompressionSignaturesForOwner.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getCompressionSignaturesForTokenOwner.yaml b/src/openapi/specs/getCompressionSignaturesForTokenOwner.yaml index a37cc65..ea72fa9 100644 --- a/src/openapi/specs/getCompressionSignaturesForTokenOwner.yaml +++ b/src/openapi/specs/getCompressionSignaturesForTokenOwner.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getIndexerHealth.yaml b/src/openapi/specs/getIndexerHealth.yaml index 6b86bac..d40866c 100644 --- a/src/openapi/specs/getIndexerHealth.yaml +++ b/src/openapi/specs/getIndexerHealth.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getIndexerSlot.yaml b/src/openapi/specs/getIndexerSlot.yaml index ff0ac38..29edaa6 100644 --- a/src/openapi/specs/getIndexerSlot.yaml +++ b/src/openapi/specs/getIndexerSlot.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getLatestCompressionSignatures.yaml b/src/openapi/specs/getLatestCompressionSignatures.yaml index ebbc8cc..902f34b 100644 --- a/src/openapi/specs/getLatestCompressionSignatures.yaml +++ b/src/openapi/specs/getLatestCompressionSignatures.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getLatestNonVotingSignatures.yaml b/src/openapi/specs/getLatestNonVotingSignatures.yaml index 1ebea51..004c673 100644 --- a/src/openapi/specs/getLatestNonVotingSignatures.yaml +++ b/src/openapi/specs/getLatestNonVotingSignatures.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getMultipleCompressedAccountProofs.yaml b/src/openapi/specs/getMultipleCompressedAccountProofs.yaml index 0eb3586..c520f8f 100644 --- a/src/openapi/specs/getMultipleCompressedAccountProofs.yaml +++ b/src/openapi/specs/getMultipleCompressedAccountProofs.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getMultipleCompressedAccounts.yaml b/src/openapi/specs/getMultipleCompressedAccounts.yaml index 347ac0e..cbe7ce1 100644 --- a/src/openapi/specs/getMultipleCompressedAccounts.yaml +++ b/src/openapi/specs/getMultipleCompressedAccounts.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getMultipleNewAddressProofs.yaml b/src/openapi/specs/getMultipleNewAddressProofs.yaml index 5b227b8..95efb88 100644 --- a/src/openapi/specs/getMultipleNewAddressProofs.yaml +++ b/src/openapi/specs/getMultipleNewAddressProofs.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getMultipleNewAddressProofsV2.yaml b/src/openapi/specs/getMultipleNewAddressProofsV2.yaml index d215ae5..399efde 100644 --- a/src/openapi/specs/getMultipleNewAddressProofsV2.yaml +++ b/src/openapi/specs/getMultipleNewAddressProofsV2.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getTransactionWithCompressionInfo.yaml b/src/openapi/specs/getTransactionWithCompressionInfo.yaml index b09423f..59ca0c9 100644 --- a/src/openapi/specs/getTransactionWithCompressionInfo.yaml +++ b/src/openapi/specs/getTransactionWithCompressionInfo.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: diff --git a/src/openapi/specs/getValidityProof.yaml b/src/openapi/specs/getValidityProof.yaml index 5145d20..d2abd4e 100644 --- a/src/openapi/specs/getValidityProof.yaml +++ b/src/openapi/specs/getValidityProof.yaml @@ -4,7 +4,7 @@ info: description: Solana indexer for general compression license: name: Apache-2.0 - version: 0.49.0 + version: 0.50.0 servers: - url: https://mainnet.helius-rpc.com?api-key= paths: @@ -44,10 +44,6 @@ paths: type: array items: $ref: '#/components/schemas/Hash' - newAddresses: - type: array - items: - $ref: '#/components/schemas/SerializablePubkey' newAddressesWithTrees: type: array items: