Custom JSON-RPC support

This commit is contained in:
Aleksandr Kraiz
2022-05-19 16:07:35 +04:00
parent b5dc1b0077
commit 0287882be3
2 changed files with 3 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.8.1",
"version": "0.8.2",
"description": "Orion Protocol SDK",
"main": "./lib/esm/index.js",
"module": "./lib/esm/index.js",

View File

@@ -14,6 +14,7 @@ const orionAnalyticsUrl = 'https://trade.orionprotocol.io';
type Options = {
api?: string;
nodeJsonRpc?: string;
services?: {
orionBlockchain?: {
api?: string;
@@ -115,7 +116,7 @@ export default class OrionUnit {
this.chainId = chainId;
this.networkCode = chainInfo.code;
this.provider = new ethers.providers.StaticJsonRpcProvider(customRpc ?? chainInfo.rpc);
this.provider = new ethers.providers.StaticJsonRpcProvider(options?.nodeJsonRpc ?? customRpc ?? chainInfo.rpc);
this.env = env;
this.apiUrl = customApi;