penumbra_proto::penumbra::view::v1::view_service_server

Trait ViewService

Source
pub trait ViewService:
    Send
    + Sync
    + 'static {
Show 43 associated items type StatusStreamStream: Stream<Item = Result<StatusStreamResponse, Status>> + Send + 'static; type NotesStream: Stream<Item = Result<NotesResponse, Status>> + Send + 'static; type NotesForVotingStream: Stream<Item = Result<NotesForVotingResponse, Status>> + Send + 'static; type AssetsStream: Stream<Item = Result<AssetsResponse, Status>> + Send + 'static; type BalancesStream: Stream<Item = Result<BalancesResponse, Status>> + Send + 'static; type UnclaimedSwapsStream: Stream<Item = Result<UnclaimedSwapsResponse, Status>> + Send + 'static; type TransactionInfoStream: Stream<Item = Result<TransactionInfoResponse, Status>> + Send + 'static; type OwnedPositionIdsStream: Stream<Item = Result<OwnedPositionIdsResponse, Status>> + Send + 'static; type WitnessAndBuildStream: Stream<Item = Result<WitnessAndBuildResponse, Status>> + Send + 'static; type AuthorizeAndBuildStream: Stream<Item = Result<AuthorizeAndBuildResponse, Status>> + Send + 'static; type BroadcastTransactionStream: Stream<Item = Result<BroadcastTransactionResponse, Status>> + Send + 'static; type DelegationsByAddressIndexStream: Stream<Item = Result<DelegationsByAddressIndexResponse, Status>> + Send + 'static; type UnbondingTokensByAddressIndexStream: Stream<Item = Result<UnbondingTokensByAddressIndexResponse, Status>> + Send + 'static; type AuctionsStream: Stream<Item = Result<AuctionsResponse, Status>> + Send + 'static; // Required methods fn status<'life0, 'async_trait>( &'life0 self, request: Request<StatusRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<StatusResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn status_stream<'life0, 'async_trait>( &'life0 self, request: Request<StatusStreamRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::StatusStreamStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn notes<'life0, 'async_trait>( &'life0 self, request: Request<NotesRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::NotesStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn notes_for_voting<'life0, 'async_trait>( &'life0 self, request: Request<NotesForVotingRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::NotesForVotingStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn assets<'life0, 'async_trait>( &'life0 self, request: Request<AssetsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::AssetsStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn asset_metadata_by_id<'life0, 'async_trait>( &'life0 self, request: Request<AssetMetadataByIdRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<AssetMetadataByIdResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn app_parameters<'life0, 'async_trait>( &'life0 self, request: Request<AppParametersRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<AppParametersResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn gas_prices<'life0, 'async_trait>( &'life0 self, request: Request<GasPricesRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GasPricesResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn fmd_parameters<'life0, 'async_trait>( &'life0 self, request: Request<FmdParametersRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<FmdParametersResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn address_by_index<'life0, 'async_trait>( &'life0 self, request: Request<AddressByIndexRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<AddressByIndexResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn wallet_id<'life0, 'async_trait>( &'life0 self, request: Request<WalletIdRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<WalletIdResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn index_by_address<'life0, 'async_trait>( &'life0 self, request: Request<IndexByAddressRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<IndexByAddressResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn ephemeral_address<'life0, 'async_trait>( &'life0 self, request: Request<EphemeralAddressRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<EphemeralAddressResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn balances<'life0, 'async_trait>( &'life0 self, request: Request<BalancesRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::BalancesStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn note_by_commitment<'life0, 'async_trait>( &'life0 self, request: Request<NoteByCommitmentRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<NoteByCommitmentResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn swap_by_commitment<'life0, 'async_trait>( &'life0 self, request: Request<SwapByCommitmentRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<SwapByCommitmentResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn unclaimed_swaps<'life0, 'async_trait>( &'life0 self, request: Request<UnclaimedSwapsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::UnclaimedSwapsStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn nullifier_status<'life0, 'async_trait>( &'life0 self, request: Request<NullifierStatusRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<NullifierStatusResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn transaction_info_by_hash<'life0, 'async_trait>( &'life0 self, request: Request<TransactionInfoByHashRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<TransactionInfoByHashResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn transaction_info<'life0, 'async_trait>( &'life0 self, request: Request<TransactionInfoRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::TransactionInfoStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn owned_position_ids<'life0, 'async_trait>( &'life0 self, request: Request<OwnedPositionIdsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::OwnedPositionIdsStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn transaction_planner<'life0, 'async_trait>( &'life0 self, request: Request<TransactionPlannerRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<TransactionPlannerResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn witness<'life0, 'async_trait>( &'life0 self, request: Request<WitnessRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<WitnessResponse>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn witness_and_build<'life0, 'async_trait>( &'life0 self, request: Request<WitnessAndBuildRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::WitnessAndBuildStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn authorize_and_build<'life0, 'async_trait>( &'life0 self, request: Request<AuthorizeAndBuildRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::AuthorizeAndBuildStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn broadcast_transaction<'life0, 'async_trait>( &'life0 self, request: Request<BroadcastTransactionRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::BroadcastTransactionStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn delegations_by_address_index<'life0, 'async_trait>( &'life0 self, request: Request<DelegationsByAddressIndexRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::DelegationsByAddressIndexStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn unbonding_tokens_by_address_index<'life0, 'async_trait>( &'life0 self, request: Request<UnbondingTokensByAddressIndexRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::UnbondingTokensByAddressIndexStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn auctions<'life0, 'async_trait>( &'life0 self, request: Request<AuctionsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::AuctionsStream>, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait;
}
Available on crate feature rpc only.
Expand description

