Crates.io | nft_storage_core |
lib.rs | nft_storage_core |
version | 0.2.0 |
source | src |
created_at | 2023-11-03 22:49:49.556543 |
updated_at | 2023-12-25 13:31:32.020727 |
description | A Rust client tailored for NFT.storage, providing an intuitive API wrapper for enhanced interaction with the service. It supports storing ERC-1155 compatible NFTs, encrypted file uploads with pluggable encryption modules, asset management, and decentralized identity (DID) handling. The client also enables encrypted downloads and decryption, ensuring secure data handling. It's designed with async capabilities to integrate smoothly into contemporary Rust async ecosystems. |
homepage | https://github.com/noplan-inc/nft.storage-rs |
repository | https://github.com/noplan-inc/nft.storage-rs |
max_upload_size | |
id | 1024732 |
size | 3,379,689 |
nft.storage-rs
is a Rust client for easily uploading a file to the nft.storage service.
Add the following to your Cargo.toml
:
[dependencies]
nft.storage-rs = "0.1.0"
Run:
$ cargo build
Here's a quick example:
use std::path::PathBuf;
use nft_storage_core::{encryptor::plugins::aes::AesEncryptor, NftStorageApi, NftStorageCore};
#[tokio::main]
async fn main() {
let aes = AesEncryptor::generate_key().unwrap();
let encryptor = Box::new(aes);
// If pass none, use NFT_STORAGE_API_KEY envrioment variable.
let api_key = Some("<FILL ME NFT_STORAGE_API_KEY>".to_string());
let client = NftStorageCore::try_new(api_key, encryptor).unwrap();
let path = vec![PathBuf::from("test.txt")];
let resp = client.upload(&path, None).await.unwrap();
println!("{}", serde_json::to_string_pretty(&resp).unwrap());
}
For more examples, please refer to the examples/
directory.
For full documentation, please visit docs.rs/nft.storage-rs.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
This project is licensed under the MIT License - see the LICENSE file for details.