diff --git a/package-lock.json b/package-lock.json index 3de0ee90..26dd747e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@dydxprotocol/perpetual", - "version": "1.0.8", + "version": "1.0.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1950e44f..4562fb4a 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/Perpetual.ts b/src/Perpetual.ts index 061d8275..6060e83e 100644 --- a/src/Perpetual.ts +++ b/src/Perpetual.ts @@ -107,7 +107,6 @@ 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()) { @@ -115,7 +114,10 @@ export class Perpetual { } 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));