Skip to content

Commit

Permalink
Merge branch 'helius-labs:main' into triton
Browse files Browse the repository at this point in the history
  • Loading branch information
bruswejn authored Jan 3, 2025
2 parents 0a536c7 + df690fd commit bd0fd33
Show file tree
Hide file tree
Showing 28 changed files with 42 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 2 additions & 1 deletion src/api/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 {
Expand Down
16 changes: 14 additions & 2 deletions src/api/method/get_validity_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,23 @@ pub struct GetValidityProofRequest {
#[serde(default)]
pub hashes: Vec<Hash>,
#[serde(default)]
#[schema(deprecated = true)]
pub newAddresses: Vec<SerializablePubkey>,
#[serde(default)]
pub newAddressesWithTrees: Vec<AddressWithTree>,
}

#[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<Hash>,
#[serde(default)]
pub newAddressesWithTrees: Vec<AddressWithTree>,
}

#[derive(Serialize, Deserialize, ToSchema)]
#[serde(deny_unknown_fields, rename_all = "camelCase")]
pub struct GetValidityProofResponse {
Expand All @@ -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(),
));
}
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getCompressedAccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getCompressedAccountBalance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getCompressedAccountProof.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getCompressedAccountsByOwner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getCompressedBalanceByOwner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getCompressedMintTokenHolders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getCompressedTokenAccountBalance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getCompressedTokenAccountsByOwner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getCompressedTokenBalancesByOwner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getCompressedTokenBalancesByOwnerV2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getCompressionSignaturesForAccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getCompressionSignaturesForAddress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getCompressionSignaturesForOwner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getIndexerHealth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getIndexerSlot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getLatestCompressionSignatures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getLatestNonVotingSignatures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getMultipleCompressedAccountProofs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getMultipleCompressedAccounts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getMultipleNewAddressProofs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getMultipleNewAddressProofsV2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/specs/getTransactionWithCompressionInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down
6 changes: 1 addition & 5 deletions src/openapi/specs/getValidityProof.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<api_key>
paths:
Expand Down Expand Up @@ -44,10 +44,6 @@ paths:
type: array
items:
$ref: '#/components/schemas/Hash'
newAddresses:
type: array
items:
$ref: '#/components/schemas/SerializablePubkey'
newAddressesWithTrees:
type: array
items:
Expand Down

0 comments on commit bd0fd33

Please sign in to comment.