1 | "use strict";
|
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
4 | };
|
5 | Object.defineProperty(exports, "__esModule", { value: true });
|
6 | var bn_js_1 = __importDefault(require("bn.js"));
|
7 | var crypto_utils_1 = require("./crypto-utils");
|
8 | var loom_pb_1 = require("./proto/loom_pb");
|
9 | function unmarshalBigUIntPB(value) {
|
10 | var bytes = value.getValue_asU8();
|
11 | var buf = Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
12 | return new bn_js_1.default(buf, 10, 'be');
|
13 | }
|
14 | exports.unmarshalBigUIntPB = unmarshalBigUIntPB;
|
15 | function marshalBigUIntPB(value) {
|
16 | var buf = value.toArrayLike(Buffer, 'be');
|
17 | var pb = new loom_pb_1.BigUInt();
|
18 | pb.setValue(crypto_utils_1.bufferToProtobufBytes(buf));
|
19 | return pb;
|
20 | }
|
21 | exports.marshalBigUIntPB = marshalBigUIntPB;
|
22 |
|
\ | No newline at end of file |