koilib 4.1.2 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -11
- package/dist/koinos.js +1099 -543
- package/dist/koinos.min.js +1 -1
- package/lib/Contract.d.ts +2 -0
- package/lib/Contract.js +36 -30
- package/lib/Contract.js.map +1 -1
- package/lib/Provider.d.ts +17 -5
- package/lib/Provider.js +33 -14
- package/lib/Provider.js.map +1 -1
- package/lib/Serializer.js +2 -0
- package/lib/Serializer.js.map +1 -1
- package/lib/Signer.d.ts +14 -9
- package/lib/Signer.js +23 -10
- package/lib/Signer.js.map +1 -1
- package/lib/browser/Contract.d.ts +2 -0
- package/lib/browser/Contract.js +36 -30
- package/lib/browser/Contract.js.map +1 -1
- package/lib/browser/Provider.d.ts +17 -5
- package/lib/browser/Provider.js +33 -14
- package/lib/browser/Provider.js.map +1 -1
- package/lib/browser/Serializer.js +2 -0
- package/lib/browser/Serializer.js.map +1 -1
- package/lib/browser/Signer.d.ts +14 -9
- package/lib/browser/Signer.js +23 -10
- package/lib/browser/Signer.js.map +1 -1
- package/lib/browser/index.js +5 -1
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/index2.js +5 -1
- package/lib/browser/index2.js.map +1 -1
- package/lib/browser/indexUtils.js +5 -1
- package/lib/browser/indexUtils.js.map +1 -1
- package/lib/browser/interface.d.ts +68 -3
- package/lib/browser/jsonDescriptors/chain-proto.json +50 -0
- package/lib/browser/jsonDescriptors/token-proto.json +37 -8
- package/lib/browser/protoModules/protocol-proto.js +518 -201
- package/lib/browser/protoModules/protocol-proto.js.map +1 -1
- package/lib/browser/utils.js +5 -1
- package/lib/browser/utils.js.map +1 -1
- package/lib/browser/utilsNode.d.ts +50 -0
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/lib/index2.js +5 -1
- package/lib/index2.js.map +1 -1
- package/lib/indexUtils.js +5 -1
- package/lib/indexUtils.js.map +1 -1
- package/lib/interface.d.ts +68 -3
- package/lib/jsonDescriptors/chain-proto.json +50 -0
- package/lib/jsonDescriptors/token-proto.json +37 -8
- package/lib/protoModules/protocol-proto.js +518 -201
- package/lib/protoModules/protocol-proto.js.map +1 -1
- package/lib/utils.js +5 -1
- package/lib/utils.js.map +1 -1
- package/lib/utilsNode.d.ts +50 -0
- package/package.json +29 -28
package/dist/koinos.js
CHANGED
|
@@ -132,6 +132,65 @@ function base (ALPHABET) {
|
|
|
132
132
|
module.exports = base
|
|
133
133
|
|
|
134
134
|
|
|
135
|
+
/***/ }),
|
|
136
|
+
|
|
137
|
+
/***/ 7320:
|
|
138
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
139
|
+
|
|
140
|
+
"use strict";
|
|
141
|
+
|
|
142
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
143
|
+
exports.output = exports.exists = exports.hash = exports.bytes = exports.bool = exports.number = void 0;
|
|
144
|
+
function number(n) {
|
|
145
|
+
if (!Number.isSafeInteger(n) || n < 0)
|
|
146
|
+
throw new Error(`Wrong positive integer: ${n}`);
|
|
147
|
+
}
|
|
148
|
+
exports.number = number;
|
|
149
|
+
function bool(b) {
|
|
150
|
+
if (typeof b !== 'boolean')
|
|
151
|
+
throw new Error(`Expected boolean, not ${b}`);
|
|
152
|
+
}
|
|
153
|
+
exports.bool = bool;
|
|
154
|
+
function bytes(b, ...lengths) {
|
|
155
|
+
if (!(b instanceof Uint8Array))
|
|
156
|
+
throw new TypeError('Expected Uint8Array');
|
|
157
|
+
if (lengths.length > 0 && !lengths.includes(b.length))
|
|
158
|
+
throw new TypeError(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);
|
|
159
|
+
}
|
|
160
|
+
exports.bytes = bytes;
|
|
161
|
+
function hash(hash) {
|
|
162
|
+
if (typeof hash !== 'function' || typeof hash.create !== 'function')
|
|
163
|
+
throw new Error('Hash should be wrapped by utils.wrapConstructor');
|
|
164
|
+
number(hash.outputLen);
|
|
165
|
+
number(hash.blockLen);
|
|
166
|
+
}
|
|
167
|
+
exports.hash = hash;
|
|
168
|
+
function exists(instance, checkFinished = true) {
|
|
169
|
+
if (instance.destroyed)
|
|
170
|
+
throw new Error('Hash instance has been destroyed');
|
|
171
|
+
if (checkFinished && instance.finished)
|
|
172
|
+
throw new Error('Hash#digest() has already been called');
|
|
173
|
+
}
|
|
174
|
+
exports.exists = exists;
|
|
175
|
+
function output(out, instance) {
|
|
176
|
+
bytes(out);
|
|
177
|
+
const min = instance.outputLen;
|
|
178
|
+
if (out.length < min) {
|
|
179
|
+
throw new Error(`digestInto() expects output buffer of length at least ${min}`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
exports.output = output;
|
|
183
|
+
const assert = {
|
|
184
|
+
number,
|
|
185
|
+
bool,
|
|
186
|
+
bytes,
|
|
187
|
+
hash,
|
|
188
|
+
exists,
|
|
189
|
+
output,
|
|
190
|
+
};
|
|
191
|
+
exports["default"] = assert;
|
|
192
|
+
|
|
193
|
+
|
|
135
194
|
/***/ }),
|
|
136
195
|
|
|
137
196
|
/***/ 7505:
|
|
@@ -141,6 +200,7 @@ module.exports = base
|
|
|
141
200
|
|
|
142
201
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
143
202
|
exports.SHA2 = void 0;
|
|
203
|
+
const _assert_js_1 = __webpack_require__(7320);
|
|
144
204
|
const utils_js_1 = __webpack_require__(8089);
|
|
145
205
|
// Polyfill for Safari 14
|
|
146
206
|
function setBigUint64(view, byteOffset, value, isLE) {
|
|
@@ -171,11 +231,8 @@ class SHA2 extends utils_js_1.Hash {
|
|
|
171
231
|
this.view = (0, utils_js_1.createView)(this.buffer);
|
|
172
232
|
}
|
|
173
233
|
update(data) {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
const { view, buffer, blockLen, finished } = this;
|
|
177
|
-
if (finished)
|
|
178
|
-
throw new Error('digest() was already called');
|
|
234
|
+
_assert_js_1.default.exists(this);
|
|
235
|
+
const { view, buffer, blockLen } = this;
|
|
179
236
|
data = (0, utils_js_1.toBytes)(data);
|
|
180
237
|
const len = data.length;
|
|
181
238
|
for (let pos = 0; pos < len;) {
|
|
@@ -200,12 +257,8 @@ class SHA2 extends utils_js_1.Hash {
|
|
|
200
257
|
return this;
|
|
201
258
|
}
|
|
202
259
|
digestInto(out) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
if (!(out instanceof Uint8Array) || out.length < this.outputLen)
|
|
206
|
-
throw new Error('_Sha2: Invalid output buffer');
|
|
207
|
-
if (this.finished)
|
|
208
|
-
throw new Error('digest() was already called');
|
|
260
|
+
_assert_js_1.default.exists(this);
|
|
261
|
+
_assert_js_1.default.output(out, this);
|
|
209
262
|
this.finished = true;
|
|
210
263
|
// Padding
|
|
211
264
|
// We can avoid allocation of buffer for padding completely if it
|
|
@@ -223,9 +276,9 @@ class SHA2 extends utils_js_1.Hash {
|
|
|
223
276
|
// Pad until full block byte with zeros
|
|
224
277
|
for (let i = pos; i < blockLen; i++)
|
|
225
278
|
buffer[i] = 0;
|
|
226
|
-
//
|
|
279
|
+
// Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that
|
|
227
280
|
// You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.
|
|
228
|
-
// So we just write lowest
|
|
281
|
+
// So we just write lowest 64 bits of that value.
|
|
229
282
|
setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);
|
|
230
283
|
this.process(view, 0);
|
|
231
284
|
const oview = (0, utils_js_1.createView)(out);
|
|
@@ -501,14 +554,13 @@ exports.sha256 = (0, utils_js_1.wrapConstructor)(() => new SHA256());
|
|
|
501
554
|
/***/ }),
|
|
502
555
|
|
|
503
556
|
/***/ 8089:
|
|
504
|
-
/***/ ((
|
|
557
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
505
558
|
|
|
506
559
|
"use strict";
|
|
507
|
-
/* module decorator */ module = __webpack_require__.nmd(module);
|
|
508
560
|
|
|
509
561
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
510
562
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
511
|
-
exports.randomBytes = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.checkOpts = exports.Hash = exports.
|
|
563
|
+
exports.randomBytes = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.checkOpts = exports.Hash = exports.concatBytes = exports.toBytes = exports.utf8ToBytes = exports.asyncLoop = exports.nextTick = exports.hexToBytes = exports.bytesToHex = exports.isLE = exports.rotr = exports.createView = exports.u32 = exports.u8 = void 0;
|
|
512
564
|
// The import here is via the package name. This is to ensure
|
|
513
565
|
// that exports mapping/resolution does fall into place.
|
|
514
566
|
const crypto_1 = __webpack_require__(4421);
|
|
@@ -524,7 +576,7 @@ exports.createView = createView;
|
|
|
524
576
|
const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);
|
|
525
577
|
exports.rotr = rotr;
|
|
526
578
|
exports.isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;
|
|
527
|
-
// There is almost no big endian hardware, but js typed arrays uses platform specific
|
|
579
|
+
// There is almost no big endian hardware, but js typed arrays uses platform specific endianness.
|
|
528
580
|
// So, just to be sure not to corrupt anything.
|
|
529
581
|
if (!exports.isLE)
|
|
530
582
|
throw new Error('Non little-endian hardware is not supported');
|
|
@@ -534,6 +586,8 @@ const hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '
|
|
|
534
586
|
*/
|
|
535
587
|
function bytesToHex(uint8a) {
|
|
536
588
|
// pre-caching improves the speed 6x
|
|
589
|
+
if (!(uint8a instanceof Uint8Array))
|
|
590
|
+
throw new Error('Uint8Array expected');
|
|
537
591
|
let hex = '';
|
|
538
592
|
for (let i = 0; i < uint8a.length; i++) {
|
|
539
593
|
hex += hexes[uint8a[i]];
|
|
@@ -555,28 +609,17 @@ function hexToBytes(hex) {
|
|
|
555
609
|
const j = i * 2;
|
|
556
610
|
const hexByte = hex.slice(j, j + 2);
|
|
557
611
|
const byte = Number.parseInt(hexByte, 16);
|
|
558
|
-
if (Number.isNaN(byte))
|
|
612
|
+
if (Number.isNaN(byte) || byte < 0)
|
|
559
613
|
throw new Error('Invalid byte sequence');
|
|
560
614
|
array[i] = byte;
|
|
561
615
|
}
|
|
562
616
|
return array;
|
|
563
617
|
}
|
|
564
618
|
exports.hexToBytes = hexToBytes;
|
|
565
|
-
//
|
|
566
|
-
//
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
typeof module.require === 'function' &&
|
|
570
|
-
module.require.bind(module);
|
|
571
|
-
try {
|
|
572
|
-
if (nodeRequire) {
|
|
573
|
-
const { setImmediate } = nodeRequire('timers');
|
|
574
|
-
return () => new Promise((resolve) => setImmediate(resolve));
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
catch (e) { }
|
|
578
|
-
return () => new Promise((resolve) => setTimeout(resolve, 0));
|
|
579
|
-
})();
|
|
619
|
+
// There is no setImmediate in browser and setTimeout is slow. However, call to async function will return Promise
|
|
620
|
+
// which will be fullfiled only on next scheduler queue processing step and this is exactly what we need.
|
|
621
|
+
const nextTick = async () => { };
|
|
622
|
+
exports.nextTick = nextTick;
|
|
580
623
|
// Returns control to thread each 'tick' ms to avoid blocking
|
|
581
624
|
async function asyncLoop(iters, tick, cb) {
|
|
582
625
|
let ts = Date.now();
|
|
@@ -625,31 +668,6 @@ function concatBytes(...arrays) {
|
|
|
625
668
|
return result;
|
|
626
669
|
}
|
|
627
670
|
exports.concatBytes = concatBytes;
|
|
628
|
-
function assertNumber(n) {
|
|
629
|
-
if (!Number.isSafeInteger(n) || n < 0)
|
|
630
|
-
throw new Error(`Wrong positive integer: ${n}`);
|
|
631
|
-
}
|
|
632
|
-
exports.assertNumber = assertNumber;
|
|
633
|
-
function assertBool(b) {
|
|
634
|
-
if (typeof b !== 'boolean') {
|
|
635
|
-
throw new Error(`Expected boolean, not ${b}`);
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
exports.assertBool = assertBool;
|
|
639
|
-
function assertBytes(bytes, ...lengths) {
|
|
640
|
-
if (bytes instanceof Uint8Array && (!lengths.length || lengths.includes(bytes.length))) {
|
|
641
|
-
return;
|
|
642
|
-
}
|
|
643
|
-
throw new TypeError(`Expected ${lengths} bytes, not ${typeof bytes} with length=${bytes.length}`);
|
|
644
|
-
}
|
|
645
|
-
exports.assertBytes = assertBytes;
|
|
646
|
-
function assertHash(hash) {
|
|
647
|
-
if (typeof hash !== 'function' || typeof hash.create !== 'function')
|
|
648
|
-
throw new Error('Hash should be wrapped by utils.wrapConstructor');
|
|
649
|
-
assertNumber(hash.outputLen);
|
|
650
|
-
assertNumber(hash.blockLen);
|
|
651
|
-
}
|
|
652
|
-
exports.assertHash = assertHash;
|
|
653
671
|
// For runtime check if class implements interface
|
|
654
672
|
class Hash {
|
|
655
673
|
// Safe version that clones internal state
|
|
@@ -660,11 +678,11 @@ class Hash {
|
|
|
660
678
|
exports.Hash = Hash;
|
|
661
679
|
// Check if object doens't have custom constructor (like Uint8Array/Array)
|
|
662
680
|
const isPlainObject = (obj) => Object.prototype.toString.call(obj) === '[object Object]' && obj.constructor === Object;
|
|
663
|
-
function checkOpts(
|
|
664
|
-
if (
|
|
681
|
+
function checkOpts(defaults, opts) {
|
|
682
|
+
if (opts !== undefined && (typeof opts !== 'object' || !isPlainObject(opts)))
|
|
665
683
|
throw new TypeError('Options should be object or undefined');
|
|
666
|
-
const
|
|
667
|
-
return
|
|
684
|
+
const merged = Object.assign(defaults, opts);
|
|
685
|
+
return merged;
|
|
668
686
|
}
|
|
669
687
|
exports.checkOpts = checkOpts;
|
|
670
688
|
function wrapConstructor(hashConstructor) {
|
|
@@ -705,17 +723,14 @@ exports.randomBytes = randomBytes;
|
|
|
705
723
|
/***/ }),
|
|
706
724
|
|
|
707
725
|
/***/ 9656:
|
|
708
|
-
/***/ (
|
|
726
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
709
727
|
|
|
710
728
|
"use strict";
|
|
711
729
|
|
|
712
730
|
/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */
|
|
713
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
714
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
715
|
-
};
|
|
716
731
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
717
732
|
exports.utils = exports.schnorr = exports.verify = exports.signSync = exports.sign = exports.getSharedSecret = exports.recoverPublicKey = exports.getPublicKey = exports.Signature = exports.Point = exports.CURVE = void 0;
|
|
718
|
-
const
|
|
733
|
+
const nodeCrypto = __webpack_require__(9159);
|
|
719
734
|
const _0n = BigInt(0);
|
|
720
735
|
const _1n = BigInt(1);
|
|
721
736
|
const _2n = BigInt(2);
|
|
@@ -760,25 +775,27 @@ class JacobianPoint {
|
|
|
760
775
|
return JacobianPoint.toAffineBatch(points).map(JacobianPoint.fromAffine);
|
|
761
776
|
}
|
|
762
777
|
equals(other) {
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
const
|
|
766
|
-
const
|
|
767
|
-
const
|
|
768
|
-
const
|
|
769
|
-
|
|
778
|
+
if (!(other instanceof JacobianPoint))
|
|
779
|
+
throw new TypeError('JacobianPoint expected');
|
|
780
|
+
const { x: X1, y: Y1, z: Z1 } = this;
|
|
781
|
+
const { x: X2, y: Y2, z: Z2 } = other;
|
|
782
|
+
const Z1Z1 = mod(Z1 ** _2n);
|
|
783
|
+
const Z2Z2 = mod(Z2 ** _2n);
|
|
784
|
+
const U1 = mod(X1 * Z2Z2);
|
|
785
|
+
const U2 = mod(X2 * Z1Z1);
|
|
786
|
+
const S1 = mod(mod(Y1 * Z2) * Z2Z2);
|
|
787
|
+
const S2 = mod(mod(Y2 * Z1) * Z1Z1);
|
|
788
|
+
return U1 === U2 && S1 === S2;
|
|
770
789
|
}
|
|
771
790
|
negate() {
|
|
772
791
|
return new JacobianPoint(this.x, mod(-this.y), this.z);
|
|
773
792
|
}
|
|
774
793
|
double() {
|
|
775
|
-
const X1 = this
|
|
776
|
-
const Y1 = this.y;
|
|
777
|
-
const Z1 = this.z;
|
|
794
|
+
const { x: X1, y: Y1, z: Z1 } = this;
|
|
778
795
|
const A = mod(X1 ** _2n);
|
|
779
796
|
const B = mod(Y1 ** _2n);
|
|
780
797
|
const C = mod(B ** _2n);
|
|
781
|
-
const D = mod(_2n * (mod(
|
|
798
|
+
const D = mod(_2n * (mod((X1 + B) ** _2n) - A - C));
|
|
782
799
|
const E = mod(_3n * A);
|
|
783
800
|
const F = mod(E ** _2n);
|
|
784
801
|
const X3 = mod(F - _2n * D);
|
|
@@ -787,15 +804,10 @@ class JacobianPoint {
|
|
|
787
804
|
return new JacobianPoint(X3, Y3, Z3);
|
|
788
805
|
}
|
|
789
806
|
add(other) {
|
|
790
|
-
if (!(other instanceof JacobianPoint))
|
|
791
|
-
throw new TypeError('JacobianPoint
|
|
792
|
-
}
|
|
793
|
-
const
|
|
794
|
-
const Y1 = this.y;
|
|
795
|
-
const Z1 = this.z;
|
|
796
|
-
const X2 = other.x;
|
|
797
|
-
const Y2 = other.y;
|
|
798
|
-
const Z2 = other.z;
|
|
807
|
+
if (!(other instanceof JacobianPoint))
|
|
808
|
+
throw new TypeError('JacobianPoint expected');
|
|
809
|
+
const { x: X1, y: Y1, z: Z1 } = this;
|
|
810
|
+
const { x: X2, y: Y2, z: Z2 } = other;
|
|
799
811
|
if (X2 === _0n || Y2 === _0n)
|
|
800
812
|
return this;
|
|
801
813
|
if (X1 === _0n || Y1 === _0n)
|
|
@@ -804,7 +816,7 @@ class JacobianPoint {
|
|
|
804
816
|
const Z2Z2 = mod(Z2 ** _2n);
|
|
805
817
|
const U1 = mod(X1 * Z2Z2);
|
|
806
818
|
const U2 = mod(X2 * Z1Z1);
|
|
807
|
-
const S1 = mod(Y1 * Z2 * Z2Z2);
|
|
819
|
+
const S1 = mod(mod(Y1 * Z2) * Z2Z2);
|
|
808
820
|
const S2 = mod(mod(Y2 * Z1) * Z1Z1);
|
|
809
821
|
const H = mod(U2 - U1);
|
|
810
822
|
const r = mod(S2 - S1);
|
|
@@ -828,9 +840,14 @@ class JacobianPoint {
|
|
|
828
840
|
return this.add(other.negate());
|
|
829
841
|
}
|
|
830
842
|
multiplyUnsafe(scalar) {
|
|
843
|
+
const P0 = JacobianPoint.ZERO;
|
|
844
|
+
if (typeof scalar === 'bigint' && scalar === _0n)
|
|
845
|
+
return P0;
|
|
831
846
|
let n = normalizeScalar(scalar);
|
|
847
|
+
if (n === _1n)
|
|
848
|
+
return this;
|
|
832
849
|
if (!USE_ENDOMORPHISM) {
|
|
833
|
-
let p =
|
|
850
|
+
let p = P0;
|
|
834
851
|
let d = this;
|
|
835
852
|
while (n > _0n) {
|
|
836
853
|
if (n & _1n)
|
|
@@ -841,8 +858,8 @@ class JacobianPoint {
|
|
|
841
858
|
return p;
|
|
842
859
|
}
|
|
843
860
|
let { k1neg, k1, k2neg, k2 } = splitScalarEndo(n);
|
|
844
|
-
let k1p =
|
|
845
|
-
let k2p =
|
|
861
|
+
let k1p = P0;
|
|
862
|
+
let k2p = P0;
|
|
846
863
|
let d = this;
|
|
847
864
|
while (k1 > _0n || k2 > _0n) {
|
|
848
865
|
if (k1 & _1n)
|
|
@@ -893,7 +910,7 @@ class JacobianPoint {
|
|
|
893
910
|
}
|
|
894
911
|
let p = JacobianPoint.ZERO;
|
|
895
912
|
let f = JacobianPoint.ZERO;
|
|
896
|
-
const windows = USE_ENDOMORPHISM ? 128 / W
|
|
913
|
+
const windows = 1 + (USE_ENDOMORPHISM ? 128 / W : 256 / W);
|
|
897
914
|
const windowSize = 2 ** (W - 1);
|
|
898
915
|
const mask = BigInt(2 ** W - 1);
|
|
899
916
|
const maxNumber = 2 ** W;
|
|
@@ -926,7 +943,7 @@ class JacobianPoint {
|
|
|
926
943
|
let point;
|
|
927
944
|
let fake;
|
|
928
945
|
if (USE_ENDOMORPHISM) {
|
|
929
|
-
|
|
946
|
+
const { k1neg, k1, k2neg, k2 } = splitScalarEndo(n);
|
|
930
947
|
let { p: k1p, f: f1p } = this.wNAF(k1, affinePoint);
|
|
931
948
|
let { p: k2p, f: f2p } = this.wNAF(k2, affinePoint);
|
|
932
949
|
if (k1neg)
|
|
@@ -938,17 +955,23 @@ class JacobianPoint {
|
|
|
938
955
|
fake = f1p.add(f2p);
|
|
939
956
|
}
|
|
940
957
|
else {
|
|
941
|
-
|
|
958
|
+
const { p, f } = this.wNAF(n, affinePoint);
|
|
942
959
|
point = p;
|
|
943
960
|
fake = f;
|
|
944
961
|
}
|
|
945
962
|
return JacobianPoint.normalizeZ([point, fake])[0];
|
|
946
963
|
}
|
|
947
964
|
toAffine(invZ = invert(this.z)) {
|
|
948
|
-
const
|
|
949
|
-
const
|
|
950
|
-
const
|
|
951
|
-
|
|
965
|
+
const { x, y, z } = this;
|
|
966
|
+
const iz1 = invZ;
|
|
967
|
+
const iz2 = mod(iz1 * iz1);
|
|
968
|
+
const iz3 = mod(iz2 * iz1);
|
|
969
|
+
const ax = mod(x * iz2);
|
|
970
|
+
const ay = mod(y * iz3);
|
|
971
|
+
const zz = mod(z * iz1);
|
|
972
|
+
if (zz !== _1n)
|
|
973
|
+
throw new Error('invZ was invalid');
|
|
974
|
+
return new Point(ax, ay);
|
|
952
975
|
}
|
|
953
976
|
}
|
|
954
977
|
JacobianPoint.BASE = new JacobianPoint(CURVE.Gx, CURVE.Gy, _1n);
|
|
@@ -965,7 +988,9 @@ class Point {
|
|
|
965
988
|
}
|
|
966
989
|
static fromCompressedHex(bytes) {
|
|
967
990
|
const isShort = bytes.length === 32;
|
|
968
|
-
const x = bytesToNumber(isShort ? bytes : bytes.
|
|
991
|
+
const x = bytesToNumber(isShort ? bytes : bytes.subarray(1));
|
|
992
|
+
if (!isValidFieldElement(x))
|
|
993
|
+
throw new Error('Point is not on curve');
|
|
969
994
|
const y2 = weistrass(x);
|
|
970
995
|
let y = sqrtMod(y2);
|
|
971
996
|
const isYOdd = (y & _1n) === _1n;
|
|
@@ -983,52 +1008,56 @@ class Point {
|
|
|
983
1008
|
return point;
|
|
984
1009
|
}
|
|
985
1010
|
static fromUncompressedHex(bytes) {
|
|
986
|
-
const x = bytesToNumber(bytes.
|
|
987
|
-
const y = bytesToNumber(bytes.
|
|
1011
|
+
const x = bytesToNumber(bytes.subarray(1, 33));
|
|
1012
|
+
const y = bytesToNumber(bytes.subarray(33, 65));
|
|
988
1013
|
const point = new Point(x, y);
|
|
989
1014
|
point.assertValidity();
|
|
990
1015
|
return point;
|
|
991
1016
|
}
|
|
992
1017
|
static fromHex(hex) {
|
|
993
1018
|
const bytes = ensureBytes(hex);
|
|
1019
|
+
const len = bytes.length;
|
|
994
1020
|
const header = bytes[0];
|
|
995
|
-
if (
|
|
1021
|
+
if (len === 32 || (len === 33 && (header === 0x02 || header === 0x03))) {
|
|
996
1022
|
return this.fromCompressedHex(bytes);
|
|
997
1023
|
}
|
|
998
|
-
if (
|
|
1024
|
+
if (len === 65 && header === 0x04)
|
|
999
1025
|
return this.fromUncompressedHex(bytes);
|
|
1000
|
-
throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${
|
|
1026
|
+
throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${len}`);
|
|
1001
1027
|
}
|
|
1002
1028
|
static fromPrivateKey(privateKey) {
|
|
1003
1029
|
return Point.BASE.multiply(normalizePrivateKey(privateKey));
|
|
1004
1030
|
}
|
|
1005
1031
|
static fromSignature(msgHash, signature, recovery) {
|
|
1006
|
-
|
|
1007
|
-
const
|
|
1008
|
-
const { r, s } =
|
|
1032
|
+
msgHash = ensureBytes(msgHash);
|
|
1033
|
+
const h = truncateHash(msgHash);
|
|
1034
|
+
const { r, s } = normalizeSignature(signature);
|
|
1009
1035
|
if (recovery !== 0 && recovery !== 1) {
|
|
1010
1036
|
throw new Error('Cannot recover signature: invalid recovery bit');
|
|
1011
1037
|
}
|
|
1012
|
-
const prefix =
|
|
1013
|
-
const
|
|
1014
|
-
const
|
|
1015
|
-
const
|
|
1016
|
-
const
|
|
1017
|
-
const
|
|
1018
|
-
const
|
|
1019
|
-
|
|
1020
|
-
|
|
1038
|
+
const prefix = recovery & 1 ? '03' : '02';
|
|
1039
|
+
const R = Point.fromHex(prefix + numTo32bStr(r));
|
|
1040
|
+
const { n } = CURVE;
|
|
1041
|
+
const rinv = invert(r, n);
|
|
1042
|
+
const u1 = mod(-h * rinv, n);
|
|
1043
|
+
const u2 = mod(s * rinv, n);
|
|
1044
|
+
const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2);
|
|
1045
|
+
if (!Q)
|
|
1046
|
+
throw new Error('Cannot recover signature: point at infinify');
|
|
1047
|
+
Q.assertValidity();
|
|
1048
|
+
return Q;
|
|
1021
1049
|
}
|
|
1022
1050
|
toRawBytes(isCompressed = false) {
|
|
1023
1051
|
return hexToBytes(this.toHex(isCompressed));
|
|
1024
1052
|
}
|
|
1025
1053
|
toHex(isCompressed = false) {
|
|
1026
|
-
const x =
|
|
1054
|
+
const x = numTo32bStr(this.x);
|
|
1027
1055
|
if (isCompressed) {
|
|
1028
|
-
|
|
1056
|
+
const prefix = this.y & _1n ? '03' : '02';
|
|
1057
|
+
return `${prefix}${x}`;
|
|
1029
1058
|
}
|
|
1030
1059
|
else {
|
|
1031
|
-
return `04${x}${
|
|
1060
|
+
return `04${x}${numTo32bStr(this.y)}`;
|
|
1032
1061
|
}
|
|
1033
1062
|
}
|
|
1034
1063
|
toHexX() {
|
|
@@ -1040,7 +1069,7 @@ class Point {
|
|
|
1040
1069
|
assertValidity() {
|
|
1041
1070
|
const msg = 'Point is not on elliptic curve';
|
|
1042
1071
|
const { x, y } = this;
|
|
1043
|
-
if (!
|
|
1072
|
+
if (!isValidFieldElement(x) || !isValidFieldElement(y))
|
|
1044
1073
|
throw new Error(msg);
|
|
1045
1074
|
const left = mod(y * y);
|
|
1046
1075
|
const right = weistrass(x);
|
|
@@ -1065,6 +1094,13 @@ class Point {
|
|
|
1065
1094
|
multiply(scalar) {
|
|
1066
1095
|
return JacobianPoint.fromAffine(this).multiply(scalar, this).toAffine();
|
|
1067
1096
|
}
|
|
1097
|
+
multiplyAndAddUnsafe(Q, a, b) {
|
|
1098
|
+
const P = JacobianPoint.fromAffine(this);
|
|
1099
|
+
const aP = a === _0n || a === _1n || this !== Point.BASE ? P.multiplyUnsafe(a) : P.multiply(a);
|
|
1100
|
+
const bQ = JacobianPoint.fromAffine(Q).multiplyUnsafe(b);
|
|
1101
|
+
const sum = aP.add(bQ);
|
|
1102
|
+
return sum.equals(JacobianPoint.ZERO) ? undefined : sum.toAffine();
|
|
1103
|
+
}
|
|
1068
1104
|
}
|
|
1069
1105
|
exports.Point = Point;
|
|
1070
1106
|
Point.BASE = new Point(CURVE.Gx, CURVE.Gy);
|
|
@@ -1107,7 +1143,7 @@ class Signature {
|
|
|
1107
1143
|
this.assertValidity();
|
|
1108
1144
|
}
|
|
1109
1145
|
static fromCompact(hex) {
|
|
1110
|
-
const arr = hex
|
|
1146
|
+
const arr = isUint8a(hex);
|
|
1111
1147
|
const name = 'Signature.fromCompact';
|
|
1112
1148
|
if (typeof hex !== 'string' && !arr)
|
|
1113
1149
|
throw new TypeError(`${name}: Expected string or Uint8Array`);
|
|
@@ -1117,7 +1153,7 @@ class Signature {
|
|
|
1117
1153
|
return new Signature(hexToNumber(str.slice(0, 64)), hexToNumber(str.slice(64, 128)));
|
|
1118
1154
|
}
|
|
1119
1155
|
static fromDER(hex) {
|
|
1120
|
-
const arr = hex
|
|
1156
|
+
const arr = isUint8a(hex);
|
|
1121
1157
|
if (typeof hex !== 'string' && !arr)
|
|
1122
1158
|
throw new TypeError(`Signature.fromDER: Expected string or Uint8Array`);
|
|
1123
1159
|
const { r, s } = parseDERSignature(arr ? hex : hexToBytes(hex));
|
|
@@ -1144,13 +1180,13 @@ class Signature {
|
|
|
1144
1180
|
return hexToBytes(this.toDERHex(isCompressed));
|
|
1145
1181
|
}
|
|
1146
1182
|
toDERHex(isCompressed = false) {
|
|
1147
|
-
const sHex = sliceDER(
|
|
1183
|
+
const sHex = sliceDER(numberToHexUnpadded(this.s));
|
|
1148
1184
|
if (isCompressed)
|
|
1149
1185
|
return sHex;
|
|
1150
|
-
const rHex = sliceDER(
|
|
1151
|
-
const rLen =
|
|
1152
|
-
const sLen =
|
|
1153
|
-
const length =
|
|
1186
|
+
const rHex = sliceDER(numberToHexUnpadded(this.r));
|
|
1187
|
+
const rLen = numberToHexUnpadded(rHex.length / 2);
|
|
1188
|
+
const sLen = numberToHexUnpadded(sHex.length / 2);
|
|
1189
|
+
const length = numberToHexUnpadded(rHex.length / 2 + sHex.length / 2 + 4);
|
|
1154
1190
|
return `30${length}02${rLen}${rHex}02${sLen}${sHex}`;
|
|
1155
1191
|
}
|
|
1156
1192
|
toRawBytes() {
|
|
@@ -1163,12 +1199,12 @@ class Signature {
|
|
|
1163
1199
|
return hexToBytes(this.toCompactHex());
|
|
1164
1200
|
}
|
|
1165
1201
|
toCompactHex() {
|
|
1166
|
-
return
|
|
1202
|
+
return numTo32bStr(this.r) + numTo32bStr(this.s);
|
|
1167
1203
|
}
|
|
1168
1204
|
}
|
|
1169
1205
|
exports.Signature = Signature;
|
|
1170
1206
|
function concatBytes(...arrays) {
|
|
1171
|
-
if (!arrays.every(
|
|
1207
|
+
if (!arrays.every(isUint8a))
|
|
1172
1208
|
throw new Error('Uint8Array list expected');
|
|
1173
1209
|
if (arrays.length === 1)
|
|
1174
1210
|
return arrays[0];
|
|
@@ -1181,23 +1217,28 @@ function concatBytes(...arrays) {
|
|
|
1181
1217
|
}
|
|
1182
1218
|
return result;
|
|
1183
1219
|
}
|
|
1220
|
+
function isUint8a(bytes) {
|
|
1221
|
+
return bytes instanceof Uint8Array;
|
|
1222
|
+
}
|
|
1184
1223
|
const hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0'));
|
|
1185
1224
|
function bytesToHex(uint8a) {
|
|
1225
|
+
if (!(uint8a instanceof Uint8Array))
|
|
1226
|
+
throw new Error('Expected Uint8Array');
|
|
1186
1227
|
let hex = '';
|
|
1187
1228
|
for (let i = 0; i < uint8a.length; i++) {
|
|
1188
1229
|
hex += hexes[uint8a[i]];
|
|
1189
1230
|
}
|
|
1190
1231
|
return hex;
|
|
1191
1232
|
}
|
|
1192
|
-
function
|
|
1233
|
+
function numTo32bStr(num) {
|
|
1193
1234
|
if (num > POW_2_256)
|
|
1194
|
-
throw new Error('
|
|
1235
|
+
throw new Error('Expected number < 2^256');
|
|
1195
1236
|
return num.toString(16).padStart(64, '0');
|
|
1196
1237
|
}
|
|
1197
|
-
function
|
|
1198
|
-
return hexToBytes(
|
|
1238
|
+
function numTo32b(num) {
|
|
1239
|
+
return hexToBytes(numTo32bStr(num));
|
|
1199
1240
|
}
|
|
1200
|
-
function
|
|
1241
|
+
function numberToHexUnpadded(num) {
|
|
1201
1242
|
const hex = num.toString(16);
|
|
1202
1243
|
return hex.length & 1 ? `0${hex}` : hex;
|
|
1203
1244
|
}
|
|
@@ -1218,22 +1259,20 @@ function hexToBytes(hex) {
|
|
|
1218
1259
|
const j = i * 2;
|
|
1219
1260
|
const hexByte = hex.slice(j, j + 2);
|
|
1220
1261
|
const byte = Number.parseInt(hexByte, 16);
|
|
1221
|
-
if (Number.isNaN(byte))
|
|
1262
|
+
if (Number.isNaN(byte) || byte < 0)
|
|
1222
1263
|
throw new Error('Invalid byte sequence');
|
|
1223
1264
|
array[i] = byte;
|
|
1224
1265
|
}
|
|
1225
1266
|
return array;
|
|
1226
1267
|
}
|
|
1227
|
-
function ensureBytes(hex) {
|
|
1228
|
-
return hex instanceof Uint8Array ? hex : hexToBytes(hex);
|
|
1229
|
-
}
|
|
1230
1268
|
function bytesToNumber(bytes) {
|
|
1231
|
-
if (!(bytes instanceof Uint8Array))
|
|
1232
|
-
throw new Error('Expected Uint8Array');
|
|
1233
1269
|
return hexToNumber(bytesToHex(bytes));
|
|
1234
1270
|
}
|
|
1271
|
+
function ensureBytes(hex) {
|
|
1272
|
+
return hex instanceof Uint8Array ? Uint8Array.from(hex) : hexToBytes(hex);
|
|
1273
|
+
}
|
|
1235
1274
|
function normalizeScalar(num) {
|
|
1236
|
-
if (typeof num === 'number' &&
|
|
1275
|
+
if (typeof num === 'number' && Number.isSafeInteger(num) && num > 0)
|
|
1237
1276
|
return BigInt(num);
|
|
1238
1277
|
if (typeof num === 'bigint' && isWithinCurveOrder(num))
|
|
1239
1278
|
return num;
|
|
@@ -1241,7 +1280,7 @@ function normalizeScalar(num) {
|
|
|
1241
1280
|
}
|
|
1242
1281
|
function mod(a, b = CURVE.P) {
|
|
1243
1282
|
const result = a % b;
|
|
1244
|
-
return result >=
|
|
1283
|
+
return result >= _0n ? result : b + result;
|
|
1245
1284
|
}
|
|
1246
1285
|
function pow2(x, power) {
|
|
1247
1286
|
const { P } = CURVE;
|
|
@@ -1294,25 +1333,22 @@ function invert(number, modulo = CURVE.P) {
|
|
|
1294
1333
|
throw new Error('invert: does not exist');
|
|
1295
1334
|
return mod(x, modulo);
|
|
1296
1335
|
}
|
|
1297
|
-
function invertBatch(nums,
|
|
1298
|
-
const
|
|
1299
|
-
const
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
if (nums[i] === _0n)
|
|
1303
|
-
continue;
|
|
1336
|
+
function invertBatch(nums, p = CURVE.P) {
|
|
1337
|
+
const scratch = new Array(nums.length);
|
|
1338
|
+
const lastMultiplied = nums.reduce((acc, num, i) => {
|
|
1339
|
+
if (num === _0n)
|
|
1340
|
+
return acc;
|
|
1304
1341
|
scratch[i] = acc;
|
|
1305
|
-
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
if (
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
return nums;
|
|
1342
|
+
return mod(acc * num, p);
|
|
1343
|
+
}, _1n);
|
|
1344
|
+
const inverted = invert(lastMultiplied, p);
|
|
1345
|
+
nums.reduceRight((acc, num, i) => {
|
|
1346
|
+
if (num === _0n)
|
|
1347
|
+
return acc;
|
|
1348
|
+
scratch[i] = mod(acc * scratch[i], p);
|
|
1349
|
+
return mod(acc * num, p);
|
|
1350
|
+
}, inverted);
|
|
1351
|
+
return scratch;
|
|
1316
1352
|
}
|
|
1317
1353
|
const divNearest = (a, b) => (a + b / _2n) / b;
|
|
1318
1354
|
const POW_2_128 = _2n ** BigInt(128);
|
|
@@ -1332,23 +1368,21 @@ function splitScalarEndo(k) {
|
|
|
1332
1368
|
k1 = n - k1;
|
|
1333
1369
|
if (k2neg)
|
|
1334
1370
|
k2 = n - k2;
|
|
1335
|
-
if (k1 > POW_2_128 || k2 > POW_2_128)
|
|
1336
|
-
throw new Error('splitScalarEndo: Endomorphism failed');
|
|
1371
|
+
if (k1 > POW_2_128 || k2 > POW_2_128) {
|
|
1372
|
+
throw new Error('splitScalarEndo: Endomorphism failed, k=' + k);
|
|
1373
|
+
}
|
|
1337
1374
|
return { k1neg, k1, k2neg, k2 };
|
|
1338
1375
|
}
|
|
1339
1376
|
function truncateHash(hash) {
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
let msg = hexToNumber(hash || '0');
|
|
1343
|
-
const byteLength = hash.length / 2;
|
|
1377
|
+
const { n } = CURVE;
|
|
1378
|
+
const byteLength = hash.length;
|
|
1344
1379
|
const delta = byteLength * 8 - 256;
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
if (
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
return msg;
|
|
1380
|
+
let h = bytesToNumber(hash);
|
|
1381
|
+
if (delta > 0)
|
|
1382
|
+
h = h >> BigInt(delta);
|
|
1383
|
+
if (h >= n)
|
|
1384
|
+
h -= n;
|
|
1385
|
+
return h;
|
|
1352
1386
|
}
|
|
1353
1387
|
class HmacDrbg {
|
|
1354
1388
|
constructor() {
|
|
@@ -1403,8 +1437,8 @@ class HmacDrbg {
|
|
|
1403
1437
|
function isWithinCurveOrder(num) {
|
|
1404
1438
|
return _0n < num && num < CURVE.n;
|
|
1405
1439
|
}
|
|
1406
|
-
function
|
|
1407
|
-
return
|
|
1440
|
+
function isValidFieldElement(num) {
|
|
1441
|
+
return _0n < num && num < CURVE.P;
|
|
1408
1442
|
}
|
|
1409
1443
|
function kmdToSig(kBytes, m, d) {
|
|
1410
1444
|
const k = bytesToNumber(kBytes);
|
|
@@ -1435,7 +1469,7 @@ function normalizePrivateKey(key) {
|
|
|
1435
1469
|
throw new Error('Expected 32 bytes of private key');
|
|
1436
1470
|
num = hexToNumber(key);
|
|
1437
1471
|
}
|
|
1438
|
-
else if (key
|
|
1472
|
+
else if (isUint8a(key)) {
|
|
1439
1473
|
if (key.length !== 32)
|
|
1440
1474
|
throw new Error('Expected 32 bytes of private key');
|
|
1441
1475
|
num = bytesToNumber(key);
|
|
@@ -1472,12 +1506,12 @@ function getPublicKey(privateKey, isCompressed = false) {
|
|
|
1472
1506
|
return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed);
|
|
1473
1507
|
}
|
|
1474
1508
|
exports.getPublicKey = getPublicKey;
|
|
1475
|
-
function recoverPublicKey(msgHash, signature, recovery) {
|
|
1476
|
-
return Point.fromSignature(msgHash, signature, recovery).toRawBytes();
|
|
1509
|
+
function recoverPublicKey(msgHash, signature, recovery, isCompressed = false) {
|
|
1510
|
+
return Point.fromSignature(msgHash, signature, recovery).toRawBytes(isCompressed);
|
|
1477
1511
|
}
|
|
1478
1512
|
exports.recoverPublicKey = recoverPublicKey;
|
|
1479
1513
|
function isPub(item) {
|
|
1480
|
-
const arr = item
|
|
1514
|
+
const arr = isUint8a(item);
|
|
1481
1515
|
const str = typeof item === 'string';
|
|
1482
1516
|
const len = (arr || str) && item.length;
|
|
1483
1517
|
if (arr)
|
|
@@ -1510,21 +1544,21 @@ function bits2octets(bytes) {
|
|
|
1510
1544
|
function int2octets(num) {
|
|
1511
1545
|
if (typeof num !== 'bigint')
|
|
1512
1546
|
throw new Error('Expected bigint');
|
|
1513
|
-
const hex =
|
|
1547
|
+
const hex = numTo32bStr(num);
|
|
1514
1548
|
return hexToBytes(hex);
|
|
1515
1549
|
}
|
|
1516
1550
|
function initSigArgs(msgHash, privateKey, extraEntropy) {
|
|
1517
1551
|
if (msgHash == null)
|
|
1518
|
-
throw new Error(`sign: expected valid
|
|
1552
|
+
throw new Error(`sign: expected valid message hash, not "${msgHash}"`);
|
|
1519
1553
|
const h1 = ensureBytes(msgHash);
|
|
1520
1554
|
const d = normalizePrivateKey(privateKey);
|
|
1521
1555
|
const seedArgs = [int2octets(d), bits2octets(h1)];
|
|
1522
1556
|
if (extraEntropy != null) {
|
|
1523
1557
|
if (extraEntropy === true)
|
|
1524
1558
|
extraEntropy = exports.utils.randomBytes(32);
|
|
1525
|
-
const e =
|
|
1559
|
+
const e = ensureBytes(extraEntropy);
|
|
1526
1560
|
if (e.length !== 32)
|
|
1527
|
-
throw new Error('
|
|
1561
|
+
throw new Error('sign: Expected 32 bytes of extra data');
|
|
1528
1562
|
seedArgs.push(e);
|
|
1529
1563
|
}
|
|
1530
1564
|
const seed = concatBytes(...seedArgs);
|
|
@@ -1566,6 +1600,7 @@ function verify(signature, msgHash, publicKey, opts = vopts) {
|
|
|
1566
1600
|
let sig;
|
|
1567
1601
|
try {
|
|
1568
1602
|
sig = normalizeSignature(signature);
|
|
1603
|
+
msgHash = ensureBytes(msgHash);
|
|
1569
1604
|
}
|
|
1570
1605
|
catch (error) {
|
|
1571
1606
|
return false;
|
|
@@ -1574,57 +1609,51 @@ function verify(signature, msgHash, publicKey, opts = vopts) {
|
|
|
1574
1609
|
if (opts.strict && sig.hasHighS())
|
|
1575
1610
|
return false;
|
|
1576
1611
|
const h = truncateHash(msgHash);
|
|
1577
|
-
|
|
1578
|
-
return false;
|
|
1579
|
-
let pubKey;
|
|
1612
|
+
let P;
|
|
1580
1613
|
try {
|
|
1581
|
-
|
|
1614
|
+
P = normalizePublicKey(publicKey);
|
|
1582
1615
|
}
|
|
1583
1616
|
catch (error) {
|
|
1584
1617
|
return false;
|
|
1585
1618
|
}
|
|
1586
1619
|
const { n } = CURVE;
|
|
1587
|
-
const
|
|
1588
|
-
const u1 = mod(h *
|
|
1589
|
-
const u2 = mod(r *
|
|
1590
|
-
const
|
|
1591
|
-
|
|
1592
|
-
|
|
1620
|
+
const sinv = invert(s, n);
|
|
1621
|
+
const u1 = mod(h * sinv, n);
|
|
1622
|
+
const u2 = mod(r * sinv, n);
|
|
1623
|
+
const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2);
|
|
1624
|
+
if (!R)
|
|
1625
|
+
return false;
|
|
1593
1626
|
const v = mod(R.x, n);
|
|
1594
1627
|
return v === r;
|
|
1595
1628
|
}
|
|
1596
1629
|
exports.verify = verify;
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
const tagH = await exports.utils.sha256(tagB);
|
|
1600
|
-
const h = await exports.utils.sha256(concatBytes(tagH, tagH, ...messages));
|
|
1601
|
-
return bytesToNumber(h);
|
|
1602
|
-
}
|
|
1603
|
-
async function createChallenge(x, P, message) {
|
|
1604
|
-
const rx = pad32b(x);
|
|
1605
|
-
const t = await taggedHash('BIP0340/challenge', rx, P.toRawX(), message);
|
|
1606
|
-
return mod(t, CURVE.n);
|
|
1630
|
+
function finalizeSchnorrChallenge(ch) {
|
|
1631
|
+
return mod(bytesToNumber(ch), CURVE.n);
|
|
1607
1632
|
}
|
|
1608
1633
|
function hasEvenY(point) {
|
|
1609
|
-
return
|
|
1634
|
+
return (point.y & _1n) === _0n;
|
|
1610
1635
|
}
|
|
1611
1636
|
class SchnorrSignature {
|
|
1612
1637
|
constructor(r, s) {
|
|
1613
1638
|
this.r = r;
|
|
1614
1639
|
this.s = s;
|
|
1615
|
-
|
|
1616
|
-
throw new Error('Invalid signature');
|
|
1640
|
+
this.assertValidity();
|
|
1617
1641
|
}
|
|
1618
1642
|
static fromHex(hex) {
|
|
1619
1643
|
const bytes = ensureBytes(hex);
|
|
1620
1644
|
if (bytes.length !== 64)
|
|
1621
1645
|
throw new TypeError(`SchnorrSignature.fromHex: expected 64 bytes, not ${bytes.length}`);
|
|
1622
|
-
const r = bytesToNumber(bytes.
|
|
1623
|
-
const s = bytesToNumber(bytes.
|
|
1646
|
+
const r = bytesToNumber(bytes.subarray(0, 32));
|
|
1647
|
+
const s = bytesToNumber(bytes.subarray(32, 64));
|
|
1624
1648
|
return new SchnorrSignature(r, s);
|
|
1625
1649
|
}
|
|
1650
|
+
assertValidity() {
|
|
1651
|
+
const { r, s } = this;
|
|
1652
|
+
if (!isValidFieldElement(r) || !isWithinCurveOrder(s))
|
|
1653
|
+
throw new Error('Invalid signature');
|
|
1654
|
+
}
|
|
1626
1655
|
toHex() {
|
|
1627
|
-
return
|
|
1656
|
+
return numTo32bStr(this.r) + numTo32bStr(this.s);
|
|
1628
1657
|
}
|
|
1629
1658
|
toRawBytes() {
|
|
1630
1659
|
return hexToBytes(this.toHex());
|
|
@@ -1633,55 +1662,112 @@ class SchnorrSignature {
|
|
|
1633
1662
|
function schnorrGetPublicKey(privateKey) {
|
|
1634
1663
|
return Point.fromPrivateKey(privateKey).toRawX();
|
|
1635
1664
|
}
|
|
1636
|
-
|
|
1665
|
+
function initSchnorrSigArgs(message, privateKey, auxRand) {
|
|
1637
1666
|
if (message == null)
|
|
1638
1667
|
throw new TypeError(`sign: Expected valid message, not "${message}"`);
|
|
1639
|
-
const { n } = CURVE;
|
|
1640
1668
|
const m = ensureBytes(message);
|
|
1641
1669
|
const d0 = normalizePrivateKey(privateKey);
|
|
1642
1670
|
const rand = ensureBytes(auxRand);
|
|
1643
1671
|
if (rand.length !== 32)
|
|
1644
1672
|
throw new TypeError('sign: Expected 32 bytes of aux randomness');
|
|
1645
1673
|
const P = Point.fromPrivateKey(d0);
|
|
1646
|
-
const
|
|
1647
|
-
const
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1674
|
+
const px = P.toRawX();
|
|
1675
|
+
const d = hasEvenY(P) ? d0 : CURVE.n - d0;
|
|
1676
|
+
return { m, P, px, d, rand };
|
|
1677
|
+
}
|
|
1678
|
+
function initSchnorrNonce(d, t0h) {
|
|
1679
|
+
return numTo32b(d ^ bytesToNumber(t0h));
|
|
1680
|
+
}
|
|
1681
|
+
function finalizeSchnorrNonce(k0h) {
|
|
1682
|
+
const k0 = mod(bytesToNumber(k0h), CURVE.n);
|
|
1651
1683
|
if (k0 === _0n)
|
|
1652
1684
|
throw new Error('sign: Creation of signature failed. k is zero');
|
|
1653
1685
|
const R = Point.fromPrivateKey(k0);
|
|
1654
|
-
const
|
|
1655
|
-
const
|
|
1656
|
-
|
|
1657
|
-
|
|
1686
|
+
const rx = R.toRawX();
|
|
1687
|
+
const k = hasEvenY(R) ? k0 : CURVE.n - k0;
|
|
1688
|
+
return { R, rx, k };
|
|
1689
|
+
}
|
|
1690
|
+
function finalizeSchnorrSig(R, k, e, d) {
|
|
1691
|
+
return new SchnorrSignature(R.x, mod(k + e * d, CURVE.n)).toRawBytes();
|
|
1692
|
+
}
|
|
1693
|
+
async function schnorrSign(message, privateKey, auxRand = exports.utils.randomBytes()) {
|
|
1694
|
+
const { m, px, d, rand } = initSchnorrSigArgs(message, privateKey, auxRand);
|
|
1695
|
+
const t = initSchnorrNonce(d, await exports.utils.taggedHash(TAGS.aux, rand));
|
|
1696
|
+
const { R, rx, k } = finalizeSchnorrNonce(await exports.utils.taggedHash(TAGS.nonce, t, px, m));
|
|
1697
|
+
const e = finalizeSchnorrChallenge(await exports.utils.taggedHash(TAGS.challenge, rx, px, m));
|
|
1698
|
+
const sig = finalizeSchnorrSig(R, k, e, d);
|
|
1699
|
+
const isValid = await schnorrVerify(sig, m, px);
|
|
1658
1700
|
if (!isValid)
|
|
1659
1701
|
throw new Error('sign: Invalid signature produced');
|
|
1660
|
-
return sig
|
|
1702
|
+
return sig;
|
|
1661
1703
|
}
|
|
1662
|
-
|
|
1663
|
-
const
|
|
1664
|
-
const
|
|
1665
|
-
const
|
|
1666
|
-
const e =
|
|
1667
|
-
const
|
|
1668
|
-
const
|
|
1669
|
-
|
|
1670
|
-
|
|
1704
|
+
function schnorrSignSync(message, privateKey, auxRand = exports.utils.randomBytes()) {
|
|
1705
|
+
const { m, px, d, rand } = initSchnorrSigArgs(message, privateKey, auxRand);
|
|
1706
|
+
const t = initSchnorrNonce(d, exports.utils.taggedHashSync(TAGS.aux, rand));
|
|
1707
|
+
const { R, rx, k } = finalizeSchnorrNonce(exports.utils.taggedHashSync(TAGS.nonce, t, px, m));
|
|
1708
|
+
const e = finalizeSchnorrChallenge(exports.utils.taggedHashSync(TAGS.challenge, rx, px, m));
|
|
1709
|
+
const sig = finalizeSchnorrSig(R, k, e, d);
|
|
1710
|
+
const isValid = schnorrVerifySync(sig, m, px);
|
|
1711
|
+
if (!isValid)
|
|
1712
|
+
throw new Error('sign: Invalid signature produced');
|
|
1713
|
+
return sig;
|
|
1714
|
+
}
|
|
1715
|
+
function initSchnorrVerify(signature, message, publicKey) {
|
|
1716
|
+
const raw = signature instanceof SchnorrSignature;
|
|
1717
|
+
const sig = raw ? signature : SchnorrSignature.fromHex(signature);
|
|
1718
|
+
if (raw)
|
|
1719
|
+
sig.assertValidity();
|
|
1720
|
+
return {
|
|
1721
|
+
...sig,
|
|
1722
|
+
m: ensureBytes(message),
|
|
1723
|
+
P: normalizePublicKey(publicKey),
|
|
1724
|
+
};
|
|
1725
|
+
}
|
|
1726
|
+
function finalizeSchnorrVerify(r, P, s, e) {
|
|
1727
|
+
const R = Point.BASE.multiplyAndAddUnsafe(P, normalizePrivateKey(s), mod(-e, CURVE.n));
|
|
1728
|
+
if (!R || !hasEvenY(R) || R.x !== r)
|
|
1671
1729
|
return false;
|
|
1672
1730
|
return true;
|
|
1673
1731
|
}
|
|
1732
|
+
async function schnorrVerify(signature, message, publicKey) {
|
|
1733
|
+
try {
|
|
1734
|
+
const { r, s, m, P } = initSchnorrVerify(signature, message, publicKey);
|
|
1735
|
+
const e = finalizeSchnorrChallenge(await exports.utils.taggedHash(TAGS.challenge, numTo32b(r), P.toRawX(), m));
|
|
1736
|
+
return finalizeSchnorrVerify(r, P, s, e);
|
|
1737
|
+
}
|
|
1738
|
+
catch (error) {
|
|
1739
|
+
return false;
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
function schnorrVerifySync(signature, message, publicKey) {
|
|
1743
|
+
try {
|
|
1744
|
+
const { r, s, m, P } = initSchnorrVerify(signature, message, publicKey);
|
|
1745
|
+
const e = finalizeSchnorrChallenge(exports.utils.taggedHashSync(TAGS.challenge, numTo32b(r), P.toRawX(), m));
|
|
1746
|
+
return finalizeSchnorrVerify(r, P, s, e);
|
|
1747
|
+
}
|
|
1748
|
+
catch (error) {
|
|
1749
|
+
return false;
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1674
1752
|
exports.schnorr = {
|
|
1675
1753
|
Signature: SchnorrSignature,
|
|
1676
1754
|
getPublicKey: schnorrGetPublicKey,
|
|
1677
1755
|
sign: schnorrSign,
|
|
1678
1756
|
verify: schnorrVerify,
|
|
1757
|
+
signSync: schnorrSignSync,
|
|
1758
|
+
verifySync: schnorrVerifySync,
|
|
1679
1759
|
};
|
|
1680
1760
|
Point.BASE._setWindowSize(8);
|
|
1681
1761
|
const crypto = {
|
|
1682
|
-
node:
|
|
1762
|
+
node: nodeCrypto,
|
|
1683
1763
|
web: typeof self === 'object' && 'crypto' in self ? self.crypto : undefined,
|
|
1684
1764
|
};
|
|
1765
|
+
const TAGS = {
|
|
1766
|
+
challenge: 'BIP0340/challenge',
|
|
1767
|
+
aux: 'BIP0340/aux',
|
|
1768
|
+
nonce: 'BIP0340/nonce',
|
|
1769
|
+
};
|
|
1770
|
+
const TAGGED_HASH_PREFIXES = {};
|
|
1685
1771
|
exports.utils = {
|
|
1686
1772
|
isValidPrivateKey(privateKey) {
|
|
1687
1773
|
try {
|
|
@@ -1692,6 +1778,35 @@ exports.utils = {
|
|
|
1692
1778
|
return false;
|
|
1693
1779
|
}
|
|
1694
1780
|
},
|
|
1781
|
+
privateAdd: (privateKey, tweak) => {
|
|
1782
|
+
const p = normalizePrivateKey(privateKey);
|
|
1783
|
+
const t = normalizePrivateKey(tweak);
|
|
1784
|
+
return numTo32b(mod(p + t, CURVE.n));
|
|
1785
|
+
},
|
|
1786
|
+
privateNegate: (privateKey) => {
|
|
1787
|
+
const p = normalizePrivateKey(privateKey);
|
|
1788
|
+
return numTo32b(CURVE.n - p);
|
|
1789
|
+
},
|
|
1790
|
+
pointAddScalar: (p, tweak, isCompressed) => {
|
|
1791
|
+
const P = Point.fromHex(p);
|
|
1792
|
+
const t = normalizePrivateKey(tweak);
|
|
1793
|
+
const Q = Point.BASE.multiplyAndAddUnsafe(P, t, _1n);
|
|
1794
|
+
if (!Q)
|
|
1795
|
+
throw new Error('Tweaked point at infinity');
|
|
1796
|
+
return Q.toRawBytes(isCompressed);
|
|
1797
|
+
},
|
|
1798
|
+
pointMultiply: (p, tweak, isCompressed) => {
|
|
1799
|
+
const P = Point.fromHex(p);
|
|
1800
|
+
const t = bytesToNumber(ensureBytes(tweak));
|
|
1801
|
+
return P.multiply(t).toRawBytes(isCompressed);
|
|
1802
|
+
},
|
|
1803
|
+
hashToPrivateKey: (hash) => {
|
|
1804
|
+
hash = ensureBytes(hash);
|
|
1805
|
+
if (hash.length < 40 || hash.length > 1024)
|
|
1806
|
+
throw new Error('Expected 40-1024 bytes of private key as per FIPS 186');
|
|
1807
|
+
const num = mod(bytesToNumber(hash), CURVE.n - _1n) + _1n;
|
|
1808
|
+
return numTo32b(num);
|
|
1809
|
+
},
|
|
1695
1810
|
randomBytes: (bytesLength = 32) => {
|
|
1696
1811
|
if (crypto.web) {
|
|
1697
1812
|
return crypto.web.getRandomValues(new Uint8Array(bytesLength));
|
|
@@ -1705,24 +1820,23 @@ exports.utils = {
|
|
|
1705
1820
|
}
|
|
1706
1821
|
},
|
|
1707
1822
|
randomPrivateKey: () => {
|
|
1708
|
-
|
|
1709
|
-
while (i--) {
|
|
1710
|
-
const b32 = exports.utils.randomBytes(32);
|
|
1711
|
-
const num = bytesToNumber(b32);
|
|
1712
|
-
if (isWithinCurveOrder(num) && num !== _1n)
|
|
1713
|
-
return b32;
|
|
1714
|
-
}
|
|
1715
|
-
throw new Error('Valid private key was not found in 8 iterations. PRNG is broken');
|
|
1823
|
+
return exports.utils.hashToPrivateKey(exports.utils.randomBytes(40));
|
|
1716
1824
|
},
|
|
1717
1825
|
bytesToHex,
|
|
1718
|
-
|
|
1826
|
+
hexToBytes,
|
|
1827
|
+
concatBytes,
|
|
1828
|
+
mod,
|
|
1829
|
+
invert,
|
|
1830
|
+
sha256: async (...messages) => {
|
|
1719
1831
|
if (crypto.web) {
|
|
1720
|
-
const buffer = await crypto.web.subtle.digest('SHA-256',
|
|
1832
|
+
const buffer = await crypto.web.subtle.digest('SHA-256', concatBytes(...messages));
|
|
1721
1833
|
return new Uint8Array(buffer);
|
|
1722
1834
|
}
|
|
1723
1835
|
else if (crypto.node) {
|
|
1724
1836
|
const { createHash } = crypto.node;
|
|
1725
|
-
|
|
1837
|
+
const hash = createHash('sha256');
|
|
1838
|
+
messages.forEach((m) => hash.update(m));
|
|
1839
|
+
return Uint8Array.from(hash.digest());
|
|
1726
1840
|
}
|
|
1727
1841
|
else {
|
|
1728
1842
|
throw new Error("The environment doesn't have sha256 function");
|
|
@@ -1747,6 +1861,26 @@ exports.utils = {
|
|
|
1747
1861
|
},
|
|
1748
1862
|
sha256Sync: undefined,
|
|
1749
1863
|
hmacSha256Sync: undefined,
|
|
1864
|
+
taggedHash: async (tag, ...messages) => {
|
|
1865
|
+
let tagP = TAGGED_HASH_PREFIXES[tag];
|
|
1866
|
+
if (tagP === undefined) {
|
|
1867
|
+
const tagH = await exports.utils.sha256(Uint8Array.from(tag, (c) => c.charCodeAt(0)));
|
|
1868
|
+
tagP = concatBytes(tagH, tagH);
|
|
1869
|
+
TAGGED_HASH_PREFIXES[tag] = tagP;
|
|
1870
|
+
}
|
|
1871
|
+
return exports.utils.sha256(tagP, ...messages);
|
|
1872
|
+
},
|
|
1873
|
+
taggedHashSync: (tag, ...messages) => {
|
|
1874
|
+
if (typeof exports.utils.sha256Sync !== 'function')
|
|
1875
|
+
throw new Error('utils.sha256Sync is undefined, you need to set it');
|
|
1876
|
+
let tagP = TAGGED_HASH_PREFIXES[tag];
|
|
1877
|
+
if (tagP === undefined) {
|
|
1878
|
+
const tagH = exports.utils.sha256Sync(Uint8Array.from(tag, (c) => c.charCodeAt(0)));
|
|
1879
|
+
tagP = concatBytes(tagH, tagH);
|
|
1880
|
+
TAGGED_HASH_PREFIXES[tag] = tagP;
|
|
1881
|
+
}
|
|
1882
|
+
return exports.utils.sha256Sync(tagP, ...messages);
|
|
1883
|
+
},
|
|
1750
1884
|
precompute(windowSize = 8, point = Point.BASE) {
|
|
1751
1885
|
const cached = point === Point.BASE ? point : new Point(point.x, point.y);
|
|
1752
1886
|
cached._setWindowSize(windowSize);
|
|
@@ -3455,7 +3589,7 @@ function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
|
|
|
3455
3589
|
case "bytes": gen
|
|
3456
3590
|
("if(typeof d%s===\"string\")", prop)
|
|
3457
3591
|
("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)", prop, prop, prop)
|
|
3458
|
-
("else if(d%s.length)", prop)
|
|
3592
|
+
("else if(d%s.length >= 0)", prop)
|
|
3459
3593
|
("m%s=d%s", prop, prop);
|
|
3460
3594
|
break;
|
|
3461
3595
|
case "string": gen
|
|
@@ -3718,7 +3852,7 @@ function decoder(mtype) {
|
|
|
3718
3852
|
var field = mtype._fieldsArray[i].resolve(),
|
|
3719
3853
|
type = field.resolvedType instanceof Enum ? "int32" : field.type,
|
|
3720
3854
|
ref = "m" + util.safeProp(field.name); gen
|
|
3721
|
-
("case %i:", field.id);
|
|
3855
|
+
("case %i: {", field.id);
|
|
3722
3856
|
|
|
3723
3857
|
// Map fields
|
|
3724
3858
|
if (field.map) { gen
|
|
@@ -3789,8 +3923,9 @@ function decoder(mtype) {
|
|
|
3789
3923
|
else gen
|
|
3790
3924
|
("%s=r.%s()", ref, type);
|
|
3791
3925
|
gen
|
|
3792
|
-
("break")
|
|
3793
|
-
|
|
3926
|
+
("break")
|
|
3927
|
+
("}");
|
|
3928
|
+
// Unknown fields
|
|
3794
3929
|
} gen
|
|
3795
3930
|
("default:")
|
|
3796
3931
|
("r.skipType(t&7)")
|
|
@@ -4196,13 +4331,13 @@ function Field(name, id, type, rule, extend, options, comment) {
|
|
|
4196
4331
|
if (extend !== undefined && !util.isString(extend))
|
|
4197
4332
|
throw TypeError("extend must be a string");
|
|
4198
4333
|
|
|
4199
|
-
if (rule === "proto3_optional") {
|
|
4200
|
-
rule = "optional";
|
|
4201
|
-
}
|
|
4202
4334
|
/**
|
|
4203
4335
|
* Field rule, if any.
|
|
4204
4336
|
* @type {string|undefined}
|
|
4205
4337
|
*/
|
|
4338
|
+
if (rule === "proto3_optional") {
|
|
4339
|
+
rule = "optional";
|
|
4340
|
+
}
|
|
4206
4341
|
this.rule = rule && rule !== "optional" ? rule : undefined; // toJSON
|
|
4207
4342
|
|
|
4208
4343
|
/**
|
|
@@ -4388,6 +4523,9 @@ Field.prototype.resolve = function resolve() {
|
|
|
4388
4523
|
this.typeDefault = null;
|
|
4389
4524
|
else // instanceof Enum
|
|
4390
4525
|
this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined
|
|
4526
|
+
} else if (this.options && this.options.proto3_optional) {
|
|
4527
|
+
// proto3 scalar value marked optional; should default to null
|
|
4528
|
+
this.typeDefault = null;
|
|
4391
4529
|
}
|
|
4392
4530
|
|
|
4393
4531
|
// use explicitly set default value if present
|
|
@@ -5110,7 +5248,6 @@ var ReflectionObject = __webpack_require__(3243);
|
|
|
5110
5248
|
((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace";
|
|
5111
5249
|
|
|
5112
5250
|
var Field = __webpack_require__(3548),
|
|
5113
|
-
OneOf = __webpack_require__(7598),
|
|
5114
5251
|
util = __webpack_require__(9935);
|
|
5115
5252
|
|
|
5116
5253
|
var Type, // cyclic
|
|
@@ -5322,7 +5459,7 @@ Namespace.prototype.getEnum = function getEnum(name) {
|
|
|
5322
5459
|
*/
|
|
5323
5460
|
Namespace.prototype.add = function add(object) {
|
|
5324
5461
|
|
|
5325
|
-
if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace
|
|
5462
|
+
if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof Enum || object instanceof Service || object instanceof Namespace))
|
|
5326
5463
|
throw TypeError("object must be a valid nested object");
|
|
5327
5464
|
|
|
5328
5465
|
if (!this.nested)
|
|
@@ -6861,7 +6998,7 @@ module.exports = {};
|
|
|
6861
6998
|
/**
|
|
6862
6999
|
* Named roots.
|
|
6863
7000
|
* This is where pbjs stores generated structures (the option `-r, --root` specifies a name).
|
|
6864
|
-
* Can also be used manually to make roots available
|
|
7001
|
+
* Can also be used manually to make roots available across modules.
|
|
6865
7002
|
* @name roots
|
|
6866
7003
|
* @type {Object.<string,Root>}
|
|
6867
7004
|
* @example
|
|
@@ -8229,6 +8366,9 @@ util.decorateEnum = function decorateEnum(object) {
|
|
|
8229
8366
|
util.setProperty = function setProperty(dst, path, value) {
|
|
8230
8367
|
function setProp(dst, path, value) {
|
|
8231
8368
|
var part = path.shift();
|
|
8369
|
+
if (part === "__proto__") {
|
|
8370
|
+
return dst;
|
|
8371
|
+
}
|
|
8232
8372
|
if (path.length > 0) {
|
|
8233
8373
|
dst[part] = setProp(dst[part] || {}, path, value);
|
|
8234
8374
|
} else {
|
|
@@ -8758,13 +8898,30 @@ function newError(name) {
|
|
|
8758
8898
|
merge(this, properties);
|
|
8759
8899
|
}
|
|
8760
8900
|
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8901
|
+
CustomError.prototype = Object.create(Error.prototype, {
|
|
8902
|
+
constructor: {
|
|
8903
|
+
value: CustomError,
|
|
8904
|
+
writable: true,
|
|
8905
|
+
enumerable: false,
|
|
8906
|
+
configurable: true,
|
|
8907
|
+
},
|
|
8908
|
+
name: {
|
|
8909
|
+
get() { return name; },
|
|
8910
|
+
set: undefined,
|
|
8911
|
+
enumerable: false,
|
|
8912
|
+
// configurable: false would accurately preserve the behavior of
|
|
8913
|
+
// the original, but I'm guessing that was not intentional.
|
|
8914
|
+
// For an actual error subclass, this property would
|
|
8915
|
+
// be configurable.
|
|
8916
|
+
configurable: true,
|
|
8917
|
+
},
|
|
8918
|
+
toString: {
|
|
8919
|
+
value() { return this.name + ": " + this.message; },
|
|
8920
|
+
writable: true,
|
|
8921
|
+
enumerable: false,
|
|
8922
|
+
configurable: true,
|
|
8923
|
+
},
|
|
8924
|
+
});
|
|
8768
8925
|
|
|
8769
8926
|
return CustomError;
|
|
8770
8927
|
}
|
|
@@ -9140,7 +9297,7 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
9140
9297
|
if (type) {
|
|
9141
9298
|
// type_url does not accept leading "."
|
|
9142
9299
|
var type_url = object["@type"].charAt(0) === "." ?
|
|
9143
|
-
object["@type"].
|
|
9300
|
+
object["@type"].slice(1) : object["@type"];
|
|
9144
9301
|
// type_url prefix is optional, but path seperator is required
|
|
9145
9302
|
if (type_url.indexOf("/") === -1) {
|
|
9146
9303
|
type_url = "/" + type_url;
|
|
@@ -9178,7 +9335,7 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
9178
9335
|
if (!(message instanceof this.ctor) && message instanceof Message) {
|
|
9179
9336
|
var object = message.$type.toObject(message, options);
|
|
9180
9337
|
var messageName = message.$type.fullName[0] === "." ?
|
|
9181
|
-
message.$type.fullName.
|
|
9338
|
+
message.$type.fullName.slice(1) : message.$type.fullName;
|
|
9182
9339
|
// Default to type.googleapis.com prefix if no prefix is used
|
|
9183
9340
|
if (prefix === "") {
|
|
9184
9341
|
prefix = googleApi;
|
|
@@ -9845,15 +10002,12 @@ class Contract {
|
|
|
9845
10002
|
this.options = {
|
|
9846
10003
|
signTransaction: true,
|
|
9847
10004
|
sendTransaction: true,
|
|
10005
|
+
broadcast: true,
|
|
9848
10006
|
sendAbis: true,
|
|
9849
10007
|
...c.options,
|
|
9850
10008
|
};
|
|
9851
10009
|
this.functions = {};
|
|
9852
|
-
if (this.
|
|
9853
|
-
this.provider &&
|
|
9854
|
-
this.abi &&
|
|
9855
|
-
this.abi.methods &&
|
|
9856
|
-
this.serializer) {
|
|
10010
|
+
if (this.abi && this.abi.methods) {
|
|
9857
10011
|
Object.keys(this.abi.methods).forEach((name) => {
|
|
9858
10012
|
this.functions[name] = async (argu = {}, options) => {
|
|
9859
10013
|
if (!this.provider)
|
|
@@ -9894,29 +10048,33 @@ class Contract {
|
|
|
9894
10048
|
throw new Error("signer not found");
|
|
9895
10049
|
let tx = await this.signer.prepareTransaction({
|
|
9896
10050
|
header: {
|
|
9897
|
-
...(
|
|
9898
|
-
...(
|
|
9899
|
-
...(
|
|
9900
|
-
...(
|
|
9901
|
-
...(
|
|
10051
|
+
...(opts.chainId && { chain_id: opts.chainId }),
|
|
10052
|
+
...(opts.rcLimit && { rc_limit: opts.rcLimit }),
|
|
10053
|
+
...(opts.nonce && { nonce: opts.nonce }),
|
|
10054
|
+
...(opts.payer && { payer: opts.payer }),
|
|
10055
|
+
...(opts.payee && { payee: opts.payee }),
|
|
9902
10056
|
},
|
|
9903
10057
|
operations: [operation],
|
|
9904
10058
|
});
|
|
9905
|
-
const
|
|
9906
|
-
|
|
10059
|
+
const optsSend = {
|
|
10060
|
+
broadcast: opts.broadcast,
|
|
10061
|
+
beforeSend: opts.beforeSend,
|
|
10062
|
+
};
|
|
10063
|
+
if (opts.sendAbis) {
|
|
10064
|
+
optsSend.abis = {};
|
|
9907
10065
|
const contractId = (0, utils_1.encodeBase58)(this.id);
|
|
9908
|
-
abis[contractId] = this.abi;
|
|
10066
|
+
optsSend.abis[contractId] = this.abi;
|
|
9909
10067
|
}
|
|
9910
10068
|
// return result if the transaction will not be broadcasted
|
|
9911
|
-
if (!
|
|
10069
|
+
if (!opts.sendTransaction) {
|
|
9912
10070
|
const noWait = () => {
|
|
9913
10071
|
throw new Error("This transaction was not broadcasted");
|
|
9914
10072
|
};
|
|
9915
10073
|
if (opts.signTransaction)
|
|
9916
|
-
tx = await this.signer.signTransaction(tx, abis);
|
|
10074
|
+
tx = await this.signer.signTransaction(tx, optsSend.abis);
|
|
9917
10075
|
return { operation, transaction: { ...tx, wait: noWait } };
|
|
9918
10076
|
}
|
|
9919
|
-
const { transaction, receipt } = await this.signer.sendTransaction(tx,
|
|
10077
|
+
const { transaction, receipt } = await this.signer.sendTransaction(tx, optsSend);
|
|
9920
10078
|
return { operation, transaction, receipt };
|
|
9921
10079
|
};
|
|
9922
10080
|
});
|
|
@@ -9966,6 +10124,7 @@ class Contract {
|
|
|
9966
10124
|
* // sign and broadcast
|
|
9967
10125
|
* signTransaction: true,
|
|
9968
10126
|
* sendTransaction: true,
|
|
10127
|
+
* broadcast: true,
|
|
9969
10128
|
* });
|
|
9970
10129
|
* console.log(receipt);
|
|
9971
10130
|
* // wait to be mined
|
|
@@ -9989,30 +10148,34 @@ class Contract {
|
|
|
9989
10148
|
upload_contract: {
|
|
9990
10149
|
contract_id: contractId,
|
|
9991
10150
|
bytecode: (0, utils_1.encodeBase64url)(this.bytecode),
|
|
9992
|
-
...(
|
|
9993
|
-
...(
|
|
9994
|
-
authorizes_call_contract: opts
|
|
10151
|
+
...(opts.abi && { abi: opts.abi }),
|
|
10152
|
+
...(opts.authorizesCallContract && {
|
|
10153
|
+
authorizes_call_contract: opts.authorizesCallContract,
|
|
9995
10154
|
}),
|
|
9996
|
-
...(
|
|
9997
|
-
authorizes_transaction_application: opts
|
|
10155
|
+
...(opts.authorizesTransactionApplication && {
|
|
10156
|
+
authorizes_transaction_application: opts.authorizesTransactionApplication,
|
|
9998
10157
|
}),
|
|
9999
|
-
...(
|
|
10000
|
-
authorizes_upload_contract: opts
|
|
10158
|
+
...(opts.authorizesUploadContract && {
|
|
10159
|
+
authorizes_upload_contract: opts.authorizesUploadContract,
|
|
10001
10160
|
}),
|
|
10002
10161
|
},
|
|
10003
10162
|
};
|
|
10004
10163
|
let tx = await this.signer.prepareTransaction({
|
|
10005
10164
|
header: {
|
|
10006
|
-
...(
|
|
10007
|
-
...(
|
|
10008
|
-
...(
|
|
10009
|
-
...(
|
|
10010
|
-
...(
|
|
10165
|
+
...(opts.chainId && { chain_id: opts.chainId }),
|
|
10166
|
+
...(opts.rcLimit && { rc_limit: opts.rcLimit }),
|
|
10167
|
+
...(opts.nonce && { nonce: opts.nonce }),
|
|
10168
|
+
...(opts.payer && { payer: opts.payer }),
|
|
10169
|
+
...(opts.payee && { payee: opts.payee }),
|
|
10011
10170
|
},
|
|
10012
10171
|
operations: [operation],
|
|
10013
10172
|
});
|
|
10173
|
+
const optsSend = {
|
|
10174
|
+
broadcast: opts.broadcast,
|
|
10175
|
+
beforeSend: opts.beforeSend,
|
|
10176
|
+
};
|
|
10014
10177
|
// return result if the transaction will not be broadcasted
|
|
10015
|
-
if (!
|
|
10178
|
+
if (!opts.sendTransaction) {
|
|
10016
10179
|
const noWait = () => {
|
|
10017
10180
|
throw new Error("This transaction was not broadcasted");
|
|
10018
10181
|
};
|
|
@@ -10020,7 +10183,7 @@ class Contract {
|
|
|
10020
10183
|
tx = await this.signer.signTransaction(tx);
|
|
10021
10184
|
return { operation, transaction: { ...tx, wait: noWait } };
|
|
10022
10185
|
}
|
|
10023
|
-
const { transaction, receipt } = await this.signer.sendTransaction(tx);
|
|
10186
|
+
const { transaction, receipt } = await this.signer.sendTransaction(tx, optsSend);
|
|
10024
10187
|
return { operation, transaction, receipt };
|
|
10025
10188
|
}
|
|
10026
10189
|
/**
|
|
@@ -10318,16 +10481,16 @@ class Provider {
|
|
|
10318
10481
|
*
|
|
10319
10482
|
* When _byTransactionId_ is used it returns the block id.
|
|
10320
10483
|
*
|
|
10321
|
-
* @param timeout - Timeout in milliseconds. By default it is
|
|
10484
|
+
* @param timeout - Timeout in milliseconds. By default it is 15000
|
|
10322
10485
|
* @example
|
|
10323
10486
|
* ```ts
|
|
10324
10487
|
* const blockNumber = await provider.wait(txId);
|
|
10325
|
-
* // const blockNumber = await provider.wait(txId, "byBlock",
|
|
10326
|
-
* // const blockId = await provider.wait(txId, "byTransactionId",
|
|
10488
|
+
* // const blockNumber = await provider.wait(txId, "byBlock", 15000);
|
|
10489
|
+
* // const blockId = await provider.wait(txId, "byTransactionId", 15000);
|
|
10327
10490
|
* console.log("Transaction mined")
|
|
10328
10491
|
* ```
|
|
10329
10492
|
*/
|
|
10330
|
-
async wait(txId, type = "byBlock", timeout =
|
|
10493
|
+
async wait(txId, type = "byBlock", timeout = 15000) {
|
|
10331
10494
|
const iniTime = Date.now();
|
|
10332
10495
|
if (type === "byTransactionId") {
|
|
10333
10496
|
while (Date.now() < iniTime + timeout) {
|
|
@@ -10336,7 +10499,9 @@ class Provider {
|
|
|
10336
10499
|
if (transactions &&
|
|
10337
10500
|
transactions[0] &&
|
|
10338
10501
|
transactions[0].containing_blocks)
|
|
10339
|
-
return
|
|
10502
|
+
return {
|
|
10503
|
+
blockId: transactions[0].containing_blocks[0],
|
|
10504
|
+
};
|
|
10340
10505
|
}
|
|
10341
10506
|
throw new Error(`Transaction not mined after ${timeout} ms`);
|
|
10342
10507
|
}
|
|
@@ -10344,6 +10509,7 @@ class Provider {
|
|
|
10344
10509
|
const findTxInBlocks = async (ini, numBlocks, idRef) => {
|
|
10345
10510
|
const blocks = await this.getBlocks(ini, numBlocks, idRef);
|
|
10346
10511
|
let bNum = 0;
|
|
10512
|
+
let bId = "";
|
|
10347
10513
|
blocks.forEach((block) => {
|
|
10348
10514
|
if (!block ||
|
|
10349
10515
|
!block.block ||
|
|
@@ -10351,11 +10517,13 @@ class Provider {
|
|
|
10351
10517
|
!block.block.transactions)
|
|
10352
10518
|
return;
|
|
10353
10519
|
const tx = block.block.transactions.find((t) => t.id === txId);
|
|
10354
|
-
if (tx)
|
|
10520
|
+
if (tx) {
|
|
10355
10521
|
bNum = Number(block.block_height);
|
|
10522
|
+
bId = block.block_id;
|
|
10523
|
+
}
|
|
10356
10524
|
});
|
|
10357
10525
|
const lastId = blocks[blocks.length - 1].block_id;
|
|
10358
|
-
return [bNum, lastId];
|
|
10526
|
+
return [bNum, bId, lastId];
|
|
10359
10527
|
};
|
|
10360
10528
|
let blockNumber = 0;
|
|
10361
10529
|
let iniBlock = 0;
|
|
@@ -10370,18 +10538,24 @@ class Provider {
|
|
|
10370
10538
|
if (Number(headTopology.height) === blockNumber - 1 &&
|
|
10371
10539
|
previousId &&
|
|
10372
10540
|
previousId !== headTopology.id) {
|
|
10373
|
-
const [bNum, lastId] = await findTxInBlocks(iniBlock, Number(headTopology.height) - iniBlock + 1, headTopology.id);
|
|
10541
|
+
const [bNum, bId, lastId] = await findTxInBlocks(iniBlock, Number(headTopology.height) - iniBlock + 1, headTopology.id);
|
|
10374
10542
|
if (bNum)
|
|
10375
|
-
return
|
|
10543
|
+
return {
|
|
10544
|
+
blockId: bId,
|
|
10545
|
+
blockNumber: bNum,
|
|
10546
|
+
};
|
|
10376
10547
|
previousId = lastId;
|
|
10377
10548
|
blockNumber = Number(headTopology.height) + 1;
|
|
10378
10549
|
}
|
|
10379
10550
|
// eslint-disable-next-line no-continue
|
|
10380
10551
|
if (blockNumber > Number(headTopology.height))
|
|
10381
10552
|
continue;
|
|
10382
|
-
const [bNum, lastId] = await findTxInBlocks(blockNumber, 1, headTopology.id);
|
|
10553
|
+
const [bNum, bId, lastId] = await findTxInBlocks(blockNumber, 1, headTopology.id);
|
|
10383
10554
|
if (bNum)
|
|
10384
|
-
return
|
|
10555
|
+
return {
|
|
10556
|
+
blockId: bId,
|
|
10557
|
+
blockNumber: bNum,
|
|
10558
|
+
};
|
|
10385
10559
|
if (!previousId)
|
|
10386
10560
|
previousId = lastId;
|
|
10387
10561
|
blockNumber += 1;
|
|
@@ -10391,12 +10565,20 @@ class Provider {
|
|
|
10391
10565
|
/**
|
|
10392
10566
|
* Function to call "chain.submit_transaction" to send a signed
|
|
10393
10567
|
* transaction to the blockchain.
|
|
10568
|
+
*
|
|
10569
|
+
* It also has the option to not broadcast the transaction (to not
|
|
10570
|
+
* include the transaction the mempool), which is useful if you
|
|
10571
|
+
* want to test the interaction with a contract and check the
|
|
10572
|
+
* possible events triggered.
|
|
10573
|
+
* @param transaction - Transaction
|
|
10574
|
+
* @param broadcast - Option to broadcast the transaction to the
|
|
10575
|
+
* whole network. By default it is true.
|
|
10394
10576
|
* @returns It returns the receipt received from the RPC node
|
|
10395
10577
|
* and the transaction with the arrow function "wait" (see [[wait]])
|
|
10396
10578
|
*/
|
|
10397
|
-
async sendTransaction(transaction) {
|
|
10398
|
-
const response = await this.call("chain.submit_transaction", { transaction });
|
|
10399
|
-
transaction.wait = async (type = "byBlock", timeout =
|
|
10579
|
+
async sendTransaction(transaction, broadcast = true) {
|
|
10580
|
+
const response = await this.call("chain.submit_transaction", { transaction, broadcast });
|
|
10581
|
+
transaction.wait = async (type = "byBlock", timeout = 15000) => {
|
|
10400
10582
|
return this.wait(transaction.id, type, timeout);
|
|
10401
10583
|
};
|
|
10402
10584
|
return { ...response, transaction: transaction };
|
|
@@ -10503,6 +10685,7 @@ class Serializer {
|
|
|
10503
10685
|
btypeDecode(valueBtypeEncoded, protobufType) {
|
|
10504
10686
|
const valueBtypeDecoded = {};
|
|
10505
10687
|
Object.keys(protobufType.fields).forEach((fieldName) => {
|
|
10688
|
+
// @ts-ignore
|
|
10506
10689
|
const { options, name, type, rule } = protobufType.fields[fieldName];
|
|
10507
10690
|
if (!valueBtypeEncoded[name])
|
|
10508
10691
|
return;
|
|
@@ -10540,6 +10723,7 @@ class Serializer {
|
|
|
10540
10723
|
btypeEncode(valueBtypeDecoded, protobufType) {
|
|
10541
10724
|
const valueBtypeEncoded = {};
|
|
10542
10725
|
Object.keys(protobufType.fields).forEach((fieldName) => {
|
|
10726
|
+
// @ts-ignore
|
|
10543
10727
|
const { options, name, type, rule } = protobufType.fields[fieldName];
|
|
10544
10728
|
if (!valueBtypeDecoded[name])
|
|
10545
10729
|
return;
|
|
@@ -10632,7 +10816,11 @@ exports["default"] = Serializer;
|
|
|
10632
10816
|
|
|
10633
10817
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10634
10818
|
if (k2 === undefined) k2 = k;
|
|
10635
|
-
Object.
|
|
10819
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10820
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10821
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10822
|
+
}
|
|
10823
|
+
Object.defineProperty(o, k2, desc);
|
|
10636
10824
|
}) : (function(o, m, k, k2) {
|
|
10637
10825
|
if (k2 === undefined) k2 = k;
|
|
10638
10826
|
o[k2] = m[k];
|
|
@@ -10803,6 +10991,10 @@ class Signer {
|
|
|
10803
10991
|
}
|
|
10804
10992
|
if (c.chainId)
|
|
10805
10993
|
this.chainId = c.chainId;
|
|
10994
|
+
this.sendOptions = {
|
|
10995
|
+
broadcast: true,
|
|
10996
|
+
...c.sendOptions,
|
|
10997
|
+
};
|
|
10806
10998
|
}
|
|
10807
10999
|
/**
|
|
10808
11000
|
* Function to import a private key from the WIF
|
|
@@ -10951,19 +11143,24 @@ class Signer {
|
|
|
10951
11143
|
/**
|
|
10952
11144
|
* Function to sign and send a transaction. It internally uses
|
|
10953
11145
|
* [[Provider.sendTransaction]]
|
|
10954
|
-
* @param
|
|
10955
|
-
* if it is not signed yet
|
|
10956
|
-
* @param
|
|
10957
|
-
* transaction. This parameter is optional.
|
|
10958
|
-
* @returns
|
|
11146
|
+
* @param transaction - Transaction to send. It will be signed inside this
|
|
11147
|
+
* function if it is not signed yet
|
|
11148
|
+
* @param options - Options for sending the transaction
|
|
10959
11149
|
*/
|
|
10960
|
-
async sendTransaction(
|
|
11150
|
+
async sendTransaction(transaction, options) {
|
|
10961
11151
|
var _a;
|
|
10962
|
-
if (!
|
|
10963
|
-
|
|
11152
|
+
if (!transaction.signatures || !((_a = transaction.signatures) === null || _a === void 0 ? void 0 : _a.length))
|
|
11153
|
+
transaction = await this.signTransaction(transaction);
|
|
10964
11154
|
if (!this.provider)
|
|
10965
11155
|
throw new Error("provider is undefined");
|
|
10966
|
-
|
|
11156
|
+
const opts = {
|
|
11157
|
+
...this.sendOptions,
|
|
11158
|
+
...options,
|
|
11159
|
+
};
|
|
11160
|
+
if (opts.beforeSend) {
|
|
11161
|
+
await opts.beforeSend(transaction);
|
|
11162
|
+
}
|
|
11163
|
+
return this.provider.sendTransaction(transaction, opts.broadcast);
|
|
10967
11164
|
}
|
|
10968
11165
|
/**
|
|
10969
11166
|
* Function to recover the public key from hash and signature
|
|
@@ -11293,7 +11490,11 @@ exports["default"] = Signer;
|
|
|
11293
11490
|
/*! koilib - MIT License (c) Julian Gonzalez (joticajulian@gmail.com) */
|
|
11294
11491
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11295
11492
|
if (k2 === undefined) k2 = k;
|
|
11296
|
-
Object.
|
|
11493
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11494
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11495
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11496
|
+
}
|
|
11497
|
+
Object.defineProperty(o, k2, desc);
|
|
11297
11498
|
}) : (function(o, m, k, k2) {
|
|
11298
11499
|
if (k2 === undefined) k2 = k;
|
|
11299
11500
|
o[k2] = m[k];
|
|
@@ -11332,7 +11533,11 @@ window.Serializer = Serializer_1.Serializer;
|
|
|
11332
11533
|
|
|
11333
11534
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11334
11535
|
if (k2 === undefined) k2 = k;
|
|
11335
|
-
Object.
|
|
11536
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11537
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11538
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11539
|
+
}
|
|
11540
|
+
Object.defineProperty(o, k2, desc);
|
|
11336
11541
|
}) : (function(o, m, k, k2) {
|
|
11337
11542
|
if (k2 === undefined) k2 = k;
|
|
11338
11543
|
o[k2] = m[k];
|
|
@@ -11938,23 +12143,28 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
11938
12143
|
while (reader.pos < end) {
|
|
11939
12144
|
var tag = reader.uint32();
|
|
11940
12145
|
switch (tag >>> 3) {
|
|
11941
|
-
case 1:
|
|
12146
|
+
case 1: {
|
|
11942
12147
|
message.sequence = reader.uint32();
|
|
11943
12148
|
break;
|
|
11944
|
-
|
|
12149
|
+
}
|
|
12150
|
+
case 2: {
|
|
11945
12151
|
message.source = reader.bytes();
|
|
11946
12152
|
break;
|
|
11947
|
-
|
|
12153
|
+
}
|
|
12154
|
+
case 3: {
|
|
11948
12155
|
message.name = reader.string();
|
|
11949
12156
|
break;
|
|
11950
|
-
|
|
12157
|
+
}
|
|
12158
|
+
case 4: {
|
|
11951
12159
|
message.data = reader.bytes();
|
|
11952
12160
|
break;
|
|
11953
|
-
|
|
12161
|
+
}
|
|
12162
|
+
case 5: {
|
|
11954
12163
|
if (!(message.impacted && message.impacted.length))
|
|
11955
12164
|
message.impacted = [];
|
|
11956
12165
|
message.impacted.push(reader.bytes());
|
|
11957
12166
|
break;
|
|
12167
|
+
}
|
|
11958
12168
|
default:
|
|
11959
12169
|
reader.skipType(tag & 7);
|
|
11960
12170
|
break;
|
|
@@ -12047,7 +12257,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
12047
12257
|
)),
|
|
12048
12258
|
0
|
|
12049
12259
|
);
|
|
12050
|
-
else if (object.source.length) message.source = object.source;
|
|
12260
|
+
else if (object.source.length >= 0) message.source = object.source;
|
|
12051
12261
|
if (object.name != null) message.name = String(object.name);
|
|
12052
12262
|
if (object.data != null)
|
|
12053
12263
|
if (typeof object.data === "string")
|
|
@@ -12058,7 +12268,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
12058
12268
|
)),
|
|
12059
12269
|
0
|
|
12060
12270
|
);
|
|
12061
|
-
else if (object.data.length) message.data = object.data;
|
|
12271
|
+
else if (object.data.length >= 0) message.data = object.data;
|
|
12062
12272
|
if (object.impacted) {
|
|
12063
12273
|
if (!Array.isArray(object.impacted))
|
|
12064
12274
|
throw TypeError(
|
|
@@ -12074,7 +12284,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
12074
12284
|
)),
|
|
12075
12285
|
0
|
|
12076
12286
|
);
|
|
12077
|
-
else if (object.impacted[i].length)
|
|
12287
|
+
else if (object.impacted[i].length >= 0)
|
|
12078
12288
|
message.impacted[i] = object.impacted[i];
|
|
12079
12289
|
}
|
|
12080
12290
|
return message;
|
|
@@ -12155,6 +12365,21 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
12155
12365
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
12156
12366
|
};
|
|
12157
12367
|
|
|
12368
|
+
/**
|
|
12369
|
+
* Gets the default type url for event_data
|
|
12370
|
+
* @function getTypeUrl
|
|
12371
|
+
* @memberof koinos.protocol.event_data
|
|
12372
|
+
* @static
|
|
12373
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
12374
|
+
* @returns {string} The default type url
|
|
12375
|
+
*/
|
|
12376
|
+
event_data.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
12377
|
+
if (typeUrlPrefix === undefined) {
|
|
12378
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
12379
|
+
}
|
|
12380
|
+
return typeUrlPrefix + "/koinos.protocol.event_data";
|
|
12381
|
+
};
|
|
12382
|
+
|
|
12158
12383
|
return event_data;
|
|
12159
12384
|
})();
|
|
12160
12385
|
|
|
@@ -12276,12 +12501,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
12276
12501
|
while (reader.pos < end) {
|
|
12277
12502
|
var tag = reader.uint32();
|
|
12278
12503
|
switch (tag >>> 3) {
|
|
12279
|
-
case 1:
|
|
12504
|
+
case 1: {
|
|
12280
12505
|
message.contract_id = reader.bytes();
|
|
12281
12506
|
break;
|
|
12282
|
-
|
|
12507
|
+
}
|
|
12508
|
+
case 2: {
|
|
12283
12509
|
message.entry_point = reader.uint32();
|
|
12284
12510
|
break;
|
|
12511
|
+
}
|
|
12285
12512
|
default:
|
|
12286
12513
|
reader.skipType(tag & 7);
|
|
12287
12514
|
break;
|
|
@@ -12360,7 +12587,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
12360
12587
|
)),
|
|
12361
12588
|
0
|
|
12362
12589
|
);
|
|
12363
|
-
else if (object.contract_id.length)
|
|
12590
|
+
else if (object.contract_id.length >= 0)
|
|
12364
12591
|
message.contract_id = object.contract_id;
|
|
12365
12592
|
if (object.entry_point != null)
|
|
12366
12593
|
message.entry_point = object.entry_point >>> 0;
|
|
@@ -12421,6 +12648,21 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
12421
12648
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
12422
12649
|
};
|
|
12423
12650
|
|
|
12651
|
+
/**
|
|
12652
|
+
* Gets the default type url for contract_call_bundle
|
|
12653
|
+
* @function getTypeUrl
|
|
12654
|
+
* @memberof koinos.protocol.contract_call_bundle
|
|
12655
|
+
* @static
|
|
12656
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
12657
|
+
* @returns {string} The default type url
|
|
12658
|
+
*/
|
|
12659
|
+
contract_call_bundle.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
12660
|
+
if (typeUrlPrefix === undefined) {
|
|
12661
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
12662
|
+
}
|
|
12663
|
+
return typeUrlPrefix + "/koinos.protocol.contract_call_bundle";
|
|
12664
|
+
};
|
|
12665
|
+
|
|
12424
12666
|
return contract_call_bundle;
|
|
12425
12667
|
})();
|
|
12426
12668
|
|
|
@@ -12559,16 +12801,18 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
12559
12801
|
while (reader.pos < end) {
|
|
12560
12802
|
var tag = reader.uint32();
|
|
12561
12803
|
switch (tag >>> 3) {
|
|
12562
|
-
case 1:
|
|
12804
|
+
case 1: {
|
|
12563
12805
|
message.thunk_id = reader.uint32();
|
|
12564
12806
|
break;
|
|
12565
|
-
|
|
12807
|
+
}
|
|
12808
|
+
case 2: {
|
|
12566
12809
|
message.system_call_bundle =
|
|
12567
12810
|
$root.koinos.protocol.contract_call_bundle.decode(
|
|
12568
12811
|
reader,
|
|
12569
12812
|
reader.uint32()
|
|
12570
12813
|
);
|
|
12571
12814
|
break;
|
|
12815
|
+
}
|
|
12572
12816
|
default:
|
|
12573
12817
|
reader.skipType(tag & 7);
|
|
12574
12818
|
break;
|
|
@@ -12692,6 +12936,21 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
12692
12936
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
12693
12937
|
};
|
|
12694
12938
|
|
|
12939
|
+
/**
|
|
12940
|
+
* Gets the default type url for system_call_target
|
|
12941
|
+
* @function getTypeUrl
|
|
12942
|
+
* @memberof koinos.protocol.system_call_target
|
|
12943
|
+
* @static
|
|
12944
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
12945
|
+
* @returns {string} The default type url
|
|
12946
|
+
*/
|
|
12947
|
+
system_call_target.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
12948
|
+
if (typeUrlPrefix === undefined) {
|
|
12949
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
12950
|
+
}
|
|
12951
|
+
return typeUrlPrefix + "/koinos.protocol.system_call_target";
|
|
12952
|
+
};
|
|
12953
|
+
|
|
12695
12954
|
return system_call_target;
|
|
12696
12955
|
})();
|
|
12697
12956
|
|
|
@@ -12873,24 +13132,30 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
12873
13132
|
while (reader.pos < end) {
|
|
12874
13133
|
var tag = reader.uint32();
|
|
12875
13134
|
switch (tag >>> 3) {
|
|
12876
|
-
case 1:
|
|
13135
|
+
case 1: {
|
|
12877
13136
|
message.contract_id = reader.bytes();
|
|
12878
13137
|
break;
|
|
12879
|
-
|
|
13138
|
+
}
|
|
13139
|
+
case 2: {
|
|
12880
13140
|
message.bytecode = reader.bytes();
|
|
12881
13141
|
break;
|
|
12882
|
-
|
|
13142
|
+
}
|
|
13143
|
+
case 3: {
|
|
12883
13144
|
message.abi = reader.string();
|
|
12884
13145
|
break;
|
|
12885
|
-
|
|
13146
|
+
}
|
|
13147
|
+
case 4: {
|
|
12886
13148
|
message.authorizes_call_contract = reader.bool();
|
|
12887
13149
|
break;
|
|
12888
|
-
|
|
13150
|
+
}
|
|
13151
|
+
case 5: {
|
|
12889
13152
|
message.authorizes_transaction_application = reader.bool();
|
|
12890
13153
|
break;
|
|
12891
|
-
|
|
13154
|
+
}
|
|
13155
|
+
case 6: {
|
|
12892
13156
|
message.authorizes_upload_contract = reader.bool();
|
|
12893
13157
|
break;
|
|
13158
|
+
}
|
|
12894
13159
|
default:
|
|
12895
13160
|
reader.skipType(tag & 7);
|
|
12896
13161
|
break;
|
|
@@ -12992,7 +13257,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
12992
13257
|
)),
|
|
12993
13258
|
0
|
|
12994
13259
|
);
|
|
12995
|
-
else if (object.contract_id.length)
|
|
13260
|
+
else if (object.contract_id.length >= 0)
|
|
12996
13261
|
message.contract_id = object.contract_id;
|
|
12997
13262
|
if (object.bytecode != null)
|
|
12998
13263
|
if (typeof object.bytecode === "string")
|
|
@@ -13003,7 +13268,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
13003
13268
|
)),
|
|
13004
13269
|
0
|
|
13005
13270
|
);
|
|
13006
|
-
else if (object.bytecode.length
|
|
13271
|
+
else if (object.bytecode.length >= 0)
|
|
13272
|
+
message.bytecode = object.bytecode;
|
|
13007
13273
|
if (object.abi != null) message.abi = String(object.abi);
|
|
13008
13274
|
if (object.authorizes_call_contract != null)
|
|
13009
13275
|
message.authorizes_call_contract = Boolean(
|
|
@@ -13111,6 +13377,23 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
13111
13377
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
13112
13378
|
};
|
|
13113
13379
|
|
|
13380
|
+
/**
|
|
13381
|
+
* Gets the default type url for upload_contract_operation
|
|
13382
|
+
* @function getTypeUrl
|
|
13383
|
+
* @memberof koinos.protocol.upload_contract_operation
|
|
13384
|
+
* @static
|
|
13385
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
13386
|
+
* @returns {string} The default type url
|
|
13387
|
+
*/
|
|
13388
|
+
upload_contract_operation.getTypeUrl = function getTypeUrl(
|
|
13389
|
+
typeUrlPrefix
|
|
13390
|
+
) {
|
|
13391
|
+
if (typeUrlPrefix === undefined) {
|
|
13392
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
13393
|
+
}
|
|
13394
|
+
return typeUrlPrefix + "/koinos.protocol.upload_contract_operation";
|
|
13395
|
+
};
|
|
13396
|
+
|
|
13114
13397
|
return upload_contract_operation;
|
|
13115
13398
|
})();
|
|
13116
13399
|
|
|
@@ -13246,15 +13529,18 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
13246
13529
|
while (reader.pos < end) {
|
|
13247
13530
|
var tag = reader.uint32();
|
|
13248
13531
|
switch (tag >>> 3) {
|
|
13249
|
-
case 1:
|
|
13532
|
+
case 1: {
|
|
13250
13533
|
message.contract_id = reader.bytes();
|
|
13251
13534
|
break;
|
|
13252
|
-
|
|
13535
|
+
}
|
|
13536
|
+
case 2: {
|
|
13253
13537
|
message.entry_point = reader.uint32();
|
|
13254
13538
|
break;
|
|
13255
|
-
|
|
13539
|
+
}
|
|
13540
|
+
case 3: {
|
|
13256
13541
|
message.args = reader.bytes();
|
|
13257
13542
|
break;
|
|
13543
|
+
}
|
|
13258
13544
|
default:
|
|
13259
13545
|
reader.skipType(tag & 7);
|
|
13260
13546
|
break;
|
|
@@ -13341,7 +13627,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
13341
13627
|
)),
|
|
13342
13628
|
0
|
|
13343
13629
|
);
|
|
13344
|
-
else if (object.contract_id.length)
|
|
13630
|
+
else if (object.contract_id.length >= 0)
|
|
13345
13631
|
message.contract_id = object.contract_id;
|
|
13346
13632
|
if (object.entry_point != null)
|
|
13347
13633
|
message.entry_point = object.entry_point >>> 0;
|
|
@@ -13354,7 +13640,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
13354
13640
|
)),
|
|
13355
13641
|
0
|
|
13356
13642
|
);
|
|
13357
|
-
else if (object.args.length) message.args = object.args;
|
|
13643
|
+
else if (object.args.length >= 0) message.args = object.args;
|
|
13358
13644
|
return message;
|
|
13359
13645
|
};
|
|
13360
13646
|
|
|
@@ -13425,6 +13711,23 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
13425
13711
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
13426
13712
|
};
|
|
13427
13713
|
|
|
13714
|
+
/**
|
|
13715
|
+
* Gets the default type url for call_contract_operation
|
|
13716
|
+
* @function getTypeUrl
|
|
13717
|
+
* @memberof koinos.protocol.call_contract_operation
|
|
13718
|
+
* @static
|
|
13719
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
13720
|
+
* @returns {string} The default type url
|
|
13721
|
+
*/
|
|
13722
|
+
call_contract_operation.getTypeUrl = function getTypeUrl(
|
|
13723
|
+
typeUrlPrefix
|
|
13724
|
+
) {
|
|
13725
|
+
if (typeUrlPrefix === undefined) {
|
|
13726
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
13727
|
+
}
|
|
13728
|
+
return typeUrlPrefix + "/koinos.protocol.call_contract_operation";
|
|
13729
|
+
};
|
|
13730
|
+
|
|
13428
13731
|
return call_contract_operation;
|
|
13429
13732
|
})();
|
|
13430
13733
|
|
|
@@ -13547,16 +13850,18 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
13547
13850
|
while (reader.pos < end) {
|
|
13548
13851
|
var tag = reader.uint32();
|
|
13549
13852
|
switch (tag >>> 3) {
|
|
13550
|
-
case 1:
|
|
13853
|
+
case 1: {
|
|
13551
13854
|
message.call_id = reader.uint32();
|
|
13552
13855
|
break;
|
|
13553
|
-
|
|
13856
|
+
}
|
|
13857
|
+
case 2: {
|
|
13554
13858
|
message.target =
|
|
13555
13859
|
$root.koinos.protocol.system_call_target.decode(
|
|
13556
13860
|
reader,
|
|
13557
13861
|
reader.uint32()
|
|
13558
13862
|
);
|
|
13559
13863
|
break;
|
|
13864
|
+
}
|
|
13560
13865
|
default:
|
|
13561
13866
|
reader.skipType(tag & 7);
|
|
13562
13867
|
break;
|
|
@@ -13671,6 +13976,23 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
13671
13976
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
13672
13977
|
};
|
|
13673
13978
|
|
|
13979
|
+
/**
|
|
13980
|
+
* Gets the default type url for set_system_call_operation
|
|
13981
|
+
* @function getTypeUrl
|
|
13982
|
+
* @memberof koinos.protocol.set_system_call_operation
|
|
13983
|
+
* @static
|
|
13984
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
13985
|
+
* @returns {string} The default type url
|
|
13986
|
+
*/
|
|
13987
|
+
set_system_call_operation.getTypeUrl = function getTypeUrl(
|
|
13988
|
+
typeUrlPrefix
|
|
13989
|
+
) {
|
|
13990
|
+
if (typeUrlPrefix === undefined) {
|
|
13991
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
13992
|
+
}
|
|
13993
|
+
return typeUrlPrefix + "/koinos.protocol.set_system_call_operation";
|
|
13994
|
+
};
|
|
13995
|
+
|
|
13674
13996
|
return set_system_call_operation;
|
|
13675
13997
|
})();
|
|
13676
13998
|
|
|
@@ -13795,12 +14117,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
13795
14117
|
while (reader.pos < end) {
|
|
13796
14118
|
var tag = reader.uint32();
|
|
13797
14119
|
switch (tag >>> 3) {
|
|
13798
|
-
case 1:
|
|
14120
|
+
case 1: {
|
|
13799
14121
|
message.contract_id = reader.bytes();
|
|
13800
14122
|
break;
|
|
13801
|
-
|
|
14123
|
+
}
|
|
14124
|
+
case 2: {
|
|
13802
14125
|
message.system_contract = reader.bool();
|
|
13803
14126
|
break;
|
|
14127
|
+
}
|
|
13804
14128
|
default:
|
|
13805
14129
|
reader.skipType(tag & 7);
|
|
13806
14130
|
break;
|
|
@@ -13882,7 +14206,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
13882
14206
|
)),
|
|
13883
14207
|
0
|
|
13884
14208
|
);
|
|
13885
|
-
else if (object.contract_id.length)
|
|
14209
|
+
else if (object.contract_id.length >= 0)
|
|
13886
14210
|
message.contract_id = object.contract_id;
|
|
13887
14211
|
if (object.system_contract != null)
|
|
13888
14212
|
message.system_contract = Boolean(object.system_contract);
|
|
@@ -13946,6 +14270,25 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
13946
14270
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
13947
14271
|
};
|
|
13948
14272
|
|
|
14273
|
+
/**
|
|
14274
|
+
* Gets the default type url for set_system_contract_operation
|
|
14275
|
+
* @function getTypeUrl
|
|
14276
|
+
* @memberof koinos.protocol.set_system_contract_operation
|
|
14277
|
+
* @static
|
|
14278
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
14279
|
+
* @returns {string} The default type url
|
|
14280
|
+
*/
|
|
14281
|
+
set_system_contract_operation.getTypeUrl = function getTypeUrl(
|
|
14282
|
+
typeUrlPrefix
|
|
14283
|
+
) {
|
|
14284
|
+
if (typeUrlPrefix === undefined) {
|
|
14285
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
14286
|
+
}
|
|
14287
|
+
return (
|
|
14288
|
+
typeUrlPrefix + "/koinos.protocol.set_system_contract_operation"
|
|
14289
|
+
);
|
|
14290
|
+
};
|
|
14291
|
+
|
|
13949
14292
|
return set_system_contract_operation;
|
|
13950
14293
|
})();
|
|
13951
14294
|
|
|
@@ -14129,34 +14472,38 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
14129
14472
|
while (reader.pos < end) {
|
|
14130
14473
|
var tag = reader.uint32();
|
|
14131
14474
|
switch (tag >>> 3) {
|
|
14132
|
-
case 1:
|
|
14475
|
+
case 1: {
|
|
14133
14476
|
message.upload_contract =
|
|
14134
14477
|
$root.koinos.protocol.upload_contract_operation.decode(
|
|
14135
14478
|
reader,
|
|
14136
14479
|
reader.uint32()
|
|
14137
14480
|
);
|
|
14138
14481
|
break;
|
|
14139
|
-
|
|
14482
|
+
}
|
|
14483
|
+
case 2: {
|
|
14140
14484
|
message.call_contract =
|
|
14141
14485
|
$root.koinos.protocol.call_contract_operation.decode(
|
|
14142
14486
|
reader,
|
|
14143
14487
|
reader.uint32()
|
|
14144
14488
|
);
|
|
14145
14489
|
break;
|
|
14146
|
-
|
|
14490
|
+
}
|
|
14491
|
+
case 3: {
|
|
14147
14492
|
message.set_system_call =
|
|
14148
14493
|
$root.koinos.protocol.set_system_call_operation.decode(
|
|
14149
14494
|
reader,
|
|
14150
14495
|
reader.uint32()
|
|
14151
14496
|
);
|
|
14152
14497
|
break;
|
|
14153
|
-
|
|
14498
|
+
}
|
|
14499
|
+
case 4: {
|
|
14154
14500
|
message.set_system_contract =
|
|
14155
14501
|
$root.koinos.protocol.set_system_contract_operation.decode(
|
|
14156
14502
|
reader,
|
|
14157
14503
|
reader.uint32()
|
|
14158
14504
|
);
|
|
14159
14505
|
break;
|
|
14506
|
+
}
|
|
14160
14507
|
default:
|
|
14161
14508
|
reader.skipType(tag & 7);
|
|
14162
14509
|
break;
|
|
@@ -14373,6 +14720,21 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
14373
14720
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
14374
14721
|
};
|
|
14375
14722
|
|
|
14723
|
+
/**
|
|
14724
|
+
* Gets the default type url for operation
|
|
14725
|
+
* @function getTypeUrl
|
|
14726
|
+
* @memberof koinos.protocol.operation
|
|
14727
|
+
* @static
|
|
14728
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
14729
|
+
* @returns {string} The default type url
|
|
14730
|
+
*/
|
|
14731
|
+
operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
14732
|
+
if (typeUrlPrefix === undefined) {
|
|
14733
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
14734
|
+
}
|
|
14735
|
+
return typeUrlPrefix + "/koinos.protocol.operation";
|
|
14736
|
+
};
|
|
14737
|
+
|
|
14376
14738
|
return operation;
|
|
14377
14739
|
})();
|
|
14378
14740
|
|
|
@@ -14552,24 +14914,30 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
14552
14914
|
while (reader.pos < end) {
|
|
14553
14915
|
var tag = reader.uint32();
|
|
14554
14916
|
switch (tag >>> 3) {
|
|
14555
|
-
case 1:
|
|
14917
|
+
case 1: {
|
|
14556
14918
|
message.chain_id = reader.bytes();
|
|
14557
14919
|
break;
|
|
14558
|
-
|
|
14920
|
+
}
|
|
14921
|
+
case 2: {
|
|
14559
14922
|
message.rc_limit = reader.uint64();
|
|
14560
14923
|
break;
|
|
14561
|
-
|
|
14924
|
+
}
|
|
14925
|
+
case 3: {
|
|
14562
14926
|
message.nonce = reader.bytes();
|
|
14563
14927
|
break;
|
|
14564
|
-
|
|
14928
|
+
}
|
|
14929
|
+
case 4: {
|
|
14565
14930
|
message.operation_merkle_root = reader.bytes();
|
|
14566
14931
|
break;
|
|
14567
|
-
|
|
14932
|
+
}
|
|
14933
|
+
case 5: {
|
|
14568
14934
|
message.payer = reader.bytes();
|
|
14569
14935
|
break;
|
|
14570
|
-
|
|
14936
|
+
}
|
|
14937
|
+
case 6: {
|
|
14571
14938
|
message.payee = reader.bytes();
|
|
14572
14939
|
break;
|
|
14940
|
+
}
|
|
14573
14941
|
default:
|
|
14574
14942
|
reader.skipType(tag & 7);
|
|
14575
14943
|
break;
|
|
@@ -14683,7 +15051,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
14683
15051
|
)),
|
|
14684
15052
|
0
|
|
14685
15053
|
);
|
|
14686
|
-
else if (object.chain_id.length
|
|
15054
|
+
else if (object.chain_id.length >= 0)
|
|
15055
|
+
message.chain_id = object.chain_id;
|
|
14687
15056
|
if (object.rc_limit != null)
|
|
14688
15057
|
if ($util.Long)
|
|
14689
15058
|
(message.rc_limit = $util.Long.fromValue(
|
|
@@ -14707,7 +15076,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
14707
15076
|
)),
|
|
14708
15077
|
0
|
|
14709
15078
|
);
|
|
14710
|
-
else if (object.nonce.length) message.nonce = object.nonce;
|
|
15079
|
+
else if (object.nonce.length >= 0) message.nonce = object.nonce;
|
|
14711
15080
|
if (object.operation_merkle_root != null)
|
|
14712
15081
|
if (typeof object.operation_merkle_root === "string")
|
|
14713
15082
|
$util.base64.decode(
|
|
@@ -14717,7 +15086,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
14717
15086
|
)),
|
|
14718
15087
|
0
|
|
14719
15088
|
);
|
|
14720
|
-
else if (object.operation_merkle_root.length)
|
|
15089
|
+
else if (object.operation_merkle_root.length >= 0)
|
|
14721
15090
|
message.operation_merkle_root = object.operation_merkle_root;
|
|
14722
15091
|
if (object.payer != null)
|
|
14723
15092
|
if (typeof object.payer === "string")
|
|
@@ -14728,7 +15097,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
14728
15097
|
)),
|
|
14729
15098
|
0
|
|
14730
15099
|
);
|
|
14731
|
-
else if (object.payer.length) message.payer = object.payer;
|
|
15100
|
+
else if (object.payer.length >= 0) message.payer = object.payer;
|
|
14732
15101
|
if (object.payee != null)
|
|
14733
15102
|
if (typeof object.payee === "string")
|
|
14734
15103
|
$util.base64.decode(
|
|
@@ -14738,7 +15107,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
14738
15107
|
)),
|
|
14739
15108
|
0
|
|
14740
15109
|
);
|
|
14741
|
-
else if (object.payee.length) message.payee = object.payee;
|
|
15110
|
+
else if (object.payee.length >= 0) message.payee = object.payee;
|
|
14742
15111
|
return message;
|
|
14743
15112
|
};
|
|
14744
15113
|
|
|
@@ -14873,6 +15242,21 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
14873
15242
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
14874
15243
|
};
|
|
14875
15244
|
|
|
15245
|
+
/**
|
|
15246
|
+
* Gets the default type url for transaction_header
|
|
15247
|
+
* @function getTypeUrl
|
|
15248
|
+
* @memberof koinos.protocol.transaction_header
|
|
15249
|
+
* @static
|
|
15250
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
15251
|
+
* @returns {string} The default type url
|
|
15252
|
+
*/
|
|
15253
|
+
transaction_header.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
15254
|
+
if (typeUrlPrefix === undefined) {
|
|
15255
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
15256
|
+
}
|
|
15257
|
+
return typeUrlPrefix + "/koinos.protocol.transaction_header";
|
|
15258
|
+
};
|
|
15259
|
+
|
|
14876
15260
|
return transaction_header;
|
|
14877
15261
|
})();
|
|
14878
15262
|
|
|
@@ -15025,17 +15409,19 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
15025
15409
|
while (reader.pos < end) {
|
|
15026
15410
|
var tag = reader.uint32();
|
|
15027
15411
|
switch (tag >>> 3) {
|
|
15028
|
-
case 1:
|
|
15412
|
+
case 1: {
|
|
15029
15413
|
message.id = reader.bytes();
|
|
15030
15414
|
break;
|
|
15031
|
-
|
|
15415
|
+
}
|
|
15416
|
+
case 2: {
|
|
15032
15417
|
message.header =
|
|
15033
15418
|
$root.koinos.protocol.transaction_header.decode(
|
|
15034
15419
|
reader,
|
|
15035
15420
|
reader.uint32()
|
|
15036
15421
|
);
|
|
15037
15422
|
break;
|
|
15038
|
-
|
|
15423
|
+
}
|
|
15424
|
+
case 3: {
|
|
15039
15425
|
if (!(message.operations && message.operations.length))
|
|
15040
15426
|
message.operations = [];
|
|
15041
15427
|
message.operations.push(
|
|
@@ -15045,11 +15431,13 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
15045
15431
|
)
|
|
15046
15432
|
);
|
|
15047
15433
|
break;
|
|
15048
|
-
|
|
15434
|
+
}
|
|
15435
|
+
case 4: {
|
|
15049
15436
|
if (!(message.signatures && message.signatures.length))
|
|
15050
15437
|
message.signatures = [];
|
|
15051
15438
|
message.signatures.push(reader.bytes());
|
|
15052
15439
|
break;
|
|
15440
|
+
}
|
|
15053
15441
|
default:
|
|
15054
15442
|
reader.skipType(tag & 7);
|
|
15055
15443
|
break;
|
|
@@ -15149,7 +15537,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
15149
15537
|
(message.id = $util.newBuffer($util.base64.length(object.id))),
|
|
15150
15538
|
0
|
|
15151
15539
|
);
|
|
15152
|
-
else if (object.id.length) message.id = object.id;
|
|
15540
|
+
else if (object.id.length >= 0) message.id = object.id;
|
|
15153
15541
|
if (object.header != null) {
|
|
15154
15542
|
if (typeof object.header !== "object")
|
|
15155
15543
|
throw TypeError(
|
|
@@ -15192,7 +15580,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
15192
15580
|
)),
|
|
15193
15581
|
0
|
|
15194
15582
|
);
|
|
15195
|
-
else if (object.signatures[i].length)
|
|
15583
|
+
else if (object.signatures[i].length >= 0)
|
|
15196
15584
|
message.signatures[i] = object.signatures[i];
|
|
15197
15585
|
}
|
|
15198
15586
|
return message;
|
|
@@ -15271,6 +15659,21 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
15271
15659
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
15272
15660
|
};
|
|
15273
15661
|
|
|
15662
|
+
/**
|
|
15663
|
+
* Gets the default type url for transaction
|
|
15664
|
+
* @function getTypeUrl
|
|
15665
|
+
* @memberof koinos.protocol.transaction
|
|
15666
|
+
* @static
|
|
15667
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
15668
|
+
* @returns {string} The default type url
|
|
15669
|
+
*/
|
|
15670
|
+
transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
15671
|
+
if (typeUrlPrefix === undefined) {
|
|
15672
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
15673
|
+
}
|
|
15674
|
+
return typeUrlPrefix + "/koinos.protocol.transaction";
|
|
15675
|
+
};
|
|
15676
|
+
|
|
15274
15677
|
return transaction;
|
|
15275
15678
|
})();
|
|
15276
15679
|
|
|
@@ -15536,34 +15939,43 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
15536
15939
|
while (reader.pos < end) {
|
|
15537
15940
|
var tag = reader.uint32();
|
|
15538
15941
|
switch (tag >>> 3) {
|
|
15539
|
-
case 1:
|
|
15942
|
+
case 1: {
|
|
15540
15943
|
message.id = reader.bytes();
|
|
15541
15944
|
break;
|
|
15542
|
-
|
|
15945
|
+
}
|
|
15946
|
+
case 2: {
|
|
15543
15947
|
message.payer = reader.bytes();
|
|
15544
15948
|
break;
|
|
15545
|
-
|
|
15949
|
+
}
|
|
15950
|
+
case 3: {
|
|
15546
15951
|
message.max_payer_rc = reader.uint64();
|
|
15547
15952
|
break;
|
|
15548
|
-
|
|
15953
|
+
}
|
|
15954
|
+
case 4: {
|
|
15549
15955
|
message.rc_limit = reader.uint64();
|
|
15550
15956
|
break;
|
|
15551
|
-
|
|
15957
|
+
}
|
|
15958
|
+
case 5: {
|
|
15552
15959
|
message.rc_used = reader.uint64();
|
|
15553
15960
|
break;
|
|
15554
|
-
|
|
15961
|
+
}
|
|
15962
|
+
case 6: {
|
|
15555
15963
|
message.disk_storage_used = reader.uint64();
|
|
15556
15964
|
break;
|
|
15557
|
-
|
|
15965
|
+
}
|
|
15966
|
+
case 7: {
|
|
15558
15967
|
message.network_bandwidth_used = reader.uint64();
|
|
15559
15968
|
break;
|
|
15560
|
-
|
|
15969
|
+
}
|
|
15970
|
+
case 8: {
|
|
15561
15971
|
message.compute_bandwidth_used = reader.uint64();
|
|
15562
15972
|
break;
|
|
15563
|
-
|
|
15973
|
+
}
|
|
15974
|
+
case 9: {
|
|
15564
15975
|
message.reverted = reader.bool();
|
|
15565
15976
|
break;
|
|
15566
|
-
|
|
15977
|
+
}
|
|
15978
|
+
case 10: {
|
|
15567
15979
|
if (!(message.events && message.events.length))
|
|
15568
15980
|
message.events = [];
|
|
15569
15981
|
message.events.push(
|
|
@@ -15573,10 +15985,12 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
15573
15985
|
)
|
|
15574
15986
|
);
|
|
15575
15987
|
break;
|
|
15576
|
-
|
|
15988
|
+
}
|
|
15989
|
+
case 11: {
|
|
15577
15990
|
if (!(message.logs && message.logs.length)) message.logs = [];
|
|
15578
15991
|
message.logs.push(reader.string());
|
|
15579
15992
|
break;
|
|
15993
|
+
}
|
|
15580
15994
|
default:
|
|
15581
15995
|
reader.skipType(tag & 7);
|
|
15582
15996
|
break;
|
|
@@ -15739,7 +16153,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
15739
16153
|
(message.id = $util.newBuffer($util.base64.length(object.id))),
|
|
15740
16154
|
0
|
|
15741
16155
|
);
|
|
15742
|
-
else if (object.id.length) message.id = object.id;
|
|
16156
|
+
else if (object.id.length >= 0) message.id = object.id;
|
|
15743
16157
|
if (object.payer != null)
|
|
15744
16158
|
if (typeof object.payer === "string")
|
|
15745
16159
|
$util.base64.decode(
|
|
@@ -15749,7 +16163,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
15749
16163
|
)),
|
|
15750
16164
|
0
|
|
15751
16165
|
);
|
|
15752
|
-
else if (object.payer.length) message.payer = object.payer;
|
|
16166
|
+
else if (object.payer.length >= 0) message.payer = object.payer;
|
|
15753
16167
|
if (object.max_payer_rc != null)
|
|
15754
16168
|
if ($util.Long)
|
|
15755
16169
|
(message.max_payer_rc = $util.Long.fromValue(
|
|
@@ -16120,6 +16534,21 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16120
16534
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
16121
16535
|
};
|
|
16122
16536
|
|
|
16537
|
+
/**
|
|
16538
|
+
* Gets the default type url for transaction_receipt
|
|
16539
|
+
* @function getTypeUrl
|
|
16540
|
+
* @memberof koinos.protocol.transaction_receipt
|
|
16541
|
+
* @static
|
|
16542
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
16543
|
+
* @returns {string} The default type url
|
|
16544
|
+
*/
|
|
16545
|
+
transaction_receipt.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
16546
|
+
if (typeUrlPrefix === undefined) {
|
|
16547
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
16548
|
+
}
|
|
16549
|
+
return typeUrlPrefix + "/koinos.protocol.transaction_receipt";
|
|
16550
|
+
};
|
|
16551
|
+
|
|
16123
16552
|
return transaction_receipt;
|
|
16124
16553
|
})();
|
|
16125
16554
|
|
|
@@ -16134,6 +16563,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16134
16563
|
* @property {Uint8Array|null} [previous_state_merkle_root] block_header previous_state_merkle_root
|
|
16135
16564
|
* @property {Uint8Array|null} [transaction_merkle_root] block_header transaction_merkle_root
|
|
16136
16565
|
* @property {Uint8Array|null} [signer] block_header signer
|
|
16566
|
+
* @property {Array.<Uint8Array>|null} [approved_proposals] block_header approved_proposals
|
|
16137
16567
|
*/
|
|
16138
16568
|
|
|
16139
16569
|
/**
|
|
@@ -16145,6 +16575,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16145
16575
|
* @param {koinos.protocol.Iblock_header=} [properties] Properties to set
|
|
16146
16576
|
*/
|
|
16147
16577
|
function block_header(properties) {
|
|
16578
|
+
this.approved_proposals = [];
|
|
16148
16579
|
if (properties)
|
|
16149
16580
|
for (
|
|
16150
16581
|
var keys = Object.keys(properties), i = 0;
|
|
@@ -16207,6 +16638,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16207
16638
|
*/
|
|
16208
16639
|
block_header.prototype.signer = $util.newBuffer([]);
|
|
16209
16640
|
|
|
16641
|
+
/**
|
|
16642
|
+
* block_header approved_proposals.
|
|
16643
|
+
* @member {Array.<Uint8Array>} approved_proposals
|
|
16644
|
+
* @memberof koinos.protocol.block_header
|
|
16645
|
+
* @instance
|
|
16646
|
+
*/
|
|
16647
|
+
block_header.prototype.approved_proposals = $util.emptyArray;
|
|
16648
|
+
|
|
16210
16649
|
/**
|
|
16211
16650
|
* Creates a new block_header instance using the specified properties.
|
|
16212
16651
|
* @function create
|
|
@@ -16264,6 +16703,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16264
16703
|
Object.hasOwnProperty.call(message, "signer")
|
|
16265
16704
|
)
|
|
16266
16705
|
writer.uint32(/* id 6, wireType 2 =*/ 50).bytes(message.signer);
|
|
16706
|
+
if (
|
|
16707
|
+
message.approved_proposals != null &&
|
|
16708
|
+
message.approved_proposals.length
|
|
16709
|
+
)
|
|
16710
|
+
for (var i = 0; i < message.approved_proposals.length; ++i)
|
|
16711
|
+
writer
|
|
16712
|
+
.uint32(/* id 7, wireType 2 =*/ 58)
|
|
16713
|
+
.bytes(message.approved_proposals[i]);
|
|
16267
16714
|
return writer;
|
|
16268
16715
|
};
|
|
16269
16716
|
|
|
@@ -16301,24 +16748,41 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16301
16748
|
while (reader.pos < end) {
|
|
16302
16749
|
var tag = reader.uint32();
|
|
16303
16750
|
switch (tag >>> 3) {
|
|
16304
|
-
case 1:
|
|
16751
|
+
case 1: {
|
|
16305
16752
|
message.previous = reader.bytes();
|
|
16306
16753
|
break;
|
|
16307
|
-
|
|
16754
|
+
}
|
|
16755
|
+
case 2: {
|
|
16308
16756
|
message.height = reader.uint64();
|
|
16309
16757
|
break;
|
|
16310
|
-
|
|
16758
|
+
}
|
|
16759
|
+
case 3: {
|
|
16311
16760
|
message.timestamp = reader.uint64();
|
|
16312
16761
|
break;
|
|
16313
|
-
|
|
16762
|
+
}
|
|
16763
|
+
case 4: {
|
|
16314
16764
|
message.previous_state_merkle_root = reader.bytes();
|
|
16315
16765
|
break;
|
|
16316
|
-
|
|
16766
|
+
}
|
|
16767
|
+
case 5: {
|
|
16317
16768
|
message.transaction_merkle_root = reader.bytes();
|
|
16318
16769
|
break;
|
|
16319
|
-
|
|
16770
|
+
}
|
|
16771
|
+
case 6: {
|
|
16320
16772
|
message.signer = reader.bytes();
|
|
16321
16773
|
break;
|
|
16774
|
+
}
|
|
16775
|
+
case 7: {
|
|
16776
|
+
if (
|
|
16777
|
+
!(
|
|
16778
|
+
message.approved_proposals &&
|
|
16779
|
+
message.approved_proposals.length
|
|
16780
|
+
)
|
|
16781
|
+
)
|
|
16782
|
+
message.approved_proposals = [];
|
|
16783
|
+
message.approved_proposals.push(reader.bytes());
|
|
16784
|
+
break;
|
|
16785
|
+
}
|
|
16322
16786
|
default:
|
|
16323
16787
|
reader.skipType(tag & 7);
|
|
16324
16788
|
break;
|
|
@@ -16415,6 +16879,22 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16415
16879
|
)
|
|
16416
16880
|
)
|
|
16417
16881
|
return "signer: buffer expected";
|
|
16882
|
+
if (
|
|
16883
|
+
message.approved_proposals != null &&
|
|
16884
|
+
message.hasOwnProperty("approved_proposals")
|
|
16885
|
+
) {
|
|
16886
|
+
if (!Array.isArray(message.approved_proposals))
|
|
16887
|
+
return "approved_proposals: array expected";
|
|
16888
|
+
for (var i = 0; i < message.approved_proposals.length; ++i)
|
|
16889
|
+
if (
|
|
16890
|
+
!(
|
|
16891
|
+
(message.approved_proposals[i] &&
|
|
16892
|
+
typeof message.approved_proposals[i].length === "number") ||
|
|
16893
|
+
$util.isString(message.approved_proposals[i])
|
|
16894
|
+
)
|
|
16895
|
+
)
|
|
16896
|
+
return "approved_proposals: buffer[] expected";
|
|
16897
|
+
}
|
|
16418
16898
|
return null;
|
|
16419
16899
|
};
|
|
16420
16900
|
|
|
@@ -16439,7 +16919,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16439
16919
|
)),
|
|
16440
16920
|
0
|
|
16441
16921
|
);
|
|
16442
|
-
else if (object.previous.length
|
|
16922
|
+
else if (object.previous.length >= 0)
|
|
16923
|
+
message.previous = object.previous;
|
|
16443
16924
|
if (object.height != null)
|
|
16444
16925
|
if ($util.Long)
|
|
16445
16926
|
(message.height = $util.Long.fromValue(
|
|
@@ -16477,7 +16958,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16477
16958
|
)),
|
|
16478
16959
|
0
|
|
16479
16960
|
);
|
|
16480
|
-
else if (object.previous_state_merkle_root.length)
|
|
16961
|
+
else if (object.previous_state_merkle_root.length >= 0)
|
|
16481
16962
|
message.previous_state_merkle_root =
|
|
16482
16963
|
object.previous_state_merkle_root;
|
|
16483
16964
|
if (object.transaction_merkle_root != null)
|
|
@@ -16489,7 +16970,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16489
16970
|
)),
|
|
16490
16971
|
0
|
|
16491
16972
|
);
|
|
16492
|
-
else if (object.transaction_merkle_root.length)
|
|
16973
|
+
else if (object.transaction_merkle_root.length >= 0)
|
|
16493
16974
|
message.transaction_merkle_root = object.transaction_merkle_root;
|
|
16494
16975
|
if (object.signer != null)
|
|
16495
16976
|
if (typeof object.signer === "string")
|
|
@@ -16500,7 +16981,25 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16500
16981
|
)),
|
|
16501
16982
|
0
|
|
16502
16983
|
);
|
|
16503
|
-
else if (object.signer.length) message.signer = object.signer;
|
|
16984
|
+
else if (object.signer.length >= 0) message.signer = object.signer;
|
|
16985
|
+
if (object.approved_proposals) {
|
|
16986
|
+
if (!Array.isArray(object.approved_proposals))
|
|
16987
|
+
throw TypeError(
|
|
16988
|
+
".koinos.protocol.block_header.approved_proposals: array expected"
|
|
16989
|
+
);
|
|
16990
|
+
message.approved_proposals = [];
|
|
16991
|
+
for (var i = 0; i < object.approved_proposals.length; ++i)
|
|
16992
|
+
if (typeof object.approved_proposals[i] === "string")
|
|
16993
|
+
$util.base64.decode(
|
|
16994
|
+
object.approved_proposals[i],
|
|
16995
|
+
(message.approved_proposals[i] = $util.newBuffer(
|
|
16996
|
+
$util.base64.length(object.approved_proposals[i])
|
|
16997
|
+
)),
|
|
16998
|
+
0
|
|
16999
|
+
);
|
|
17000
|
+
else if (object.approved_proposals[i].length >= 0)
|
|
17001
|
+
message.approved_proposals[i] = object.approved_proposals[i];
|
|
17002
|
+
}
|
|
16504
17003
|
return message;
|
|
16505
17004
|
};
|
|
16506
17005
|
|
|
@@ -16516,6 +17015,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16516
17015
|
block_header.toObject = function toObject(message, options) {
|
|
16517
17016
|
if (!options) options = {};
|
|
16518
17017
|
var object = {};
|
|
17018
|
+
if (options.arrays || options.defaults)
|
|
17019
|
+
object.approved_proposals = [];
|
|
16519
17020
|
if (options.defaults) {
|
|
16520
17021
|
if (options.bytes === String) object.previous = "";
|
|
16521
17022
|
else {
|
|
@@ -16643,6 +17144,20 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16643
17144
|
: options.bytes === Array
|
|
16644
17145
|
? Array.prototype.slice.call(message.signer)
|
|
16645
17146
|
: message.signer;
|
|
17147
|
+
if (message.approved_proposals && message.approved_proposals.length) {
|
|
17148
|
+
object.approved_proposals = [];
|
|
17149
|
+
for (var j = 0; j < message.approved_proposals.length; ++j)
|
|
17150
|
+
object.approved_proposals[j] =
|
|
17151
|
+
options.bytes === String
|
|
17152
|
+
? $util.base64.encode(
|
|
17153
|
+
message.approved_proposals[j],
|
|
17154
|
+
0,
|
|
17155
|
+
message.approved_proposals[j].length
|
|
17156
|
+
)
|
|
17157
|
+
: options.bytes === Array
|
|
17158
|
+
? Array.prototype.slice.call(message.approved_proposals[j])
|
|
17159
|
+
: message.approved_proposals[j];
|
|
17160
|
+
}
|
|
16646
17161
|
return object;
|
|
16647
17162
|
};
|
|
16648
17163
|
|
|
@@ -16657,6 +17172,21 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16657
17172
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
16658
17173
|
};
|
|
16659
17174
|
|
|
17175
|
+
/**
|
|
17176
|
+
* Gets the default type url for block_header
|
|
17177
|
+
* @function getTypeUrl
|
|
17178
|
+
* @memberof koinos.protocol.block_header
|
|
17179
|
+
* @static
|
|
17180
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
17181
|
+
* @returns {string} The default type url
|
|
17182
|
+
*/
|
|
17183
|
+
block_header.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
17184
|
+
if (typeUrlPrefix === undefined) {
|
|
17185
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
17186
|
+
}
|
|
17187
|
+
return typeUrlPrefix + "/koinos.protocol.block_header";
|
|
17188
|
+
};
|
|
17189
|
+
|
|
16660
17190
|
return block_header;
|
|
16661
17191
|
})();
|
|
16662
17192
|
|
|
@@ -16805,16 +17335,18 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16805
17335
|
while (reader.pos < end) {
|
|
16806
17336
|
var tag = reader.uint32();
|
|
16807
17337
|
switch (tag >>> 3) {
|
|
16808
|
-
case 1:
|
|
17338
|
+
case 1: {
|
|
16809
17339
|
message.id = reader.bytes();
|
|
16810
17340
|
break;
|
|
16811
|
-
|
|
17341
|
+
}
|
|
17342
|
+
case 2: {
|
|
16812
17343
|
message.header = $root.koinos.protocol.block_header.decode(
|
|
16813
17344
|
reader,
|
|
16814
17345
|
reader.uint32()
|
|
16815
17346
|
);
|
|
16816
17347
|
break;
|
|
16817
|
-
|
|
17348
|
+
}
|
|
17349
|
+
case 3: {
|
|
16818
17350
|
if (!(message.transactions && message.transactions.length))
|
|
16819
17351
|
message.transactions = [];
|
|
16820
17352
|
message.transactions.push(
|
|
@@ -16824,9 +17356,11 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16824
17356
|
)
|
|
16825
17357
|
);
|
|
16826
17358
|
break;
|
|
16827
|
-
|
|
17359
|
+
}
|
|
17360
|
+
case 4: {
|
|
16828
17361
|
message.signature = reader.bytes();
|
|
16829
17362
|
break;
|
|
17363
|
+
}
|
|
16830
17364
|
default:
|
|
16831
17365
|
reader.skipType(tag & 7);
|
|
16832
17366
|
break;
|
|
@@ -16918,7 +17452,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16918
17452
|
(message.id = $util.newBuffer($util.base64.length(object.id))),
|
|
16919
17453
|
0
|
|
16920
17454
|
);
|
|
16921
|
-
else if (object.id.length) message.id = object.id;
|
|
17455
|
+
else if (object.id.length >= 0) message.id = object.id;
|
|
16922
17456
|
if (object.header != null) {
|
|
16923
17457
|
if (typeof object.header !== "object")
|
|
16924
17458
|
throw TypeError(".koinos.protocol.block.header: object expected");
|
|
@@ -16952,7 +17486,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
16952
17486
|
)),
|
|
16953
17487
|
0
|
|
16954
17488
|
);
|
|
16955
|
-
else if (object.signature.length)
|
|
17489
|
+
else if (object.signature.length >= 0)
|
|
16956
17490
|
message.signature = object.signature;
|
|
16957
17491
|
return message;
|
|
16958
17492
|
};
|
|
@@ -17031,6 +17565,21 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
17031
17565
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
17032
17566
|
};
|
|
17033
17567
|
|
|
17568
|
+
/**
|
|
17569
|
+
* Gets the default type url for block
|
|
17570
|
+
* @function getTypeUrl
|
|
17571
|
+
* @memberof koinos.protocol.block
|
|
17572
|
+
* @static
|
|
17573
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
17574
|
+
* @returns {string} The default type url
|
|
17575
|
+
*/
|
|
17576
|
+
block.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
17577
|
+
if (typeUrlPrefix === undefined) {
|
|
17578
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
17579
|
+
}
|
|
17580
|
+
return typeUrlPrefix + "/koinos.protocol.block";
|
|
17581
|
+
};
|
|
17582
|
+
|
|
17034
17583
|
return block;
|
|
17035
17584
|
})();
|
|
17036
17585
|
|
|
@@ -17269,25 +17818,31 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
17269
17818
|
while (reader.pos < end) {
|
|
17270
17819
|
var tag = reader.uint32();
|
|
17271
17820
|
switch (tag >>> 3) {
|
|
17272
|
-
case 1:
|
|
17821
|
+
case 1: {
|
|
17273
17822
|
message.id = reader.bytes();
|
|
17274
17823
|
break;
|
|
17275
|
-
|
|
17824
|
+
}
|
|
17825
|
+
case 2: {
|
|
17276
17826
|
message.height = reader.uint64();
|
|
17277
17827
|
break;
|
|
17278
|
-
|
|
17828
|
+
}
|
|
17829
|
+
case 3: {
|
|
17279
17830
|
message.disk_storage_used = reader.uint64();
|
|
17280
17831
|
break;
|
|
17281
|
-
|
|
17832
|
+
}
|
|
17833
|
+
case 4: {
|
|
17282
17834
|
message.network_bandwidth_used = reader.uint64();
|
|
17283
17835
|
break;
|
|
17284
|
-
|
|
17836
|
+
}
|
|
17837
|
+
case 5: {
|
|
17285
17838
|
message.compute_bandwidth_used = reader.uint64();
|
|
17286
17839
|
break;
|
|
17287
|
-
|
|
17840
|
+
}
|
|
17841
|
+
case 6: {
|
|
17288
17842
|
message.state_merkle_root = reader.bytes();
|
|
17289
17843
|
break;
|
|
17290
|
-
|
|
17844
|
+
}
|
|
17845
|
+
case 7: {
|
|
17291
17846
|
if (!(message.events && message.events.length))
|
|
17292
17847
|
message.events = [];
|
|
17293
17848
|
message.events.push(
|
|
@@ -17297,7 +17852,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
17297
17852
|
)
|
|
17298
17853
|
);
|
|
17299
17854
|
break;
|
|
17300
|
-
|
|
17855
|
+
}
|
|
17856
|
+
case 8: {
|
|
17301
17857
|
if (
|
|
17302
17858
|
!(
|
|
17303
17859
|
message.transaction_receipts &&
|
|
@@ -17312,10 +17868,12 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
17312
17868
|
)
|
|
17313
17869
|
);
|
|
17314
17870
|
break;
|
|
17315
|
-
|
|
17871
|
+
}
|
|
17872
|
+
case 9: {
|
|
17316
17873
|
if (!(message.logs && message.logs.length)) message.logs = [];
|
|
17317
17874
|
message.logs.push(reader.string());
|
|
17318
17875
|
break;
|
|
17876
|
+
}
|
|
17319
17877
|
default:
|
|
17320
17878
|
reader.skipType(tag & 7);
|
|
17321
17879
|
break;
|
|
@@ -17469,7 +18027,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
17469
18027
|
(message.id = $util.newBuffer($util.base64.length(object.id))),
|
|
17470
18028
|
0
|
|
17471
18029
|
);
|
|
17472
|
-
else if (object.id.length) message.id = object.id;
|
|
18030
|
+
else if (object.id.length >= 0) message.id = object.id;
|
|
17473
18031
|
if (object.height != null)
|
|
17474
18032
|
if ($util.Long)
|
|
17475
18033
|
(message.height = $util.Long.fromValue(
|
|
@@ -17544,7 +18102,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
17544
18102
|
)),
|
|
17545
18103
|
0
|
|
17546
18104
|
);
|
|
17547
|
-
else if (object.state_merkle_root.length)
|
|
18105
|
+
else if (object.state_merkle_root.length >= 0)
|
|
17548
18106
|
message.state_merkle_root = object.state_merkle_root;
|
|
17549
18107
|
if (object.events) {
|
|
17550
18108
|
if (!Array.isArray(object.events))
|
|
@@ -17804,6 +18362,21 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
17804
18362
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
17805
18363
|
};
|
|
17806
18364
|
|
|
18365
|
+
/**
|
|
18366
|
+
* Gets the default type url for block_receipt
|
|
18367
|
+
* @function getTypeUrl
|
|
18368
|
+
* @memberof koinos.protocol.block_receipt
|
|
18369
|
+
* @static
|
|
18370
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
18371
|
+
* @returns {string} The default type url
|
|
18372
|
+
*/
|
|
18373
|
+
block_receipt.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
18374
|
+
if (typeUrlPrefix === undefined) {
|
|
18375
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
18376
|
+
}
|
|
18377
|
+
return typeUrlPrefix + "/koinos.protocol.block_receipt";
|
|
18378
|
+
};
|
|
18379
|
+
|
|
17807
18380
|
return block_receipt;
|
|
17808
18381
|
})();
|
|
17809
18382
|
|
|
@@ -17824,8 +18397,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
17824
18397
|
* @memberof koinos.chain
|
|
17825
18398
|
* @interface Ivalue_type
|
|
17826
18399
|
* @property {google.protobuf.IAny|null} [message_value] value_type message_value
|
|
17827
|
-
* @property {number|null} [double_value] value_type double_value
|
|
17828
|
-
* @property {number|null} [float_value] value_type float_value
|
|
17829
18400
|
* @property {number|null} [int32_value] value_type int32_value
|
|
17830
18401
|
* @property {number|Long|null} [int64_value] value_type int64_value
|
|
17831
18402
|
* @property {number|null} [uint32_value] value_type uint32_value
|
|
@@ -17868,22 +18439,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
17868
18439
|
*/
|
|
17869
18440
|
value_type.prototype.message_value = null;
|
|
17870
18441
|
|
|
17871
|
-
/**
|
|
17872
|
-
* value_type double_value.
|
|
17873
|
-
* @member {number|null|undefined} double_value
|
|
17874
|
-
* @memberof koinos.chain.value_type
|
|
17875
|
-
* @instance
|
|
17876
|
-
*/
|
|
17877
|
-
value_type.prototype.double_value = null;
|
|
17878
|
-
|
|
17879
|
-
/**
|
|
17880
|
-
* value_type float_value.
|
|
17881
|
-
* @member {number|null|undefined} float_value
|
|
17882
|
-
* @memberof koinos.chain.value_type
|
|
17883
|
-
* @instance
|
|
17884
|
-
*/
|
|
17885
|
-
value_type.prototype.float_value = null;
|
|
17886
|
-
|
|
17887
18442
|
/**
|
|
17888
18443
|
* value_type int32_value.
|
|
17889
18444
|
* @member {number|null|undefined} int32_value
|
|
@@ -17993,7 +18548,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
17993
18548
|
|
|
17994
18549
|
/**
|
|
17995
18550
|
* value_type kind.
|
|
17996
|
-
* @member {"message_value"|"
|
|
18551
|
+
* @member {"message_value"|"int32_value"|"int64_value"|"uint32_value"|"uint64_value"|"sint32_value"|"sint64_value"|"fixed32_value"|"fixed64_value"|"sfixed32_value"|"sfixed64_value"|"bool_value"|"string_value"|"bytes_value"|undefined} kind
|
|
17997
18552
|
* @memberof koinos.chain.value_type
|
|
17998
18553
|
* @instance
|
|
17999
18554
|
*/
|
|
@@ -18001,8 +18556,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
18001
18556
|
get: $util.oneOfGetter(
|
|
18002
18557
|
($oneOfFields = [
|
|
18003
18558
|
"message_value",
|
|
18004
|
-
"double_value",
|
|
18005
|
-
"float_value",
|
|
18006
18559
|
"int32_value",
|
|
18007
18560
|
"int64_value",
|
|
18008
18561
|
"uint32_value",
|
|
@@ -18052,110 +18605,94 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
18052
18605
|
message.message_value,
|
|
18053
18606
|
writer.uint32(/* id 1, wireType 2 =*/ 10).fork()
|
|
18054
18607
|
).ldelim();
|
|
18055
|
-
if (
|
|
18056
|
-
message.double_value != null &&
|
|
18057
|
-
Object.hasOwnProperty.call(message, "double_value")
|
|
18058
|
-
)
|
|
18059
|
-
writer
|
|
18060
|
-
.uint32(/* id 2, wireType 1 =*/ 17)
|
|
18061
|
-
.double(message.double_value);
|
|
18062
|
-
if (
|
|
18063
|
-
message.float_value != null &&
|
|
18064
|
-
Object.hasOwnProperty.call(message, "float_value")
|
|
18065
|
-
)
|
|
18066
|
-
writer
|
|
18067
|
-
.uint32(/* id 3, wireType 5 =*/ 29)
|
|
18068
|
-
.float(message.float_value);
|
|
18069
18608
|
if (
|
|
18070
18609
|
message.int32_value != null &&
|
|
18071
18610
|
Object.hasOwnProperty.call(message, "int32_value")
|
|
18072
18611
|
)
|
|
18073
18612
|
writer
|
|
18074
|
-
.uint32(/* id
|
|
18613
|
+
.uint32(/* id 2, wireType 0 =*/ 16)
|
|
18075
18614
|
.int32(message.int32_value);
|
|
18076
18615
|
if (
|
|
18077
18616
|
message.int64_value != null &&
|
|
18078
18617
|
Object.hasOwnProperty.call(message, "int64_value")
|
|
18079
18618
|
)
|
|
18080
18619
|
writer
|
|
18081
|
-
.uint32(/* id
|
|
18620
|
+
.uint32(/* id 3, wireType 0 =*/ 24)
|
|
18082
18621
|
.int64(message.int64_value);
|
|
18083
18622
|
if (
|
|
18084
18623
|
message.uint32_value != null &&
|
|
18085
18624
|
Object.hasOwnProperty.call(message, "uint32_value")
|
|
18086
18625
|
)
|
|
18087
18626
|
writer
|
|
18088
|
-
.uint32(/* id
|
|
18627
|
+
.uint32(/* id 4, wireType 0 =*/ 32)
|
|
18089
18628
|
.uint32(message.uint32_value);
|
|
18090
18629
|
if (
|
|
18091
18630
|
message.uint64_value != null &&
|
|
18092
18631
|
Object.hasOwnProperty.call(message, "uint64_value")
|
|
18093
18632
|
)
|
|
18094
18633
|
writer
|
|
18095
|
-
.uint32(/* id
|
|
18634
|
+
.uint32(/* id 5, wireType 0 =*/ 40)
|
|
18096
18635
|
.uint64(message.uint64_value);
|
|
18097
18636
|
if (
|
|
18098
18637
|
message.sint32_value != null &&
|
|
18099
18638
|
Object.hasOwnProperty.call(message, "sint32_value")
|
|
18100
18639
|
)
|
|
18101
18640
|
writer
|
|
18102
|
-
.uint32(/* id
|
|
18641
|
+
.uint32(/* id 6, wireType 0 =*/ 48)
|
|
18103
18642
|
.sint32(message.sint32_value);
|
|
18104
18643
|
if (
|
|
18105
18644
|
message.sint64_value != null &&
|
|
18106
18645
|
Object.hasOwnProperty.call(message, "sint64_value")
|
|
18107
18646
|
)
|
|
18108
18647
|
writer
|
|
18109
|
-
.uint32(/* id
|
|
18648
|
+
.uint32(/* id 7, wireType 0 =*/ 56)
|
|
18110
18649
|
.sint64(message.sint64_value);
|
|
18111
18650
|
if (
|
|
18112
18651
|
message.fixed32_value != null &&
|
|
18113
18652
|
Object.hasOwnProperty.call(message, "fixed32_value")
|
|
18114
18653
|
)
|
|
18115
18654
|
writer
|
|
18116
|
-
.uint32(/* id
|
|
18655
|
+
.uint32(/* id 8, wireType 5 =*/ 69)
|
|
18117
18656
|
.fixed32(message.fixed32_value);
|
|
18118
18657
|
if (
|
|
18119
18658
|
message.fixed64_value != null &&
|
|
18120
18659
|
Object.hasOwnProperty.call(message, "fixed64_value")
|
|
18121
18660
|
)
|
|
18122
18661
|
writer
|
|
18123
|
-
.uint32(/* id
|
|
18662
|
+
.uint32(/* id 9, wireType 1 =*/ 73)
|
|
18124
18663
|
.fixed64(message.fixed64_value);
|
|
18125
18664
|
if (
|
|
18126
18665
|
message.sfixed32_value != null &&
|
|
18127
18666
|
Object.hasOwnProperty.call(message, "sfixed32_value")
|
|
18128
18667
|
)
|
|
18129
18668
|
writer
|
|
18130
|
-
.uint32(/* id
|
|
18669
|
+
.uint32(/* id 10, wireType 5 =*/ 85)
|
|
18131
18670
|
.sfixed32(message.sfixed32_value);
|
|
18132
18671
|
if (
|
|
18133
18672
|
message.sfixed64_value != null &&
|
|
18134
18673
|
Object.hasOwnProperty.call(message, "sfixed64_value")
|
|
18135
18674
|
)
|
|
18136
18675
|
writer
|
|
18137
|
-
.uint32(/* id
|
|
18676
|
+
.uint32(/* id 11, wireType 1 =*/ 89)
|
|
18138
18677
|
.sfixed64(message.sfixed64_value);
|
|
18139
18678
|
if (
|
|
18140
18679
|
message.bool_value != null &&
|
|
18141
18680
|
Object.hasOwnProperty.call(message, "bool_value")
|
|
18142
18681
|
)
|
|
18143
|
-
writer
|
|
18144
|
-
.uint32(/* id 14, wireType 0 =*/ 112)
|
|
18145
|
-
.bool(message.bool_value);
|
|
18682
|
+
writer.uint32(/* id 12, wireType 0 =*/ 96).bool(message.bool_value);
|
|
18146
18683
|
if (
|
|
18147
18684
|
message.string_value != null &&
|
|
18148
18685
|
Object.hasOwnProperty.call(message, "string_value")
|
|
18149
18686
|
)
|
|
18150
18687
|
writer
|
|
18151
|
-
.uint32(/* id
|
|
18688
|
+
.uint32(/* id 13, wireType 2 =*/ 106)
|
|
18152
18689
|
.string(message.string_value);
|
|
18153
18690
|
if (
|
|
18154
18691
|
message.bytes_value != null &&
|
|
18155
18692
|
Object.hasOwnProperty.call(message, "bytes_value")
|
|
18156
18693
|
)
|
|
18157
18694
|
writer
|
|
18158
|
-
.uint32(/* id
|
|
18695
|
+
.uint32(/* id 14, wireType 2 =*/ 114)
|
|
18159
18696
|
.bytes(message.bytes_value);
|
|
18160
18697
|
return writer;
|
|
18161
18698
|
};
|
|
@@ -18191,57 +18728,65 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
18191
18728
|
while (reader.pos < end) {
|
|
18192
18729
|
var tag = reader.uint32();
|
|
18193
18730
|
switch (tag >>> 3) {
|
|
18194
|
-
case 1:
|
|
18731
|
+
case 1: {
|
|
18195
18732
|
message.message_value = $root.google.protobuf.Any.decode(
|
|
18196
18733
|
reader,
|
|
18197
18734
|
reader.uint32()
|
|
18198
18735
|
);
|
|
18199
18736
|
break;
|
|
18200
|
-
|
|
18201
|
-
|
|
18202
|
-
break;
|
|
18203
|
-
case 3:
|
|
18204
|
-
message.float_value = reader.float();
|
|
18205
|
-
break;
|
|
18206
|
-
case 4:
|
|
18737
|
+
}
|
|
18738
|
+
case 2: {
|
|
18207
18739
|
message.int32_value = reader.int32();
|
|
18208
18740
|
break;
|
|
18209
|
-
|
|
18741
|
+
}
|
|
18742
|
+
case 3: {
|
|
18210
18743
|
message.int64_value = reader.int64();
|
|
18211
18744
|
break;
|
|
18212
|
-
|
|
18745
|
+
}
|
|
18746
|
+
case 4: {
|
|
18213
18747
|
message.uint32_value = reader.uint32();
|
|
18214
18748
|
break;
|
|
18215
|
-
|
|
18749
|
+
}
|
|
18750
|
+
case 5: {
|
|
18216
18751
|
message.uint64_value = reader.uint64();
|
|
18217
18752
|
break;
|
|
18218
|
-
|
|
18753
|
+
}
|
|
18754
|
+
case 6: {
|
|
18219
18755
|
message.sint32_value = reader.sint32();
|
|
18220
18756
|
break;
|
|
18221
|
-
|
|
18757
|
+
}
|
|
18758
|
+
case 7: {
|
|
18222
18759
|
message.sint64_value = reader.sint64();
|
|
18223
18760
|
break;
|
|
18224
|
-
|
|
18761
|
+
}
|
|
18762
|
+
case 8: {
|
|
18225
18763
|
message.fixed32_value = reader.fixed32();
|
|
18226
18764
|
break;
|
|
18227
|
-
|
|
18765
|
+
}
|
|
18766
|
+
case 9: {
|
|
18228
18767
|
message.fixed64_value = reader.fixed64();
|
|
18229
18768
|
break;
|
|
18230
|
-
|
|
18769
|
+
}
|
|
18770
|
+
case 10: {
|
|
18231
18771
|
message.sfixed32_value = reader.sfixed32();
|
|
18232
18772
|
break;
|
|
18233
|
-
|
|
18773
|
+
}
|
|
18774
|
+
case 11: {
|
|
18234
18775
|
message.sfixed64_value = reader.sfixed64();
|
|
18235
18776
|
break;
|
|
18236
|
-
|
|
18777
|
+
}
|
|
18778
|
+
case 12: {
|
|
18237
18779
|
message.bool_value = reader.bool();
|
|
18238
18780
|
break;
|
|
18239
|
-
|
|
18781
|
+
}
|
|
18782
|
+
case 13: {
|
|
18240
18783
|
message.string_value = reader.string();
|
|
18241
18784
|
break;
|
|
18242
|
-
|
|
18785
|
+
}
|
|
18786
|
+
case 14: {
|
|
18243
18787
|
message.bytes_value = reader.bytes();
|
|
18244
18788
|
break;
|
|
18789
|
+
}
|
|
18245
18790
|
default:
|
|
18246
18791
|
reader.skipType(tag & 7);
|
|
18247
18792
|
break;
|
|
@@ -18289,24 +18834,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
18289
18834
|
if (error) return "message_value." + error;
|
|
18290
18835
|
}
|
|
18291
18836
|
}
|
|
18292
|
-
if (
|
|
18293
|
-
message.double_value != null &&
|
|
18294
|
-
message.hasOwnProperty("double_value")
|
|
18295
|
-
) {
|
|
18296
|
-
if (properties.kind === 1) return "kind: multiple values";
|
|
18297
|
-
properties.kind = 1;
|
|
18298
|
-
if (typeof message.double_value !== "number")
|
|
18299
|
-
return "double_value: number expected";
|
|
18300
|
-
}
|
|
18301
|
-
if (
|
|
18302
|
-
message.float_value != null &&
|
|
18303
|
-
message.hasOwnProperty("float_value")
|
|
18304
|
-
) {
|
|
18305
|
-
if (properties.kind === 1) return "kind: multiple values";
|
|
18306
|
-
properties.kind = 1;
|
|
18307
|
-
if (typeof message.float_value !== "number")
|
|
18308
|
-
return "float_value: number expected";
|
|
18309
|
-
}
|
|
18310
18837
|
if (
|
|
18311
18838
|
message.int32_value != null &&
|
|
18312
18839
|
message.hasOwnProperty("int32_value")
|
|
@@ -18488,10 +19015,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
18488
19015
|
object.message_value
|
|
18489
19016
|
);
|
|
18490
19017
|
}
|
|
18491
|
-
if (object.double_value != null)
|
|
18492
|
-
message.double_value = Number(object.double_value);
|
|
18493
|
-
if (object.float_value != null)
|
|
18494
|
-
message.float_value = Number(object.float_value);
|
|
18495
19018
|
if (object.int32_value != null)
|
|
18496
19019
|
message.int32_value = object.int32_value | 0;
|
|
18497
19020
|
if (object.int64_value != null)
|
|
@@ -18585,7 +19108,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
18585
19108
|
)),
|
|
18586
19109
|
0
|
|
18587
19110
|
);
|
|
18588
|
-
else if (object.bytes_value.length)
|
|
19111
|
+
else if (object.bytes_value.length >= 0)
|
|
18589
19112
|
message.bytes_value = object.bytes_value;
|
|
18590
19113
|
return message;
|
|
18591
19114
|
};
|
|
@@ -18612,26 +19135,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
18612
19135
|
);
|
|
18613
19136
|
if (options.oneofs) object.kind = "message_value";
|
|
18614
19137
|
}
|
|
18615
|
-
if (
|
|
18616
|
-
message.double_value != null &&
|
|
18617
|
-
message.hasOwnProperty("double_value")
|
|
18618
|
-
) {
|
|
18619
|
-
object.double_value =
|
|
18620
|
-
options.json && !isFinite(message.double_value)
|
|
18621
|
-
? String(message.double_value)
|
|
18622
|
-
: message.double_value;
|
|
18623
|
-
if (options.oneofs) object.kind = "double_value";
|
|
18624
|
-
}
|
|
18625
|
-
if (
|
|
18626
|
-
message.float_value != null &&
|
|
18627
|
-
message.hasOwnProperty("float_value")
|
|
18628
|
-
) {
|
|
18629
|
-
object.float_value =
|
|
18630
|
-
options.json && !isFinite(message.float_value)
|
|
18631
|
-
? String(message.float_value)
|
|
18632
|
-
: message.float_value;
|
|
18633
|
-
if (options.oneofs) object.kind = "float_value";
|
|
18634
|
-
}
|
|
18635
19138
|
if (
|
|
18636
19139
|
message.int32_value != null &&
|
|
18637
19140
|
message.hasOwnProperty("int32_value")
|
|
@@ -18816,6 +19319,21 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
18816
19319
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
18817
19320
|
};
|
|
18818
19321
|
|
|
19322
|
+
/**
|
|
19323
|
+
* Gets the default type url for value_type
|
|
19324
|
+
* @function getTypeUrl
|
|
19325
|
+
* @memberof koinos.chain.value_type
|
|
19326
|
+
* @static
|
|
19327
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
19328
|
+
* @returns {string} The default type url
|
|
19329
|
+
*/
|
|
19330
|
+
value_type.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
19331
|
+
if (typeUrlPrefix === undefined) {
|
|
19332
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
19333
|
+
}
|
|
19334
|
+
return typeUrlPrefix + "/koinos.chain.value_type";
|
|
19335
|
+
};
|
|
19336
|
+
|
|
18819
19337
|
return value_type;
|
|
18820
19338
|
})();
|
|
18821
19339
|
|
|
@@ -18930,12 +19448,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
18930
19448
|
while (reader.pos < end) {
|
|
18931
19449
|
var tag = reader.uint32();
|
|
18932
19450
|
switch (tag >>> 3) {
|
|
18933
|
-
case 1:
|
|
19451
|
+
case 1: {
|
|
18934
19452
|
message.name = reader.string();
|
|
18935
19453
|
break;
|
|
18936
|
-
|
|
19454
|
+
}
|
|
19455
|
+
case 2: {
|
|
18937
19456
|
message.number = reader.int32();
|
|
18938
19457
|
break;
|
|
19458
|
+
}
|
|
18939
19459
|
default:
|
|
18940
19460
|
reader.skipType(tag & 7);
|
|
18941
19461
|
break;
|
|
@@ -19028,6 +19548,21 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
19028
19548
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
19029
19549
|
};
|
|
19030
19550
|
|
|
19551
|
+
/**
|
|
19552
|
+
* Gets the default type url for enum_type
|
|
19553
|
+
* @function getTypeUrl
|
|
19554
|
+
* @memberof koinos.chain.enum_type
|
|
19555
|
+
* @static
|
|
19556
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
19557
|
+
* @returns {string} The default type url
|
|
19558
|
+
*/
|
|
19559
|
+
enum_type.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
19560
|
+
if (typeUrlPrefix === undefined) {
|
|
19561
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
19562
|
+
}
|
|
19563
|
+
return typeUrlPrefix + "/koinos.chain.enum_type";
|
|
19564
|
+
};
|
|
19565
|
+
|
|
19031
19566
|
return enum_type;
|
|
19032
19567
|
})();
|
|
19033
19568
|
|
|
@@ -19132,13 +19667,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
19132
19667
|
while (reader.pos < end) {
|
|
19133
19668
|
var tag = reader.uint32();
|
|
19134
19669
|
switch (tag >>> 3) {
|
|
19135
|
-
case 1:
|
|
19670
|
+
case 1: {
|
|
19136
19671
|
if (!(message.values && message.values.length))
|
|
19137
19672
|
message.values = [];
|
|
19138
19673
|
message.values.push(
|
|
19139
19674
|
$root.koinos.chain.value_type.decode(reader, reader.uint32())
|
|
19140
19675
|
);
|
|
19141
19676
|
break;
|
|
19677
|
+
}
|
|
19142
19678
|
default:
|
|
19143
19679
|
reader.skipType(tag & 7);
|
|
19144
19680
|
break;
|
|
@@ -19248,6 +19784,21 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
19248
19784
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
19249
19785
|
};
|
|
19250
19786
|
|
|
19787
|
+
/**
|
|
19788
|
+
* Gets the default type url for list_type
|
|
19789
|
+
* @function getTypeUrl
|
|
19790
|
+
* @memberof koinos.chain.list_type
|
|
19791
|
+
* @static
|
|
19792
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
19793
|
+
* @returns {string} The default type url
|
|
19794
|
+
*/
|
|
19795
|
+
list_type.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
19796
|
+
if (typeUrlPrefix === undefined) {
|
|
19797
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
19798
|
+
}
|
|
19799
|
+
return typeUrlPrefix + "/koinos.chain.list_type";
|
|
19800
|
+
};
|
|
19801
|
+
|
|
19251
19802
|
return list_type;
|
|
19252
19803
|
})();
|
|
19253
19804
|
|
|
@@ -19384,12 +19935,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
19384
19935
|
while (reader.pos < end) {
|
|
19385
19936
|
var tag = reader.uint32();
|
|
19386
19937
|
switch (tag >>> 3) {
|
|
19387
|
-
case 1:
|
|
19938
|
+
case 1: {
|
|
19388
19939
|
message.type_url = reader.string();
|
|
19389
19940
|
break;
|
|
19390
|
-
|
|
19941
|
+
}
|
|
19942
|
+
case 2: {
|
|
19391
19943
|
message.value = reader.bytes();
|
|
19392
19944
|
break;
|
|
19945
|
+
}
|
|
19393
19946
|
default:
|
|
19394
19947
|
reader.skipType(tag & 7);
|
|
19395
19948
|
break;
|
|
@@ -19460,7 +20013,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
19460
20013
|
)),
|
|
19461
20014
|
0
|
|
19462
20015
|
);
|
|
19463
|
-
else if (object.value.length) message.value = object.value;
|
|
20016
|
+
else if (object.value.length >= 0) message.value = object.value;
|
|
19464
20017
|
return message;
|
|
19465
20018
|
};
|
|
19466
20019
|
|
|
@@ -19508,6 +20061,21 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
19508
20061
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
19509
20062
|
};
|
|
19510
20063
|
|
|
20064
|
+
/**
|
|
20065
|
+
* Gets the default type url for Any
|
|
20066
|
+
* @function getTypeUrl
|
|
20067
|
+
* @memberof google.protobuf.Any
|
|
20068
|
+
* @static
|
|
20069
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
20070
|
+
* @returns {string} The default type url
|
|
20071
|
+
*/
|
|
20072
|
+
Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
20073
|
+
if (typeUrlPrefix === undefined) {
|
|
20074
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
20075
|
+
}
|
|
20076
|
+
return typeUrlPrefix + "/google.protobuf.Any";
|
|
20077
|
+
};
|
|
20078
|
+
|
|
19511
20079
|
return Any;
|
|
19512
20080
|
})();
|
|
19513
20081
|
|
|
@@ -19534,7 +20102,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
19534
20102
|
/***/ ((module) => {
|
|
19535
20103
|
|
|
19536
20104
|
"use strict";
|
|
19537
|
-
module.exports = JSON.parse('{"nested":{"koinos":{"nested":{"contracts":{"nested":{"token":{"options":{"go_package":"github.com/koinos/koinos-proto-golang/koinos/contracts/token"},"nested":{"name_arguments":{"fields":{}},"name_result":{"fields":{"value":{"type":"string","id":1}}},"symbol_arguments":{"fields":{}},"symbol_result":{"fields":{"value":{"type":"string","id":1}}},"decimals_arguments":{"fields":{}},"decimals_result":{"fields":{"value":{"type":"uint32","id":1}}},"total_supply_arguments":{"fields":{}},"total_supply_result":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"balance_of_arguments":{"fields":{"owner":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}}}},"balance_of_result":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"transfer_arguments":{"fields":{"from":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"to":{"type":"bytes","id":2,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}},"transfer_result":{"fields":{
|
|
20105
|
+
module.exports = JSON.parse('{"nested":{"koinos":{"nested":{"contracts":{"nested":{"token":{"options":{"go_package":"github.com/koinos/koinos-proto-golang/koinos/contracts/token"},"nested":{"name_arguments":{"fields":{}},"name_result":{"fields":{"value":{"type":"string","id":1}}},"symbol_arguments":{"fields":{}},"symbol_result":{"fields":{"value":{"type":"string","id":1}}},"decimals_arguments":{"fields":{}},"decimals_result":{"fields":{"value":{"type":"uint32","id":1}}},"total_supply_arguments":{"fields":{}},"total_supply_result":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"balance_of_arguments":{"fields":{"owner":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}}}},"balance_of_result":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"transfer_arguments":{"fields":{"from":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"to":{"type":"bytes","id":2,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}},"transfer_result":{"fields":{}},"mint_arguments":{"fields":{"to":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}}}},"mint_result":{"fields":{}},"burn_arguments":{"fields":{"from":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}}}},"burn_result":{"fields":{}},"balance_object":{"fields":{"value":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}}}},"mana_balance_object":{"fields":{"balance":{"type":"uint64","id":1,"options":{"jstype":"JS_STRING"}},"mana":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}},"last_mana_update":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}},"burn_event":{"fields":{"from":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}}}},"mint_event":{"fields":{"to":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":2,"options":{"jstype":"JS_STRING"}}}},"transfer_event":{"fields":{"from":{"type":"bytes","id":1,"options":{"(btype)":"ADDRESS"}},"to":{"type":"bytes","id":2,"options":{"(btype)":"ADDRESS"}},"value":{"type":"uint64","id":3,"options":{"jstype":"JS_STRING"}}}}}}}}}}}}');
|
|
19538
20106
|
|
|
19539
20107
|
/***/ })
|
|
19540
20108
|
|
|
@@ -19552,17 +20120,14 @@ module.exports = JSON.parse('{"nested":{"koinos":{"nested":{"contracts":{"nested
|
|
|
19552
20120
|
/******/ }
|
|
19553
20121
|
/******/ // Create a new module (and put it into the cache)
|
|
19554
20122
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
19555
|
-
/******/ id
|
|
19556
|
-
/******/ loaded
|
|
20123
|
+
/******/ // no module.id needed
|
|
20124
|
+
/******/ // no module.loaded needed
|
|
19557
20125
|
/******/ exports: {}
|
|
19558
20126
|
/******/ };
|
|
19559
20127
|
/******/
|
|
19560
20128
|
/******/ // Execute the module function
|
|
19561
20129
|
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
19562
20130
|
/******/
|
|
19563
|
-
/******/ // Flag the module as loaded
|
|
19564
|
-
/******/ module.loaded = true;
|
|
19565
|
-
/******/
|
|
19566
20131
|
/******/ // Return the exports of the module
|
|
19567
20132
|
/******/ return module.exports;
|
|
19568
20133
|
/******/ }
|
|
@@ -19580,15 +20145,6 @@ module.exports = JSON.parse('{"nested":{"koinos":{"nested":{"contracts":{"nested
|
|
|
19580
20145
|
/******/ })();
|
|
19581
20146
|
/******/ })();
|
|
19582
20147
|
/******/
|
|
19583
|
-
/******/ /* webpack/runtime/node module decorator */
|
|
19584
|
-
/******/ (() => {
|
|
19585
|
-
/******/ __webpack_require__.nmd = (module) => {
|
|
19586
|
-
/******/ module.paths = [];
|
|
19587
|
-
/******/ if (!module.children) module.children = [];
|
|
19588
|
-
/******/ return module;
|
|
19589
|
-
/******/ };
|
|
19590
|
-
/******/ })();
|
|
19591
|
-
/******/
|
|
19592
20148
|
/************************************************************************/
|
|
19593
20149
|
/******/
|
|
19594
20150
|
/******/ // startup
|