sdk-triggerx 0.1.8 → 0.1.10
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.
- package/dist/api/checkTgBalance.js +1 -1
- package/dist/api/jobs.js +1 -1
- package/dist/api/topupTg.js +1 -1
- package/dist/api/withdrawTg.js +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ exports.checkTgBalance = void 0;
|
|
|
7
7
|
const ethers_1 = require("ethers");
|
|
8
8
|
const GasRegistry_json_1 = __importDefault(require("../contracts/abi/GasRegistry.json"));
|
|
9
9
|
const checkTgBalance = async (signer) => {
|
|
10
|
-
const gasRegistryContractAddress = process.env.GAS_REGISTRY_CONTRACT_ADDRESS || '
|
|
10
|
+
const gasRegistryContractAddress = process.env.GAS_REGISTRY_CONTRACT_ADDRESS || '0x204F9278D6BB7714D7A40842423dFd5A27cC1b88';
|
|
11
11
|
if (!gasRegistryContractAddress) {
|
|
12
12
|
throw new Error('GAS_REGISTRY_CONTRACT_ADDRESS is not set in the environment variables');
|
|
13
13
|
}
|
package/dist/api/jobs.js
CHANGED
|
@@ -242,7 +242,7 @@ async function createJob(client, params) {
|
|
|
242
242
|
}
|
|
243
243
|
else {
|
|
244
244
|
// autotopupTG is true, automatically top up
|
|
245
|
-
const requiredTG = Math.ceil(job_cost_prediction
|
|
245
|
+
const requiredTG = Math.ceil(job_cost_prediction); // 1 TG = 0.001 ETH
|
|
246
246
|
await (0, topupTg_1.topupTg)(requiredTG, signer);
|
|
247
247
|
}
|
|
248
248
|
}
|
package/dist/api/topupTg.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.topupTg = void 0;
|
|
|
7
7
|
const ethers_1 = require("ethers");
|
|
8
8
|
const GasRegistry_json_1 = __importDefault(require("../contracts/abi/GasRegistry.json"));
|
|
9
9
|
const topupTg = async (tgAmount, signer) => {
|
|
10
|
-
const gasRegistryContractAddress = process.env.GAS_REGISTRY_CONTRACT_ADDRESS || '
|
|
10
|
+
const gasRegistryContractAddress = process.env.GAS_REGISTRY_CONTRACT_ADDRESS || '0x204F9278D6BB7714D7A40842423dFd5A27cC1b88';
|
|
11
11
|
const contract = new ethers_1.ethers.Contract(gasRegistryContractAddress, GasRegistry_json_1.default, signer);
|
|
12
12
|
// Each TG costs 0.001 ETH, so calculate the ETH required for the given TG amount
|
|
13
13
|
const amountInEth = tgAmount * 0.001;
|
package/dist/api/withdrawTg.js
CHANGED
|
@@ -13,7 +13,7 @@ const GasRegistry_json_1 = __importDefault(require("../contracts/abi/GasRegistry
|
|
|
13
13
|
* @returns The transaction object
|
|
14
14
|
*/
|
|
15
15
|
const withdrawTg = async (signer, amountTG) => {
|
|
16
|
-
const gasRegistryContractAddress = process.env.GAS_REGISTRY_CONTRACT_ADDRESS || '
|
|
16
|
+
const gasRegistryContractAddress = process.env.GAS_REGISTRY_CONTRACT_ADDRESS || '0x204F9278D6BB7714D7A40842423dFd5A27cC1b88';
|
|
17
17
|
if (!gasRegistryContractAddress) {
|
|
18
18
|
throw new Error('GAS_REGISTRY_CONTRACT_ADDRESS is not set in the environment variables');
|
|
19
19
|
}
|