@@ -4,7 +4,9 @@ use near_client::{
44 client:: NearClient ,
55 prelude:: { AccountId , Finality } ,
66} ;
7- use reqwest:: { multipart:: { Form , Part } , Client
7+ use reqwest:: {
8+ multipart:: { Form , Part } ,
9+ Client ,
810} ;
911use rocket:: serde:: json:: { json, Json , Value } ;
1012use tracing:: debug;
@@ -91,26 +93,19 @@ pub async fn mint_tweet_request(tweet_id: Option<String>) -> NetworkResponse {
9193
9294 let client = Client :: new ( ) ;
9395
94- let form = Form :: new ( )
95- . part ( "file" , Part :: bytes ( image) . file_name ( "image.png" )
96- ) ;
96+ let form = Form :: new ( ) . part ( "file" , Part :: bytes ( image) . file_name ( "image.png" ) ) ;
9797
9898 // Return a JSON response
99- let url ="https://node.lighthouse.storage/api/v0/add?pin=true" ;
99+ let url = "https://node.lighthouse.storage/api/v0/add?pin=true" ;
100100 let response = client
101101 . post ( url)
102102 . header (
103103 "Content-Type" ,
104104 format ! ( "multipart/form-data; boundary={}" , form. boundary( ) ) ,
105105 )
106- . header (
107- "Encryption" , "false" ,
108- )
109- . header (
110- "Mime-Type" , "null" ,
111- ) . header (
112- "Authorization" , format ! ( "Bearer {}" , lighthouse_token) ,
113- )
106+ . header ( "Encryption" , "false" )
107+ . header ( "Mime-Type" , "null" )
108+ . header ( "Authorization" , format ! ( "Bearer {}" , lighthouse_token) )
114109 . multipart ( form)
115110 . send ( )
116111 . await ;
0 commit comments