Skip to content

Commit

Permalink
Merging the develop branch into the main branch, v5.5.3 (#190)
Browse files Browse the repository at this point in the history
* Trongrid support (#189)
  • Loading branch information
r0wdy1 authored Aug 30, 2024
1 parent 5df7dcf commit 34a72ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <voidxnull@gmail.com>",
Expand Down
7 changes: 7 additions & 0 deletions src/networks/tron/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 34a72ff

Please sign in to comment.