forked from onflow/nft-catalog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
33 lines (28 loc) · 1022 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const json = require("./lib/CadenceToJson.json");
export { json };
import contracts from "./lib/cadut-generated/contracts/index.js";
import scripts from "./lib/cadut-generated/scripts/index.js";
import transactions from "./lib/cadut-generated/transactions/index.js";
import {
setEnvironment,
getEnvironment,
extendEnvironment,
} from "@onflow/flow-cadut";
let contractNames = Object.keys(json.vars["testnet"]);
for (let index in contractNames) {
const contractName = contractNames[index];
extendEnvironment({
name: contractName.replace("0x", ""),
testnet: json.vars["testnet"][contractName],
mainnet: json.vars["mainnet"][contractName],
});
}
const getAddressMaps = async function () {
const addressMaps = {};
setEnvironment("mainnet");
addressMaps["mainnet"] = await getEnvironment();
setEnvironment("testnet");
addressMaps["testnet"] = await getEnvironment();
return addressMaps;
};
export { getAddressMaps, contracts, scripts, transactions };