* Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. * * A //Quantity// does not have and leading 0 values unless the value is * the literal value `0x0`. This is most commonly used for JSSON-RPC * numeric values.
(value)
| 216 | * numeric values. |
| 217 | */ |
| 218 | function toQuantity(value) { |
| 219 | let result = (0, data_js_1.hexlify)((0, data_js_1.isBytesLike)(value) ? value : toBeArray(value)).substring(2); |
| 220 | while (result.startsWith("0")) { |
| 221 | result = result.substring(1); |
| 222 | } |
| 223 | if (result === "") { |
| 224 | result = "0"; |
| 225 | } |
| 226 | return "0x" + result; |
| 227 | } |
| 228 | exports.toQuantity = toQuantity; |
| 229 | //# sourceMappingURL=maths.js.map |
nothing calls this directly
no test coverage detected