mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-07 06:07:45 +00:00
remove trade.rs
This commit is contained in:
+5
-5
@@ -63,12 +63,12 @@ pub struct CreateTokenMetadata {
|
||||
pub metadata_uri: Option<String>,
|
||||
}
|
||||
|
||||
pub async fn create_token_metadata(metadata: CreateTokenMetadata, api_key: &str) -> Result<TokenMetadataIPFS, anyhow::Error> {
|
||||
pub async fn create_token_metadata(metadata: CreateTokenMetadata, jwt_token: &str) -> Result<TokenMetadataIPFS, anyhow::Error> {
|
||||
let ipfs_url = if metadata.file.starts_with("http") || metadata.metadata_uri.is_some() {
|
||||
metadata.file
|
||||
} else {
|
||||
let base64_string = file_to_base64(&metadata.file).await?;
|
||||
upload_base64_file(&base64_string, api_key).await?
|
||||
upload_base64_file(&base64_string, jwt_token).await?
|
||||
};
|
||||
|
||||
let token_metadata = TokenMetadata {
|
||||
@@ -94,7 +94,7 @@ pub async fn create_token_metadata(metadata: CreateTokenMetadata, api_key: &str)
|
||||
let response = client
|
||||
.post("https://api.pinata.cloud/pinning/pinJSONToIPFS")
|
||||
.header("Content-Type", "application/json")
|
||||
.header("Authorization", format!("Bearer {}", api_key))
|
||||
.header("Authorization", format!("Bearer {}", jwt_token))
|
||||
.json(&token_metadata)
|
||||
.send()
|
||||
.await?;
|
||||
@@ -116,7 +116,7 @@ pub async fn create_token_metadata(metadata: CreateTokenMetadata, api_key: &str)
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn upload_base64_file(base64_string: &str, api_key: &str) -> Result<String, anyhow::Error> {
|
||||
pub async fn upload_base64_file(base64_string: &str, jwt_token: &str) -> Result<String, anyhow::Error> {
|
||||
let decoded_bytes = general_purpose::STANDARD.decode(base64_string)?;
|
||||
|
||||
let client = Client::builder()
|
||||
@@ -133,7 +133,7 @@ pub async fn upload_base64_file(base64_string: &str, api_key: &str) -> Result<St
|
||||
|
||||
let response = client
|
||||
.post("https://api.pinata.cloud/pinning/pinFileToIPFS")
|
||||
.header("Authorization", format!("Bearer {}", api_key))
|
||||
.header("Authorization", format!("Bearer {}", jwt_token))
|
||||
.header("Accept", "application/json")
|
||||
.multipart(form)
|
||||
.send()
|
||||
|
||||
@@ -5,7 +5,6 @@ pub mod instruction;
|
||||
pub mod grpc;
|
||||
pub mod common;
|
||||
pub mod ipfs;
|
||||
pub mod trade;
|
||||
pub mod jito;
|
||||
pub mod pumpfun;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user