Burn WHUF via Ethos Everywhere wallet
using System.Net.Http.Headers;var clientHandler = new HttpClientHandler{ UseCookies = false,};var client = new HttpClient(clientHandler);var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://api.ethos.network/api/v2/wallets/privy/whuf/burn"), Headers = { { "cookie", "ethos-access-token=<ethos-access-token>" }, }, Content = new StringContent("{ \"amount\": \"example\", \"restoreId\": 1 }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.ethos.network/api/v2/wallets/privy/whuf/burn"
payload := strings.NewReader("{ \"amount\": \"example\", \"restoreId\": 1 }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "ethos-access-token=<ethos-access-token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{ \"amount\": \"example\", \"restoreId\": 1 }");Request request = new Request.Builder() .url("https://api.ethos.network/api/v2/wallets/privy/whuf/burn") .post(body) .addHeader("cookie", "ethos-access-token=<ethos-access-token>") .addHeader("Content-Type", "application/json") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'POST', url: 'https://api.ethos.network/api/v2/wallets/privy/whuf/burn', headers: { cookie: 'ethos-access-token=<ethos-access-token>', 'Content-Type': 'application/json' }, data: {amount: 'example', restoreId: 1}};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.ethos.network/api/v2/wallets/privy/whuf/burn';const options = { method: 'POST', headers: { cookie: 'ethos-access-token=<ethos-access-token>', 'Content-Type': 'application/json' }, body: '{"amount":"example","restoreId":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://api.ethos.network/api/v2/wallets/privy/whuf/burn";
let payload = json!({ "amount": "example", "restoreId": 1 });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("cookie", "ethos-access-token=<ethos-access-token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request POST \ --url https://api.ethos.network/api/v2/wallets/privy/whuf/burn \ --header 'Content-Type: application/json' \ --cookie ethos-access-token=<ethos-access-token> \ --data '{ "amount": "example", "restoreId": 1 }'wget --quiet \ --method POST \ --header 'cookie: ethos-access-token=<ethos-access-token>' \ --header 'Content-Type: application/json' \ --body-data '{ "amount": "example", "restoreId": 1 }' \ --output-document \ - https://api.ethos.network/api/v2/wallets/privy/whuf/burnBurns what an open streak restore still needs from the user’s Ethos Everywhere wallet. Ethos counts the burn as WHUF credit, which pays for the restore. Refused when the amount no longer matches what is due. > ⚠️ Warning: This is a beta endpoint. It is not guaranteed to be stable and may change or break without notice.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Example generated
{ "amount": "example", "restoreId": 1}Responses
Section titled “Responses”Successful response
object
0x-prefixed 32-byte transaction hash (keccak256)
Example generated
{ "hash": "example"}Invalid input data
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "BAD_REQUEST", "message": "Invalid input data", "issues": []}Authorization not provided
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "UNAUTHORIZED", "message": "Authorization not provided", "issues": []}Insufficient access
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "FORBIDDEN", "message": "Insufficient access", "issues": []}Internal server error
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "INTERNAL_SERVER_ERROR", "message": "Internal server error", "issues": []}