From e9961e77fa9300dd9ca763b2be65c6442d9a3d51 Mon Sep 17 00:00:00 2001 From: Brendan Chou Date: Thu, 30 Jul 2020 11:27:48 -0700 Subject: [PATCH 1/2] fix api --- src/Perpetual.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)); From 46d8ad59bdb680e5af50c72c2c73a56caed90bf4 Mon Sep 17 00:00:00 2001 From: Brendan Chou Date: Thu, 30 Jul 2020 11:27:52 -0700 Subject: [PATCH 2/2] 1.0.9 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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",