Skip to content

Instantly share code, notes, and snippets.

@Beasta
Last active September 29, 2021 07:44
Show Gist options
  • Save Beasta/6b0649125cd138ab7c7c11764689111e to your computer and use it in GitHub Desktop.
Save Beasta/6b0649125cd138ab7c7c11764689111e to your computer and use it in GitHub Desktop.
Simple script for retrieving, modifying, and updating zapper.fi wallets. Meant to be run in the console.
////////////////////////////////////////////////////
// zapper.fi
//////////////////////////////////////////////////////
// grab persist:account from localStorage and parse it
let persistAccount = JSON.parse(localStorage.getItem("persist:account"))
Object.keys(persistAccount).forEach(key => {
let value = JSON.parse(persistAccount[key]);
persistAccount[key] = value;
});
//add a test item to the wallet
persistAccount.wallets.push(persistAccount.wallets[0]);
//Stringify the values of the object
Object.keys(persistAccount).forEach(key => {
let stringValue = JSON.stringify(persistAccount[key]);
persistAccount[key] = stringValue;
});
// Stringify the whole thing
persistAccount = JSON.stringify(persistAccount);
// add it back to local storage
localStorage.setItem("persist:account", persistAccount);
@Beasta
Copy link
Author

Beasta commented Sep 29, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment