Last active
September 29, 2021 07:44
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////// | |
// 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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
similar script but for Frame wallets - https://gist.github.com/Beasta/3eaec00449086128eef36339bff47f68