Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
assert.isETHAddressHex(`settings.FEE_RECIPIENTS[${i}].ADDRESS`, feeRecipient.ADDRESS);
assert.isString(`settings.FEE_RECIPIENTS[${i}].PRIVATE_KEY`, feeRecipient.PRIVATE_KEY);
const PLACEHOLDER = 'FILL_ME_IN';
if (feeRecipient.ADDRESS === PLACEHOLDER || feeRecipient.PRIVATE_KEY === PLACEHOLDER) {
throw new Error(
`Found placeholder value '${PLACEHOLDER}' in FEE_RECIPIENTS configs. Please replace with actual values.`,
);
}
const recoveredAddress = utils.getAddressFromPrivateKey(feeRecipient.PRIVATE_KEY);
if (recoveredAddress !== feeRecipient.ADDRESS) {
throw new Error(
`FeeRecipientAddress ${feeRecipient.ADDRESS} does not correspond to the private key ${feeRecipient.PRIVATE_KEY}`,
);
}
});
assert.isUri('settings.RPC_URL', settings.RPC_URL);
});
}
constructor(opts: SRAWebsocketOrderProviderOpts, orderStore: OrderStore) {
super(orderStore, opts.httpEndpoint, PER_PAGE_DEFAULT);
assert.isUri('websocketEndpoint', opts.websocketEndpoint);
this._websocketEndpoint = opts.websocketEndpoint;
}
isValidOrderSource(variableName: string, orderSource: string | SignedOrder[]): void {
if (_.isString(orderSource)) {
sharedAssert.isUri(variableName, orderSource);
return;
}
sharedAssert.doesConformToSchema(variableName, orderSource, schemas.signedOrdersSchema);
},
areValidAssetDatas(variableName: string, assetDatas: string[]): void {