UNPKG

@etherspot/remote-signer

Version:

Etherspot Permissioned Signer SDK - signs the UserOp with SessionKey and sends it to the Bundler

34 lines (32 loc) 687 B
import { resolveProperties } from "./chunk-M6FK2HC2.mjs"; import { toHex } from "./chunk-VPBLFL5G.mjs"; // src/sdk/common/OperationUtils.ts function toJSON(op) { return resolveProperties(op).then( (userOp) => Object.keys(userOp).map((key) => { let val = userOp[key]; if (typeof val !== "string" || !val.startsWith("0x")) { val = toHex(val); } return [key, val]; }).reduce( (set, [k, v]) => ({ ...set, [k]: v }), {} ) ); } async function printOp(op) { return toJSON(op).then((userOp) => JSON.stringify(userOp, null, 2)); } export { toJSON, printOp }; //# sourceMappingURL=chunk-6SBJA5IO.mjs.map