Skip to content

Commit 34a72ff

Browse files
authored
Merging the develop branch into the main branch, v5.5.3 (#190)
* Trongrid support (#189)
1 parent 5df7dcf commit 34a72ff

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zkbob-client-js",
3-
"version": "5.5.2",
3+
"version": "5.5.3",
44
"description": "zkBob integration library",
55
"repository": "[email protected]:zkBob/libzkbob-client-js.git",
66
"author": "Dmitry Vdovin <[email protected]>",

src/networks/tron/index.ts

+7
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,16 @@ export class TronNetwork extends MultiRpcManager implements NetworkBackend, RpcM
6464
public setEnabled(enabled: boolean) {
6565
if (enabled) {
6666
if (!this.isEnabled()) {
67+
let optKey;
68+
try {
69+
optKey = (process as any)?.env?.REACT_APP_TRONGRID_API_KEY ??
70+
(window as any)?.REACT_APP_TRONGRID_API_KEY;
71+
} catch(_) {}
72+
6773
this.tronWeb = new TronWeb({
6874
fullHost: this.curRpcUrl(),
6975
privateKey: '01',
76+
headers: optKey ? { 'TRON-PRO-API-KEY': optKey } : undefined,
7077
});
7178
}
7279
} else {

0 commit comments

Comments
 (0)