// npm i cross-fetch
const fetch = require("cross-fetch");
const API_URL = "https://apis.xpay.stream/client/wallets/save";
const method = "POST";
const headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <access_token>"
};
const body = JSON.stringify({
wallet: "<existing_wallet_uuid>",
tag: "<your_tag>"
});
fetch(API_URL, { headers, body, method })
.then(async res => await res.json())
.then(result => {
if(result.error)
console.log("Wallet Update Error", result);
if(result.success)
console.log("Wallet Updated", result);
})
.catch((err) => {
console.error("Wallet Update API Exception", err);
});