How to use the @waves/waves-transactions.crypto.base64Encode function in @waves/waves-transactions

To help you get started, we’ve selected a few @waves/waves-transactions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wavesplatform / WavesGUI / src / modules / utils / modals / exportAccounts / ExportAccounts.js View on Github external
encryptSeed(stringifyUsers, this.password, 10000);

                const saveData = {
                    encrypted: this.needPassword,
                    encryptionRounds: this.needPassword ? 10000 : undefined,
                    saveUsers
                };

                const dataToSaveInBytes = crypto.stringToBytes(JSON.stringify(saveData));

                saveData.hashSum = crypto.base58Encode(crypto.sha256(dataToSaveInBytes));

                const toSave = {
                    type: 'wavesBackup',
                    lastOpenVersion: this.settings.lastOpenVersion,
                    data: crypto.base64Encode(crypto.stringToBytes(JSON.stringify(saveData))),
                    checkSum: saveData.hashSum,
                    time: Date.now()
                };

                utils.downloadFile(`accountsBackup-${toSave.time}.json`, JSON.stringify(toSave, null, 4));
            }