normalizePxRequest
- normalizePxRequest(pxRequest)
Normalizes a pxRequest – the set of operations a proxy key is being requested for – into a single canonical shape: an array of single-key objects, each fully populated with uses, amount, related, and (when given) auth defaults.
- Arguments:
pxRequest – A string, an array of strings, an object, or an array of objects – see below.
- Return type:
Promise<object[]>
All of the following describe the same request, and all normalize to the same result:
'job.exec';
['job.exec'];
[{ 'job.exec': true }];
const request = { 'job.exec': true };
A component can also specify more detail instead of just true:
const request = {
'bank.account.link.job.new': { amount: null, uses: null, related: null },
};
uses (number|null) - How many times the resulting key can perform this operation.
nullmeans unlimited.amount (BigNumber|null) - For money-related operations, a cap on the total amount. Plain numbers/strings are coerced to
BigNumber.related (any|null) - Restricts the operation to resources related to this value (meaning depends on the operation).
auth (Keystore) - Present when this component needs sign-off from a resource owner other than the identity making the request (see
requestProxyKey()).
The special string '$login' (the default for login()) requests full access, tied to the user’s own identity.