Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

v1.0.9: Fix API Initialization #241

Merged
merged 2 commits into from
Jul 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dydxprotocol/perpetual",
"version": "1.0.8",
"version": "1.0.9",
"description": "Ethereum Smart Contracts and TypeScript library used for the dYdX Perpetual Contracts",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
4 changes: 3 additions & 1 deletion src/Perpetual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,17 @@ export class Perpetual {
this.operator = new Operator(this.contracts);
this.token = new Token(this.contracts);
this.weth = new Weth(this.contracts);
this.api = new Api(this.orders, options.apiOptions);

// Use different Orders module depending on if the market is a linear or inverse perpetual.
if (this.isInverse()) {
this.orders = new InverseOrders(this.contracts, this.web3);
} else {
this.orders = new Orders(this.contracts, this.web3);
}

// Client modules that rely on this.orders.
this.trade = new Trade(this.contracts, this.orders);
this.api = new Api(this.orders, options.apiOptions);

if (options.accounts) {
options.accounts.forEach(a => this.loadAccount(a));
Expand Down