25 lines
616 B
TypeScript
25 lines
616 B
TypeScript
import { getDECACCDBAddress } from './getDB.ts'
|
|
//import * as dotenv from 'dotenv';
|
|
//dotenv.config();
|
|
import { load } from "https://deno.land/std@0.217.0/dotenv/mod.ts";
|
|
|
|
|
|
async function main() {
|
|
|
|
const env = await load();
|
|
const providerUrl = env["PROVIDER_URL"];
|
|
|
|
if(providerUrl){
|
|
try {
|
|
const ccdbadd: string = await getDECACCDBAddress(providerUrl);
|
|
console.log('Greeting from contract:', ccdbadd);
|
|
} catch (error) {
|
|
console.error('Error:', error);
|
|
}
|
|
} else {
|
|
console.error("couldn't get provider from the .env")
|
|
}
|
|
}
|
|
|
|
main();
|