quartz/fetchjson/hello-hedera-js-sdk/index.js
2022-02-15 13:48:55 +08:00

19 lines
436 B
JavaScript

const { Client } = require("@hashgraph/sdk");
require("dotenv").config();
async function main() {
const myAccountId = process.env.MY_ACCOUNT_ID
const myPrivateKey = process.env.MY_PRIVATE_KEY
if (myAccountId == null ||
myPrivateKey == null ) {
throw new Error("Environment variables must be present");
}
}
const client = Client.forTestnet();
client.setOperator(myAccountId, myPrivateKey);
// put into async function main() {