[][src]Struct pinata_sdk::PinataApi

pub struct PinataApi { /* fields omitted */ }

API struct. Exposes functions to interact with the Pinata API

Methods

impl PinataApi[src]

pub fn new<S: Into<String>>(
    api_key: S,
    secret_api_key: S
) -> Result<PinataApi, Error>
[src]

Creates a new instance of PinataApi using the provided keys. This function panics if api_key or secret_api_key's are empty/blank

pub async fn test_authentication<'_>(&'_ self) -> Result<(), ApiError>[src]

Test if your credentials are corrects. It returns an error if credentials are not correct

pub async fn set_hash_pin_policy<'_>(
    &'_ self,
    policy: HashPinPolicy
) -> Result<(), ApiError>
[src]

Change the pin policy for an individual piece of content.

Changes made via this function only affect the content for the hash passed in. They do not affect a user's account level pin policy.

To read more about pin policies, please check out the Regions and Replications documentation

pub async fn pin_by_hash<'_>(
    &'_ self,
    hash: PinByHash
) -> Result<PinByHashResult, ApiError>
[src]

Add a hash to Pinata for asynchronous pinning.

Content added through this function is pinned in the background. Fpr this operation to succeed, the content for the hash provided must already be pinned by another node on the IPFS network.

pub async fn get_pin_jobs<'_>(
    &'_ self,
    filters: PinJobsFilter
) -> Result<PinJobs, ApiError>
[src]

Retrieve a list of all the pins that are currently in the pin queue for your user

pub async fn pin_json<'_, S>(
    &'_ self,
    pin_data: PinByJson<S>
) -> Result<PinnedObject, ApiError> where
    S: Serialize
[src]

Pin any JSON serializable object to Pinata IPFS nodes.

pub async fn pin_file<'_>(
    &'_ self,
    pin_data: PinByFile
) -> Result<PinnedObject, ApiError>
[src]

Pin any file or folder to Pinata's IPFS nodes.

To upload a file use PinByFile::new("file_path"). If file_path is a directory, all the content of the directory will be uploaded to IPFS and the hash of the parent directory is returned.

If the file cannot be read or directory cannot be read an error will be returned.

pub async fn unpin<'_, '_>(&'_ self, hash: &'_ str) -> Result<(), ApiError>[src]

Unpin content previously uploaded to the Pinata's IPFS nodes.

pub async fn change_hash_metadata<'_>(
    &'_ self,
    change: ChangePinMetadata
) -> Result<(), ApiError>
[src]

Change name and custom key values associated for a piece of content stored on Pinata.

pub async fn get_total_user_pinned_data<'_>(
    &'_ self
) -> Result<TotalPinnedData, ApiError>
[src]

This endpoint returns the total combined size for all content that you've pinned through Pinata

pub async fn get_pin_list<'_>(
    &'_ self,
    filters: PinListFilter
) -> Result<PinList, ApiError>
[src]

This returns data on what content the sender has pinned to IPFS from pinata

The purpose of this endpoint is to provide insight into what is being pinned, and how long it has been pinned. The results of this call can be filtered using PinListFilter.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.