@taquito/sapling 24.3.0-beta.2 → 24.3.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,39 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- const fs = require("fs")
3
-
4
- const ZCASH_DOWNLOAD_URL = 'https://download.z.cash/downloads';
5
- const ZCASH_SPEND_PARAMS_FILE_NAME = 'sapling-spend.params';
6
- const ZCASH_OUTPUT_PARAMS_FILE_NAME = 'sapling-output.params';
7
- const SPEND_PARAMS = 'saplingSpendParams';
8
- const OUTPUT_PARAMS = 'saplingOutputParams';
9
-
10
- async function fetchSaplingParams(url, name) {
11
- const response = await fetch(`${ZCASH_DOWNLOAD_URL}/${url}`);
12
- const arrBuff = await response.arrayBuffer();
13
- const buff = Buffer.from(arrBuff);
14
-
15
- fs.writeFile(`${name}.js`, `
16
- (function (root, factory) {
17
- if (typeof define === 'function' && define.amd) {
18
- // AMD Module
19
- define([], factory);
20
- } else if (typeof module === 'object' && module.exports) {
21
- // Node Module
22
- module.exports = factory();
23
- } else {
24
- // Browser Global
25
- root.returnExports = factory();
26
- }
27
- }(this, function () {
28
- return {
29
- "${name}": "${buff.toString('base64')}"
30
- };
31
- }));
32
- `, (err) => {
33
- if (err) return console.log(err);
34
- console.log(`The file ${name} has been saved!`);
35
- });
36
- }
37
-
38
- fetchSaplingParams(ZCASH_SPEND_PARAMS_FILE_NAME, SPEND_PARAMS);
39
- fetchSaplingParams(ZCASH_OUTPUT_PARAMS_FILE_NAME, OUTPUT_PARAMS);