sdk-triggerx 0.1.7 → 0.1.9
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/topupTg.js +1 -1
- package/dist/api/withdrawTg.js +1 -1
- package/dist/client.js +2 -3
- package/dist/config.js +2 -5
- 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/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
|
}
|
package/dist/client.js
CHANGED
|
@@ -5,13 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.TriggerXClient = void 0;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
|
-
const config_1 = require("./config");
|
|
9
8
|
class TriggerXClient {
|
|
10
9
|
constructor(apiKey, config) {
|
|
11
10
|
this.apiKey = apiKey; // Initialize the apiKey
|
|
12
|
-
const baseConfig =
|
|
11
|
+
// const baseConfig = getConfig();
|
|
13
12
|
this.client = axios_1.default.create({
|
|
14
|
-
baseURL:
|
|
13
|
+
baseURL: 'https://data.triggerx.network',
|
|
15
14
|
headers: { 'Authorization': `Bearer ${this.apiKey}` }, // Set the API key here
|
|
16
15
|
...config,
|
|
17
16
|
});
|
package/dist/config.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
2
|
+
// import dotenv from 'dotenv';
|
|
3
|
+
// dotenv.config();
|
|
5
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
5
|
exports.getConfig = getConfig;
|
|
7
|
-
const dotenv_1 = __importDefault(require("dotenv"));
|
|
8
|
-
dotenv_1.default.config();
|
|
9
6
|
function getConfig() {
|
|
10
7
|
return {
|
|
11
8
|
apiKey: process.env.API_KEY || '',
|