Introduction

Welcome to the documentation for the Solana Wallet Reader Unreal plugin.

The Solana Wallet Reader plugin allows you to read the balance, NFTs and tokens from a Solana wallet. It does this by leveraging Moralis blockchain services, you will need to sign up to Moralis and retrieve an API key.




Initialization

Before making any read calls from a Solana wallet you will need to create the Solana Wallet Reader BP Library and set the moralis api key.




The Local Cache

Because blockchain data does not rapidly change the plugin has the ability to locally cache recieved data. To enable the cache call the 'Enable Local Cache' function of the Solana Wallet Reader BP Library object and enter the number of seconds that records should be retained for.


To turn of the cache call the 'Disable Local Cache' function of the Solana Wallet Reader BP Library object. This will purge the cache and dissable the cache timer.





Getting Wallet Data

To retrieve data from the wallet you will need to bind to the appropriate event.



Once bound you can then call the corresponding function.






Demonstration Level

A demonstration level is provided that showcases features of the Solana Wallet Reader plugin. To open the demo level make sure that 'Show Plugin Content' is enabled in the view options of the content browser.


Once plugin content is visible, navigate to the Solana Wallet Reader content



The demonstration level will now be visible





API Reference


SetMoralisAPIKey

Applies the Moralis API key to the plugin for use in wallet requests. This must be done before any requests are made.

Inputs
FString MoralisAPIKey - The API key retrieved from the Moralis service

EnableLocalCache

Enables or ( re-enables if the cache has been dissabled during runtime ) the local in memory runtime cache. The cache will purge itself every 'SecondsToPurgeCache' seconds.

Inputs
int SecondsToPurgeCache - The looping number of seconds to clear everythng from the cache

DisableLocalCache

Disables the local cache timer and immediately deletes any cached data.


GetWalletBalances

Retrieves the Solana and Lamports balance of a wallet. The balances will be returned in the OnTokenBalancesRetrieved event.

Cached data is returned if that data is present in the cache. If it is not a request is made to retrieve it and the cache populated.

Inputs
UNetwork Network - The Network ( devnet or mainnet ) to read from
FString WalletId - The wallet Id of the wallet to get the data from

GetNFTs

Retrieves all NFT data from a Solana wallet. The NFT data will be returned in the OnNFTsRetrieved event.

Cached data is returned if that data is present in the cache. If it is not a request is made to retrieve it and the cache populated.

Inputs
UNetwork Network - The Network ( devnet or mainnet ) to read from
FString WalletId - The walledId of the wallet to get the data from

GetNFTMetadata

Retrieves the metadata associated with an NFT. The NFT metadata will be returned in the OnNFTMetaDataRetrieved event.

Cached data is returned if that data is present in the cache. If it is not a request is made to retrieve it and the cache populated.

Inputs
UNetwork Network - The Network ( devnet or mainnet ) to read from
FString Mint - The Mint Id of the NFT returned in the GetNFTs output

GetWalletTokenBalances

Retrieves the token balances for a Solana wallet. The token balances will be returned in the OnTokenBalancesRetrieved event.

Cached data is returned if that data is present in the cache. If it is not a request is made to retrieve it and the cache populated.

Inputs
UNetwork Network - The Network ( devnet or mainnet ) to read from
FString WalletId - The wallet Id of the wallet to get the data from

GetWalletTokenPrices

Retrieves the token prices for a Solana wallet. The token prices will be returned in the OnTokenPricesRetrieved event.

Cached data is returned if that data is present in the cache. If it is not a request is made to retrieve it and the cache populated.

Inputs
UNetwork Network - The Network ( devnet or mainnet ) to read from
FString WalletId - The wallet Id of the wallet to get the data from



Licence

The Solana logo, name and branding are used in accordance with the Solana Licence and Apache Licence-2.0