mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-22 21:59:44 +03:00
Fix docs
This commit is contained in:
10
README.md
10
README.md
@@ -20,9 +20,9 @@ npm i @orionprotocol/sdk
|
|||||||
import { OrionUnit } from "@orionprotocol/sdk";
|
import { OrionUnit } from "@orionprotocol/sdk";
|
||||||
import { Wallet } from "ethers";
|
import { Wallet } from "ethers";
|
||||||
|
|
||||||
const wallet = new Wallet("0x...");
|
|
||||||
// OrionUnit is chain-in-environment abstraction
|
|
||||||
const orionUnit = new OrionUnit("bsc", "production"); // eth, bsc, ftm available
|
const orionUnit = new OrionUnit("bsc", "production"); // eth, bsc, ftm available
|
||||||
|
const wallet = new Wallet("0x...", orionUnit.provider);
|
||||||
|
// OrionUnit is chain-in-environment abstraction
|
||||||
```
|
```
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -136,7 +136,7 @@ import {
|
|||||||
ERC20__factory,
|
ERC20__factory,
|
||||||
OrionGovernance__factory,
|
OrionGovernance__factory,
|
||||||
OrionVoting__factory,
|
OrionVoting__factory,
|
||||||
} from "@orionprotocol/contracts/ethers";
|
} from "@orionprotocol/contracts";
|
||||||
|
|
||||||
const exchangeContract = Exchange__factory.connect(
|
const exchangeContract = Exchange__factory.connect(
|
||||||
exchangeContractAddress,
|
exchangeContractAddress,
|
||||||
@@ -222,7 +222,7 @@ if (placeOrderFetchResult.isErr()) {
|
|||||||
console.error(`URL: ${error.url}, Error: ${error.message}`);
|
console.error(`URL: ${error.url}, Error: ${error.message}`);
|
||||||
break;
|
break;
|
||||||
case "unknownFetchThrow":
|
case "unknownFetchThrow":
|
||||||
console.error("Something wrong happened furing fetching", error.error);
|
console.error("Something wrong happened during fetching", error.error);
|
||||||
break;
|
break;
|
||||||
// ... and 8 errors types more
|
// ... and 8 errors types more
|
||||||
// see src/fetchWithValidation.ts for details
|
// see src/fetchWithValidation.ts for details
|
||||||
@@ -303,7 +303,7 @@ orionUnit.orionAggregator.ws.subscribe(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (balances) console.log("Balance update", balances); // Since this is an update message, the balances only contain the changed assets
|
if (data.balances) console.log("Balance update", data.balances); // Since this is an update message, the balances only contain the changed assets
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user