@polkadot/api-provider
Version:
Transport providers for the API
20 lines (17 loc) • 494 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = send;
// Copyright 2017-2018 @polkadot/api-provider authors & contributors
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
async function send({
requests,
db
}, method, params) {
if (!requests[method]) {
throw new Error(`provider.send: Invalid method '${method}'`);
}
return requests[method](db, params);
}