Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public removeOrder(orderHash: string): void {
assert.doesConformToSchema('orderHash', orderHash, schemas.orderHashSchema);
const signedOrder = this._orderByOrderHash[orderHash];
if (signedOrder === undefined) {
return; // noop
}
this._dependentOrderHashesTracker.removeFromDependentOrderHashes(signedOrder);
delete this._orderByOrderHash[orderHash];
this._expirationWatcher.removeOrder(orderHash);
delete this._orderStateByOrderHashCache[orderHash];
}
/**
public async isCancelledAsync(orderHash: string, methodOpts: MethodOpts = {}): Promise {
assert.doesConformToSchema('orderHash', orderHash, schemas.orderHashSchema);
assert.doesConformToSchema('methodOpts', methodOpts, methodOptsSchema);
const callData = {};
const isCancelled = await this._exchangeContract.cancelled.callAsync(
orderHash,
callData,
methodOpts.defaultBlock,
);
return isCancelled;
}
/**
public async getOrderAsync(orderHash: string, requestOpts?: RequestOpts): Promise {
if (requestOpts !== undefined) {
assert.doesConformToSchema('requestOpts', requestOpts, schemas.requestOptsSchema);
}
assert.doesConformToSchema('orderHash', orderHash, schemas.orderHashSchema);
const httpRequestOpts = {
params: requestOpts,
};
const responseJson = await this._requestAsync(`/order/${orderHash}`, HttpRequestType.Get, httpRequestOpts);
const order = relayerResponseJsonParsers.parseAPIOrderJson(responseJson);
return order;
}
/**