Generated trait containing gRPC methods that should be implemented for use with ViewServiceServer.

Required Associated Types§

Source

type StatusStreamStream: Stream<Item = Result<StatusStreamResponse, Status>> + Send + 'static

Server streaming response type for the StatusStream method.

Source

type NotesStream: Stream<Item = Result<NotesResponse, Status>> + Send + 'static

Server streaming response type for the Notes method.

Source

type NotesForVotingStream: Stream<Item = Result<NotesForVotingResponse, Status>> + Send + 'static

Server streaming response type for the NotesForVoting method.

Source

type AssetsStream: Stream<Item = Result<AssetsResponse, Status>> + Send + 'static

Server streaming response type for the Assets method.

Source

type BalancesStream: Stream<Item = Result<BalancesResponse, Status>> + Send + 'static

Server streaming response type for the Balances method.

Source

type UnclaimedSwapsStream: Stream<Item = Result<UnclaimedSwapsResponse, Status>> + Send + 'static

Server streaming response type for the UnclaimedSwaps method.

Source

type TransactionInfoStream: Stream<Item = Result<TransactionInfoResponse, Status>> + Send + 'static

Server streaming response type for the TransactionInfo method.

Source

type OwnedPositionIdsStream: Stream<Item = Result<OwnedPositionIdsResponse, Status>> + Send + 'static

Server streaming response type for the OwnedPositionIds method.

Source

type WitnessAndBuildStream: Stream<Item = Result<WitnessAndBuildResponse, Status>> + Send + 'static

Server streaming response type for the WitnessAndBuild method.

Source

type AuthorizeAndBuildStream: Stream<Item = Result<AuthorizeAndBuildResponse, Status>> + Send + 'static

Server streaming response type for the AuthorizeAndBuild method.

Source

type BroadcastTransactionStream: Stream<Item = Result<BroadcastTransactionResponse, Status>> + Send + 'static

Server streaming response type for the BroadcastTransaction method.

Source

type DelegationsByAddressIndexStream: Stream<Item = Result<DelegationsByAddressIndexResponse, Status>> + Send + 'static

Server streaming response type for the DelegationsByAddressIndex method.

Source

type UnbondingTokensByAddressIndexStream: Stream<Item = Result<UnbondingTokensByAddressIndexResponse, Status>> + Send + 'static

Server streaming response type for the UnbondingTokensByAddressIndex method.

Source

type AuctionsStream: Stream<Item = Result<AuctionsResponse, Status>> + Send + 'static

Server streaming response type for the Auctions method.

Required Methods§

Source

