From 4dbdb49190db923a3737d94d3bfac7c84645f914 Mon Sep 17 00:00:00 2001 From: Gleb Karavatski Date: Thu, 28 Nov 2024 12:38:08 +0300 Subject: [PATCH] add dotenv comment --- 02-contract/test/deploy.step8.ts | 4 ++++ 02-contract/test/sendIncrement.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/02-contract/test/deploy.step8.ts b/02-contract/test/deploy.step8.ts index db5ba45..7b41c5a 100644 --- a/02-contract/test/deploy.step8.ts +++ b/02-contract/test/deploy.step8.ts @@ -1,3 +1,6 @@ +import dotenv from "dotenv"; +dotenv.config({ path: "../../.env" }); + import * as fs from "fs"; import { mnemonicToWalletKey } from "@ton/crypto"; import { TonClient, Cell, WalletContractV4 } from "@ton/ton"; @@ -20,6 +23,7 @@ export async function run() { } // open wallet v4 (notice the correct wallet version here) + // const mnemonic = process.env.MNEMONIC; // could be used mnemonic from .env file instead const mnemonic = 'table jungle security cargo adjust barrel dance net permit pig soap simple rabbit upgrade unique update firm between deer minor ship thought ride physical'; const key = await mnemonicToWalletKey(mnemonic!.split(" ")); diff --git a/02-contract/test/sendIncrement.ts b/02-contract/test/sendIncrement.ts index b445db5..43bb9be 100644 --- a/02-contract/test/sendIncrement.ts +++ b/02-contract/test/sendIncrement.ts @@ -1,3 +1,6 @@ +import dotenv from "dotenv"; +dotenv.config({ path: "../../.env" }); + import { mnemonicToWalletKey } from "@ton/crypto"; import { TonClient, WalletContractV4, Address } from "@ton/ton"; import Counter from "./counter.step10"; // this is the interface class we just implemented @@ -7,6 +10,7 @@ export async function run() { const client = new TonClient({ endpoint: "https://testnet.toncenter.com/api/v2/jsonRPC", apiKey: "f20ff0043ded8c132d0b4b870e678b4bbab3940788cbb8c8762491935cf3a460" }); // open wallet v4 (notice the correct wallet version here) + // const mnemonic = process.env.MNEMONIC; // could be used mnemonic from .env file instead const mnemonic = 'table jungle security cargo adjust barrel dance net permit pig soap simple rabbit upgrade unique update firm between deer minor ship thought ride physical'; const key = await mnemonicToWalletKey(mnemonic!.split(" "));