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.
@@ -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 || '0x85ea3eB894105bD7e7e2A8D34cf66C8E8163CD2a';
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
  }
@@ -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 || '0x85ea3eB894105bD7e7e2A8D34cf66C8E8163CD2a';
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;
@@ -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 || '0x85ea3eB894105bD7e7e2A8D34cf66C8E8163CD2a';
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 = (0, config_1.getConfig)();
11
+ // const baseConfig = getConfig();
13
12
  this.client = axios_1.default.create({
14
- baseURL: config?.baseURL || baseConfig.apiUrl || 'https://data.triggerx.network', //http://localhost:9002 , https://data.triggerx.network
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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 || '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdk-triggerx",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "SDK for interacting with the TriggerX backend and smart contracts.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",