fn status<'life0, 'async_trait>( &'life0 self, request: Request<StatusRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<StatusResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get current status of chain sync

Source

fn status_stream<'life0, 'async_trait>( &'life0 self, request: Request<StatusStreamRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::StatusStreamStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stream sync status updates until the view service has caught up with the chain. Returns a stream of StatusStreamResponses.

Source

fn notes<'life0, 'async_trait>( &'life0 self, request: Request<NotesRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::NotesStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Queries for notes that have been accepted by the chain. Returns a stream of NotesResponses.

Source

fn notes_for_voting<'life0, 'async_trait>( &'life0 self, request: Request<NotesForVotingRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::NotesForVotingStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a stream of NotesForVotingResponses.

Source

fn assets<'life0, 'async_trait>( &'life0 self, request: Request<AssetsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::AssetsStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Queries for metadata about known assets. Returns a stream of AssetsResponses.

Source

fn asset_metadata_by_id<'life0, 'async_trait>( &'life0 self, request: Request<AssetMetadataByIdRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<AssetMetadataByIdResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for metadata about a specific asset, by asset ID.

This is the same as the method on the shielded pool’s QueryService, but exposing it here allows a view server to provide more specific or opinionated asset metadata – like using an asset registry to provide tickers, symbols, etc.

Source

fn app_parameters<'life0, 'async_trait>( &'life0 self, request: Request<AppParametersRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<AppParametersResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for the current app parameters.

Source

fn gas_prices<'life0, 'async_trait>( &'life0 self, request: Request<GasPricesRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GasPricesResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for the current gas prices.

Source

fn fmd_parameters<'life0, 'async_trait>( &'life0 self, request: Request<FmdParametersRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<FmdParametersResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for the current FMD parameters.

Source

fn address_by_index<'life0, 'async_trait>( &'life0 self, request: Request<AddressByIndexRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<AddressByIndexResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for an address given an address index

Source

fn wallet_id<'life0, 'async_trait>( &'life0 self, request: Request<WalletIdRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<WalletIdResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for wallet id

Source

fn index_by_address<'life0, 'async_trait>( &'life0 self, request: Request<IndexByAddressRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<IndexByAddressResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for an address given an address index

Source

fn ephemeral_address<'life0, 'async_trait>( &'life0 self, request: Request<EphemeralAddressRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<EphemeralAddressResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for an ephemeral address

Source

fn balances<'life0, 'async_trait>( &'life0 self, request: Request<BalancesRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::BalancesStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for balance of a given address. Returns a stream of BalancesResponses.

Source

fn note_by_commitment<'life0, 'async_trait>( &'life0 self, request: Request<NoteByCommitmentRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<NoteByCommitmentResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for a note by its note commitment, optionally waiting until the note is detected.

Source

fn swap_by_commitment<'life0, 'async_trait>( &'life0 self, request: Request<SwapByCommitmentRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<SwapByCommitmentResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for a swap by its swap commitment, optionally waiting until the swap is detected.

Source

fn unclaimed_swaps<'life0, 'async_trait>( &'life0 self, request: Request<UnclaimedSwapsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::UnclaimedSwapsStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for all unclaimed swaps.

Source

fn nullifier_status<'life0, 'async_trait>( &'life0 self, request: Request<NullifierStatusRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<NullifierStatusResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for whether a nullifier has been spent, optionally waiting until it is spent.

Source

fn transaction_info_by_hash<'life0, 'async_trait>( &'life0 self, request: Request<TransactionInfoByHashRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<TransactionInfoByHashResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for a given transaction by its hash.

Source

fn transaction_info<'life0, 'async_trait>( &'life0 self, request: Request<TransactionInfoRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::TransactionInfoStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for the full transactions in the given range of blocks. Returns a stream of TransactionInfoResponses.

Source

fn owned_position_ids<'life0, 'async_trait>( &'life0 self, request: Request<OwnedPositionIdsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::OwnedPositionIdsStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for owned position IDs for the given trading pair and in the given position state.

Source

fn transaction_planner<'life0, 'async_trait>( &'life0 self, request: Request<TransactionPlannerRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<TransactionPlannerResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Translates a high-level intent (“send X funds to Y address”) into a complete transaction plan.

Source

fn witness<'life0, 'async_trait>( &'life0 self, request: Request<WitnessRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<WitnessResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns authentication data for the given transaction plan.

This method takes a complete transaction plan, so that the client can get a consistent set of authentication paths to a common root for the entire transaction. (Otherwise, if a client made multiple requests, the wallet service could have advanced the state commitment tree between queries).

Source

fn witness_and_build<'life0, 'async_trait>( &'life0 self, request: Request<WitnessAndBuildRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::WitnessAndBuildStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Like Witness, but immediately uses the witness data to build (prove) the transaction.

This method is useful for clients that can’t easily do proving themselves, either because they’re not written in Rust and can’t easily import the proving code, or because they don’t have access to proving keys, or some other reason.

This method streams status updates to the caller before finally returning the transaction.

Source

fn authorize_and_build<'life0, 'async_trait>( &'life0 self, request: Request<AuthorizeAndBuildRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::AuthorizeAndBuildStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Authorize a transaction plan and build the transaction.

This method is only supported on view servers that have access to a custody service. Otherwise, it will fail.

Penumbra’s transaction authorization mechanism is designed so transactions can be signed and built (proved) concurrently. This allows implementations to, e.g., start proving optimistically while presenting the user with an approval dialog.

This method streams status updates to the caller before finally returning the transaction.

Source

fn broadcast_transaction<'life0, 'async_trait>( &'life0 self, request: Request<BroadcastTransactionRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::BroadcastTransactionStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Broadcast a transaction to the network, optionally waiting for full confirmation.

This method streams status updates to the caller before finally returning confirmation.

Source

fn delegations_by_address_index<'life0, 'async_trait>( &'life0 self, request: Request<DelegationsByAddressIndexRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::DelegationsByAddressIndexStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get delegation tokens for a given address index. Each delegation token will be represented by a ValueView with the given address index’s balance of that token. Each ValueView’s extended_metadata field will contain the ValidatorInfo of the delegated validator.

Source

fn unbonding_tokens_by_address_index<'life0, 'async_trait>( &'life0 self, request: Request<UnbondingTokensByAddressIndexRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::UnbondingTokensByAddressIndexStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get unbonding tokens for the given address index, optionally filtered by whether the tokens are currently claimable.

Source

fn auctions<'life0, 'async_trait>( &'life0 self, request: Request<AuctionsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::AuctionsStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Gets the auctions controlled by the user’s wallet.

Implementors§