Created
April 16, 2024 22:16
-
-
Save dcts/25918788037d1bc4112ea2e992aff478 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Helper function to download data | |
function downloadObjectAsJson(exportObj: any, exportName: string) { | |
var dataStr = | |
"data:text/json;charset=utf-8," + | |
encodeURIComponent(JSON.stringify(exportObj, null, 2)); | |
var downloadAnchorNode = document.createElement("a"); | |
downloadAnchorNode.setAttribute("href", dataStr); | |
downloadAnchorNode.setAttribute("download", exportName + ".json"); | |
document.body.appendChild(downloadAnchorNode); // required for firefox | |
downloadAnchorNode.click(); | |
downloadAnchorNode.remove(); | |
} | |
// Add this inside where the options are sorted | |
const dict: { [x: string]: string } = {}; | |
newOptions.forEach((option) => { | |
dict[option.address] = option.orderReceiptAddress; | |
}); | |
downloadObjectAsJson(dict, "orderReceiptNftAddresses"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment