Back

Version 5

6/26/2023
let runValAPIAuth = async ({ val, args, handle, privateKey, keys }) => {
let t = Date.now();
let toSign = {
val,
handle: handle.replace("@", ""),
args,
t,
};
if (keys && !privateKey) {
privateKey = await @stevekrouse.importKey(
keys.privateKey,
"privateKey",
);
}
let signature = await @me.btoa(
await @stevekrouse.signECDSA(JSON.stringify(toSign), privateKey),
);
return @stevekrouse.runValAPI(val, ...[...args, {
...toSign,
signature,
}]);
};
Updated: October 31, 2023