From 34a72ff79423f8127fac0ced7e6e56a5fb584b94 Mon Sep 17 00:00:00 2001 From: r0wdy1 <103738251+r0wdy1@users.noreply.github.com> Date: Fri, 30 Aug 2024 10:35:49 +0300 Subject: [PATCH] Merging the develop branch into the main branch, v5.5.3 (#190) * Trongrid support (#189) --- package.json | 2 +- src/networks/tron/index.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c93ff0a..9be584f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zkbob-client-js", - "version": "5.5.2", + "version": "5.5.3", "description": "zkBob integration library", "repository": "git@github.com:zkBob/libzkbob-client-js.git", "author": "Dmitry Vdovin ", diff --git a/src/networks/tron/index.ts b/src/networks/tron/index.ts index e805927..06d1191 100644 --- a/src/networks/tron/index.ts +++ b/src/networks/tron/index.ts @@ -64,9 +64,16 @@ export class TronNetwork extends MultiRpcManager implements NetworkBackend, RpcM public setEnabled(enabled: boolean) { if (enabled) { if (!this.isEnabled()) { + let optKey; + try { + optKey = (process as any)?.env?.REACT_APP_TRONGRID_API_KEY ?? + (window as any)?.REACT_APP_TRONGRID_API_KEY; + } catch(_) {} + this.tronWeb = new TronWeb({ fullHost: this.curRpcUrl(), privateKey: '01', + headers: optKey ? { 'TRON-PRO-API-KEY': optKey } : undefined, }); } } else {