@dydxprotocol/exchange-wrappers
Version:
Collection of exchange wrapper contracts used by the dYdX Protocol
22 lines • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ZeroExV2ExchangeWrapper = void 0;
var BytesHelper_1 = require("../helpers/BytesHelper");
var deployed_json_1 = require("../../migrations/deployed.json");
var ZeroExV2ExchangeWrapper = /** @class */ (function () {
function ZeroExV2ExchangeWrapper(networkId) {
this.networkId = networkId;
}
ZeroExV2ExchangeWrapper.prototype.getAddress = function () {
return deployed_json_1.ZeroExV2ExchangeWrapper[this.networkId.toString()].address;
};
ZeroExV2ExchangeWrapper.prototype.setNetworkId = function (networkId) {
this.networkId = networkId;
};
ZeroExV2ExchangeWrapper.prototype.orderToBytes = function (order) {
return BytesHelper_1.allToBytes(order.makerAddress, order.takerAddress, order.feeRecipientAddress, order.senderAddress, order.makerAssetAmount, order.takerAssetAmount, order.makerFee, order.takerFee, order.expirationTimeSeconds, order.salt, order.signature);
};
return ZeroExV2ExchangeWrapper;
}());
exports.ZeroExV2ExchangeWrapper = ZeroExV2ExchangeWrapper;
//# sourceMappingURL=ZeroExV2ExchangeWrapper.js.map