@solana/web3.js 1.1.0 → 1.1.2
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/lib/index.browser.esm.js +41 -18
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +41 -18
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +2320 -0
- package/lib/index.esm.js +41 -18
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +483 -400
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +2 -2
- package/lib/index.iife.min.js.map +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +28 -28
- package/src/message.ts +9 -12
- package/src/transaction.ts +2 -2
- package/src/util/guarded-array-utils.ts +37 -0
- package/src/validator-info.ts +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.browser.esm.js","sources":["../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/buffer/index.js","../src/util/to-buffer.ts","../node_modules/safe-buffer/index.js","../node_modules/base-x/index.js","../node_modules/bs58/index.js","../src/publickey.ts","../src/account.ts","../src/bpf-loader-deprecated.ts","../node_modules/rollup-plugin-node-polyfills/polyfills/global.js","../node_modules/rollup-plugin-node-polyfills/polyfills/inherits.js","../node_modules/rollup-plugin-node-polyfills/polyfills/util.js","../node_modules/rollup-plugin-node-polyfills/polyfills/assert.js","../node_modules/buffer-layout/lib/Layout.js","../src/layout.ts","../src/util/shortvec-encoding.ts","../src/message.ts","../src/transaction.ts","../src/sysvar.ts","../src/util/send-and-confirm-transaction.ts","../src/util/sleep.ts","../src/instruction.ts","../src/fee-calculator.ts","../src/nonce-account.ts","../src/system-program.ts","../src/loader.ts","../src/bpf-loader.ts","../node_modules/punycode/punycode.es6.js","../node_modules/rollup-plugin-node-polyfills/polyfills/qs.js","../node_modules/rollup-plugin-node-polyfills/polyfills/url.js","../src/timing.ts","../src/util/promise-timeout.ts","../src/connection.ts","../src/stake-program.ts","../src/secp256k1-program.ts","../src/validator-info.ts","../src/vote-account.ts","../src/util/send-and-confirm-raw-transaction.ts","../src/util/cluster.ts","../src/index.ts"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nconst base64 = require('base64-js')\nconst ieee754 = require('ieee754')\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n const valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n const b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n const length = byteLength(string, encoding) | 0\n let buf = createBuffer(length)\n\n const actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0\n const buf = createBuffer(length)\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n let buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0\n const buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n let x = a.length\n let y = b.length\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n let i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n const buffer = Buffer.allocUnsafe(length)\n let pos = 0\n for (i = 0; i < list.length; ++i) {\n let buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n buf.copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n const len = string.length\n const mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n let loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n const i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n const len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n const len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n const len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n const length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n let str = ''\n const max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return '<Buffer ' + str + '>'\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n let x = thisEnd - thisStart\n let y = end - start\n const len = Math.min(x, y)\n\n const thisCopy = this.slice(thisStart, thisEnd)\n const targetCopy = target.slice(start, end)\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n let indexSize = 1\n let arrLength = arr.length\n let valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n let i\n if (dir) {\n let foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n let found = true\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n const remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n const strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n let i\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n const remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n const res = []\n\n let i = start\n while (i < end) {\n const firstByte = buf[i]\n let codePoint = null\n let bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n const len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = ''\n let i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n const len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n let out = ''\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n const bytes = buf.slice(start, end)\n let res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n const len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n const newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n let val = this[offset + --byteLength]\n let mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const lo = first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24\n\n const hi = this[++offset] +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n last * 2 ** 24\n\n return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const hi = first * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n const lo = this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last\n\n return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let i = byteLength\n let mul = 1\n let val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = this[offset + 4] +\n this[offset + 5] * 2 ** 8 +\n this[offset + 6] * 2 ** 16 +\n (last << 24) // Overflow\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let mul = 1\n let i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let i = byteLength - 1\n let mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset + 7] = lo\n lo = lo >> 8\n buf[offset + 6] = lo\n lo = lo >> 8\n buf[offset + 5] = lo\n lo = lo >> 8\n buf[offset + 4] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset + 3] = hi\n hi = hi >> 8\n buf[offset + 2] = hi\n hi = hi >> 8\n buf[offset + 1] = hi\n hi = hi >> 8\n buf[offset] = hi\n return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = 0\n let mul = 1\n let sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = byteLength - 1\n let mul = 1\n let sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n const len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n let i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n const bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n const len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor () {\n super()\n\n Object.defineProperty(this, 'message', {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n })\n\n // Add the error code to the name to include it in the stack trace.\n this.name = `${this.name} [${sym}]`\n // Access the stack to generate the error message including the error code\n // from the name.\n this.stack // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n delete this.name\n }\n\n get code () {\n return sym\n }\n\n set code (value) {\n Object.defineProperty(this, 'code', {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n })\n }\n\n toString () {\n return `${this.name} [${sym}]: ${this.message}`\n }\n }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`\n }\n\n return 'Attempt to access memory outside buffer bounds'\n }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n }, TypeError)\nE('ERR_OUT_OF_RANGE',\n function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`\n let received = input\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n }\n msg += ` It must be ${range}. Received ${received}`\n return msg\n }, RangeError)\n\nfunction addNumericalSeparator (val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n validateNumber(offset, 'offset')\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1))\n }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === 'bigint' ? 'n' : ''\n let range\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n `${(byteLength + 1) * 8 - 1}${n}`\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`\n }\n throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n }\n checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n if (typeof value !== 'number') {\n throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n}\n\nfunction boundsError (value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type)\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n `>= ${type ? 1 : 0} and <= ${length}`,\n value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n let c, hi, lo\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n let i\n for (i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef'\n const table = new Array(256)\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n throw new Error('BigInt not supported')\n}\n","import {Buffer} from 'buffer';\n\nexport const toBuffer = (arr: Buffer | Uint8Array | Array<number>): Buffer => {\n if (arr instanceof Buffer) {\n return arr;\n } else if (arr instanceof Uint8Array) {\n return Buffer.from(arr.buffer, arr.byteOffset, arr.byteLength);\n } else {\n return Buffer.from(arr);\n }\n};\n","/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","// base-x encoding\n// Forked from https://github.com/cryptocoinjs/bs58\n// Originally written by Mike Hearn for BitcoinJ\n// Copyright (c) 2011 Google Inc\n// Ported to JavaScript by Stefan Thomas\n// Merged Buffer refactorings from base58-native by Stephen Pair\n// Copyright (c) 2013 BitPay Inc\n\nvar Buffer = require('safe-buffer').Buffer\n\nmodule.exports = function base (ALPHABET) {\n var ALPHABET_MAP = {}\n var BASE = ALPHABET.length\n var LEADER = ALPHABET.charAt(0)\n\n // pre-compute lookup table\n for (var z = 0; z < ALPHABET.length; z++) {\n var x = ALPHABET.charAt(z)\n\n if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')\n ALPHABET_MAP[x] = z\n }\n\n function encode (source) {\n if (source.length === 0) return ''\n\n var digits = [0]\n for (var i = 0; i < source.length; ++i) {\n for (var j = 0, carry = source[i]; j < digits.length; ++j) {\n carry += digits[j] << 8\n digits[j] = carry % BASE\n carry = (carry / BASE) | 0\n }\n\n while (carry > 0) {\n digits.push(carry % BASE)\n carry = (carry / BASE) | 0\n }\n }\n\n var string = ''\n\n // deal with leading zeros\n for (var k = 0; source[k] === 0 && k < source.length - 1; ++k) string += LEADER\n // convert digits to a string\n for (var q = digits.length - 1; q >= 0; --q) string += ALPHABET[digits[q]]\n\n return string\n }\n\n function decodeUnsafe (string) {\n if (typeof string !== 'string') throw new TypeError('Expected String')\n if (string.length === 0) return Buffer.allocUnsafe(0)\n\n var bytes = [0]\n for (var i = 0; i < string.length; i++) {\n var value = ALPHABET_MAP[string[i]]\n if (value === undefined) return\n\n for (var j = 0, carry = value; j < bytes.length; ++j) {\n carry += bytes[j] * BASE\n bytes[j] = carry & 0xff\n carry >>= 8\n }\n\n while (carry > 0) {\n bytes.push(carry & 0xff)\n carry >>= 8\n }\n }\n\n // deal with leading zeros\n for (var k = 0; string[k] === LEADER && k < string.length - 1; ++k) {\n bytes.push(0)\n }\n\n return Buffer.from(bytes.reverse())\n }\n\n function decode (string) {\n var buffer = decodeUnsafe(string)\n if (buffer) return buffer\n\n throw new Error('Non-base' + BASE + ' character')\n }\n\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n }\n}\n","var basex = require('base-x')\nvar ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n\nmodule.exports = basex(ALPHABET)\n","import BN from 'bn.js';\nimport bs58 from 'bs58';\nimport nacl from 'tweetnacl';\nimport {sha256} from 'crypto-hash';\nimport {Buffer} from 'buffer';\n\n/**\n * Maximum length of derived pubkey seed\n */\nexport const MAX_SEED_LENGTH = 32;\n\n/**\n * A public key\n */\nexport class PublicKey {\n /** @internal */\n _bn: BN;\n\n /**\n * Create a new PublicKey object\n * @param value ed25519 public key as buffer or base-58 encoded string\n */\n constructor(value: number | string | Buffer | Uint8Array | Array<number>) {\n if (typeof value === 'string') {\n // assume base 58 encoding by default\n const decoded = bs58.decode(value);\n if (decoded.length != 32) {\n throw new Error(`Invalid public key input`);\n }\n this._bn = new BN(decoded);\n } else {\n this._bn = new BN(value);\n }\n\n if (this._bn.byteLength() > 32) {\n throw new Error(`Invalid public key input`);\n }\n }\n\n /**\n * Checks if two publicKeys are equal\n */\n equals(publicKey: PublicKey): boolean {\n return this._bn.eq(publicKey._bn);\n }\n\n /**\n * Return the base-58 representation of the public key\n */\n toBase58(): string {\n return bs58.encode(this.toBuffer());\n }\n\n /**\n * Return the Buffer representation of the public key\n */\n toBuffer(): Buffer {\n const b = this._bn.toArrayLike(Buffer);\n if (b.length === 32) {\n return b;\n }\n\n const zeroPad = Buffer.alloc(32);\n b.copy(zeroPad, 32 - b.length);\n return zeroPad;\n }\n\n /**\n * Return the base-58 representation of the public key\n */\n toString(): string {\n return this.toBase58();\n }\n\n /**\n * Derive a public key from another key, a seed, and a program ID.\n */\n static async createWithSeed(\n fromPublicKey: PublicKey,\n seed: string,\n programId: PublicKey,\n ): Promise<PublicKey> {\n const buffer = Buffer.concat([\n fromPublicKey.toBuffer(),\n Buffer.from(seed),\n programId.toBuffer(),\n ]);\n const hash = await sha256(new Uint8Array(buffer));\n return new PublicKey(Buffer.from(hash, 'hex'));\n }\n\n /**\n * Derive a program address from seeds and a program ID.\n */\n static async createProgramAddress(\n seeds: Array<Buffer | Uint8Array>,\n programId: PublicKey,\n ): Promise<PublicKey> {\n let buffer = Buffer.alloc(0);\n seeds.forEach(function (seed) {\n if (seed.length > MAX_SEED_LENGTH) {\n throw new Error(`Max seed length exceeded`);\n }\n buffer = Buffer.concat([buffer, Buffer.from(seed)]);\n });\n buffer = Buffer.concat([\n buffer,\n programId.toBuffer(),\n Buffer.from('ProgramDerivedAddress'),\n ]);\n let hash = await sha256(new Uint8Array(buffer));\n let publicKeyBytes = new BN(hash, 16).toArray(undefined, 32);\n if (is_on_curve(publicKeyBytes)) {\n throw new Error(`Invalid seeds, address must fall off the curve`);\n }\n return new PublicKey(publicKeyBytes);\n }\n\n /**\n * Find a valid program address\n *\n * Valid program addresses must fall off the ed25519 curve. This function\n * iterates a nonce until it finds one that when combined with the seeds\n * results in a valid program address.\n */\n static async findProgramAddress(\n seeds: Array<Buffer | Uint8Array>,\n programId: PublicKey,\n ): Promise<[PublicKey, number]> {\n let nonce = 255;\n let address;\n while (nonce != 0) {\n try {\n const seedsWithNonce = seeds.concat(Buffer.from([nonce]));\n address = await this.createProgramAddress(seedsWithNonce, programId);\n } catch (err) {\n nonce--;\n continue;\n }\n return [address, nonce];\n }\n throw new Error(`Unable to find a viable program address nonce`);\n }\n}\n\n// @ts-ignore\nlet naclLowLevel = nacl.lowlevel;\n\n// Check that a pubkey is on the curve.\n// This function and its dependents were sourced from:\n// https://github.com/dchest/tweetnacl-js/blob/f1ec050ceae0861f34280e62498b1d3ed9c350c6/nacl.js#L792\nfunction is_on_curve(p: any) {\n var r = [\n naclLowLevel.gf(),\n naclLowLevel.gf(),\n naclLowLevel.gf(),\n naclLowLevel.gf(),\n ];\n\n var t = naclLowLevel.gf(),\n chk = naclLowLevel.gf(),\n num = naclLowLevel.gf(),\n den = naclLowLevel.gf(),\n den2 = naclLowLevel.gf(),\n den4 = naclLowLevel.gf(),\n den6 = naclLowLevel.gf();\n\n naclLowLevel.set25519(r[2], gf1);\n naclLowLevel.unpack25519(r[1], p);\n naclLowLevel.S(num, r[1]);\n naclLowLevel.M(den, num, naclLowLevel.D);\n naclLowLevel.Z(num, num, r[2]);\n naclLowLevel.A(den, r[2], den);\n\n naclLowLevel.S(den2, den);\n naclLowLevel.S(den4, den2);\n naclLowLevel.M(den6, den4, den2);\n naclLowLevel.M(t, den6, num);\n naclLowLevel.M(t, t, den);\n\n naclLowLevel.pow2523(t, t);\n naclLowLevel.M(t, t, num);\n naclLowLevel.M(t, t, den);\n naclLowLevel.M(t, t, den);\n naclLowLevel.M(r[0], t, den);\n\n naclLowLevel.S(chk, r[0]);\n naclLowLevel.M(chk, chk, den);\n if (neq25519(chk, num)) naclLowLevel.M(r[0], r[0], I);\n\n naclLowLevel.S(chk, r[0]);\n naclLowLevel.M(chk, chk, den);\n if (neq25519(chk, num)) return 0;\n return 1;\n}\nlet gf1 = naclLowLevel.gf([1]);\nlet I = naclLowLevel.gf([\n 0xa0b0,\n 0x4a0e,\n 0x1b27,\n 0xc4ee,\n 0xe478,\n 0xad2f,\n 0x1806,\n 0x2f43,\n 0xd7a7,\n 0x3dfb,\n 0x0099,\n 0x2b4d,\n 0xdf0b,\n 0x4fc1,\n 0x2480,\n 0x2b83,\n]);\nfunction neq25519(a: any, b: any) {\n var c = new Uint8Array(32),\n d = new Uint8Array(32);\n naclLowLevel.pack25519(c, a);\n naclLowLevel.pack25519(d, b);\n return naclLowLevel.crypto_verify_32(c, 0, d, 0);\n}\n","import * as nacl from 'tweetnacl';\nimport type {SignKeyPair as KeyPair} from 'tweetnacl';\n\nimport {toBuffer} from './util/to-buffer';\nimport {PublicKey} from './publickey';\n\n/**\n * An account key pair (public and secret keys).\n */\nexport class Account {\n /** @internal */\n _keypair: KeyPair;\n\n /**\n * Create a new Account object\n *\n * If the secretKey parameter is not provided a new key pair is randomly\n * created for the account\n *\n * @param secretKey Secret key for the account\n */\n constructor(secretKey?: Buffer | Uint8Array | Array<number>) {\n if (secretKey) {\n this._keypair = nacl.sign.keyPair.fromSecretKey(toBuffer(secretKey));\n } else {\n this._keypair = nacl.sign.keyPair();\n }\n }\n\n /**\n * The public key for this account\n */\n get publicKey(): PublicKey {\n return new PublicKey(this._keypair.publicKey);\n }\n\n /**\n * The **unencrypted** secret key for this account\n */\n get secretKey(): Buffer {\n return toBuffer(this._keypair.secretKey);\n }\n}\n","import {PublicKey} from './publickey';\n\nexport const BPF_LOADER_DEPRECATED_PROGRAM_ID = new PublicKey(\n 'BPFLoader1111111111111111111111111111111111',\n);\n","export default (typeof global !== \"undefined\" ? global :\n typeof self !== \"undefined\" ? self :\n typeof window !== \"undefined\" ? window : {});","\nvar inherits;\nif (typeof Object.create === 'function'){\n inherits = function inherits(ctor, superCtor) {\n // implementation from standard node.js 'util' module\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n inherits = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\nexport default inherits;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\nimport process from 'process';\nvar formatRegExp = /%[sdj%]/g;\nexport function format(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexport function deprecate(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexport function debuglog(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = 0;\n debugs[set] = function() {\n var msg = format.apply(null, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nexport function inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n _extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nexport function isArray(ar) {\n return Array.isArray(ar);\n}\n\nexport function isBoolean(arg) {\n return typeof arg === 'boolean';\n}\n\nexport function isNull(arg) {\n return arg === null;\n}\n\nexport function isNullOrUndefined(arg) {\n return arg == null;\n}\n\nexport function isNumber(arg) {\n return typeof arg === 'number';\n}\n\nexport function isString(arg) {\n return typeof arg === 'string';\n}\n\nexport function isSymbol(arg) {\n return typeof arg === 'symbol';\n}\n\nexport function isUndefined(arg) {\n return arg === void 0;\n}\n\nexport function isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\n\nexport function isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nexport function isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\n\nexport function isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\n\nexport function isFunction(arg) {\n return typeof arg === 'function';\n}\n\nexport function isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\n\nexport function isBuffer(maybeBuf) {\n return Buffer.isBuffer(maybeBuf);\n}\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexport function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n}\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nimport inherits from './inherits';\nexport {inherits}\n\nexport function _extend(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport default {\n inherits: inherits,\n _extend: _extend,\n log: log,\n isBuffer: isBuffer,\n isPrimitive: isPrimitive,\n isFunction: isFunction,\n isError: isError,\n isDate: isDate,\n isObject: isObject,\n isRegExp: isRegExp,\n isUndefined: isUndefined,\n isSymbol: isSymbol,\n isString: isString,\n isNumber: isNumber,\n isNullOrUndefined: isNullOrUndefined,\n isNull: isNull,\n isBoolean: isBoolean,\n isArray: isArray,\n inspect: inspect,\n deprecate: deprecate,\n format: format,\n debuglog: debuglog\n}\n","\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n if (hasOwn.call(obj, key)) keys.push(key);\n }\n return keys;\n};\n// based on node assert, original notice:\n\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nimport {isBuffer} from 'buffer';\nimport {isPrimitive, inherits, isError, isFunction, isRegExp, isDate, inspect as utilInspect} from 'util';\nvar pSlice = Array.prototype.slice;\nvar _functionsHaveNames;\nfunction functionsHaveNames() {\n if (typeof _functionsHaveNames !== 'undefined') {\n return _functionsHaveNames;\n }\n return _functionsHaveNames = (function () {\n return function foo() {}.name === 'foo';\n }());\n}\nfunction pToString (obj) {\n return Object.prototype.toString.call(obj);\n}\nfunction isView(arrbuf) {\n if (isBuffer(arrbuf)) {\n return false;\n }\n if (typeof global.ArrayBuffer !== 'function') {\n return false;\n }\n if (typeof ArrayBuffer.isView === 'function') {\n return ArrayBuffer.isView(arrbuf);\n }\n if (!arrbuf) {\n return false;\n }\n if (arrbuf instanceof DataView) {\n return true;\n }\n if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {\n return true;\n }\n return false;\n}\n// 1. The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nfunction assert(value, message) {\n if (!value) fail(value, true, message, '==', ok);\n}\nexport default assert;\n\n// 2. The AssertionError is defined in assert.\n// new assert.AssertionError({ message: message,\n// actual: actual,\n// expected: expected })\n\nvar regex = /\\s*function\\s+([^\\(\\s]*)\\s*/;\n// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js\nfunction getName(func) {\n if (!isFunction(func)) {\n return;\n }\n if (functionsHaveNames()) {\n return func.name;\n }\n var str = func.toString();\n var match = str.match(regex);\n return match && match[1];\n}\nassert.AssertionError = AssertionError;\nexport function AssertionError(options) {\n this.name = 'AssertionError';\n this.actual = options.actual;\n this.expected = options.expected;\n this.operator = options.operator;\n if (options.message) {\n this.message = options.message;\n this.generatedMessage = false;\n } else {\n this.message = getMessage(this);\n this.generatedMessage = true;\n }\n var stackStartFunction = options.stackStartFunction || fail;\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, stackStartFunction);\n } else {\n // non v8 browsers so we can have a stacktrace\n var err = new Error();\n if (err.stack) {\n var out = err.stack;\n\n // try to strip useless frames\n var fn_name = getName(stackStartFunction);\n var idx = out.indexOf('\\n' + fn_name);\n if (idx >= 0) {\n // once we have located the function frame\n // we need to strip out everything before it (and its line)\n var next_line = out.indexOf('\\n', idx + 1);\n out = out.substring(next_line + 1);\n }\n\n this.stack = out;\n }\n }\n}\n\n// assert.AssertionError instanceof Error\ninherits(AssertionError, Error);\n\nfunction truncate(s, n) {\n if (typeof s === 'string') {\n return s.length < n ? s : s.slice(0, n);\n } else {\n return s;\n }\n}\nfunction inspect(something) {\n if (functionsHaveNames() || !isFunction(something)) {\n return utilInspect(something);\n }\n var rawname = getName(something);\n var name = rawname ? ': ' + rawname : '';\n return '[Function' + name + ']';\n}\nfunction getMessage(self) {\n return truncate(inspect(self.actual), 128) + ' ' +\n self.operator + ' ' +\n truncate(inspect(self.expected), 128);\n}\n\n// At present only the three keys mentioned above are used and\n// understood by the spec. Implementations or sub modules can pass\n// other keys to the AssertionError's constructor - they will be\n// ignored.\n\n// 3. All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nexport function fail(actual, expected, message, operator, stackStartFunction) {\n throw new AssertionError({\n message: message,\n actual: actual,\n expected: expected,\n operator: operator,\n stackStartFunction: stackStartFunction\n });\n}\n\n// EXTENSION! allows for well behaved errors defined elsewhere.\nassert.fail = fail;\n\n// 4. Pure assertion tests whether a value is truthy, as determined\n// by !!guard.\n// assert.ok(guard, message_opt);\n// This statement is equivalent to assert.equal(true, !!guard,\n// message_opt);. To test strictly for the value true, use\n// assert.strictEqual(true, guard, message_opt);.\n\nexport function ok(value, message) {\n if (!value) fail(value, true, message, '==', ok);\n}\nassert.ok = ok;\nexport {ok as assert};\n\n// 5. The equality assertion tests shallow, coercive equality with\n// ==.\n// assert.equal(actual, expected, message_opt);\nassert.equal = equal;\nexport function equal(actual, expected, message) {\n if (actual != expected) fail(actual, expected, message, '==', equal);\n}\n\n// 6. The non-equality assertion tests for whether two objects are not equal\n// with != assert.notEqual(actual, expected, message_opt);\nassert.notEqual = notEqual;\nexport function notEqual(actual, expected, message) {\n if (actual == expected) {\n fail(actual, expected, message, '!=', notEqual);\n }\n}\n\n// 7. The equivalence assertion tests a deep equality relation.\n// assert.deepEqual(actual, expected, message_opt);\nassert.deepEqual = deepEqual;\nexport function deepEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'deepEqual', deepEqual);\n }\n}\nassert.deepStrictEqual = deepStrictEqual;\nexport function deepStrictEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'deepStrictEqual', deepStrictEqual);\n }\n}\n\nfunction _deepEqual(actual, expected, strict, memos) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n } else if (isBuffer(actual) && isBuffer(expected)) {\n return compare(actual, expected) === 0;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (isDate(actual) && isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (isRegExp(actual) && isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if ((actual === null || typeof actual !== 'object') &&\n (expected === null || typeof expected !== 'object')) {\n return strict ? actual === expected : actual == expected;\n\n // If both values are instances of typed arrays, wrap their underlying\n // ArrayBuffers in a Buffer each to increase performance\n // This optimization requires the arrays to have the same type as checked by\n // Object.prototype.toString (aka pToString). Never perform binary\n // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their\n // bit patterns are not identical.\n } else if (isView(actual) && isView(expected) &&\n pToString(actual) === pToString(expected) &&\n !(actual instanceof Float32Array ||\n actual instanceof Float64Array)) {\n return compare(new Uint8Array(actual.buffer),\n new Uint8Array(expected.buffer)) === 0;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else if (isBuffer(actual) !== isBuffer(expected)) {\n return false;\n } else {\n memos = memos || {actual: [], expected: []};\n\n var actualIndex = memos.actual.indexOf(actual);\n if (actualIndex !== -1) {\n if (actualIndex === memos.expected.indexOf(expected)) {\n return true;\n }\n }\n\n memos.actual.push(actual);\n memos.expected.push(expected);\n\n return objEquiv(actual, expected, strict, memos);\n }\n}\n\nfunction isArguments(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\nfunction objEquiv(a, b, strict, actualVisitedObjects) {\n if (a === null || a === undefined || b === null || b === undefined)\n return false;\n // if one is a primitive, the other must be same\n if (isPrimitive(a) || isPrimitive(b))\n return a === b;\n if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))\n return false;\n var aIsArgs = isArguments(a);\n var bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))\n return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return _deepEqual(a, b, strict);\n }\n var ka = objectKeys(a);\n var kb = objectKeys(b);\n var key, i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length !== kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] !== kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))\n return false;\n }\n return true;\n}\n\n// 8. The non-equivalence assertion tests for any deep inequality.\n// assert.notDeepEqual(actual, expected, message_opt);\nassert.notDeepEqual = notDeepEqual;\nexport function notDeepEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'notDeepEqual', notDeepEqual);\n }\n}\n\nassert.notDeepStrictEqual = notDeepStrictEqual;\nexport function notDeepStrictEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);\n }\n}\n\n\n// 9. The strict equality assertion tests strict equality, as determined by ===.\n// assert.strictEqual(actual, expected, message_opt);\nassert.strictEqual = strictEqual;\nexport function strictEqual(actual, expected, message) {\n if (actual !== expected) {\n fail(actual, expected, message, '===', strictEqual);\n }\n}\n\n// 10. The strict non-equality assertion tests for strict inequality, as\n// determined by !==. assert.notStrictEqual(actual, expected, message_opt);\nassert.notStrictEqual = notStrictEqual;\nexport function notStrictEqual(actual, expected, message) {\n if (actual === expected) {\n fail(actual, expected, message, '!==', notStrictEqual);\n }\n}\n\nfunction expectedException(actual, expected) {\n if (!actual || !expected) {\n return false;\n }\n\n if (Object.prototype.toString.call(expected) == '[object RegExp]') {\n return expected.test(actual);\n }\n\n try {\n if (actual instanceof expected) {\n return true;\n }\n } catch (e) {\n // Ignore. The instanceof check doesn't work for arrow functions.\n }\n\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n\n return expected.call({}, actual) === true;\n}\n\nfunction _tryBlock(block) {\n var error;\n try {\n block();\n } catch (e) {\n error = e;\n }\n return error;\n}\n\nfunction _throws(shouldThrow, block, expected, message) {\n var actual;\n\n if (typeof block !== 'function') {\n throw new TypeError('\"block\" argument must be a function');\n }\n\n if (typeof expected === 'string') {\n message = expected;\n expected = null;\n }\n\n actual = _tryBlock(block);\n\n message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +\n (message ? ' ' + message : '.');\n\n if (shouldThrow && !actual) {\n fail(actual, expected, 'Missing expected exception' + message);\n }\n\n var userProvidedMessage = typeof message === 'string';\n var isUnwantedException = !shouldThrow && isError(actual);\n var isUnexpectedException = !shouldThrow && actual && !expected;\n\n if ((isUnwantedException &&\n userProvidedMessage &&\n expectedException(actual, expected)) ||\n isUnexpectedException) {\n fail(actual, expected, 'Got unwanted exception' + message);\n }\n\n if ((shouldThrow && actual && expected &&\n !expectedException(actual, expected)) || (!shouldThrow && actual)) {\n throw actual;\n }\n}\n\n// 11. Expected to throw an error:\n// assert.throws(block, Error_opt, message_opt);\nassert.throws = throws;\nexport function throws(block, /*optional*/error, /*optional*/message) {\n _throws(true, block, error, message);\n}\n\n// EXTENSION! This is annoying to write outside this module.\nassert.doesNotThrow = doesNotThrow;\nexport function doesNotThrow(block, /*optional*/error, /*optional*/message) {\n _throws(false, block, error, message);\n}\n\nassert.ifError = ifError;\nexport function ifError(err) {\n if (err) throw err;\n}\n","/* The MIT License (MIT)\n *\n * Copyright 2015-2018 Peter A. Bigot\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Support for translating between Buffer instances and JavaScript\n * native types.\n *\n * {@link module:Layout~Layout|Layout} is the basis of a class\n * hierarchy that associates property names with sequences of encoded\n * bytes.\n *\n * Layouts are supported for these scalar (numeric) types:\n * * {@link module:Layout~UInt|Unsigned integers in little-endian\n * format} with {@link module:Layout.u8|8-bit}, {@link\n * module:Layout.u16|16-bit}, {@link module:Layout.u24|24-bit},\n * {@link module:Layout.u32|32-bit}, {@link\n * module:Layout.u40|40-bit}, and {@link module:Layout.u48|48-bit}\n * representation ranges;\n * * {@link module:Layout~UIntBE|Unsigned integers in big-endian\n * format} with {@link module:Layout.u16be|16-bit}, {@link\n * module:Layout.u24be|24-bit}, {@link module:Layout.u32be|32-bit},\n * {@link module:Layout.u40be|40-bit}, and {@link\n * module:Layout.u48be|48-bit} representation ranges;\n * * {@link module:Layout~Int|Signed integers in little-endian\n * format} with {@link module:Layout.s8|8-bit}, {@link\n * module:Layout.s16|16-bit}, {@link module:Layout.s24|24-bit},\n * {@link module:Layout.s32|32-bit}, {@link\n * module:Layout.s40|40-bit}, and {@link module:Layout.s48|48-bit}\n * representation ranges;\n * * {@link module:Layout~IntBE|Signed integers in big-endian format}\n * with {@link module:Layout.s16be|16-bit}, {@link\n * module:Layout.s24be|24-bit}, {@link module:Layout.s32be|32-bit},\n * {@link module:Layout.s40be|40-bit}, and {@link\n * module:Layout.s48be|48-bit} representation ranges;\n * * 64-bit integral values that decode to an exact (if magnitude is\n * less than 2^53) or nearby integral Number in {@link\n * module:Layout.nu64|unsigned little-endian}, {@link\n * module:Layout.nu64be|unsigned big-endian}, {@link\n * module:Layout.ns64|signed little-endian}, and {@link\n * module:Layout.ns64be|unsigned big-endian} encodings;\n * * 32-bit floating point values with {@link\n * module:Layout.f32|little-endian} and {@link\n * module:Layout.f32be|big-endian} representations;\n * * 64-bit floating point values with {@link\n * module:Layout.f64|little-endian} and {@link\n * module:Layout.f64be|big-endian} representations;\n * * {@link module:Layout.const|Constants} that take no space in the\n * encoded expression.\n *\n * and for these aggregate types:\n * * {@link module:Layout.seq|Sequence}s of instances of a {@link\n * module:Layout~Layout|Layout}, with JavaScript representation as\n * an Array and constant or data-dependent {@link\n * module:Layout~Sequence#count|length};\n * * {@link module:Layout.struct|Structure}s that aggregate a\n * heterogeneous sequence of {@link module:Layout~Layout|Layout}\n * instances, with JavaScript representation as an Object;\n * * {@link module:Layout.union|Union}s that support multiple {@link\n * module:Layout~VariantLayout|variant layouts} over a fixed\n * (padded) or variable (not padded) span of bytes, using an\n * unsigned integer at the start of the data or a separate {@link\n * module:Layout.unionLayoutDiscriminator|layout element} to\n * determine which layout to use when interpreting the buffer\n * contents;\n * * {@link module:Layout.bits|BitStructure}s that contain a sequence\n * of individual {@link\n * module:Layout~BitStructure#addField|BitField}s packed into an 8,\n * 16, 24, or 32-bit unsigned integer starting at the least- or\n * most-significant bit;\n * * {@link module:Layout.cstr|C strings} of varying length;\n * * {@link module:Layout.blob|Blobs} of fixed- or variable-{@link\n * module:Layout~Blob#length|length} raw data.\n *\n * All {@link module:Layout~Layout|Layout} instances are immutable\n * after construction, to prevent internal state from becoming\n * inconsistent.\n *\n * @local Layout\n * @local ExternalLayout\n * @local GreedyCount\n * @local OffsetLayout\n * @local UInt\n * @local UIntBE\n * @local Int\n * @local IntBE\n * @local NearUInt64\n * @local NearUInt64BE\n * @local NearInt64\n * @local NearInt64BE\n * @local Float\n * @local FloatBE\n * @local Double\n * @local DoubleBE\n * @local Sequence\n * @local Structure\n * @local UnionDiscriminator\n * @local UnionLayoutDiscriminator\n * @local Union\n * @local VariantLayout\n * @local BitStructure\n * @local BitField\n * @local Boolean\n * @local Blob\n * @local CString\n * @local Constant\n * @local bindConstructorLayout\n * @module Layout\n * @license MIT\n * @author Peter A. Bigot\n * @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub}\n */\n\n'use strict';\n\nconst assert = require('assert');\n\n/**\n * Base class for layout objects.\n *\n * **NOTE** This is an abstract base class; you can create instances\n * if it amuses you, but they won't support the {@link\n * Layout#encode|encode} or {@link Layout#decode|decode} functions.\n *\n * @param {Number} span - Initializer for {@link Layout#span|span}. The\n * parameter must be an integer; a negative value signifies that the\n * span is {@link Layout#getSpan|value-specific}.\n *\n * @param {string} [property] - Initializer for {@link\n * Layout#property|property}.\n *\n * @abstract\n */\nclass Layout {\n constructor(span, property) {\n if (!Number.isInteger(span)) {\n throw new TypeError('span must be an integer');\n }\n\n /** The span of the layout in bytes.\n *\n * Positive values are generally expected.\n *\n * Zero will only appear in {@link Constant}s and in {@link\n * Sequence}s where the {@link Sequence#count|count} is zero.\n *\n * A negative value indicates that the span is value-specific, and\n * must be obtained using {@link Layout#getSpan|getSpan}. */\n this.span = span;\n\n /** The property name used when this layout is represented in an\n * Object.\n *\n * Used only for layouts that {@link Layout#decode|decode} to Object\n * instances. If left undefined the span of the unnamed layout will\n * be treated as padding: it will not be mutated by {@link\n * Layout#encode|encode} nor represented as a property in the\n * decoded Object. */\n this.property = property;\n }\n\n /** Function to create an Object into which decoded properties will\n * be written.\n *\n * Used only for layouts that {@link Layout#decode|decode} to Object\n * instances, which means:\n * * {@link Structure}\n * * {@link Union}\n * * {@link VariantLayout}\n * * {@link BitStructure}\n *\n * If left undefined the JavaScript representation of these layouts\n * will be Object instances.\n *\n * See {@link bindConstructorLayout}.\n */\n makeDestinationObject() {\n return {};\n }\n\n /**\n * Decode from a Buffer into an JavaScript value.\n *\n * @param {Buffer} b - the buffer from which encoded data is read.\n *\n * @param {Number} [offset] - the offset at which the encoded data\n * starts. If absent a zero offset is inferred.\n *\n * @returns {(Number|Array|Object)} - the value of the decoded data.\n *\n * @abstract\n */\n decode(b, offset) {\n throw new Error('Layout is abstract');\n }\n\n /**\n * Encode a JavaScript value into a Buffer.\n *\n * @param {(Number|Array|Object)} src - the value to be encoded into\n * the buffer. The type accepted depends on the (sub-)type of {@link\n * Layout}.\n *\n * @param {Buffer} b - the buffer into which encoded data will be\n * written.\n *\n * @param {Number} [offset] - the offset at which the encoded data\n * starts. If absent a zero offset is inferred.\n *\n * @returns {Number} - the number of bytes encoded, including the\n * space skipped for internal padding, but excluding data such as\n * {@link Sequence#count|lengths} when stored {@link\n * ExternalLayout|externally}. This is the adjustment to `offset`\n * producing the offset where data for the next layout would be\n * written.\n *\n * @abstract\n */\n encode(src, b, offset) {\n throw new Error('Layout is abstract');\n }\n\n /**\n * Calculate the span of a specific instance of a layout.\n *\n * @param {Buffer} b - the buffer that contains an encoded instance.\n *\n * @param {Number} [offset] - the offset at which the encoded instance\n * starts. If absent a zero offset is inferred.\n *\n * @return {Number} - the number of bytes covered by the layout\n * instance. If this method is not overridden in a subclass the\n * definition-time constant {@link Layout#span|span} will be\n * returned.\n *\n * @throws {RangeError} - if the length of the value cannot be\n * determined.\n */\n getSpan(b, offset) {\n if (0 > this.span) {\n throw new RangeError('indeterminate span');\n }\n return this.span;\n }\n\n /**\n * Replicate the layout using a new property.\n *\n * This function must be used to get a structurally-equivalent layout\n * with a different name since all {@link Layout} instances are\n * immutable.\n *\n * **NOTE** This is a shallow copy. All fields except {@link\n * Layout#property|property} are strictly equal to the origin layout.\n *\n * @param {String} property - the value for {@link\n * Layout#property|property} in the replica.\n *\n * @returns {Layout} - the copy with {@link Layout#property|property}\n * set to `property`.\n */\n replicate(property) {\n const rv = Object.create(this.constructor.prototype);\n Object.assign(rv, this);\n rv.property = property;\n return rv;\n }\n\n /**\n * Create an object from layout properties and an array of values.\n *\n * **NOTE** This function returns `undefined` if invoked on a layout\n * that does not return its value as an Object. Objects are\n * returned for things that are a {@link Structure}, which includes\n * {@link VariantLayout|variant layouts} if they are structures, and\n * excludes {@link Union}s. If you want this feature for a union\n * you must use {@link Union.getVariant|getVariant} to select the\n * desired layout.\n *\n * @param {Array} values - an array of values that correspond to the\n * default order for properties. As with {@link Layout#decode|decode}\n * layout elements that have no property name are skipped when\n * iterating over the array values. Only the top-level properties are\n * assigned; arguments are not assigned to properties of contained\n * layouts. Any unused values are ignored.\n *\n * @return {(Object|undefined)}\n */\n fromArray(values) {\n return undefined;\n }\n}\nexports.Layout = Layout;\n\n/* Provide text that carries a name (such as for a function that will\n * be throwing an error) annotated with the property of a given layout\n * (such as one for which the value was unacceptable).\n *\n * @ignore */\nfunction nameWithProperty(name, lo) {\n if (lo.property) {\n return name + '[' + lo.property + ']';\n }\n return name;\n}\nexports.nameWithProperty = nameWithProperty;\n\n/**\n * Augment a class so that instances can be encoded/decoded using a\n * given layout.\n *\n * Calling this function couples `Class` with `layout` in several ways:\n *\n * * `Class.layout_` becomes a static member property equal to `layout`;\n * * `layout.boundConstructor_` becomes a static member property equal\n * to `Class`;\n * * The {@link Layout#makeDestinationObject|makeDestinationObject()}\n * property of `layout` is set to a function that returns a `new\n * Class()`;\n * * `Class.decode(b, offset)` becomes a static member function that\n * delegates to {@link Layout#decode|layout.decode}. The\n * synthesized function may be captured and extended.\n * * `Class.prototype.encode(b, offset)` provides an instance member\n * function that delegates to {@link Layout#encode|layout.encode}\n * with `src` set to `this`. The synthesized function may be\n * captured and extended, but when the extension is invoked `this`\n * must be explicitly bound to the instance.\n *\n * @param {class} Class - a JavaScript class with a nullary\n * constructor.\n *\n * @param {Layout} layout - the {@link Layout} instance used to encode\n * instances of `Class`.\n */\nfunction bindConstructorLayout(Class, layout) {\n if ('function' !== typeof Class) {\n throw new TypeError('Class must be constructor');\n }\n if (Class.hasOwnProperty('layout_')) {\n throw new Error('Class is already bound to a layout');\n }\n if (!(layout && (layout instanceof Layout))) {\n throw new TypeError('layout must be a Layout');\n }\n if (layout.hasOwnProperty('boundConstructor_')) {\n throw new Error('layout is already bound to a constructor');\n }\n Class.layout_ = layout;\n layout.boundConstructor_ = Class;\n layout.makeDestinationObject = (() => new Class());\n Object.defineProperty(Class.prototype, 'encode', {\n value: function(b, offset) {\n return layout.encode(this, b, offset);\n },\n writable: true,\n });\n Object.defineProperty(Class, 'decode', {\n value: function(b, offset) {\n return layout.decode(b, offset);\n },\n writable: true,\n });\n}\nexports.bindConstructorLayout = bindConstructorLayout;\n\n/**\n * An object that behaves like a layout but does not consume space\n * within its containing layout.\n *\n * This is primarily used to obtain metadata about a member, such as a\n * {@link OffsetLayout} that can provide data about a {@link\n * Layout#getSpan|value-specific span}.\n *\n * **NOTE** This is an abstract base class; you can create instances\n * if it amuses you, but they won't support {@link\n * ExternalLayout#isCount|isCount} or other {@link Layout} functions.\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @abstract\n * @augments {Layout}\n */\nclass ExternalLayout extends Layout {\n /**\n * Return `true` iff the external layout decodes to an unsigned\n * integer layout.\n *\n * In that case it can be used as the source of {@link\n * Sequence#count|Sequence counts}, {@link Blob#length|Blob lengths},\n * or as {@link UnionLayoutDiscriminator#layout|external union\n * discriminators}.\n *\n * @abstract\n */\n isCount() {\n throw new Error('ExternalLayout is abstract');\n }\n}\n\n/**\n * An {@link ExternalLayout} that determines its {@link\n * Layout#decode|value} based on offset into and length of the buffer\n * on which it is invoked.\n *\n * *Factory*: {@link module:Layout.greedy|greedy}\n *\n * @param {Number} [elementSpan] - initializer for {@link\n * GreedyCount#elementSpan|elementSpan}.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {ExternalLayout}\n */\nclass GreedyCount extends ExternalLayout {\n constructor(elementSpan, property) {\n if (undefined === elementSpan) {\n elementSpan = 1;\n }\n if ((!Number.isInteger(elementSpan)) || (0 >= elementSpan)) {\n throw new TypeError('elementSpan must be a (positive) integer');\n }\n super(-1, property);\n\n /** The layout for individual elements of the sequence. The value\n * must be a positive integer. If not provided, the value will be\n * 1. */\n this.elementSpan = elementSpan;\n }\n\n /** @override */\n isCount() {\n return true;\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const rem = b.length - offset;\n return Math.floor(rem / this.elementSpan);\n }\n\n /** @override */\n encode(src, b, offset) {\n return 0;\n }\n}\n\n/**\n * An {@link ExternalLayout} that supports accessing a {@link Layout}\n * at a fixed offset from the start of another Layout. The offset may\n * be before, within, or after the base layout.\n *\n * *Factory*: {@link module:Layout.offset|offset}\n *\n * @param {Layout} layout - initializer for {@link\n * OffsetLayout#layout|layout}, modulo `property`.\n *\n * @param {Number} [offset] - Initializes {@link\n * OffsetLayout#offset|offset}. Defaults to zero.\n *\n * @param {string} [property] - Optional new property name for a\n * {@link Layout#replicate| replica} of `layout` to be used as {@link\n * OffsetLayout#layout|layout}. If not provided the `layout` is used\n * unchanged.\n *\n * @augments {Layout}\n */\nclass OffsetLayout extends ExternalLayout {\n constructor(layout, offset, property) {\n if (!(layout instanceof Layout)) {\n throw new TypeError('layout must be a Layout');\n }\n\n if (undefined === offset) {\n offset = 0;\n } else if (!Number.isInteger(offset)) {\n throw new TypeError('offset must be integer or undefined');\n }\n\n super(layout.span, property || layout.property);\n\n /** The subordinated layout. */\n this.layout = layout;\n\n /** The location of {@link OffsetLayout#layout} relative to the\n * start of another layout.\n *\n * The value may be positive or negative, but an error will thrown\n * if at the point of use it goes outside the span of the Buffer\n * being accessed. */\n this.offset = offset;\n }\n\n /** @override */\n isCount() {\n return ((this.layout instanceof UInt)\n || (this.layout instanceof UIntBE));\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return this.layout.decode(b, offset + this.offset);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return this.layout.encode(src, b, offset + this.offset);\n }\n}\n\n/**\n * Represent an unsigned integer in little-endian format.\n *\n * *Factory*: {@link module:Layout.u8|u8}, {@link\n * module:Layout.u16|u16}, {@link module:Layout.u24|u24}, {@link\n * module:Layout.u32|u32}, {@link module:Layout.u40|u40}, {@link\n * module:Layout.u48|u48}\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass UInt extends Layout {\n constructor(span, property) {\n super(span, property);\n if (6 < this.span) {\n throw new RangeError('span must not exceed 6 bytes');\n }\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readUIntLE(offset, this.span);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeUIntLE(src, offset, this.span);\n return this.span;\n }\n}\n\n/**\n * Represent an unsigned integer in big-endian format.\n *\n * *Factory*: {@link module:Layout.u8be|u8be}, {@link\n * module:Layout.u16be|u16be}, {@link module:Layout.u24be|u24be},\n * {@link module:Layout.u32be|u32be}, {@link\n * module:Layout.u40be|u40be}, {@link module:Layout.u48be|u48be}\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass UIntBE extends Layout {\n constructor(span, property) {\n super( span, property);\n if (6 < this.span) {\n throw new RangeError('span must not exceed 6 bytes');\n }\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readUIntBE(offset, this.span);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeUIntBE(src, offset, this.span);\n return this.span;\n }\n}\n\n/**\n * Represent a signed integer in little-endian format.\n *\n * *Factory*: {@link module:Layout.s8|s8}, {@link\n * module:Layout.s16|s16}, {@link module:Layout.s24|s24}, {@link\n * module:Layout.s32|s32}, {@link module:Layout.s40|s40}, {@link\n * module:Layout.s48|s48}\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Int extends Layout {\n constructor(span, property) {\n super(span, property);\n if (6 < this.span) {\n throw new RangeError('span must not exceed 6 bytes');\n }\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readIntLE(offset, this.span);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeIntLE(src, offset, this.span);\n return this.span;\n }\n}\n\n/**\n * Represent a signed integer in big-endian format.\n *\n * *Factory*: {@link module:Layout.s8be|s8be}, {@link\n * module:Layout.s16be|s16be}, {@link module:Layout.s24be|s24be},\n * {@link module:Layout.s32be|s32be}, {@link\n * module:Layout.s40be|s40be}, {@link module:Layout.s48be|s48be}\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass IntBE extends Layout {\n constructor(span, property) {\n super(span, property);\n if (6 < this.span) {\n throw new RangeError('span must not exceed 6 bytes');\n }\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readIntBE(offset, this.span);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeIntBE(src, offset, this.span);\n return this.span;\n }\n}\n\nconst V2E32 = Math.pow(2, 32);\n\n/* True modulus high and low 32-bit words, where low word is always\n * non-negative. */\nfunction divmodInt64(src) {\n const hi32 = Math.floor(src / V2E32);\n const lo32 = src - (hi32 * V2E32);\n // assert.equal(roundedInt64(hi32, lo32), src);\n // assert(0 <= lo32);\n return {hi32, lo32};\n}\n/* Reconstruct Number from quotient and non-negative remainder */\nfunction roundedInt64(hi32, lo32) {\n return hi32 * V2E32 + lo32;\n}\n\n/**\n * Represent an unsigned 64-bit integer in little-endian format when\n * encoded and as a near integral JavaScript Number when decoded.\n *\n * *Factory*: {@link module:Layout.nu64|nu64}\n *\n * **NOTE** Values with magnitude greater than 2^52 may not decode to\n * the exact value of the encoded representation.\n *\n * @augments {Layout}\n */\nclass NearUInt64 extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const lo32 = b.readUInt32LE(offset);\n const hi32 = b.readUInt32LE(offset + 4);\n return roundedInt64(hi32, lo32);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const split = divmodInt64(src);\n b.writeUInt32LE(split.lo32, offset);\n b.writeUInt32LE(split.hi32, offset + 4);\n return 8;\n }\n}\n\n/**\n * Represent an unsigned 64-bit integer in big-endian format when\n * encoded and as a near integral JavaScript Number when decoded.\n *\n * *Factory*: {@link module:Layout.nu64be|nu64be}\n *\n * **NOTE** Values with magnitude greater than 2^52 may not decode to\n * the exact value of the encoded representation.\n *\n * @augments {Layout}\n */\nclass NearUInt64BE extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const hi32 = b.readUInt32BE(offset);\n const lo32 = b.readUInt32BE(offset + 4);\n return roundedInt64(hi32, lo32);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const split = divmodInt64(src);\n b.writeUInt32BE(split.hi32, offset);\n b.writeUInt32BE(split.lo32, offset + 4);\n return 8;\n }\n}\n\n/**\n * Represent a signed 64-bit integer in little-endian format when\n * encoded and as a near integral JavaScript Number when decoded.\n *\n * *Factory*: {@link module:Layout.ns64|ns64}\n *\n * **NOTE** Values with magnitude greater than 2^52 may not decode to\n * the exact value of the encoded representation.\n *\n * @augments {Layout}\n */\nclass NearInt64 extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const lo32 = b.readUInt32LE(offset);\n const hi32 = b.readInt32LE(offset + 4);\n return roundedInt64(hi32, lo32);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const split = divmodInt64(src);\n b.writeUInt32LE(split.lo32, offset);\n b.writeInt32LE(split.hi32, offset + 4);\n return 8;\n }\n}\n\n/**\n * Represent a signed 64-bit integer in big-endian format when\n * encoded and as a near integral JavaScript Number when decoded.\n *\n * *Factory*: {@link module:Layout.ns64be|ns64be}\n *\n * **NOTE** Values with magnitude greater than 2^52 may not decode to\n * the exact value of the encoded representation.\n *\n * @augments {Layout}\n */\nclass NearInt64BE extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const hi32 = b.readInt32BE(offset);\n const lo32 = b.readUInt32BE(offset + 4);\n return roundedInt64(hi32, lo32);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const split = divmodInt64(src);\n b.writeInt32BE(split.hi32, offset);\n b.writeUInt32BE(split.lo32, offset + 4);\n return 8;\n }\n}\n\n/**\n * Represent a 32-bit floating point number in little-endian format.\n *\n * *Factory*: {@link module:Layout.f32|f32}\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Float extends Layout {\n constructor(property) {\n super(4, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readFloatLE(offset);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeFloatLE(src, offset);\n return 4;\n }\n}\n\n/**\n * Represent a 32-bit floating point number in big-endian format.\n *\n * *Factory*: {@link module:Layout.f32be|f32be}\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass FloatBE extends Layout {\n constructor(property) {\n super(4, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readFloatBE(offset);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeFloatBE(src, offset);\n return 4;\n }\n}\n\n/**\n * Represent a 64-bit floating point number in little-endian format.\n *\n * *Factory*: {@link module:Layout.f64|f64}\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Double extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readDoubleLE(offset);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeDoubleLE(src, offset);\n return 8;\n }\n}\n\n/**\n * Represent a 64-bit floating point number in big-endian format.\n *\n * *Factory*: {@link module:Layout.f64be|f64be}\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass DoubleBE extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readDoubleBE(offset);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeDoubleBE(src, offset);\n return 8;\n }\n}\n\n/**\n * Represent a contiguous sequence of a specific layout as an Array.\n *\n * *Factory*: {@link module:Layout.seq|seq}\n *\n * @param {Layout} elementLayout - initializer for {@link\n * Sequence#elementLayout|elementLayout}.\n *\n * @param {(Number|ExternalLayout)} count - initializer for {@link\n * Sequence#count|count}. The parameter must be either a positive\n * integer or an instance of {@link ExternalLayout}.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Sequence extends Layout {\n constructor(elementLayout, count, property) {\n if (!(elementLayout instanceof Layout)) {\n throw new TypeError('elementLayout must be a Layout');\n }\n if (!(((count instanceof ExternalLayout) && count.isCount())\n || (Number.isInteger(count) && (0 <= count)))) {\n throw new TypeError('count must be non-negative integer '\n + 'or an unsigned integer ExternalLayout');\n }\n let span = -1;\n if ((!(count instanceof ExternalLayout))\n && (0 < elementLayout.span)) {\n span = count * elementLayout.span;\n }\n\n super(span, property);\n\n /** The layout for individual elements of the sequence. */\n this.elementLayout = elementLayout;\n\n /** The number of elements in the sequence.\n *\n * This will be either a non-negative integer or an instance of\n * {@link ExternalLayout} for which {@link\n * ExternalLayout#isCount|isCount()} is `true`. */\n this.count = count;\n }\n\n /** @override */\n getSpan(b, offset) {\n if (0 <= this.span) {\n return this.span;\n }\n if (undefined === offset) {\n offset = 0;\n }\n let span = 0;\n let count = this.count;\n if (count instanceof ExternalLayout) {\n count = count.decode(b, offset);\n }\n if (0 < this.elementLayout.span) {\n span = count * this.elementLayout.span;\n } else {\n let idx = 0;\n while (idx < count) {\n span += this.elementLayout.getSpan(b, offset + span);\n ++idx;\n }\n }\n return span;\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const rv = [];\n let i = 0;\n let count = this.count;\n if (count instanceof ExternalLayout) {\n count = count.decode(b, offset);\n }\n while (i < count) {\n rv.push(this.elementLayout.decode(b, offset));\n offset += this.elementLayout.getSpan(b, offset);\n i += 1;\n }\n return rv;\n }\n\n /** Implement {@link Layout#encode|encode} for {@link Sequence}.\n *\n * **NOTE** If `src` is shorter than {@link Sequence#count|count} then\n * the unused space in the buffer is left unchanged. If `src` is\n * longer than {@link Sequence#count|count} the unneeded elements are\n * ignored.\n *\n * **NOTE** If {@link Layout#count|count} is an instance of {@link\n * ExternalLayout} then the length of `src` will be encoded as the\n * count after `src` is encoded. */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const elo = this.elementLayout;\n const span = src.reduce((span, v) => {\n return span + elo.encode(v, b, offset + span);\n }, 0);\n if (this.count instanceof ExternalLayout) {\n this.count.encode(src.length, b, offset);\n }\n return span;\n }\n}\n\n/**\n * Represent a contiguous sequence of arbitrary layout elements as an\n * Object.\n *\n * *Factory*: {@link module:Layout.struct|struct}\n *\n * **NOTE** The {@link Layout#span|span} of the structure is variable\n * if any layout in {@link Structure#fields|fields} has a variable\n * span. When {@link Layout#encode|encoding} we must have a value for\n * all variable-length fields, or we wouldn't be able to figure out\n * how much space to use for storage. We can only identify the value\n * for a field when it has a {@link Layout#property|property}. As\n * such, although a structure may contain both unnamed fields and\n * variable-length fields, it cannot contain an unnamed\n * variable-length field.\n *\n * @param {Layout[]} fields - initializer for {@link\n * Structure#fields|fields}. An error is raised if this contains a\n * variable-length field for which a {@link Layout#property|property}\n * is not defined.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @param {Boolean} [decodePrefixes] - initializer for {@link\n * Structure#decodePrefixes|property}.\n *\n * @throws {Error} - if `fields` contains an unnamed variable-length\n * layout.\n *\n * @augments {Layout}\n */\nclass Structure extends Layout {\n constructor(fields, property, decodePrefixes) {\n if (!(Array.isArray(fields)\n && fields.reduce((acc, v) => acc && (v instanceof Layout), true))) {\n throw new TypeError('fields must be array of Layout instances');\n }\n if (('boolean' === typeof property)\n && (undefined === decodePrefixes)) {\n decodePrefixes = property;\n property = undefined;\n }\n\n /* Verify absence of unnamed variable-length fields. */\n for (const fd of fields) {\n if ((0 > fd.span)\n && (undefined === fd.property)) {\n throw new Error('fields cannot contain unnamed variable-length layout');\n }\n }\n\n let span = -1;\n try {\n span = fields.reduce((span, fd) => span + fd.getSpan(), 0);\n } catch (e) {\n }\n super(span, property);\n\n /** The sequence of {@link Layout} values that comprise the\n * structure.\n *\n * The individual elements need not be the same type, and may be\n * either scalar or aggregate layouts. If a member layout leaves\n * its {@link Layout#property|property} undefined the\n * corresponding region of the buffer associated with the element\n * will not be mutated.\n *\n * @type {Layout[]} */\n this.fields = fields;\n\n /** Control behavior of {@link Layout#decode|decode()} given short\n * buffers.\n *\n * In some situations a structure many be extended with additional\n * fields over time, with older installations providing only a\n * prefix of the full structure. If this property is `true`\n * decoding will accept those buffers and leave subsequent fields\n * undefined, as long as the buffer ends at a field boundary.\n * Defaults to `false`. */\n this.decodePrefixes = !!decodePrefixes;\n }\n\n /** @override */\n getSpan(b, offset) {\n if (0 <= this.span) {\n return this.span;\n }\n if (undefined === offset) {\n offset = 0;\n }\n let span = 0;\n try {\n span = this.fields.reduce((span, fd) => {\n const fsp = fd.getSpan(b, offset);\n offset += fsp;\n return span + fsp;\n }, 0);\n } catch (e) {\n throw new RangeError('indeterminate span');\n }\n return span;\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const dest = this.makeDestinationObject();\n for (const fd of this.fields) {\n if (undefined !== fd.property) {\n dest[fd.property] = fd.decode(b, offset);\n }\n offset += fd.getSpan(b, offset);\n if (this.decodePrefixes\n && (b.length === offset)) {\n break;\n }\n }\n return dest;\n }\n\n /** Implement {@link Layout#encode|encode} for {@link Structure}.\n *\n * If `src` is missing a property for a member with a defined {@link\n * Layout#property|property} the corresponding region of the buffer is\n * left unmodified. */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const firstOffset = offset;\n let lastOffset = 0;\n let lastWrote = 0;\n for (const fd of this.fields) {\n let span = fd.span;\n lastWrote = (0 < span) ? span : 0;\n if (undefined === fd.property) {\n /* By construction the field must be fixed-length (because\n * unnamed variable-length fields are disallowed when\n * encoding). But check it anyway. */\n assert(0 < span);\n } else {\n const fv = src[fd.property];\n if (undefined !== fv) {\n lastWrote = fd.encode(fv, b, offset);\n if (0 > span) {\n /* Read the as-encoded span, which is not necessarily the\n * same as what we wrote. */\n span = fd.getSpan(b, offset);\n }\n }\n }\n lastOffset = offset;\n offset += span;\n }\n /* Use (lastOffset + lastWrote) instead of offset because the last\n * item may have had a dynamic length and we don't want to include\n * the padding between it and the end of the space reserved for\n * it. */\n return (lastOffset + lastWrote) - firstOffset;\n }\n\n /** @override */\n fromArray(values) {\n const dest = this.makeDestinationObject();\n for (const fd of this.fields) {\n if ((undefined !== fd.property)\n && (0 < values.length)) {\n dest[fd.property] = values.shift();\n }\n }\n return dest;\n }\n\n /**\n * Get access to the layout of a given property.\n *\n * @param {String} property - the structure member of interest.\n *\n * @return {Layout} - the layout associated with `property`, or\n * undefined if there is no such property.\n */\n layoutFor(property) {\n if ('string' !== typeof property) {\n throw new TypeError('property must be string');\n }\n for (const fd of this.fields) {\n if (fd.property === property) {\n return fd;\n }\n }\n }\n\n /**\n * Get the offset of a structure member.\n *\n * @param {String} property - the structure member of interest.\n *\n * @return {Number} - the offset in bytes to the start of `property`\n * within the structure, or undefined if `property` is not a field\n * within the structure. If the property is a member but follows a\n * variable-length structure member a negative number will be\n * returned.\n */\n offsetOf(property) {\n if ('string' !== typeof property) {\n throw new TypeError('property must be string');\n }\n let offset = 0;\n for (const fd of this.fields) {\n if (fd.property === property) {\n return offset;\n }\n if (0 > fd.span) {\n offset = -1;\n } else if (0 <= offset) {\n offset += fd.span;\n }\n }\n }\n}\n\n/**\n * An object that can provide a {@link\n * Union#discriminator|discriminator} API for {@link Union}.\n *\n * **NOTE** This is an abstract base class; you can create instances\n * if it amuses you, but they won't support the {@link\n * UnionDiscriminator#encode|encode} or {@link\n * UnionDiscriminator#decode|decode} functions.\n *\n * @param {string} [property] - Default for {@link\n * UnionDiscriminator#property|property}.\n *\n * @abstract\n */\nclass UnionDiscriminator {\n constructor(property) {\n /** The {@link Layout#property|property} to be used when the\n * discriminator is referenced in isolation (generally when {@link\n * Union#decode|Union decode} cannot delegate to a specific\n * variant). */\n this.property = property;\n }\n\n /** Analog to {@link Layout#decode|Layout decode} for union discriminators.\n *\n * The implementation of this method need not reference the buffer if\n * variant information is available through other means. */\n decode() {\n throw new Error('UnionDiscriminator is abstract');\n }\n\n /** Analog to {@link Layout#decode|Layout encode} for union discriminators.\n *\n * The implementation of this method need not store the value if\n * variant information is maintained through other means. */\n encode() {\n throw new Error('UnionDiscriminator is abstract');\n }\n}\n\n/**\n * An object that can provide a {@link\n * UnionDiscriminator|discriminator API} for {@link Union} using an\n * unsigned integral {@link Layout} instance located either inside or\n * outside the union.\n *\n * @param {ExternalLayout} layout - initializes {@link\n * UnionLayoutDiscriminator#layout|layout}. Must satisfy {@link\n * ExternalLayout#isCount|isCount()}.\n *\n * @param {string} [property] - Default for {@link\n * UnionDiscriminator#property|property}, superseding the property\n * from `layout`, but defaulting to `variant` if neither `property`\n * nor layout provide a property name.\n *\n * @augments {UnionDiscriminator}\n */\nclass UnionLayoutDiscriminator extends UnionDiscriminator {\n constructor(layout, property) {\n if (!((layout instanceof ExternalLayout)\n && layout.isCount())) {\n throw new TypeError('layout must be an unsigned integer ExternalLayout');\n }\n\n super(property || layout.property || 'variant');\n\n /** The {@link ExternalLayout} used to access the discriminator\n * value. */\n this.layout = layout;\n }\n\n /** Delegate decoding to {@link UnionLayoutDiscriminator#layout|layout}. */\n decode(b, offset) {\n return this.layout.decode(b, offset);\n }\n\n /** Delegate encoding to {@link UnionLayoutDiscriminator#layout|layout}. */\n encode(src, b, offset) {\n return this.layout.encode(src, b, offset);\n }\n}\n\n/**\n * Represent any number of span-compatible layouts.\n *\n * *Factory*: {@link module:Layout.union|union}\n *\n * If the union has a {@link Union#defaultLayout|default layout} that\n * layout must have a non-negative {@link Layout#span|span}. The span\n * of a fixed-span union includes its {@link\n * Union#discriminator|discriminator} if the variant is a {@link\n * Union#usesPrefixDiscriminator|prefix of the union}, plus the span\n * of its {@link Union#defaultLayout|default layout}.\n *\n * If the union does not have a default layout then the encoded span\n * of the union depends on the encoded span of its variant (which may\n * be fixed or variable).\n *\n * {@link VariantLayout#layout|Variant layout}s are added through\n * {@link Union#addVariant|addVariant}. If the union has a default\n * layout, the span of the {@link VariantLayout#layout|layout\n * contained by the variant} must not exceed the span of the {@link\n * Union#defaultLayout|default layout} (minus the span of a {@link\n * Union#usesPrefixDiscriminator|prefix disriminator}, if used). The\n * span of the variant will equal the span of the union itself.\n *\n * The variant for a buffer can only be identified from the {@link\n * Union#discriminator|discriminator} {@link\n * UnionDiscriminator#property|property} (in the case of the {@link\n * Union#defaultLayout|default layout}), or by using {@link\n * Union#getVariant|getVariant} and examining the resulting {@link\n * VariantLayout} instance.\n *\n * A variant compatible with a JavaScript object can be identified\n * using {@link Union#getSourceVariant|getSourceVariant}.\n *\n * @param {(UnionDiscriminator|ExternalLayout|Layout)} discr - How to\n * identify the layout used to interpret the union contents. The\n * parameter must be an instance of {@link UnionDiscriminator}, an\n * {@link ExternalLayout} that satisfies {@link\n * ExternalLayout#isCount|isCount()}, or {@link UInt} (or {@link\n * UIntBE}). When a non-external layout element is passed the layout\n * appears at the start of the union. In all cases the (synthesized)\n * {@link UnionDiscriminator} instance is recorded as {@link\n * Union#discriminator|discriminator}.\n *\n * @param {(Layout|null)} defaultLayout - initializer for {@link\n * Union#defaultLayout|defaultLayout}. If absent defaults to `null`.\n * If `null` there is no default layout: the union has data-dependent\n * length and attempts to decode or encode unrecognized variants will\n * throw an exception. A {@link Layout} instance must have a\n * non-negative {@link Layout#span|span}, and if it lacks a {@link\n * Layout#property|property} the {@link\n * Union#defaultLayout|defaultLayout} will be a {@link\n * Layout#replicate|replica} with property `content`.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Union extends Layout {\n constructor(discr, defaultLayout, property) {\n const upv = ((discr instanceof UInt)\n || (discr instanceof UIntBE));\n if (upv) {\n discr = new UnionLayoutDiscriminator(new OffsetLayout(discr));\n } else if ((discr instanceof ExternalLayout)\n && discr.isCount()) {\n discr = new UnionLayoutDiscriminator(discr);\n } else if (!(discr instanceof UnionDiscriminator)) {\n throw new TypeError('discr must be a UnionDiscriminator '\n + 'or an unsigned integer layout');\n }\n if (undefined === defaultLayout) {\n defaultLayout = null;\n }\n if (!((null === defaultLayout)\n || (defaultLayout instanceof Layout))) {\n throw new TypeError('defaultLayout must be null or a Layout');\n }\n if (null !== defaultLayout) {\n if (0 > defaultLayout.span) {\n throw new Error('defaultLayout must have constant span');\n }\n if (undefined === defaultLayout.property) {\n defaultLayout = defaultLayout.replicate('content');\n }\n }\n\n /* The union span can be estimated only if there's a default\n * layout. The union spans its default layout, plus any prefix\n * variant layout. By construction both layouts, if present, have\n * non-negative span. */\n let span = -1;\n if (defaultLayout) {\n span = defaultLayout.span;\n if ((0 <= span) && upv) {\n span += discr.layout.span;\n }\n }\n super(span, property);\n\n /** The interface for the discriminator value in isolation.\n *\n * This a {@link UnionDiscriminator} either passed to the\n * constructor or synthesized from the `discr` constructor\n * argument. {@link\n * Union#usesPrefixDiscriminator|usesPrefixDiscriminator} will be\n * `true` iff the `discr` parameter was a non-offset {@link\n * Layout} instance. */\n this.discriminator = discr;\n\n /** `true` if the {@link Union#discriminator|discriminator} is the\n * first field in the union.\n *\n * If `false` the discriminator is obtained from somewhere\n * else. */\n this.usesPrefixDiscriminator = upv;\n\n /** The layout for non-discriminator content when the value of the\n * discriminator is not recognized.\n *\n * This is the value passed to the constructor. It is\n * structurally equivalent to the second component of {@link\n * Union#layout|layout} but may have a different property\n * name. */\n this.defaultLayout = defaultLayout;\n\n /** A registry of allowed variants.\n *\n * The keys are unsigned integers which should be compatible with\n * {@link Union.discriminator|discriminator}. The property value\n * is the corresponding {@link VariantLayout} instances assigned\n * to this union by {@link Union#addVariant|addVariant}.\n *\n * **NOTE** The registry remains mutable so that variants can be\n * {@link Union#addVariant|added} at any time. Users should not\n * manipulate the content of this property. */\n this.registry = {};\n\n /* Private variable used when invoking getSourceVariant */\n let boundGetSourceVariant = this.defaultGetSourceVariant.bind(this);\n\n /** Function to infer the variant selected by a source object.\n *\n * Defaults to {@link\n * Union#defaultGetSourceVariant|defaultGetSourceVariant} but may\n * be overridden using {@link\n * Union#configGetSourceVariant|configGetSourceVariant}.\n *\n * @param {Object} src - as with {@link\n * Union#defaultGetSourceVariant|defaultGetSourceVariant}.\n *\n * @returns {(undefined|VariantLayout)} The default variant\n * (`undefined`) or first registered variant that uses a property\n * available in `src`. */\n this.getSourceVariant = function(src) {\n return boundGetSourceVariant(src);\n };\n\n /** Function to override the implementation of {@link\n * Union#getSourceVariant|getSourceVariant}.\n *\n * Use this if the desired variant cannot be identified using the\n * algorithm of {@link\n * Union#defaultGetSourceVariant|defaultGetSourceVariant}.\n *\n * **NOTE** The provided function will be invoked bound to this\n * Union instance, providing local access to {@link\n * Union#registry|registry}.\n *\n * @param {Function} gsv - a function that follows the API of\n * {@link Union#defaultGetSourceVariant|defaultGetSourceVariant}. */\n this.configGetSourceVariant = function(gsv) {\n boundGetSourceVariant = gsv.bind(this);\n };\n }\n\n /** @override */\n getSpan(b, offset) {\n if (0 <= this.span) {\n return this.span;\n }\n if (undefined === offset) {\n offset = 0;\n }\n /* Default layouts always have non-negative span, so we don't have\n * one and we have to recognize the variant which will in turn\n * determine the span. */\n const vlo = this.getVariant(b, offset);\n if (!vlo) {\n throw new Error('unable to determine span for unrecognized variant');\n }\n return vlo.getSpan(b, offset);\n }\n\n /**\n * Method to infer a registered Union variant compatible with `src`.\n *\n * The first satisified rule in the following sequence defines the\n * return value:\n * * If `src` has properties matching the Union discriminator and\n * the default layout, `undefined` is returned regardless of the\n * value of the discriminator property (this ensures the default\n * layout will be used);\n * * If `src` has a property matching the Union discriminator, the\n * value of the discriminator identifies a registered variant, and\n * either (a) the variant has no layout, or (b) `src` has the\n * variant's property, then the variant is returned (because the\n * source satisfies the constraints of the variant it identifies);\n * * If `src` does not have a property matching the Union\n * discriminator, but does have a property matching a registered\n * variant, then the variant is returned (because the source\n * matches a variant without an explicit conflict);\n * * An error is thrown (because we either can't identify a variant,\n * or we were explicitly told the variant but can't satisfy it).\n *\n * @param {Object} src - an object presumed to be compatible with\n * the content of the Union.\n *\n * @return {(undefined|VariantLayout)} - as described above.\n *\n * @throws {Error} - if `src` cannot be associated with a default or\n * registered variant.\n */\n defaultGetSourceVariant(src) {\n if (src.hasOwnProperty(this.discriminator.property)) {\n if (this.defaultLayout\n && src.hasOwnProperty(this.defaultLayout.property)) {\n return undefined;\n }\n const vlo = this.registry[src[this.discriminator.property]];\n if (vlo\n && ((!vlo.layout)\n || src.hasOwnProperty(vlo.property))) {\n return vlo;\n }\n } else {\n for (const tag in this.registry) {\n const vlo = this.registry[tag];\n if (src.hasOwnProperty(vlo.property)) {\n return vlo;\n }\n }\n }\n throw new Error('unable to infer src variant');\n }\n\n /** Implement {@link Layout#decode|decode} for {@link Union}.\n *\n * If the variant is {@link Union#addVariant|registered} the return\n * value is an instance of that variant, with no explicit\n * discriminator. Otherwise the {@link Union#defaultLayout|default\n * layout} is used to decode the content. */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n let dest;\n const dlo = this.discriminator;\n const discr = dlo.decode(b, offset);\n let clo = this.registry[discr];\n if (undefined === clo) {\n let contentOffset = 0;\n clo = this.defaultLayout;\n if (this.usesPrefixDiscriminator) {\n contentOffset = dlo.layout.span;\n }\n dest = this.makeDestinationObject();\n dest[dlo.property] = discr;\n dest[clo.property] = this.defaultLayout.decode(b, offset + contentOffset);\n } else {\n dest = clo.decode(b, offset);\n }\n return dest;\n }\n\n /** Implement {@link Layout#encode|encode} for {@link Union}.\n *\n * This API assumes the `src` object is consistent with the union's\n * {@link Union#defaultLayout|default layout}. To encode variants\n * use the appropriate variant-specific {@link VariantLayout#encode}\n * method. */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const vlo = this.getSourceVariant(src);\n if (undefined === vlo) {\n const dlo = this.discriminator;\n const clo = this.defaultLayout;\n let contentOffset = 0;\n if (this.usesPrefixDiscriminator) {\n contentOffset = dlo.layout.span;\n }\n dlo.encode(src[dlo.property], b, offset);\n return contentOffset + clo.encode(src[clo.property], b,\n offset + contentOffset);\n }\n return vlo.encode(src, b, offset);\n }\n\n /** Register a new variant structure within a union. The newly\n * created variant is returned.\n *\n * @param {Number} variant - initializer for {@link\n * VariantLayout#variant|variant}.\n *\n * @param {Layout} layout - initializer for {@link\n * VariantLayout#layout|layout}.\n *\n * @param {String} property - initializer for {@link\n * Layout#property|property}.\n *\n * @return {VariantLayout} */\n addVariant(variant, layout, property) {\n const rv = new VariantLayout(this, variant, layout, property);\n this.registry[variant] = rv;\n return rv;\n }\n\n /**\n * Get the layout associated with a registered variant.\n *\n * If `vb` does not produce a registered variant the function returns\n * `undefined`.\n *\n * @param {(Number|Buffer)} vb - either the variant number, or a\n * buffer from which the discriminator is to be read.\n *\n * @param {Number} offset - offset into `vb` for the start of the\n * union. Used only when `vb` is an instance of {Buffer}.\n *\n * @return {({VariantLayout}|undefined)}\n */\n getVariant(vb, offset) {\n let variant = vb;\n if (vb instanceof Buffer) {\n if (undefined === offset) {\n offset = 0;\n }\n variant = this.discriminator.decode(vb, offset);\n }\n return this.registry[variant];\n }\n}\n\n/**\n * Represent a specific variant within a containing union.\n *\n * **NOTE** The {@link Layout#span|span} of the variant may include\n * the span of the {@link Union#discriminator|discriminator} used to\n * identify it, but values read and written using the variant strictly\n * conform to the content of {@link VariantLayout#layout|layout}.\n *\n * **NOTE** User code should not invoke this constructor directly. Use\n * the union {@link Union#addVariant|addVariant} helper method.\n *\n * @param {Union} union - initializer for {@link\n * VariantLayout#union|union}.\n *\n * @param {Number} variant - initializer for {@link\n * VariantLayout#variant|variant}.\n *\n * @param {Layout} [layout] - initializer for {@link\n * VariantLayout#layout|layout}. If absent the variant carries no\n * data.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}. Unlike many other layouts, variant\n * layouts normally include a property name so they can be identified\n * within their containing {@link Union}. The property identifier may\n * be absent only if `layout` is is absent.\n *\n * @augments {Layout}\n */\nclass VariantLayout extends Layout {\n constructor(union, variant, layout, property) {\n if (!(union instanceof Union)) {\n throw new TypeError('union must be a Union');\n }\n if ((!Number.isInteger(variant)) || (0 > variant)) {\n throw new TypeError('variant must be a (non-negative) integer');\n }\n if (('string' === typeof layout)\n && (undefined === property)) {\n property = layout;\n layout = null;\n }\n if (layout) {\n if (!(layout instanceof Layout)) {\n throw new TypeError('layout must be a Layout');\n }\n if ((null !== union.defaultLayout)\n && (0 <= layout.span)\n && (layout.span > union.defaultLayout.span)) {\n throw new Error('variant span exceeds span of containing union');\n }\n if ('string' !== typeof property) {\n throw new TypeError('variant must have a String property');\n }\n }\n let span = union.span;\n if (0 > union.span) {\n span = layout ? layout.span : 0;\n if ((0 <= span) && union.usesPrefixDiscriminator) {\n span += union.discriminator.layout.span;\n }\n }\n super(span, property);\n\n /** The {@link Union} to which this variant belongs. */\n this.union = union;\n\n /** The unsigned integral value identifying this variant within\n * the {@link Union#discriminator|discriminator} of the containing\n * union. */\n this.variant = variant;\n\n /** The {@link Layout} to be used when reading/writing the\n * non-discriminator part of the {@link\n * VariantLayout#union|union}. If `null` the variant carries no\n * data. */\n this.layout = layout || null;\n }\n\n /** @override */\n getSpan(b, offset) {\n if (0 <= this.span) {\n /* Will be equal to the containing union span if that is not\n * variable. */\n return this.span;\n }\n if (undefined === offset) {\n offset = 0;\n }\n let contentOffset = 0;\n if (this.union.usesPrefixDiscriminator) {\n contentOffset = this.union.discriminator.layout.span;\n }\n /* Span is defined solely by the variant (and prefix discriminator) */\n return contentOffset + this.layout.getSpan(b, offset + contentOffset);\n }\n\n /** @override */\n decode(b, offset) {\n const dest = this.makeDestinationObject();\n if (undefined === offset) {\n offset = 0;\n }\n if (this !== this.union.getVariant(b, offset)) {\n throw new Error('variant mismatch');\n }\n let contentOffset = 0;\n if (this.union.usesPrefixDiscriminator) {\n contentOffset = this.union.discriminator.layout.span;\n }\n if (this.layout) {\n dest[this.property] = this.layout.decode(b, offset + contentOffset);\n } else if (this.property) {\n dest[this.property] = true;\n } else if (this.union.usesPrefixDiscriminator) {\n dest[this.union.discriminator.property] = this.variant;\n }\n return dest;\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n let contentOffset = 0;\n if (this.union.usesPrefixDiscriminator) {\n contentOffset = this.union.discriminator.layout.span;\n }\n if (this.layout\n && (!src.hasOwnProperty(this.property))) {\n throw new TypeError('variant lacks property ' + this.property);\n }\n this.union.discriminator.encode(this.variant, b, offset);\n let span = contentOffset;\n if (this.layout) {\n this.layout.encode(src[this.property], b, offset + contentOffset);\n span += this.layout.getSpan(b, offset + contentOffset);\n if ((0 <= this.union.span)\n && (span > this.union.span)) {\n throw new Error('encoded variant overruns containing union');\n }\n }\n return span;\n }\n\n /** Delegate {@link Layout#fromArray|fromArray} to {@link\n * VariantLayout#layout|layout}. */\n fromArray(values) {\n if (this.layout) {\n return this.layout.fromArray(values);\n }\n }\n}\n\n/** JavaScript chose to define bitwise operations as operating on\n * signed 32-bit values in 2's complement form, meaning any integer\n * with bit 31 set is going to look negative. For right shifts that's\n * not a problem, because `>>>` is a logical shift, but for every\n * other bitwise operator we have to compensate for possible negative\n * results. */\nfunction fixBitwiseResult(v) {\n if (0 > v) {\n v += 0x100000000;\n }\n return v;\n}\n\n/**\n * Contain a sequence of bit fields as an unsigned integer.\n *\n * *Factory*: {@link module:Layout.bits|bits}\n *\n * This is a container element; within it there are {@link BitField}\n * instances that provide the extracted properties. The container\n * simply defines the aggregate representation and its bit ordering.\n * The representation is an object containing properties with numeric\n * or {@link Boolean} values.\n *\n * {@link BitField}s are added with the {@link\n * BitStructure#addField|addField} and {@link\n * BitStructure#addBoolean|addBoolean} methods.\n\n * @param {Layout} word - initializer for {@link\n * BitStructure#word|word}. The parameter must be an instance of\n * {@link UInt} (or {@link UIntBE}) that is no more than 4 bytes wide.\n *\n * @param {bool} [msb] - `true` if the bit numbering starts at the\n * most significant bit of the containing word; `false` (default) if\n * it starts at the least significant bit of the containing word. If\n * the parameter at this position is a string and `property` is\n * `undefined` the value of this argument will instead be used as the\n * value of `property`.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass BitStructure extends Layout {\n constructor(word, msb, property) {\n if (!((word instanceof UInt)\n || (word instanceof UIntBE))) {\n throw new TypeError('word must be a UInt or UIntBE layout');\n }\n if (('string' === typeof msb)\n && (undefined === property)) {\n property = msb;\n msb = undefined;\n }\n if (4 < word.span) {\n throw new RangeError('word cannot exceed 32 bits');\n }\n super(word.span, property);\n\n /** The layout used for the packed value. {@link BitField}\n * instances are packed sequentially depending on {@link\n * BitStructure#msb|msb}. */\n this.word = word;\n\n /** Whether the bit sequences are packed starting at the most\n * significant bit growing down (`true`), or the least significant\n * bit growing up (`false`).\n *\n * **NOTE** Regardless of this value, the least significant bit of\n * any {@link BitField} value is the least significant bit of the\n * corresponding section of the packed value. */\n this.msb = !!msb;\n\n /** The sequence of {@link BitField} layouts that comprise the\n * packed structure.\n *\n * **NOTE** The array remains mutable to allow fields to be {@link\n * BitStructure#addField|added} after construction. Users should\n * not manipulate the content of this property.*/\n this.fields = [];\n\n /* Storage for the value. Capture a variable instead of using an\n * instance property because we don't want anything to change the\n * value without going through the mutator. */\n let value = 0;\n this._packedSetValue = function(v) {\n value = fixBitwiseResult(v);\n return this;\n };\n this._packedGetValue = function() {\n return value;\n };\n }\n\n /** @override */\n decode(b, offset) {\n const dest = this.makeDestinationObject();\n if (undefined === offset) {\n offset = 0;\n }\n const value = this.word.decode(b, offset);\n this._packedSetValue(value);\n for (const fd of this.fields) {\n if (undefined !== fd.property) {\n dest[fd.property] = fd.decode(value);\n }\n }\n return dest;\n }\n\n /** Implement {@link Layout#encode|encode} for {@link BitStructure}.\n *\n * If `src` is missing a property for a member with a defined {@link\n * Layout#property|property} the corresponding region of the packed\n * value is left unmodified. Unused bits are also left unmodified. */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const value = this.word.decode(b, offset);\n this._packedSetValue(value);\n for (const fd of this.fields) {\n if (undefined !== fd.property) {\n const fv = src[fd.property];\n if (undefined !== fv) {\n fd.encode(fv);\n }\n }\n }\n return this.word.encode(this._packedGetValue(), b, offset);\n }\n\n /** Register a new bitfield with a containing bit structure. The\n * resulting bitfield is returned.\n *\n * @param {Number} bits - initializer for {@link BitField#bits|bits}.\n *\n * @param {string} property - initializer for {@link\n * Layout#property|property}.\n *\n * @return {BitField} */\n addField(bits, property) {\n const bf = new BitField(this, bits, property);\n this.fields.push(bf);\n return bf;\n }\n\n /** As with {@link BitStructure#addField|addField} for single-bit\n * fields with `boolean` value representation.\n *\n * @param {string} property - initializer for {@link\n * Layout#property|property}.\n *\n * @return {Boolean} */\n addBoolean(property) {\n // This is my Boolean, not the Javascript one.\n // eslint-disable-next-line no-new-wrappers\n const bf = new Boolean(this, property);\n this.fields.push(bf);\n return bf;\n }\n\n /**\n * Get access to the bit field for a given property.\n *\n * @param {String} property - the bit field of interest.\n *\n * @return {BitField} - the field associated with `property`, or\n * undefined if there is no such property.\n */\n fieldFor(property) {\n if ('string' !== typeof property) {\n throw new TypeError('property must be string');\n }\n for (const fd of this.fields) {\n if (fd.property === property) {\n return fd;\n }\n }\n }\n}\n\n/**\n * Represent a sequence of bits within a {@link BitStructure}.\n *\n * All bit field values are represented as unsigned integers.\n *\n * **NOTE** User code should not invoke this constructor directly.\n * Use the container {@link BitStructure#addField|addField} helper\n * method.\n *\n * **NOTE** BitField instances are not instances of {@link Layout}\n * since {@link Layout#span|span} measures 8-bit units.\n *\n * @param {BitStructure} container - initializer for {@link\n * BitField#container|container}.\n *\n * @param {Number} bits - initializer for {@link BitField#bits|bits}.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n */\nclass BitField {\n constructor(container, bits, property) {\n if (!(container instanceof BitStructure)) {\n throw new TypeError('container must be a BitStructure');\n }\n if ((!Number.isInteger(bits)) || (0 >= bits)) {\n throw new TypeError('bits must be positive integer');\n }\n const totalBits = 8 * container.span;\n const usedBits = container.fields.reduce((sum, fd) => sum + fd.bits, 0);\n if ((bits + usedBits) > totalBits) {\n throw new Error('bits too long for span remainder ('\n + (totalBits - usedBits) + ' of '\n + totalBits + ' remain)');\n }\n\n /** The {@link BitStructure} instance to which this bit field\n * belongs. */\n this.container = container;\n\n /** The span of this value in bits. */\n this.bits = bits;\n\n /** A mask of {@link BitField#bits|bits} bits isolating value bits\n * that fit within the field.\n *\n * That is, it masks a value that has not yet been shifted into\n * position within its containing packed integer. */\n this.valueMask = (1 << bits) - 1;\n if (32 === bits) { // shifted value out of range\n this.valueMask = 0xFFFFFFFF;\n }\n\n /** The offset of the value within the containing packed unsigned\n * integer. The least significant bit of the packed value is at\n * offset zero, regardless of bit ordering used. */\n this.start = usedBits;\n if (this.container.msb) {\n this.start = totalBits - usedBits - bits;\n }\n\n /** A mask of {@link BitField#bits|bits} isolating the field value\n * within the containing packed unsigned integer. */\n this.wordMask = fixBitwiseResult(this.valueMask << this.start);\n\n /** The property name used when this bitfield is represented in an\n * Object.\n *\n * Intended to be functionally equivalent to {@link\n * Layout#property}.\n *\n * If left undefined the corresponding span of bits will be\n * treated as padding: it will not be mutated by {@link\n * Layout#encode|encode} nor represented as a property in the\n * decoded Object. */\n this.property = property;\n }\n\n /** Store a value into the corresponding subsequence of the containing\n * bit field. */\n decode() {\n const word = this.container._packedGetValue();\n const wordValue = fixBitwiseResult(word & this.wordMask);\n const value = wordValue >>> this.start;\n return value;\n }\n\n /** Store a value into the corresponding subsequence of the containing\n * bit field.\n *\n * **NOTE** This is not a specialization of {@link\n * Layout#encode|Layout.encode} and there is no return value. */\n encode(value) {\n if ((!Number.isInteger(value))\n || (value !== fixBitwiseResult(value & this.valueMask))) {\n throw new TypeError(nameWithProperty('BitField.encode', this)\n + ' value must be integer not exceeding ' + this.valueMask);\n }\n const word = this.container._packedGetValue();\n const wordValue = fixBitwiseResult(value << this.start);\n this.container._packedSetValue(fixBitwiseResult(word & ~this.wordMask)\n | wordValue);\n };\n}\n\n/**\n * Represent a single bit within a {@link BitStructure} as a\n * JavaScript boolean.\n *\n * **NOTE** User code should not invoke this constructor directly.\n * Use the container {@link BitStructure#addBoolean|addBoolean} helper\n * method.\n *\n * @param {BitStructure} container - initializer for {@link\n * BitField#container|container}.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {BitField}\n */\n/* eslint-disable no-extend-native */\nclass Boolean extends BitField {\n constructor(container, property) {\n super(container, 1, property);\n }\n\n /** Override {@link BitField#decode|decode} for {@link Boolean|Boolean}.\n *\n * @returns {boolean} */\n decode(b, offset) {\n return !!BitField.prototype.decode.call(this, b, offset);\n }\n\n /** @override */\n encode(value) {\n if ('boolean' === typeof value) {\n // BitField requires integer values\n value = +value;\n }\n return BitField.prototype.encode.call(this, value);\n }\n}\n/* eslint-enable no-extend-native */\n\n/**\n * Contain a fixed-length block of arbitrary data, represented as a\n * Buffer.\n *\n * *Factory*: {@link module:Layout.blob|blob}\n *\n * @param {(Number|ExternalLayout)} length - initializes {@link\n * Blob#length|length}.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Blob extends Layout {\n constructor(length, property) {\n if (!(((length instanceof ExternalLayout) && length.isCount())\n || (Number.isInteger(length) && (0 <= length)))) {\n throw new TypeError('length must be positive integer '\n + 'or an unsigned integer ExternalLayout');\n }\n\n let span = -1;\n if (!(length instanceof ExternalLayout)) {\n span = length;\n }\n super(span, property);\n\n /** The number of bytes in the blob.\n *\n * This may be a non-negative integer, or an instance of {@link\n * ExternalLayout} that satisfies {@link\n * ExternalLayout#isCount|isCount()}. */\n this.length = length;\n }\n\n /** @override */\n getSpan(b, offset) {\n let span = this.span;\n if (0 > span) {\n span = this.length.decode(b, offset);\n }\n return span;\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n let span = this.span;\n if (0 > span) {\n span = this.length.decode(b, offset);\n }\n return b.slice(offset, offset + span);\n }\n\n /** Implement {@link Layout#encode|encode} for {@link Blob}.\n *\n * **NOTE** If {@link Layout#count|count} is an instance of {@link\n * ExternalLayout} then the length of `src` will be encoded as the\n * count after `src` is encoded. */\n encode(src, b, offset) {\n let span = this.length;\n if (this.length instanceof ExternalLayout) {\n span = src.length;\n }\n if (!((src instanceof Buffer)\n && (span === src.length))) {\n throw new TypeError(nameWithProperty('Blob.encode', this)\n + ' requires (length ' + span + ') Buffer as src');\n }\n if ((offset + span) > b.length) {\n throw new RangeError('encoding overruns Buffer');\n }\n b.write(src.toString('hex'), offset, span, 'hex');\n if (this.length instanceof ExternalLayout) {\n this.length.encode(span, b, offset);\n }\n return span;\n }\n}\n\n/**\n * Contain a `NUL`-terminated UTF8 string.\n *\n * *Factory*: {@link module:Layout.cstr|cstr}\n *\n * **NOTE** Any UTF8 string that incorporates a zero-valued byte will\n * not be correctly decoded by this layout.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass CString extends Layout {\n constructor(property) {\n super(-1, property);\n }\n\n /** @override */\n getSpan(b, offset) {\n if (!(b instanceof Buffer)) {\n throw new TypeError('b must be a Buffer');\n }\n if (undefined === offset) {\n offset = 0;\n }\n let idx = offset;\n while ((idx < b.length) && (0 !== b[idx])) {\n idx += 1;\n }\n return 1 + idx - offset;\n }\n\n /** @override */\n decode(b, offset, dest) {\n if (undefined === offset) {\n offset = 0;\n }\n let span = this.getSpan(b, offset);\n return b.slice(offset, offset + span - 1).toString('utf-8');\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n /* Must force this to a string, lest it be a number and the\n * \"utf8-encoding\" below actually allocate a buffer of length\n * src */\n if ('string' !== typeof src) {\n src = src.toString();\n }\n const srcb = new Buffer(src, 'utf8');\n const span = srcb.length;\n if ((offset + span) > b.length) {\n throw new RangeError('encoding overruns Buffer');\n }\n srcb.copy(b, offset);\n b[offset + span] = 0;\n return span + 1;\n }\n}\n\n/**\n * Contain a UTF8 string with implicit length.\n *\n * *Factory*: {@link module:Layout.utf8|utf8}\n *\n * **NOTE** Because the length is implicit in the size of the buffer\n * this layout should be used only in isolation, or in a situation\n * where the length can be expressed by operating on a slice of the\n * containing buffer.\n *\n * @param {Number} [maxSpan] - the maximum length allowed for encoded\n * string content. If not provided there is no bound on the allowed\n * content.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass UTF8 extends Layout {\n constructor(maxSpan, property) {\n if (('string' === typeof maxSpan)\n && (undefined === property)) {\n property = maxSpan;\n maxSpan = undefined;\n }\n if (undefined === maxSpan) {\n maxSpan = -1;\n } else if (!Number.isInteger(maxSpan)) {\n throw new TypeError('maxSpan must be an integer');\n }\n\n super(-1, property);\n\n /** The maximum span of the layout in bytes.\n *\n * Positive values are generally expected. Zero is abnormal.\n * Attempts to encode or decode a value that exceeds this length\n * will throw a `RangeError`.\n *\n * A negative value indicates that there is no bound on the length\n * of the content. */\n this.maxSpan = maxSpan;\n }\n\n /** @override */\n getSpan(b, offset) {\n if (!(b instanceof Buffer)) {\n throw new TypeError('b must be a Buffer');\n }\n if (undefined === offset) {\n offset = 0;\n }\n return b.length - offset;\n }\n\n /** @override */\n decode(b, offset, dest) {\n if (undefined === offset) {\n offset = 0;\n }\n let span = this.getSpan(b, offset);\n if ((0 <= this.maxSpan)\n && (this.maxSpan < span)) {\n throw new RangeError('text length exceeds maxSpan');\n }\n return b.slice(offset, offset + span).toString('utf-8');\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n /* Must force this to a string, lest it be a number and the\n * \"utf8-encoding\" below actually allocate a buffer of length\n * src */\n if ('string' !== typeof src) {\n src = src.toString();\n }\n const srcb = new Buffer(src, 'utf8');\n const span = srcb.length;\n if ((0 <= this.maxSpan)\n && (this.maxSpan < span)) {\n throw new RangeError('text length exceeds maxSpan');\n }\n if ((offset + span) > b.length) {\n throw new RangeError('encoding overruns Buffer');\n }\n srcb.copy(b, offset);\n return span;\n }\n}\n\n/**\n * Contain a constant value.\n *\n * This layout may be used in cases where a JavaScript value can be\n * inferred without an expression in the binary encoding. An example\n * would be a {@link VariantLayout|variant layout} where the content\n * is implied by the union {@link Union#discriminator|discriminator}.\n *\n * @param {Object|Number|String} value - initializer for {@link\n * Constant#value|value}. If the value is an object (or array) and\n * the application intends the object to remain unchanged regardless\n * of what is done to values decoded by this layout, the value should\n * be frozen prior passing it to this constructor.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Constant extends Layout {\n constructor(value, property) {\n super(0, property);\n\n /** The value produced by this constant when the layout is {@link\n * Constant#decode|decoded}.\n *\n * Any JavaScript value including `null` and `undefined` is\n * permitted.\n *\n * **WARNING** If `value` passed in the constructor was not\n * frozen, it is possible for users of decoded values to change\n * the content of the value. */\n this.value = value;\n }\n\n /** @override */\n decode(b, offset, dest) {\n return this.value;\n }\n\n /** @override */\n encode(src, b, offset) {\n /* Constants take no space */\n return 0;\n }\n}\n\nexports.ExternalLayout = ExternalLayout;\nexports.GreedyCount = GreedyCount;\nexports.OffsetLayout = OffsetLayout;\nexports.UInt = UInt;\nexports.UIntBE = UIntBE;\nexports.Int = Int;\nexports.IntBE = IntBE;\nexports.Float = Float;\nexports.FloatBE = FloatBE;\nexports.Double = Double;\nexports.DoubleBE = DoubleBE;\nexports.Sequence = Sequence;\nexports.Structure = Structure;\nexports.UnionDiscriminator = UnionDiscriminator;\nexports.UnionLayoutDiscriminator = UnionLayoutDiscriminator;\nexports.Union = Union;\nexports.VariantLayout = VariantLayout;\nexports.BitStructure = BitStructure;\nexports.BitField = BitField;\nexports.Boolean = Boolean;\nexports.Blob = Blob;\nexports.CString = CString;\nexports.UTF8 = UTF8;\nexports.Constant = Constant;\n\n/** Factory for {@link GreedyCount}. */\nexports.greedy = ((elementSpan, property) => new GreedyCount(elementSpan, property));\n\n/** Factory for {@link OffsetLayout}. */\nexports.offset = ((layout, offset, property) => new OffsetLayout(layout, offset, property));\n\n/** Factory for {@link UInt|unsigned int layouts} spanning one\n * byte. */\nexports.u8 = (property => new UInt(1, property));\n\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning two bytes. */\nexports.u16 = (property => new UInt(2, property));\n\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning three bytes. */\nexports.u24 = (property => new UInt(3, property));\n\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning four bytes. */\nexports.u32 = (property => new UInt(4, property));\n\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning five bytes. */\nexports.u40 = (property => new UInt(5, property));\n\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning six bytes. */\nexports.u48 = (property => new UInt(6, property));\n\n/** Factory for {@link NearUInt64|little-endian unsigned int\n * layouts} interpreted as Numbers. */\nexports.nu64 = (property => new NearUInt64(property));\n\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning two bytes. */\nexports.u16be = (property => new UIntBE(2, property));\n\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning three bytes. */\nexports.u24be = (property => new UIntBE(3, property));\n\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning four bytes. */\nexports.u32be = (property => new UIntBE(4, property));\n\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning five bytes. */\nexports.u40be = (property => new UIntBE(5, property));\n\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning six bytes. */\nexports.u48be = (property => new UIntBE(6, property));\n\n/** Factory for {@link NearUInt64BE|big-endian unsigned int\n * layouts} interpreted as Numbers. */\nexports.nu64be = (property => new NearUInt64BE(property));\n\n/** Factory for {@link Int|signed int layouts} spanning one\n * byte. */\nexports.s8 = (property => new Int(1, property));\n\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning two bytes. */\nexports.s16 = (property => new Int(2, property));\n\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning three bytes. */\nexports.s24 = (property => new Int(3, property));\n\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning four bytes. */\nexports.s32 = (property => new Int(4, property));\n\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning five bytes. */\nexports.s40 = (property => new Int(5, property));\n\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning six bytes. */\nexports.s48 = (property => new Int(6, property));\n\n/** Factory for {@link NearInt64|little-endian signed int layouts}\n * interpreted as Numbers. */\nexports.ns64 = (property => new NearInt64(property));\n\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning two bytes. */\nexports.s16be = (property => new IntBE(2, property));\n\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning three bytes. */\nexports.s24be = (property => new IntBE(3, property));\n\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning four bytes. */\nexports.s32be = (property => new IntBE(4, property));\n\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning five bytes. */\nexports.s40be = (property => new IntBE(5, property));\n\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning six bytes. */\nexports.s48be = (property => new IntBE(6, property));\n\n/** Factory for {@link NearInt64BE|big-endian signed int layouts}\n * interpreted as Numbers. */\nexports.ns64be = (property => new NearInt64BE(property));\n\n/** Factory for {@link Float|little-endian 32-bit floating point} values. */\nexports.f32 = (property => new Float(property));\n\n/** Factory for {@link FloatBE|big-endian 32-bit floating point} values. */\nexports.f32be = (property => new FloatBE(property));\n\n/** Factory for {@link Double|little-endian 64-bit floating point} values. */\nexports.f64 = (property => new Double(property));\n\n/** Factory for {@link DoubleBE|big-endian 64-bit floating point} values. */\nexports.f64be = (property => new DoubleBE(property));\n\n/** Factory for {@link Structure} values. */\nexports.struct = ((fields, property, decodePrefixes) => new Structure(fields, property, decodePrefixes));\n\n/** Factory for {@link BitStructure} values. */\nexports.bits = ((word, msb, property) => new BitStructure(word, msb, property));\n\n/** Factory for {@link Sequence} values. */\nexports.seq = ((elementLayout, count, property) => new Sequence(elementLayout, count, property));\n\n/** Factory for {@link Union} values. */\nexports.union = ((discr, defaultLayout, property) => new Union(discr, defaultLayout, property));\n\n/** Factory for {@link UnionLayoutDiscriminator} values. */\nexports.unionLayoutDiscriminator = ((layout, property) => new UnionLayoutDiscriminator(layout, property));\n\n/** Factory for {@link Blob} values. */\nexports.blob = ((length, property) => new Blob(length, property));\n\n/** Factory for {@link CString} values. */\nexports.cstr = (property => new CString(property));\n\n/** Factory for {@link UTF8} values. */\nexports.utf8 = ((maxSpan, property) => new UTF8(maxSpan, property));\n\n/** Factory for {@link Constant} values. */\nexports.const = ((value, property) => new Constant(value, property));\n","import {Buffer} from 'buffer';\nimport * as BufferLayout from 'buffer-layout';\n\n/**\n * Layout for a public key\n */\nexport const publicKey = (property: string = 'publicKey'): Object => {\n return BufferLayout.blob(32, property);\n};\n\n/**\n * Layout for a 64bit unsigned value\n */\nexport const uint64 = (property: string = 'uint64'): Object => {\n return BufferLayout.blob(8, property);\n};\n\n/**\n * Layout for a Rust String type\n */\nexport const rustString = (property: string = 'string') => {\n const rsl = BufferLayout.struct(\n [\n BufferLayout.u32('length'),\n BufferLayout.u32('lengthPadding'),\n BufferLayout.blob(BufferLayout.offset(BufferLayout.u32(), -8), 'chars'),\n ],\n property,\n );\n const _decode = rsl.decode.bind(rsl);\n const _encode = rsl.encode.bind(rsl);\n\n rsl.decode = (buffer: any, offset: any) => {\n const data = _decode(buffer, offset);\n return data.chars.toString('utf8');\n };\n\n rsl.encode = (str: any, buffer: any, offset: any) => {\n const data = {\n chars: Buffer.from(str, 'utf8'),\n };\n return _encode(data, buffer, offset);\n };\n\n rsl.alloc = (str: any) => {\n return (\n BufferLayout.u32().span +\n BufferLayout.u32().span +\n Buffer.from(str, 'utf8').length\n );\n };\n\n return rsl;\n};\n\n/**\n * Layout for an Authorized object\n */\nexport const authorized = (property: string = 'authorized') => {\n return BufferLayout.struct(\n [publicKey('staker'), publicKey('withdrawer')],\n property,\n );\n};\n\n/**\n * Layout for a Lockup object\n */\nexport const lockup = (property: string = 'lockup') => {\n return BufferLayout.struct(\n [\n BufferLayout.ns64('unixTimestamp'),\n BufferLayout.ns64('epoch'),\n publicKey('custodian'),\n ],\n property,\n );\n};\n\nexport function getAlloc(type: any, fields: any): number {\n let alloc = 0;\n type.layout.fields.forEach((item: any) => {\n if (item.span >= 0) {\n alloc += item.span;\n } else if (typeof item.alloc === 'function') {\n alloc += item.alloc(fields[item.property]);\n }\n });\n return alloc;\n}\n","export function decodeLength(bytes: Array<number>): number {\n let len = 0;\n let size = 0;\n for (;;) {\n let elem = bytes.shift() as number;\n len |= (elem & 0x7f) << (size * 7);\n size += 1;\n if ((elem & 0x80) === 0) {\n break;\n }\n }\n return len;\n}\n\nexport function encodeLength(bytes: Array<number>, len: number) {\n let rem_len = len;\n for (;;) {\n let elem = rem_len & 0x7f;\n rem_len >>= 7;\n if (rem_len == 0) {\n bytes.push(elem);\n break;\n } else {\n elem |= 0x80;\n bytes.push(elem);\n }\n }\n}\n","import bs58 from 'bs58';\nimport {Buffer} from 'buffer';\nimport * as BufferLayout from 'buffer-layout';\n\nimport {PublicKey} from './publickey';\nimport type {Blockhash} from './blockhash';\nimport * as Layout from './layout';\nimport {PACKET_DATA_SIZE} from './transaction';\nimport * as shortvec from './util/shortvec-encoding';\n\n/**\n * The message header, identifying signed and read-only account\n *\n * @typedef {Object} MessageHeader\n * @property {number} numRequiredSignatures The number of signatures required for this message to be considered valid. The\n * signatures must match the first `numRequiredSignatures` of `accountKeys`.\n * @property {number} numReadonlySignedAccounts: The last `numReadonlySignedAccounts` of the signed keys are read-only accounts\n * @property {number} numReadonlyUnsignedAccounts The last `numReadonlySignedAccounts` of the unsigned keys are read-only accounts\n */\nexport type MessageHeader = {\n numRequiredSignatures: number;\n numReadonlySignedAccounts: number;\n numReadonlyUnsignedAccounts: number;\n};\n\n/**\n * An instruction to execute by a program\n *\n * @typedef {Object} CompiledInstruction\n * @property {number} programIdIndex Index into the transaction keys array indicating the program account that executes this instruction\n * @property {number[]} accounts Ordered indices into the transaction keys array indicating which accounts to pass to the program\n * @property {string} data The program input data encoded as base 58\n */\nexport type CompiledInstruction = {\n programIdIndex: number;\n accounts: number[];\n data: string;\n};\n\n/**\n * Message constructor arguments\n *\n * @typedef {Object} MessageArgs\n * @property {MessageHeader} header The message header, identifying signed and read-only `accountKeys`\n * @property {string[]} accounts All the account keys used by this transaction\n * @property {Blockhash} recentBlockhash The hash of a recent ledger block\n * @property {CompiledInstruction[]} instructions Instructions that will be executed in sequence and committed in one atomic transaction if all succeed.\n */\nexport type MessageArgs = {\n header: MessageHeader;\n accountKeys: string[];\n recentBlockhash: Blockhash;\n instructions: CompiledInstruction[];\n};\n\nconst PUBKEY_LENGTH = 32;\n\n/**\n * List of instructions to be processed atomically\n */\nexport class Message {\n header: MessageHeader;\n accountKeys: PublicKey[];\n recentBlockhash: Blockhash;\n instructions: CompiledInstruction[];\n\n constructor(args: MessageArgs) {\n this.header = args.header;\n this.accountKeys = args.accountKeys.map(account => new PublicKey(account));\n this.recentBlockhash = args.recentBlockhash;\n this.instructions = args.instructions;\n }\n\n isAccountWritable(index: number): boolean {\n return (\n index <\n this.header.numRequiredSignatures -\n this.header.numReadonlySignedAccounts ||\n (index >= this.header.numRequiredSignatures &&\n index <\n this.accountKeys.length - this.header.numReadonlyUnsignedAccounts)\n );\n }\n\n serialize(): Buffer {\n const numKeys = this.accountKeys.length;\n\n let keyCount: number[] = [];\n shortvec.encodeLength(keyCount, numKeys);\n\n const instructions = this.instructions.map(instruction => {\n const {accounts, programIdIndex} = instruction;\n const data = bs58.decode(instruction.data);\n\n let keyIndicesCount: number[] = [];\n shortvec.encodeLength(keyIndicesCount, accounts.length);\n\n let dataCount: number[] = [];\n shortvec.encodeLength(dataCount, data.length);\n\n return {\n programIdIndex,\n keyIndicesCount: Buffer.from(keyIndicesCount),\n keyIndices: Buffer.from(accounts),\n dataLength: Buffer.from(dataCount),\n data,\n };\n });\n\n let instructionCount: number[] = [];\n shortvec.encodeLength(instructionCount, instructions.length);\n let instructionBuffer = Buffer.alloc(PACKET_DATA_SIZE);\n Buffer.from(instructionCount).copy(instructionBuffer);\n let instructionBufferLength = instructionCount.length;\n\n instructions.forEach(instruction => {\n const instructionLayout = BufferLayout.struct([\n BufferLayout.u8('programIdIndex'),\n\n BufferLayout.blob(\n instruction.keyIndicesCount.length,\n 'keyIndicesCount',\n ),\n BufferLayout.seq(\n BufferLayout.u8('keyIndex'),\n instruction.keyIndices.length,\n 'keyIndices',\n ),\n BufferLayout.blob(instruction.dataLength.length, 'dataLength'),\n BufferLayout.seq(\n BufferLayout.u8('userdatum'),\n instruction.data.length,\n 'data',\n ),\n ]);\n const length = instructionLayout.encode(\n instruction,\n instructionBuffer,\n instructionBufferLength,\n );\n instructionBufferLength += length;\n });\n instructionBuffer = instructionBuffer.slice(0, instructionBufferLength);\n\n const signDataLayout = BufferLayout.struct([\n BufferLayout.blob(1, 'numRequiredSignatures'),\n BufferLayout.blob(1, 'numReadonlySignedAccounts'),\n BufferLayout.blob(1, 'numReadonlyUnsignedAccounts'),\n BufferLayout.blob(keyCount.length, 'keyCount'),\n BufferLayout.seq(Layout.publicKey('key'), numKeys, 'keys'),\n Layout.publicKey('recentBlockhash'),\n ]);\n\n const transaction = {\n numRequiredSignatures: Buffer.from([this.header.numRequiredSignatures]),\n numReadonlySignedAccounts: Buffer.from([\n this.header.numReadonlySignedAccounts,\n ]),\n numReadonlyUnsignedAccounts: Buffer.from([\n this.header.numReadonlyUnsignedAccounts,\n ]),\n keyCount: Buffer.from(keyCount),\n keys: this.accountKeys.map(key => key.toBuffer()),\n recentBlockhash: bs58.decode(this.recentBlockhash),\n };\n\n let signData = Buffer.alloc(2048);\n const length = signDataLayout.encode(transaction, signData);\n instructionBuffer.copy(signData, length);\n return signData.slice(0, length + instructionBuffer.length);\n }\n\n /**\n * Decode a compiled message into a Message object.\n */\n static from(buffer: Buffer | Uint8Array | Array<number>): Message {\n // Slice up wire data\n let byteArray = [...buffer];\n\n const numRequiredSignatures = byteArray.shift() as number;\n const numReadonlySignedAccounts = byteArray.shift() as number;\n const numReadonlyUnsignedAccounts = byteArray.shift() as number;\n\n const accountCount = shortvec.decodeLength(byteArray);\n let accountKeys = [];\n for (let i = 0; i < accountCount; i++) {\n const account = byteArray.slice(0, PUBKEY_LENGTH);\n byteArray = byteArray.slice(PUBKEY_LENGTH);\n accountKeys.push(bs58.encode(Buffer.from(account)));\n }\n\n const recentBlockhash = byteArray.slice(0, PUBKEY_LENGTH);\n byteArray = byteArray.slice(PUBKEY_LENGTH);\n\n const instructionCount = shortvec.decodeLength(byteArray);\n let instructions: CompiledInstruction[] = [];\n for (let i = 0; i < instructionCount; i++) {\n const programIdIndex = byteArray.shift() as number;\n const accountCount = shortvec.decodeLength(byteArray);\n const accounts = byteArray.slice(0, accountCount);\n byteArray = byteArray.slice(accountCount);\n const dataLength = shortvec.decodeLength(byteArray);\n const dataSlice = byteArray.slice(0, dataLength);\n const data = bs58.encode(Buffer.from(dataSlice));\n byteArray = byteArray.slice(dataLength);\n instructions.push({\n programIdIndex,\n accounts,\n data,\n });\n }\n\n const messageArgs = {\n header: {\n numRequiredSignatures,\n numReadonlySignedAccounts,\n numReadonlyUnsignedAccounts,\n },\n recentBlockhash: bs58.encode(Buffer.from(recentBlockhash)),\n accountKeys,\n instructions,\n };\n\n return new Message(messageArgs);\n }\n}\n","import invariant from 'assert';\nimport nacl from 'tweetnacl';\nimport bs58 from 'bs58';\nimport {Buffer} from 'buffer';\n\nimport type {CompiledInstruction} from './message';\nimport {Message} from './message';\nimport {PublicKey} from './publickey';\nimport {Account} from './account';\nimport * as shortvec from './util/shortvec-encoding';\nimport type {Blockhash} from './blockhash';\nimport {toBuffer} from './util/to-buffer';\n\n/**\n * @typedef {string} TransactionSignature\n */\nexport type TransactionSignature = string;\n\n/**\n * Default (empty) signature\n *\n * Signatures are 64 bytes in length\n */\nconst DEFAULT_SIGNATURE = Buffer.alloc(64).fill(0);\n\n/**\n * Maximum over-the-wire size of a Transaction\n *\n * 1280 is IPv6 minimum MTU\n * 40 bytes is the size of the IPv6 header\n * 8 bytes is the size of the fragment header\n */\nexport const PACKET_DATA_SIZE = 1280 - 40 - 8;\n\nconst SIGNATURE_LENGTH = 64;\n\n/**\n * Account metadata used to define instructions\n *\n * @typedef {Object} AccountMeta\n * @property {PublicKey} pubkey An account's public key\n * @property {boolean} isSigner True if an instruction requires a transaction signature matching `pubkey`\n * @property {boolean} isWritable True if the `pubkey` can be loaded as a read-write account.\n */\nexport type AccountMeta = {\n pubkey: PublicKey;\n isSigner: boolean;\n isWritable: boolean;\n};\n\n/**\n * List of TransactionInstruction object fields that may be initialized at construction\n *\n * @typedef {Object} TransactionInstructionCtorFields\n * @property {Array<PublicKey>} keys\n * @property {PublicKey} programId\n * @property {?Buffer} data\n */\nexport type TransactionInstructionCtorFields = {\n keys: Array<AccountMeta>;\n programId: PublicKey;\n data?: Buffer;\n};\n\n/**\n * Configuration object for Transaction.serialize()\n *\n * @typedef {Object} SerializeConfig\n * @property {boolean|undefined} requireAllSignatures Require all transaction signatures be present (default: true)\n * @property {boolean|undefined} verifySignatures Verify provided signatures (default: true)\n */\nexport type SerializeConfig = {\n requireAllSignatures?: boolean;\n verifySignatures?: boolean;\n};\n\n/**\n * Transaction Instruction class\n */\nexport class TransactionInstruction {\n /**\n * Public keys to include in this transaction\n * Boolean represents whether this pubkey needs to sign the transaction\n */\n keys: Array<AccountMeta>;\n\n /**\n * Program Id to execute\n */\n programId: PublicKey;\n\n /**\n * Program input\n */\n data: Buffer = Buffer.alloc(0);\n\n constructor(opts: TransactionInstructionCtorFields) {\n this.programId = opts.programId;\n this.keys = opts.keys;\n if (opts.data) {\n this.data = opts.data;\n }\n }\n}\n\n/**\n * @internal\n */\ntype SignaturePubkeyPair = {\n signature: Buffer | null;\n publicKey: PublicKey;\n};\n\n/**\n * List of Transaction object fields that may be initialized at construction\n *\n * @typedef {Object} TransactionCtorFields\n * @property {?Blockhash} recentBlockhash A recent blockhash\n * @property {?PublicKey} feePayer The transaction fee payer\n * @property {?Array<SignaturePubkeyPair>} signatures One or more signatures\n *\n */\ntype TransactionCtorFields = {\n recentBlockhash?: Blockhash | null;\n nonceInfo?: NonceInformation | null;\n feePayer?: PublicKey | null;\n signatures?: Array<SignaturePubkeyPair>;\n};\n\n/**\n * NonceInformation to be used to build a Transaction.\n *\n * @typedef {Object} NonceInformation\n * @property {Blockhash} nonce The current Nonce blockhash\n * @property {TransactionInstruction} nonceInstruction AdvanceNonceAccount Instruction\n */\ntype NonceInformation = {\n nonce: Blockhash;\n nonceInstruction: TransactionInstruction;\n};\n\n/**\n * Transaction class\n */\nexport class Transaction {\n /**\n * Signatures for the transaction. Typically created by invoking the\n * `sign()` method\n */\n signatures: Array<SignaturePubkeyPair> = [];\n\n /**\n * The first (payer) Transaction signature\n */\n get signature(): Buffer | null {\n if (this.signatures.length > 0) {\n return this.signatures[0].signature;\n }\n return null;\n }\n\n /**\n * The transaction fee payer\n */\n feePayer?: PublicKey;\n\n /**\n * The instructions to atomically execute\n */\n instructions: Array<TransactionInstruction> = [];\n\n /**\n * A recent transaction id. Must be populated by the caller\n */\n recentBlockhash?: Blockhash;\n\n /**\n * Optional Nonce information. If populated, transaction will use a durable\n * Nonce hash instead of a recentBlockhash. Must be populated by the caller\n */\n nonceInfo?: NonceInformation;\n\n /**\n * Construct an empty Transaction\n */\n constructor(opts?: TransactionCtorFields) {\n opts && Object.assign(this, opts);\n }\n\n /**\n * Add one or more instructions to this Transaction\n */\n add(\n ...items: Array<\n Transaction | TransactionInstruction | TransactionInstructionCtorFields\n >\n ): Transaction {\n if (items.length === 0) {\n throw new Error('No instructions');\n }\n\n items.forEach((item: any) => {\n if ('instructions' in item) {\n this.instructions = this.instructions.concat(item.instructions);\n } else if ('data' in item && 'programId' in item && 'keys' in item) {\n this.instructions.push(item);\n } else {\n this.instructions.push(new TransactionInstruction(item));\n }\n });\n return this;\n }\n\n /**\n * Compile transaction data\n */\n compileMessage(): Message {\n const {nonceInfo} = this;\n if (nonceInfo && this.instructions[0] != nonceInfo.nonceInstruction) {\n this.recentBlockhash = nonceInfo.nonce;\n this.instructions.unshift(nonceInfo.nonceInstruction);\n }\n const {recentBlockhash} = this;\n if (!recentBlockhash) {\n throw new Error('Transaction recentBlockhash required');\n }\n\n if (this.instructions.length < 1) {\n throw new Error('No instructions provided');\n }\n\n let feePayer: PublicKey;\n if (this.feePayer) {\n feePayer = this.feePayer;\n } else if (this.signatures.length > 0 && this.signatures[0].publicKey) {\n // Use implicit fee payer\n feePayer = this.signatures[0].publicKey;\n } else {\n throw new Error('Transaction fee payer required');\n }\n\n for (let i = 0; i < this.instructions.length; i++) {\n if (this.instructions[i].programId === undefined) {\n throw new Error(\n `Transaction instruction index ${i} has undefined program id`,\n );\n }\n }\n\n const programIds: string[] = [];\n const accountMetas: AccountMeta[] = [];\n this.instructions.forEach(instruction => {\n instruction.keys.forEach(accountMeta => {\n accountMetas.push({...accountMeta});\n });\n\n const programId = instruction.programId.toString();\n if (!programIds.includes(programId)) {\n programIds.push(programId);\n }\n });\n\n // Append programID account metas\n programIds.forEach(programId => {\n accountMetas.push({\n pubkey: new PublicKey(programId),\n isSigner: false,\n isWritable: false,\n });\n });\n\n // Sort. Prioritizing first by signer, then by writable\n accountMetas.sort(function (x, y) {\n const checkSigner = x.isSigner === y.isSigner ? 0 : x.isSigner ? -1 : 1;\n const checkWritable =\n x.isWritable === y.isWritable ? 0 : x.isWritable ? -1 : 1;\n return checkSigner || checkWritable;\n });\n\n // Cull duplicate account metas\n const uniqueMetas: AccountMeta[] = [];\n accountMetas.forEach(accountMeta => {\n const pubkeyString = accountMeta.pubkey.toString();\n const uniqueIndex = uniqueMetas.findIndex(x => {\n return x.pubkey.toString() === pubkeyString;\n });\n if (uniqueIndex > -1) {\n uniqueMetas[uniqueIndex].isWritable =\n uniqueMetas[uniqueIndex].isWritable || accountMeta.isWritable;\n } else {\n uniqueMetas.push(accountMeta);\n }\n });\n\n // Move fee payer to the front\n const feePayerIndex = uniqueMetas.findIndex(x => {\n return x.pubkey.equals(feePayer);\n });\n if (feePayerIndex > -1) {\n const [payerMeta] = uniqueMetas.splice(feePayerIndex, 1);\n payerMeta.isSigner = true;\n payerMeta.isWritable = true;\n uniqueMetas.unshift(payerMeta);\n } else {\n uniqueMetas.unshift({\n pubkey: feePayer,\n isSigner: true,\n isWritable: true,\n });\n }\n\n // Disallow unknown signers\n for (const signature of this.signatures) {\n const uniqueIndex = uniqueMetas.findIndex(x => {\n return x.pubkey.equals(signature.publicKey);\n });\n if (uniqueIndex > -1) {\n if (!uniqueMetas[uniqueIndex].isSigner) {\n uniqueMetas[uniqueIndex].isSigner = true;\n console.warn(\n 'Transaction references a signature that is unnecessary, ' +\n 'only the fee payer and instruction signer accounts should sign a transaction. ' +\n 'This behavior is deprecated and will throw an error in the next major version release.',\n );\n }\n } else {\n throw new Error(`unknown signer: ${signature.publicKey.toString()}`);\n }\n }\n\n let numRequiredSignatures = 0;\n let numReadonlySignedAccounts = 0;\n let numReadonlyUnsignedAccounts = 0;\n\n // Split out signing from non-signing keys and count header values\n const signedKeys: string[] = [];\n const unsignedKeys: string[] = [];\n uniqueMetas.forEach(({pubkey, isSigner, isWritable}) => {\n if (isSigner) {\n signedKeys.push(pubkey.toString());\n numRequiredSignatures += 1;\n if (!isWritable) {\n numReadonlySignedAccounts += 1;\n }\n } else {\n unsignedKeys.push(pubkey.toString());\n if (!isWritable) {\n numReadonlyUnsignedAccounts += 1;\n }\n }\n });\n\n const accountKeys = signedKeys.concat(unsignedKeys);\n const instructions: CompiledInstruction[] = this.instructions.map(\n instruction => {\n const {data, programId} = instruction;\n return {\n programIdIndex: accountKeys.indexOf(programId.toString()),\n accounts: instruction.keys.map(meta =>\n accountKeys.indexOf(meta.pubkey.toString()),\n ),\n data: bs58.encode(data),\n };\n },\n );\n\n instructions.forEach(instruction => {\n invariant(instruction.programIdIndex >= 0);\n instruction.accounts.forEach(keyIndex => invariant(keyIndex >= 0));\n });\n\n return new Message({\n header: {\n numRequiredSignatures,\n numReadonlySignedAccounts,\n numReadonlyUnsignedAccounts,\n },\n accountKeys,\n recentBlockhash,\n instructions,\n });\n }\n\n /**\n * @internal\n */\n _compile(): Message {\n const message = this.compileMessage();\n const signedKeys = message.accountKeys.slice(\n 0,\n message.header.numRequiredSignatures,\n );\n\n if (this.signatures.length === signedKeys.length) {\n const valid = this.signatures.every((pair, index) => {\n return signedKeys[index].equals(pair.publicKey);\n });\n\n if (valid) return message;\n }\n\n this.signatures = signedKeys.map(publicKey => ({\n signature: null,\n publicKey,\n }));\n\n return message;\n }\n\n /**\n * Get a buffer of the Transaction data that need to be covered by signatures\n */\n serializeMessage(): Buffer {\n return this._compile().serialize();\n }\n\n /**\n * Specify the public keys which will be used to sign the Transaction.\n * The first signer will be used as the transaction fee payer account.\n *\n * Signatures can be added with either `partialSign` or `addSignature`\n *\n * @deprecated Deprecated since v0.84.0. Only the fee payer needs to be\n * specified and it can be set in the Transaction constructor or with the\n * `feePayer` property.\n */\n setSigners(...signers: Array<PublicKey>) {\n if (signers.length === 0) {\n throw new Error('No signers');\n }\n\n const seen = new Set();\n this.signatures = signers\n .filter(publicKey => {\n const key = publicKey.toString();\n if (seen.has(key)) {\n return false;\n } else {\n seen.add(key);\n return true;\n }\n })\n .map(publicKey => ({signature: null, publicKey}));\n }\n\n /**\n * Sign the Transaction with the specified accounts. Multiple signatures may\n * be applied to a Transaction. The first signature is considered \"primary\"\n * and is used identify and confirm transactions.\n *\n * If the Transaction `feePayer` is not set, the first signer will be used\n * as the transaction fee payer account.\n *\n * Transaction fields should not be modified after the first call to `sign`,\n * as doing so may invalidate the signature and cause the Transaction to be\n * rejected.\n *\n * The Transaction must be assigned a valid `recentBlockhash` before invoking this method\n */\n sign(...signers: Array<Account>) {\n if (signers.length === 0) {\n throw new Error('No signers');\n }\n\n // Dedupe signers\n const seen = new Set();\n const uniqueSigners = [];\n for (const signer of signers) {\n const key = signer.publicKey.toString();\n if (seen.has(key)) {\n continue;\n } else {\n seen.add(key);\n uniqueSigners.push(signer);\n }\n }\n\n this.signatures = uniqueSigners.map(signer => ({\n signature: null,\n publicKey: signer.publicKey,\n }));\n\n const message = this._compile();\n this._partialSign(message, ...uniqueSigners);\n this._verifySignatures(message.serialize(), true);\n }\n\n /**\n * Partially sign a transaction with the specified accounts. All accounts must\n * correspond to either the fee payer or a signer account in the transaction\n * instructions.\n *\n * All the caveats from the `sign` method apply to `partialSign`\n */\n partialSign(...signers: Array<Account>) {\n if (signers.length === 0) {\n throw new Error('No signers');\n }\n\n // Dedupe signers\n const seen = new Set();\n const uniqueSigners = [];\n for (const signer of signers) {\n const key = signer.publicKey.toString();\n if (seen.has(key)) {\n continue;\n } else {\n seen.add(key);\n uniqueSigners.push(signer);\n }\n }\n\n const message = this._compile();\n this._partialSign(message, ...uniqueSigners);\n }\n\n /**\n * @internal\n */\n _partialSign(message: Message, ...signers: Array<Account>) {\n const signData = message.serialize();\n signers.forEach(signer => {\n const signature = nacl.sign.detached(signData, signer.secretKey);\n this._addSignature(signer.publicKey, toBuffer(signature));\n });\n }\n\n /**\n * Add an externally created signature to a transaction. The public key\n * must correspond to either the fee payer or a signer account in the transaction\n * instructions.\n */\n addSignature(pubkey: PublicKey, signature: Buffer) {\n this._compile(); // Ensure signatures array is populated\n this._addSignature(pubkey, signature);\n }\n\n /**\n * @internal\n */\n _addSignature(pubkey: PublicKey, signature: Buffer) {\n invariant(signature.length === 64);\n\n const index = this.signatures.findIndex(sigpair =>\n pubkey.equals(sigpair.publicKey),\n );\n if (index < 0) {\n throw new Error(`unknown signer: ${pubkey.toString()}`);\n }\n\n this.signatures[index].signature = Buffer.from(signature);\n }\n\n /**\n * Verify signatures of a complete, signed Transaction\n */\n verifySignatures(): boolean {\n return this._verifySignatures(this.serializeMessage(), true);\n }\n\n /**\n * @internal\n */\n _verifySignatures(signData: Buffer, requireAllSignatures: boolean): boolean {\n for (const {signature, publicKey} of this.signatures) {\n if (signature === null) {\n if (requireAllSignatures) {\n return false;\n }\n } else {\n if (\n !nacl.sign.detached.verify(signData, signature, publicKey.toBuffer())\n ) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * Serialize the Transaction in the wire format.\n */\n serialize(config?: SerializeConfig): Buffer {\n const {requireAllSignatures, verifySignatures} = Object.assign(\n {requireAllSignatures: true, verifySignatures: true},\n config,\n );\n\n const signData = this.serializeMessage();\n if (\n verifySignatures &&\n !this._verifySignatures(signData, requireAllSignatures)\n ) {\n throw new Error('Signature verification failed');\n }\n\n return this._serialize(signData);\n }\n\n /**\n * @internal\n */\n _serialize(signData: Buffer): Buffer {\n const {signatures} = this;\n const signatureCount: number[] = [];\n shortvec.encodeLength(signatureCount, signatures.length);\n const transactionLength =\n signatureCount.length + signatures.length * 64 + signData.length;\n const wireTransaction = Buffer.alloc(transactionLength);\n invariant(signatures.length < 256);\n Buffer.from(signatureCount).copy(wireTransaction, 0);\n signatures.forEach(({signature}, index) => {\n if (signature !== null) {\n invariant(signature.length === 64, `signature has invalid length`);\n Buffer.from(signature).copy(\n wireTransaction,\n signatureCount.length + index * 64,\n );\n }\n });\n signData.copy(\n wireTransaction,\n signatureCount.length + signatures.length * 64,\n );\n invariant(\n wireTransaction.length <= PACKET_DATA_SIZE,\n `Transaction too large: ${wireTransaction.length} > ${PACKET_DATA_SIZE}`,\n );\n return wireTransaction;\n }\n\n /**\n * Deprecated method\n * @internal\n */\n get keys(): Array<PublicKey> {\n invariant(this.instructions.length === 1);\n return this.instructions[0].keys.map(keyObj => keyObj.pubkey);\n }\n\n /**\n * Deprecated method\n * @internal\n */\n get programId(): PublicKey {\n invariant(this.instructions.length === 1);\n return this.instructions[0].programId;\n }\n\n /**\n * Deprecated method\n * @internal\n */\n get data(): Buffer {\n invariant(this.instructions.length === 1);\n return this.instructions[0].data;\n }\n\n /**\n * Parse a wire transaction into a Transaction object.\n */\n static from(buffer: Buffer | Uint8Array | Array<number>): Transaction {\n // Slice up wire data\n let byteArray = [...buffer];\n\n const signatureCount = shortvec.decodeLength(byteArray);\n let signatures = [];\n for (let i = 0; i < signatureCount; i++) {\n const signature = byteArray.slice(0, SIGNATURE_LENGTH);\n byteArray = byteArray.slice(SIGNATURE_LENGTH);\n signatures.push(bs58.encode(Buffer.from(signature)));\n }\n\n return Transaction.populate(Message.from(byteArray), signatures);\n }\n\n /**\n * Populate Transaction object from message and signatures\n */\n static populate(message: Message, signatures: Array<string>): Transaction {\n const transaction = new Transaction();\n transaction.recentBlockhash = message.recentBlockhash;\n if (message.header.numRequiredSignatures > 0) {\n transaction.feePayer = message.accountKeys[0];\n }\n signatures.forEach((signature, index) => {\n const sigPubkeyPair = {\n signature:\n signature == bs58.encode(DEFAULT_SIGNATURE)\n ? null\n : bs58.decode(signature),\n publicKey: message.accountKeys[index],\n };\n transaction.signatures.push(sigPubkeyPair);\n });\n\n message.instructions.forEach(instruction => {\n const keys = instruction.accounts.map(account => {\n const pubkey = message.accountKeys[account];\n return {\n pubkey,\n isSigner: transaction.signatures.some(\n keyObj => keyObj.publicKey.toString() === pubkey.toString(),\n ),\n isWritable: message.isAccountWritable(account),\n };\n });\n\n transaction.instructions.push(\n new TransactionInstruction({\n keys,\n programId: message.accountKeys[instruction.programIdIndex],\n data: bs58.decode(instruction.data),\n }),\n );\n });\n\n return transaction;\n }\n}\n","import {PublicKey} from './publickey';\n\nexport const SYSVAR_CLOCK_PUBKEY = new PublicKey(\n 'SysvarC1ock11111111111111111111111111111111',\n);\n\nexport const SYSVAR_RECENT_BLOCKHASHES_PUBKEY = new PublicKey(\n 'SysvarRecentB1ockHashes11111111111111111111',\n);\n\nexport const SYSVAR_RENT_PUBKEY = new PublicKey(\n 'SysvarRent111111111111111111111111111111111',\n);\n\nexport const SYSVAR_REWARDS_PUBKEY = new PublicKey(\n 'SysvarRewards111111111111111111111111111111',\n);\n\nexport const SYSVAR_STAKE_HISTORY_PUBKEY = new PublicKey(\n 'SysvarStakeHistory1111111111111111111111111',\n);\n\nexport const SYSVAR_INSTRUCTIONS_PUBKEY = new PublicKey(\n 'Sysvar1nstructions1111111111111111111111111',\n);\n","import {Connection} from '../connection';\nimport {Transaction} from '../transaction';\nimport type {Account} from '../account';\nimport type {ConfirmOptions} from '../connection';\nimport type {TransactionSignature} from '../transaction';\n\n/**\n * Sign, send and confirm a transaction.\n *\n * If `commitment` option is not specified, defaults to 'max' commitment.\n *\n * @param {Connection} connection\n * @param {Transaction} transaction\n * @param {Array<Account>} signers\n * @param {ConfirmOptions} [options]\n * @returns {Promise<TransactionSignature>}\n */\nexport async function sendAndConfirmTransaction(\n connection: Connection,\n transaction: Transaction,\n signers: Array<Account>,\n options?: ConfirmOptions,\n): Promise<TransactionSignature> {\n const sendOptions = options && {\n skipPreflight: options.skipPreflight,\n preflightCommitment: options.preflightCommitment || options.commitment,\n };\n\n const signature = await connection.sendTransaction(\n transaction,\n signers,\n sendOptions,\n );\n\n const status = (\n await connection.confirmTransaction(\n signature,\n options && options.commitment,\n )\n ).value;\n\n if (status.err) {\n throw new Error(\n `Transaction ${signature} failed (${JSON.stringify(status)})`,\n );\n }\n\n return signature;\n}\n","// zzz\nexport function sleep(ms: number): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms));\n}\n","import {Buffer} from 'buffer';\nimport * as BufferLayout from 'buffer-layout';\n\nimport * as Layout from './layout';\n\n/**\n * @typedef {Object} InstructionType\n * @property (index} The Instruction index (from solana upstream program)\n * @property (BufferLayout} The BufferLayout to use to build data\n * @internal\n */\nexport type InstructionType = {\n index: number;\n layout: typeof BufferLayout;\n};\n\n/**\n * Populate a buffer of instruction data using an InstructionType\n * @internal\n */\nexport function encodeData(type: InstructionType, fields?: any): Buffer {\n const allocLength =\n type.layout.span >= 0 ? type.layout.span : Layout.getAlloc(type, fields);\n const data = Buffer.alloc(allocLength);\n const layoutFields = Object.assign({instruction: type.index}, fields);\n type.layout.encode(layoutFields, data);\n return data;\n}\n\n/**\n * Decode instruction data buffer using an InstructionType\n * @internal\n */\nexport function decodeData(type: InstructionType, buffer: Buffer): any {\n let data;\n try {\n data = type.layout.decode(buffer);\n } catch (err) {\n throw new Error('invalid instruction; ' + err);\n }\n\n if (data.instruction !== type.index) {\n throw new Error(\n `invalid instruction; instruction index mismatch ${data.instruction} != ${type.index}`,\n );\n }\n\n return data;\n}\n","// @ts-ignore\nimport * as BufferLayout from 'buffer-layout';\n\n/**\n * https://github.com/solana-labs/solana/blob/90bedd7e067b5b8f3ddbb45da00a4e9cabb22c62/sdk/src/fee_calculator.rs#L7-L11\n *\n * @internal\n */\nexport const FeeCalculatorLayout = BufferLayout.nu64('lamportsPerSignature');\n\n/**\n * Calculator for transaction fees.\n */\nexport interface FeeCalculator {\n /** Cost in lamports to validate a signature. */\n lamportsPerSignature: number;\n}\n","import * as BufferLayout from 'buffer-layout';\n\nimport type {Blockhash} from './blockhash';\nimport * as Layout from './layout';\nimport {PublicKey} from './publickey';\nimport type {FeeCalculator} from './fee-calculator';\nimport {FeeCalculatorLayout} from './fee-calculator';\nimport {toBuffer} from './util/to-buffer';\n\n/**\n * See https://github.com/solana-labs/solana/blob/0ea2843ec9cdc517572b8e62c959f41b55cf4453/sdk/src/nonce_state.rs#L29-L32\n *\n * @internal\n */\nconst NonceAccountLayout = BufferLayout.struct([\n BufferLayout.u32('version'),\n BufferLayout.u32('state'),\n Layout.publicKey('authorizedPubkey'),\n Layout.publicKey('nonce'),\n BufferLayout.struct([FeeCalculatorLayout], 'feeCalculator'),\n]);\n\nexport const NONCE_ACCOUNT_LENGTH = NonceAccountLayout.span;\n\ntype NonceAccountArgs = {\n authorizedPubkey: PublicKey;\n nonce: Blockhash;\n feeCalculator: FeeCalculator;\n};\n\n/**\n * NonceAccount class\n */\nexport class NonceAccount {\n authorizedPubkey: PublicKey;\n nonce: Blockhash;\n feeCalculator: FeeCalculator;\n\n /**\n * @internal\n */\n constructor(args: NonceAccountArgs) {\n this.authorizedPubkey = args.authorizedPubkey;\n this.nonce = args.nonce;\n this.feeCalculator = args.feeCalculator;\n }\n\n /**\n * Deserialize NonceAccount from the account data.\n *\n * @param buffer account data\n * @return NonceAccount\n */\n static fromAccountData(\n buffer: Buffer | Uint8Array | Array<number>,\n ): NonceAccount {\n const nonceAccount = NonceAccountLayout.decode(toBuffer(buffer), 0);\n return new NonceAccount({\n authorizedPubkey: new PublicKey(nonceAccount.authorizedPubkey),\n nonce: new PublicKey(nonceAccount.nonce).toString(),\n feeCalculator: nonceAccount.feeCalculator,\n });\n }\n}\n","import * as BufferLayout from 'buffer-layout';\n\nimport {encodeData, decodeData, InstructionType} from './instruction';\nimport * as Layout from './layout';\nimport {NONCE_ACCOUNT_LENGTH} from './nonce-account';\nimport {PublicKey} from './publickey';\nimport {SYSVAR_RECENT_BLOCKHASHES_PUBKEY, SYSVAR_RENT_PUBKEY} from './sysvar';\nimport {Transaction, TransactionInstruction} from './transaction';\n\n/**\n * Create account system transaction params\n * @typedef {Object} CreateAccountParams\n * @property {PublicKey} fromPubkey\n * @property {PublicKey} newAccountPubkey\n * @property {number} lamports\n * @property {number} space\n * @property {PublicKey} programId\n */\nexport type CreateAccountParams = {\n fromPubkey: PublicKey;\n newAccountPubkey: PublicKey;\n lamports: number;\n space: number;\n programId: PublicKey;\n};\n\n/**\n * Transfer system transaction params\n * @typedef {Object} TransferParams\n * @property {PublicKey} fromPubkey\n * @property {PublicKey} toPubkey\n * @property {number} lamports\n */\nexport type TransferParams = {\n fromPubkey: PublicKey;\n toPubkey: PublicKey;\n lamports: number;\n};\n\n/**\n * Assign system transaction params\n * @typedef {Object} AssignParams\n * @property {PublicKey} accountPubkey\n * @property {PublicKey} programId\n */\nexport type AssignParams = {\n accountPubkey: PublicKey;\n programId: PublicKey;\n};\n\n/**\n * Create account with seed system transaction params\n * @typedef {Object} CreateAccountWithSeedParams\n * @property {PublicKey} fromPubkey\n * @property {PublicKey} newAccountPubkey\n * @property {PublicKey} basePubkey\n * @property {string} seed\n * @property {number} lamports\n * @property {number} space\n * @property {PublicKey} programId\n */\nexport type CreateAccountWithSeedParams = {\n fromPubkey: PublicKey;\n newAccountPubkey: PublicKey;\n basePubkey: PublicKey;\n seed: string;\n lamports: number;\n space: number;\n programId: PublicKey;\n};\n\n/**\n * Create nonce account system transaction params\n * @typedef {Object} CreateNonceAccountParams\n * @property {PublicKey} fromPubkey\n * @property {PublicKey} noncePubkey\n * @property {PublicKey} authorizedPubkey\n * @property {number} lamports\n */\nexport type CreateNonceAccountParams = {\n fromPubkey: PublicKey;\n noncePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n lamports: number;\n};\n\n/**\n * Create nonce account with seed system transaction params\n * @typedef {Object} CreateNonceAccountWithSeedParams\n * @property {PublicKey} fromPubkey\n * @property {PublicKey} noncePubkey\n * @property {PublicKey} authorizedPubkey\n * @property {PublicKey} basePubkey\n * @property {string} seed\n * @property {number} lamports\n */\nexport type CreateNonceAccountWithSeedParams = {\n fromPubkey: PublicKey;\n noncePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n lamports: number;\n basePubkey: PublicKey;\n seed: string;\n};\n\n/**\n * Initialize nonce account system instruction params\n * @typedef {Object} InitializeNonceParams\n * @property {PublicKey} noncePubkey\n * @property {PublicKey} authorizedPubkey\n */\nexport type InitializeNonceParams = {\n noncePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n};\n\n/**\n * Advance nonce account system instruction params\n * @typedef {Object} AdvanceNonceParams\n * @property {PublicKey} noncePubkey\n * @property {PublicKey} authorizedPubkey\n */\nexport type AdvanceNonceParams = {\n noncePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n};\n\n/**\n * Withdraw nonce account system transaction params\n * @typedef {Object} WithdrawNonceParams\n * @property {PublicKey} noncePubkey\n * @property {PublicKey} authorizedPubkey\n * @property {PublicKey} toPubkey\n * @property {number} lamports\n */\nexport type WithdrawNonceParams = {\n noncePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n toPubkey: PublicKey;\n lamports: number;\n};\n\n/**\n * Authorize nonce account system transaction params\n * @typedef {Object} AuthorizeNonceParams\n * @property {PublicKey} noncePubkey\n * @property {PublicKey} authorizedPubkey\n * @property {PublicKey} newAuthorizedPubkey\n */\nexport type AuthorizeNonceParams = {\n noncePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n newAuthorizedPubkey: PublicKey;\n};\n\n/**\n * Allocate account system transaction params\n * @typedef {Object} AllocateParams\n * @property {PublicKey} accountPubkey\n * @property {number} space\n */\nexport type AllocateParams = {\n accountPubkey: PublicKey;\n space: number;\n};\n\n/**\n * Allocate account with seed system transaction params\n * @typedef {Object} AllocateWithSeedParams\n * @property {PublicKey} accountPubkey\n * @property {PublicKey} basePubkey\n * @property {string} seed\n * @property {number} space\n * @property {PublicKey} programId\n */\nexport type AllocateWithSeedParams = {\n accountPubkey: PublicKey;\n basePubkey: PublicKey;\n seed: string;\n space: number;\n programId: PublicKey;\n};\n\n/**\n * Assign account with seed system transaction params\n * @typedef {Object} AssignWithSeedParams\n * @property {PublicKey} accountPubkey\n * @property {PublicKey} basePubkey\n * @property {string} seed\n * @property {PublicKey} programId\n */\nexport type AssignWithSeedParams = {\n accountPubkey: PublicKey;\n basePubkey: PublicKey;\n seed: string;\n programId: PublicKey;\n};\n\n/**\n * Transfer with seed system transaction params\n * @typedef {Object} TransferWithSeedParams\n * @property {PublicKey} fromPubkey\n * @property {PublicKey} basePubkey\n * @property {PublicKey} toPubkey\n * @property {number} lamports\n * @property {string} seed\n * @property {PublicKey} programId\n */\nexport type TransferWithSeedParams = {\n fromPubkey: PublicKey;\n basePubkey: PublicKey;\n toPubkey: PublicKey;\n lamports: number;\n seed: string;\n programId: PublicKey;\n};\n\n/**\n * System Instruction class\n */\nexport class SystemInstruction {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Decode a system instruction and retrieve the instruction type.\n */\n static decodeInstructionType(\n instruction: TransactionInstruction,\n ): SystemInstructionType {\n this.checkProgramId(instruction.programId);\n\n const instructionTypeLayout = BufferLayout.u32('instruction');\n const typeIndex = instructionTypeLayout.decode(instruction.data);\n\n let type: SystemInstructionType | undefined;\n for (const [ixType, layout] of Object.entries(SYSTEM_INSTRUCTION_LAYOUTS)) {\n if (layout.index == typeIndex) {\n type = ixType as SystemInstructionType;\n break;\n }\n }\n\n if (!type) {\n throw new Error('Instruction type incorrect; not a SystemInstruction');\n }\n\n return type;\n }\n\n /**\n * Decode a create account system instruction and retrieve the instruction params.\n */\n static decodeCreateAccount(\n instruction: TransactionInstruction,\n ): CreateAccountParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n\n const {lamports, space, programId} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.Create,\n instruction.data,\n );\n\n return {\n fromPubkey: instruction.keys[0].pubkey,\n newAccountPubkey: instruction.keys[1].pubkey,\n lamports,\n space,\n programId: new PublicKey(programId),\n };\n }\n\n /**\n * Decode a transfer system instruction and retrieve the instruction params.\n */\n static decodeTransfer(instruction: TransactionInstruction): TransferParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n\n const {lamports} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.Transfer,\n instruction.data,\n );\n\n return {\n fromPubkey: instruction.keys[0].pubkey,\n toPubkey: instruction.keys[1].pubkey,\n lamports,\n };\n }\n\n /**\n * Decode a transfer with seed system instruction and retrieve the instruction params.\n */\n static decodeTransferWithSeed(\n instruction: TransactionInstruction,\n ): TransferWithSeedParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n\n const {lamports, seed, programId} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.TransferWithSeed,\n instruction.data,\n );\n\n return {\n fromPubkey: instruction.keys[0].pubkey,\n basePubkey: instruction.keys[1].pubkey,\n toPubkey: instruction.keys[2].pubkey,\n lamports,\n seed,\n programId: new PublicKey(programId),\n };\n }\n\n /**\n * Decode an allocate system instruction and retrieve the instruction params.\n */\n static decodeAllocate(instruction: TransactionInstruction): AllocateParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 1);\n\n const {space} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.Allocate,\n instruction.data,\n );\n\n return {\n accountPubkey: instruction.keys[0].pubkey,\n space,\n };\n }\n\n /**\n * Decode an allocate with seed system instruction and retrieve the instruction params.\n */\n static decodeAllocateWithSeed(\n instruction: TransactionInstruction,\n ): AllocateWithSeedParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 1);\n\n const {base, seed, space, programId} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.AllocateWithSeed,\n instruction.data,\n );\n\n return {\n accountPubkey: instruction.keys[0].pubkey,\n basePubkey: new PublicKey(base),\n seed,\n space,\n programId: new PublicKey(programId),\n };\n }\n\n /**\n * Decode an assign system instruction and retrieve the instruction params.\n */\n static decodeAssign(instruction: TransactionInstruction): AssignParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 1);\n\n const {programId} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.Assign,\n instruction.data,\n );\n\n return {\n accountPubkey: instruction.keys[0].pubkey,\n programId: new PublicKey(programId),\n };\n }\n\n /**\n * Decode an assign with seed system instruction and retrieve the instruction params.\n */\n static decodeAssignWithSeed(\n instruction: TransactionInstruction,\n ): AssignWithSeedParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 1);\n\n const {base, seed, programId} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.AssignWithSeed,\n instruction.data,\n );\n\n return {\n accountPubkey: instruction.keys[0].pubkey,\n basePubkey: new PublicKey(base),\n seed,\n programId: new PublicKey(programId),\n };\n }\n\n /**\n * Decode a create account with seed system instruction and retrieve the instruction params.\n */\n static decodeCreateWithSeed(\n instruction: TransactionInstruction,\n ): CreateAccountWithSeedParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n\n const {base, seed, lamports, space, programId} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.CreateWithSeed,\n instruction.data,\n );\n\n return {\n fromPubkey: instruction.keys[0].pubkey,\n newAccountPubkey: instruction.keys[1].pubkey,\n basePubkey: new PublicKey(base),\n seed,\n lamports,\n space,\n programId: new PublicKey(programId),\n };\n }\n\n /**\n * Decode a nonce initialize system instruction and retrieve the instruction params.\n */\n static decodeNonceInitialize(\n instruction: TransactionInstruction,\n ): InitializeNonceParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n\n const {authorized} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.InitializeNonceAccount,\n instruction.data,\n );\n\n return {\n noncePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: new PublicKey(authorized),\n };\n }\n\n /**\n * Decode a nonce advance system instruction and retrieve the instruction params.\n */\n static decodeNonceAdvance(\n instruction: TransactionInstruction,\n ): AdvanceNonceParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n\n decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.AdvanceNonceAccount,\n instruction.data,\n );\n\n return {\n noncePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n };\n }\n\n /**\n * Decode a nonce withdraw system instruction and retrieve the instruction params.\n */\n static decodeNonceWithdraw(\n instruction: TransactionInstruction,\n ): WithdrawNonceParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 5);\n\n const {lamports} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.WithdrawNonceAccount,\n instruction.data,\n );\n\n return {\n noncePubkey: instruction.keys[0].pubkey,\n toPubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[4].pubkey,\n lamports,\n };\n }\n\n /**\n * Decode a nonce authorize system instruction and retrieve the instruction params.\n */\n static decodeNonceAuthorize(\n instruction: TransactionInstruction,\n ): AuthorizeNonceParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n\n const {authorized} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.AuthorizeNonceAccount,\n instruction.data,\n );\n\n return {\n noncePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[1].pubkey,\n newAuthorizedPubkey: new PublicKey(authorized),\n };\n }\n\n /**\n * @internal\n */\n static checkProgramId(programId: PublicKey) {\n if (!programId.equals(SystemProgram.programId)) {\n throw new Error('invalid instruction; programId is not SystemProgram');\n }\n }\n\n /**\n * @internal\n */\n static checkKeyLength(keys: Array<any>, expectedLength: number) {\n if (keys.length < expectedLength) {\n throw new Error(\n `invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`,\n );\n }\n }\n}\n\n/**\n * An enumeration of valid SystemInstructionType's\n */\nexport type SystemInstructionType =\n | 'AdvanceNonceAccount'\n | 'Allocate'\n | 'AllocateWithSeed'\n | 'Assign'\n | 'AssignWithSeed'\n | 'AuthorizeNonceAccount'\n | 'Create'\n | 'CreateWithSeed'\n | 'InitializeNonceAccount'\n | 'Transfer'\n | 'TransferWithSeed'\n | 'WithdrawNonceAccount';\n\n/**\n * An enumeration of valid system InstructionType's\n */\nexport const SYSTEM_INSTRUCTION_LAYOUTS: {\n [type in SystemInstructionType]: InstructionType;\n} = Object.freeze({\n Create: {\n index: 0,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.ns64('lamports'),\n BufferLayout.ns64('space'),\n Layout.publicKey('programId'),\n ]),\n },\n Assign: {\n index: 1,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('programId'),\n ]),\n },\n Transfer: {\n index: 2,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.ns64('lamports'),\n ]),\n },\n CreateWithSeed: {\n index: 3,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('base'),\n Layout.rustString('seed'),\n BufferLayout.ns64('lamports'),\n BufferLayout.ns64('space'),\n Layout.publicKey('programId'),\n ]),\n },\n AdvanceNonceAccount: {\n index: 4,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')]),\n },\n WithdrawNonceAccount: {\n index: 5,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.ns64('lamports'),\n ]),\n },\n InitializeNonceAccount: {\n index: 6,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('authorized'),\n ]),\n },\n AuthorizeNonceAccount: {\n index: 7,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('authorized'),\n ]),\n },\n Allocate: {\n index: 8,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.ns64('space'),\n ]),\n },\n AllocateWithSeed: {\n index: 9,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('base'),\n Layout.rustString('seed'),\n BufferLayout.ns64('space'),\n Layout.publicKey('programId'),\n ]),\n },\n AssignWithSeed: {\n index: 10,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('base'),\n Layout.rustString('seed'),\n Layout.publicKey('programId'),\n ]),\n },\n TransferWithSeed: {\n index: 11,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.ns64('lamports'),\n Layout.rustString('seed'),\n Layout.publicKey('programId'),\n ]),\n },\n});\n\n/**\n * Factory class for transactions to interact with the System program\n */\nexport class SystemProgram {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the System program\n */\n static get programId(): PublicKey {\n return new PublicKey('11111111111111111111111111111111');\n }\n\n /**\n * Generate a transaction instruction that creates a new account\n */\n static createAccount(params: CreateAccountParams): TransactionInstruction {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Create;\n const data = encodeData(type, {\n lamports: params.lamports,\n space: params.space,\n programId: params.programId.toBuffer(),\n });\n\n return new TransactionInstruction({\n keys: [\n {pubkey: params.fromPubkey, isSigner: true, isWritable: true},\n {pubkey: params.newAccountPubkey, isSigner: true, isWritable: true},\n ],\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a transaction instruction that transfers lamports from one account to another\n */\n static transfer(\n params: TransferParams | TransferWithSeedParams,\n ): TransactionInstruction {\n let data;\n let keys;\n if ('basePubkey' in params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.TransferWithSeed;\n data = encodeData(type, {\n lamports: params.lamports,\n seed: params.seed,\n programId: params.programId.toBuffer(),\n });\n keys = [\n {pubkey: params.fromPubkey, isSigner: false, isWritable: true},\n {pubkey: params.basePubkey, isSigner: true, isWritable: false},\n {pubkey: params.toPubkey, isSigner: false, isWritable: true},\n ];\n } else {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Transfer;\n data = encodeData(type, {lamports: params.lamports});\n keys = [\n {pubkey: params.fromPubkey, isSigner: true, isWritable: true},\n {pubkey: params.toPubkey, isSigner: false, isWritable: true},\n ];\n }\n\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a transaction instruction that assigns an account to a program\n */\n static assign(\n params: AssignParams | AssignWithSeedParams,\n ): TransactionInstruction {\n let data;\n let keys;\n if ('basePubkey' in params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.AssignWithSeed;\n data = encodeData(type, {\n base: params.basePubkey.toBuffer(),\n seed: params.seed,\n programId: params.programId.toBuffer(),\n });\n keys = [\n {pubkey: params.accountPubkey, isSigner: false, isWritable: true},\n {pubkey: params.basePubkey, isSigner: true, isWritable: false},\n ];\n } else {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Assign;\n data = encodeData(type, {programId: params.programId.toBuffer()});\n keys = [{pubkey: params.accountPubkey, isSigner: true, isWritable: true}];\n }\n\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a transaction instruction that creates a new account at\n * an address generated with `from`, a seed, and programId\n */\n static createAccountWithSeed(\n params: CreateAccountWithSeedParams,\n ): TransactionInstruction {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.CreateWithSeed;\n const data = encodeData(type, {\n base: params.basePubkey.toBuffer(),\n seed: params.seed,\n lamports: params.lamports,\n space: params.space,\n programId: params.programId.toBuffer(),\n });\n let keys = [\n {pubkey: params.fromPubkey, isSigner: true, isWritable: true},\n {pubkey: params.newAccountPubkey, isSigner: false, isWritable: true},\n ];\n if (params.basePubkey != params.fromPubkey) {\n keys.push({pubkey: params.basePubkey, isSigner: true, isWritable: false});\n }\n\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a transaction that creates a new Nonce account\n */\n static createNonceAccount(\n params: CreateNonceAccountParams | CreateNonceAccountWithSeedParams,\n ): Transaction {\n const transaction = new Transaction();\n if ('basePubkey' in params && 'seed' in params) {\n transaction.add(\n SystemProgram.createAccountWithSeed({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.noncePubkey,\n basePubkey: params.basePubkey,\n seed: params.seed,\n lamports: params.lamports,\n space: NONCE_ACCOUNT_LENGTH,\n programId: this.programId,\n }),\n );\n } else {\n transaction.add(\n SystemProgram.createAccount({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.noncePubkey,\n lamports: params.lamports,\n space: NONCE_ACCOUNT_LENGTH,\n programId: this.programId,\n }),\n );\n }\n\n const initParams = {\n noncePubkey: params.noncePubkey,\n authorizedPubkey: params.authorizedPubkey,\n };\n\n transaction.add(this.nonceInitialize(initParams));\n return transaction;\n }\n\n /**\n * Generate an instruction to initialize a Nonce account\n */\n static nonceInitialize(\n params: InitializeNonceParams,\n ): TransactionInstruction {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.InitializeNonceAccount;\n const data = encodeData(type, {\n authorized: params.authorizedPubkey.toBuffer(),\n });\n const instructionData = {\n keys: [\n {pubkey: params.noncePubkey, isSigner: false, isWritable: true},\n {\n pubkey: SYSVAR_RECENT_BLOCKHASHES_PUBKEY,\n isSigner: false,\n isWritable: false,\n },\n {pubkey: SYSVAR_RENT_PUBKEY, isSigner: false, isWritable: false},\n ],\n programId: this.programId,\n data,\n };\n return new TransactionInstruction(instructionData);\n }\n\n /**\n * Generate an instruction to advance the nonce in a Nonce account\n */\n static nonceAdvance(params: AdvanceNonceParams): TransactionInstruction {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.AdvanceNonceAccount;\n const data = encodeData(type);\n const instructionData = {\n keys: [\n {pubkey: params.noncePubkey, isSigner: false, isWritable: true},\n {\n pubkey: SYSVAR_RECENT_BLOCKHASHES_PUBKEY,\n isSigner: false,\n isWritable: false,\n },\n {pubkey: params.authorizedPubkey, isSigner: true, isWritable: false},\n ],\n programId: this.programId,\n data,\n };\n return new TransactionInstruction(instructionData);\n }\n\n /**\n * Generate a transaction instruction that withdraws lamports from a Nonce account\n */\n static nonceWithdraw(params: WithdrawNonceParams): TransactionInstruction {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.WithdrawNonceAccount;\n const data = encodeData(type, {lamports: params.lamports});\n\n return new TransactionInstruction({\n keys: [\n {pubkey: params.noncePubkey, isSigner: false, isWritable: true},\n {pubkey: params.toPubkey, isSigner: false, isWritable: true},\n {\n pubkey: SYSVAR_RECENT_BLOCKHASHES_PUBKEY,\n isSigner: false,\n isWritable: false,\n },\n {\n pubkey: SYSVAR_RENT_PUBKEY,\n isSigner: false,\n isWritable: false,\n },\n {pubkey: params.authorizedPubkey, isSigner: true, isWritable: false},\n ],\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a transaction instruction that authorizes a new PublicKey as the authority\n * on a Nonce account.\n */\n static nonceAuthorize(params: AuthorizeNonceParams): TransactionInstruction {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.AuthorizeNonceAccount;\n const data = encodeData(type, {\n authorized: params.newAuthorizedPubkey.toBuffer(),\n });\n\n return new TransactionInstruction({\n keys: [\n {pubkey: params.noncePubkey, isSigner: false, isWritable: true},\n {pubkey: params.authorizedPubkey, isSigner: true, isWritable: false},\n ],\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a transaction instruction that allocates space in an account without funding\n */\n static allocate(\n params: AllocateParams | AllocateWithSeedParams,\n ): TransactionInstruction {\n let data;\n let keys;\n if ('basePubkey' in params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.AllocateWithSeed;\n data = encodeData(type, {\n base: params.basePubkey.toBuffer(),\n seed: params.seed,\n space: params.space,\n programId: params.programId.toBuffer(),\n });\n keys = [\n {pubkey: params.accountPubkey, isSigner: false, isWritable: true},\n {pubkey: params.basePubkey, isSigner: true, isWritable: false},\n ];\n } else {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Allocate;\n data = encodeData(type, {\n space: params.space,\n });\n keys = [{pubkey: params.accountPubkey, isSigner: true, isWritable: true}];\n }\n\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data,\n });\n }\n}\n","import {Buffer} from 'buffer';\nimport * as BufferLayout from 'buffer-layout';\n\nimport {Account} from './account';\nimport {PublicKey} from './publickey';\nimport {Transaction, PACKET_DATA_SIZE} from './transaction';\nimport {SYSVAR_RENT_PUBKEY} from './sysvar';\nimport {sendAndConfirmTransaction} from './util/send-and-confirm-transaction';\nimport {sleep} from './util/sleep';\nimport type {Connection} from './connection';\nimport {SystemProgram} from './system-program';\n\n/**\n * Program loader interface\n */\nexport class Loader {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Amount of program data placed in each load Transaction\n */\n static get chunkSize(): number {\n // Keep program chunks under PACKET_DATA_SIZE, leaving enough room for the\n // rest of the Transaction fields\n //\n // TODO: replace 300 with a proper constant for the size of the other\n // Transaction fields\n return PACKET_DATA_SIZE - 300;\n }\n\n /**\n * Minimum number of signatures required to load a program not including\n * retries\n *\n * Can be used to calculate transaction fees\n */\n static getMinNumSignatures(dataLength: number): number {\n return (\n 2 * // Every transaction requires two signatures (payer + program)\n (Math.ceil(dataLength / Loader.chunkSize) +\n 1 + // Add one for Create transaction\n 1) // Add one for Finalize transaction\n );\n }\n\n /**\n * Loads a generic program\n *\n * @param connection The connection to use\n * @param payer System account that pays to load the program\n * @param program Account to load the program into\n * @param programId Public key that identifies the loader\n * @param data Program octets\n * @return true if program was loaded successfully, false if program was already loaded\n */\n static async load(\n connection: Connection,\n payer: Account,\n program: Account,\n programId: PublicKey,\n data: Buffer | Uint8Array | Array<number>,\n ): Promise<boolean> {\n {\n const balanceNeeded = await connection.getMinimumBalanceForRentExemption(\n data.length,\n );\n\n // Fetch program account info to check if it has already been created\n const programInfo = await connection.getAccountInfo(\n program.publicKey,\n 'confirmed',\n );\n\n let transaction: Transaction | null = null;\n if (programInfo !== null) {\n if (programInfo.executable) {\n console.error('Program load failed, account is already executable');\n return false;\n }\n\n if (programInfo.data.length !== data.length) {\n transaction = transaction || new Transaction();\n transaction.add(\n SystemProgram.allocate({\n accountPubkey: program.publicKey,\n space: data.length,\n }),\n );\n }\n\n if (!programInfo.owner.equals(programId)) {\n transaction = transaction || new Transaction();\n transaction.add(\n SystemProgram.assign({\n accountPubkey: program.publicKey,\n programId,\n }),\n );\n }\n\n if (programInfo.lamports < balanceNeeded) {\n transaction = transaction || new Transaction();\n transaction.add(\n SystemProgram.transfer({\n fromPubkey: payer.publicKey,\n toPubkey: program.publicKey,\n lamports: balanceNeeded - programInfo.lamports,\n }),\n );\n }\n } else {\n transaction = new Transaction().add(\n SystemProgram.createAccount({\n fromPubkey: payer.publicKey,\n newAccountPubkey: program.publicKey,\n lamports: balanceNeeded > 0 ? balanceNeeded : 1,\n space: data.length,\n programId,\n }),\n );\n }\n\n // If the account is already created correctly, skip this step\n // and proceed directly to loading instructions\n if (transaction !== null) {\n await sendAndConfirmTransaction(\n connection,\n transaction,\n [payer, program],\n {\n commitment: 'confirmed',\n },\n );\n }\n }\n\n const dataLayout = BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.u32('offset'),\n BufferLayout.u32('bytesLength'),\n BufferLayout.u32('bytesLengthPadding'),\n BufferLayout.seq(\n BufferLayout.u8('byte'),\n BufferLayout.offset(BufferLayout.u32(), -8),\n 'bytes',\n ),\n ]);\n\n const chunkSize = Loader.chunkSize;\n let offset = 0;\n let array = data;\n let transactions = [];\n while (array.length > 0) {\n const bytes = array.slice(0, chunkSize);\n const data = Buffer.alloc(chunkSize + 16);\n dataLayout.encode(\n {\n instruction: 0, // Load instruction\n offset,\n bytes,\n },\n data,\n );\n\n const transaction = new Transaction().add({\n keys: [{pubkey: program.publicKey, isSigner: true, isWritable: true}],\n programId,\n data,\n });\n transactions.push(\n sendAndConfirmTransaction(connection, transaction, [payer, program], {\n commitment: 'confirmed',\n }),\n );\n\n // Delay between sends in an attempt to reduce rate limit errors\n if (connection._rpcEndpoint.includes('solana.com')) {\n const REQUESTS_PER_SECOND = 4;\n await sleep(1000 / REQUESTS_PER_SECOND);\n }\n\n offset += chunkSize;\n array = array.slice(chunkSize);\n }\n await Promise.all(transactions);\n\n // Finalize the account loaded with program data for execution\n {\n const dataLayout = BufferLayout.struct([BufferLayout.u32('instruction')]);\n\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 1, // Finalize instruction\n },\n data,\n );\n\n const transaction = new Transaction().add({\n keys: [\n {pubkey: program.publicKey, isSigner: true, isWritable: true},\n {pubkey: SYSVAR_RENT_PUBKEY, isSigner: false, isWritable: false},\n ],\n programId,\n data,\n });\n await sendAndConfirmTransaction(\n connection,\n transaction,\n [payer, program],\n {\n commitment: 'confirmed',\n },\n );\n }\n\n // success\n return true;\n }\n}\n","import {Account} from './account';\nimport {PublicKey} from './publickey';\nimport {Loader} from './loader';\nimport type {Connection} from './connection';\n\nexport const BPF_LOADER_PROGRAM_ID = new PublicKey(\n 'BPFLoader2111111111111111111111111111111111',\n);\n\n/**\n * Factory class for transactions to interact with a program loader\n */\nexport class BpfLoader {\n /**\n * Minimum number of signatures required to load a program not including\n * retries\n *\n * Can be used to calculate transaction fees\n */\n static getMinNumSignatures(dataLength: number): number {\n return Loader.getMinNumSignatures(dataLength);\n }\n\n /**\n * Load a BPF program\n *\n * @param connection The connection to use\n * @param payer Account that will pay program loading fees\n * @param program Account to load the program into\n * @param elf The entire ELF containing the BPF program\n * @param loaderProgramId The program id of the BPF loader to use\n * @return true if program was loaded successfully, false if program was already loaded\n */\n static load(\n connection: Connection,\n payer: Account,\n program: Account,\n elf: Buffer | Uint8Array | Array<number>,\n loaderProgramId: PublicKey,\n ): Promise<boolean> {\n return Loader.load(connection, payer, program, loaderProgramId, elf);\n }\n}\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see <https://mathiasbynens.be/notes/javascript-encoding>\n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode };\nexport default punycode;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\nfunction stringifyPrimitive(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n}\n\nexport function stringify (obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (isArray(obj[k])) {\n return map(obj[k], function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n\nfunction map (xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n return res;\n};\n\nexport function parse(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\nexport default {\n encode: stringify,\n stringify: stringify,\n decode: parse,\n parse: parse\n}\nexport {stringify as encode, parse as decode};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\nimport {toASCII} from 'punycode';\nimport {isObject,isString,isNullOrUndefined,isNull} from 'util';\nimport {parse as qsParse,stringify as qsStringify} from 'querystring';\nexport {\n urlParse as parse,\n urlResolve as resolve,\n urlResolveObject as resolveObject,\n urlFormat as format\n};\nexport default {\n parse: urlParse,\n resolve: urlResolve,\n resolveObject: urlResolveObject,\n format: urlFormat,\n Url: Url\n}\nexport function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.host = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.query = null;\n this.pathname = null;\n this.path = null;\n this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n\n // Special case for a simple path URL\n simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\n // RFC 2396: characters reserved for delimiting URLs.\n // We actually just auto-escape these.\n delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\n // RFC 2396: characters not allowed for various reasons.\n unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n autoEscape = ['\\''].concat(unwise),\n // Characters that are never ever allowed in a hostname.\n // Note that any invalid chars are also handled, but these\n // are the ones that are *expected* to be seen, so we fast-path\n // them.\n nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n hostEndingChars = ['/', '?', '#'],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n unsafeProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that never have a hostname.\n hostlessProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that always contain a // bit.\n slashedProtocol = {\n 'http': true,\n 'https': true,\n 'ftp': true,\n 'gopher': true,\n 'file': true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n };\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n if (url && isObject(url) && url instanceof Url) return url;\n\n var u = new Url;\n u.parse(url, parseQueryString, slashesDenoteHost);\n return u;\n}\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n return parse(this, url, parseQueryString, slashesDenoteHost);\n}\n\nfunction parse(self, url, parseQueryString, slashesDenoteHost) {\n if (!isString(url)) {\n throw new TypeError('Parameter \\'url\\' must be a string, not ' + typeof url);\n }\n\n // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n var queryIndex = url.indexOf('?'),\n splitter =\n (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n uSplit = url.split(splitter),\n slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, '/');\n url = uSplit.join(splitter);\n\n var rest = url;\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n self.path = rest;\n self.href = rest;\n self.pathname = simplePath[1];\n if (simplePath[2]) {\n self.search = simplePath[2];\n if (parseQueryString) {\n self.query = qsParse(self.search.substr(1));\n } else {\n self.query = self.search.substr(1);\n }\n } else if (parseQueryString) {\n self.search = '';\n self.query = {};\n }\n return self;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n self.protocol = lowerProto;\n rest = rest.substr(proto.length);\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n var slashes = rest.substr(0, 2) === '//';\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n self.slashes = true;\n }\n }\n var i, hec, l, p;\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n for (i = 0; i < hostEndingChars.length; i++) {\n hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n var auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd);\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n self.auth = decodeURIComponent(auth);\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (i = 0; i < nonHostChars.length; i++) {\n hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1)\n hostEnd = rest.length;\n\n self.host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n\n // pull out port.\n parseHost(self);\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n self.hostname = self.hostname || '';\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n var ipv6Hostname = self.hostname[0] === '[' &&\n self.hostname[self.hostname.length - 1] === ']';\n\n // validate a little.\n if (!ipv6Hostname) {\n var hostparts = self.hostname.split(/\\./);\n for (i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = '/' + notHost.join('.') + rest;\n }\n self.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (self.hostname.length > hostnameMaxLen) {\n self.hostname = '';\n } else {\n // hostnames are always lower case.\n self.hostname = self.hostname.toLowerCase();\n }\n\n if (!ipv6Hostname) {\n // IDNA Support: Returns a punycoded representation of \"domain\".\n // It only converts parts of the domain name that\n // have non-ASCII characters, i.e. it doesn't matter if\n // you call it with a domain that already is ASCII-only.\n self.hostname = toASCII(self.hostname);\n }\n\n p = self.port ? ':' + self.port : '';\n var h = self.hostname || '';\n self.host = h + p;\n self.href += self.host;\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n self.hostname = self.hostname.substr(1, self.hostname.length - 2);\n if (rest[0] !== '/') {\n rest = '/' + rest;\n }\n }\n }\n\n // now rest is set to the post-host stuff.\n // chop off any delim chars.\n if (!unsafeProtocol[lowerProto]) {\n\n // First, make 100% sure that any \"autoEscape\" chars get\n // escaped, even if encodeURIComponent doesn't think they\n // need to be.\n for (i = 0, l = autoEscape.length; i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae) {\n esc = escape(ae);\n }\n rest = rest.split(ae).join(esc);\n }\n }\n\n\n // chop off from the tail first.\n var hash = rest.indexOf('#');\n if (hash !== -1) {\n // got a fragment string.\n self.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n var qm = rest.indexOf('?');\n if (qm !== -1) {\n self.search = rest.substr(qm);\n self.query = rest.substr(qm + 1);\n if (parseQueryString) {\n self.query = qsParse(self.query);\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString) {\n // no query string, but parseQueryString still requested\n self.search = '';\n self.query = {};\n }\n if (rest) self.pathname = rest;\n if (slashedProtocol[lowerProto] &&\n self.hostname && !self.pathname) {\n self.pathname = '/';\n }\n\n //to support http.request\n if (self.pathname || self.search) {\n p = self.pathname || '';\n var s = self.search || '';\n self.path = p + s;\n }\n\n // finally, reconstruct the href based on what has been validated.\n self.href = format(self);\n return self;\n}\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = parse({}, obj);\n return format(obj);\n}\n\nfunction format(self) {\n var auth = self.auth || '';\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, ':');\n auth += '@';\n }\n\n var protocol = self.protocol || '',\n pathname = self.pathname || '',\n hash = self.hash || '',\n host = false,\n query = '';\n\n if (self.host) {\n host = auth + self.host;\n } else if (self.hostname) {\n host = auth + (self.hostname.indexOf(':') === -1 ?\n self.hostname :\n '[' + this.hostname + ']');\n if (self.port) {\n host += ':' + self.port;\n }\n }\n\n if (self.query &&\n isObject(self.query) &&\n Object.keys(self.query).length) {\n query = qsStringify(self.query);\n }\n\n var search = self.search || (query && ('?' + query)) || '';\n\n if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\n // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n // unless they had them to begin with.\n if (self.slashes ||\n (!protocol || slashedProtocol[protocol]) && host !== false) {\n host = '//' + (host || '');\n if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n } else if (!host) {\n host = '';\n }\n\n if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n if (search && search.charAt(0) !== '?') search = '?' + search;\n\n pathname = pathname.replace(/[?#]/g, function(match) {\n return encodeURIComponent(match);\n });\n search = search.replace('#', '%23');\n\n return protocol + host + pathname + search + hash;\n}\n\nUrl.prototype.format = function() {\n return format(this);\n}\n\nfunction urlResolve(source, relative) {\n return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n if (!source) return relative;\n return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function(relative) {\n if (isString(relative)) {\n var rel = new Url();\n rel.parse(relative, false, true);\n relative = rel;\n }\n\n var result = new Url();\n var tkeys = Object.keys(this);\n for (var tk = 0; tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n\n // hash is always overridden, no matter what.\n // even href=\"\" will remove it.\n result.hash = relative.hash;\n\n // if the relative url is empty, then there's nothing left to do here.\n if (relative.href === '') {\n result.href = result.format();\n return result;\n }\n\n // hrefs like //foo/bar always cut to the protocol.\n if (relative.slashes && !relative.protocol) {\n // take everything except the protocol from relative\n var rkeys = Object.keys(relative);\n for (var rk = 0; rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== 'protocol')\n result[rkey] = relative[rkey];\n }\n\n //urlParse appends trailing / to urls like http://www.example.com\n if (slashedProtocol[result.protocol] &&\n result.hostname && !result.pathname) {\n result.path = result.pathname = '/';\n }\n\n result.href = result.format();\n return result;\n }\n var relPath;\n if (relative.protocol && relative.protocol !== result.protocol) {\n // if it's a known url protocol, then changing\n // the protocol does weird things\n // first, if it's not file:, then we MUST have a host,\n // and if there was a path\n // to begin with, then we MUST have a path.\n // if it is file:, then the host is dropped,\n // because that's known to be hostless.\n // anything else is assumed to be absolute.\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0; v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n result.href = result.format();\n return result;\n }\n\n result.protocol = relative.protocol;\n if (!relative.host && !hostlessProtocol[relative.protocol]) {\n relPath = (relative.pathname || '').split('/');\n while (relPath.length && !(relative.host = relPath.shift()));\n if (!relative.host) relative.host = '';\n if (!relative.hostname) relative.hostname = '';\n if (relPath[0] !== '') relPath.unshift('');\n if (relPath.length < 2) relPath.unshift('');\n result.pathname = relPath.join('/');\n } else {\n result.pathname = relative.pathname;\n }\n result.search = relative.search;\n result.query = relative.query;\n result.host = relative.host || '';\n result.auth = relative.auth;\n result.hostname = relative.hostname || relative.host;\n result.port = relative.port;\n // to support http.request\n if (result.pathname || result.search) {\n var p = result.pathname || '';\n var s = result.search || '';\n result.path = p + s;\n }\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n }\n\n var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n isRelAbs = (\n relative.host ||\n relative.pathname && relative.pathname.charAt(0) === '/'\n ),\n mustEndAbs = (isRelAbs || isSourceAbs ||\n (result.host && relative.pathname)),\n removeAllDots = mustEndAbs,\n srcPath = result.pathname && result.pathname.split('/') || [],\n psychotic = result.protocol && !slashedProtocol[result.protocol];\n relPath = relative.pathname && relative.pathname.split('/') || [];\n // if the url is a non-slashed url, then relative\n // links like ../.. should be able\n // to crawl up to the hostname, as well. This is strange.\n // result.protocol has already been set by now.\n // Later on, put the first path part into the host field.\n if (psychotic) {\n result.hostname = '';\n result.port = null;\n if (result.host) {\n if (srcPath[0] === '') srcPath[0] = result.host;\n else srcPath.unshift(result.host);\n }\n result.host = '';\n if (relative.protocol) {\n relative.hostname = null;\n relative.port = null;\n if (relative.host) {\n if (relPath[0] === '') relPath[0] = relative.host;\n else relPath.unshift(relative.host);\n }\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n }\n var authInHost;\n if (isRelAbs) {\n // it's absolute.\n result.host = (relative.host || relative.host === '') ?\n relative.host : result.host;\n result.hostname = (relative.hostname || relative.hostname === '') ?\n relative.hostname : result.hostname;\n result.search = relative.search;\n result.query = relative.query;\n srcPath = relPath;\n // fall through to the dot-handling below.\n } else if (relPath.length) {\n // it's relative\n // throw away the existing file, and take the new path instead.\n if (!srcPath) srcPath = [];\n srcPath.pop();\n srcPath = srcPath.concat(relPath);\n result.search = relative.search;\n result.query = relative.query;\n } else if (!isNullOrUndefined(relative.search)) {\n // just pull out the search.\n // like href='?foo'.\n // Put this after the other two cases because it simplifies the booleans\n if (psychotic) {\n result.hostname = result.host = srcPath.shift();\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n result.search = relative.search;\n result.query = relative.query;\n //to support http.request\n if (!isNull(result.pathname) || !isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.href = result.format();\n return result;\n }\n\n if (!srcPath.length) {\n // no path at all. easy.\n // we've already handled the other stuff above.\n result.pathname = null;\n //to support http.request\n if (result.search) {\n result.path = '/' + result.search;\n } else {\n result.path = null;\n }\n result.href = result.format();\n return result;\n }\n\n // if a url ENDs in . or .., then it must get a trailing slash.\n // however, if it ends in anything else non-slashy,\n // then it must NOT get a trailing slash.\n var last = srcPath.slice(-1)[0];\n var hasTrailingSlash = (\n (result.host || relative.host || srcPath.length > 1) &&\n (last === '.' || last === '..') || last === '');\n\n // strip single dots, resolve double dots to parent dir\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = srcPath.length; i >= 0; i--) {\n last = srcPath[i];\n if (last === '.') {\n srcPath.splice(i, 1);\n } else if (last === '..') {\n srcPath.splice(i, 1);\n up++;\n } else if (up) {\n srcPath.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (!mustEndAbs && !removeAllDots) {\n for (; up--; up) {\n srcPath.unshift('..');\n }\n }\n\n if (mustEndAbs && srcPath[0] !== '' &&\n (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n srcPath.unshift('');\n }\n\n if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n srcPath.push('');\n }\n\n var isAbsolute = srcPath[0] === '' ||\n (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n // put the host back\n if (psychotic) {\n result.hostname = result.host = isAbsolute ? '' :\n srcPath.length ? srcPath.shift() : '';\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n\n mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n if (mustEndAbs && !isAbsolute) {\n srcPath.unshift('');\n }\n\n if (!srcPath.length) {\n result.pathname = null;\n result.path = null;\n } else {\n result.pathname = srcPath.join('/');\n }\n\n //to support request.http\n if (!isNull(result.pathname) || !isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.auth = relative.auth || result.auth;\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n};\n\nUrl.prototype.parseHost = function() {\n return parseHost(this);\n};\n\nfunction parseHost(self) {\n var host = self.host;\n var port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== ':') {\n self.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) self.hostname = host;\n}\n","// TODO: These constants should be removed in favor of reading them out of a\n// Syscall account\n\n/**\n * @internal\n */\nexport const NUM_TICKS_PER_SECOND = 160;\n\n/**\n * @internal\n */\nexport const DEFAULT_TICKS_PER_SLOT = 64;\n\n/**\n * @internal\n */\nexport const NUM_SLOTS_PER_SECOND =\n NUM_TICKS_PER_SECOND / DEFAULT_TICKS_PER_SLOT;\n\n/**\n * @internal\n */\nexport const MS_PER_SLOT = 1000 / NUM_SLOTS_PER_SECOND;\n","export function promiseTimeout<T>(\n promise: Promise<T>,\n timeoutMs: number,\n): Promise<T | null> {\n let timeoutId: ReturnType<typeof setTimeout>;\n const timeoutPromise: Promise<null> = new Promise(resolve => {\n timeoutId = setTimeout(() => resolve(null), timeoutMs);\n });\n\n return Promise.race([promise, timeoutPromise]).then((result: T | null) => {\n clearTimeout(timeoutId);\n return result;\n });\n}\n","import assert from 'assert';\nimport bs58 from 'bs58';\nimport {Buffer} from 'buffer';\nimport {parse as urlParse, format as urlFormat} from 'url';\nimport fetch, {Response} from 'node-fetch';\nimport {\n type as pick,\n number,\n string,\n array,\n boolean,\n literal,\n record,\n union,\n optional,\n nullable,\n coerce,\n instance,\n create,\n tuple,\n unknown,\n any,\n} from 'superstruct';\nimport type {Struct} from 'superstruct';\nimport {Client as RpcWebSocketClient} from 'rpc-websockets';\nimport RpcClient from 'jayson/lib/client/browser';\nimport {IWSRequestParams} from 'rpc-websockets/dist/lib/client';\n\nimport {AgentManager} from './agent-manager';\nimport {NonceAccount} from './nonce-account';\nimport {PublicKey} from './publickey';\nimport {MS_PER_SLOT} from './timing';\nimport {Transaction} from './transaction';\nimport {Message} from './message';\nimport {sleep} from './util/sleep';\nimport {promiseTimeout} from './util/promise-timeout';\nimport {toBuffer} from './util/to-buffer';\nimport type {Blockhash} from './blockhash';\nimport type {FeeCalculator} from './fee-calculator';\nimport type {Account} from './account';\nimport type {TransactionSignature} from './transaction';\nimport type {CompiledInstruction} from './message';\n\nconst PublicKeyFromString = coerce(\n instance(PublicKey),\n string(),\n value => new PublicKey(value),\n);\n\nconst RawAccountDataResult = tuple([string(), literal('base64')]);\n\nconst BufferFromRawAccountData = coerce(\n instance(Buffer),\n RawAccountDataResult,\n value => Buffer.from(value[0], 'base64'),\n);\n\n/**\n * Attempt to use a recent blockhash for up to 30 seconds\n * @internal\n */\nexport const BLOCKHASH_CACHE_TIMEOUT_MS = 30 * 1000;\n\ntype RpcRequest = (methodName: string, args: Array<any>) => any;\n\ntype RpcBatchRequest = (requests: RpcParams[]) => any;\n\n/**\n * @internal\n */\nexport type RpcParams = {\n methodName: string;\n args: Array<any>;\n};\n\nexport type TokenAccountsFilter =\n | {\n mint: PublicKey;\n }\n | {\n programId: PublicKey;\n };\n\n/**\n * Extra contextual information for RPC responses\n */\nexport type Context = {\n slot: number;\n};\n\n/**\n * Options for sending transactions\n */\nexport type SendOptions = {\n /** disable transaction verification step */\n skipPreflight?: boolean;\n /** preflight commitment level */\n preflightCommitment?: Commitment;\n};\n\n/**\n * Options for confirming transactions\n */\nexport type ConfirmOptions = {\n /** disable transaction verification step */\n skipPreflight?: boolean;\n /** desired commitment level */\n commitment?: Commitment;\n /** preflight commitment level */\n preflightCommitment?: Commitment;\n};\n\n/**\n * Options for getConfirmedSignaturesForAddress2\n *\n * @typedef {Object} ConfirmedSignaturesForAddress2Options\n */\nexport type ConfirmedSignaturesForAddress2Options = {\n /**\n * Start searching backwards from this transaction signature.\n * @remark If not provided the search starts from the highest max confirmed block.\n */\n before?: TransactionSignature;\n /** Maximum transaction signatures to return (between 1 and 1,000, default: 1,000). */\n limit?: number;\n};\n\n/**\n * RPC Response with extra contextual information\n */\nexport type RpcResponseAndContext<T> = {\n /** response context */\n context: Context;\n /** response value */\n value: T;\n};\n\n/**\n * @internal\n */\nfunction createRpcResult<T, U>(result: Struct<T, U>) {\n return union([\n pick({\n jsonrpc: literal('2.0'),\n id: string(),\n result,\n }),\n pick({\n jsonrpc: literal('2.0'),\n id: string(),\n error: pick({\n code: unknown(),\n message: string(),\n data: optional(any()),\n }),\n }),\n ]);\n}\n\nconst UnknownRpcResult = createRpcResult(unknown());\n\n/**\n * @internal\n */\nfunction jsonRpcResult<T, U>(schema: Struct<T, U>) {\n return coerce(createRpcResult(schema), UnknownRpcResult, value => {\n if ('error' in value) {\n return value;\n } else {\n return {\n ...value,\n result: create(value.result, schema),\n };\n }\n });\n}\n\n/**\n * @internal\n */\nfunction jsonRpcResultAndContext<T, U>(value: Struct<T, U>) {\n return jsonRpcResult(\n pick({\n context: pick({\n slot: number(),\n }),\n value,\n }),\n );\n}\n\n/**\n * @internal\n */\nfunction notificationResultAndContext<T, U>(value: Struct<T, U>) {\n return pick({\n context: pick({\n slot: number(),\n }),\n value,\n });\n}\n\n/**\n * The level of commitment desired when querying state\n * <pre>\n * 'processed': Query the most recent block which has reached 1 confirmation by the connected node\n * 'confirmed': Query the most recent block which has reached 1 confirmation by the cluster\n * 'finalized': Query the most recent block which has been finalized by the cluster\n * </pre>\n *\n * @typedef {'processed' | 'confirmed' | 'finalized'} Commitment\n */\nexport type Commitment =\n | 'processed'\n | 'confirmed'\n | 'finalized'\n | 'recent' // Deprecated as of v1.5.5\n | 'single' // Deprecated as of v1.5.5\n | 'singleGossip' // Deprecated as of v1.5.5\n | 'root' // Deprecated as of v1.5.5\n | 'max'; // Deprecated as of v1.5.5\n\n/**\n * Filter for largest accounts query\n * <pre>\n * 'circulating': Return the largest accounts that are part of the circulating supply\n * 'nonCirculating': Return the largest accounts that are not part of the circulating supply\n * </pre>\n *\n * @typedef {'circulating' | 'nonCirculating'} LargestAccountsFilter\n */\nexport type LargestAccountsFilter = 'circulating' | 'nonCirculating';\n\n/**\n * Configuration object for changing `getLargestAccounts` query behavior\n *\n * @typedef {Object} GetLargestAccountsConfig\n * @property {Commitment|undefined} commitment The level of commitment desired\n * @property {LargestAccountsFilter|undefined} filter Filter largest accounts by whether they are part of the circulating supply\n */\nexport type GetLargestAccountsConfig = {\n commitment?: Commitment;\n filter?: LargestAccountsFilter;\n};\n\n/**\n * Configuration object for changing query behavior\n *\n * @typedef {Object} SignatureStatusConfig\n * @property {boolean} searchTransactionHistory enable searching status history, not needed for recent transactions\n */\nexport type SignatureStatusConfig = {\n searchTransactionHistory: boolean;\n};\n\n/**\n * Information describing a cluster node\n *\n * @typedef {Object} ContactInfo\n * @property {string} pubkey Identity public key of the node\n * @property {string|null} gossip Gossip network address for the node\n * @property {string|null} tpu TPU network address for the node (null if not available)\n * @property {string|null} rpc JSON RPC network address for the node (null if not available)\n * @property {string|null} version Software version of the node (null if not available)\n */\nexport type ContactInfo = {\n pubkey: string;\n gossip: string | null;\n tpu: string | null;\n rpc: string | null;\n version: string | null;\n};\n\n/**\n * Information describing a vote account\n *\n * @typedef {Object} VoteAccountInfo\n * @property {string} votePubkey Public key of the vote account\n * @property {string} nodePubkey Identity public key of the node voting with this account\n * @property {number} activatedStake The stake, in lamports, delegated to this vote account and activated\n * @property {boolean} epochVoteAccount Whether the vote account is staked for this epoch\n * @property {Array<Array<number>>} epochCredits Recent epoch voting credit history for this voter\n * @property {number} commission A percentage (0-100) of rewards payout owed to the voter\n * @property {number} lastVote Most recent slot voted on by this vote account\n */\nexport type VoteAccountInfo = {\n votePubkey: string;\n nodePubkey: string;\n activatedStake: number;\n epochVoteAccount: boolean;\n epochCredits: Array<[number, number, number]>;\n commission: number;\n lastVote: number;\n};\n\n/**\n * A collection of cluster vote accounts\n *\n * @typedef {Object} VoteAccountStatus\n * @property {Array<VoteAccountInfo>} current Active vote accounts\n * @property {Array<VoteAccountInfo>} delinquent Inactive vote accounts\n */\nexport type VoteAccountStatus = {\n current: Array<VoteAccountInfo>;\n delinquent: Array<VoteAccountInfo>;\n};\n\n/**\n * Network Inflation\n * (see https://docs.solana.com/implemented-proposals/ed_overview)\n *\n * @typedef {Object} InflationGovernor\n * @property {number} foundation\n * @property {number} foundation_term\n * @property {number} initial\n * @property {number} taper\n * @property {number} terminal\n */\nexport type InflationGovernor = {\n foundation: number;\n foundationTerm: number;\n initial: number;\n taper: number;\n terminal: number;\n};\n\nconst GetInflationGovernorResult = pick({\n foundation: number(),\n foundationTerm: number(),\n initial: number(),\n taper: number(),\n terminal: number(),\n});\n\n/**\n * Information about the current epoch\n *\n * @typedef {Object} EpochInfo\n * @property {number} epoch\n * @property {number} slotIndex\n * @property {number} slotsInEpoch\n * @property {number} absoluteSlot\n * @property {number} blockHeight\n * @property {number} transactionCount\n */\nexport type EpochInfo = {\n epoch: number;\n slotIndex: number;\n slotsInEpoch: number;\n absoluteSlot: number;\n blockHeight?: number;\n transactionCount?: number;\n};\n\nconst GetEpochInfoResult = pick({\n epoch: number(),\n slotIndex: number(),\n slotsInEpoch: number(),\n absoluteSlot: number(),\n blockHeight: optional(number()),\n transactionCount: optional(number()),\n});\n\n/**\n * Epoch schedule\n * (see https://docs.solana.com/terminology#epoch)\n *\n * @typedef {Object} EpochSchedule\n * @property {number} slotsPerEpoch The maximum number of slots in each epoch\n * @property {number} leaderScheduleSlotOffset The number of slots before beginning of an epoch to calculate a leader schedule for that epoch\n * @property {boolean} warmup Indicates whether epochs start short and grow\n * @property {number} firstNormalEpoch The first epoch with `slotsPerEpoch` slots\n * @property {number} firstNormalSlot The first slot of `firstNormalEpoch`\n */\nexport type EpochSchedule = {\n slotsPerEpoch: number;\n leaderScheduleSlotOffset: number;\n warmup: boolean;\n firstNormalEpoch: number;\n firstNormalSlot: number;\n};\n\nconst GetEpochScheduleResult = pick({\n slotsPerEpoch: number(),\n leaderScheduleSlotOffset: number(),\n warmup: boolean(),\n firstNormalEpoch: number(),\n firstNormalSlot: number(),\n});\n\n/**\n * Leader schedule\n * (see https://docs.solana.com/terminology#leader-schedule)\n *\n * @typedef {Object} LeaderSchedule\n */\nexport type LeaderSchedule = {\n [address: string]: number[];\n};\n\nconst GetLeaderScheduleResult = record(string(), array(number()));\n\n/**\n * Transaction error or null\n */\nconst TransactionErrorResult = nullable(pick({}));\n\n/**\n * Signature status for a transaction\n */\nconst SignatureStatusResult = pick({\n err: TransactionErrorResult,\n});\n\n/**\n * Transaction signature received notification\n */\nconst SignatureReceivedResult = literal('receivedSignature');\n\nexport type Version = {\n 'solana-core': string;\n 'feature-set'?: number;\n};\n\n/**\n * Version info for a node\n *\n * @typedef {Object} Version\n * @property {string} solana-core Version of solana-core\n */\nconst VersionResult = pick({\n 'solana-core': string(),\n 'feature-set': optional(number()),\n});\n\nexport type SimulatedTransactionResponse = {\n err: TransactionError | string | null;\n logs: Array<string> | null;\n};\n\nconst SimulatedTransactionResponseStruct = jsonRpcResultAndContext(\n pick({\n err: nullable(union([pick({}), string()])),\n logs: nullable(array(string())),\n }),\n);\n\nexport type ParsedInnerInstruction = {\n index: number;\n instructions: (ParsedInstruction | PartiallyDecodedInstruction)[];\n};\n\nexport type TokenBalance = {\n accountIndex: number;\n mint: string;\n uiTokenAmount: TokenAmount;\n};\n\n/**\n * Metadata for a parsed confirmed transaction on the ledger\n *\n * @typedef {Object} ParsedConfirmedTransactionMeta\n * @property {number} fee The fee charged for processing the transaction\n * @property {Array<ParsedInnerInstruction>} innerInstructions An array of cross program invoked parsed instructions\n * @property {Array<number>} preBalances The balances of the transaction accounts before processing\n * @property {Array<number>} postBalances The balances of the transaction accounts after processing\n * @property {Array<string>} logMessages An array of program log messages emitted during a transaction\n * @property {Array<TokenBalance>} preTokenBalances The token balances of the transaction accounts before processing\n * @property {Array<TokenBalance>} postTokenBalances The token balances of the transaction accounts after processing\n * @property {object|null} err The error result of transaction processing\n */\nexport type ParsedConfirmedTransactionMeta = {\n fee: number;\n innerInstructions?: ParsedInnerInstruction[] | null;\n preBalances: Array<number>;\n postBalances: Array<number>;\n logMessages?: Array<string> | null;\n preTokenBalances?: Array<TokenBalance> | null;\n postTokenBalances?: Array<TokenBalance> | null;\n err: TransactionError | null;\n};\n\nexport type CompiledInnerInstruction = {\n index: number;\n instructions: CompiledInstruction[];\n};\n\n/**\n * Metadata for a confirmed transaction on the ledger\n *\n * @typedef {Object} ConfirmedTransactionMeta\n * @property {number} fee The fee charged for processing the transaction\n * @property {Array<CompiledInnerInstruction>} innerInstructions An array of cross program invoked instructions\n * @property {Array<number>} preBalances The balances of the transaction accounts before processing\n * @property {Array<number>} postBalances The balances of the transaction accounts after processing\n * @property {Array<string>} logMessages An array of program log messages emitted during a transaction\n * @property {Array<TokenBalance>} preTokenBalances The token balances of the transaction accounts before processing\n * @property {Array<TokenBalance>} postTokenBalances The token balances of the transaction accounts after processing\n * @property {object|null} err The error result of transaction processing\n */\nexport type ConfirmedTransactionMeta = {\n fee: number;\n innerInstructions?: CompiledInnerInstruction[] | null;\n preBalances: Array<number>;\n postBalances: Array<number>;\n logMessages?: Array<string> | null;\n preTokenBalances?: Array<TokenBalance> | null;\n postTokenBalances?: Array<TokenBalance> | null;\n err: TransactionError | null;\n};\n\n/**\n * A confirmed transaction on the ledger\n *\n * @typedef {Object} ConfirmedTransaction\n * @property {number} slot The slot during which the transaction was processed\n * @property {Transaction} transaction The details of the transaction\n * @property {ConfirmedTransactionMeta|null} meta Metadata produced from the transaction\n * @property {number|null|undefined} blockTime The unix timestamp of when the transaction was processed\n */\nexport type ConfirmedTransaction = {\n slot: number;\n transaction: Transaction;\n meta: ConfirmedTransactionMeta | null;\n blockTime?: number | null;\n};\n\n/**\n * A partially decoded transaction instruction\n */\nexport type PartiallyDecodedInstruction = {\n /** Program id called by this instruction */\n programId: PublicKey;\n /** Public keys of accounts passed to this instruction */\n accounts: Array<PublicKey>;\n /** Raw base-58 instruction data */\n data: string;\n};\n\n/**\n * A parsed transaction message account\n *\n * @typedef {Object} ParsedMessageAccount\n * @property {PublicKey} pubkey Public key of the account\n * @property {boolean} signer Indicates if the account signed the transaction\n * @property {boolean} writable Indicates if the account is writable for this transaction\n */\nexport type ParsedMessageAccount = {\n pubkey: PublicKey;\n signer: boolean;\n writable: boolean;\n};\n\n/**\n * A parsed transaction instruction\n *\n * @typedef {Object} ParsedInstruction\n * @property {string} program Name of the program for this instruction\n * @property {PublicKey} programId ID of the program for this instruction\n * @property {any} parsed Parsed instruction info\n */\nexport type ParsedInstruction = {\n program: string;\n programId: PublicKey;\n parsed: any;\n};\n\n/**\n * A parsed transaction message\n *\n * @typedef {Object} ParsedMessage\n * @property {Array<ParsedMessageAccount>} accountKeys Accounts used in the instructions\n * @property {Array<ParsedInstruction | PartiallyDecodedInstruction>} instructions The atomically executed instructions for the transaction\n * @property {string} recentBlockhash Recent blockhash\n */\nexport type ParsedMessage = {\n accountKeys: ParsedMessageAccount[];\n instructions: (ParsedInstruction | PartiallyDecodedInstruction)[];\n recentBlockhash: string;\n};\n\n/**\n * A parsed transaction\n *\n * @typedef {Object} ParsedTransaction\n * @property {Array<string>} signatures Signatures for the transaction\n * @property {ParsedMessage} message Message of the transaction\n */\nexport type ParsedTransaction = {\n signatures: Array<string>;\n message: ParsedMessage;\n};\n\n/**\n * A parsed and confirmed transaction on the ledger\n *\n * @typedef {Object} ParsedConfirmedTransaction\n * @property {number} slot The slot during which the transaction was processed\n * @property {ParsedTransaction} transaction The details of the transaction\n * @property {ConfirmedTransactionMeta|null} meta Metadata produced from the transaction\n * @property {number|null|undefined} blockTime The unix timestamp of when the transaction was processed\n */\nexport type ParsedConfirmedTransaction = {\n slot: number;\n transaction: ParsedTransaction;\n meta: ParsedConfirmedTransactionMeta | null;\n blockTime?: number | null;\n};\n\n/**\n * A ConfirmedBlock on the ledger\n *\n * @typedef {Object} ConfirmedBlock\n * @property {Blockhash} blockhash Blockhash of this block\n * @property {Blockhash} previousBlockhash Blockhash of this block's parent\n * @property {number} parentSlot Slot index of this block's parent\n * @property {Array<object>} transactions Vector of transactions and status metas\n * @property {Array<object>} rewards Vector of block rewards\n * @property {number|null} blockTime The unix timestamp of when the block was processed\n */\nexport type ConfirmedBlock = {\n blockhash: Blockhash;\n previousBlockhash: Blockhash;\n parentSlot: number;\n transactions: Array<{\n transaction: Transaction;\n meta: ConfirmedTransactionMeta | null;\n }>;\n rewards?: Array<{\n pubkey: string;\n lamports: number;\n postBalance: number | null;\n rewardType: string | null;\n }>;\n blockTime: number | null;\n};\n\n/**\n * A performance sample\n *\n * @typedef {Object} PerfSample\n * @property {number} slot Slot number of sample\n * @property {number} numTransactions Number of transactions in a sample window\n * @property {number} numSlots Number of slots in a sample window\n * @property {number} samplePeriodSecs Sample window in seconds\n */\nexport type PerfSample = {\n slot: number;\n numTransactions: number;\n numSlots: number;\n samplePeriodSecs: number;\n};\n\nfunction createRpcClient(url: string, useHttps: boolean): RpcClient {\n let agentManager: AgentManager | undefined;\n if (!process.env.BROWSER) {\n agentManager = new AgentManager(useHttps);\n }\n\n const clientBrowser = new RpcClient(async (request, callback) => {\n const agent = agentManager ? agentManager.requestStart() : undefined;\n const options = {\n method: 'POST',\n body: request,\n agent,\n headers: {\n 'Content-Type': 'application/json',\n },\n };\n\n try {\n let too_many_requests_retries = 5;\n let res: Response;\n let waitTime = 500;\n for (;;) {\n res = await fetch(url, options);\n if (res.status !== 429 /* Too many requests */) {\n break;\n }\n too_many_requests_retries -= 1;\n if (too_many_requests_retries === 0) {\n break;\n }\n console.log(\n `Server responded with ${res.status} ${res.statusText}. Retrying after ${waitTime}ms delay...`,\n );\n await sleep(waitTime);\n waitTime *= 2;\n }\n\n const text = await res.text();\n if (res.ok) {\n callback(null, text);\n } else {\n callback(new Error(`${res.status} ${res.statusText}: ${text}`));\n }\n } catch (err) {\n callback(err);\n } finally {\n agentManager && agentManager.requestEnd();\n }\n }, {});\n\n return clientBrowser;\n}\n\nfunction createRpcRequest(client: RpcClient): RpcRequest {\n return (method, args) => {\n return new Promise((resolve, reject) => {\n client.request(method, args, (err: any, response: any) => {\n if (err) {\n reject(err);\n return;\n }\n resolve(response);\n });\n });\n };\n}\n\nfunction createRpcBatchRequest(client: RpcClient): RpcBatchRequest {\n return (requests: RpcParams[]) => {\n return new Promise((resolve, reject) => {\n const batch = requests.map((params: RpcParams) => {\n return client.request(params.methodName, params.args);\n });\n\n client.request(batch, (err: any, response: any) => {\n if (err) {\n reject(err);\n return;\n }\n resolve(response);\n });\n });\n };\n}\n\n/**\n * Expected JSON RPC response for the \"getInflationGovernor\" message\n */\nconst GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);\n\n/**\n * Expected JSON RPC response for the \"getEpochInfo\" message\n */\nconst GetEpochInfoRpcResult = jsonRpcResult(GetEpochInfoResult);\n\n/**\n * Expected JSON RPC response for the \"getEpochSchedule\" message\n */\nconst GetEpochScheduleRpcResult = jsonRpcResult(GetEpochScheduleResult);\n\n/**\n * Expected JSON RPC response for the \"getLeaderSchedule\" message\n */\nconst GetLeaderScheduleRpcResult = jsonRpcResult(GetLeaderScheduleResult);\n\n/**\n * Expected JSON RPC response for the \"minimumLedgerSlot\" and \"getFirstAvailableBlock\" messages\n */\nconst SlotRpcResult = jsonRpcResult(number());\n\n/**\n * Supply\n *\n * @typedef {Object} Supply\n * @property {number} total Total supply in lamports\n * @property {number} circulating Circulating supply in lamports\n * @property {number} nonCirculating Non-circulating supply in lamports\n * @property {Array<PublicKey>} nonCirculatingAccounts List of non-circulating account addresses\n */\nexport type Supply = {\n total: number;\n circulating: number;\n nonCirculating: number;\n nonCirculatingAccounts: Array<PublicKey>;\n};\n\n/**\n * Expected JSON RPC response for the \"getSupply\" message\n */\nconst GetSupplyRpcResult = jsonRpcResultAndContext(\n pick({\n total: number(),\n circulating: number(),\n nonCirculating: number(),\n nonCirculatingAccounts: array(PublicKeyFromString),\n }),\n);\n\n/**\n * Token amount object which returns a token amount in different formats\n * for various client use cases.\n *\n * @typedef {Object} TokenAmount\n * @property {string} amount Raw amount of tokens as string ignoring decimals\n * @property {number} decimals Number of decimals configured for token's mint\n * @property {number | null} uiAmount Token amount as float, accounts for decimals\n * @property {string | undefined} uiAmountString Token amount as string, accounts for decimals\n */\nexport type TokenAmount = {\n amount: string;\n decimals: number;\n uiAmount: number | null;\n uiAmountString?: string;\n};\n\n/**\n * Expected JSON RPC structure for token amounts\n */\nconst TokenAmountResult = pick({\n amount: string(),\n uiAmount: nullable(number()),\n decimals: number(),\n uiAmountString: optional(string()),\n});\n\n/**\n * Token address and balance.\n *\n * @typedef {Object} TokenAccountBalancePair\n * @property {PublicKey} address Address of the token account\n * @property {string} amount Raw amount of tokens as string ignoring decimals\n * @property {number} decimals Number of decimals configured for token's mint\n * @property {number | null} uiAmount Token amount as float, accounts for decimals\n * @property {string | undefined} uiAmountString Token amount as string, accounts for decimals\n */\nexport type TokenAccountBalancePair = {\n address: PublicKey;\n amount: string;\n decimals: number;\n uiAmount: number | null;\n uiAmountString?: string;\n};\n\n/**\n * Expected JSON RPC response for the \"getTokenLargestAccounts\" message\n */\nconst GetTokenLargestAccountsResult = jsonRpcResultAndContext(\n array(\n pick({\n address: PublicKeyFromString,\n amount: string(),\n uiAmount: nullable(number()),\n decimals: number(),\n uiAmountString: optional(string()),\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"getTokenAccountsByOwner\" message\n */\nconst GetTokenAccountsByOwner = jsonRpcResultAndContext(\n array(\n pick({\n pubkey: PublicKeyFromString,\n account: pick({\n executable: boolean(),\n owner: PublicKeyFromString,\n lamports: number(),\n data: BufferFromRawAccountData,\n rentEpoch: number(),\n }),\n }),\n ),\n);\n\nconst ParsedAccountDataResult = pick({\n program: string(),\n parsed: unknown(),\n space: number(),\n});\n\n/**\n * Expected JSON RPC response for the \"getTokenAccountsByOwner\" message with parsed data\n */\nconst GetParsedTokenAccountsByOwner = jsonRpcResultAndContext(\n array(\n pick({\n pubkey: PublicKeyFromString,\n account: pick({\n executable: boolean(),\n owner: PublicKeyFromString,\n lamports: number(),\n data: ParsedAccountDataResult,\n rentEpoch: number(),\n }),\n }),\n ),\n);\n\n/**\n * Pair of an account address and its balance\n *\n * @typedef {Object} AccountBalancePair\n * @property {PublicKey} address\n * @property {number} lamports\n */\nexport type AccountBalancePair = {\n address: PublicKey;\n lamports: number;\n};\n\n/**\n * Expected JSON RPC response for the \"getLargestAccounts\" message\n */\nconst GetLargestAccountsRpcResult = jsonRpcResultAndContext(\n array(\n pick({\n lamports: number(),\n address: PublicKeyFromString,\n }),\n ),\n);\n\n/**\n * @internal\n */\nconst AccountInfoResult = pick({\n executable: boolean(),\n owner: PublicKeyFromString,\n lamports: number(),\n data: BufferFromRawAccountData,\n rentEpoch: number(),\n});\n\n/**\n * @internal\n */\nconst KeyedAccountInfoResult = pick({\n pubkey: PublicKeyFromString,\n account: AccountInfoResult,\n});\n\nconst ParsedOrRawAccountData = coerce(\n union([instance(Buffer), ParsedAccountDataResult]),\n union([RawAccountDataResult, ParsedAccountDataResult]),\n value => {\n if (Array.isArray(value)) {\n return create(value, BufferFromRawAccountData);\n } else {\n return value;\n }\n },\n);\n\n/**\n * @internal\n */\nconst ParsedAccountInfoResult = pick({\n executable: boolean(),\n owner: PublicKeyFromString,\n lamports: number(),\n data: ParsedOrRawAccountData,\n rentEpoch: number(),\n});\n\nconst KeyedParsedAccountInfoResult = pick({\n pubkey: PublicKeyFromString,\n account: ParsedAccountInfoResult,\n});\n\n/**\n * @internal\n */\nconst StakeActivationResult = pick({\n state: union([\n literal('active'),\n literal('inactive'),\n literal('activating'),\n literal('deactivating'),\n ]),\n active: number(),\n inactive: number(),\n});\n\n/**\n * Expected JSON RPC response for the \"getConfirmedSignaturesForAddress\" message\n */\nconst GetConfirmedSignaturesForAddressRpcResult = jsonRpcResult(\n array(string()),\n);\n\n/**\n * Expected JSON RPC response for the \"getConfirmedSignaturesForAddress2\" message\n */\n\nconst GetConfirmedSignaturesForAddress2RpcResult = jsonRpcResult(\n array(\n pick({\n signature: string(),\n slot: number(),\n err: TransactionErrorResult,\n memo: nullable(string()),\n blockTime: optional(nullable(number())),\n }),\n ),\n);\n\n/***\n * Expected JSON RPC response for the \"accountNotification\" message\n */\nconst AccountNotificationResult = pick({\n subscription: number(),\n result: notificationResultAndContext(AccountInfoResult),\n});\n\n/**\n * @internal\n */\nconst ProgramAccountInfoResult = pick({\n pubkey: PublicKeyFromString,\n account: AccountInfoResult,\n});\n\n/***\n * Expected JSON RPC response for the \"programNotification\" message\n */\nconst ProgramAccountNotificationResult = pick({\n subscription: number(),\n result: notificationResultAndContext(ProgramAccountInfoResult),\n});\n\n/**\n * @internal\n */\nconst SlotInfoResult = pick({\n parent: number(),\n slot: number(),\n root: number(),\n});\n\n/**\n * Expected JSON RPC response for the \"slotNotification\" message\n */\nconst SlotNotificationResult = pick({\n subscription: number(),\n result: SlotInfoResult,\n});\n\n/**\n * Expected JSON RPC response for the \"signatureNotification\" message\n */\nconst SignatureNotificationResult = pick({\n subscription: number(),\n result: notificationResultAndContext(\n union([SignatureStatusResult, SignatureReceivedResult]),\n ),\n});\n\n/**\n * Expected JSON RPC response for the \"rootNotification\" message\n */\nconst RootNotificationResult = pick({\n subscription: number(),\n result: number(),\n});\n\nconst ContactInfoResult = pick({\n pubkey: string(),\n gossip: nullable(string()),\n tpu: nullable(string()),\n rpc: nullable(string()),\n version: nullable(string()),\n});\n\nconst VoteAccountInfoResult = pick({\n votePubkey: string(),\n nodePubkey: string(),\n activatedStake: number(),\n epochVoteAccount: boolean(),\n epochCredits: array(tuple([number(), number(), number()])),\n commission: number(),\n lastVote: number(),\n rootSlot: nullable(number()),\n});\n\n/**\n * Expected JSON RPC response for the \"getVoteAccounts\" message\n */\nconst GetVoteAccounts = jsonRpcResult(\n pick({\n current: array(VoteAccountInfoResult),\n delinquent: array(VoteAccountInfoResult),\n }),\n);\n\nconst ConfirmationStatus = union([\n literal('processed'),\n literal('confirmed'),\n literal('finalized'),\n]);\n\nconst SignatureStatusResponse = pick({\n slot: number(),\n confirmations: nullable(number()),\n err: TransactionErrorResult,\n confirmationStatus: optional(ConfirmationStatus),\n});\n\n/**\n * Expected JSON RPC response for the \"getSignatureStatuses\" message\n */\nconst GetSignatureStatusesRpcResult = jsonRpcResultAndContext(\n array(nullable(SignatureStatusResponse)),\n);\n\n/**\n * Expected JSON RPC response for the \"getMinimumBalanceForRentExemption\" message\n */\nconst GetMinimumBalanceForRentExemptionRpcResult = jsonRpcResult(number());\n\n/**\n * @internal\n */\nconst ConfirmedTransactionResult = pick({\n signatures: array(string()),\n message: pick({\n accountKeys: array(string()),\n header: pick({\n numRequiredSignatures: number(),\n numReadonlySignedAccounts: number(),\n numReadonlyUnsignedAccounts: number(),\n }),\n instructions: array(\n pick({\n accounts: array(number()),\n data: string(),\n programIdIndex: number(),\n }),\n ),\n recentBlockhash: string(),\n }),\n});\n\nconst TransactionFromConfirmed = coerce(\n instance(Transaction),\n ConfirmedTransactionResult,\n result => {\n const {message, signatures} = result;\n return Transaction.populate(new Message(message), signatures);\n },\n);\n\nconst ParsedInstructionResult = pick({\n parsed: unknown(),\n program: string(),\n programId: PublicKeyFromString,\n});\n\nconst RawInstructionResult = pick({\n accounts: array(PublicKeyFromString),\n data: string(),\n programId: PublicKeyFromString,\n});\n\nconst InstructionResult = union([\n RawInstructionResult,\n ParsedInstructionResult,\n]);\n\nconst UnknownInstructionResult = union([\n pick({\n parsed: unknown(),\n program: string(),\n programId: string(),\n }),\n pick({\n accounts: array(string()),\n data: string(),\n programId: string(),\n }),\n]);\n\nconst ParsedOrRawInstruction = coerce(\n InstructionResult,\n UnknownInstructionResult,\n value => {\n if ('accounts' in value) {\n return create(value, RawInstructionResult);\n } else {\n return create(value, ParsedInstructionResult);\n }\n },\n);\n\n/**\n * @internal\n */\nconst ParsedConfirmedTransactionResult = pick({\n signatures: array(string()),\n message: pick({\n accountKeys: array(\n pick({\n pubkey: PublicKeyFromString,\n signer: boolean(),\n writable: boolean(),\n }),\n ),\n instructions: array(ParsedOrRawInstruction),\n recentBlockhash: string(),\n }),\n});\n\nconst TokenBalanceResult = pick({\n accountIndex: number(),\n mint: string(),\n uiTokenAmount: TokenAmountResult,\n});\n\n/**\n * @internal\n */\nconst ConfirmedTransactionMetaResult = pick({\n err: TransactionErrorResult,\n fee: number(),\n innerInstructions: optional(\n nullable(\n array(\n pick({\n index: number(),\n instructions: array(\n pick({\n accounts: array(number()),\n data: string(),\n programIdIndex: number(),\n }),\n ),\n }),\n ),\n ),\n ),\n preBalances: array(number()),\n postBalances: array(number()),\n logMessages: optional(nullable(array(string()))),\n preTokenBalances: optional(nullable(array(TokenBalanceResult))),\n postTokenBalances: optional(nullable(array(TokenBalanceResult))),\n});\n\n/**\n * @internal\n */\nconst ParsedConfirmedTransactionMetaResult = pick({\n err: TransactionErrorResult,\n fee: number(),\n innerInstructions: optional(\n nullable(\n array(\n pick({\n index: number(),\n instructions: array(ParsedOrRawInstruction),\n }),\n ),\n ),\n ),\n preBalances: array(number()),\n postBalances: array(number()),\n logMessages: optional(nullable(array(string()))),\n preTokenBalances: optional(nullable(array(TokenBalanceResult))),\n postTokenBalances: optional(nullable(array(TokenBalanceResult))),\n});\n\n/**\n * Expected JSON RPC response for the \"getConfirmedBlock\" message\n */\nexport const GetConfirmedBlockRpcResult = jsonRpcResult(\n nullable(\n pick({\n blockhash: string(),\n previousBlockhash: string(),\n parentSlot: number(),\n transactions: array(\n pick({\n transaction: TransactionFromConfirmed,\n meta: nullable(ConfirmedTransactionMetaResult),\n }),\n ),\n rewards: optional(\n array(\n pick({\n pubkey: string(),\n lamports: number(),\n postBalance: nullable(number()),\n rewardType: nullable(string()),\n }),\n ),\n ),\n blockTime: nullable(number()),\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"getConfirmedTransaction\" message\n */\nconst GetConfirmedTransactionRpcResult = jsonRpcResult(\n nullable(\n pick({\n slot: number(),\n transaction: TransactionFromConfirmed,\n meta: ConfirmedTransactionMetaResult,\n blockTime: optional(nullable(number())),\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"getConfirmedTransaction\" message\n */\nconst GetParsedConfirmedTransactionRpcResult = jsonRpcResult(\n nullable(\n pick({\n slot: number(),\n transaction: ParsedConfirmedTransactionResult,\n meta: nullable(ParsedConfirmedTransactionMetaResult),\n blockTime: optional(nullable(number())),\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"getRecentBlockhash\" message\n */\nconst GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(\n pick({\n blockhash: string(),\n feeCalculator: pick({\n lamportsPerSignature: number(),\n }),\n }),\n);\n\nconst PerfSampleResult = pick({\n slot: number(),\n numTransactions: number(),\n numSlots: number(),\n samplePeriodSecs: number(),\n});\n\n/*\n * Expected JSON RPC response for \"getRecentPerformanceSamples\" message\n */\nconst GetRecentPerformanceSamplesRpcResult = jsonRpcResult(\n array(PerfSampleResult),\n);\n\n/**\n * Expected JSON RPC response for the \"getFeeCalculatorForBlockhash\" message\n */\nconst GetFeeCalculatorRpcResult = jsonRpcResultAndContext(\n nullable(\n pick({\n feeCalculator: pick({\n lamportsPerSignature: number(),\n }),\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"requestAirdrop\" message\n */\nconst RequestAirdropRpcResult = jsonRpcResult(string());\n\n/**\n * Expected JSON RPC response for the \"sendTransaction\" message\n */\nconst SendTransactionRpcResult = jsonRpcResult(string());\n\n/**\n * Information about the latest slot being processed by a node\n *\n * @typedef {Object} SlotInfo\n * @property {number} slot Currently processing slot\n * @property {number} parent Parent of the current slot\n * @property {number} root The root block of the current slot's fork\n */\nexport type SlotInfo = {\n slot: number;\n parent: number;\n root: number;\n};\n\n/**\n * Parsed account data\n *\n * @typedef {Object} ParsedAccountData\n * @property {string} program Name of the program that owns this account\n * @property {any} parsed Parsed account data\n * @property {number} space Space used by account data\n */\nexport type ParsedAccountData = {\n program: string;\n parsed: any;\n space: number;\n};\n\n/**\n * Stake Activation data\n *\n * @typedef {Object} StakeActivationData\n * @property {string} state: <string - the stake account's activation state, one of: active, inactive, activating, deactivating\n * @property {number} active: stake active during the epoch\n * @property {number} inactive: stake inactive during the epoch\n */\nexport type StakeActivationData = {\n state: 'active' | 'inactive' | 'activating' | 'deactivating';\n active: number;\n inactive: number;\n};\n\n/**\n * Information describing an account\n *\n * @typedef {Object} AccountInfo\n * @property {number} lamports Number of lamports assigned to the account\n * @property {PublicKey} owner Identifier of the program that owns the account\n * @property {T} data Optional data assigned to the account\n * @property {boolean} executable `true` if this account's data contains a loaded program\n */\nexport type AccountInfo<T> = {\n executable: boolean;\n owner: PublicKey;\n lamports: number;\n data: T;\n};\n\n/**\n * Account information identified by pubkey\n *\n * @typedef {Object} KeyedAccountInfo\n * @property {PublicKey} accountId\n * @property {AccountInfo<Buffer>} accountInfo\n */\nexport type KeyedAccountInfo = {\n accountId: PublicKey;\n accountInfo: AccountInfo<Buffer>;\n};\n\n/**\n * Callback function for account change notifications\n */\nexport type AccountChangeCallback = (\n accountInfo: AccountInfo<Buffer>,\n context: Context,\n) => void;\n\n/**\n * @internal\n */\ntype SubscriptionId = 'subscribing' | number;\n\n/**\n * @internal\n */\ntype AccountSubscriptionInfo = {\n publicKey: string; // PublicKey of the account as a base 58 string\n callback: AccountChangeCallback;\n commitment?: Commitment;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n};\n\n/**\n * Callback function for program account change notifications\n */\nexport type ProgramAccountChangeCallback = (\n keyedAccountInfo: KeyedAccountInfo,\n context: Context,\n) => void;\n\n/**\n * @internal\n */\ntype ProgramAccountSubscriptionInfo = {\n programId: string; // PublicKey of the program as a base 58 string\n callback: ProgramAccountChangeCallback;\n commitment?: Commitment;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n};\n\n/**\n * Callback function for slot change notifications\n */\nexport type SlotChangeCallback = (slotInfo: SlotInfo) => void;\n\n/**\n * @internal\n */\ntype SlotSubscriptionInfo = {\n callback: SlotChangeCallback;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n};\n\n/**\n * Callback function for signature status notifications\n */\nexport type SignatureResultCallback = (\n signatureResult: SignatureResult,\n context: Context,\n) => void;\n\n/**\n * Signature status notification with transaction result\n */\nexport type SignatureStatusNotification = {\n type: 'status';\n result: SignatureResult;\n};\n\n/**\n * Signature received notification\n */\nexport type SignatureReceivedNotification = {\n type: 'received';\n};\n\n/**\n * Callback function for signature notifications\n */\nexport type SignatureSubscriptionCallback = (\n notification: SignatureStatusNotification | SignatureReceivedNotification,\n context: Context,\n) => void;\n\n/**\n * Signature subscription options\n */\nexport type SignatureSubscriptionOptions = {\n commitment?: Commitment;\n enableReceivedNotification?: boolean;\n};\n\n/**\n * @internal\n */\ntype SignatureSubscriptionInfo = {\n signature: TransactionSignature; // TransactionSignature as a base 58 string\n callback: SignatureSubscriptionCallback;\n options?: SignatureSubscriptionOptions;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n};\n\n/**\n * Callback function for root change notifications\n */\nexport type RootChangeCallback = (root: number) => void;\n\n/**\n * @internal\n */\ntype RootSubscriptionInfo = {\n callback: RootChangeCallback;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n};\n\n/**\n * @internal\n */\nconst LogsResult = pick({\n err: TransactionErrorResult,\n logs: array(string()),\n signature: string(),\n});\n\n/**\n * Logs result.\n *\n * @typedef {Object} Logs.\n */\nexport type Logs = {\n err: TransactionError | null;\n logs: string[];\n signature: string;\n};\n\n/**\n * Expected JSON RPC response for the \"logsNotification\" message.\n */\nconst LogsNotificationResult = pick({\n result: notificationResultAndContext(LogsResult),\n subscription: number(),\n});\n\n/**\n * Filter for log subscriptions.\n */\nexport type LogsFilter = PublicKey | 'all' | 'allWithVotes';\n\n/**\n * Callback function for log notifications.\n */\nexport type LogsCallback = (logs: Logs, ctx: Context) => void;\n\n/**\n * @private\n */\ntype LogsSubscriptionInfo = {\n callback: LogsCallback;\n filter: LogsFilter;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n commitment?: Commitment;\n};\n\n/**\n * Signature result\n *\n * @typedef {Object} SignatureResult\n */\nexport type SignatureResult = {\n err: TransactionError | null;\n};\n\n/**\n * Transaction error\n *\n * @typedef {Object} TransactionError\n */\nexport type TransactionError = {};\n\n/**\n * Transaction confirmation status\n * <pre>\n * 'processed': Transaction landed in a block which has reached 1 confirmation by the connected node\n * 'confirmed': Transaction landed in a block which has reached 1 confirmation by the cluster\n * 'finalized': Transaction landed in a block which has been finalized by the cluster\n * </pre>\n */\nexport type TransactionConfirmationStatus =\n | 'processed'\n | 'confirmed'\n | 'finalized';\n\n/**\n * Signature status\n */\nexport type SignatureStatus = {\n /** when the transaction was processed */\n slot: number;\n /** the number of blocks that have been confirmed and voted on in the fork containing `slot` */\n confirmations: number | null;\n /** transaction error, if any */\n err: TransactionError | null;\n /** cluster confirmation status, if data available. Possible responses: `processed`, `confirmed`, `finalized` */\n confirmationStatus?: TransactionConfirmationStatus;\n};\n\n/**\n * A confirmed signature with its status\n *\n * @typedef {Object} ConfirmedSignatureInfo\n * @property {string} signature the transaction signature\n * @property {number} slot when the transaction was processed\n * @property {TransactionError | null} err error, if any\n * @property {string | null} memo memo associated with the transaction, if any\n * @property {number | null | undefined} blockTime The unix timestamp of when the transaction was processed\n */\nexport type ConfirmedSignatureInfo = {\n signature: string;\n slot: number;\n err: TransactionError | null;\n memo: string | null;\n blockTime?: number | null;\n};\n\n/**\n * A connection to a fullnode JSON RPC endpoint\n */\nexport class Connection {\n /** @internal */ _commitment?: Commitment;\n /** @internal */ _rpcEndpoint: string;\n /** @internal */ _rpcClient: RpcClient;\n /** @internal */ _rpcRequest: RpcRequest;\n /** @internal */ _rpcBatchRequest: RpcBatchRequest;\n /** @internal */ _rpcWebSocket: RpcWebSocketClient;\n /** @internal */ _rpcWebSocketConnected: boolean = false;\n /** @internal */ _rpcWebSocketHeartbeat: ReturnType<\n typeof setInterval\n > | null = null;\n /** @internal */ _rpcWebSocketIdleTimeout: ReturnType<\n typeof setTimeout\n > | null = null;\n\n /** @internal */ _disableBlockhashCaching: boolean = false;\n /** @internal */ _pollingBlockhash: boolean = false;\n /** @internal */ _blockhashInfo: {\n recentBlockhash: Blockhash | null;\n lastFetch: number;\n simulatedSignatures: Array<string>;\n transactionSignatures: Array<string>;\n };\n\n /** @internal */ _accountChangeSubscriptionCounter: number = 0;\n /** @internal */ _accountChangeSubscriptions: {\n [id: number]: AccountSubscriptionInfo;\n } = {};\n\n /** @internal */ _programAccountChangeSubscriptionCounter: number = 0;\n /** @internal */ _programAccountChangeSubscriptions: {\n [id: number]: ProgramAccountSubscriptionInfo;\n } = {};\n\n /** @internal */ _rootSubscriptionCounter: number = 0;\n /** @internal */ _rootSubscriptions: {\n [id: number]: RootSubscriptionInfo;\n } = {};\n\n /** @internal */ _signatureSubscriptionCounter: number = 0;\n /** @internal */ _signatureSubscriptions: {\n [id: number]: SignatureSubscriptionInfo;\n } = {};\n\n /** @internal */ _slotSubscriptionCounter: number = 0;\n /** @internal */ _slotSubscriptions: {\n [id: number]: SlotSubscriptionInfo;\n } = {};\n\n /** @internal */ _logsSubscriptionCounter: number = 0;\n /** @internal */ _logsSubscriptions: {\n [id: number]: LogsSubscriptionInfo;\n } = {};\n\n /**\n * Establish a JSON RPC connection\n *\n * @param endpoint URL to the fullnode JSON RPC endpoint\n * @param commitment optional default commitment level\n */\n constructor(endpoint: string, commitment?: Commitment) {\n this._rpcEndpoint = endpoint;\n\n let url = urlParse(endpoint);\n const useHttps = url.protocol === 'https:';\n\n this._rpcClient = createRpcClient(url.href, useHttps);\n this._rpcRequest = createRpcRequest(this._rpcClient);\n this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient);\n this._commitment = commitment;\n this._blockhashInfo = {\n recentBlockhash: null,\n lastFetch: 0,\n transactionSignatures: [],\n simulatedSignatures: [],\n };\n\n url.protocol = useHttps ? 'wss:' : 'ws:';\n url.host = '';\n // Only shift the port by +1 as a convention for ws(s) only if given endpoint\n // is explictly specifying the endpoint port (HTTP-based RPC), assuming\n // we're directly trying to connect to solana-validator's ws listening port.\n // When the endpoint omits the port, we're connecting to the protocol\n // default ports: http(80) or https(443) and it's assumed we're behind a reverse\n // proxy which manages WebSocket upgrade and backend port redirection.\n if (url.port !== null) {\n url.port = String(Number(url.port) + 1);\n }\n this._rpcWebSocket = new RpcWebSocketClient(urlFormat(url), {\n autoconnect: false,\n max_reconnects: Infinity,\n });\n this._rpcWebSocket.on('open', this._wsOnOpen.bind(this));\n this._rpcWebSocket.on('error', this._wsOnError.bind(this));\n this._rpcWebSocket.on('close', this._wsOnClose.bind(this));\n this._rpcWebSocket.on(\n 'accountNotification',\n this._wsOnAccountNotification.bind(this),\n );\n this._rpcWebSocket.on(\n 'programNotification',\n this._wsOnProgramAccountNotification.bind(this),\n );\n this._rpcWebSocket.on(\n 'slotNotification',\n this._wsOnSlotNotification.bind(this),\n );\n this._rpcWebSocket.on(\n 'signatureNotification',\n this._wsOnSignatureNotification.bind(this),\n );\n this._rpcWebSocket.on(\n 'rootNotification',\n this._wsOnRootNotification.bind(this),\n );\n this._rpcWebSocket.on(\n 'logsNotification',\n this._wsOnLogsNotification.bind(this),\n );\n }\n\n /**\n * The default commitment used for requests\n */\n get commitment(): Commitment | undefined {\n return this._commitment;\n }\n\n /**\n * Fetch the balance for the specified public key, return with context\n */\n async getBalanceAndContext(\n publicKey: PublicKey,\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<number>> {\n const args = this._buildArgs([publicKey.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getBalance', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(number()));\n if ('error' in res) {\n throw new Error(\n 'failed to get balance for ' +\n publicKey.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch the balance for the specified public key\n */\n async getBalance(\n publicKey: PublicKey,\n commitment?: Commitment,\n ): Promise<number> {\n return await this.getBalanceAndContext(publicKey, commitment)\n .then(x => x.value)\n .catch(e => {\n throw new Error(\n 'failed to get balance of account ' + publicKey.toBase58() + ': ' + e,\n );\n });\n }\n\n /**\n * Fetch the estimated production time of a block\n */\n async getBlockTime(slot: number): Promise<number | null> {\n const unsafeRes = await this._rpcRequest('getBlockTime', [slot]);\n const res = create(unsafeRes, jsonRpcResult(nullable(number())));\n if ('error' in res) {\n throw new Error(\n 'failed to get block time for slot ' + slot + ': ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch the lowest slot that the node has information about in its ledger.\n * This value may increase over time if the node is configured to purge older ledger data\n */\n async getMinimumLedgerSlot(): Promise<number> {\n const unsafeRes = await this._rpcRequest('minimumLedgerSlot', []);\n const res = create(unsafeRes, jsonRpcResult(number()));\n if ('error' in res) {\n throw new Error(\n 'failed to get minimum ledger slot: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch the slot of the lowest confirmed block that has not been purged from the ledger\n */\n async getFirstAvailableBlock(): Promise<number> {\n const unsafeRes = await this._rpcRequest('getFirstAvailableBlock', []);\n const res = create(unsafeRes, SlotRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get first available block: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch information about the current supply\n */\n async getSupply(\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<Supply>> {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getSupply', args);\n const res = create(unsafeRes, GetSupplyRpcResult);\n if ('error' in res) {\n throw new Error('failed to get supply: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current supply of a token mint\n */\n async getTokenSupply(\n tokenMintAddress: PublicKey,\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<TokenAmount>> {\n const args = this._buildArgs([tokenMintAddress.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getTokenSupply', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(TokenAmountResult));\n if ('error' in res) {\n throw new Error('failed to get token supply: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current balance of a token account\n */\n async getTokenAccountBalance(\n tokenAddress: PublicKey,\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<TokenAmount>> {\n const args = this._buildArgs([tokenAddress.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getTokenAccountBalance', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(TokenAmountResult));\n if ('error' in res) {\n throw new Error(\n 'failed to get token account balance: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch all the token accounts owned by the specified account\n *\n * @return {Promise<RpcResponseAndContext<Array<{pubkey: PublicKey, account: AccountInfo<Buffer>}>>>}\n */\n async getTokenAccountsByOwner(\n ownerAddress: PublicKey,\n filter: TokenAccountsFilter,\n commitment?: Commitment,\n ): Promise<\n RpcResponseAndContext<\n Array<{pubkey: PublicKey; account: AccountInfo<Buffer>}>\n >\n > {\n let _args: any[] = [ownerAddress.toBase58()];\n if ('mint' in filter) {\n _args.push({mint: filter.mint.toBase58()});\n } else {\n _args.push({programId: filter.programId.toBase58()});\n }\n\n const args = this._buildArgs(_args, commitment, 'base64');\n const unsafeRes = await this._rpcRequest('getTokenAccountsByOwner', args);\n const res = create(unsafeRes, GetTokenAccountsByOwner);\n if ('error' in res) {\n throw new Error(\n 'failed to get token accounts owned by account ' +\n ownerAddress.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch parsed token accounts owned by the specified account\n *\n * @return {Promise<RpcResponseAndContext<Array<{pubkey: PublicKey, account: AccountInfo<ParsedAccountData>}>>>}\n */\n async getParsedTokenAccountsByOwner(\n ownerAddress: PublicKey,\n filter: TokenAccountsFilter,\n commitment?: Commitment,\n ): Promise<\n RpcResponseAndContext<\n Array<{pubkey: PublicKey; account: AccountInfo<ParsedAccountData>}>\n >\n > {\n let _args: any[] = [ownerAddress.toBase58()];\n if ('mint' in filter) {\n _args.push({mint: filter.mint.toBase58()});\n } else {\n _args.push({programId: filter.programId.toBase58()});\n }\n\n const args = this._buildArgs(_args, commitment, 'jsonParsed');\n const unsafeRes = await this._rpcRequest('getTokenAccountsByOwner', args);\n const res = create(unsafeRes, GetParsedTokenAccountsByOwner);\n if ('error' in res) {\n throw new Error(\n 'failed to get token accounts owned by account ' +\n ownerAddress.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch the 20 largest accounts with their current balances\n */\n async getLargestAccounts(\n config?: GetLargestAccountsConfig,\n ): Promise<RpcResponseAndContext<Array<AccountBalancePair>>> {\n const arg = {\n ...config,\n commitment: (config && config.commitment) || this.commitment,\n };\n const args = arg.filter || arg.commitment ? [arg] : [];\n const unsafeRes = await this._rpcRequest('getLargestAccounts', args);\n const res = create(unsafeRes, GetLargestAccountsRpcResult);\n if ('error' in res) {\n throw new Error('failed to get largest accounts: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the 20 largest token accounts with their current balances\n * for a given mint.\n */\n async getTokenLargestAccounts(\n mintAddress: PublicKey,\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<Array<TokenAccountBalancePair>>> {\n const args = this._buildArgs([mintAddress.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getTokenLargestAccounts', args);\n const res = create(unsafeRes, GetTokenLargestAccountsResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get token largest accounts: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch all the account info for the specified public key, return with context\n */\n async getAccountInfoAndContext(\n publicKey: PublicKey,\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<AccountInfo<Buffer> | null>> {\n const args = this._buildArgs([publicKey.toBase58()], commitment, 'base64');\n const unsafeRes = await this._rpcRequest('getAccountInfo', args);\n const res = create(\n unsafeRes,\n jsonRpcResultAndContext(nullable(AccountInfoResult)),\n );\n if ('error' in res) {\n throw new Error(\n 'failed to get info about account ' +\n publicKey.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch parsed account info for the specified public key\n */\n async getParsedAccountInfo(\n publicKey: PublicKey,\n commitment?: Commitment,\n ): Promise<\n RpcResponseAndContext<AccountInfo<Buffer | ParsedAccountData> | null>\n > {\n const args = this._buildArgs(\n [publicKey.toBase58()],\n commitment,\n 'jsonParsed',\n );\n const unsafeRes = await this._rpcRequest('getAccountInfo', args);\n const res = create(\n unsafeRes,\n jsonRpcResultAndContext(nullable(ParsedAccountInfoResult)),\n );\n if ('error' in res) {\n throw new Error(\n 'failed to get info about account ' +\n publicKey.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch all the account info for the specified public key\n */\n async getAccountInfo(\n publicKey: PublicKey,\n commitment?: Commitment,\n ): Promise<AccountInfo<Buffer> | null> {\n try {\n const res = await this.getAccountInfoAndContext(publicKey, commitment);\n return res.value;\n } catch (e) {\n throw new Error(\n 'failed to get info about account ' + publicKey.toBase58() + ': ' + e,\n );\n }\n }\n\n /**\n * Returns epoch activation information for a stake account that has been delegated\n */\n async getStakeActivation(\n publicKey: PublicKey,\n commitment?: Commitment,\n epoch?: number,\n ): Promise<StakeActivationData> {\n const args = this._buildArgs(\n [publicKey.toBase58()],\n commitment,\n undefined,\n epoch !== undefined ? {epoch} : undefined,\n );\n\n const unsafeRes = await this._rpcRequest('getStakeActivation', args);\n const res = create(unsafeRes, jsonRpcResult(StakeActivationResult));\n if ('error' in res) {\n throw new Error(\n `failed to get Stake Activation ${publicKey.toBase58()}: ${\n res.error.message\n }`,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch all the accounts owned by the specified program id\n *\n * @return {Promise<Array<{pubkey: PublicKey, account: AccountInfo<Buffer>}>>}\n */\n async getProgramAccounts(\n programId: PublicKey,\n commitment?: Commitment,\n ): Promise<Array<{pubkey: PublicKey; account: AccountInfo<Buffer>}>> {\n const args = this._buildArgs([programId.toBase58()], commitment, 'base64');\n const unsafeRes = await this._rpcRequest('getProgramAccounts', args);\n const res = create(unsafeRes, jsonRpcResult(array(KeyedAccountInfoResult)));\n if ('error' in res) {\n throw new Error(\n 'failed to get accounts owned by program ' +\n programId.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch and parse all the accounts owned by the specified program id\n *\n * @return {Promise<Array<{pubkey: PublicKey, account: AccountInfo<Buffer | ParsedAccountData>}>>}\n */\n async getParsedProgramAccounts(\n programId: PublicKey,\n commitment?: Commitment,\n ): Promise<\n Array<{\n pubkey: PublicKey;\n account: AccountInfo<Buffer | ParsedAccountData>;\n }>\n > {\n const args = this._buildArgs(\n [programId.toBase58()],\n commitment,\n 'jsonParsed',\n );\n const unsafeRes = await this._rpcRequest('getProgramAccounts', args);\n const res = create(\n unsafeRes,\n jsonRpcResult(array(KeyedParsedAccountInfoResult)),\n );\n if ('error' in res) {\n throw new Error(\n 'failed to get accounts owned by program ' +\n programId.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Confirm the transaction identified by the specified signature.\n */\n async confirmTransaction(\n signature: TransactionSignature,\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<SignatureResult>> {\n let decodedSignature;\n try {\n decodedSignature = bs58.decode(signature);\n } catch (err) {\n throw new Error('signature must be base58 encoded: ' + signature);\n }\n\n assert(decodedSignature.length === 64, 'signature has invalid length');\n\n const start = Date.now();\n const subscriptionCommitment = commitment || this.commitment;\n\n let subscriptionId;\n let response: RpcResponseAndContext<SignatureResult> | null = null;\n const confirmPromise = new Promise((resolve, reject) => {\n try {\n subscriptionId = this.onSignature(\n signature,\n (result: SignatureResult, context: Context) => {\n subscriptionId = undefined;\n response = {\n context,\n value: result,\n };\n resolve(null);\n },\n subscriptionCommitment,\n );\n } catch (err) {\n reject(err);\n }\n });\n\n let timeoutMs = 60 * 1000;\n switch (subscriptionCommitment) {\n case 'processed':\n case 'recent':\n case 'single':\n case 'confirmed':\n case 'singleGossip': {\n timeoutMs = 30 * 1000;\n break;\n }\n // exhaust enums to ensure full coverage\n case 'finalized':\n case 'max':\n case 'root':\n }\n\n try {\n await promiseTimeout(confirmPromise, timeoutMs);\n } finally {\n if (subscriptionId) {\n this.removeSignatureListener(subscriptionId);\n }\n }\n\n if (response === null) {\n const duration = (Date.now() - start) / 1000;\n throw new Error(\n `Transaction was not confirmed in ${duration.toFixed(\n 2,\n )} seconds. It is unknown if it succeeded or failed. Check signature ${signature} using the Solana Explorer or CLI tools.`,\n );\n }\n\n return response;\n }\n\n /**\n * Return the list of nodes that are currently participating in the cluster\n */\n async getClusterNodes(): Promise<Array<ContactInfo>> {\n const unsafeRes = await this._rpcRequest('getClusterNodes', []);\n const res = create(unsafeRes, jsonRpcResult(array(ContactInfoResult)));\n if ('error' in res) {\n throw new Error('failed to get cluster nodes: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Return the list of nodes that are currently participating in the cluster\n */\n async getVoteAccounts(commitment?: Commitment): Promise<VoteAccountStatus> {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getVoteAccounts', args);\n const res = create(unsafeRes, GetVoteAccounts);\n if ('error' in res) {\n throw new Error('failed to get vote accounts: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current slot that the node is processing\n */\n async getSlot(commitment?: Commitment): Promise<number> {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getSlot', args);\n const res = create(unsafeRes, jsonRpcResult(number()));\n if ('error' in res) {\n throw new Error('failed to get slot: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current slot leader of the cluster\n */\n async getSlotLeader(commitment?: Commitment): Promise<string> {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getSlotLeader', args);\n const res = create(unsafeRes, jsonRpcResult(string()));\n if ('error' in res) {\n throw new Error('failed to get slot leader: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current status of a signature\n */\n async getSignatureStatus(\n signature: TransactionSignature,\n config?: SignatureStatusConfig,\n ): Promise<RpcResponseAndContext<SignatureStatus | null>> {\n const {context, value: values} = await this.getSignatureStatuses(\n [signature],\n config,\n );\n assert(values.length === 1);\n const value = values[0];\n return {context, value};\n }\n\n /**\n * Fetch the current statuses of a batch of signatures\n */\n async getSignatureStatuses(\n signatures: Array<TransactionSignature>,\n config?: SignatureStatusConfig,\n ): Promise<RpcResponseAndContext<Array<SignatureStatus | null>>> {\n const params: any[] = [signatures];\n if (config) {\n params.push(config);\n }\n const unsafeRes = await this._rpcRequest('getSignatureStatuses', params);\n const res = create(unsafeRes, GetSignatureStatusesRpcResult);\n if ('error' in res) {\n throw new Error('failed to get signature status: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current transaction count of the cluster\n */\n async getTransactionCount(commitment?: Commitment): Promise<number> {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getTransactionCount', args);\n const res = create(unsafeRes, jsonRpcResult(number()));\n if ('error' in res) {\n throw new Error('failed to get transaction count: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current total currency supply of the cluster in lamports\n */\n async getTotalSupply(commitment?: Commitment): Promise<number> {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getTotalSupply', args);\n const res = create(unsafeRes, jsonRpcResult(number()));\n if ('error' in res) {\n throw new Error('failed to get total supply: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the cluster InflationGovernor parameters\n */\n async getInflationGovernor(\n commitment?: Commitment,\n ): Promise<InflationGovernor> {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getInflationGovernor', args);\n const res = create(unsafeRes, GetInflationGovernorRpcResult);\n if ('error' in res) {\n throw new Error('failed to get inflation: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the Epoch Info parameters\n */\n async getEpochInfo(commitment?: Commitment): Promise<EpochInfo> {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getEpochInfo', args);\n const res = create(unsafeRes, GetEpochInfoRpcResult);\n if ('error' in res) {\n throw new Error('failed to get epoch info: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the Epoch Schedule parameters\n */\n async getEpochSchedule(): Promise<EpochSchedule> {\n const unsafeRes = await this._rpcRequest('getEpochSchedule', []);\n const res = create(unsafeRes, GetEpochScheduleRpcResult);\n if ('error' in res) {\n throw new Error('failed to get epoch schedule: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the leader schedule for the current epoch\n * @return {Promise<RpcResponseAndContext<LeaderSchedule>>}\n */\n async getLeaderSchedule(): Promise<LeaderSchedule> {\n const unsafeRes = await this._rpcRequest('getLeaderSchedule', []);\n const res = create(unsafeRes, GetLeaderScheduleRpcResult);\n if ('error' in res) {\n throw new Error('failed to get leader schedule: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the minimum balance needed to exempt an account of `dataLength`\n * size from rent\n */\n async getMinimumBalanceForRentExemption(\n dataLength: number,\n commitment?: Commitment,\n ): Promise<number> {\n const args = this._buildArgs([dataLength], commitment);\n const unsafeRes = await this._rpcRequest(\n 'getMinimumBalanceForRentExemption',\n args,\n );\n const res = create(unsafeRes, GetMinimumBalanceForRentExemptionRpcResult);\n if ('error' in res) {\n console.warn('Unable to fetch minimum balance for rent exemption');\n return 0;\n }\n return res.result;\n }\n\n /**\n * Fetch a recent blockhash from the cluster, return with context\n * @return {Promise<RpcResponseAndContext<{blockhash: Blockhash, feeCalculator: FeeCalculator}>>}\n */\n async getRecentBlockhashAndContext(\n commitment?: Commitment,\n ): Promise<\n RpcResponseAndContext<{blockhash: Blockhash; feeCalculator: FeeCalculator}>\n > {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getRecentBlockhash', args);\n const res = create(unsafeRes, GetRecentBlockhashAndContextRpcResult);\n if ('error' in res) {\n throw new Error('failed to get recent blockhash: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch recent performance samples\n * @return {Promise<Array<PerfSample>>}\n */\n async getRecentPerformanceSamples(\n limit?: number,\n ): Promise<Array<PerfSample>> {\n const args = this._buildArgs(limit ? [limit] : []);\n const unsafeRes = await this._rpcRequest(\n 'getRecentPerformanceSamples',\n args,\n );\n const res = create(unsafeRes, GetRecentPerformanceSamplesRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get recent performance samples: ' + res.error.message,\n );\n }\n\n return res.result;\n }\n\n /**\n * Fetch the fee calculator for a recent blockhash from the cluster, return with context\n */\n async getFeeCalculatorForBlockhash(\n blockhash: Blockhash,\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<FeeCalculator | null>> {\n const args = this._buildArgs([blockhash], commitment);\n const unsafeRes = await this._rpcRequest(\n 'getFeeCalculatorForBlockhash',\n args,\n );\n\n const res = create(unsafeRes, GetFeeCalculatorRpcResult);\n if ('error' in res) {\n throw new Error('failed to get fee calculator: ' + res.error.message);\n }\n const {context, value} = res.result;\n return {\n context,\n value: value !== null ? value.feeCalculator : null,\n };\n }\n\n /**\n * Fetch a recent blockhash from the cluster\n * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}\n */\n async getRecentBlockhash(\n commitment?: Commitment,\n ): Promise<{blockhash: Blockhash; feeCalculator: FeeCalculator}> {\n try {\n const res = await this.getRecentBlockhashAndContext(commitment);\n return res.value;\n } catch (e) {\n throw new Error('failed to get recent blockhash: ' + e);\n }\n }\n\n /**\n * Fetch the node version\n */\n async getVersion(): Promise<Version> {\n const unsafeRes = await this._rpcRequest('getVersion', []);\n const res = create(unsafeRes, jsonRpcResult(VersionResult));\n if ('error' in res) {\n throw new Error('failed to get version: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch a list of Transactions and transaction statuses from the cluster\n * for a confirmed block\n */\n async getConfirmedBlock(slot: number): Promise<ConfirmedBlock> {\n const unsafeRes = await this._rpcRequest('getConfirmedBlock', [slot]);\n const res = create(unsafeRes, GetConfirmedBlockRpcResult);\n if ('error' in res) {\n throw new Error('failed to get confirmed block: ' + res.error.message);\n }\n const result = res.result;\n if (!result) {\n throw new Error('Confirmed block ' + slot + ' not found');\n }\n return result;\n }\n\n /**\n * Fetch a transaction details for a confirmed transaction\n */\n async getConfirmedTransaction(\n signature: TransactionSignature,\n ): Promise<ConfirmedTransaction | null> {\n const unsafeRes = await this._rpcRequest('getConfirmedTransaction', [\n signature,\n ]);\n const res = create(unsafeRes, GetConfirmedTransactionRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get confirmed transaction: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch parsed transaction details for a confirmed transaction\n */\n async getParsedConfirmedTransaction(\n signature: TransactionSignature,\n ): Promise<ParsedConfirmedTransaction | null> {\n const unsafeRes = await this._rpcRequest('getConfirmedTransaction', [\n signature,\n 'jsonParsed',\n ]);\n const res = create(unsafeRes, GetParsedConfirmedTransactionRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get confirmed transaction: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch parsed transaction details for a batch of confirmed transactions\n */\n async getParsedConfirmedTransactions(\n signatures: TransactionSignature[],\n ): Promise<(ParsedConfirmedTransaction | null)[]> {\n const batch = signatures.map(signature => {\n return {\n methodName: 'getConfirmedTransaction',\n args: [signature, 'jsonParsed'],\n };\n });\n\n const unsafeRes = await this._rpcBatchRequest(batch);\n const res = unsafeRes.map((unsafeRes: any) => {\n const res = create(unsafeRes, GetParsedConfirmedTransactionRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get confirmed transactions: ' + res.error.message,\n );\n }\n return res.result;\n });\n\n return res;\n }\n\n /**\n * Fetch a list of all the confirmed signatures for transactions involving an address\n * within a specified slot range. Max range allowed is 10,000 slots.\n *\n * @param address queried address\n * @param startSlot start slot, inclusive\n * @param endSlot end slot, inclusive\n */\n async getConfirmedSignaturesForAddress(\n address: PublicKey,\n startSlot: number,\n endSlot: number,\n ): Promise<Array<TransactionSignature>> {\n const unsafeRes = await this._rpcRequest(\n 'getConfirmedSignaturesForAddress',\n [address.toBase58(), startSlot, endSlot],\n );\n const res = create(unsafeRes, GetConfirmedSignaturesForAddressRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get confirmed signatures for address: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Returns confirmed signatures for transactions involving an\n * address backwards in time from the provided signature or most recent confirmed block\n *\n *\n * @param address queried address\n * @param options\n */\n async getConfirmedSignaturesForAddress2(\n address: PublicKey,\n options?: ConfirmedSignaturesForAddress2Options,\n ): Promise<Array<ConfirmedSignatureInfo>> {\n const unsafeRes = await this._rpcRequest(\n 'getConfirmedSignaturesForAddress2',\n [address.toBase58(), options],\n );\n const res = create(unsafeRes, GetConfirmedSignaturesForAddress2RpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get confirmed signatures for address: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch the contents of a Nonce account from the cluster, return with context\n */\n async getNonceAndContext(\n nonceAccount: PublicKey,\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<NonceAccount | null>> {\n const {context, value: accountInfo} = await this.getAccountInfoAndContext(\n nonceAccount,\n commitment,\n );\n\n let value = null;\n if (accountInfo !== null) {\n value = NonceAccount.fromAccountData(accountInfo.data);\n }\n\n return {\n context,\n value,\n };\n }\n\n /**\n * Fetch the contents of a Nonce account from the cluster\n */\n async getNonce(\n nonceAccount: PublicKey,\n commitment?: Commitment,\n ): Promise<NonceAccount | null> {\n return await this.getNonceAndContext(nonceAccount, commitment)\n .then(x => x.value)\n .catch(e => {\n throw new Error(\n 'failed to get nonce for account ' +\n nonceAccount.toBase58() +\n ': ' +\n e,\n );\n });\n }\n\n /**\n * Request an allocation of lamports to the specified account\n */\n async requestAirdrop(\n to: PublicKey,\n amount: number,\n ): Promise<TransactionSignature> {\n const unsafeRes = await this._rpcRequest('requestAirdrop', [\n to.toBase58(),\n amount,\n ]);\n const res = create(unsafeRes, RequestAirdropRpcResult);\n if ('error' in res) {\n throw new Error(\n 'airdrop to ' + to.toBase58() + ' failed: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * @internal\n */\n async _recentBlockhash(disableCache: boolean): Promise<Blockhash> {\n if (!disableCache) {\n // Wait for polling to finish\n while (this._pollingBlockhash) {\n await sleep(100);\n }\n const timeSinceFetch = Date.now() - this._blockhashInfo.lastFetch;\n const expired = timeSinceFetch >= BLOCKHASH_CACHE_TIMEOUT_MS;\n if (this._blockhashInfo.recentBlockhash !== null && !expired) {\n return this._blockhashInfo.recentBlockhash;\n }\n }\n\n return await this._pollNewBlockhash();\n }\n\n /**\n * @internal\n */\n async _pollNewBlockhash(): Promise<Blockhash> {\n this._pollingBlockhash = true;\n try {\n const startTime = Date.now();\n for (let i = 0; i < 50; i++) {\n const {blockhash} = await this.getRecentBlockhash('finalized');\n\n if (this._blockhashInfo.recentBlockhash != blockhash) {\n this._blockhashInfo = {\n recentBlockhash: blockhash,\n lastFetch: Date.now(),\n transactionSignatures: [],\n simulatedSignatures: [],\n };\n return blockhash;\n }\n\n // Sleep for approximately half a slot\n await sleep(MS_PER_SLOT / 2);\n }\n\n throw new Error(\n `Unable to obtain a new blockhash after ${Date.now() - startTime}ms`,\n );\n } finally {\n this._pollingBlockhash = false;\n }\n }\n\n /**\n * Simulate a transaction\n */\n async simulateTransaction(\n transaction: Transaction,\n signers?: Array<Account>,\n ): Promise<RpcResponseAndContext<SimulatedTransactionResponse>> {\n if (transaction.nonceInfo && signers) {\n transaction.sign(...signers);\n } else {\n let disableCache = this._disableBlockhashCaching;\n for (;;) {\n transaction.recentBlockhash = await this._recentBlockhash(disableCache);\n\n if (!signers) break;\n\n transaction.sign(...signers);\n if (!transaction.signature) {\n throw new Error('!signature'); // should never happen\n }\n\n // If the signature of this transaction has not been seen before with the\n // current recentBlockhash, all done.\n const signature = transaction.signature.toString('base64');\n if (\n !this._blockhashInfo.simulatedSignatures.includes(signature) &&\n !this._blockhashInfo.transactionSignatures.includes(signature)\n ) {\n this._blockhashInfo.simulatedSignatures.push(signature);\n break;\n } else {\n disableCache = true;\n }\n }\n }\n\n const signData = transaction.serializeMessage();\n const wireTransaction = transaction._serialize(signData);\n const encodedTransaction = wireTransaction.toString('base64');\n const config: any = {\n encoding: 'base64',\n commitment: this.commitment,\n };\n\n if (signers) {\n config.sigVerify = true;\n }\n\n const args = [encodedTransaction, config];\n const unsafeRes = await this._rpcRequest('simulateTransaction', args);\n const res = create(unsafeRes, SimulatedTransactionResponseStruct);\n if ('error' in res) {\n throw new Error('failed to simulate transaction: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Sign and send a transaction\n */\n async sendTransaction(\n transaction: Transaction,\n signers: Array<Account>,\n options?: SendOptions,\n ): Promise<TransactionSignature> {\n if (transaction.nonceInfo) {\n transaction.sign(...signers);\n } else {\n let disableCache = this._disableBlockhashCaching;\n for (;;) {\n transaction.recentBlockhash = await this._recentBlockhash(disableCache);\n transaction.sign(...signers);\n if (!transaction.signature) {\n throw new Error('!signature'); // should never happen\n }\n\n // If the signature of this transaction has not been seen before with the\n // current recentBlockhash, all done.\n const signature = transaction.signature.toString('base64');\n if (!this._blockhashInfo.transactionSignatures.includes(signature)) {\n this._blockhashInfo.transactionSignatures.push(signature);\n break;\n } else {\n disableCache = true;\n }\n }\n }\n\n const wireTransaction = transaction.serialize();\n return await this.sendRawTransaction(wireTransaction, options);\n }\n\n /**\n * Send a transaction that has already been signed and serialized into the\n * wire format\n */\n async sendRawTransaction(\n rawTransaction: Buffer | Uint8Array | Array<number>,\n options?: SendOptions,\n ): Promise<TransactionSignature> {\n const encodedTransaction = toBuffer(rawTransaction).toString('base64');\n const result = await this.sendEncodedTransaction(\n encodedTransaction,\n options,\n );\n return result;\n }\n\n /**\n * Send a transaction that has already been signed, serialized into the\n * wire format, and encoded as a base64 string\n */\n async sendEncodedTransaction(\n encodedTransaction: string,\n options?: SendOptions,\n ): Promise<TransactionSignature> {\n const config: any = {encoding: 'base64'};\n const skipPreflight = options && options.skipPreflight;\n const preflightCommitment =\n (options && options.preflightCommitment) || this.commitment;\n\n if (skipPreflight) {\n config.skipPreflight = skipPreflight;\n }\n if (preflightCommitment) {\n config.preflightCommitment = preflightCommitment;\n }\n\n const args = [encodedTransaction, config];\n const unsafeRes = await this._rpcRequest('sendTransaction', args);\n const res = create(unsafeRes, SendTransactionRpcResult);\n if ('error' in res) {\n if ('data' in res.error) {\n const logs = res.error.data.logs;\n if (logs && Array.isArray(logs)) {\n const traceIndent = '\\n ';\n const logTrace = traceIndent + logs.join(traceIndent);\n console.error(res.error.message, logTrace);\n }\n }\n throw new Error('failed to send transaction: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * @internal\n */\n _wsOnOpen() {\n this._rpcWebSocketConnected = true;\n this._rpcWebSocketHeartbeat = setInterval(() => {\n // Ping server every 5s to prevent idle timeouts\n this._rpcWebSocket.notify('ping').catch(() => {});\n }, 5000);\n this._updateSubscriptions();\n }\n\n /**\n * @internal\n */\n _wsOnError(err: Error) {\n console.error('ws error:', err.message);\n }\n\n /**\n * @internal\n */\n _wsOnClose(code: number) {\n if (this._rpcWebSocketHeartbeat) {\n clearInterval(this._rpcWebSocketHeartbeat);\n this._rpcWebSocketHeartbeat = null;\n }\n\n if (code === 1000) {\n // explicit close, check if any subscriptions have been made since close\n this._updateSubscriptions();\n return;\n }\n\n // implicit close, prepare subscriptions for auto-reconnect\n this._resetSubscriptions();\n }\n\n /**\n * @internal\n */\n async _subscribe(\n sub: {subscriptionId: SubscriptionId | null},\n rpcMethod: string,\n rpcArgs: IWSRequestParams,\n ) {\n if (sub.subscriptionId == null) {\n sub.subscriptionId = 'subscribing';\n try {\n const id = await this._rpcWebSocket.call(rpcMethod, rpcArgs);\n if (typeof id === 'number' && sub.subscriptionId === 'subscribing') {\n // eslint-disable-next-line require-atomic-updates\n sub.subscriptionId = id;\n }\n } catch (err) {\n if (sub.subscriptionId === 'subscribing') {\n // eslint-disable-next-line require-atomic-updates\n sub.subscriptionId = null;\n }\n console.error(`${rpcMethod} error for argument`, rpcArgs, err.message);\n }\n }\n }\n\n /**\n * @internal\n */\n async _unsubscribe(\n sub: {subscriptionId: SubscriptionId | null},\n rpcMethod: string,\n ) {\n const subscriptionId = sub.subscriptionId;\n if (subscriptionId != null && typeof subscriptionId != 'string') {\n const unsubscribeId: number = subscriptionId;\n try {\n await this._rpcWebSocket.call(rpcMethod, [unsubscribeId]);\n } catch (err) {\n console.error(`${rpcMethod} error:`, err.message);\n }\n }\n }\n\n /**\n * @internal\n */\n _resetSubscriptions() {\n Object.values(this._accountChangeSubscriptions).forEach(\n s => (s.subscriptionId = null),\n );\n Object.values(this._programAccountChangeSubscriptions).forEach(\n s => (s.subscriptionId = null),\n );\n Object.values(this._signatureSubscriptions).forEach(\n s => (s.subscriptionId = null),\n );\n Object.values(this._slotSubscriptions).forEach(\n s => (s.subscriptionId = null),\n );\n Object.values(this._rootSubscriptions).forEach(\n s => (s.subscriptionId = null),\n );\n }\n\n /**\n * @internal\n */\n _updateSubscriptions() {\n const accountKeys = Object.keys(this._accountChangeSubscriptions).map(\n Number,\n );\n const programKeys = Object.keys(\n this._programAccountChangeSubscriptions,\n ).map(Number);\n const slotKeys = Object.keys(this._slotSubscriptions).map(Number);\n const signatureKeys = Object.keys(this._signatureSubscriptions).map(Number);\n const rootKeys = Object.keys(this._rootSubscriptions).map(Number);\n const logsKeys = Object.keys(this._logsSubscriptions).map(Number);\n if (\n accountKeys.length === 0 &&\n programKeys.length === 0 &&\n slotKeys.length === 0 &&\n signatureKeys.length === 0 &&\n rootKeys.length === 0 &&\n logsKeys.length === 0\n ) {\n if (this._rpcWebSocketConnected) {\n this._rpcWebSocketConnected = false;\n this._rpcWebSocketIdleTimeout = setTimeout(() => {\n this._rpcWebSocketIdleTimeout = null;\n this._rpcWebSocket.close();\n }, 500);\n }\n return;\n }\n\n if (this._rpcWebSocketIdleTimeout !== null) {\n clearTimeout(this._rpcWebSocketIdleTimeout);\n this._rpcWebSocketIdleTimeout = null;\n this._rpcWebSocketConnected = true;\n }\n\n if (!this._rpcWebSocketConnected) {\n this._rpcWebSocket.connect();\n return;\n }\n\n for (let id of accountKeys) {\n const sub = this._accountChangeSubscriptions[id];\n this._subscribe(\n sub,\n 'accountSubscribe',\n this._buildArgs([sub.publicKey], sub.commitment, 'base64'),\n );\n }\n\n for (let id of programKeys) {\n const sub = this._programAccountChangeSubscriptions[id];\n this._subscribe(\n sub,\n 'programSubscribe',\n this._buildArgs([sub.programId], sub.commitment, 'base64'),\n );\n }\n\n for (let id of slotKeys) {\n const sub = this._slotSubscriptions[id];\n this._subscribe(sub, 'slotSubscribe', []);\n }\n\n for (let id of signatureKeys) {\n const sub = this._signatureSubscriptions[id];\n const args: any[] = [sub.signature];\n if (sub.options) args.push(sub.options);\n this._subscribe(sub, 'signatureSubscribe', args);\n }\n\n for (let id of rootKeys) {\n const sub = this._rootSubscriptions[id];\n this._subscribe(sub, 'rootSubscribe', []);\n }\n\n for (let id of logsKeys) {\n const sub = this._logsSubscriptions[id];\n let filter;\n if (typeof sub.filter === 'object') {\n filter = {mentions: [sub.filter.toString()]};\n } else {\n filter = sub.filter;\n }\n this._subscribe(\n sub,\n 'logsSubscribe',\n this._buildArgs([filter], sub.commitment),\n );\n }\n }\n\n /**\n * @internal\n */\n _wsOnAccountNotification(notification: object) {\n const res = create(notification, AccountNotificationResult);\n for (const sub of Object.values(this._accountChangeSubscriptions)) {\n if (sub.subscriptionId === res.subscription) {\n sub.callback(res.result.value, res.result.context);\n return;\n }\n }\n }\n\n /**\n * Register a callback to be invoked whenever the specified account changes\n *\n * @param publicKey Public key of the account to monitor\n * @param callback Function to invoke whenever the account is changed\n * @param commitment Specify the commitment level account changes must reach before notification\n * @return subscription id\n */\n onAccountChange(\n publicKey: PublicKey,\n callback: AccountChangeCallback,\n commitment?: Commitment,\n ): number {\n const id = ++this._accountChangeSubscriptionCounter;\n this._accountChangeSubscriptions[id] = {\n publicKey: publicKey.toBase58(),\n callback,\n commitment,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister an account notification callback\n *\n * @param id subscription id to deregister\n */\n async removeAccountChangeListener(id: number): Promise<void> {\n if (this._accountChangeSubscriptions[id]) {\n const subInfo = this._accountChangeSubscriptions[id];\n delete this._accountChangeSubscriptions[id];\n await this._unsubscribe(subInfo, 'accountUnsubscribe');\n this._updateSubscriptions();\n } else {\n throw new Error(`Unknown account change id: ${id}`);\n }\n }\n\n /**\n * @internal\n */\n _wsOnProgramAccountNotification(notification: Object) {\n const res = create(notification, ProgramAccountNotificationResult);\n for (const sub of Object.values(this._programAccountChangeSubscriptions)) {\n if (sub.subscriptionId === res.subscription) {\n const {value, context} = res.result;\n sub.callback(\n {\n accountId: value.pubkey,\n accountInfo: value.account,\n },\n context,\n );\n return;\n }\n }\n }\n\n /**\n * Register a callback to be invoked whenever accounts owned by the\n * specified program change\n *\n * @param programId Public key of the program to monitor\n * @param callback Function to invoke whenever the account is changed\n * @param commitment Specify the commitment level account changes must reach before notification\n * @return subscription id\n */\n onProgramAccountChange(\n programId: PublicKey,\n callback: ProgramAccountChangeCallback,\n commitment?: Commitment,\n ): number {\n const id = ++this._programAccountChangeSubscriptionCounter;\n this._programAccountChangeSubscriptions[id] = {\n programId: programId.toBase58(),\n callback,\n commitment,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister an account notification callback\n *\n * @param id subscription id to deregister\n */\n async removeProgramAccountChangeListener(id: number): Promise<void> {\n if (this._programAccountChangeSubscriptions[id]) {\n const subInfo = this._programAccountChangeSubscriptions[id];\n delete this._programAccountChangeSubscriptions[id];\n await this._unsubscribe(subInfo, 'programUnsubscribe');\n this._updateSubscriptions();\n } else {\n throw new Error(`Unknown program account change id: ${id}`);\n }\n }\n\n /**\n * Registers a callback to be invoked whenever logs are emitted.\n */\n onLogs(\n filter: LogsFilter,\n callback: LogsCallback,\n commitment?: Commitment,\n ): number {\n const id = ++this._logsSubscriptionCounter;\n this._logsSubscriptions[id] = {\n filter,\n callback,\n commitment,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister a logs callback.\n *\n * @param id subscription id to deregister.\n */\n async removeOnLogsListener(id: number): Promise<void> {\n if (!this._logsSubscriptions[id]) {\n throw new Error(`Unknown logs id: ${id}`);\n }\n const subInfo = this._logsSubscriptions[id];\n delete this._logsSubscriptions[id];\n await this._unsubscribe(subInfo, 'logsUnsubscribe');\n this._updateSubscriptions();\n }\n\n /**\n * @internal\n */\n _wsOnLogsNotification(notification: Object) {\n const res = create(notification, LogsNotificationResult);\n const keys = Object.keys(this._logsSubscriptions).map(Number);\n for (let id of keys) {\n const sub = this._logsSubscriptions[id];\n if (sub.subscriptionId === res.subscription) {\n sub.callback(res.result.value, res.result.context);\n return;\n }\n }\n }\n\n /**\n * @internal\n */\n _wsOnSlotNotification(notification: Object) {\n const res = create(notification, SlotNotificationResult);\n for (const sub of Object.values(this._slotSubscriptions)) {\n if (sub.subscriptionId === res.subscription) {\n sub.callback(res.result);\n return;\n }\n }\n }\n\n /**\n * Register a callback to be invoked upon slot changes\n *\n * @param callback Function to invoke whenever the slot changes\n * @return subscription id\n */\n onSlotChange(callback: SlotChangeCallback): number {\n const id = ++this._slotSubscriptionCounter;\n this._slotSubscriptions[id] = {\n callback,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister a slot notification callback\n *\n * @param id subscription id to deregister\n */\n async removeSlotChangeListener(id: number): Promise<void> {\n if (this._slotSubscriptions[id]) {\n const subInfo = this._slotSubscriptions[id];\n delete this._slotSubscriptions[id];\n await this._unsubscribe(subInfo, 'slotUnsubscribe');\n this._updateSubscriptions();\n } else {\n throw new Error(`Unknown slot change id: ${id}`);\n }\n }\n\n /**\n * @internal\n */\n _buildArgs(\n args: Array<any>,\n override?: Commitment,\n encoding?: 'jsonParsed' | 'base64',\n extra?: any,\n ): Array<any> {\n const commitment = override || this._commitment;\n if (commitment || encoding || extra) {\n let options: any = {};\n if (encoding) {\n options.encoding = encoding;\n }\n if (commitment) {\n options.commitment = commitment;\n }\n if (extra) {\n options = Object.assign(options, extra);\n }\n args.push(options);\n }\n return args;\n }\n\n /**\n * @internal\n */\n _wsOnSignatureNotification(notification: Object) {\n const res = create(notification, SignatureNotificationResult);\n for (const [id, sub] of Object.entries(this._signatureSubscriptions)) {\n if (sub.subscriptionId === res.subscription) {\n if (res.result.value === 'receivedSignature') {\n sub.callback(\n {\n type: 'received',\n },\n res.result.context,\n );\n } else {\n // Signatures subscriptions are auto-removed by the RPC service so\n // no need to explicitly send an unsubscribe message\n delete this._signatureSubscriptions[Number(id)];\n this._updateSubscriptions();\n sub.callback(\n {\n type: 'status',\n result: res.result.value,\n },\n res.result.context,\n );\n }\n return;\n }\n }\n }\n\n /**\n * Register a callback to be invoked upon signature updates\n *\n * @param signature Transaction signature string in base 58\n * @param callback Function to invoke on signature notifications\n * @param commitment Specify the commitment level signature must reach before notification\n * @return subscription id\n */\n onSignature(\n signature: TransactionSignature,\n callback: SignatureResultCallback,\n commitment?: Commitment,\n ): number {\n const id = ++this._signatureSubscriptionCounter;\n this._signatureSubscriptions[id] = {\n signature,\n callback: (notification, context) => {\n if (notification.type === 'status') {\n callback(notification.result, context);\n }\n },\n options: {commitment},\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Register a callback to be invoked when a transaction is\n * received and/or processed.\n *\n * @param signature Transaction signature string in base 58\n * @param callback Function to invoke on signature notifications\n * @param options Enable received notifications and set the commitment\n * level that signature must reach before notification\n * @return subscription id\n */\n onSignatureWithOptions(\n signature: TransactionSignature,\n callback: SignatureSubscriptionCallback,\n options?: SignatureSubscriptionOptions,\n ): number {\n const id = ++this._signatureSubscriptionCounter;\n this._signatureSubscriptions[id] = {\n signature,\n callback,\n options,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister a signature notification callback\n *\n * @param id subscription id to deregister\n */\n async removeSignatureListener(id: number): Promise<void> {\n if (this._signatureSubscriptions[id]) {\n const subInfo = this._signatureSubscriptions[id];\n delete this._signatureSubscriptions[id];\n await this._unsubscribe(subInfo, 'signatureUnsubscribe');\n this._updateSubscriptions();\n } else {\n throw new Error(`Unknown signature result id: ${id}`);\n }\n }\n\n /**\n * @internal\n */\n _wsOnRootNotification(notification: Object) {\n const res = create(notification, RootNotificationResult);\n for (const sub of Object.values(this._rootSubscriptions)) {\n if (sub.subscriptionId === res.subscription) {\n sub.callback(res.result);\n return;\n }\n }\n }\n\n /**\n * Register a callback to be invoked upon root changes\n *\n * @param callback Function to invoke whenever the root changes\n * @return subscription id\n */\n onRootChange(callback: RootChangeCallback): number {\n const id = ++this._rootSubscriptionCounter;\n this._rootSubscriptions[id] = {\n callback,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister a root notification callback\n *\n * @param id subscription id to deregister\n */\n async removeRootChangeListener(id: number): Promise<void> {\n if (this._rootSubscriptions[id]) {\n const subInfo = this._rootSubscriptions[id];\n delete this._rootSubscriptions[id];\n await this._unsubscribe(subInfo, 'rootUnsubscribe');\n this._updateSubscriptions();\n } else {\n throw new Error(`Unknown root change id: ${id}`);\n }\n }\n}\n","import * as BufferLayout from 'buffer-layout';\n\nimport {encodeData, decodeData, InstructionType} from './instruction';\nimport * as Layout from './layout';\nimport {PublicKey} from './publickey';\nimport {SystemProgram} from './system-program';\nimport {\n SYSVAR_CLOCK_PUBKEY,\n SYSVAR_RENT_PUBKEY,\n SYSVAR_STAKE_HISTORY_PUBKEY,\n} from './sysvar';\nimport {Transaction, TransactionInstruction} from './transaction';\n\n/**\n * Address of the stake config account which configures the rate\n * of stake warmup and cooldown as well as the slashing penalty.\n */\nexport const STAKE_CONFIG_ID = new PublicKey(\n 'StakeConfig11111111111111111111111111111111',\n);\n\n/**\n * Stake account authority info\n */\nexport class Authorized {\n /** stake authority */\n staker: PublicKey;\n /** withdraw authority */\n withdrawer: PublicKey;\n\n /**\n * Create a new Authorized object\n * @param staker the stake authority\n * @param withdrawer the withdraw authority\n */\n constructor(staker: PublicKey, withdrawer: PublicKey) {\n this.staker = staker;\n this.withdrawer = withdrawer;\n }\n}\n\n/**\n * Stake account lockup info\n */\nexport class Lockup {\n /** Unix timestamp of lockup expiration */\n unixTimestamp: number;\n /** Epoch of lockup expiration */\n epoch: number;\n /** Lockup custodian authority */\n custodian: PublicKey;\n\n /**\n * Create a new Lockup object\n */\n constructor(unixTimestamp: number, epoch: number, custodian: PublicKey) {\n this.unixTimestamp = unixTimestamp;\n this.epoch = epoch;\n this.custodian = custodian;\n }\n}\n\n/**\n * Create stake account transaction params\n */\nexport type CreateStakeAccountParams = {\n /** Address of the account which will fund creation */\n fromPubkey: PublicKey;\n /** Address of the new stake account */\n stakePubkey: PublicKey;\n /** Authorities of the new stake account */\n authorized: Authorized;\n /** Lockup of the new stake account */\n lockup: Lockup;\n /** Funding amount */\n lamports: number;\n};\n\n/**\n * Create stake account with seed transaction params\n */\nexport type CreateStakeAccountWithSeedParams = {\n fromPubkey: PublicKey;\n stakePubkey: PublicKey;\n basePubkey: PublicKey;\n seed: string;\n authorized: Authorized;\n lockup: Lockup;\n lamports: number;\n};\n\n/**\n * Initialize stake instruction params\n */\nexport type InitializeStakeParams = {\n stakePubkey: PublicKey;\n authorized: Authorized;\n lockup: Lockup;\n};\n\n/**\n * Delegate stake instruction params\n */\nexport type DelegateStakeParams = {\n stakePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n votePubkey: PublicKey;\n};\n\n/**\n * Authorize stake instruction params\n */\nexport type AuthorizeStakeParams = {\n stakePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n newAuthorizedPubkey: PublicKey;\n stakeAuthorizationType: StakeAuthorizationType;\n custodianPubkey?: PublicKey;\n};\n\n/**\n * Authorize stake instruction params using a derived key\n */\nexport type AuthorizeWithSeedStakeParams = {\n stakePubkey: PublicKey;\n authorityBase: PublicKey;\n authoritySeed: string;\n authorityOwner: PublicKey;\n newAuthorizedPubkey: PublicKey;\n stakeAuthorizationType: StakeAuthorizationType;\n custodianPubkey?: PublicKey;\n};\n\n/**\n * Split stake instruction params\n */\nexport type SplitStakeParams = {\n stakePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n splitStakePubkey: PublicKey;\n lamports: number;\n};\n\n/**\n * Withdraw stake instruction params\n */\nexport type WithdrawStakeParams = {\n stakePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n toPubkey: PublicKey;\n lamports: number;\n custodianPubkey?: PublicKey;\n};\n\n/**\n * Deactivate stake instruction params\n */\nexport type DeactivateStakeParams = {\n stakePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n};\n\n/**\n * Stake Instruction class\n */\nexport class StakeInstruction {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Decode a stake instruction and retrieve the instruction type.\n */\n static decodeInstructionType(\n instruction: TransactionInstruction,\n ): StakeInstructionType {\n this.checkProgramId(instruction.programId);\n\n const instructionTypeLayout = BufferLayout.u32('instruction');\n const typeIndex = instructionTypeLayout.decode(instruction.data);\n\n let type: StakeInstructionType | undefined;\n for (const [ixType, layout] of Object.entries(STAKE_INSTRUCTION_LAYOUTS)) {\n if (layout.index == typeIndex) {\n type = ixType as StakeInstructionType;\n break;\n }\n }\n\n if (!type) {\n throw new Error('Instruction type incorrect; not a StakeInstruction');\n }\n\n return type;\n }\n\n /**\n * Decode a initialize stake instruction and retrieve the instruction params.\n */\n static decodeInitialize(\n instruction: TransactionInstruction,\n ): InitializeStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n\n const {authorized, lockup} = decodeData(\n STAKE_INSTRUCTION_LAYOUTS.Initialize,\n instruction.data,\n );\n\n return {\n stakePubkey: instruction.keys[0].pubkey,\n authorized: new Authorized(\n new PublicKey(authorized.staker),\n new PublicKey(authorized.withdrawer),\n ),\n lockup: new Lockup(\n lockup.unixTimestamp,\n lockup.epoch,\n new PublicKey(lockup.custodian),\n ),\n };\n }\n\n /**\n * Decode a delegate stake instruction and retrieve the instruction params.\n */\n static decodeDelegate(\n instruction: TransactionInstruction,\n ): DelegateStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 6);\n decodeData(STAKE_INSTRUCTION_LAYOUTS.Delegate, instruction.data);\n\n return {\n stakePubkey: instruction.keys[0].pubkey,\n votePubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[5].pubkey,\n };\n }\n\n /**\n * Decode an authorize stake instruction and retrieve the instruction params.\n */\n static decodeAuthorize(\n instruction: TransactionInstruction,\n ): AuthorizeStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {newAuthorized, stakeAuthorizationType} = decodeData(\n STAKE_INSTRUCTION_LAYOUTS.Authorize,\n instruction.data,\n );\n\n const o: AuthorizeStakeParams = {\n stakePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n newAuthorizedPubkey: new PublicKey(newAuthorized),\n stakeAuthorizationType: {\n index: stakeAuthorizationType,\n },\n };\n if (instruction.keys.length > 3) {\n o.custodianPubkey = instruction.keys[3].pubkey;\n }\n return o;\n }\n\n /**\n * Decode an authorize-with-seed stake instruction and retrieve the instruction params.\n */\n static decodeAuthorizeWithSeed(\n instruction: TransactionInstruction,\n ): AuthorizeWithSeedStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n\n const {\n newAuthorized,\n stakeAuthorizationType,\n authoritySeed,\n authorityOwner,\n } = decodeData(\n STAKE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed,\n instruction.data,\n );\n\n const o: AuthorizeWithSeedStakeParams = {\n stakePubkey: instruction.keys[0].pubkey,\n authorityBase: instruction.keys[1].pubkey,\n authoritySeed: authoritySeed,\n authorityOwner: new PublicKey(authorityOwner),\n newAuthorizedPubkey: new PublicKey(newAuthorized),\n stakeAuthorizationType: {\n index: stakeAuthorizationType,\n },\n };\n if (instruction.keys.length > 3) {\n o.custodianPubkey = instruction.keys[3].pubkey;\n }\n return o;\n }\n\n /**\n * Decode a split stake instruction and retrieve the instruction params.\n */\n static decodeSplit(instruction: TransactionInstruction): SplitStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {lamports} = decodeData(\n STAKE_INSTRUCTION_LAYOUTS.Split,\n instruction.data,\n );\n\n return {\n stakePubkey: instruction.keys[0].pubkey,\n splitStakePubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n lamports,\n };\n }\n\n /**\n * Decode a withdraw stake instruction and retrieve the instruction params.\n */\n static decodeWithdraw(\n instruction: TransactionInstruction,\n ): WithdrawStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 5);\n const {lamports} = decodeData(\n STAKE_INSTRUCTION_LAYOUTS.Withdraw,\n instruction.data,\n );\n\n const o: WithdrawStakeParams = {\n stakePubkey: instruction.keys[0].pubkey,\n toPubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[4].pubkey,\n lamports,\n };\n if (instruction.keys.length > 5) {\n o.custodianPubkey = instruction.keys[5].pubkey;\n }\n return o;\n }\n\n /**\n * Decode a deactivate stake instruction and retrieve the instruction params.\n */\n static decodeDeactivate(\n instruction: TransactionInstruction,\n ): DeactivateStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n decodeData(STAKE_INSTRUCTION_LAYOUTS.Deactivate, instruction.data);\n\n return {\n stakePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n };\n }\n\n /**\n * @internal\n */\n static checkProgramId(programId: PublicKey) {\n if (!programId.equals(StakeProgram.programId)) {\n throw new Error('invalid instruction; programId is not StakeProgram');\n }\n }\n\n /**\n * @internal\n */\n static checkKeyLength(keys: Array<any>, expectedLength: number) {\n if (keys.length < expectedLength) {\n throw new Error(\n `invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`,\n );\n }\n }\n}\n\n/**\n * An enumeration of valid StakeInstructionType's\n */\nexport type StakeInstructionType =\n | 'AuthorizeWithSeed'\n | 'Authorize'\n | 'Deactivate'\n | 'Delegate'\n | 'Initialize'\n | 'Split'\n | 'Withdraw';\n\n/**\n * An enumeration of valid stake InstructionType's\n */\nexport const STAKE_INSTRUCTION_LAYOUTS: {\n [type in StakeInstructionType]: InstructionType;\n} = Object.freeze({\n Initialize: {\n index: 0,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.authorized(),\n Layout.lockup(),\n ]),\n },\n Authorize: {\n index: 1,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('newAuthorized'),\n BufferLayout.u32('stakeAuthorizationType'),\n ]),\n },\n Delegate: {\n index: 2,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')]),\n },\n Split: {\n index: 3,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.ns64('lamports'),\n ]),\n },\n Withdraw: {\n index: 4,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.ns64('lamports'),\n ]),\n },\n Deactivate: {\n index: 5,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')]),\n },\n AuthorizeWithSeed: {\n index: 8,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('newAuthorized'),\n BufferLayout.u32('stakeAuthorizationType'),\n Layout.rustString('authoritySeed'),\n Layout.publicKey('authorityOwner'),\n ]),\n },\n});\n\n/**\n * @typedef {Object} StakeAuthorizationType\n * @property (index} The Stake Authorization index (from solana-stake-program)\n */\nexport type StakeAuthorizationType = {\n index: number;\n};\n\n/**\n * An enumeration of valid StakeAuthorizationLayout's\n */\nexport const StakeAuthorizationLayout = Object.freeze({\n Staker: {\n index: 0,\n },\n Withdrawer: {\n index: 1,\n },\n});\n\n/**\n * Factory class for transactions to interact with the Stake program\n */\nexport class StakeProgram {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the Stake program\n */\n static get programId(): PublicKey {\n return new PublicKey('Stake11111111111111111111111111111111111111');\n }\n\n /**\n * Max space of a Stake account\n *\n * This is generated from the solana-stake-program StakeState struct as\n * `std::mem::size_of::<StakeState>()`:\n * https://docs.rs/solana-stake-program/1.4.4/solana_stake_program/stake_state/enum.StakeState.html\n */\n static get space(): number {\n return 200;\n }\n\n /**\n * Generate an Initialize instruction to add to a Stake Create transaction\n */\n static initialize(params: InitializeStakeParams): TransactionInstruction {\n const {stakePubkey, authorized, lockup} = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Initialize;\n const data = encodeData(type, {\n authorized: {\n staker: authorized.staker.toBuffer(),\n withdrawer: authorized.withdrawer.toBuffer(),\n },\n lockup: {\n unixTimestamp: lockup.unixTimestamp,\n epoch: lockup.epoch,\n custodian: lockup.custodian.toBuffer(),\n },\n });\n const instructionData = {\n keys: [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: SYSVAR_RENT_PUBKEY, isSigner: false, isWritable: false},\n ],\n programId: this.programId,\n data,\n };\n return new TransactionInstruction(instructionData);\n }\n\n /**\n * Generate a Transaction that creates a new Stake account at\n * an address generated with `from`, a seed, and the Stake programId\n */\n static createAccountWithSeed(\n params: CreateStakeAccountWithSeedParams,\n ): Transaction {\n const transaction = new Transaction();\n transaction.add(\n SystemProgram.createAccountWithSeed({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.stakePubkey,\n basePubkey: params.basePubkey,\n seed: params.seed,\n lamports: params.lamports,\n space: this.space,\n programId: this.programId,\n }),\n );\n\n const {stakePubkey, authorized, lockup} = params;\n return transaction.add(this.initialize({stakePubkey, authorized, lockup}));\n }\n\n /**\n * Generate a Transaction that creates a new Stake account\n */\n static createAccount(params: CreateStakeAccountParams): Transaction {\n const transaction = new Transaction();\n transaction.add(\n SystemProgram.createAccount({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.stakePubkey,\n lamports: params.lamports,\n space: this.space,\n programId: this.programId,\n }),\n );\n\n const {stakePubkey, authorized, lockup} = params;\n return transaction.add(this.initialize({stakePubkey, authorized, lockup}));\n }\n\n /**\n * Generate a Transaction that delegates Stake tokens to a validator\n * Vote PublicKey. This transaction can also be used to redelegate Stake\n * to a new validator Vote PublicKey.\n */\n static delegate(params: DelegateStakeParams): Transaction {\n const {stakePubkey, authorizedPubkey, votePubkey} = params;\n\n const type = STAKE_INSTRUCTION_LAYOUTS.Delegate;\n const data = encodeData(type);\n\n return new Transaction().add({\n keys: [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: votePubkey, isSigner: false, isWritable: false},\n {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: false},\n {\n pubkey: SYSVAR_STAKE_HISTORY_PUBKEY,\n isSigner: false,\n isWritable: false,\n },\n {pubkey: STAKE_CONFIG_ID, isSigner: false, isWritable: false},\n {pubkey: authorizedPubkey, isSigner: true, isWritable: false},\n ],\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a Transaction that authorizes a new PublicKey as Staker\n * or Withdrawer on the Stake account.\n */\n static authorize(params: AuthorizeStakeParams): Transaction {\n const {\n stakePubkey,\n authorizedPubkey,\n newAuthorizedPubkey,\n stakeAuthorizationType,\n custodianPubkey,\n } = params;\n\n const type = STAKE_INSTRUCTION_LAYOUTS.Authorize;\n const data = encodeData(type, {\n newAuthorized: newAuthorizedPubkey.toBuffer(),\n stakeAuthorizationType: stakeAuthorizationType.index,\n });\n\n const keys = [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: true},\n {pubkey: authorizedPubkey, isSigner: true, isWritable: false},\n ];\n if (custodianPubkey) {\n keys.push({pubkey: custodianPubkey, isSigner: false, isWritable: false});\n }\n return new Transaction().add({\n keys,\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a Transaction that authorizes a new PublicKey as Staker\n * or Withdrawer on the Stake account.\n */\n static authorizeWithSeed(params: AuthorizeWithSeedStakeParams): Transaction {\n const {\n stakePubkey,\n authorityBase,\n authoritySeed,\n authorityOwner,\n newAuthorizedPubkey,\n stakeAuthorizationType,\n custodianPubkey,\n } = params;\n\n const type = STAKE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed;\n const data = encodeData(type, {\n newAuthorized: newAuthorizedPubkey.toBuffer(),\n stakeAuthorizationType: stakeAuthorizationType.index,\n authoritySeed: authoritySeed,\n authorityOwner: authorityOwner.toBuffer(),\n });\n\n const keys = [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: authorityBase, isSigner: true, isWritable: false},\n {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: false},\n ];\n if (custodianPubkey) {\n keys.push({pubkey: custodianPubkey, isSigner: false, isWritable: false});\n }\n return new Transaction().add({\n keys,\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a Transaction that splits Stake tokens into another stake account\n */\n static split(params: SplitStakeParams): Transaction {\n const {stakePubkey, authorizedPubkey, splitStakePubkey, lamports} = params;\n\n const transaction = new Transaction();\n transaction.add(\n SystemProgram.createAccount({\n fromPubkey: authorizedPubkey,\n newAccountPubkey: splitStakePubkey,\n lamports: 0,\n space: this.space,\n programId: this.programId,\n }),\n );\n const type = STAKE_INSTRUCTION_LAYOUTS.Split;\n const data = encodeData(type, {lamports});\n\n return transaction.add({\n keys: [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: splitStakePubkey, isSigner: false, isWritable: true},\n {pubkey: authorizedPubkey, isSigner: true, isWritable: false},\n ],\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a Transaction that withdraws deactivated Stake tokens.\n */\n static withdraw(params: WithdrawStakeParams): Transaction {\n const {\n stakePubkey,\n authorizedPubkey,\n toPubkey,\n lamports,\n custodianPubkey,\n } = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Withdraw;\n const data = encodeData(type, {lamports});\n\n const keys = [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: toPubkey, isSigner: false, isWritable: true},\n {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: false},\n {\n pubkey: SYSVAR_STAKE_HISTORY_PUBKEY,\n isSigner: false,\n isWritable: false,\n },\n {pubkey: authorizedPubkey, isSigner: true, isWritable: false},\n ];\n if (custodianPubkey) {\n keys.push({pubkey: custodianPubkey, isSigner: false, isWritable: false});\n }\n return new Transaction().add({\n keys,\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a Transaction that deactivates Stake tokens.\n */\n static deactivate(params: DeactivateStakeParams): Transaction {\n const {stakePubkey, authorizedPubkey} = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Deactivate;\n const data = encodeData(type);\n\n return new Transaction().add({\n keys: [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: false},\n {pubkey: authorizedPubkey, isSigner: true, isWritable: false},\n ],\n programId: this.programId,\n data,\n });\n }\n}\n","import {Buffer} from 'buffer';\nimport * as BufferLayout from 'buffer-layout';\nimport secp256k1 from 'secp256k1';\nimport assert from 'assert';\nimport {keccak_256} from 'js-sha3';\n\nimport {PublicKey} from './publickey';\nimport {TransactionInstruction} from './transaction';\nimport {toBuffer} from './util/to-buffer';\n\nconst {publicKeyCreate, ecdsaSign} = secp256k1;\n\nconst PRIVATE_KEY_BYTES = 32;\nconst ETHEREUM_ADDRESS_BYTES = 20;\nconst PUBLIC_KEY_BYTES = 64;\nconst SIGNATURE_OFFSETS_SERIALIZED_SIZE = 11;\n\n/**\n * Params for creating an secp256k1 instruction using a public key\n * @typedef {Object} CreateSecp256k1InstructionWithPublicKeyParams\n * @property {Buffer | Uint8Array | Array<number>} publicKey\n * @property {Buffer | Uint8Array | Array<number>} message\n * @property {Buffer | Uint8Array | Array<number>} signature\n * @property {number} recoveryId\n */\nexport type CreateSecp256k1InstructionWithPublicKeyParams = {\n publicKey: Buffer | Uint8Array | Array<number>;\n message: Buffer | Uint8Array | Array<number>;\n signature: Buffer | Uint8Array | Array<number>;\n recoveryId: number;\n};\n\n/**\n * Params for creating an secp256k1 instruction using an Ethereum address\n * @typedef {Object} CreateSecp256k1InstructionWithEthAddressParams\n * @property {Buffer | Uint8Array | Array<number>} ethAddress\n * @property {Buffer | Uint8Array | Array<number>} message\n * @property {Buffer | Uint8Array | Array<number>} signature\n * @property {number} recoveryId\n */\nexport type CreateSecp256k1InstructionWithEthAddressParams = {\n ethAddress: Buffer | Uint8Array | Array<number> | string;\n message: Buffer | Uint8Array | Array<number>;\n signature: Buffer | Uint8Array | Array<number>;\n recoveryId: number;\n};\n\n/**\n * Params for creating an secp256k1 instruction using a private key\n * @typedef {Object} CreateSecp256k1InstructionWithPrivateKeyParams\n * @property {Buffer | Uint8Array | Array<number>} privateKey\n * @property {Buffer | Uint8Array | Array<number>} message\n */\nexport type CreateSecp256k1InstructionWithPrivateKeyParams = {\n privateKey: Buffer | Uint8Array | Array<number>;\n message: Buffer | Uint8Array | Array<number>;\n};\n\nconst SECP256K1_INSTRUCTION_LAYOUT = BufferLayout.struct([\n BufferLayout.u8('numSignatures'),\n BufferLayout.u16('signatureOffset'),\n BufferLayout.u8('signatureInstructionIndex'),\n BufferLayout.u16('ethAddressOffset'),\n BufferLayout.u8('ethAddressInstructionIndex'),\n BufferLayout.u16('messageDataOffset'),\n BufferLayout.u16('messageDataSize'),\n BufferLayout.u8('messageInstructionIndex'),\n BufferLayout.blob(20, 'ethAddress'),\n BufferLayout.blob(64, 'signature'),\n BufferLayout.u8('recoveryId'),\n]);\n\nexport class Secp256k1Program {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the secp256k1 program\n */\n static get programId(): PublicKey {\n return new PublicKey('KeccakSecp256k11111111111111111111111111111');\n }\n\n /**\n * Construct an Ethereum address from a secp256k1 public key buffer.\n * @param {Buffer} publicKey a 64 byte secp256k1 public key buffer\n */\n static publicKeyToEthAddress(\n publicKey: Buffer | Uint8Array | Array<number>,\n ): Buffer {\n assert(\n publicKey.length === PUBLIC_KEY_BYTES,\n `Public key must be ${PUBLIC_KEY_BYTES} bytes but received ${publicKey.length} bytes`,\n );\n\n try {\n return Buffer.from(keccak_256.update(toBuffer(publicKey)).digest()).slice(\n -ETHEREUM_ADDRESS_BYTES,\n );\n } catch (error) {\n throw new Error(`Error constructing Ethereum address: ${error}`);\n }\n }\n\n /**\n * Create an secp256k1 instruction with a public key. The public key\n * must be a buffer that is 64 bytes long.\n */\n static createInstructionWithPublicKey(\n params: CreateSecp256k1InstructionWithPublicKeyParams,\n ): TransactionInstruction {\n const {publicKey, message, signature, recoveryId} = params;\n return Secp256k1Program.createInstructionWithEthAddress({\n ethAddress: Secp256k1Program.publicKeyToEthAddress(publicKey),\n message,\n signature,\n recoveryId,\n });\n }\n\n /**\n * Create an secp256k1 instruction with an Ethereum address. The address\n * must be a hex string or a buffer that is 20 bytes long.\n */\n static createInstructionWithEthAddress(\n params: CreateSecp256k1InstructionWithEthAddressParams,\n ): TransactionInstruction {\n const {ethAddress: rawAddress, message, signature, recoveryId} = params;\n\n let ethAddress;\n if (typeof rawAddress === 'string') {\n if (rawAddress.startsWith('0x')) {\n ethAddress = Buffer.from(rawAddress.substr(2), 'hex');\n } else {\n ethAddress = Buffer.from(rawAddress, 'hex');\n }\n } else {\n ethAddress = rawAddress;\n }\n\n assert(\n ethAddress.length === ETHEREUM_ADDRESS_BYTES,\n `Address must be ${ETHEREUM_ADDRESS_BYTES} bytes but received ${ethAddress.length} bytes`,\n );\n\n const dataStart = 1 + SIGNATURE_OFFSETS_SERIALIZED_SIZE;\n const ethAddressOffset = dataStart;\n const signatureOffset = dataStart + ethAddress.length;\n const messageDataOffset = signatureOffset + signature.length + 1;\n const numSignatures = 1;\n\n const instructionData = Buffer.alloc(\n SECP256K1_INSTRUCTION_LAYOUT.span + message.length,\n );\n\n SECP256K1_INSTRUCTION_LAYOUT.encode(\n {\n numSignatures,\n signatureOffset,\n signatureInstructionIndex: 0,\n ethAddressOffset,\n ethAddressInstructionIndex: 0,\n messageDataOffset,\n messageDataSize: message.length,\n messageInstructionIndex: 0,\n signature: toBuffer(signature),\n ethAddress: toBuffer(ethAddress),\n recoveryId,\n },\n instructionData,\n );\n\n instructionData.fill(toBuffer(message), SECP256K1_INSTRUCTION_LAYOUT.span);\n\n return new TransactionInstruction({\n keys: [],\n programId: Secp256k1Program.programId,\n data: instructionData,\n });\n }\n\n /**\n * Create an secp256k1 instruction with a private key. The private key\n * must be a buffer that is 32 bytes long.\n */\n static createInstructionWithPrivateKey(\n params: CreateSecp256k1InstructionWithPrivateKeyParams,\n ): TransactionInstruction {\n const {privateKey: pkey, message} = params;\n\n assert(\n pkey.length === PRIVATE_KEY_BYTES,\n `Private key must be ${PRIVATE_KEY_BYTES} bytes but received ${pkey.length} bytes`,\n );\n\n let privateKey;\n if (Array.isArray(pkey)) {\n privateKey = Uint8Array.from(pkey);\n } else {\n privateKey = pkey;\n }\n\n try {\n const publicKey = publicKeyCreate(privateKey, false).slice(1); // throw away leading byte\n const messageHash = Buffer.from(\n keccak_256.update(toBuffer(message)).digest(),\n );\n const {signature, recid: recoveryId} = ecdsaSign(messageHash, privateKey);\n\n return this.createInstructionWithPublicKey({\n publicKey,\n message,\n signature,\n recoveryId,\n });\n } catch (error) {\n throw new Error(`Error creating instruction; ${error}`);\n }\n }\n}\n","import {Buffer} from 'buffer';\nimport {\n assert as assertType,\n optional,\n string,\n type as pick,\n} from 'superstruct';\n\nimport * as Layout from './layout';\nimport * as shortvec from './util/shortvec-encoding';\nimport {PublicKey} from './publickey';\n\nexport const VALIDATOR_INFO_KEY = new PublicKey(\n 'Va1idator1nfo111111111111111111111111111111',\n);\n\n/**\n * @internal\n */\ntype ConfigKey = {\n publicKey: PublicKey;\n isSigner: boolean;\n};\n\n/**\n * Info used to identity validators.\n *\n * @typedef {Object} Info\n * @property {string} name validator name\n * @property {?string} website optional, validator website\n * @property {?string} details optional, extra information the validator chose to share\n * @property {?string} keybaseUsername optional, used to identify validators on keybase.io\n */\nexport type Info = {\n name: string;\n website?: string;\n details?: string;\n keybaseUsername?: string;\n};\n\nconst InfoString = pick({\n name: string(),\n website: optional(string()),\n details: optional(string()),\n keybaseUsername: optional(string()),\n});\n\n/**\n * ValidatorInfo class\n */\nexport class ValidatorInfo {\n /**\n * validator public key\n */\n key: PublicKey;\n /**\n * validator information\n */\n info: Info;\n\n /**\n * Construct a valid ValidatorInfo\n *\n * @param key validator public key\n * @param info validator information\n */\n constructor(key: PublicKey, info: Info) {\n this.key = key;\n this.info = info;\n }\n\n /**\n * Deserialize ValidatorInfo from the config account data. Exactly two config\n * keys are required in the data.\n *\n * @param buffer config account data\n * @return null if info was not found\n */\n static fromConfigData(\n buffer: Buffer | Uint8Array | Array<number>,\n ): ValidatorInfo | null {\n const PUBKEY_LENGTH = 32;\n\n let byteArray = [...buffer];\n const configKeyCount = shortvec.decodeLength(byteArray);\n if (configKeyCount !== 2) return null;\n\n const configKeys: Array<ConfigKey> = [];\n for (let i = 0; i < 2; i++) {\n const publicKey = new PublicKey(byteArray.slice(0, PUBKEY_LENGTH));\n byteArray = byteArray.slice(PUBKEY_LENGTH);\n const isSigner = byteArray.slice(0, 1)[0] === 1;\n byteArray = byteArray.slice(1);\n configKeys.push({publicKey, isSigner});\n }\n\n if (configKeys[0].publicKey.equals(VALIDATOR_INFO_KEY)) {\n if (configKeys[1].isSigner) {\n const rawInfo = Layout.rustString().decode(Buffer.from(byteArray));\n const info = JSON.parse(rawInfo);\n assertType(info, InfoString);\n return new ValidatorInfo(configKeys[1].publicKey, info);\n }\n }\n\n return null;\n }\n}\n","import * as BufferLayout from 'buffer-layout';\n\nimport * as Layout from './layout';\nimport {PublicKey} from './publickey';\nimport {toBuffer} from './util/to-buffer';\n\nexport const VOTE_PROGRAM_ID = new PublicKey(\n 'Vote111111111111111111111111111111111111111',\n);\n\nexport type Lockout = {\n slot: number;\n confirmationCount: number;\n};\n\n/**\n * History of how many credits earned by the end of each epoch\n */\nexport type EpochCredits = {\n epoch: number;\n credits: number;\n prevCredits: number;\n};\n\n/**\n * See https://github.com/solana-labs/solana/blob/8a12ed029cfa38d4a45400916c2463fb82bbec8c/programs/vote_api/src/vote_state.rs#L68-L88\n *\n * @internal\n */\nconst VoteAccountLayout = BufferLayout.struct([\n Layout.publicKey('nodePubkey'),\n Layout.publicKey('authorizedVoterPubkey'),\n Layout.publicKey('authorizedWithdrawerPubkey'),\n BufferLayout.u8('commission'),\n BufferLayout.nu64(), // votes.length\n BufferLayout.seq(\n BufferLayout.struct([\n BufferLayout.nu64('slot'),\n BufferLayout.u32('confirmationCount'),\n ]),\n BufferLayout.offset(BufferLayout.u32(), -8),\n 'votes',\n ),\n BufferLayout.u8('rootSlotValid'),\n BufferLayout.nu64('rootSlot'),\n BufferLayout.nu64('epoch'),\n BufferLayout.nu64('credits'),\n BufferLayout.nu64('lastEpochCredits'),\n BufferLayout.nu64(), // epochCredits.length\n BufferLayout.seq(\n BufferLayout.struct([\n BufferLayout.nu64('epoch'),\n BufferLayout.nu64('credits'),\n BufferLayout.nu64('prevCredits'),\n ]),\n BufferLayout.offset(BufferLayout.u32(), -8),\n 'epochCredits',\n ),\n]);\n\ntype VoteAccountArgs = {\n nodePubkey: PublicKey;\n authorizedVoterPubkey: PublicKey;\n authorizedWithdrawerPubkey: PublicKey;\n commission: number;\n votes: Array<Lockout>;\n rootSlot: number | null;\n epoch: number;\n credits: number;\n lastEpochCredits: number;\n epochCredits: Array<EpochCredits>;\n};\n\n/**\n * VoteAccount class\n */\nexport class VoteAccount {\n nodePubkey: PublicKey;\n authorizedVoterPubkey: PublicKey;\n authorizedWithdrawerPubkey: PublicKey;\n commission: number;\n votes: Array<Lockout>;\n rootSlot: number | null;\n epoch: number;\n credits: number;\n lastEpochCredits: number;\n epochCredits: Array<EpochCredits>;\n\n /**\n * @internal\n */\n constructor(args: VoteAccountArgs) {\n this.nodePubkey = args.nodePubkey;\n this.authorizedVoterPubkey = args.authorizedVoterPubkey;\n this.authorizedWithdrawerPubkey = args.authorizedWithdrawerPubkey;\n this.commission = args.commission;\n this.votes = args.votes;\n this.rootSlot = args.rootSlot;\n this.epoch = args.epoch;\n this.credits = args.credits;\n this.lastEpochCredits = args.lastEpochCredits;\n this.epochCredits = args.epochCredits;\n }\n\n /**\n * Deserialize VoteAccount from the account data.\n *\n * @param buffer account data\n * @return VoteAccount\n */\n static fromAccountData(\n buffer: Buffer | Uint8Array | Array<number>,\n ): VoteAccount {\n const va = VoteAccountLayout.decode(toBuffer(buffer), 0);\n\n let rootSlot: number | null = va.rootSlot;\n if (!va.rootSlotValid) {\n rootSlot = null;\n }\n\n return new VoteAccount({\n nodePubkey: new PublicKey(va.nodePubkey),\n authorizedVoterPubkey: new PublicKey(va.authorizedVoterPubkey),\n authorizedWithdrawerPubkey: new PublicKey(va.authorizedWithdrawerPubkey),\n commission: va.commission,\n votes: va.votes,\n rootSlot,\n epoch: va.epoch,\n credits: va.credits,\n lastEpochCredits: va.lastEpochCredits,\n epochCredits: va.epochCredits,\n });\n }\n}\n","import {Connection} from '../connection';\nimport type {TransactionSignature} from '../transaction';\nimport type {ConfirmOptions} from '../connection';\n\n/**\n * Send and confirm a raw transaction\n *\n * If `commitment` option is not specified, defaults to 'max' commitment.\n *\n * @param {Connection} connection\n * @param {Buffer} rawTransaction\n * @param {ConfirmOptions} [options]\n * @returns {Promise<TransactionSignature>}\n */\nexport async function sendAndConfirmRawTransaction(\n connection: Connection,\n rawTransaction: Buffer,\n options?: ConfirmOptions,\n): Promise<TransactionSignature> {\n const sendOptions = options && {\n skipPreflight: options.skipPreflight,\n preflightCommitment: options.preflightCommitment || options.commitment,\n };\n\n const signature = await connection.sendRawTransaction(\n rawTransaction,\n sendOptions,\n );\n\n const status = (\n await connection.confirmTransaction(\n signature,\n options && options.commitment,\n )\n ).value;\n\n if (status.err) {\n throw new Error(\n `Raw transaction ${signature} failed (${JSON.stringify(status)})`,\n );\n }\n\n return signature;\n}\n","const endpoint = {\n http: {\n devnet: 'http://devnet.solana.com',\n testnet: 'http://testnet.solana.com',\n 'mainnet-beta': 'http://api.mainnet-beta.solana.com',\n },\n https: {\n devnet: 'https://devnet.solana.com',\n testnet: 'https://testnet.solana.com',\n 'mainnet-beta': 'https://api.mainnet-beta.solana.com',\n },\n};\n\nexport type Cluster = 'devnet' | 'testnet' | 'mainnet-beta';\n\n/**\n * Retrieves the RPC API URL for the specified cluster\n */\nexport function clusterApiUrl(cluster?: Cluster, tls?: boolean): string {\n const key = tls === false ? 'http' : 'https';\n\n if (!cluster) {\n return endpoint[key]['devnet'];\n }\n\n const url = endpoint[key][cluster];\n if (!url) {\n throw new Error(`Unknown ${key} cluster: ${cluster}`);\n }\n return url;\n}\n","export * from './account';\nexport * from './blockhash';\nexport * from './bpf-loader-deprecated';\nexport * from './bpf-loader';\nexport * from './connection';\nexport * from './fee-calculator';\nexport * from './loader';\nexport * from './message';\nexport * from './nonce-account';\nexport * from './publickey';\nexport * from './stake-program';\nexport * from './system-program';\nexport * from './secp256k1-program';\nexport * from './transaction';\nexport * from './validator-info';\nexport * from './vote-account';\nexport * from './sysvar';\nexport * from './util/send-and-confirm-transaction';\nexport * from './util/send-and-confirm-raw-transaction';\nexport * from './util/cluster';\n\n/**\n * There are 1-billion lamports in one SOL\n */\nexport const LAMPORTS_PER_SOL = 1000000000;\n"],"names":["base64","toBuffer","arr","Buffer","Uint8Array","from","buffer","byteOffset","byteLength","require$$0","basex","MAX_SEED_LENGTH","PublicKey","constructor","value","decoded","bs58","decode","length","Error","_bn","BN","equals","publicKey","eq","toBase58","encode","b","toArrayLike","zeroPad","alloc","copy","toString","createWithSeed","fromPublicKey","seed","programId","concat","hash","sha256","createProgramAddress","seeds","forEach","publicKeyBytes","toArray","undefined","is_on_curve","findProgramAddress","nonce","address","seedsWithNonce","err","naclLowLevel","nacl","lowlevel","p","r","gf","t","chk","num","den","den2","den4","den6","set25519","gf1","unpack25519","S","M","D","Z","A","pow2523","neq25519","I","a","c","d","pack25519","crypto_verify_32","Account","secretKey","_keypair","sign","keyPair","fromSecretKey","BPF_LOADER_DEPRECATED_PROGRAM_ID","inspect","isArray","hasOwnProperty","objectKeys","isBuffer","global","assert","inherits","utilInspect","property","BufferLayout","rustString","rsl","_decode","bind","_encode","offset","data","chars","str","span","authorized","lockup","getAlloc","type","fields","layout","item","decodeLength","bytes","len","size","elem","shift","encodeLength","rem_len","push","PUBKEY_LENGTH","Message","args","header","accountKeys","map","account","recentBlockhash","instructions","isAccountWritable","index","numRequiredSignatures","numReadonlySignedAccounts","numReadonlyUnsignedAccounts","serialize","numKeys","keyCount","shortvec","instruction","accounts","programIdIndex","keyIndicesCount","dataCount","keyIndices","dataLength","instructionCount","instructionBuffer","PACKET_DATA_SIZE","instructionBufferLength","instructionLayout","slice","signDataLayout","Layout","transaction","keys","key","signData","byteArray","accountCount","i","dataSlice","messageArgs","DEFAULT_SIGNATURE","fill","SIGNATURE_LENGTH","TransactionInstruction","opts","Transaction","signature","signatures","Object","assign","add","items","compileMessage","nonceInfo","nonceInstruction","unshift","feePayer","programIds","accountMetas","accountMeta","includes","pubkey","isSigner","isWritable","sort","x","y","checkSigner","checkWritable","uniqueMetas","pubkeyString","uniqueIndex","findIndex","feePayerIndex","payerMeta","splice","console","warn","signedKeys","unsignedKeys","indexOf","meta","invariant","keyIndex","_compile","message","valid","every","pair","serializeMessage","setSigners","signers","seen","Set","filter","has","uniqueSigners","signer","_partialSign","_verifySignatures","partialSign","detached","_addSignature","addSignature","sigpair","verifySignatures","requireAllSignatures","verify","config","_serialize","signatureCount","transactionLength","wireTransaction","keyObj","populate","sigPubkeyPair","some","SYSVAR_CLOCK_PUBKEY","SYSVAR_RECENT_BLOCKHASHES_PUBKEY","SYSVAR_RENT_PUBKEY","SYSVAR_REWARDS_PUBKEY","SYSVAR_STAKE_HISTORY_PUBKEY","SYSVAR_INSTRUCTIONS_PUBKEY","sendAndConfirmTransaction","connection","options","sendOptions","skipPreflight","preflightCommitment","commitment","sendTransaction","status","confirmTransaction","JSON","stringify","sleep","ms","Promise","resolve","setTimeout","encodeData","allocLength","layoutFields","decodeData","FeeCalculatorLayout","NonceAccountLayout","NONCE_ACCOUNT_LENGTH","NonceAccount","authorizedPubkey","feeCalculator","fromAccountData","nonceAccount","SystemInstruction","decodeInstructionType","checkProgramId","instructionTypeLayout","typeIndex","ixType","entries","SYSTEM_INSTRUCTION_LAYOUTS","decodeCreateAccount","checkKeyLength","lamports","space","Create","fromPubkey","newAccountPubkey","decodeTransfer","Transfer","toPubkey","decodeTransferWithSeed","TransferWithSeed","basePubkey","decodeAllocate","Allocate","accountPubkey","decodeAllocateWithSeed","base","AllocateWithSeed","decodeAssign","Assign","decodeAssignWithSeed","AssignWithSeed","decodeCreateWithSeed","CreateWithSeed","decodeNonceInitialize","InitializeNonceAccount","noncePubkey","decodeNonceAdvance","AdvanceNonceAccount","decodeNonceWithdraw","WithdrawNonceAccount","decodeNonceAuthorize","AuthorizeNonceAccount","newAuthorizedPubkey","SystemProgram","expectedLength","freeze","createAccount","params","transfer","createAccountWithSeed","createNonceAccount","initParams","nonceInitialize","instructionData","nonceAdvance","nonceWithdraw","nonceAuthorize","allocate","Loader","chunkSize","getMinNumSignatures","Math","ceil","load","payer","program","balanceNeeded","getMinimumBalanceForRentExemption","programInfo","getAccountInfo","executable","error","owner","dataLayout","array","transactions","_rpcEndpoint","REQUESTS_PER_SECOND","all","BPF_LOADER_PROGRAM_ID","BpfLoader","elf","loaderProgramId","parse","qsParse","qsStringify","NUM_TICKS_PER_SECOND","DEFAULT_TICKS_PER_SLOT","NUM_SLOTS_PER_SECOND","MS_PER_SLOT","promiseTimeout","promise","timeoutMs","timeoutId","timeoutPromise","race","then","result","clearTimeout","PublicKeyFromString","coerce","instance","string","RawAccountDataResult","tuple","literal","BufferFromRawAccountData","BLOCKHASH_CACHE_TIMEOUT_MS","createRpcResult","union","pick","jsonrpc","id","code","unknown","optional","any","UnknownRpcResult","jsonRpcResult","schema","create","jsonRpcResultAndContext","context","slot","number","notificationResultAndContext","GetInflationGovernorResult","foundation","foundationTerm","initial","taper","terminal","GetEpochInfoResult","epoch","slotIndex","slotsInEpoch","absoluteSlot","blockHeight","transactionCount","GetEpochScheduleResult","slotsPerEpoch","leaderScheduleSlotOffset","warmup","boolean","firstNormalEpoch","firstNormalSlot","GetLeaderScheduleResult","record","TransactionErrorResult","nullable","SignatureStatusResult","SignatureReceivedResult","VersionResult","SimulatedTransactionResponseStruct","logs","createRpcClient","url","useHttps","clientBrowser","RpcClient","request","callback","agent","method","body","headers","too_many_requests_retries","res","waitTime","fetch","log","statusText","text","ok","createRpcRequest","client","reject","response","createRpcBatchRequest","requests","batch","methodName","GetInflationGovernorRpcResult","GetEpochInfoRpcResult","GetEpochScheduleRpcResult","GetLeaderScheduleRpcResult","SlotRpcResult","GetSupplyRpcResult","total","circulating","nonCirculating","nonCirculatingAccounts","TokenAmountResult","amount","uiAmount","decimals","uiAmountString","GetTokenLargestAccountsResult","GetTokenAccountsByOwner","rentEpoch","ParsedAccountDataResult","parsed","GetParsedTokenAccountsByOwner","GetLargestAccountsRpcResult","AccountInfoResult","KeyedAccountInfoResult","ParsedOrRawAccountData","Array","ParsedAccountInfoResult","KeyedParsedAccountInfoResult","StakeActivationResult","state","active","inactive","GetConfirmedSignaturesForAddressRpcResult","GetConfirmedSignaturesForAddress2RpcResult","memo","blockTime","AccountNotificationResult","subscription","ProgramAccountInfoResult","ProgramAccountNotificationResult","SlotInfoResult","parent","root","SlotNotificationResult","SignatureNotificationResult","RootNotificationResult","ContactInfoResult","gossip","tpu","rpc","version","VoteAccountInfoResult","votePubkey","nodePubkey","activatedStake","epochVoteAccount","epochCredits","commission","lastVote","rootSlot","GetVoteAccounts","current","delinquent","ConfirmationStatus","SignatureStatusResponse","confirmations","confirmationStatus","GetSignatureStatusesRpcResult","GetMinimumBalanceForRentExemptionRpcResult","ConfirmedTransactionResult","TransactionFromConfirmed","ParsedInstructionResult","RawInstructionResult","InstructionResult","UnknownInstructionResult","ParsedOrRawInstruction","ParsedConfirmedTransactionResult","writable","TokenBalanceResult","accountIndex","mint","uiTokenAmount","ConfirmedTransactionMetaResult","fee","innerInstructions","preBalances","postBalances","logMessages","preTokenBalances","postTokenBalances","ParsedConfirmedTransactionMetaResult","GetConfirmedBlockRpcResult","blockhash","previousBlockhash","parentSlot","rewards","postBalance","rewardType","GetConfirmedTransactionRpcResult","GetParsedConfirmedTransactionRpcResult","GetRecentBlockhashAndContextRpcResult","lamportsPerSignature","PerfSampleResult","numTransactions","numSlots","samplePeriodSecs","GetRecentPerformanceSamplesRpcResult","GetFeeCalculatorRpcResult","RequestAirdropRpcResult","SendTransactionRpcResult","LogsResult","LogsNotificationResult","Connection","endpoint","urlParse","protocol","_rpcClient","href","_rpcRequest","_rpcBatchRequest","_commitment","_blockhashInfo","lastFetch","transactionSignatures","simulatedSignatures","host","port","String","Number","_rpcWebSocket","RpcWebSocketClient","urlFormat","autoconnect","max_reconnects","Infinity","on","_wsOnOpen","_wsOnError","_wsOnClose","_wsOnAccountNotification","_wsOnProgramAccountNotification","_wsOnSlotNotification","_wsOnSignatureNotification","_wsOnRootNotification","_wsOnLogsNotification","getBalanceAndContext","_buildArgs","unsafeRes","getBalance","catch","e","getBlockTime","getMinimumLedgerSlot","getFirstAvailableBlock","getSupply","getTokenSupply","tokenMintAddress","getTokenAccountBalance","tokenAddress","getTokenAccountsByOwner","ownerAddress","_args","getParsedTokenAccountsByOwner","getLargestAccounts","arg","getTokenLargestAccounts","mintAddress","getAccountInfoAndContext","getParsedAccountInfo","getStakeActivation","getProgramAccounts","getParsedProgramAccounts","decodedSignature","start","Date","now","subscriptionCommitment","subscriptionId","confirmPromise","onSignature","removeSignatureListener","duration","toFixed","getClusterNodes","getVoteAccounts","getSlot","getSlotLeader","getSignatureStatus","values","getSignatureStatuses","getTransactionCount","getTotalSupply","getInflationGovernor","getEpochInfo","getEpochSchedule","getLeaderSchedule","getRecentBlockhashAndContext","getRecentPerformanceSamples","limit","getFeeCalculatorForBlockhash","getRecentBlockhash","getVersion","getConfirmedBlock","getConfirmedTransaction","getParsedConfirmedTransaction","getParsedConfirmedTransactions","getConfirmedSignaturesForAddress","startSlot","endSlot","getConfirmedSignaturesForAddress2","getNonceAndContext","accountInfo","getNonce","requestAirdrop","to","_recentBlockhash","disableCache","_pollingBlockhash","timeSinceFetch","expired","_pollNewBlockhash","startTime","simulateTransaction","_disableBlockhashCaching","encodedTransaction","encoding","sigVerify","sendRawTransaction","rawTransaction","sendEncodedTransaction","traceIndent","logTrace","join","_rpcWebSocketConnected","_rpcWebSocketHeartbeat","setInterval","notify","_updateSubscriptions","clearInterval","_resetSubscriptions","_subscribe","sub","rpcMethod","rpcArgs","call","_unsubscribe","unsubscribeId","_accountChangeSubscriptions","s","_programAccountChangeSubscriptions","_signatureSubscriptions","_slotSubscriptions","_rootSubscriptions","programKeys","slotKeys","signatureKeys","rootKeys","logsKeys","_logsSubscriptions","_rpcWebSocketIdleTimeout","close","connect","mentions","notification","onAccountChange","_accountChangeSubscriptionCounter","removeAccountChangeListener","subInfo","accountId","onProgramAccountChange","_programAccountChangeSubscriptionCounter","removeProgramAccountChangeListener","onLogs","_logsSubscriptionCounter","removeOnLogsListener","onSlotChange","_slotSubscriptionCounter","removeSlotChangeListener","override","extra","_signatureSubscriptionCounter","onSignatureWithOptions","onRootChange","_rootSubscriptionCounter","removeRootChangeListener","STAKE_CONFIG_ID","Authorized","staker","withdrawer","Lockup","unixTimestamp","custodian","StakeInstruction","STAKE_INSTRUCTION_LAYOUTS","decodeInitialize","Initialize","stakePubkey","decodeDelegate","Delegate","decodeAuthorize","newAuthorized","stakeAuthorizationType","Authorize","o","custodianPubkey","decodeAuthorizeWithSeed","authoritySeed","authorityOwner","AuthorizeWithSeed","authorityBase","decodeSplit","Split","splitStakePubkey","decodeWithdraw","Withdraw","decodeDeactivate","Deactivate","StakeProgram","StakeAuthorizationLayout","Staker","Withdrawer","initialize","delegate","authorize","authorizeWithSeed","split","withdraw","deactivate","publicKeyCreate","ecdsaSign","secp256k1","PRIVATE_KEY_BYTES","ETHEREUM_ADDRESS_BYTES","PUBLIC_KEY_BYTES","SIGNATURE_OFFSETS_SERIALIZED_SIZE","SECP256K1_INSTRUCTION_LAYOUT","Secp256k1Program","publicKeyToEthAddress","keccak_256","update","digest","createInstructionWithPublicKey","recoveryId","createInstructionWithEthAddress","ethAddress","rawAddress","startsWith","substr","dataStart","ethAddressOffset","signatureOffset","messageDataOffset","numSignatures","signatureInstructionIndex","ethAddressInstructionIndex","messageDataSize","messageInstructionIndex","createInstructionWithPrivateKey","privateKey","pkey","messageHash","recid","VALIDATOR_INFO_KEY","InfoString","name","website","details","keybaseUsername","ValidatorInfo","info","fromConfigData","configKeyCount","configKeys","rawInfo","assertType","VOTE_PROGRAM_ID","VoteAccountLayout","VoteAccount","authorizedVoterPubkey","authorizedWithdrawerPubkey","votes","credits","lastEpochCredits","va","rootSlotValid","sendAndConfirmRawTransaction","http","devnet","testnet","https","clusterApiUrl","cluster","tls","LAMPORTS_PER_SOL"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,gBAAkB,GAAG,WAAU;AAC/B,iBAAmB,GAAG,YAAW;AACjC,mBAAqB,GAAG,cAAa;AACrC;AACA,IAAI,MAAM,GAAG,GAAE;AACf,IAAI,SAAS,GAAG,GAAE;AAClB,IAAI,GAAG,GAAG,OAAO,UAAU,KAAK,WAAW,GAAG,UAAU,GAAG,MAAK;AAChE;AACA,IAAI,IAAI,GAAG,mEAAkE;AAC7E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG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C,OAAO,GAAG,OAAO,CAAC;AAClB,SAAS,OAAO,CAAC,GAAG,EAAE;AAC7B,EAAE,IAAI,GAAG,EAAE,MAAM,GAAG,CAAC;AACrB;;;;;;;;;;;;;;;;;;;;;;;;AC/VA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,CAAC;AACb,EAAE,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE;AAC9B,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;AACjC,MAAM,MAAM,IAAI,SAAS,CAAC,yBAAyB,CAAC,CAAC;AACrD,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7B,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,qBAAqB,GAAG;AAC1B,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE;AACpB,IAAI,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;AAC1C,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE;AACzB,IAAI,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;AAC1C,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;A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ACA;AACO,SAASE,aAAT,CAAuBC,OAAvB,EAA0CC,GAA1C,EAAiE;AACtE,QAAMrrB,GAAG,GAAGqrB,GAAG,KAAK,KAAR,GAAgB,MAAhB,GAAyB,OAArC;;AAEA,MAAI,CAACD,OAAL,EAAc;AACZ,WAAOtR,QAAQ,CAAC9Z,GAAD,CAAR,CAAc,QAAd,CAAP;AACD;;AAED,QAAMmR,GAAG,GAAG2I,QAAQ,CAAC9Z,GAAD,CAAR,CAAcorB,OAAd,CAAZ;;AACA,MAAI,CAACja,GAAL,EAAU;AACR,UAAM,IAAIha,KAAJ,mBAAqB6I,GAArB,uBAAqCorB,OAArC,EAAN;AACD;;AACD,SAAOja,GAAP;AACD;;ACTD;AACA;AACA;;MACama,gBAAgB,GAAG;;;;"}
|
|
1
|
+
{"version":3,"file":"index.browser.esm.js","sources":["../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/buffer/index.js","../src/util/to-buffer.ts","../node_modules/safe-buffer/index.js","../node_modules/base-x/index.js","../node_modules/bs58/index.js","../src/publickey.ts","../src/account.ts","../src/bpf-loader-deprecated.ts","../node_modules/rollup-plugin-node-polyfills/polyfills/global.js","../node_modules/rollup-plugin-node-polyfills/polyfills/inherits.js","../node_modules/rollup-plugin-node-polyfills/polyfills/util.js","../node_modules/rollup-plugin-node-polyfills/polyfills/assert.js","../node_modules/buffer-layout/lib/Layout.js","../src/layout.ts","../src/util/shortvec-encoding.ts","../src/util/guarded-array-utils.ts","../src/message.ts","../src/transaction.ts","../src/sysvar.ts","../src/util/send-and-confirm-transaction.ts","../src/util/sleep.ts","../src/instruction.ts","../src/fee-calculator.ts","../src/nonce-account.ts","../src/system-program.ts","../src/loader.ts","../src/bpf-loader.ts","../node_modules/punycode/punycode.es6.js","../node_modules/rollup-plugin-node-polyfills/polyfills/qs.js","../node_modules/rollup-plugin-node-polyfills/polyfills/url.js","../src/timing.ts","../src/util/promise-timeout.ts","../src/connection.ts","../src/stake-program.ts","../src/secp256k1-program.ts","../src/validator-info.ts","../src/vote-account.ts","../src/util/send-and-confirm-raw-transaction.ts","../src/util/cluster.ts","../src/index.ts"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nconst base64 = require('base64-js')\nconst ieee754 = require('ieee754')\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n const valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n const b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n const length = byteLength(string, encoding) | 0\n let buf = createBuffer(length)\n\n const actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0\n const buf = createBuffer(length)\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n let buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0\n const buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n let x = a.length\n let y = b.length\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n let i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n const buffer = Buffer.allocUnsafe(length)\n let pos = 0\n for (i = 0; i < list.length; ++i) {\n let buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n buf.copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n const len = string.length\n const mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n let loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n const i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n const len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n const len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n const len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n const length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n let str = ''\n const max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return '<Buffer ' + str + '>'\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n let x = thisEnd - thisStart\n let y = end - start\n const len = Math.min(x, y)\n\n const thisCopy = this.slice(thisStart, thisEnd)\n const targetCopy = target.slice(start, end)\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n let indexSize = 1\n let arrLength = arr.length\n let valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n let i\n if (dir) {\n let foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n let found = true\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n const remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n const strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n let i\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n const remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n const res = []\n\n let i = start\n while (i < end) {\n const firstByte = buf[i]\n let codePoint = null\n let bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n const len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = ''\n let i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n const len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n let out = ''\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n const bytes = buf.slice(start, end)\n let res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n const len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n const newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n let val = this[offset + --byteLength]\n let mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const lo = first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24\n\n const hi = this[++offset] +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n last * 2 ** 24\n\n return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const hi = first * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n const lo = this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last\n\n return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let i = byteLength\n let mul = 1\n let val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = this[offset + 4] +\n this[offset + 5] * 2 ** 8 +\n this[offset + 6] * 2 ** 16 +\n (last << 24) // Overflow\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let mul = 1\n let i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let i = byteLength - 1\n let mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset + 7] = lo\n lo = lo >> 8\n buf[offset + 6] = lo\n lo = lo >> 8\n buf[offset + 5] = lo\n lo = lo >> 8\n buf[offset + 4] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset + 3] = hi\n hi = hi >> 8\n buf[offset + 2] = hi\n hi = hi >> 8\n buf[offset + 1] = hi\n hi = hi >> 8\n buf[offset] = hi\n return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = 0\n let mul = 1\n let sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = byteLength - 1\n let mul = 1\n let sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n const len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n let i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n const bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n const len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor () {\n super()\n\n Object.defineProperty(this, 'message', {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n })\n\n // Add the error code to the name to include it in the stack trace.\n this.name = `${this.name} [${sym}]`\n // Access the stack to generate the error message including the error code\n // from the name.\n this.stack // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n delete this.name\n }\n\n get code () {\n return sym\n }\n\n set code (value) {\n Object.defineProperty(this, 'code', {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n })\n }\n\n toString () {\n return `${this.name} [${sym}]: ${this.message}`\n }\n }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`\n }\n\n return 'Attempt to access memory outside buffer bounds'\n }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n }, TypeError)\nE('ERR_OUT_OF_RANGE',\n function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`\n let received = input\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n }\n msg += ` It must be ${range}. Received ${received}`\n return msg\n }, RangeError)\n\nfunction addNumericalSeparator (val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n validateNumber(offset, 'offset')\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1))\n }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === 'bigint' ? 'n' : ''\n let range\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n `${(byteLength + 1) * 8 - 1}${n}`\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`\n }\n throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n }\n checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n if (typeof value !== 'number') {\n throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n}\n\nfunction boundsError (value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type)\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n `>= ${type ? 1 : 0} and <= ${length}`,\n value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n let c, hi, lo\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n let i\n for (i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef'\n const table = new Array(256)\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n throw new Error('BigInt not supported')\n}\n","import {Buffer} from 'buffer';\n\nexport const toBuffer = (arr: Buffer | Uint8Array | Array<number>): Buffer => {\n if (arr instanceof Buffer) {\n return arr;\n } else if (arr instanceof Uint8Array) {\n return Buffer.from(arr.buffer, arr.byteOffset, arr.byteLength);\n } else {\n return Buffer.from(arr);\n }\n};\n","/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","// base-x encoding\n// Forked from https://github.com/cryptocoinjs/bs58\n// Originally written by Mike Hearn for BitcoinJ\n// Copyright (c) 2011 Google Inc\n// Ported to JavaScript by Stefan Thomas\n// Merged Buffer refactorings from base58-native by Stephen Pair\n// Copyright (c) 2013 BitPay Inc\n\nvar Buffer = require('safe-buffer').Buffer\n\nmodule.exports = function base (ALPHABET) {\n var ALPHABET_MAP = {}\n var BASE = ALPHABET.length\n var LEADER = ALPHABET.charAt(0)\n\n // pre-compute lookup table\n for (var z = 0; z < ALPHABET.length; z++) {\n var x = ALPHABET.charAt(z)\n\n if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')\n ALPHABET_MAP[x] = z\n }\n\n function encode (source) {\n if (source.length === 0) return ''\n\n var digits = [0]\n for (var i = 0; i < source.length; ++i) {\n for (var j = 0, carry = source[i]; j < digits.length; ++j) {\n carry += digits[j] << 8\n digits[j] = carry % BASE\n carry = (carry / BASE) | 0\n }\n\n while (carry > 0) {\n digits.push(carry % BASE)\n carry = (carry / BASE) | 0\n }\n }\n\n var string = ''\n\n // deal with leading zeros\n for (var k = 0; source[k] === 0 && k < source.length - 1; ++k) string += LEADER\n // convert digits to a string\n for (var q = digits.length - 1; q >= 0; --q) string += ALPHABET[digits[q]]\n\n return string\n }\n\n function decodeUnsafe (string) {\n if (typeof string !== 'string') throw new TypeError('Expected String')\n if (string.length === 0) return Buffer.allocUnsafe(0)\n\n var bytes = [0]\n for (var i = 0; i < string.length; i++) {\n var value = ALPHABET_MAP[string[i]]\n if (value === undefined) return\n\n for (var j = 0, carry = value; j < bytes.length; ++j) {\n carry += bytes[j] * BASE\n bytes[j] = carry & 0xff\n carry >>= 8\n }\n\n while (carry > 0) {\n bytes.push(carry & 0xff)\n carry >>= 8\n }\n }\n\n // deal with leading zeros\n for (var k = 0; string[k] === LEADER && k < string.length - 1; ++k) {\n bytes.push(0)\n }\n\n return Buffer.from(bytes.reverse())\n }\n\n function decode (string) {\n var buffer = decodeUnsafe(string)\n if (buffer) return buffer\n\n throw new Error('Non-base' + BASE + ' character')\n }\n\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n }\n}\n","var basex = require('base-x')\nvar ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n\nmodule.exports = basex(ALPHABET)\n","import BN from 'bn.js';\nimport bs58 from 'bs58';\nimport nacl from 'tweetnacl';\nimport {sha256} from 'crypto-hash';\nimport {Buffer} from 'buffer';\n\n/**\n * Maximum length of derived pubkey seed\n */\nexport const MAX_SEED_LENGTH = 32;\n\n/**\n * A public key\n */\nexport class PublicKey {\n /** @internal */\n _bn: BN;\n\n /**\n * Create a new PublicKey object\n * @param value ed25519 public key as buffer or base-58 encoded string\n */\n constructor(value: number | string | Buffer | Uint8Array | Array<number>) {\n if (typeof value === 'string') {\n // assume base 58 encoding by default\n const decoded = bs58.decode(value);\n if (decoded.length != 32) {\n throw new Error(`Invalid public key input`);\n }\n this._bn = new BN(decoded);\n } else {\n this._bn = new BN(value);\n }\n\n if (this._bn.byteLength() > 32) {\n throw new Error(`Invalid public key input`);\n }\n }\n\n /**\n * Checks if two publicKeys are equal\n */\n equals(publicKey: PublicKey): boolean {\n return this._bn.eq(publicKey._bn);\n }\n\n /**\n * Return the base-58 representation of the public key\n */\n toBase58(): string {\n return bs58.encode(this.toBuffer());\n }\n\n /**\n * Return the Buffer representation of the public key\n */\n toBuffer(): Buffer {\n const b = this._bn.toArrayLike(Buffer);\n if (b.length === 32) {\n return b;\n }\n\n const zeroPad = Buffer.alloc(32);\n b.copy(zeroPad, 32 - b.length);\n return zeroPad;\n }\n\n /**\n * Return the base-58 representation of the public key\n */\n toString(): string {\n return this.toBase58();\n }\n\n /**\n * Derive a public key from another key, a seed, and a program ID.\n */\n static async createWithSeed(\n fromPublicKey: PublicKey,\n seed: string,\n programId: PublicKey,\n ): Promise<PublicKey> {\n const buffer = Buffer.concat([\n fromPublicKey.toBuffer(),\n Buffer.from(seed),\n programId.toBuffer(),\n ]);\n const hash = await sha256(new Uint8Array(buffer));\n return new PublicKey(Buffer.from(hash, 'hex'));\n }\n\n /**\n * Derive a program address from seeds and a program ID.\n */\n static async createProgramAddress(\n seeds: Array<Buffer | Uint8Array>,\n programId: PublicKey,\n ): Promise<PublicKey> {\n let buffer = Buffer.alloc(0);\n seeds.forEach(function (seed) {\n if (seed.length > MAX_SEED_LENGTH) {\n throw new Error(`Max seed length exceeded`);\n }\n buffer = Buffer.concat([buffer, Buffer.from(seed)]);\n });\n buffer = Buffer.concat([\n buffer,\n programId.toBuffer(),\n Buffer.from('ProgramDerivedAddress'),\n ]);\n let hash = await sha256(new Uint8Array(buffer));\n let publicKeyBytes = new BN(hash, 16).toArray(undefined, 32);\n if (is_on_curve(publicKeyBytes)) {\n throw new Error(`Invalid seeds, address must fall off the curve`);\n }\n return new PublicKey(publicKeyBytes);\n }\n\n /**\n * Find a valid program address\n *\n * Valid program addresses must fall off the ed25519 curve. This function\n * iterates a nonce until it finds one that when combined with the seeds\n * results in a valid program address.\n */\n static async findProgramAddress(\n seeds: Array<Buffer | Uint8Array>,\n programId: PublicKey,\n ): Promise<[PublicKey, number]> {\n let nonce = 255;\n let address;\n while (nonce != 0) {\n try {\n const seedsWithNonce = seeds.concat(Buffer.from([nonce]));\n address = await this.createProgramAddress(seedsWithNonce, programId);\n } catch (err) {\n nonce--;\n continue;\n }\n return [address, nonce];\n }\n throw new Error(`Unable to find a viable program address nonce`);\n }\n}\n\n// @ts-ignore\nlet naclLowLevel = nacl.lowlevel;\n\n// Check that a pubkey is on the curve.\n// This function and its dependents were sourced from:\n// https://github.com/dchest/tweetnacl-js/blob/f1ec050ceae0861f34280e62498b1d3ed9c350c6/nacl.js#L792\nfunction is_on_curve(p: any) {\n var r = [\n naclLowLevel.gf(),\n naclLowLevel.gf(),\n naclLowLevel.gf(),\n naclLowLevel.gf(),\n ];\n\n var t = naclLowLevel.gf(),\n chk = naclLowLevel.gf(),\n num = naclLowLevel.gf(),\n den = naclLowLevel.gf(),\n den2 = naclLowLevel.gf(),\n den4 = naclLowLevel.gf(),\n den6 = naclLowLevel.gf();\n\n naclLowLevel.set25519(r[2], gf1);\n naclLowLevel.unpack25519(r[1], p);\n naclLowLevel.S(num, r[1]);\n naclLowLevel.M(den, num, naclLowLevel.D);\n naclLowLevel.Z(num, num, r[2]);\n naclLowLevel.A(den, r[2], den);\n\n naclLowLevel.S(den2, den);\n naclLowLevel.S(den4, den2);\n naclLowLevel.M(den6, den4, den2);\n naclLowLevel.M(t, den6, num);\n naclLowLevel.M(t, t, den);\n\n naclLowLevel.pow2523(t, t);\n naclLowLevel.M(t, t, num);\n naclLowLevel.M(t, t, den);\n naclLowLevel.M(t, t, den);\n naclLowLevel.M(r[0], t, den);\n\n naclLowLevel.S(chk, r[0]);\n naclLowLevel.M(chk, chk, den);\n if (neq25519(chk, num)) naclLowLevel.M(r[0], r[0], I);\n\n naclLowLevel.S(chk, r[0]);\n naclLowLevel.M(chk, chk, den);\n if (neq25519(chk, num)) return 0;\n return 1;\n}\nlet gf1 = naclLowLevel.gf([1]);\nlet I = naclLowLevel.gf([\n 0xa0b0,\n 0x4a0e,\n 0x1b27,\n 0xc4ee,\n 0xe478,\n 0xad2f,\n 0x1806,\n 0x2f43,\n 0xd7a7,\n 0x3dfb,\n 0x0099,\n 0x2b4d,\n 0xdf0b,\n 0x4fc1,\n 0x2480,\n 0x2b83,\n]);\nfunction neq25519(a: any, b: any) {\n var c = new Uint8Array(32),\n d = new Uint8Array(32);\n naclLowLevel.pack25519(c, a);\n naclLowLevel.pack25519(d, b);\n return naclLowLevel.crypto_verify_32(c, 0, d, 0);\n}\n","import * as nacl from 'tweetnacl';\nimport type {SignKeyPair as KeyPair} from 'tweetnacl';\n\nimport {toBuffer} from './util/to-buffer';\nimport {PublicKey} from './publickey';\n\n/**\n * An account key pair (public and secret keys).\n */\nexport class Account {\n /** @internal */\n _keypair: KeyPair;\n\n /**\n * Create a new Account object\n *\n * If the secretKey parameter is not provided a new key pair is randomly\n * created for the account\n *\n * @param secretKey Secret key for the account\n */\n constructor(secretKey?: Buffer | Uint8Array | Array<number>) {\n if (secretKey) {\n this._keypair = nacl.sign.keyPair.fromSecretKey(toBuffer(secretKey));\n } else {\n this._keypair = nacl.sign.keyPair();\n }\n }\n\n /**\n * The public key for this account\n */\n get publicKey(): PublicKey {\n return new PublicKey(this._keypair.publicKey);\n }\n\n /**\n * The **unencrypted** secret key for this account\n */\n get secretKey(): Buffer {\n return toBuffer(this._keypair.secretKey);\n }\n}\n","import {PublicKey} from './publickey';\n\nexport const BPF_LOADER_DEPRECATED_PROGRAM_ID = new PublicKey(\n 'BPFLoader1111111111111111111111111111111111',\n);\n","export default (typeof global !== \"undefined\" ? global :\n typeof self !== \"undefined\" ? self :\n typeof window !== \"undefined\" ? window : {});","\nvar inherits;\nif (typeof Object.create === 'function'){\n inherits = function inherits(ctor, superCtor) {\n // implementation from standard node.js 'util' module\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n inherits = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\nexport default inherits;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\nimport process from 'process';\nvar formatRegExp = /%[sdj%]/g;\nexport function format(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexport function deprecate(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexport function debuglog(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = 0;\n debugs[set] = function() {\n var msg = format.apply(null, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nexport function inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n _extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nexport function isArray(ar) {\n return Array.isArray(ar);\n}\n\nexport function isBoolean(arg) {\n return typeof arg === 'boolean';\n}\n\nexport function isNull(arg) {\n return arg === null;\n}\n\nexport function isNullOrUndefined(arg) {\n return arg == null;\n}\n\nexport function isNumber(arg) {\n return typeof arg === 'number';\n}\n\nexport function isString(arg) {\n return typeof arg === 'string';\n}\n\nexport function isSymbol(arg) {\n return typeof arg === 'symbol';\n}\n\nexport function isUndefined(arg) {\n return arg === void 0;\n}\n\nexport function isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\n\nexport function isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nexport function isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\n\nexport function isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\n\nexport function isFunction(arg) {\n return typeof arg === 'function';\n}\n\nexport function isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\n\nexport function isBuffer(maybeBuf) {\n return Buffer.isBuffer(maybeBuf);\n}\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexport function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n}\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nimport inherits from './inherits';\nexport {inherits}\n\nexport function _extend(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport default {\n inherits: inherits,\n _extend: _extend,\n log: log,\n isBuffer: isBuffer,\n isPrimitive: isPrimitive,\n isFunction: isFunction,\n isError: isError,\n isDate: isDate,\n isObject: isObject,\n isRegExp: isRegExp,\n isUndefined: isUndefined,\n isSymbol: isSymbol,\n isString: isString,\n isNumber: isNumber,\n isNullOrUndefined: isNullOrUndefined,\n isNull: isNull,\n isBoolean: isBoolean,\n isArray: isArray,\n inspect: inspect,\n deprecate: deprecate,\n format: format,\n debuglog: debuglog\n}\n","\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n if (hasOwn.call(obj, key)) keys.push(key);\n }\n return keys;\n};\n// based on node assert, original notice:\n\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nimport {isBuffer} from 'buffer';\nimport {isPrimitive, inherits, isError, isFunction, isRegExp, isDate, inspect as utilInspect} from 'util';\nvar pSlice = Array.prototype.slice;\nvar _functionsHaveNames;\nfunction functionsHaveNames() {\n if (typeof _functionsHaveNames !== 'undefined') {\n return _functionsHaveNames;\n }\n return _functionsHaveNames = (function () {\n return function foo() {}.name === 'foo';\n }());\n}\nfunction pToString (obj) {\n return Object.prototype.toString.call(obj);\n}\nfunction isView(arrbuf) {\n if (isBuffer(arrbuf)) {\n return false;\n }\n if (typeof global.ArrayBuffer !== 'function') {\n return false;\n }\n if (typeof ArrayBuffer.isView === 'function') {\n return ArrayBuffer.isView(arrbuf);\n }\n if (!arrbuf) {\n return false;\n }\n if (arrbuf instanceof DataView) {\n return true;\n }\n if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {\n return true;\n }\n return false;\n}\n// 1. The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nfunction assert(value, message) {\n if (!value) fail(value, true, message, '==', ok);\n}\nexport default assert;\n\n// 2. The AssertionError is defined in assert.\n// new assert.AssertionError({ message: message,\n// actual: actual,\n// expected: expected })\n\nvar regex = /\\s*function\\s+([^\\(\\s]*)\\s*/;\n// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js\nfunction getName(func) {\n if (!isFunction(func)) {\n return;\n }\n if (functionsHaveNames()) {\n return func.name;\n }\n var str = func.toString();\n var match = str.match(regex);\n return match && match[1];\n}\nassert.AssertionError = AssertionError;\nexport function AssertionError(options) {\n this.name = 'AssertionError';\n this.actual = options.actual;\n this.expected = options.expected;\n this.operator = options.operator;\n if (options.message) {\n this.message = options.message;\n this.generatedMessage = false;\n } else {\n this.message = getMessage(this);\n this.generatedMessage = true;\n }\n var stackStartFunction = options.stackStartFunction || fail;\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, stackStartFunction);\n } else {\n // non v8 browsers so we can have a stacktrace\n var err = new Error();\n if (err.stack) {\n var out = err.stack;\n\n // try to strip useless frames\n var fn_name = getName(stackStartFunction);\n var idx = out.indexOf('\\n' + fn_name);\n if (idx >= 0) {\n // once we have located the function frame\n // we need to strip out everything before it (and its line)\n var next_line = out.indexOf('\\n', idx + 1);\n out = out.substring(next_line + 1);\n }\n\n this.stack = out;\n }\n }\n}\n\n// assert.AssertionError instanceof Error\ninherits(AssertionError, Error);\n\nfunction truncate(s, n) {\n if (typeof s === 'string') {\n return s.length < n ? s : s.slice(0, n);\n } else {\n return s;\n }\n}\nfunction inspect(something) {\n if (functionsHaveNames() || !isFunction(something)) {\n return utilInspect(something);\n }\n var rawname = getName(something);\n var name = rawname ? ': ' + rawname : '';\n return '[Function' + name + ']';\n}\nfunction getMessage(self) {\n return truncate(inspect(self.actual), 128) + ' ' +\n self.operator + ' ' +\n truncate(inspect(self.expected), 128);\n}\n\n// At present only the three keys mentioned above are used and\n// understood by the spec. Implementations or sub modules can pass\n// other keys to the AssertionError's constructor - they will be\n// ignored.\n\n// 3. All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nexport function fail(actual, expected, message, operator, stackStartFunction) {\n throw new AssertionError({\n message: message,\n actual: actual,\n expected: expected,\n operator: operator,\n stackStartFunction: stackStartFunction\n });\n}\n\n// EXTENSION! allows for well behaved errors defined elsewhere.\nassert.fail = fail;\n\n// 4. Pure assertion tests whether a value is truthy, as determined\n// by !!guard.\n// assert.ok(guard, message_opt);\n// This statement is equivalent to assert.equal(true, !!guard,\n// message_opt);. To test strictly for the value true, use\n// assert.strictEqual(true, guard, message_opt);.\n\nexport function ok(value, message) {\n if (!value) fail(value, true, message, '==', ok);\n}\nassert.ok = ok;\nexport {ok as assert};\n\n// 5. The equality assertion tests shallow, coercive equality with\n// ==.\n// assert.equal(actual, expected, message_opt);\nassert.equal = equal;\nexport function equal(actual, expected, message) {\n if (actual != expected) fail(actual, expected, message, '==', equal);\n}\n\n// 6. The non-equality assertion tests for whether two objects are not equal\n// with != assert.notEqual(actual, expected, message_opt);\nassert.notEqual = notEqual;\nexport function notEqual(actual, expected, message) {\n if (actual == expected) {\n fail(actual, expected, message, '!=', notEqual);\n }\n}\n\n// 7. The equivalence assertion tests a deep equality relation.\n// assert.deepEqual(actual, expected, message_opt);\nassert.deepEqual = deepEqual;\nexport function deepEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'deepEqual', deepEqual);\n }\n}\nassert.deepStrictEqual = deepStrictEqual;\nexport function deepStrictEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'deepStrictEqual', deepStrictEqual);\n }\n}\n\nfunction _deepEqual(actual, expected, strict, memos) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n } else if (isBuffer(actual) && isBuffer(expected)) {\n return compare(actual, expected) === 0;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (isDate(actual) && isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (isRegExp(actual) && isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if ((actual === null || typeof actual !== 'object') &&\n (expected === null || typeof expected !== 'object')) {\n return strict ? actual === expected : actual == expected;\n\n // If both values are instances of typed arrays, wrap their underlying\n // ArrayBuffers in a Buffer each to increase performance\n // This optimization requires the arrays to have the same type as checked by\n // Object.prototype.toString (aka pToString). Never perform binary\n // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their\n // bit patterns are not identical.\n } else if (isView(actual) && isView(expected) &&\n pToString(actual) === pToString(expected) &&\n !(actual instanceof Float32Array ||\n actual instanceof Float64Array)) {\n return compare(new Uint8Array(actual.buffer),\n new Uint8Array(expected.buffer)) === 0;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else if (isBuffer(actual) !== isBuffer(expected)) {\n return false;\n } else {\n memos = memos || {actual: [], expected: []};\n\n var actualIndex = memos.actual.indexOf(actual);\n if (actualIndex !== -1) {\n if (actualIndex === memos.expected.indexOf(expected)) {\n return true;\n }\n }\n\n memos.actual.push(actual);\n memos.expected.push(expected);\n\n return objEquiv(actual, expected, strict, memos);\n }\n}\n\nfunction isArguments(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\nfunction objEquiv(a, b, strict, actualVisitedObjects) {\n if (a === null || a === undefined || b === null || b === undefined)\n return false;\n // if one is a primitive, the other must be same\n if (isPrimitive(a) || isPrimitive(b))\n return a === b;\n if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))\n return false;\n var aIsArgs = isArguments(a);\n var bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))\n return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return _deepEqual(a, b, strict);\n }\n var ka = objectKeys(a);\n var kb = objectKeys(b);\n var key, i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length !== kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] !== kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))\n return false;\n }\n return true;\n}\n\n// 8. The non-equivalence assertion tests for any deep inequality.\n// assert.notDeepEqual(actual, expected, message_opt);\nassert.notDeepEqual = notDeepEqual;\nexport function notDeepEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'notDeepEqual', notDeepEqual);\n }\n}\n\nassert.notDeepStrictEqual = notDeepStrictEqual;\nexport function notDeepStrictEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);\n }\n}\n\n\n// 9. The strict equality assertion tests strict equality, as determined by ===.\n// assert.strictEqual(actual, expected, message_opt);\nassert.strictEqual = strictEqual;\nexport function strictEqual(actual, expected, message) {\n if (actual !== expected) {\n fail(actual, expected, message, '===', strictEqual);\n }\n}\n\n// 10. The strict non-equality assertion tests for strict inequality, as\n// determined by !==. assert.notStrictEqual(actual, expected, message_opt);\nassert.notStrictEqual = notStrictEqual;\nexport function notStrictEqual(actual, expected, message) {\n if (actual === expected) {\n fail(actual, expected, message, '!==', notStrictEqual);\n }\n}\n\nfunction expectedException(actual, expected) {\n if (!actual || !expected) {\n return false;\n }\n\n if (Object.prototype.toString.call(expected) == '[object RegExp]') {\n return expected.test(actual);\n }\n\n try {\n if (actual instanceof expected) {\n return true;\n }\n } catch (e) {\n // Ignore. The instanceof check doesn't work for arrow functions.\n }\n\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n\n return expected.call({}, actual) === true;\n}\n\nfunction _tryBlock(block) {\n var error;\n try {\n block();\n } catch (e) {\n error = e;\n }\n return error;\n}\n\nfunction _throws(shouldThrow, block, expected, message) {\n var actual;\n\n if (typeof block !== 'function') {\n throw new TypeError('\"block\" argument must be a function');\n }\n\n if (typeof expected === 'string') {\n message = expected;\n expected = null;\n }\n\n actual = _tryBlock(block);\n\n message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +\n (message ? ' ' + message : '.');\n\n if (shouldThrow && !actual) {\n fail(actual, expected, 'Missing expected exception' + message);\n }\n\n var userProvidedMessage = typeof message === 'string';\n var isUnwantedException = !shouldThrow && isError(actual);\n var isUnexpectedException = !shouldThrow && actual && !expected;\n\n if ((isUnwantedException &&\n userProvidedMessage &&\n expectedException(actual, expected)) ||\n isUnexpectedException) {\n fail(actual, expected, 'Got unwanted exception' + message);\n }\n\n if ((shouldThrow && actual && expected &&\n !expectedException(actual, expected)) || (!shouldThrow && actual)) {\n throw actual;\n }\n}\n\n// 11. Expected to throw an error:\n// assert.throws(block, Error_opt, message_opt);\nassert.throws = throws;\nexport function throws(block, /*optional*/error, /*optional*/message) {\n _throws(true, block, error, message);\n}\n\n// EXTENSION! This is annoying to write outside this module.\nassert.doesNotThrow = doesNotThrow;\nexport function doesNotThrow(block, /*optional*/error, /*optional*/message) {\n _throws(false, block, error, message);\n}\n\nassert.ifError = ifError;\nexport function ifError(err) {\n if (err) throw err;\n}\n","/* The MIT License (MIT)\n *\n * Copyright 2015-2018 Peter A. Bigot\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Support for translating between Buffer instances and JavaScript\n * native types.\n *\n * {@link module:Layout~Layout|Layout} is the basis of a class\n * hierarchy that associates property names with sequences of encoded\n * bytes.\n *\n * Layouts are supported for these scalar (numeric) types:\n * * {@link module:Layout~UInt|Unsigned integers in little-endian\n * format} with {@link module:Layout.u8|8-bit}, {@link\n * module:Layout.u16|16-bit}, {@link module:Layout.u24|24-bit},\n * {@link module:Layout.u32|32-bit}, {@link\n * module:Layout.u40|40-bit}, and {@link module:Layout.u48|48-bit}\n * representation ranges;\n * * {@link module:Layout~UIntBE|Unsigned integers in big-endian\n * format} with {@link module:Layout.u16be|16-bit}, {@link\n * module:Layout.u24be|24-bit}, {@link module:Layout.u32be|32-bit},\n * {@link module:Layout.u40be|40-bit}, and {@link\n * module:Layout.u48be|48-bit} representation ranges;\n * * {@link module:Layout~Int|Signed integers in little-endian\n * format} with {@link module:Layout.s8|8-bit}, {@link\n * module:Layout.s16|16-bit}, {@link module:Layout.s24|24-bit},\n * {@link module:Layout.s32|32-bit}, {@link\n * module:Layout.s40|40-bit}, and {@link module:Layout.s48|48-bit}\n * representation ranges;\n * * {@link module:Layout~IntBE|Signed integers in big-endian format}\n * with {@link module:Layout.s16be|16-bit}, {@link\n * module:Layout.s24be|24-bit}, {@link module:Layout.s32be|32-bit},\n * {@link module:Layout.s40be|40-bit}, and {@link\n * module:Layout.s48be|48-bit} representation ranges;\n * * 64-bit integral values that decode to an exact (if magnitude is\n * less than 2^53) or nearby integral Number in {@link\n * module:Layout.nu64|unsigned little-endian}, {@link\n * module:Layout.nu64be|unsigned big-endian}, {@link\n * module:Layout.ns64|signed little-endian}, and {@link\n * module:Layout.ns64be|unsigned big-endian} encodings;\n * * 32-bit floating point values with {@link\n * module:Layout.f32|little-endian} and {@link\n * module:Layout.f32be|big-endian} representations;\n * * 64-bit floating point values with {@link\n * module:Layout.f64|little-endian} and {@link\n * module:Layout.f64be|big-endian} representations;\n * * {@link module:Layout.const|Constants} that take no space in the\n * encoded expression.\n *\n * and for these aggregate types:\n * * {@link module:Layout.seq|Sequence}s of instances of a {@link\n * module:Layout~Layout|Layout}, with JavaScript representation as\n * an Array and constant or data-dependent {@link\n * module:Layout~Sequence#count|length};\n * * {@link module:Layout.struct|Structure}s that aggregate a\n * heterogeneous sequence of {@link module:Layout~Layout|Layout}\n * instances, with JavaScript representation as an Object;\n * * {@link module:Layout.union|Union}s that support multiple {@link\n * module:Layout~VariantLayout|variant layouts} over a fixed\n * (padded) or variable (not padded) span of bytes, using an\n * unsigned integer at the start of the data or a separate {@link\n * module:Layout.unionLayoutDiscriminator|layout element} to\n * determine which layout to use when interpreting the buffer\n * contents;\n * * {@link module:Layout.bits|BitStructure}s that contain a sequence\n * of individual {@link\n * module:Layout~BitStructure#addField|BitField}s packed into an 8,\n * 16, 24, or 32-bit unsigned integer starting at the least- or\n * most-significant bit;\n * * {@link module:Layout.cstr|C strings} of varying length;\n * * {@link module:Layout.blob|Blobs} of fixed- or variable-{@link\n * module:Layout~Blob#length|length} raw data.\n *\n * All {@link module:Layout~Layout|Layout} instances are immutable\n * after construction, to prevent internal state from becoming\n * inconsistent.\n *\n * @local Layout\n * @local ExternalLayout\n * @local GreedyCount\n * @local OffsetLayout\n * @local UInt\n * @local UIntBE\n * @local Int\n * @local IntBE\n * @local NearUInt64\n * @local NearUInt64BE\n * @local NearInt64\n * @local NearInt64BE\n * @local Float\n * @local FloatBE\n * @local Double\n * @local DoubleBE\n * @local Sequence\n * @local Structure\n * @local UnionDiscriminator\n * @local UnionLayoutDiscriminator\n * @local Union\n * @local VariantLayout\n * @local BitStructure\n * @local BitField\n * @local Boolean\n * @local Blob\n * @local CString\n * @local Constant\n * @local bindConstructorLayout\n * @module Layout\n * @license MIT\n * @author Peter A. Bigot\n * @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub}\n */\n\n'use strict';\n\nconst assert = require('assert');\n\n/**\n * Base class for layout objects.\n *\n * **NOTE** This is an abstract base class; you can create instances\n * if it amuses you, but they won't support the {@link\n * Layout#encode|encode} or {@link Layout#decode|decode} functions.\n *\n * @param {Number} span - Initializer for {@link Layout#span|span}. The\n * parameter must be an integer; a negative value signifies that the\n * span is {@link Layout#getSpan|value-specific}.\n *\n * @param {string} [property] - Initializer for {@link\n * Layout#property|property}.\n *\n * @abstract\n */\nclass Layout {\n constructor(span, property) {\n if (!Number.isInteger(span)) {\n throw new TypeError('span must be an integer');\n }\n\n /** The span of the layout in bytes.\n *\n * Positive values are generally expected.\n *\n * Zero will only appear in {@link Constant}s and in {@link\n * Sequence}s where the {@link Sequence#count|count} is zero.\n *\n * A negative value indicates that the span is value-specific, and\n * must be obtained using {@link Layout#getSpan|getSpan}. */\n this.span = span;\n\n /** The property name used when this layout is represented in an\n * Object.\n *\n * Used only for layouts that {@link Layout#decode|decode} to Object\n * instances. If left undefined the span of the unnamed layout will\n * be treated as padding: it will not be mutated by {@link\n * Layout#encode|encode} nor represented as a property in the\n * decoded Object. */\n this.property = property;\n }\n\n /** Function to create an Object into which decoded properties will\n * be written.\n *\n * Used only for layouts that {@link Layout#decode|decode} to Object\n * instances, which means:\n * * {@link Structure}\n * * {@link Union}\n * * {@link VariantLayout}\n * * {@link BitStructure}\n *\n * If left undefined the JavaScript representation of these layouts\n * will be Object instances.\n *\n * See {@link bindConstructorLayout}.\n */\n makeDestinationObject() {\n return {};\n }\n\n /**\n * Decode from a Buffer into an JavaScript value.\n *\n * @param {Buffer} b - the buffer from which encoded data is read.\n *\n * @param {Number} [offset] - the offset at which the encoded data\n * starts. If absent a zero offset is inferred.\n *\n * @returns {(Number|Array|Object)} - the value of the decoded data.\n *\n * @abstract\n */\n decode(b, offset) {\n throw new Error('Layout is abstract');\n }\n\n /**\n * Encode a JavaScript value into a Buffer.\n *\n * @param {(Number|Array|Object)} src - the value to be encoded into\n * the buffer. The type accepted depends on the (sub-)type of {@link\n * Layout}.\n *\n * @param {Buffer} b - the buffer into which encoded data will be\n * written.\n *\n * @param {Number} [offset] - the offset at which the encoded data\n * starts. If absent a zero offset is inferred.\n *\n * @returns {Number} - the number of bytes encoded, including the\n * space skipped for internal padding, but excluding data such as\n * {@link Sequence#count|lengths} when stored {@link\n * ExternalLayout|externally}. This is the adjustment to `offset`\n * producing the offset where data for the next layout would be\n * written.\n *\n * @abstract\n */\n encode(src, b, offset) {\n throw new Error('Layout is abstract');\n }\n\n /**\n * Calculate the span of a specific instance of a layout.\n *\n * @param {Buffer} b - the buffer that contains an encoded instance.\n *\n * @param {Number} [offset] - the offset at which the encoded instance\n * starts. If absent a zero offset is inferred.\n *\n * @return {Number} - the number of bytes covered by the layout\n * instance. If this method is not overridden in a subclass the\n * definition-time constant {@link Layout#span|span} will be\n * returned.\n *\n * @throws {RangeError} - if the length of the value cannot be\n * determined.\n */\n getSpan(b, offset) {\n if (0 > this.span) {\n throw new RangeError('indeterminate span');\n }\n return this.span;\n }\n\n /**\n * Replicate the layout using a new property.\n *\n * This function must be used to get a structurally-equivalent layout\n * with a different name since all {@link Layout} instances are\n * immutable.\n *\n * **NOTE** This is a shallow copy. All fields except {@link\n * Layout#property|property} are strictly equal to the origin layout.\n *\n * @param {String} property - the value for {@link\n * Layout#property|property} in the replica.\n *\n * @returns {Layout} - the copy with {@link Layout#property|property}\n * set to `property`.\n */\n replicate(property) {\n const rv = Object.create(this.constructor.prototype);\n Object.assign(rv, this);\n rv.property = property;\n return rv;\n }\n\n /**\n * Create an object from layout properties and an array of values.\n *\n * **NOTE** This function returns `undefined` if invoked on a layout\n * that does not return its value as an Object. Objects are\n * returned for things that are a {@link Structure}, which includes\n * {@link VariantLayout|variant layouts} if they are structures, and\n * excludes {@link Union}s. If you want this feature for a union\n * you must use {@link Union.getVariant|getVariant} to select the\n * desired layout.\n *\n * @param {Array} values - an array of values that correspond to the\n * default order for properties. As with {@link Layout#decode|decode}\n * layout elements that have no property name are skipped when\n * iterating over the array values. Only the top-level properties are\n * assigned; arguments are not assigned to properties of contained\n * layouts. Any unused values are ignored.\n *\n * @return {(Object|undefined)}\n */\n fromArray(values) {\n return undefined;\n }\n}\nexports.Layout = Layout;\n\n/* Provide text that carries a name (such as for a function that will\n * be throwing an error) annotated with the property of a given layout\n * (such as one for which the value was unacceptable).\n *\n * @ignore */\nfunction nameWithProperty(name, lo) {\n if (lo.property) {\n return name + '[' + lo.property + ']';\n }\n return name;\n}\nexports.nameWithProperty = nameWithProperty;\n\n/**\n * Augment a class so that instances can be encoded/decoded using a\n * given layout.\n *\n * Calling this function couples `Class` with `layout` in several ways:\n *\n * * `Class.layout_` becomes a static member property equal to `layout`;\n * * `layout.boundConstructor_` becomes a static member property equal\n * to `Class`;\n * * The {@link Layout#makeDestinationObject|makeDestinationObject()}\n * property of `layout` is set to a function that returns a `new\n * Class()`;\n * * `Class.decode(b, offset)` becomes a static member function that\n * delegates to {@link Layout#decode|layout.decode}. The\n * synthesized function may be captured and extended.\n * * `Class.prototype.encode(b, offset)` provides an instance member\n * function that delegates to {@link Layout#encode|layout.encode}\n * with `src` set to `this`. The synthesized function may be\n * captured and extended, but when the extension is invoked `this`\n * must be explicitly bound to the instance.\n *\n * @param {class} Class - a JavaScript class with a nullary\n * constructor.\n *\n * @param {Layout} layout - the {@link Layout} instance used to encode\n * instances of `Class`.\n */\nfunction bindConstructorLayout(Class, layout) {\n if ('function' !== typeof Class) {\n throw new TypeError('Class must be constructor');\n }\n if (Class.hasOwnProperty('layout_')) {\n throw new Error('Class is already bound to a layout');\n }\n if (!(layout && (layout instanceof Layout))) {\n throw new TypeError('layout must be a Layout');\n }\n if (layout.hasOwnProperty('boundConstructor_')) {\n throw new Error('layout is already bound to a constructor');\n }\n Class.layout_ = layout;\n layout.boundConstructor_ = Class;\n layout.makeDestinationObject = (() => new Class());\n Object.defineProperty(Class.prototype, 'encode', {\n value: function(b, offset) {\n return layout.encode(this, b, offset);\n },\n writable: true,\n });\n Object.defineProperty(Class, 'decode', {\n value: function(b, offset) {\n return layout.decode(b, offset);\n },\n writable: true,\n });\n}\nexports.bindConstructorLayout = bindConstructorLayout;\n\n/**\n * An object that behaves like a layout but does not consume space\n * within its containing layout.\n *\n * This is primarily used to obtain metadata about a member, such as a\n * {@link OffsetLayout} that can provide data about a {@link\n * Layout#getSpan|value-specific span}.\n *\n * **NOTE** This is an abstract base class; you can create instances\n * if it amuses you, but they won't support {@link\n * ExternalLayout#isCount|isCount} or other {@link Layout} functions.\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @abstract\n * @augments {Layout}\n */\nclass ExternalLayout extends Layout {\n /**\n * Return `true` iff the external layout decodes to an unsigned\n * integer layout.\n *\n * In that case it can be used as the source of {@link\n * Sequence#count|Sequence counts}, {@link Blob#length|Blob lengths},\n * or as {@link UnionLayoutDiscriminator#layout|external union\n * discriminators}.\n *\n * @abstract\n */\n isCount() {\n throw new Error('ExternalLayout is abstract');\n }\n}\n\n/**\n * An {@link ExternalLayout} that determines its {@link\n * Layout#decode|value} based on offset into and length of the buffer\n * on which it is invoked.\n *\n * *Factory*: {@link module:Layout.greedy|greedy}\n *\n * @param {Number} [elementSpan] - initializer for {@link\n * GreedyCount#elementSpan|elementSpan}.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {ExternalLayout}\n */\nclass GreedyCount extends ExternalLayout {\n constructor(elementSpan, property) {\n if (undefined === elementSpan) {\n elementSpan = 1;\n }\n if ((!Number.isInteger(elementSpan)) || (0 >= elementSpan)) {\n throw new TypeError('elementSpan must be a (positive) integer');\n }\n super(-1, property);\n\n /** The layout for individual elements of the sequence. The value\n * must be a positive integer. If not provided, the value will be\n * 1. */\n this.elementSpan = elementSpan;\n }\n\n /** @override */\n isCount() {\n return true;\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const rem = b.length - offset;\n return Math.floor(rem / this.elementSpan);\n }\n\n /** @override */\n encode(src, b, offset) {\n return 0;\n }\n}\n\n/**\n * An {@link ExternalLayout} that supports accessing a {@link Layout}\n * at a fixed offset from the start of another Layout. The offset may\n * be before, within, or after the base layout.\n *\n * *Factory*: {@link module:Layout.offset|offset}\n *\n * @param {Layout} layout - initializer for {@link\n * OffsetLayout#layout|layout}, modulo `property`.\n *\n * @param {Number} [offset] - Initializes {@link\n * OffsetLayout#offset|offset}. Defaults to zero.\n *\n * @param {string} [property] - Optional new property name for a\n * {@link Layout#replicate| replica} of `layout` to be used as {@link\n * OffsetLayout#layout|layout}. If not provided the `layout` is used\n * unchanged.\n *\n * @augments {Layout}\n */\nclass OffsetLayout extends ExternalLayout {\n constructor(layout, offset, property) {\n if (!(layout instanceof Layout)) {\n throw new TypeError('layout must be a Layout');\n }\n\n if (undefined === offset) {\n offset = 0;\n } else if (!Number.isInteger(offset)) {\n throw new TypeError('offset must be integer or undefined');\n }\n\n super(layout.span, property || layout.property);\n\n /** The subordinated layout. */\n this.layout = layout;\n\n /** The location of {@link OffsetLayout#layout} relative to the\n * start of another layout.\n *\n * The value may be positive or negative, but an error will thrown\n * if at the point of use it goes outside the span of the Buffer\n * being accessed. */\n this.offset = offset;\n }\n\n /** @override */\n isCount() {\n return ((this.layout instanceof UInt)\n || (this.layout instanceof UIntBE));\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return this.layout.decode(b, offset + this.offset);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return this.layout.encode(src, b, offset + this.offset);\n }\n}\n\n/**\n * Represent an unsigned integer in little-endian format.\n *\n * *Factory*: {@link module:Layout.u8|u8}, {@link\n * module:Layout.u16|u16}, {@link module:Layout.u24|u24}, {@link\n * module:Layout.u32|u32}, {@link module:Layout.u40|u40}, {@link\n * module:Layout.u48|u48}\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass UInt extends Layout {\n constructor(span, property) {\n super(span, property);\n if (6 < this.span) {\n throw new RangeError('span must not exceed 6 bytes');\n }\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readUIntLE(offset, this.span);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeUIntLE(src, offset, this.span);\n return this.span;\n }\n}\n\n/**\n * Represent an unsigned integer in big-endian format.\n *\n * *Factory*: {@link module:Layout.u8be|u8be}, {@link\n * module:Layout.u16be|u16be}, {@link module:Layout.u24be|u24be},\n * {@link module:Layout.u32be|u32be}, {@link\n * module:Layout.u40be|u40be}, {@link module:Layout.u48be|u48be}\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass UIntBE extends Layout {\n constructor(span, property) {\n super( span, property);\n if (6 < this.span) {\n throw new RangeError('span must not exceed 6 bytes');\n }\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readUIntBE(offset, this.span);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeUIntBE(src, offset, this.span);\n return this.span;\n }\n}\n\n/**\n * Represent a signed integer in little-endian format.\n *\n * *Factory*: {@link module:Layout.s8|s8}, {@link\n * module:Layout.s16|s16}, {@link module:Layout.s24|s24}, {@link\n * module:Layout.s32|s32}, {@link module:Layout.s40|s40}, {@link\n * module:Layout.s48|s48}\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Int extends Layout {\n constructor(span, property) {\n super(span, property);\n if (6 < this.span) {\n throw new RangeError('span must not exceed 6 bytes');\n }\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readIntLE(offset, this.span);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeIntLE(src, offset, this.span);\n return this.span;\n }\n}\n\n/**\n * Represent a signed integer in big-endian format.\n *\n * *Factory*: {@link module:Layout.s8be|s8be}, {@link\n * module:Layout.s16be|s16be}, {@link module:Layout.s24be|s24be},\n * {@link module:Layout.s32be|s32be}, {@link\n * module:Layout.s40be|s40be}, {@link module:Layout.s48be|s48be}\n *\n * @param {Number} span - initializer for {@link Layout#span|span}.\n * The parameter can range from 1 through 6.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass IntBE extends Layout {\n constructor(span, property) {\n super(span, property);\n if (6 < this.span) {\n throw new RangeError('span must not exceed 6 bytes');\n }\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readIntBE(offset, this.span);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeIntBE(src, offset, this.span);\n return this.span;\n }\n}\n\nconst V2E32 = Math.pow(2, 32);\n\n/* True modulus high and low 32-bit words, where low word is always\n * non-negative. */\nfunction divmodInt64(src) {\n const hi32 = Math.floor(src / V2E32);\n const lo32 = src - (hi32 * V2E32);\n // assert.equal(roundedInt64(hi32, lo32), src);\n // assert(0 <= lo32);\n return {hi32, lo32};\n}\n/* Reconstruct Number from quotient and non-negative remainder */\nfunction roundedInt64(hi32, lo32) {\n return hi32 * V2E32 + lo32;\n}\n\n/**\n * Represent an unsigned 64-bit integer in little-endian format when\n * encoded and as a near integral JavaScript Number when decoded.\n *\n * *Factory*: {@link module:Layout.nu64|nu64}\n *\n * **NOTE** Values with magnitude greater than 2^52 may not decode to\n * the exact value of the encoded representation.\n *\n * @augments {Layout}\n */\nclass NearUInt64 extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const lo32 = b.readUInt32LE(offset);\n const hi32 = b.readUInt32LE(offset + 4);\n return roundedInt64(hi32, lo32);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const split = divmodInt64(src);\n b.writeUInt32LE(split.lo32, offset);\n b.writeUInt32LE(split.hi32, offset + 4);\n return 8;\n }\n}\n\n/**\n * Represent an unsigned 64-bit integer in big-endian format when\n * encoded and as a near integral JavaScript Number when decoded.\n *\n * *Factory*: {@link module:Layout.nu64be|nu64be}\n *\n * **NOTE** Values with magnitude greater than 2^52 may not decode to\n * the exact value of the encoded representation.\n *\n * @augments {Layout}\n */\nclass NearUInt64BE extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const hi32 = b.readUInt32BE(offset);\n const lo32 = b.readUInt32BE(offset + 4);\n return roundedInt64(hi32, lo32);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const split = divmodInt64(src);\n b.writeUInt32BE(split.hi32, offset);\n b.writeUInt32BE(split.lo32, offset + 4);\n return 8;\n }\n}\n\n/**\n * Represent a signed 64-bit integer in little-endian format when\n * encoded and as a near integral JavaScript Number when decoded.\n *\n * *Factory*: {@link module:Layout.ns64|ns64}\n *\n * **NOTE** Values with magnitude greater than 2^52 may not decode to\n * the exact value of the encoded representation.\n *\n * @augments {Layout}\n */\nclass NearInt64 extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const lo32 = b.readUInt32LE(offset);\n const hi32 = b.readInt32LE(offset + 4);\n return roundedInt64(hi32, lo32);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const split = divmodInt64(src);\n b.writeUInt32LE(split.lo32, offset);\n b.writeInt32LE(split.hi32, offset + 4);\n return 8;\n }\n}\n\n/**\n * Represent a signed 64-bit integer in big-endian format when\n * encoded and as a near integral JavaScript Number when decoded.\n *\n * *Factory*: {@link module:Layout.ns64be|ns64be}\n *\n * **NOTE** Values with magnitude greater than 2^52 may not decode to\n * the exact value of the encoded representation.\n *\n * @augments {Layout}\n */\nclass NearInt64BE extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const hi32 = b.readInt32BE(offset);\n const lo32 = b.readUInt32BE(offset + 4);\n return roundedInt64(hi32, lo32);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const split = divmodInt64(src);\n b.writeInt32BE(split.hi32, offset);\n b.writeUInt32BE(split.lo32, offset + 4);\n return 8;\n }\n}\n\n/**\n * Represent a 32-bit floating point number in little-endian format.\n *\n * *Factory*: {@link module:Layout.f32|f32}\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Float extends Layout {\n constructor(property) {\n super(4, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readFloatLE(offset);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeFloatLE(src, offset);\n return 4;\n }\n}\n\n/**\n * Represent a 32-bit floating point number in big-endian format.\n *\n * *Factory*: {@link module:Layout.f32be|f32be}\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass FloatBE extends Layout {\n constructor(property) {\n super(4, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readFloatBE(offset);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeFloatBE(src, offset);\n return 4;\n }\n}\n\n/**\n * Represent a 64-bit floating point number in little-endian format.\n *\n * *Factory*: {@link module:Layout.f64|f64}\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Double extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readDoubleLE(offset);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeDoubleLE(src, offset);\n return 8;\n }\n}\n\n/**\n * Represent a 64-bit floating point number in big-endian format.\n *\n * *Factory*: {@link module:Layout.f64be|f64be}\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass DoubleBE extends Layout {\n constructor(property) {\n super(8, property);\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n return b.readDoubleBE(offset);\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n b.writeDoubleBE(src, offset);\n return 8;\n }\n}\n\n/**\n * Represent a contiguous sequence of a specific layout as an Array.\n *\n * *Factory*: {@link module:Layout.seq|seq}\n *\n * @param {Layout} elementLayout - initializer for {@link\n * Sequence#elementLayout|elementLayout}.\n *\n * @param {(Number|ExternalLayout)} count - initializer for {@link\n * Sequence#count|count}. The parameter must be either a positive\n * integer or an instance of {@link ExternalLayout}.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Sequence extends Layout {\n constructor(elementLayout, count, property) {\n if (!(elementLayout instanceof Layout)) {\n throw new TypeError('elementLayout must be a Layout');\n }\n if (!(((count instanceof ExternalLayout) && count.isCount())\n || (Number.isInteger(count) && (0 <= count)))) {\n throw new TypeError('count must be non-negative integer '\n + 'or an unsigned integer ExternalLayout');\n }\n let span = -1;\n if ((!(count instanceof ExternalLayout))\n && (0 < elementLayout.span)) {\n span = count * elementLayout.span;\n }\n\n super(span, property);\n\n /** The layout for individual elements of the sequence. */\n this.elementLayout = elementLayout;\n\n /** The number of elements in the sequence.\n *\n * This will be either a non-negative integer or an instance of\n * {@link ExternalLayout} for which {@link\n * ExternalLayout#isCount|isCount()} is `true`. */\n this.count = count;\n }\n\n /** @override */\n getSpan(b, offset) {\n if (0 <= this.span) {\n return this.span;\n }\n if (undefined === offset) {\n offset = 0;\n }\n let span = 0;\n let count = this.count;\n if (count instanceof ExternalLayout) {\n count = count.decode(b, offset);\n }\n if (0 < this.elementLayout.span) {\n span = count * this.elementLayout.span;\n } else {\n let idx = 0;\n while (idx < count) {\n span += this.elementLayout.getSpan(b, offset + span);\n ++idx;\n }\n }\n return span;\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const rv = [];\n let i = 0;\n let count = this.count;\n if (count instanceof ExternalLayout) {\n count = count.decode(b, offset);\n }\n while (i < count) {\n rv.push(this.elementLayout.decode(b, offset));\n offset += this.elementLayout.getSpan(b, offset);\n i += 1;\n }\n return rv;\n }\n\n /** Implement {@link Layout#encode|encode} for {@link Sequence}.\n *\n * **NOTE** If `src` is shorter than {@link Sequence#count|count} then\n * the unused space in the buffer is left unchanged. If `src` is\n * longer than {@link Sequence#count|count} the unneeded elements are\n * ignored.\n *\n * **NOTE** If {@link Layout#count|count} is an instance of {@link\n * ExternalLayout} then the length of `src` will be encoded as the\n * count after `src` is encoded. */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const elo = this.elementLayout;\n const span = src.reduce((span, v) => {\n return span + elo.encode(v, b, offset + span);\n }, 0);\n if (this.count instanceof ExternalLayout) {\n this.count.encode(src.length, b, offset);\n }\n return span;\n }\n}\n\n/**\n * Represent a contiguous sequence of arbitrary layout elements as an\n * Object.\n *\n * *Factory*: {@link module:Layout.struct|struct}\n *\n * **NOTE** The {@link Layout#span|span} of the structure is variable\n * if any layout in {@link Structure#fields|fields} has a variable\n * span. When {@link Layout#encode|encoding} we must have a value for\n * all variable-length fields, or we wouldn't be able to figure out\n * how much space to use for storage. We can only identify the value\n * for a field when it has a {@link Layout#property|property}. As\n * such, although a structure may contain both unnamed fields and\n * variable-length fields, it cannot contain an unnamed\n * variable-length field.\n *\n * @param {Layout[]} fields - initializer for {@link\n * Structure#fields|fields}. An error is raised if this contains a\n * variable-length field for which a {@link Layout#property|property}\n * is not defined.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @param {Boolean} [decodePrefixes] - initializer for {@link\n * Structure#decodePrefixes|property}.\n *\n * @throws {Error} - if `fields` contains an unnamed variable-length\n * layout.\n *\n * @augments {Layout}\n */\nclass Structure extends Layout {\n constructor(fields, property, decodePrefixes) {\n if (!(Array.isArray(fields)\n && fields.reduce((acc, v) => acc && (v instanceof Layout), true))) {\n throw new TypeError('fields must be array of Layout instances');\n }\n if (('boolean' === typeof property)\n && (undefined === decodePrefixes)) {\n decodePrefixes = property;\n property = undefined;\n }\n\n /* Verify absence of unnamed variable-length fields. */\n for (const fd of fields) {\n if ((0 > fd.span)\n && (undefined === fd.property)) {\n throw new Error('fields cannot contain unnamed variable-length layout');\n }\n }\n\n let span = -1;\n try {\n span = fields.reduce((span, fd) => span + fd.getSpan(), 0);\n } catch (e) {\n }\n super(span, property);\n\n /** The sequence of {@link Layout} values that comprise the\n * structure.\n *\n * The individual elements need not be the same type, and may be\n * either scalar or aggregate layouts. If a member layout leaves\n * its {@link Layout#property|property} undefined the\n * corresponding region of the buffer associated with the element\n * will not be mutated.\n *\n * @type {Layout[]} */\n this.fields = fields;\n\n /** Control behavior of {@link Layout#decode|decode()} given short\n * buffers.\n *\n * In some situations a structure many be extended with additional\n * fields over time, with older installations providing only a\n * prefix of the full structure. If this property is `true`\n * decoding will accept those buffers and leave subsequent fields\n * undefined, as long as the buffer ends at a field boundary.\n * Defaults to `false`. */\n this.decodePrefixes = !!decodePrefixes;\n }\n\n /** @override */\n getSpan(b, offset) {\n if (0 <= this.span) {\n return this.span;\n }\n if (undefined === offset) {\n offset = 0;\n }\n let span = 0;\n try {\n span = this.fields.reduce((span, fd) => {\n const fsp = fd.getSpan(b, offset);\n offset += fsp;\n return span + fsp;\n }, 0);\n } catch (e) {\n throw new RangeError('indeterminate span');\n }\n return span;\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const dest = this.makeDestinationObject();\n for (const fd of this.fields) {\n if (undefined !== fd.property) {\n dest[fd.property] = fd.decode(b, offset);\n }\n offset += fd.getSpan(b, offset);\n if (this.decodePrefixes\n && (b.length === offset)) {\n break;\n }\n }\n return dest;\n }\n\n /** Implement {@link Layout#encode|encode} for {@link Structure}.\n *\n * If `src` is missing a property for a member with a defined {@link\n * Layout#property|property} the corresponding region of the buffer is\n * left unmodified. */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const firstOffset = offset;\n let lastOffset = 0;\n let lastWrote = 0;\n for (const fd of this.fields) {\n let span = fd.span;\n lastWrote = (0 < span) ? span : 0;\n if (undefined === fd.property) {\n /* By construction the field must be fixed-length (because\n * unnamed variable-length fields are disallowed when\n * encoding). But check it anyway. */\n assert(0 < span);\n } else {\n const fv = src[fd.property];\n if (undefined !== fv) {\n lastWrote = fd.encode(fv, b, offset);\n if (0 > span) {\n /* Read the as-encoded span, which is not necessarily the\n * same as what we wrote. */\n span = fd.getSpan(b, offset);\n }\n }\n }\n lastOffset = offset;\n offset += span;\n }\n /* Use (lastOffset + lastWrote) instead of offset because the last\n * item may have had a dynamic length and we don't want to include\n * the padding between it and the end of the space reserved for\n * it. */\n return (lastOffset + lastWrote) - firstOffset;\n }\n\n /** @override */\n fromArray(values) {\n const dest = this.makeDestinationObject();\n for (const fd of this.fields) {\n if ((undefined !== fd.property)\n && (0 < values.length)) {\n dest[fd.property] = values.shift();\n }\n }\n return dest;\n }\n\n /**\n * Get access to the layout of a given property.\n *\n * @param {String} property - the structure member of interest.\n *\n * @return {Layout} - the layout associated with `property`, or\n * undefined if there is no such property.\n */\n layoutFor(property) {\n if ('string' !== typeof property) {\n throw new TypeError('property must be string');\n }\n for (const fd of this.fields) {\n if (fd.property === property) {\n return fd;\n }\n }\n }\n\n /**\n * Get the offset of a structure member.\n *\n * @param {String} property - the structure member of interest.\n *\n * @return {Number} - the offset in bytes to the start of `property`\n * within the structure, or undefined if `property` is not a field\n * within the structure. If the property is a member but follows a\n * variable-length structure member a negative number will be\n * returned.\n */\n offsetOf(property) {\n if ('string' !== typeof property) {\n throw new TypeError('property must be string');\n }\n let offset = 0;\n for (const fd of this.fields) {\n if (fd.property === property) {\n return offset;\n }\n if (0 > fd.span) {\n offset = -1;\n } else if (0 <= offset) {\n offset += fd.span;\n }\n }\n }\n}\n\n/**\n * An object that can provide a {@link\n * Union#discriminator|discriminator} API for {@link Union}.\n *\n * **NOTE** This is an abstract base class; you can create instances\n * if it amuses you, but they won't support the {@link\n * UnionDiscriminator#encode|encode} or {@link\n * UnionDiscriminator#decode|decode} functions.\n *\n * @param {string} [property] - Default for {@link\n * UnionDiscriminator#property|property}.\n *\n * @abstract\n */\nclass UnionDiscriminator {\n constructor(property) {\n /** The {@link Layout#property|property} to be used when the\n * discriminator is referenced in isolation (generally when {@link\n * Union#decode|Union decode} cannot delegate to a specific\n * variant). */\n this.property = property;\n }\n\n /** Analog to {@link Layout#decode|Layout decode} for union discriminators.\n *\n * The implementation of this method need not reference the buffer if\n * variant information is available through other means. */\n decode() {\n throw new Error('UnionDiscriminator is abstract');\n }\n\n /** Analog to {@link Layout#decode|Layout encode} for union discriminators.\n *\n * The implementation of this method need not store the value if\n * variant information is maintained through other means. */\n encode() {\n throw new Error('UnionDiscriminator is abstract');\n }\n}\n\n/**\n * An object that can provide a {@link\n * UnionDiscriminator|discriminator API} for {@link Union} using an\n * unsigned integral {@link Layout} instance located either inside or\n * outside the union.\n *\n * @param {ExternalLayout} layout - initializes {@link\n * UnionLayoutDiscriminator#layout|layout}. Must satisfy {@link\n * ExternalLayout#isCount|isCount()}.\n *\n * @param {string} [property] - Default for {@link\n * UnionDiscriminator#property|property}, superseding the property\n * from `layout`, but defaulting to `variant` if neither `property`\n * nor layout provide a property name.\n *\n * @augments {UnionDiscriminator}\n */\nclass UnionLayoutDiscriminator extends UnionDiscriminator {\n constructor(layout, property) {\n if (!((layout instanceof ExternalLayout)\n && layout.isCount())) {\n throw new TypeError('layout must be an unsigned integer ExternalLayout');\n }\n\n super(property || layout.property || 'variant');\n\n /** The {@link ExternalLayout} used to access the discriminator\n * value. */\n this.layout = layout;\n }\n\n /** Delegate decoding to {@link UnionLayoutDiscriminator#layout|layout}. */\n decode(b, offset) {\n return this.layout.decode(b, offset);\n }\n\n /** Delegate encoding to {@link UnionLayoutDiscriminator#layout|layout}. */\n encode(src, b, offset) {\n return this.layout.encode(src, b, offset);\n }\n}\n\n/**\n * Represent any number of span-compatible layouts.\n *\n * *Factory*: {@link module:Layout.union|union}\n *\n * If the union has a {@link Union#defaultLayout|default layout} that\n * layout must have a non-negative {@link Layout#span|span}. The span\n * of a fixed-span union includes its {@link\n * Union#discriminator|discriminator} if the variant is a {@link\n * Union#usesPrefixDiscriminator|prefix of the union}, plus the span\n * of its {@link Union#defaultLayout|default layout}.\n *\n * If the union does not have a default layout then the encoded span\n * of the union depends on the encoded span of its variant (which may\n * be fixed or variable).\n *\n * {@link VariantLayout#layout|Variant layout}s are added through\n * {@link Union#addVariant|addVariant}. If the union has a default\n * layout, the span of the {@link VariantLayout#layout|layout\n * contained by the variant} must not exceed the span of the {@link\n * Union#defaultLayout|default layout} (minus the span of a {@link\n * Union#usesPrefixDiscriminator|prefix disriminator}, if used). The\n * span of the variant will equal the span of the union itself.\n *\n * The variant for a buffer can only be identified from the {@link\n * Union#discriminator|discriminator} {@link\n * UnionDiscriminator#property|property} (in the case of the {@link\n * Union#defaultLayout|default layout}), or by using {@link\n * Union#getVariant|getVariant} and examining the resulting {@link\n * VariantLayout} instance.\n *\n * A variant compatible with a JavaScript object can be identified\n * using {@link Union#getSourceVariant|getSourceVariant}.\n *\n * @param {(UnionDiscriminator|ExternalLayout|Layout)} discr - How to\n * identify the layout used to interpret the union contents. The\n * parameter must be an instance of {@link UnionDiscriminator}, an\n * {@link ExternalLayout} that satisfies {@link\n * ExternalLayout#isCount|isCount()}, or {@link UInt} (or {@link\n * UIntBE}). When a non-external layout element is passed the layout\n * appears at the start of the union. In all cases the (synthesized)\n * {@link UnionDiscriminator} instance is recorded as {@link\n * Union#discriminator|discriminator}.\n *\n * @param {(Layout|null)} defaultLayout - initializer for {@link\n * Union#defaultLayout|defaultLayout}. If absent defaults to `null`.\n * If `null` there is no default layout: the union has data-dependent\n * length and attempts to decode or encode unrecognized variants will\n * throw an exception. A {@link Layout} instance must have a\n * non-negative {@link Layout#span|span}, and if it lacks a {@link\n * Layout#property|property} the {@link\n * Union#defaultLayout|defaultLayout} will be a {@link\n * Layout#replicate|replica} with property `content`.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Union extends Layout {\n constructor(discr, defaultLayout, property) {\n const upv = ((discr instanceof UInt)\n || (discr instanceof UIntBE));\n if (upv) {\n discr = new UnionLayoutDiscriminator(new OffsetLayout(discr));\n } else if ((discr instanceof ExternalLayout)\n && discr.isCount()) {\n discr = new UnionLayoutDiscriminator(discr);\n } else if (!(discr instanceof UnionDiscriminator)) {\n throw new TypeError('discr must be a UnionDiscriminator '\n + 'or an unsigned integer layout');\n }\n if (undefined === defaultLayout) {\n defaultLayout = null;\n }\n if (!((null === defaultLayout)\n || (defaultLayout instanceof Layout))) {\n throw new TypeError('defaultLayout must be null or a Layout');\n }\n if (null !== defaultLayout) {\n if (0 > defaultLayout.span) {\n throw new Error('defaultLayout must have constant span');\n }\n if (undefined === defaultLayout.property) {\n defaultLayout = defaultLayout.replicate('content');\n }\n }\n\n /* The union span can be estimated only if there's a default\n * layout. The union spans its default layout, plus any prefix\n * variant layout. By construction both layouts, if present, have\n * non-negative span. */\n let span = -1;\n if (defaultLayout) {\n span = defaultLayout.span;\n if ((0 <= span) && upv) {\n span += discr.layout.span;\n }\n }\n super(span, property);\n\n /** The interface for the discriminator value in isolation.\n *\n * This a {@link UnionDiscriminator} either passed to the\n * constructor or synthesized from the `discr` constructor\n * argument. {@link\n * Union#usesPrefixDiscriminator|usesPrefixDiscriminator} will be\n * `true` iff the `discr` parameter was a non-offset {@link\n * Layout} instance. */\n this.discriminator = discr;\n\n /** `true` if the {@link Union#discriminator|discriminator} is the\n * first field in the union.\n *\n * If `false` the discriminator is obtained from somewhere\n * else. */\n this.usesPrefixDiscriminator = upv;\n\n /** The layout for non-discriminator content when the value of the\n * discriminator is not recognized.\n *\n * This is the value passed to the constructor. It is\n * structurally equivalent to the second component of {@link\n * Union#layout|layout} but may have a different property\n * name. */\n this.defaultLayout = defaultLayout;\n\n /** A registry of allowed variants.\n *\n * The keys are unsigned integers which should be compatible with\n * {@link Union.discriminator|discriminator}. The property value\n * is the corresponding {@link VariantLayout} instances assigned\n * to this union by {@link Union#addVariant|addVariant}.\n *\n * **NOTE** The registry remains mutable so that variants can be\n * {@link Union#addVariant|added} at any time. Users should not\n * manipulate the content of this property. */\n this.registry = {};\n\n /* Private variable used when invoking getSourceVariant */\n let boundGetSourceVariant = this.defaultGetSourceVariant.bind(this);\n\n /** Function to infer the variant selected by a source object.\n *\n * Defaults to {@link\n * Union#defaultGetSourceVariant|defaultGetSourceVariant} but may\n * be overridden using {@link\n * Union#configGetSourceVariant|configGetSourceVariant}.\n *\n * @param {Object} src - as with {@link\n * Union#defaultGetSourceVariant|defaultGetSourceVariant}.\n *\n * @returns {(undefined|VariantLayout)} The default variant\n * (`undefined`) or first registered variant that uses a property\n * available in `src`. */\n this.getSourceVariant = function(src) {\n return boundGetSourceVariant(src);\n };\n\n /** Function to override the implementation of {@link\n * Union#getSourceVariant|getSourceVariant}.\n *\n * Use this if the desired variant cannot be identified using the\n * algorithm of {@link\n * Union#defaultGetSourceVariant|defaultGetSourceVariant}.\n *\n * **NOTE** The provided function will be invoked bound to this\n * Union instance, providing local access to {@link\n * Union#registry|registry}.\n *\n * @param {Function} gsv - a function that follows the API of\n * {@link Union#defaultGetSourceVariant|defaultGetSourceVariant}. */\n this.configGetSourceVariant = function(gsv) {\n boundGetSourceVariant = gsv.bind(this);\n };\n }\n\n /** @override */\n getSpan(b, offset) {\n if (0 <= this.span) {\n return this.span;\n }\n if (undefined === offset) {\n offset = 0;\n }\n /* Default layouts always have non-negative span, so we don't have\n * one and we have to recognize the variant which will in turn\n * determine the span. */\n const vlo = this.getVariant(b, offset);\n if (!vlo) {\n throw new Error('unable to determine span for unrecognized variant');\n }\n return vlo.getSpan(b, offset);\n }\n\n /**\n * Method to infer a registered Union variant compatible with `src`.\n *\n * The first satisified rule in the following sequence defines the\n * return value:\n * * If `src` has properties matching the Union discriminator and\n * the default layout, `undefined` is returned regardless of the\n * value of the discriminator property (this ensures the default\n * layout will be used);\n * * If `src` has a property matching the Union discriminator, the\n * value of the discriminator identifies a registered variant, and\n * either (a) the variant has no layout, or (b) `src` has the\n * variant's property, then the variant is returned (because the\n * source satisfies the constraints of the variant it identifies);\n * * If `src` does not have a property matching the Union\n * discriminator, but does have a property matching a registered\n * variant, then the variant is returned (because the source\n * matches a variant without an explicit conflict);\n * * An error is thrown (because we either can't identify a variant,\n * or we were explicitly told the variant but can't satisfy it).\n *\n * @param {Object} src - an object presumed to be compatible with\n * the content of the Union.\n *\n * @return {(undefined|VariantLayout)} - as described above.\n *\n * @throws {Error} - if `src` cannot be associated with a default or\n * registered variant.\n */\n defaultGetSourceVariant(src) {\n if (src.hasOwnProperty(this.discriminator.property)) {\n if (this.defaultLayout\n && src.hasOwnProperty(this.defaultLayout.property)) {\n return undefined;\n }\n const vlo = this.registry[src[this.discriminator.property]];\n if (vlo\n && ((!vlo.layout)\n || src.hasOwnProperty(vlo.property))) {\n return vlo;\n }\n } else {\n for (const tag in this.registry) {\n const vlo = this.registry[tag];\n if (src.hasOwnProperty(vlo.property)) {\n return vlo;\n }\n }\n }\n throw new Error('unable to infer src variant');\n }\n\n /** Implement {@link Layout#decode|decode} for {@link Union}.\n *\n * If the variant is {@link Union#addVariant|registered} the return\n * value is an instance of that variant, with no explicit\n * discriminator. Otherwise the {@link Union#defaultLayout|default\n * layout} is used to decode the content. */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n let dest;\n const dlo = this.discriminator;\n const discr = dlo.decode(b, offset);\n let clo = this.registry[discr];\n if (undefined === clo) {\n let contentOffset = 0;\n clo = this.defaultLayout;\n if (this.usesPrefixDiscriminator) {\n contentOffset = dlo.layout.span;\n }\n dest = this.makeDestinationObject();\n dest[dlo.property] = discr;\n dest[clo.property] = this.defaultLayout.decode(b, offset + contentOffset);\n } else {\n dest = clo.decode(b, offset);\n }\n return dest;\n }\n\n /** Implement {@link Layout#encode|encode} for {@link Union}.\n *\n * This API assumes the `src` object is consistent with the union's\n * {@link Union#defaultLayout|default layout}. To encode variants\n * use the appropriate variant-specific {@link VariantLayout#encode}\n * method. */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const vlo = this.getSourceVariant(src);\n if (undefined === vlo) {\n const dlo = this.discriminator;\n const clo = this.defaultLayout;\n let contentOffset = 0;\n if (this.usesPrefixDiscriminator) {\n contentOffset = dlo.layout.span;\n }\n dlo.encode(src[dlo.property], b, offset);\n return contentOffset + clo.encode(src[clo.property], b,\n offset + contentOffset);\n }\n return vlo.encode(src, b, offset);\n }\n\n /** Register a new variant structure within a union. The newly\n * created variant is returned.\n *\n * @param {Number} variant - initializer for {@link\n * VariantLayout#variant|variant}.\n *\n * @param {Layout} layout - initializer for {@link\n * VariantLayout#layout|layout}.\n *\n * @param {String} property - initializer for {@link\n * Layout#property|property}.\n *\n * @return {VariantLayout} */\n addVariant(variant, layout, property) {\n const rv = new VariantLayout(this, variant, layout, property);\n this.registry[variant] = rv;\n return rv;\n }\n\n /**\n * Get the layout associated with a registered variant.\n *\n * If `vb` does not produce a registered variant the function returns\n * `undefined`.\n *\n * @param {(Number|Buffer)} vb - either the variant number, or a\n * buffer from which the discriminator is to be read.\n *\n * @param {Number} offset - offset into `vb` for the start of the\n * union. Used only when `vb` is an instance of {Buffer}.\n *\n * @return {({VariantLayout}|undefined)}\n */\n getVariant(vb, offset) {\n let variant = vb;\n if (vb instanceof Buffer) {\n if (undefined === offset) {\n offset = 0;\n }\n variant = this.discriminator.decode(vb, offset);\n }\n return this.registry[variant];\n }\n}\n\n/**\n * Represent a specific variant within a containing union.\n *\n * **NOTE** The {@link Layout#span|span} of the variant may include\n * the span of the {@link Union#discriminator|discriminator} used to\n * identify it, but values read and written using the variant strictly\n * conform to the content of {@link VariantLayout#layout|layout}.\n *\n * **NOTE** User code should not invoke this constructor directly. Use\n * the union {@link Union#addVariant|addVariant} helper method.\n *\n * @param {Union} union - initializer for {@link\n * VariantLayout#union|union}.\n *\n * @param {Number} variant - initializer for {@link\n * VariantLayout#variant|variant}.\n *\n * @param {Layout} [layout] - initializer for {@link\n * VariantLayout#layout|layout}. If absent the variant carries no\n * data.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}. Unlike many other layouts, variant\n * layouts normally include a property name so they can be identified\n * within their containing {@link Union}. The property identifier may\n * be absent only if `layout` is is absent.\n *\n * @augments {Layout}\n */\nclass VariantLayout extends Layout {\n constructor(union, variant, layout, property) {\n if (!(union instanceof Union)) {\n throw new TypeError('union must be a Union');\n }\n if ((!Number.isInteger(variant)) || (0 > variant)) {\n throw new TypeError('variant must be a (non-negative) integer');\n }\n if (('string' === typeof layout)\n && (undefined === property)) {\n property = layout;\n layout = null;\n }\n if (layout) {\n if (!(layout instanceof Layout)) {\n throw new TypeError('layout must be a Layout');\n }\n if ((null !== union.defaultLayout)\n && (0 <= layout.span)\n && (layout.span > union.defaultLayout.span)) {\n throw new Error('variant span exceeds span of containing union');\n }\n if ('string' !== typeof property) {\n throw new TypeError('variant must have a String property');\n }\n }\n let span = union.span;\n if (0 > union.span) {\n span = layout ? layout.span : 0;\n if ((0 <= span) && union.usesPrefixDiscriminator) {\n span += union.discriminator.layout.span;\n }\n }\n super(span, property);\n\n /** The {@link Union} to which this variant belongs. */\n this.union = union;\n\n /** The unsigned integral value identifying this variant within\n * the {@link Union#discriminator|discriminator} of the containing\n * union. */\n this.variant = variant;\n\n /** The {@link Layout} to be used when reading/writing the\n * non-discriminator part of the {@link\n * VariantLayout#union|union}. If `null` the variant carries no\n * data. */\n this.layout = layout || null;\n }\n\n /** @override */\n getSpan(b, offset) {\n if (0 <= this.span) {\n /* Will be equal to the containing union span if that is not\n * variable. */\n return this.span;\n }\n if (undefined === offset) {\n offset = 0;\n }\n let contentOffset = 0;\n if (this.union.usesPrefixDiscriminator) {\n contentOffset = this.union.discriminator.layout.span;\n }\n /* Span is defined solely by the variant (and prefix discriminator) */\n return contentOffset + this.layout.getSpan(b, offset + contentOffset);\n }\n\n /** @override */\n decode(b, offset) {\n const dest = this.makeDestinationObject();\n if (undefined === offset) {\n offset = 0;\n }\n if (this !== this.union.getVariant(b, offset)) {\n throw new Error('variant mismatch');\n }\n let contentOffset = 0;\n if (this.union.usesPrefixDiscriminator) {\n contentOffset = this.union.discriminator.layout.span;\n }\n if (this.layout) {\n dest[this.property] = this.layout.decode(b, offset + contentOffset);\n } else if (this.property) {\n dest[this.property] = true;\n } else if (this.union.usesPrefixDiscriminator) {\n dest[this.union.discriminator.property] = this.variant;\n }\n return dest;\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n let contentOffset = 0;\n if (this.union.usesPrefixDiscriminator) {\n contentOffset = this.union.discriminator.layout.span;\n }\n if (this.layout\n && (!src.hasOwnProperty(this.property))) {\n throw new TypeError('variant lacks property ' + this.property);\n }\n this.union.discriminator.encode(this.variant, b, offset);\n let span = contentOffset;\n if (this.layout) {\n this.layout.encode(src[this.property], b, offset + contentOffset);\n span += this.layout.getSpan(b, offset + contentOffset);\n if ((0 <= this.union.span)\n && (span > this.union.span)) {\n throw new Error('encoded variant overruns containing union');\n }\n }\n return span;\n }\n\n /** Delegate {@link Layout#fromArray|fromArray} to {@link\n * VariantLayout#layout|layout}. */\n fromArray(values) {\n if (this.layout) {\n return this.layout.fromArray(values);\n }\n }\n}\n\n/** JavaScript chose to define bitwise operations as operating on\n * signed 32-bit values in 2's complement form, meaning any integer\n * with bit 31 set is going to look negative. For right shifts that's\n * not a problem, because `>>>` is a logical shift, but for every\n * other bitwise operator we have to compensate for possible negative\n * results. */\nfunction fixBitwiseResult(v) {\n if (0 > v) {\n v += 0x100000000;\n }\n return v;\n}\n\n/**\n * Contain a sequence of bit fields as an unsigned integer.\n *\n * *Factory*: {@link module:Layout.bits|bits}\n *\n * This is a container element; within it there are {@link BitField}\n * instances that provide the extracted properties. The container\n * simply defines the aggregate representation and its bit ordering.\n * The representation is an object containing properties with numeric\n * or {@link Boolean} values.\n *\n * {@link BitField}s are added with the {@link\n * BitStructure#addField|addField} and {@link\n * BitStructure#addBoolean|addBoolean} methods.\n\n * @param {Layout} word - initializer for {@link\n * BitStructure#word|word}. The parameter must be an instance of\n * {@link UInt} (or {@link UIntBE}) that is no more than 4 bytes wide.\n *\n * @param {bool} [msb] - `true` if the bit numbering starts at the\n * most significant bit of the containing word; `false` (default) if\n * it starts at the least significant bit of the containing word. If\n * the parameter at this position is a string and `property` is\n * `undefined` the value of this argument will instead be used as the\n * value of `property`.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass BitStructure extends Layout {\n constructor(word, msb, property) {\n if (!((word instanceof UInt)\n || (word instanceof UIntBE))) {\n throw new TypeError('word must be a UInt or UIntBE layout');\n }\n if (('string' === typeof msb)\n && (undefined === property)) {\n property = msb;\n msb = undefined;\n }\n if (4 < word.span) {\n throw new RangeError('word cannot exceed 32 bits');\n }\n super(word.span, property);\n\n /** The layout used for the packed value. {@link BitField}\n * instances are packed sequentially depending on {@link\n * BitStructure#msb|msb}. */\n this.word = word;\n\n /** Whether the bit sequences are packed starting at the most\n * significant bit growing down (`true`), or the least significant\n * bit growing up (`false`).\n *\n * **NOTE** Regardless of this value, the least significant bit of\n * any {@link BitField} value is the least significant bit of the\n * corresponding section of the packed value. */\n this.msb = !!msb;\n\n /** The sequence of {@link BitField} layouts that comprise the\n * packed structure.\n *\n * **NOTE** The array remains mutable to allow fields to be {@link\n * BitStructure#addField|added} after construction. Users should\n * not manipulate the content of this property.*/\n this.fields = [];\n\n /* Storage for the value. Capture a variable instead of using an\n * instance property because we don't want anything to change the\n * value without going through the mutator. */\n let value = 0;\n this._packedSetValue = function(v) {\n value = fixBitwiseResult(v);\n return this;\n };\n this._packedGetValue = function() {\n return value;\n };\n }\n\n /** @override */\n decode(b, offset) {\n const dest = this.makeDestinationObject();\n if (undefined === offset) {\n offset = 0;\n }\n const value = this.word.decode(b, offset);\n this._packedSetValue(value);\n for (const fd of this.fields) {\n if (undefined !== fd.property) {\n dest[fd.property] = fd.decode(value);\n }\n }\n return dest;\n }\n\n /** Implement {@link Layout#encode|encode} for {@link BitStructure}.\n *\n * If `src` is missing a property for a member with a defined {@link\n * Layout#property|property} the corresponding region of the packed\n * value is left unmodified. Unused bits are also left unmodified. */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n const value = this.word.decode(b, offset);\n this._packedSetValue(value);\n for (const fd of this.fields) {\n if (undefined !== fd.property) {\n const fv = src[fd.property];\n if (undefined !== fv) {\n fd.encode(fv);\n }\n }\n }\n return this.word.encode(this._packedGetValue(), b, offset);\n }\n\n /** Register a new bitfield with a containing bit structure. The\n * resulting bitfield is returned.\n *\n * @param {Number} bits - initializer for {@link BitField#bits|bits}.\n *\n * @param {string} property - initializer for {@link\n * Layout#property|property}.\n *\n * @return {BitField} */\n addField(bits, property) {\n const bf = new BitField(this, bits, property);\n this.fields.push(bf);\n return bf;\n }\n\n /** As with {@link BitStructure#addField|addField} for single-bit\n * fields with `boolean` value representation.\n *\n * @param {string} property - initializer for {@link\n * Layout#property|property}.\n *\n * @return {Boolean} */\n addBoolean(property) {\n // This is my Boolean, not the Javascript one.\n // eslint-disable-next-line no-new-wrappers\n const bf = new Boolean(this, property);\n this.fields.push(bf);\n return bf;\n }\n\n /**\n * Get access to the bit field for a given property.\n *\n * @param {String} property - the bit field of interest.\n *\n * @return {BitField} - the field associated with `property`, or\n * undefined if there is no such property.\n */\n fieldFor(property) {\n if ('string' !== typeof property) {\n throw new TypeError('property must be string');\n }\n for (const fd of this.fields) {\n if (fd.property === property) {\n return fd;\n }\n }\n }\n}\n\n/**\n * Represent a sequence of bits within a {@link BitStructure}.\n *\n * All bit field values are represented as unsigned integers.\n *\n * **NOTE** User code should not invoke this constructor directly.\n * Use the container {@link BitStructure#addField|addField} helper\n * method.\n *\n * **NOTE** BitField instances are not instances of {@link Layout}\n * since {@link Layout#span|span} measures 8-bit units.\n *\n * @param {BitStructure} container - initializer for {@link\n * BitField#container|container}.\n *\n * @param {Number} bits - initializer for {@link BitField#bits|bits}.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n */\nclass BitField {\n constructor(container, bits, property) {\n if (!(container instanceof BitStructure)) {\n throw new TypeError('container must be a BitStructure');\n }\n if ((!Number.isInteger(bits)) || (0 >= bits)) {\n throw new TypeError('bits must be positive integer');\n }\n const totalBits = 8 * container.span;\n const usedBits = container.fields.reduce((sum, fd) => sum + fd.bits, 0);\n if ((bits + usedBits) > totalBits) {\n throw new Error('bits too long for span remainder ('\n + (totalBits - usedBits) + ' of '\n + totalBits + ' remain)');\n }\n\n /** The {@link BitStructure} instance to which this bit field\n * belongs. */\n this.container = container;\n\n /** The span of this value in bits. */\n this.bits = bits;\n\n /** A mask of {@link BitField#bits|bits} bits isolating value bits\n * that fit within the field.\n *\n * That is, it masks a value that has not yet been shifted into\n * position within its containing packed integer. */\n this.valueMask = (1 << bits) - 1;\n if (32 === bits) { // shifted value out of range\n this.valueMask = 0xFFFFFFFF;\n }\n\n /** The offset of the value within the containing packed unsigned\n * integer. The least significant bit of the packed value is at\n * offset zero, regardless of bit ordering used. */\n this.start = usedBits;\n if (this.container.msb) {\n this.start = totalBits - usedBits - bits;\n }\n\n /** A mask of {@link BitField#bits|bits} isolating the field value\n * within the containing packed unsigned integer. */\n this.wordMask = fixBitwiseResult(this.valueMask << this.start);\n\n /** The property name used when this bitfield is represented in an\n * Object.\n *\n * Intended to be functionally equivalent to {@link\n * Layout#property}.\n *\n * If left undefined the corresponding span of bits will be\n * treated as padding: it will not be mutated by {@link\n * Layout#encode|encode} nor represented as a property in the\n * decoded Object. */\n this.property = property;\n }\n\n /** Store a value into the corresponding subsequence of the containing\n * bit field. */\n decode() {\n const word = this.container._packedGetValue();\n const wordValue = fixBitwiseResult(word & this.wordMask);\n const value = wordValue >>> this.start;\n return value;\n }\n\n /** Store a value into the corresponding subsequence of the containing\n * bit field.\n *\n * **NOTE** This is not a specialization of {@link\n * Layout#encode|Layout.encode} and there is no return value. */\n encode(value) {\n if ((!Number.isInteger(value))\n || (value !== fixBitwiseResult(value & this.valueMask))) {\n throw new TypeError(nameWithProperty('BitField.encode', this)\n + ' value must be integer not exceeding ' + this.valueMask);\n }\n const word = this.container._packedGetValue();\n const wordValue = fixBitwiseResult(value << this.start);\n this.container._packedSetValue(fixBitwiseResult(word & ~this.wordMask)\n | wordValue);\n };\n}\n\n/**\n * Represent a single bit within a {@link BitStructure} as a\n * JavaScript boolean.\n *\n * **NOTE** User code should not invoke this constructor directly.\n * Use the container {@link BitStructure#addBoolean|addBoolean} helper\n * method.\n *\n * @param {BitStructure} container - initializer for {@link\n * BitField#container|container}.\n *\n * @param {string} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {BitField}\n */\n/* eslint-disable no-extend-native */\nclass Boolean extends BitField {\n constructor(container, property) {\n super(container, 1, property);\n }\n\n /** Override {@link BitField#decode|decode} for {@link Boolean|Boolean}.\n *\n * @returns {boolean} */\n decode(b, offset) {\n return !!BitField.prototype.decode.call(this, b, offset);\n }\n\n /** @override */\n encode(value) {\n if ('boolean' === typeof value) {\n // BitField requires integer values\n value = +value;\n }\n return BitField.prototype.encode.call(this, value);\n }\n}\n/* eslint-enable no-extend-native */\n\n/**\n * Contain a fixed-length block of arbitrary data, represented as a\n * Buffer.\n *\n * *Factory*: {@link module:Layout.blob|blob}\n *\n * @param {(Number|ExternalLayout)} length - initializes {@link\n * Blob#length|length}.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Blob extends Layout {\n constructor(length, property) {\n if (!(((length instanceof ExternalLayout) && length.isCount())\n || (Number.isInteger(length) && (0 <= length)))) {\n throw new TypeError('length must be positive integer '\n + 'or an unsigned integer ExternalLayout');\n }\n\n let span = -1;\n if (!(length instanceof ExternalLayout)) {\n span = length;\n }\n super(span, property);\n\n /** The number of bytes in the blob.\n *\n * This may be a non-negative integer, or an instance of {@link\n * ExternalLayout} that satisfies {@link\n * ExternalLayout#isCount|isCount()}. */\n this.length = length;\n }\n\n /** @override */\n getSpan(b, offset) {\n let span = this.span;\n if (0 > span) {\n span = this.length.decode(b, offset);\n }\n return span;\n }\n\n /** @override */\n decode(b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n let span = this.span;\n if (0 > span) {\n span = this.length.decode(b, offset);\n }\n return b.slice(offset, offset + span);\n }\n\n /** Implement {@link Layout#encode|encode} for {@link Blob}.\n *\n * **NOTE** If {@link Layout#count|count} is an instance of {@link\n * ExternalLayout} then the length of `src` will be encoded as the\n * count after `src` is encoded. */\n encode(src, b, offset) {\n let span = this.length;\n if (this.length instanceof ExternalLayout) {\n span = src.length;\n }\n if (!((src instanceof Buffer)\n && (span === src.length))) {\n throw new TypeError(nameWithProperty('Blob.encode', this)\n + ' requires (length ' + span + ') Buffer as src');\n }\n if ((offset + span) > b.length) {\n throw new RangeError('encoding overruns Buffer');\n }\n b.write(src.toString('hex'), offset, span, 'hex');\n if (this.length instanceof ExternalLayout) {\n this.length.encode(span, b, offset);\n }\n return span;\n }\n}\n\n/**\n * Contain a `NUL`-terminated UTF8 string.\n *\n * *Factory*: {@link module:Layout.cstr|cstr}\n *\n * **NOTE** Any UTF8 string that incorporates a zero-valued byte will\n * not be correctly decoded by this layout.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass CString extends Layout {\n constructor(property) {\n super(-1, property);\n }\n\n /** @override */\n getSpan(b, offset) {\n if (!(b instanceof Buffer)) {\n throw new TypeError('b must be a Buffer');\n }\n if (undefined === offset) {\n offset = 0;\n }\n let idx = offset;\n while ((idx < b.length) && (0 !== b[idx])) {\n idx += 1;\n }\n return 1 + idx - offset;\n }\n\n /** @override */\n decode(b, offset, dest) {\n if (undefined === offset) {\n offset = 0;\n }\n let span = this.getSpan(b, offset);\n return b.slice(offset, offset + span - 1).toString('utf-8');\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n /* Must force this to a string, lest it be a number and the\n * \"utf8-encoding\" below actually allocate a buffer of length\n * src */\n if ('string' !== typeof src) {\n src = src.toString();\n }\n const srcb = new Buffer(src, 'utf8');\n const span = srcb.length;\n if ((offset + span) > b.length) {\n throw new RangeError('encoding overruns Buffer');\n }\n srcb.copy(b, offset);\n b[offset + span] = 0;\n return span + 1;\n }\n}\n\n/**\n * Contain a UTF8 string with implicit length.\n *\n * *Factory*: {@link module:Layout.utf8|utf8}\n *\n * **NOTE** Because the length is implicit in the size of the buffer\n * this layout should be used only in isolation, or in a situation\n * where the length can be expressed by operating on a slice of the\n * containing buffer.\n *\n * @param {Number} [maxSpan] - the maximum length allowed for encoded\n * string content. If not provided there is no bound on the allowed\n * content.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass UTF8 extends Layout {\n constructor(maxSpan, property) {\n if (('string' === typeof maxSpan)\n && (undefined === property)) {\n property = maxSpan;\n maxSpan = undefined;\n }\n if (undefined === maxSpan) {\n maxSpan = -1;\n } else if (!Number.isInteger(maxSpan)) {\n throw new TypeError('maxSpan must be an integer');\n }\n\n super(-1, property);\n\n /** The maximum span of the layout in bytes.\n *\n * Positive values are generally expected. Zero is abnormal.\n * Attempts to encode or decode a value that exceeds this length\n * will throw a `RangeError`.\n *\n * A negative value indicates that there is no bound on the length\n * of the content. */\n this.maxSpan = maxSpan;\n }\n\n /** @override */\n getSpan(b, offset) {\n if (!(b instanceof Buffer)) {\n throw new TypeError('b must be a Buffer');\n }\n if (undefined === offset) {\n offset = 0;\n }\n return b.length - offset;\n }\n\n /** @override */\n decode(b, offset, dest) {\n if (undefined === offset) {\n offset = 0;\n }\n let span = this.getSpan(b, offset);\n if ((0 <= this.maxSpan)\n && (this.maxSpan < span)) {\n throw new RangeError('text length exceeds maxSpan');\n }\n return b.slice(offset, offset + span).toString('utf-8');\n }\n\n /** @override */\n encode(src, b, offset) {\n if (undefined === offset) {\n offset = 0;\n }\n /* Must force this to a string, lest it be a number and the\n * \"utf8-encoding\" below actually allocate a buffer of length\n * src */\n if ('string' !== typeof src) {\n src = src.toString();\n }\n const srcb = new Buffer(src, 'utf8');\n const span = srcb.length;\n if ((0 <= this.maxSpan)\n && (this.maxSpan < span)) {\n throw new RangeError('text length exceeds maxSpan');\n }\n if ((offset + span) > b.length) {\n throw new RangeError('encoding overruns Buffer');\n }\n srcb.copy(b, offset);\n return span;\n }\n}\n\n/**\n * Contain a constant value.\n *\n * This layout may be used in cases where a JavaScript value can be\n * inferred without an expression in the binary encoding. An example\n * would be a {@link VariantLayout|variant layout} where the content\n * is implied by the union {@link Union#discriminator|discriminator}.\n *\n * @param {Object|Number|String} value - initializer for {@link\n * Constant#value|value}. If the value is an object (or array) and\n * the application intends the object to remain unchanged regardless\n * of what is done to values decoded by this layout, the value should\n * be frozen prior passing it to this constructor.\n *\n * @param {String} [property] - initializer for {@link\n * Layout#property|property}.\n *\n * @augments {Layout}\n */\nclass Constant extends Layout {\n constructor(value, property) {\n super(0, property);\n\n /** The value produced by this constant when the layout is {@link\n * Constant#decode|decoded}.\n *\n * Any JavaScript value including `null` and `undefined` is\n * permitted.\n *\n * **WARNING** If `value` passed in the constructor was not\n * frozen, it is possible for users of decoded values to change\n * the content of the value. */\n this.value = value;\n }\n\n /** @override */\n decode(b, offset, dest) {\n return this.value;\n }\n\n /** @override */\n encode(src, b, offset) {\n /* Constants take no space */\n return 0;\n }\n}\n\nexports.ExternalLayout = ExternalLayout;\nexports.GreedyCount = GreedyCount;\nexports.OffsetLayout = OffsetLayout;\nexports.UInt = UInt;\nexports.UIntBE = UIntBE;\nexports.Int = Int;\nexports.IntBE = IntBE;\nexports.Float = Float;\nexports.FloatBE = FloatBE;\nexports.Double = Double;\nexports.DoubleBE = DoubleBE;\nexports.Sequence = Sequence;\nexports.Structure = Structure;\nexports.UnionDiscriminator = UnionDiscriminator;\nexports.UnionLayoutDiscriminator = UnionLayoutDiscriminator;\nexports.Union = Union;\nexports.VariantLayout = VariantLayout;\nexports.BitStructure = BitStructure;\nexports.BitField = BitField;\nexports.Boolean = Boolean;\nexports.Blob = Blob;\nexports.CString = CString;\nexports.UTF8 = UTF8;\nexports.Constant = Constant;\n\n/** Factory for {@link GreedyCount}. */\nexports.greedy = ((elementSpan, property) => new GreedyCount(elementSpan, property));\n\n/** Factory for {@link OffsetLayout}. */\nexports.offset = ((layout, offset, property) => new OffsetLayout(layout, offset, property));\n\n/** Factory for {@link UInt|unsigned int layouts} spanning one\n * byte. */\nexports.u8 = (property => new UInt(1, property));\n\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning two bytes. */\nexports.u16 = (property => new UInt(2, property));\n\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning three bytes. */\nexports.u24 = (property => new UInt(3, property));\n\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning four bytes. */\nexports.u32 = (property => new UInt(4, property));\n\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning five bytes. */\nexports.u40 = (property => new UInt(5, property));\n\n/** Factory for {@link UInt|little-endian unsigned int layouts}\n * spanning six bytes. */\nexports.u48 = (property => new UInt(6, property));\n\n/** Factory for {@link NearUInt64|little-endian unsigned int\n * layouts} interpreted as Numbers. */\nexports.nu64 = (property => new NearUInt64(property));\n\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning two bytes. */\nexports.u16be = (property => new UIntBE(2, property));\n\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning three bytes. */\nexports.u24be = (property => new UIntBE(3, property));\n\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning four bytes. */\nexports.u32be = (property => new UIntBE(4, property));\n\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning five bytes. */\nexports.u40be = (property => new UIntBE(5, property));\n\n/** Factory for {@link UInt|big-endian unsigned int layouts}\n * spanning six bytes. */\nexports.u48be = (property => new UIntBE(6, property));\n\n/** Factory for {@link NearUInt64BE|big-endian unsigned int\n * layouts} interpreted as Numbers. */\nexports.nu64be = (property => new NearUInt64BE(property));\n\n/** Factory for {@link Int|signed int layouts} spanning one\n * byte. */\nexports.s8 = (property => new Int(1, property));\n\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning two bytes. */\nexports.s16 = (property => new Int(2, property));\n\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning three bytes. */\nexports.s24 = (property => new Int(3, property));\n\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning four bytes. */\nexports.s32 = (property => new Int(4, property));\n\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning five bytes. */\nexports.s40 = (property => new Int(5, property));\n\n/** Factory for {@link Int|little-endian signed int layouts}\n * spanning six bytes. */\nexports.s48 = (property => new Int(6, property));\n\n/** Factory for {@link NearInt64|little-endian signed int layouts}\n * interpreted as Numbers. */\nexports.ns64 = (property => new NearInt64(property));\n\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning two bytes. */\nexports.s16be = (property => new IntBE(2, property));\n\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning three bytes. */\nexports.s24be = (property => new IntBE(3, property));\n\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning four bytes. */\nexports.s32be = (property => new IntBE(4, property));\n\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning five bytes. */\nexports.s40be = (property => new IntBE(5, property));\n\n/** Factory for {@link Int|big-endian signed int layouts}\n * spanning six bytes. */\nexports.s48be = (property => new IntBE(6, property));\n\n/** Factory for {@link NearInt64BE|big-endian signed int layouts}\n * interpreted as Numbers. */\nexports.ns64be = (property => new NearInt64BE(property));\n\n/** Factory for {@link Float|little-endian 32-bit floating point} values. */\nexports.f32 = (property => new Float(property));\n\n/** Factory for {@link FloatBE|big-endian 32-bit floating point} values. */\nexports.f32be = (property => new FloatBE(property));\n\n/** Factory for {@link Double|little-endian 64-bit floating point} values. */\nexports.f64 = (property => new Double(property));\n\n/** Factory for {@link DoubleBE|big-endian 64-bit floating point} values. */\nexports.f64be = (property => new DoubleBE(property));\n\n/** Factory for {@link Structure} values. */\nexports.struct = ((fields, property, decodePrefixes) => new Structure(fields, property, decodePrefixes));\n\n/** Factory for {@link BitStructure} values. */\nexports.bits = ((word, msb, property) => new BitStructure(word, msb, property));\n\n/** Factory for {@link Sequence} values. */\nexports.seq = ((elementLayout, count, property) => new Sequence(elementLayout, count, property));\n\n/** Factory for {@link Union} values. */\nexports.union = ((discr, defaultLayout, property) => new Union(discr, defaultLayout, property));\n\n/** Factory for {@link UnionLayoutDiscriminator} values. */\nexports.unionLayoutDiscriminator = ((layout, property) => new UnionLayoutDiscriminator(layout, property));\n\n/** Factory for {@link Blob} values. */\nexports.blob = ((length, property) => new Blob(length, property));\n\n/** Factory for {@link CString} values. */\nexports.cstr = (property => new CString(property));\n\n/** Factory for {@link UTF8} values. */\nexports.utf8 = ((maxSpan, property) => new UTF8(maxSpan, property));\n\n/** Factory for {@link Constant} values. */\nexports.const = ((value, property) => new Constant(value, property));\n","import {Buffer} from 'buffer';\nimport * as BufferLayout from 'buffer-layout';\n\n/**\n * Layout for a public key\n */\nexport const publicKey = (property: string = 'publicKey'): Object => {\n return BufferLayout.blob(32, property);\n};\n\n/**\n * Layout for a 64bit unsigned value\n */\nexport const uint64 = (property: string = 'uint64'): Object => {\n return BufferLayout.blob(8, property);\n};\n\n/**\n * Layout for a Rust String type\n */\nexport const rustString = (property: string = 'string') => {\n const rsl = BufferLayout.struct(\n [\n BufferLayout.u32('length'),\n BufferLayout.u32('lengthPadding'),\n BufferLayout.blob(BufferLayout.offset(BufferLayout.u32(), -8), 'chars'),\n ],\n property,\n );\n const _decode = rsl.decode.bind(rsl);\n const _encode = rsl.encode.bind(rsl);\n\n rsl.decode = (buffer: any, offset: any) => {\n const data = _decode(buffer, offset);\n return data.chars.toString('utf8');\n };\n\n rsl.encode = (str: any, buffer: any, offset: any) => {\n const data = {\n chars: Buffer.from(str, 'utf8'),\n };\n return _encode(data, buffer, offset);\n };\n\n rsl.alloc = (str: any) => {\n return (\n BufferLayout.u32().span +\n BufferLayout.u32().span +\n Buffer.from(str, 'utf8').length\n );\n };\n\n return rsl;\n};\n\n/**\n * Layout for an Authorized object\n */\nexport const authorized = (property: string = 'authorized') => {\n return BufferLayout.struct(\n [publicKey('staker'), publicKey('withdrawer')],\n property,\n );\n};\n\n/**\n * Layout for a Lockup object\n */\nexport const lockup = (property: string = 'lockup') => {\n return BufferLayout.struct(\n [\n BufferLayout.ns64('unixTimestamp'),\n BufferLayout.ns64('epoch'),\n publicKey('custodian'),\n ],\n property,\n );\n};\n\nexport function getAlloc(type: any, fields: any): number {\n let alloc = 0;\n type.layout.fields.forEach((item: any) => {\n if (item.span >= 0) {\n alloc += item.span;\n } else if (typeof item.alloc === 'function') {\n alloc += item.alloc(fields[item.property]);\n }\n });\n return alloc;\n}\n","export function decodeLength(bytes: Array<number>): number {\n let len = 0;\n let size = 0;\n for (;;) {\n let elem = bytes.shift() as number;\n len |= (elem & 0x7f) << (size * 7);\n size += 1;\n if ((elem & 0x80) === 0) {\n break;\n }\n }\n return len;\n}\n\nexport function encodeLength(bytes: Array<number>, len: number) {\n let rem_len = len;\n for (;;) {\n let elem = rem_len & 0x7f;\n rem_len >>= 7;\n if (rem_len == 0) {\n bytes.push(elem);\n break;\n } else {\n elem |= 0x80;\n bytes.push(elem);\n }\n }\n}\n","const END_OF_BUFFER_ERROR_MESSAGE = 'Reached end of buffer unexpectedly';\n\n/**\n * Delegates to `Array#shift`, but throws if the array is zero-length.\n */\nexport function guardedShift<T>(byteArray: T[]): T {\n if (byteArray.length === 0) {\n throw new Error(END_OF_BUFFER_ERROR_MESSAGE);\n }\n return byteArray.shift() as T;\n}\n\n/**\n * Delegates to `Array#splice`, but throws if the section being spliced out extends past the end of\n * the array.\n */\nexport function guardedSplice<T>(\n byteArray: T[],\n ...args:\n | [start: number, deleteCount?: number]\n | [start: number, deleteCount: number, ...items: T[]]\n): T[] {\n var _args$;\n const [start] = args;\n if (\n args.length === 2 // Implies that `deleteCount` was supplied\n ? start +\n ((_args$ = args[1]) !== null && _args$ !== void 0 ? _args$ : 0) >\n byteArray.length\n : start >= byteArray.length\n ) {\n throw new Error(END_OF_BUFFER_ERROR_MESSAGE);\n }\n return byteArray.splice(\n ...(args as Parameters<typeof Array.prototype.splice>),\n );\n}\n","import bs58 from 'bs58';\nimport {Buffer} from 'buffer';\nimport * as BufferLayout from 'buffer-layout';\n\nimport {PublicKey} from './publickey';\nimport type {Blockhash} from './blockhash';\nimport * as Layout from './layout';\nimport {PACKET_DATA_SIZE} from './transaction';\nimport * as shortvec from './util/shortvec-encoding';\nimport {guardedShift, guardedSplice} from './util/guarded-array-utils';\n\n/**\n * The message header, identifying signed and read-only account\n *\n * @typedef {Object} MessageHeader\n * @property {number} numRequiredSignatures The number of signatures required for this message to be considered valid. The\n * signatures must match the first `numRequiredSignatures` of `accountKeys`.\n * @property {number} numReadonlySignedAccounts: The last `numReadonlySignedAccounts` of the signed keys are read-only accounts\n * @property {number} numReadonlyUnsignedAccounts The last `numReadonlySignedAccounts` of the unsigned keys are read-only accounts\n */\nexport type MessageHeader = {\n numRequiredSignatures: number;\n numReadonlySignedAccounts: number;\n numReadonlyUnsignedAccounts: number;\n};\n\n/**\n * An instruction to execute by a program\n *\n * @typedef {Object} CompiledInstruction\n * @property {number} programIdIndex Index into the transaction keys array indicating the program account that executes this instruction\n * @property {number[]} accounts Ordered indices into the transaction keys array indicating which accounts to pass to the program\n * @property {string} data The program input data encoded as base 58\n */\nexport type CompiledInstruction = {\n programIdIndex: number;\n accounts: number[];\n data: string;\n};\n\n/**\n * Message constructor arguments\n *\n * @typedef {Object} MessageArgs\n * @property {MessageHeader} header The message header, identifying signed and read-only `accountKeys`\n * @property {string[]} accounts All the account keys used by this transaction\n * @property {Blockhash} recentBlockhash The hash of a recent ledger block\n * @property {CompiledInstruction[]} instructions Instructions that will be executed in sequence and committed in one atomic transaction if all succeed.\n */\nexport type MessageArgs = {\n header: MessageHeader;\n accountKeys: string[];\n recentBlockhash: Blockhash;\n instructions: CompiledInstruction[];\n};\n\nconst PUBKEY_LENGTH = 32;\n\n/**\n * List of instructions to be processed atomically\n */\nexport class Message {\n header: MessageHeader;\n accountKeys: PublicKey[];\n recentBlockhash: Blockhash;\n instructions: CompiledInstruction[];\n\n constructor(args: MessageArgs) {\n this.header = args.header;\n this.accountKeys = args.accountKeys.map(account => new PublicKey(account));\n this.recentBlockhash = args.recentBlockhash;\n this.instructions = args.instructions;\n }\n\n isAccountWritable(index: number): boolean {\n return (\n index <\n this.header.numRequiredSignatures -\n this.header.numReadonlySignedAccounts ||\n (index >= this.header.numRequiredSignatures &&\n index <\n this.accountKeys.length - this.header.numReadonlyUnsignedAccounts)\n );\n }\n\n serialize(): Buffer {\n const numKeys = this.accountKeys.length;\n\n let keyCount: number[] = [];\n shortvec.encodeLength(keyCount, numKeys);\n\n const instructions = this.instructions.map(instruction => {\n const {accounts, programIdIndex} = instruction;\n const data = bs58.decode(instruction.data);\n\n let keyIndicesCount: number[] = [];\n shortvec.encodeLength(keyIndicesCount, accounts.length);\n\n let dataCount: number[] = [];\n shortvec.encodeLength(dataCount, data.length);\n\n return {\n programIdIndex,\n keyIndicesCount: Buffer.from(keyIndicesCount),\n keyIndices: Buffer.from(accounts),\n dataLength: Buffer.from(dataCount),\n data,\n };\n });\n\n let instructionCount: number[] = [];\n shortvec.encodeLength(instructionCount, instructions.length);\n let instructionBuffer = Buffer.alloc(PACKET_DATA_SIZE);\n Buffer.from(instructionCount).copy(instructionBuffer);\n let instructionBufferLength = instructionCount.length;\n\n instructions.forEach(instruction => {\n const instructionLayout = BufferLayout.struct([\n BufferLayout.u8('programIdIndex'),\n\n BufferLayout.blob(\n instruction.keyIndicesCount.length,\n 'keyIndicesCount',\n ),\n BufferLayout.seq(\n BufferLayout.u8('keyIndex'),\n instruction.keyIndices.length,\n 'keyIndices',\n ),\n BufferLayout.blob(instruction.dataLength.length, 'dataLength'),\n BufferLayout.seq(\n BufferLayout.u8('userdatum'),\n instruction.data.length,\n 'data',\n ),\n ]);\n const length = instructionLayout.encode(\n instruction,\n instructionBuffer,\n instructionBufferLength,\n );\n instructionBufferLength += length;\n });\n instructionBuffer = instructionBuffer.slice(0, instructionBufferLength);\n\n const signDataLayout = BufferLayout.struct([\n BufferLayout.blob(1, 'numRequiredSignatures'),\n BufferLayout.blob(1, 'numReadonlySignedAccounts'),\n BufferLayout.blob(1, 'numReadonlyUnsignedAccounts'),\n BufferLayout.blob(keyCount.length, 'keyCount'),\n BufferLayout.seq(Layout.publicKey('key'), numKeys, 'keys'),\n Layout.publicKey('recentBlockhash'),\n ]);\n\n const transaction = {\n numRequiredSignatures: Buffer.from([this.header.numRequiredSignatures]),\n numReadonlySignedAccounts: Buffer.from([\n this.header.numReadonlySignedAccounts,\n ]),\n numReadonlyUnsignedAccounts: Buffer.from([\n this.header.numReadonlyUnsignedAccounts,\n ]),\n keyCount: Buffer.from(keyCount),\n keys: this.accountKeys.map(key => key.toBuffer()),\n recentBlockhash: bs58.decode(this.recentBlockhash),\n };\n\n let signData = Buffer.alloc(2048);\n const length = signDataLayout.encode(transaction, signData);\n instructionBuffer.copy(signData, length);\n return signData.slice(0, length + instructionBuffer.length);\n }\n\n /**\n * Decode a compiled message into a Message object.\n */\n static from(buffer: Buffer | Uint8Array | Array<number>): Message {\n // Slice up wire data\n let byteArray = [...buffer];\n\n const numRequiredSignatures = guardedShift(byteArray);\n const numReadonlySignedAccounts = guardedShift(byteArray);\n const numReadonlyUnsignedAccounts = guardedShift(byteArray);\n\n const accountCount = shortvec.decodeLength(byteArray);\n let accountKeys = [];\n for (let i = 0; i < accountCount; i++) {\n const account = guardedSplice(byteArray, 0, PUBKEY_LENGTH);\n accountKeys.push(bs58.encode(Buffer.from(account)));\n }\n\n const recentBlockhash = guardedSplice(byteArray, 0, PUBKEY_LENGTH);\n\n const instructionCount = shortvec.decodeLength(byteArray);\n let instructions: CompiledInstruction[] = [];\n for (let i = 0; i < instructionCount; i++) {\n const programIdIndex = guardedShift(byteArray);\n const accountCount = shortvec.decodeLength(byteArray);\n const accounts = guardedSplice(byteArray, 0, accountCount);\n const dataLength = shortvec.decodeLength(byteArray);\n const dataSlice = guardedSplice(byteArray, 0, dataLength);\n const data = bs58.encode(Buffer.from(dataSlice));\n instructions.push({\n programIdIndex,\n accounts,\n data,\n });\n }\n\n const messageArgs = {\n header: {\n numRequiredSignatures,\n numReadonlySignedAccounts,\n numReadonlyUnsignedAccounts,\n },\n recentBlockhash: bs58.encode(Buffer.from(recentBlockhash)),\n accountKeys,\n instructions,\n };\n\n return new Message(messageArgs);\n }\n}\n","import invariant from 'assert';\nimport nacl from 'tweetnacl';\nimport bs58 from 'bs58';\nimport {Buffer} from 'buffer';\n\nimport type {CompiledInstruction} from './message';\nimport {Message} from './message';\nimport {PublicKey} from './publickey';\nimport {Account} from './account';\nimport * as shortvec from './util/shortvec-encoding';\nimport type {Blockhash} from './blockhash';\nimport {toBuffer} from './util/to-buffer';\nimport {guardedSplice} from './util/guarded-array-utils';\n\n/**\n * @typedef {string} TransactionSignature\n */\nexport type TransactionSignature = string;\n\n/**\n * Default (empty) signature\n *\n * Signatures are 64 bytes in length\n */\nconst DEFAULT_SIGNATURE = Buffer.alloc(64).fill(0);\n\n/**\n * Maximum over-the-wire size of a Transaction\n *\n * 1280 is IPv6 minimum MTU\n * 40 bytes is the size of the IPv6 header\n * 8 bytes is the size of the fragment header\n */\nexport const PACKET_DATA_SIZE = 1280 - 40 - 8;\n\nconst SIGNATURE_LENGTH = 64;\n\n/**\n * Account metadata used to define instructions\n *\n * @typedef {Object} AccountMeta\n * @property {PublicKey} pubkey An account's public key\n * @property {boolean} isSigner True if an instruction requires a transaction signature matching `pubkey`\n * @property {boolean} isWritable True if the `pubkey` can be loaded as a read-write account.\n */\nexport type AccountMeta = {\n pubkey: PublicKey;\n isSigner: boolean;\n isWritable: boolean;\n};\n\n/**\n * List of TransactionInstruction object fields that may be initialized at construction\n *\n * @typedef {Object} TransactionInstructionCtorFields\n * @property {Array<PublicKey>} keys\n * @property {PublicKey} programId\n * @property {?Buffer} data\n */\nexport type TransactionInstructionCtorFields = {\n keys: Array<AccountMeta>;\n programId: PublicKey;\n data?: Buffer;\n};\n\n/**\n * Configuration object for Transaction.serialize()\n *\n * @typedef {Object} SerializeConfig\n * @property {boolean|undefined} requireAllSignatures Require all transaction signatures be present (default: true)\n * @property {boolean|undefined} verifySignatures Verify provided signatures (default: true)\n */\nexport type SerializeConfig = {\n requireAllSignatures?: boolean;\n verifySignatures?: boolean;\n};\n\n/**\n * Transaction Instruction class\n */\nexport class TransactionInstruction {\n /**\n * Public keys to include in this transaction\n * Boolean represents whether this pubkey needs to sign the transaction\n */\n keys: Array<AccountMeta>;\n\n /**\n * Program Id to execute\n */\n programId: PublicKey;\n\n /**\n * Program input\n */\n data: Buffer = Buffer.alloc(0);\n\n constructor(opts: TransactionInstructionCtorFields) {\n this.programId = opts.programId;\n this.keys = opts.keys;\n if (opts.data) {\n this.data = opts.data;\n }\n }\n}\n\n/**\n * @internal\n */\ntype SignaturePubkeyPair = {\n signature: Buffer | null;\n publicKey: PublicKey;\n};\n\n/**\n * List of Transaction object fields that may be initialized at construction\n *\n * @typedef {Object} TransactionCtorFields\n * @property {?Blockhash} recentBlockhash A recent blockhash\n * @property {?PublicKey} feePayer The transaction fee payer\n * @property {?Array<SignaturePubkeyPair>} signatures One or more signatures\n *\n */\ntype TransactionCtorFields = {\n recentBlockhash?: Blockhash | null;\n nonceInfo?: NonceInformation | null;\n feePayer?: PublicKey | null;\n signatures?: Array<SignaturePubkeyPair>;\n};\n\n/**\n * NonceInformation to be used to build a Transaction.\n *\n * @typedef {Object} NonceInformation\n * @property {Blockhash} nonce The current Nonce blockhash\n * @property {TransactionInstruction} nonceInstruction AdvanceNonceAccount Instruction\n */\ntype NonceInformation = {\n nonce: Blockhash;\n nonceInstruction: TransactionInstruction;\n};\n\n/**\n * Transaction class\n */\nexport class Transaction {\n /**\n * Signatures for the transaction. Typically created by invoking the\n * `sign()` method\n */\n signatures: Array<SignaturePubkeyPair> = [];\n\n /**\n * The first (payer) Transaction signature\n */\n get signature(): Buffer | null {\n if (this.signatures.length > 0) {\n return this.signatures[0].signature;\n }\n return null;\n }\n\n /**\n * The transaction fee payer\n */\n feePayer?: PublicKey;\n\n /**\n * The instructions to atomically execute\n */\n instructions: Array<TransactionInstruction> = [];\n\n /**\n * A recent transaction id. Must be populated by the caller\n */\n recentBlockhash?: Blockhash;\n\n /**\n * Optional Nonce information. If populated, transaction will use a durable\n * Nonce hash instead of a recentBlockhash. Must be populated by the caller\n */\n nonceInfo?: NonceInformation;\n\n /**\n * Construct an empty Transaction\n */\n constructor(opts?: TransactionCtorFields) {\n opts && Object.assign(this, opts);\n }\n\n /**\n * Add one or more instructions to this Transaction\n */\n add(\n ...items: Array<\n Transaction | TransactionInstruction | TransactionInstructionCtorFields\n >\n ): Transaction {\n if (items.length === 0) {\n throw new Error('No instructions');\n }\n\n items.forEach((item: any) => {\n if ('instructions' in item) {\n this.instructions = this.instructions.concat(item.instructions);\n } else if ('data' in item && 'programId' in item && 'keys' in item) {\n this.instructions.push(item);\n } else {\n this.instructions.push(new TransactionInstruction(item));\n }\n });\n return this;\n }\n\n /**\n * Compile transaction data\n */\n compileMessage(): Message {\n const {nonceInfo} = this;\n if (nonceInfo && this.instructions[0] != nonceInfo.nonceInstruction) {\n this.recentBlockhash = nonceInfo.nonce;\n this.instructions.unshift(nonceInfo.nonceInstruction);\n }\n const {recentBlockhash} = this;\n if (!recentBlockhash) {\n throw new Error('Transaction recentBlockhash required');\n }\n\n if (this.instructions.length < 1) {\n throw new Error('No instructions provided');\n }\n\n let feePayer: PublicKey;\n if (this.feePayer) {\n feePayer = this.feePayer;\n } else if (this.signatures.length > 0 && this.signatures[0].publicKey) {\n // Use implicit fee payer\n feePayer = this.signatures[0].publicKey;\n } else {\n throw new Error('Transaction fee payer required');\n }\n\n for (let i = 0; i < this.instructions.length; i++) {\n if (this.instructions[i].programId === undefined) {\n throw new Error(\n `Transaction instruction index ${i} has undefined program id`,\n );\n }\n }\n\n const programIds: string[] = [];\n const accountMetas: AccountMeta[] = [];\n this.instructions.forEach(instruction => {\n instruction.keys.forEach(accountMeta => {\n accountMetas.push({...accountMeta});\n });\n\n const programId = instruction.programId.toString();\n if (!programIds.includes(programId)) {\n programIds.push(programId);\n }\n });\n\n // Append programID account metas\n programIds.forEach(programId => {\n accountMetas.push({\n pubkey: new PublicKey(programId),\n isSigner: false,\n isWritable: false,\n });\n });\n\n // Sort. Prioritizing first by signer, then by writable\n accountMetas.sort(function (x, y) {\n const checkSigner = x.isSigner === y.isSigner ? 0 : x.isSigner ? -1 : 1;\n const checkWritable =\n x.isWritable === y.isWritable ? 0 : x.isWritable ? -1 : 1;\n return checkSigner || checkWritable;\n });\n\n // Cull duplicate account metas\n const uniqueMetas: AccountMeta[] = [];\n accountMetas.forEach(accountMeta => {\n const pubkeyString = accountMeta.pubkey.toString();\n const uniqueIndex = uniqueMetas.findIndex(x => {\n return x.pubkey.toString() === pubkeyString;\n });\n if (uniqueIndex > -1) {\n uniqueMetas[uniqueIndex].isWritable =\n uniqueMetas[uniqueIndex].isWritable || accountMeta.isWritable;\n } else {\n uniqueMetas.push(accountMeta);\n }\n });\n\n // Move fee payer to the front\n const feePayerIndex = uniqueMetas.findIndex(x => {\n return x.pubkey.equals(feePayer);\n });\n if (feePayerIndex > -1) {\n const [payerMeta] = uniqueMetas.splice(feePayerIndex, 1);\n payerMeta.isSigner = true;\n payerMeta.isWritable = true;\n uniqueMetas.unshift(payerMeta);\n } else {\n uniqueMetas.unshift({\n pubkey: feePayer,\n isSigner: true,\n isWritable: true,\n });\n }\n\n // Disallow unknown signers\n for (const signature of this.signatures) {\n const uniqueIndex = uniqueMetas.findIndex(x => {\n return x.pubkey.equals(signature.publicKey);\n });\n if (uniqueIndex > -1) {\n if (!uniqueMetas[uniqueIndex].isSigner) {\n uniqueMetas[uniqueIndex].isSigner = true;\n console.warn(\n 'Transaction references a signature that is unnecessary, ' +\n 'only the fee payer and instruction signer accounts should sign a transaction. ' +\n 'This behavior is deprecated and will throw an error in the next major version release.',\n );\n }\n } else {\n throw new Error(`unknown signer: ${signature.publicKey.toString()}`);\n }\n }\n\n let numRequiredSignatures = 0;\n let numReadonlySignedAccounts = 0;\n let numReadonlyUnsignedAccounts = 0;\n\n // Split out signing from non-signing keys and count header values\n const signedKeys: string[] = [];\n const unsignedKeys: string[] = [];\n uniqueMetas.forEach(({pubkey, isSigner, isWritable}) => {\n if (isSigner) {\n signedKeys.push(pubkey.toString());\n numRequiredSignatures += 1;\n if (!isWritable) {\n numReadonlySignedAccounts += 1;\n }\n } else {\n unsignedKeys.push(pubkey.toString());\n if (!isWritable) {\n numReadonlyUnsignedAccounts += 1;\n }\n }\n });\n\n const accountKeys = signedKeys.concat(unsignedKeys);\n const instructions: CompiledInstruction[] = this.instructions.map(\n instruction => {\n const {data, programId} = instruction;\n return {\n programIdIndex: accountKeys.indexOf(programId.toString()),\n accounts: instruction.keys.map(meta =>\n accountKeys.indexOf(meta.pubkey.toString()),\n ),\n data: bs58.encode(data),\n };\n },\n );\n\n instructions.forEach(instruction => {\n invariant(instruction.programIdIndex >= 0);\n instruction.accounts.forEach(keyIndex => invariant(keyIndex >= 0));\n });\n\n return new Message({\n header: {\n numRequiredSignatures,\n numReadonlySignedAccounts,\n numReadonlyUnsignedAccounts,\n },\n accountKeys,\n recentBlockhash,\n instructions,\n });\n }\n\n /**\n * @internal\n */\n _compile(): Message {\n const message = this.compileMessage();\n const signedKeys = message.accountKeys.slice(\n 0,\n message.header.numRequiredSignatures,\n );\n\n if (this.signatures.length === signedKeys.length) {\n const valid = this.signatures.every((pair, index) => {\n return signedKeys[index].equals(pair.publicKey);\n });\n\n if (valid) return message;\n }\n\n this.signatures = signedKeys.map(publicKey => ({\n signature: null,\n publicKey,\n }));\n\n return message;\n }\n\n /**\n * Get a buffer of the Transaction data that need to be covered by signatures\n */\n serializeMessage(): Buffer {\n return this._compile().serialize();\n }\n\n /**\n * Specify the public keys which will be used to sign the Transaction.\n * The first signer will be used as the transaction fee payer account.\n *\n * Signatures can be added with either `partialSign` or `addSignature`\n *\n * @deprecated Deprecated since v0.84.0. Only the fee payer needs to be\n * specified and it can be set in the Transaction constructor or with the\n * `feePayer` property.\n */\n setSigners(...signers: Array<PublicKey>) {\n if (signers.length === 0) {\n throw new Error('No signers');\n }\n\n const seen = new Set();\n this.signatures = signers\n .filter(publicKey => {\n const key = publicKey.toString();\n if (seen.has(key)) {\n return false;\n } else {\n seen.add(key);\n return true;\n }\n })\n .map(publicKey => ({signature: null, publicKey}));\n }\n\n /**\n * Sign the Transaction with the specified accounts. Multiple signatures may\n * be applied to a Transaction. The first signature is considered \"primary\"\n * and is used identify and confirm transactions.\n *\n * If the Transaction `feePayer` is not set, the first signer will be used\n * as the transaction fee payer account.\n *\n * Transaction fields should not be modified after the first call to `sign`,\n * as doing so may invalidate the signature and cause the Transaction to be\n * rejected.\n *\n * The Transaction must be assigned a valid `recentBlockhash` before invoking this method\n */\n sign(...signers: Array<Account>) {\n if (signers.length === 0) {\n throw new Error('No signers');\n }\n\n // Dedupe signers\n const seen = new Set();\n const uniqueSigners = [];\n for (const signer of signers) {\n const key = signer.publicKey.toString();\n if (seen.has(key)) {\n continue;\n } else {\n seen.add(key);\n uniqueSigners.push(signer);\n }\n }\n\n this.signatures = uniqueSigners.map(signer => ({\n signature: null,\n publicKey: signer.publicKey,\n }));\n\n const message = this._compile();\n this._partialSign(message, ...uniqueSigners);\n this._verifySignatures(message.serialize(), true);\n }\n\n /**\n * Partially sign a transaction with the specified accounts. All accounts must\n * correspond to either the fee payer or a signer account in the transaction\n * instructions.\n *\n * All the caveats from the `sign` method apply to `partialSign`\n */\n partialSign(...signers: Array<Account>) {\n if (signers.length === 0) {\n throw new Error('No signers');\n }\n\n // Dedupe signers\n const seen = new Set();\n const uniqueSigners = [];\n for (const signer of signers) {\n const key = signer.publicKey.toString();\n if (seen.has(key)) {\n continue;\n } else {\n seen.add(key);\n uniqueSigners.push(signer);\n }\n }\n\n const message = this._compile();\n this._partialSign(message, ...uniqueSigners);\n }\n\n /**\n * @internal\n */\n _partialSign(message: Message, ...signers: Array<Account>) {\n const signData = message.serialize();\n signers.forEach(signer => {\n const signature = nacl.sign.detached(signData, signer.secretKey);\n this._addSignature(signer.publicKey, toBuffer(signature));\n });\n }\n\n /**\n * Add an externally created signature to a transaction. The public key\n * must correspond to either the fee payer or a signer account in the transaction\n * instructions.\n */\n addSignature(pubkey: PublicKey, signature: Buffer) {\n this._compile(); // Ensure signatures array is populated\n this._addSignature(pubkey, signature);\n }\n\n /**\n * @internal\n */\n _addSignature(pubkey: PublicKey, signature: Buffer) {\n invariant(signature.length === 64);\n\n const index = this.signatures.findIndex(sigpair =>\n pubkey.equals(sigpair.publicKey),\n );\n if (index < 0) {\n throw new Error(`unknown signer: ${pubkey.toString()}`);\n }\n\n this.signatures[index].signature = Buffer.from(signature);\n }\n\n /**\n * Verify signatures of a complete, signed Transaction\n */\n verifySignatures(): boolean {\n return this._verifySignatures(this.serializeMessage(), true);\n }\n\n /**\n * @internal\n */\n _verifySignatures(signData: Buffer, requireAllSignatures: boolean): boolean {\n for (const {signature, publicKey} of this.signatures) {\n if (signature === null) {\n if (requireAllSignatures) {\n return false;\n }\n } else {\n if (\n !nacl.sign.detached.verify(signData, signature, publicKey.toBuffer())\n ) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * Serialize the Transaction in the wire format.\n */\n serialize(config?: SerializeConfig): Buffer {\n const {requireAllSignatures, verifySignatures} = Object.assign(\n {requireAllSignatures: true, verifySignatures: true},\n config,\n );\n\n const signData = this.serializeMessage();\n if (\n verifySignatures &&\n !this._verifySignatures(signData, requireAllSignatures)\n ) {\n throw new Error('Signature verification failed');\n }\n\n return this._serialize(signData);\n }\n\n /**\n * @internal\n */\n _serialize(signData: Buffer): Buffer {\n const {signatures} = this;\n const signatureCount: number[] = [];\n shortvec.encodeLength(signatureCount, signatures.length);\n const transactionLength =\n signatureCount.length + signatures.length * 64 + signData.length;\n const wireTransaction = Buffer.alloc(transactionLength);\n invariant(signatures.length < 256);\n Buffer.from(signatureCount).copy(wireTransaction, 0);\n signatures.forEach(({signature}, index) => {\n if (signature !== null) {\n invariant(signature.length === 64, `signature has invalid length`);\n Buffer.from(signature).copy(\n wireTransaction,\n signatureCount.length + index * 64,\n );\n }\n });\n signData.copy(\n wireTransaction,\n signatureCount.length + signatures.length * 64,\n );\n invariant(\n wireTransaction.length <= PACKET_DATA_SIZE,\n `Transaction too large: ${wireTransaction.length} > ${PACKET_DATA_SIZE}`,\n );\n return wireTransaction;\n }\n\n /**\n * Deprecated method\n * @internal\n */\n get keys(): Array<PublicKey> {\n invariant(this.instructions.length === 1);\n return this.instructions[0].keys.map(keyObj => keyObj.pubkey);\n }\n\n /**\n * Deprecated method\n * @internal\n */\n get programId(): PublicKey {\n invariant(this.instructions.length === 1);\n return this.instructions[0].programId;\n }\n\n /**\n * Deprecated method\n * @internal\n */\n get data(): Buffer {\n invariant(this.instructions.length === 1);\n return this.instructions[0].data;\n }\n\n /**\n * Parse a wire transaction into a Transaction object.\n */\n static from(buffer: Buffer | Uint8Array | Array<number>): Transaction {\n // Slice up wire data\n let byteArray = [...buffer];\n\n const signatureCount = shortvec.decodeLength(byteArray);\n let signatures = [];\n for (let i = 0; i < signatureCount; i++) {\n const signature = guardedSplice(byteArray, 0, SIGNATURE_LENGTH);\n signatures.push(bs58.encode(Buffer.from(signature)));\n }\n\n return Transaction.populate(Message.from(byteArray), signatures);\n }\n\n /**\n * Populate Transaction object from message and signatures\n */\n static populate(message: Message, signatures: Array<string>): Transaction {\n const transaction = new Transaction();\n transaction.recentBlockhash = message.recentBlockhash;\n if (message.header.numRequiredSignatures > 0) {\n transaction.feePayer = message.accountKeys[0];\n }\n signatures.forEach((signature, index) => {\n const sigPubkeyPair = {\n signature:\n signature == bs58.encode(DEFAULT_SIGNATURE)\n ? null\n : bs58.decode(signature),\n publicKey: message.accountKeys[index],\n };\n transaction.signatures.push(sigPubkeyPair);\n });\n\n message.instructions.forEach(instruction => {\n const keys = instruction.accounts.map(account => {\n const pubkey = message.accountKeys[account];\n return {\n pubkey,\n isSigner: transaction.signatures.some(\n keyObj => keyObj.publicKey.toString() === pubkey.toString(),\n ),\n isWritable: message.isAccountWritable(account),\n };\n });\n\n transaction.instructions.push(\n new TransactionInstruction({\n keys,\n programId: message.accountKeys[instruction.programIdIndex],\n data: bs58.decode(instruction.data),\n }),\n );\n });\n\n return transaction;\n }\n}\n","import {PublicKey} from './publickey';\n\nexport const SYSVAR_CLOCK_PUBKEY = new PublicKey(\n 'SysvarC1ock11111111111111111111111111111111',\n);\n\nexport const SYSVAR_RECENT_BLOCKHASHES_PUBKEY = new PublicKey(\n 'SysvarRecentB1ockHashes11111111111111111111',\n);\n\nexport const SYSVAR_RENT_PUBKEY = new PublicKey(\n 'SysvarRent111111111111111111111111111111111',\n);\n\nexport const SYSVAR_REWARDS_PUBKEY = new PublicKey(\n 'SysvarRewards111111111111111111111111111111',\n);\n\nexport const SYSVAR_STAKE_HISTORY_PUBKEY = new PublicKey(\n 'SysvarStakeHistory1111111111111111111111111',\n);\n\nexport const SYSVAR_INSTRUCTIONS_PUBKEY = new PublicKey(\n 'Sysvar1nstructions1111111111111111111111111',\n);\n","import {Connection} from '../connection';\nimport {Transaction} from '../transaction';\nimport type {Account} from '../account';\nimport type {ConfirmOptions} from '../connection';\nimport type {TransactionSignature} from '../transaction';\n\n/**\n * Sign, send and confirm a transaction.\n *\n * If `commitment` option is not specified, defaults to 'max' commitment.\n *\n * @param {Connection} connection\n * @param {Transaction} transaction\n * @param {Array<Account>} signers\n * @param {ConfirmOptions} [options]\n * @returns {Promise<TransactionSignature>}\n */\nexport async function sendAndConfirmTransaction(\n connection: Connection,\n transaction: Transaction,\n signers: Array<Account>,\n options?: ConfirmOptions,\n): Promise<TransactionSignature> {\n const sendOptions = options && {\n skipPreflight: options.skipPreflight,\n preflightCommitment: options.preflightCommitment || options.commitment,\n };\n\n const signature = await connection.sendTransaction(\n transaction,\n signers,\n sendOptions,\n );\n\n const status = (\n await connection.confirmTransaction(\n signature,\n options && options.commitment,\n )\n ).value;\n\n if (status.err) {\n throw new Error(\n `Transaction ${signature} failed (${JSON.stringify(status)})`,\n );\n }\n\n return signature;\n}\n","// zzz\nexport function sleep(ms: number): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms));\n}\n","import {Buffer} from 'buffer';\nimport * as BufferLayout from 'buffer-layout';\n\nimport * as Layout from './layout';\n\n/**\n * @typedef {Object} InstructionType\n * @property (index} The Instruction index (from solana upstream program)\n * @property (BufferLayout} The BufferLayout to use to build data\n * @internal\n */\nexport type InstructionType = {\n index: number;\n layout: typeof BufferLayout;\n};\n\n/**\n * Populate a buffer of instruction data using an InstructionType\n * @internal\n */\nexport function encodeData(type: InstructionType, fields?: any): Buffer {\n const allocLength =\n type.layout.span >= 0 ? type.layout.span : Layout.getAlloc(type, fields);\n const data = Buffer.alloc(allocLength);\n const layoutFields = Object.assign({instruction: type.index}, fields);\n type.layout.encode(layoutFields, data);\n return data;\n}\n\n/**\n * Decode instruction data buffer using an InstructionType\n * @internal\n */\nexport function decodeData(type: InstructionType, buffer: Buffer): any {\n let data;\n try {\n data = type.layout.decode(buffer);\n } catch (err) {\n throw new Error('invalid instruction; ' + err);\n }\n\n if (data.instruction !== type.index) {\n throw new Error(\n `invalid instruction; instruction index mismatch ${data.instruction} != ${type.index}`,\n );\n }\n\n return data;\n}\n","// @ts-ignore\nimport * as BufferLayout from 'buffer-layout';\n\n/**\n * https://github.com/solana-labs/solana/blob/90bedd7e067b5b8f3ddbb45da00a4e9cabb22c62/sdk/src/fee_calculator.rs#L7-L11\n *\n * @internal\n */\nexport const FeeCalculatorLayout = BufferLayout.nu64('lamportsPerSignature');\n\n/**\n * Calculator for transaction fees.\n */\nexport interface FeeCalculator {\n /** Cost in lamports to validate a signature. */\n lamportsPerSignature: number;\n}\n","import * as BufferLayout from 'buffer-layout';\n\nimport type {Blockhash} from './blockhash';\nimport * as Layout from './layout';\nimport {PublicKey} from './publickey';\nimport type {FeeCalculator} from './fee-calculator';\nimport {FeeCalculatorLayout} from './fee-calculator';\nimport {toBuffer} from './util/to-buffer';\n\n/**\n * See https://github.com/solana-labs/solana/blob/0ea2843ec9cdc517572b8e62c959f41b55cf4453/sdk/src/nonce_state.rs#L29-L32\n *\n * @internal\n */\nconst NonceAccountLayout = BufferLayout.struct([\n BufferLayout.u32('version'),\n BufferLayout.u32('state'),\n Layout.publicKey('authorizedPubkey'),\n Layout.publicKey('nonce'),\n BufferLayout.struct([FeeCalculatorLayout], 'feeCalculator'),\n]);\n\nexport const NONCE_ACCOUNT_LENGTH = NonceAccountLayout.span;\n\ntype NonceAccountArgs = {\n authorizedPubkey: PublicKey;\n nonce: Blockhash;\n feeCalculator: FeeCalculator;\n};\n\n/**\n * NonceAccount class\n */\nexport class NonceAccount {\n authorizedPubkey: PublicKey;\n nonce: Blockhash;\n feeCalculator: FeeCalculator;\n\n /**\n * @internal\n */\n constructor(args: NonceAccountArgs) {\n this.authorizedPubkey = args.authorizedPubkey;\n this.nonce = args.nonce;\n this.feeCalculator = args.feeCalculator;\n }\n\n /**\n * Deserialize NonceAccount from the account data.\n *\n * @param buffer account data\n * @return NonceAccount\n */\n static fromAccountData(\n buffer: Buffer | Uint8Array | Array<number>,\n ): NonceAccount {\n const nonceAccount = NonceAccountLayout.decode(toBuffer(buffer), 0);\n return new NonceAccount({\n authorizedPubkey: new PublicKey(nonceAccount.authorizedPubkey),\n nonce: new PublicKey(nonceAccount.nonce).toString(),\n feeCalculator: nonceAccount.feeCalculator,\n });\n }\n}\n","import * as BufferLayout from 'buffer-layout';\n\nimport {encodeData, decodeData, InstructionType} from './instruction';\nimport * as Layout from './layout';\nimport {NONCE_ACCOUNT_LENGTH} from './nonce-account';\nimport {PublicKey} from './publickey';\nimport {SYSVAR_RECENT_BLOCKHASHES_PUBKEY, SYSVAR_RENT_PUBKEY} from './sysvar';\nimport {Transaction, TransactionInstruction} from './transaction';\n\n/**\n * Create account system transaction params\n * @typedef {Object} CreateAccountParams\n * @property {PublicKey} fromPubkey\n * @property {PublicKey} newAccountPubkey\n * @property {number} lamports\n * @property {number} space\n * @property {PublicKey} programId\n */\nexport type CreateAccountParams = {\n fromPubkey: PublicKey;\n newAccountPubkey: PublicKey;\n lamports: number;\n space: number;\n programId: PublicKey;\n};\n\n/**\n * Transfer system transaction params\n * @typedef {Object} TransferParams\n * @property {PublicKey} fromPubkey\n * @property {PublicKey} toPubkey\n * @property {number} lamports\n */\nexport type TransferParams = {\n fromPubkey: PublicKey;\n toPubkey: PublicKey;\n lamports: number;\n};\n\n/**\n * Assign system transaction params\n * @typedef {Object} AssignParams\n * @property {PublicKey} accountPubkey\n * @property {PublicKey} programId\n */\nexport type AssignParams = {\n accountPubkey: PublicKey;\n programId: PublicKey;\n};\n\n/**\n * Create account with seed system transaction params\n * @typedef {Object} CreateAccountWithSeedParams\n * @property {PublicKey} fromPubkey\n * @property {PublicKey} newAccountPubkey\n * @property {PublicKey} basePubkey\n * @property {string} seed\n * @property {number} lamports\n * @property {number} space\n * @property {PublicKey} programId\n */\nexport type CreateAccountWithSeedParams = {\n fromPubkey: PublicKey;\n newAccountPubkey: PublicKey;\n basePubkey: PublicKey;\n seed: string;\n lamports: number;\n space: number;\n programId: PublicKey;\n};\n\n/**\n * Create nonce account system transaction params\n * @typedef {Object} CreateNonceAccountParams\n * @property {PublicKey} fromPubkey\n * @property {PublicKey} noncePubkey\n * @property {PublicKey} authorizedPubkey\n * @property {number} lamports\n */\nexport type CreateNonceAccountParams = {\n fromPubkey: PublicKey;\n noncePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n lamports: number;\n};\n\n/**\n * Create nonce account with seed system transaction params\n * @typedef {Object} CreateNonceAccountWithSeedParams\n * @property {PublicKey} fromPubkey\n * @property {PublicKey} noncePubkey\n * @property {PublicKey} authorizedPubkey\n * @property {PublicKey} basePubkey\n * @property {string} seed\n * @property {number} lamports\n */\nexport type CreateNonceAccountWithSeedParams = {\n fromPubkey: PublicKey;\n noncePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n lamports: number;\n basePubkey: PublicKey;\n seed: string;\n};\n\n/**\n * Initialize nonce account system instruction params\n * @typedef {Object} InitializeNonceParams\n * @property {PublicKey} noncePubkey\n * @property {PublicKey} authorizedPubkey\n */\nexport type InitializeNonceParams = {\n noncePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n};\n\n/**\n * Advance nonce account system instruction params\n * @typedef {Object} AdvanceNonceParams\n * @property {PublicKey} noncePubkey\n * @property {PublicKey} authorizedPubkey\n */\nexport type AdvanceNonceParams = {\n noncePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n};\n\n/**\n * Withdraw nonce account system transaction params\n * @typedef {Object} WithdrawNonceParams\n * @property {PublicKey} noncePubkey\n * @property {PublicKey} authorizedPubkey\n * @property {PublicKey} toPubkey\n * @property {number} lamports\n */\nexport type WithdrawNonceParams = {\n noncePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n toPubkey: PublicKey;\n lamports: number;\n};\n\n/**\n * Authorize nonce account system transaction params\n * @typedef {Object} AuthorizeNonceParams\n * @property {PublicKey} noncePubkey\n * @property {PublicKey} authorizedPubkey\n * @property {PublicKey} newAuthorizedPubkey\n */\nexport type AuthorizeNonceParams = {\n noncePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n newAuthorizedPubkey: PublicKey;\n};\n\n/**\n * Allocate account system transaction params\n * @typedef {Object} AllocateParams\n * @property {PublicKey} accountPubkey\n * @property {number} space\n */\nexport type AllocateParams = {\n accountPubkey: PublicKey;\n space: number;\n};\n\n/**\n * Allocate account with seed system transaction params\n * @typedef {Object} AllocateWithSeedParams\n * @property {PublicKey} accountPubkey\n * @property {PublicKey} basePubkey\n * @property {string} seed\n * @property {number} space\n * @property {PublicKey} programId\n */\nexport type AllocateWithSeedParams = {\n accountPubkey: PublicKey;\n basePubkey: PublicKey;\n seed: string;\n space: number;\n programId: PublicKey;\n};\n\n/**\n * Assign account with seed system transaction params\n * @typedef {Object} AssignWithSeedParams\n * @property {PublicKey} accountPubkey\n * @property {PublicKey} basePubkey\n * @property {string} seed\n * @property {PublicKey} programId\n */\nexport type AssignWithSeedParams = {\n accountPubkey: PublicKey;\n basePubkey: PublicKey;\n seed: string;\n programId: PublicKey;\n};\n\n/**\n * Transfer with seed system transaction params\n * @typedef {Object} TransferWithSeedParams\n * @property {PublicKey} fromPubkey\n * @property {PublicKey} basePubkey\n * @property {PublicKey} toPubkey\n * @property {number} lamports\n * @property {string} seed\n * @property {PublicKey} programId\n */\nexport type TransferWithSeedParams = {\n fromPubkey: PublicKey;\n basePubkey: PublicKey;\n toPubkey: PublicKey;\n lamports: number;\n seed: string;\n programId: PublicKey;\n};\n\n/**\n * System Instruction class\n */\nexport class SystemInstruction {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Decode a system instruction and retrieve the instruction type.\n */\n static decodeInstructionType(\n instruction: TransactionInstruction,\n ): SystemInstructionType {\n this.checkProgramId(instruction.programId);\n\n const instructionTypeLayout = BufferLayout.u32('instruction');\n const typeIndex = instructionTypeLayout.decode(instruction.data);\n\n let type: SystemInstructionType | undefined;\n for (const [ixType, layout] of Object.entries(SYSTEM_INSTRUCTION_LAYOUTS)) {\n if (layout.index == typeIndex) {\n type = ixType as SystemInstructionType;\n break;\n }\n }\n\n if (!type) {\n throw new Error('Instruction type incorrect; not a SystemInstruction');\n }\n\n return type;\n }\n\n /**\n * Decode a create account system instruction and retrieve the instruction params.\n */\n static decodeCreateAccount(\n instruction: TransactionInstruction,\n ): CreateAccountParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n\n const {lamports, space, programId} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.Create,\n instruction.data,\n );\n\n return {\n fromPubkey: instruction.keys[0].pubkey,\n newAccountPubkey: instruction.keys[1].pubkey,\n lamports,\n space,\n programId: new PublicKey(programId),\n };\n }\n\n /**\n * Decode a transfer system instruction and retrieve the instruction params.\n */\n static decodeTransfer(instruction: TransactionInstruction): TransferParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n\n const {lamports} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.Transfer,\n instruction.data,\n );\n\n return {\n fromPubkey: instruction.keys[0].pubkey,\n toPubkey: instruction.keys[1].pubkey,\n lamports,\n };\n }\n\n /**\n * Decode a transfer with seed system instruction and retrieve the instruction params.\n */\n static decodeTransferWithSeed(\n instruction: TransactionInstruction,\n ): TransferWithSeedParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n\n const {lamports, seed, programId} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.TransferWithSeed,\n instruction.data,\n );\n\n return {\n fromPubkey: instruction.keys[0].pubkey,\n basePubkey: instruction.keys[1].pubkey,\n toPubkey: instruction.keys[2].pubkey,\n lamports,\n seed,\n programId: new PublicKey(programId),\n };\n }\n\n /**\n * Decode an allocate system instruction and retrieve the instruction params.\n */\n static decodeAllocate(instruction: TransactionInstruction): AllocateParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 1);\n\n const {space} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.Allocate,\n instruction.data,\n );\n\n return {\n accountPubkey: instruction.keys[0].pubkey,\n space,\n };\n }\n\n /**\n * Decode an allocate with seed system instruction and retrieve the instruction params.\n */\n static decodeAllocateWithSeed(\n instruction: TransactionInstruction,\n ): AllocateWithSeedParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 1);\n\n const {base, seed, space, programId} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.AllocateWithSeed,\n instruction.data,\n );\n\n return {\n accountPubkey: instruction.keys[0].pubkey,\n basePubkey: new PublicKey(base),\n seed,\n space,\n programId: new PublicKey(programId),\n };\n }\n\n /**\n * Decode an assign system instruction and retrieve the instruction params.\n */\n static decodeAssign(instruction: TransactionInstruction): AssignParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 1);\n\n const {programId} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.Assign,\n instruction.data,\n );\n\n return {\n accountPubkey: instruction.keys[0].pubkey,\n programId: new PublicKey(programId),\n };\n }\n\n /**\n * Decode an assign with seed system instruction and retrieve the instruction params.\n */\n static decodeAssignWithSeed(\n instruction: TransactionInstruction,\n ): AssignWithSeedParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 1);\n\n const {base, seed, programId} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.AssignWithSeed,\n instruction.data,\n );\n\n return {\n accountPubkey: instruction.keys[0].pubkey,\n basePubkey: new PublicKey(base),\n seed,\n programId: new PublicKey(programId),\n };\n }\n\n /**\n * Decode a create account with seed system instruction and retrieve the instruction params.\n */\n static decodeCreateWithSeed(\n instruction: TransactionInstruction,\n ): CreateAccountWithSeedParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n\n const {base, seed, lamports, space, programId} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.CreateWithSeed,\n instruction.data,\n );\n\n return {\n fromPubkey: instruction.keys[0].pubkey,\n newAccountPubkey: instruction.keys[1].pubkey,\n basePubkey: new PublicKey(base),\n seed,\n lamports,\n space,\n programId: new PublicKey(programId),\n };\n }\n\n /**\n * Decode a nonce initialize system instruction and retrieve the instruction params.\n */\n static decodeNonceInitialize(\n instruction: TransactionInstruction,\n ): InitializeNonceParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n\n const {authorized} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.InitializeNonceAccount,\n instruction.data,\n );\n\n return {\n noncePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: new PublicKey(authorized),\n };\n }\n\n /**\n * Decode a nonce advance system instruction and retrieve the instruction params.\n */\n static decodeNonceAdvance(\n instruction: TransactionInstruction,\n ): AdvanceNonceParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n\n decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.AdvanceNonceAccount,\n instruction.data,\n );\n\n return {\n noncePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n };\n }\n\n /**\n * Decode a nonce withdraw system instruction and retrieve the instruction params.\n */\n static decodeNonceWithdraw(\n instruction: TransactionInstruction,\n ): WithdrawNonceParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 5);\n\n const {lamports} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.WithdrawNonceAccount,\n instruction.data,\n );\n\n return {\n noncePubkey: instruction.keys[0].pubkey,\n toPubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[4].pubkey,\n lamports,\n };\n }\n\n /**\n * Decode a nonce authorize system instruction and retrieve the instruction params.\n */\n static decodeNonceAuthorize(\n instruction: TransactionInstruction,\n ): AuthorizeNonceParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n\n const {authorized} = decodeData(\n SYSTEM_INSTRUCTION_LAYOUTS.AuthorizeNonceAccount,\n instruction.data,\n );\n\n return {\n noncePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[1].pubkey,\n newAuthorizedPubkey: new PublicKey(authorized),\n };\n }\n\n /**\n * @internal\n */\n static checkProgramId(programId: PublicKey) {\n if (!programId.equals(SystemProgram.programId)) {\n throw new Error('invalid instruction; programId is not SystemProgram');\n }\n }\n\n /**\n * @internal\n */\n static checkKeyLength(keys: Array<any>, expectedLength: number) {\n if (keys.length < expectedLength) {\n throw new Error(\n `invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`,\n );\n }\n }\n}\n\n/**\n * An enumeration of valid SystemInstructionType's\n */\nexport type SystemInstructionType =\n | 'AdvanceNonceAccount'\n | 'Allocate'\n | 'AllocateWithSeed'\n | 'Assign'\n | 'AssignWithSeed'\n | 'AuthorizeNonceAccount'\n | 'Create'\n | 'CreateWithSeed'\n | 'InitializeNonceAccount'\n | 'Transfer'\n | 'TransferWithSeed'\n | 'WithdrawNonceAccount';\n\n/**\n * An enumeration of valid system InstructionType's\n */\nexport const SYSTEM_INSTRUCTION_LAYOUTS: {\n [type in SystemInstructionType]: InstructionType;\n} = Object.freeze({\n Create: {\n index: 0,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.ns64('lamports'),\n BufferLayout.ns64('space'),\n Layout.publicKey('programId'),\n ]),\n },\n Assign: {\n index: 1,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('programId'),\n ]),\n },\n Transfer: {\n index: 2,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.ns64('lamports'),\n ]),\n },\n CreateWithSeed: {\n index: 3,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('base'),\n Layout.rustString('seed'),\n BufferLayout.ns64('lamports'),\n BufferLayout.ns64('space'),\n Layout.publicKey('programId'),\n ]),\n },\n AdvanceNonceAccount: {\n index: 4,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')]),\n },\n WithdrawNonceAccount: {\n index: 5,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.ns64('lamports'),\n ]),\n },\n InitializeNonceAccount: {\n index: 6,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('authorized'),\n ]),\n },\n AuthorizeNonceAccount: {\n index: 7,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('authorized'),\n ]),\n },\n Allocate: {\n index: 8,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.ns64('space'),\n ]),\n },\n AllocateWithSeed: {\n index: 9,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('base'),\n Layout.rustString('seed'),\n BufferLayout.ns64('space'),\n Layout.publicKey('programId'),\n ]),\n },\n AssignWithSeed: {\n index: 10,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('base'),\n Layout.rustString('seed'),\n Layout.publicKey('programId'),\n ]),\n },\n TransferWithSeed: {\n index: 11,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.ns64('lamports'),\n Layout.rustString('seed'),\n Layout.publicKey('programId'),\n ]),\n },\n});\n\n/**\n * Factory class for transactions to interact with the System program\n */\nexport class SystemProgram {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the System program\n */\n static get programId(): PublicKey {\n return new PublicKey('11111111111111111111111111111111');\n }\n\n /**\n * Generate a transaction instruction that creates a new account\n */\n static createAccount(params: CreateAccountParams): TransactionInstruction {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Create;\n const data = encodeData(type, {\n lamports: params.lamports,\n space: params.space,\n programId: params.programId.toBuffer(),\n });\n\n return new TransactionInstruction({\n keys: [\n {pubkey: params.fromPubkey, isSigner: true, isWritable: true},\n {pubkey: params.newAccountPubkey, isSigner: true, isWritable: true},\n ],\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a transaction instruction that transfers lamports from one account to another\n */\n static transfer(\n params: TransferParams | TransferWithSeedParams,\n ): TransactionInstruction {\n let data;\n let keys;\n if ('basePubkey' in params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.TransferWithSeed;\n data = encodeData(type, {\n lamports: params.lamports,\n seed: params.seed,\n programId: params.programId.toBuffer(),\n });\n keys = [\n {pubkey: params.fromPubkey, isSigner: false, isWritable: true},\n {pubkey: params.basePubkey, isSigner: true, isWritable: false},\n {pubkey: params.toPubkey, isSigner: false, isWritable: true},\n ];\n } else {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Transfer;\n data = encodeData(type, {lamports: params.lamports});\n keys = [\n {pubkey: params.fromPubkey, isSigner: true, isWritable: true},\n {pubkey: params.toPubkey, isSigner: false, isWritable: true},\n ];\n }\n\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a transaction instruction that assigns an account to a program\n */\n static assign(\n params: AssignParams | AssignWithSeedParams,\n ): TransactionInstruction {\n let data;\n let keys;\n if ('basePubkey' in params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.AssignWithSeed;\n data = encodeData(type, {\n base: params.basePubkey.toBuffer(),\n seed: params.seed,\n programId: params.programId.toBuffer(),\n });\n keys = [\n {pubkey: params.accountPubkey, isSigner: false, isWritable: true},\n {pubkey: params.basePubkey, isSigner: true, isWritable: false},\n ];\n } else {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Assign;\n data = encodeData(type, {programId: params.programId.toBuffer()});\n keys = [{pubkey: params.accountPubkey, isSigner: true, isWritable: true}];\n }\n\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a transaction instruction that creates a new account at\n * an address generated with `from`, a seed, and programId\n */\n static createAccountWithSeed(\n params: CreateAccountWithSeedParams,\n ): TransactionInstruction {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.CreateWithSeed;\n const data = encodeData(type, {\n base: params.basePubkey.toBuffer(),\n seed: params.seed,\n lamports: params.lamports,\n space: params.space,\n programId: params.programId.toBuffer(),\n });\n let keys = [\n {pubkey: params.fromPubkey, isSigner: true, isWritable: true},\n {pubkey: params.newAccountPubkey, isSigner: false, isWritable: true},\n ];\n if (params.basePubkey != params.fromPubkey) {\n keys.push({pubkey: params.basePubkey, isSigner: true, isWritable: false});\n }\n\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a transaction that creates a new Nonce account\n */\n static createNonceAccount(\n params: CreateNonceAccountParams | CreateNonceAccountWithSeedParams,\n ): Transaction {\n const transaction = new Transaction();\n if ('basePubkey' in params && 'seed' in params) {\n transaction.add(\n SystemProgram.createAccountWithSeed({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.noncePubkey,\n basePubkey: params.basePubkey,\n seed: params.seed,\n lamports: params.lamports,\n space: NONCE_ACCOUNT_LENGTH,\n programId: this.programId,\n }),\n );\n } else {\n transaction.add(\n SystemProgram.createAccount({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.noncePubkey,\n lamports: params.lamports,\n space: NONCE_ACCOUNT_LENGTH,\n programId: this.programId,\n }),\n );\n }\n\n const initParams = {\n noncePubkey: params.noncePubkey,\n authorizedPubkey: params.authorizedPubkey,\n };\n\n transaction.add(this.nonceInitialize(initParams));\n return transaction;\n }\n\n /**\n * Generate an instruction to initialize a Nonce account\n */\n static nonceInitialize(\n params: InitializeNonceParams,\n ): TransactionInstruction {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.InitializeNonceAccount;\n const data = encodeData(type, {\n authorized: params.authorizedPubkey.toBuffer(),\n });\n const instructionData = {\n keys: [\n {pubkey: params.noncePubkey, isSigner: false, isWritable: true},\n {\n pubkey: SYSVAR_RECENT_BLOCKHASHES_PUBKEY,\n isSigner: false,\n isWritable: false,\n },\n {pubkey: SYSVAR_RENT_PUBKEY, isSigner: false, isWritable: false},\n ],\n programId: this.programId,\n data,\n };\n return new TransactionInstruction(instructionData);\n }\n\n /**\n * Generate an instruction to advance the nonce in a Nonce account\n */\n static nonceAdvance(params: AdvanceNonceParams): TransactionInstruction {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.AdvanceNonceAccount;\n const data = encodeData(type);\n const instructionData = {\n keys: [\n {pubkey: params.noncePubkey, isSigner: false, isWritable: true},\n {\n pubkey: SYSVAR_RECENT_BLOCKHASHES_PUBKEY,\n isSigner: false,\n isWritable: false,\n },\n {pubkey: params.authorizedPubkey, isSigner: true, isWritable: false},\n ],\n programId: this.programId,\n data,\n };\n return new TransactionInstruction(instructionData);\n }\n\n /**\n * Generate a transaction instruction that withdraws lamports from a Nonce account\n */\n static nonceWithdraw(params: WithdrawNonceParams): TransactionInstruction {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.WithdrawNonceAccount;\n const data = encodeData(type, {lamports: params.lamports});\n\n return new TransactionInstruction({\n keys: [\n {pubkey: params.noncePubkey, isSigner: false, isWritable: true},\n {pubkey: params.toPubkey, isSigner: false, isWritable: true},\n {\n pubkey: SYSVAR_RECENT_BLOCKHASHES_PUBKEY,\n isSigner: false,\n isWritable: false,\n },\n {\n pubkey: SYSVAR_RENT_PUBKEY,\n isSigner: false,\n isWritable: false,\n },\n {pubkey: params.authorizedPubkey, isSigner: true, isWritable: false},\n ],\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a transaction instruction that authorizes a new PublicKey as the authority\n * on a Nonce account.\n */\n static nonceAuthorize(params: AuthorizeNonceParams): TransactionInstruction {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.AuthorizeNonceAccount;\n const data = encodeData(type, {\n authorized: params.newAuthorizedPubkey.toBuffer(),\n });\n\n return new TransactionInstruction({\n keys: [\n {pubkey: params.noncePubkey, isSigner: false, isWritable: true},\n {pubkey: params.authorizedPubkey, isSigner: true, isWritable: false},\n ],\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a transaction instruction that allocates space in an account without funding\n */\n static allocate(\n params: AllocateParams | AllocateWithSeedParams,\n ): TransactionInstruction {\n let data;\n let keys;\n if ('basePubkey' in params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.AllocateWithSeed;\n data = encodeData(type, {\n base: params.basePubkey.toBuffer(),\n seed: params.seed,\n space: params.space,\n programId: params.programId.toBuffer(),\n });\n keys = [\n {pubkey: params.accountPubkey, isSigner: false, isWritable: true},\n {pubkey: params.basePubkey, isSigner: true, isWritable: false},\n ];\n } else {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Allocate;\n data = encodeData(type, {\n space: params.space,\n });\n keys = [{pubkey: params.accountPubkey, isSigner: true, isWritable: true}];\n }\n\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data,\n });\n }\n}\n","import {Buffer} from 'buffer';\nimport * as BufferLayout from 'buffer-layout';\n\nimport {Account} from './account';\nimport {PublicKey} from './publickey';\nimport {Transaction, PACKET_DATA_SIZE} from './transaction';\nimport {SYSVAR_RENT_PUBKEY} from './sysvar';\nimport {sendAndConfirmTransaction} from './util/send-and-confirm-transaction';\nimport {sleep} from './util/sleep';\nimport type {Connection} from './connection';\nimport {SystemProgram} from './system-program';\n\n/**\n * Program loader interface\n */\nexport class Loader {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Amount of program data placed in each load Transaction\n */\n static get chunkSize(): number {\n // Keep program chunks under PACKET_DATA_SIZE, leaving enough room for the\n // rest of the Transaction fields\n //\n // TODO: replace 300 with a proper constant for the size of the other\n // Transaction fields\n return PACKET_DATA_SIZE - 300;\n }\n\n /**\n * Minimum number of signatures required to load a program not including\n * retries\n *\n * Can be used to calculate transaction fees\n */\n static getMinNumSignatures(dataLength: number): number {\n return (\n 2 * // Every transaction requires two signatures (payer + program)\n (Math.ceil(dataLength / Loader.chunkSize) +\n 1 + // Add one for Create transaction\n 1) // Add one for Finalize transaction\n );\n }\n\n /**\n * Loads a generic program\n *\n * @param connection The connection to use\n * @param payer System account that pays to load the program\n * @param program Account to load the program into\n * @param programId Public key that identifies the loader\n * @param data Program octets\n * @return true if program was loaded successfully, false if program was already loaded\n */\n static async load(\n connection: Connection,\n payer: Account,\n program: Account,\n programId: PublicKey,\n data: Buffer | Uint8Array | Array<number>,\n ): Promise<boolean> {\n {\n const balanceNeeded = await connection.getMinimumBalanceForRentExemption(\n data.length,\n );\n\n // Fetch program account info to check if it has already been created\n const programInfo = await connection.getAccountInfo(\n program.publicKey,\n 'confirmed',\n );\n\n let transaction: Transaction | null = null;\n if (programInfo !== null) {\n if (programInfo.executable) {\n console.error('Program load failed, account is already executable');\n return false;\n }\n\n if (programInfo.data.length !== data.length) {\n transaction = transaction || new Transaction();\n transaction.add(\n SystemProgram.allocate({\n accountPubkey: program.publicKey,\n space: data.length,\n }),\n );\n }\n\n if (!programInfo.owner.equals(programId)) {\n transaction = transaction || new Transaction();\n transaction.add(\n SystemProgram.assign({\n accountPubkey: program.publicKey,\n programId,\n }),\n );\n }\n\n if (programInfo.lamports < balanceNeeded) {\n transaction = transaction || new Transaction();\n transaction.add(\n SystemProgram.transfer({\n fromPubkey: payer.publicKey,\n toPubkey: program.publicKey,\n lamports: balanceNeeded - programInfo.lamports,\n }),\n );\n }\n } else {\n transaction = new Transaction().add(\n SystemProgram.createAccount({\n fromPubkey: payer.publicKey,\n newAccountPubkey: program.publicKey,\n lamports: balanceNeeded > 0 ? balanceNeeded : 1,\n space: data.length,\n programId,\n }),\n );\n }\n\n // If the account is already created correctly, skip this step\n // and proceed directly to loading instructions\n if (transaction !== null) {\n await sendAndConfirmTransaction(\n connection,\n transaction,\n [payer, program],\n {\n commitment: 'confirmed',\n },\n );\n }\n }\n\n const dataLayout = BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.u32('offset'),\n BufferLayout.u32('bytesLength'),\n BufferLayout.u32('bytesLengthPadding'),\n BufferLayout.seq(\n BufferLayout.u8('byte'),\n BufferLayout.offset(BufferLayout.u32(), -8),\n 'bytes',\n ),\n ]);\n\n const chunkSize = Loader.chunkSize;\n let offset = 0;\n let array = data;\n let transactions = [];\n while (array.length > 0) {\n const bytes = array.slice(0, chunkSize);\n const data = Buffer.alloc(chunkSize + 16);\n dataLayout.encode(\n {\n instruction: 0, // Load instruction\n offset,\n bytes,\n },\n data,\n );\n\n const transaction = new Transaction().add({\n keys: [{pubkey: program.publicKey, isSigner: true, isWritable: true}],\n programId,\n data,\n });\n transactions.push(\n sendAndConfirmTransaction(connection, transaction, [payer, program], {\n commitment: 'confirmed',\n }),\n );\n\n // Delay between sends in an attempt to reduce rate limit errors\n if (connection._rpcEndpoint.includes('solana.com')) {\n const REQUESTS_PER_SECOND = 4;\n await sleep(1000 / REQUESTS_PER_SECOND);\n }\n\n offset += chunkSize;\n array = array.slice(chunkSize);\n }\n await Promise.all(transactions);\n\n // Finalize the account loaded with program data for execution\n {\n const dataLayout = BufferLayout.struct([BufferLayout.u32('instruction')]);\n\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n instruction: 1, // Finalize instruction\n },\n data,\n );\n\n const transaction = new Transaction().add({\n keys: [\n {pubkey: program.publicKey, isSigner: true, isWritable: true},\n {pubkey: SYSVAR_RENT_PUBKEY, isSigner: false, isWritable: false},\n ],\n programId,\n data,\n });\n await sendAndConfirmTransaction(\n connection,\n transaction,\n [payer, program],\n {\n commitment: 'confirmed',\n },\n );\n }\n\n // success\n return true;\n }\n}\n","import {Account} from './account';\nimport {PublicKey} from './publickey';\nimport {Loader} from './loader';\nimport type {Connection} from './connection';\n\nexport const BPF_LOADER_PROGRAM_ID = new PublicKey(\n 'BPFLoader2111111111111111111111111111111111',\n);\n\n/**\n * Factory class for transactions to interact with a program loader\n */\nexport class BpfLoader {\n /**\n * Minimum number of signatures required to load a program not including\n * retries\n *\n * Can be used to calculate transaction fees\n */\n static getMinNumSignatures(dataLength: number): number {\n return Loader.getMinNumSignatures(dataLength);\n }\n\n /**\n * Load a BPF program\n *\n * @param connection The connection to use\n * @param payer Account that will pay program loading fees\n * @param program Account to load the program into\n * @param elf The entire ELF containing the BPF program\n * @param loaderProgramId The program id of the BPF loader to use\n * @return true if program was loaded successfully, false if program was already loaded\n */\n static load(\n connection: Connection,\n payer: Account,\n program: Account,\n elf: Buffer | Uint8Array | Array<number>,\n loaderProgramId: PublicKey,\n ): Promise<boolean> {\n return Loader.load(connection, payer, program, loaderProgramId, elf);\n }\n}\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see <https://mathiasbynens.be/notes/javascript-encoding>\n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode };\nexport default punycode;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\nfunction stringifyPrimitive(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n}\n\nexport function stringify (obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (isArray(obj[k])) {\n return map(obj[k], function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n\nfunction map (xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n return res;\n};\n\nexport function parse(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\nexport default {\n encode: stringify,\n stringify: stringify,\n decode: parse,\n parse: parse\n}\nexport {stringify as encode, parse as decode};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\nimport {toASCII} from 'punycode';\nimport {isObject,isString,isNullOrUndefined,isNull} from 'util';\nimport {parse as qsParse,stringify as qsStringify} from 'querystring';\nexport {\n urlParse as parse,\n urlResolve as resolve,\n urlResolveObject as resolveObject,\n urlFormat as format\n};\nexport default {\n parse: urlParse,\n resolve: urlResolve,\n resolveObject: urlResolveObject,\n format: urlFormat,\n Url: Url\n}\nexport function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.host = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.query = null;\n this.pathname = null;\n this.path = null;\n this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n\n // Special case for a simple path URL\n simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\n // RFC 2396: characters reserved for delimiting URLs.\n // We actually just auto-escape these.\n delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\n // RFC 2396: characters not allowed for various reasons.\n unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n autoEscape = ['\\''].concat(unwise),\n // Characters that are never ever allowed in a hostname.\n // Note that any invalid chars are also handled, but these\n // are the ones that are *expected* to be seen, so we fast-path\n // them.\n nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n hostEndingChars = ['/', '?', '#'],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n unsafeProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that never have a hostname.\n hostlessProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that always contain a // bit.\n slashedProtocol = {\n 'http': true,\n 'https': true,\n 'ftp': true,\n 'gopher': true,\n 'file': true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n };\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n if (url && isObject(url) && url instanceof Url) return url;\n\n var u = new Url;\n u.parse(url, parseQueryString, slashesDenoteHost);\n return u;\n}\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n return parse(this, url, parseQueryString, slashesDenoteHost);\n}\n\nfunction parse(self, url, parseQueryString, slashesDenoteHost) {\n if (!isString(url)) {\n throw new TypeError('Parameter \\'url\\' must be a string, not ' + typeof url);\n }\n\n // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n var queryIndex = url.indexOf('?'),\n splitter =\n (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n uSplit = url.split(splitter),\n slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, '/');\n url = uSplit.join(splitter);\n\n var rest = url;\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n self.path = rest;\n self.href = rest;\n self.pathname = simplePath[1];\n if (simplePath[2]) {\n self.search = simplePath[2];\n if (parseQueryString) {\n self.query = qsParse(self.search.substr(1));\n } else {\n self.query = self.search.substr(1);\n }\n } else if (parseQueryString) {\n self.search = '';\n self.query = {};\n }\n return self;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n self.protocol = lowerProto;\n rest = rest.substr(proto.length);\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n var slashes = rest.substr(0, 2) === '//';\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n self.slashes = true;\n }\n }\n var i, hec, l, p;\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n for (i = 0; i < hostEndingChars.length; i++) {\n hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n var auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd);\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n self.auth = decodeURIComponent(auth);\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (i = 0; i < nonHostChars.length; i++) {\n hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1)\n hostEnd = rest.length;\n\n self.host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n\n // pull out port.\n parseHost(self);\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n self.hostname = self.hostname || '';\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n var ipv6Hostname = self.hostname[0] === '[' &&\n self.hostname[self.hostname.length - 1] === ']';\n\n // validate a little.\n if (!ipv6Hostname) {\n var hostparts = self.hostname.split(/\\./);\n for (i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = '/' + notHost.join('.') + rest;\n }\n self.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (self.hostname.length > hostnameMaxLen) {\n self.hostname = '';\n } else {\n // hostnames are always lower case.\n self.hostname = self.hostname.toLowerCase();\n }\n\n if (!ipv6Hostname) {\n // IDNA Support: Returns a punycoded representation of \"domain\".\n // It only converts parts of the domain name that\n // have non-ASCII characters, i.e. it doesn't matter if\n // you call it with a domain that already is ASCII-only.\n self.hostname = toASCII(self.hostname);\n }\n\n p = self.port ? ':' + self.port : '';\n var h = self.hostname || '';\n self.host = h + p;\n self.href += self.host;\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n self.hostname = self.hostname.substr(1, self.hostname.length - 2);\n if (rest[0] !== '/') {\n rest = '/' + rest;\n }\n }\n }\n\n // now rest is set to the post-host stuff.\n // chop off any delim chars.\n if (!unsafeProtocol[lowerProto]) {\n\n // First, make 100% sure that any \"autoEscape\" chars get\n // escaped, even if encodeURIComponent doesn't think they\n // need to be.\n for (i = 0, l = autoEscape.length; i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae) {\n esc = escape(ae);\n }\n rest = rest.split(ae).join(esc);\n }\n }\n\n\n // chop off from the tail first.\n var hash = rest.indexOf('#');\n if (hash !== -1) {\n // got a fragment string.\n self.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n var qm = rest.indexOf('?');\n if (qm !== -1) {\n self.search = rest.substr(qm);\n self.query = rest.substr(qm + 1);\n if (parseQueryString) {\n self.query = qsParse(self.query);\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString) {\n // no query string, but parseQueryString still requested\n self.search = '';\n self.query = {};\n }\n if (rest) self.pathname = rest;\n if (slashedProtocol[lowerProto] &&\n self.hostname && !self.pathname) {\n self.pathname = '/';\n }\n\n //to support http.request\n if (self.pathname || self.search) {\n p = self.pathname || '';\n var s = self.search || '';\n self.path = p + s;\n }\n\n // finally, reconstruct the href based on what has been validated.\n self.href = format(self);\n return self;\n}\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (isString(obj)) obj = parse({}, obj);\n return format(obj);\n}\n\nfunction format(self) {\n var auth = self.auth || '';\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, ':');\n auth += '@';\n }\n\n var protocol = self.protocol || '',\n pathname = self.pathname || '',\n hash = self.hash || '',\n host = false,\n query = '';\n\n if (self.host) {\n host = auth + self.host;\n } else if (self.hostname) {\n host = auth + (self.hostname.indexOf(':') === -1 ?\n self.hostname :\n '[' + this.hostname + ']');\n if (self.port) {\n host += ':' + self.port;\n }\n }\n\n if (self.query &&\n isObject(self.query) &&\n Object.keys(self.query).length) {\n query = qsStringify(self.query);\n }\n\n var search = self.search || (query && ('?' + query)) || '';\n\n if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\n // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n // unless they had them to begin with.\n if (self.slashes ||\n (!protocol || slashedProtocol[protocol]) && host !== false) {\n host = '//' + (host || '');\n if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n } else if (!host) {\n host = '';\n }\n\n if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n if (search && search.charAt(0) !== '?') search = '?' + search;\n\n pathname = pathname.replace(/[?#]/g, function(match) {\n return encodeURIComponent(match);\n });\n search = search.replace('#', '%23');\n\n return protocol + host + pathname + search + hash;\n}\n\nUrl.prototype.format = function() {\n return format(this);\n}\n\nfunction urlResolve(source, relative) {\n return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n if (!source) return relative;\n return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function(relative) {\n if (isString(relative)) {\n var rel = new Url();\n rel.parse(relative, false, true);\n relative = rel;\n }\n\n var result = new Url();\n var tkeys = Object.keys(this);\n for (var tk = 0; tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n\n // hash is always overridden, no matter what.\n // even href=\"\" will remove it.\n result.hash = relative.hash;\n\n // if the relative url is empty, then there's nothing left to do here.\n if (relative.href === '') {\n result.href = result.format();\n return result;\n }\n\n // hrefs like //foo/bar always cut to the protocol.\n if (relative.slashes && !relative.protocol) {\n // take everything except the protocol from relative\n var rkeys = Object.keys(relative);\n for (var rk = 0; rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== 'protocol')\n result[rkey] = relative[rkey];\n }\n\n //urlParse appends trailing / to urls like http://www.example.com\n if (slashedProtocol[result.protocol] &&\n result.hostname && !result.pathname) {\n result.path = result.pathname = '/';\n }\n\n result.href = result.format();\n return result;\n }\n var relPath;\n if (relative.protocol && relative.protocol !== result.protocol) {\n // if it's a known url protocol, then changing\n // the protocol does weird things\n // first, if it's not file:, then we MUST have a host,\n // and if there was a path\n // to begin with, then we MUST have a path.\n // if it is file:, then the host is dropped,\n // because that's known to be hostless.\n // anything else is assumed to be absolute.\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0; v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n result.href = result.format();\n return result;\n }\n\n result.protocol = relative.protocol;\n if (!relative.host && !hostlessProtocol[relative.protocol]) {\n relPath = (relative.pathname || '').split('/');\n while (relPath.length && !(relative.host = relPath.shift()));\n if (!relative.host) relative.host = '';\n if (!relative.hostname) relative.hostname = '';\n if (relPath[0] !== '') relPath.unshift('');\n if (relPath.length < 2) relPath.unshift('');\n result.pathname = relPath.join('/');\n } else {\n result.pathname = relative.pathname;\n }\n result.search = relative.search;\n result.query = relative.query;\n result.host = relative.host || '';\n result.auth = relative.auth;\n result.hostname = relative.hostname || relative.host;\n result.port = relative.port;\n // to support http.request\n if (result.pathname || result.search) {\n var p = result.pathname || '';\n var s = result.search || '';\n result.path = p + s;\n }\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n }\n\n var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n isRelAbs = (\n relative.host ||\n relative.pathname && relative.pathname.charAt(0) === '/'\n ),\n mustEndAbs = (isRelAbs || isSourceAbs ||\n (result.host && relative.pathname)),\n removeAllDots = mustEndAbs,\n srcPath = result.pathname && result.pathname.split('/') || [],\n psychotic = result.protocol && !slashedProtocol[result.protocol];\n relPath = relative.pathname && relative.pathname.split('/') || [];\n // if the url is a non-slashed url, then relative\n // links like ../.. should be able\n // to crawl up to the hostname, as well. This is strange.\n // result.protocol has already been set by now.\n // Later on, put the first path part into the host field.\n if (psychotic) {\n result.hostname = '';\n result.port = null;\n if (result.host) {\n if (srcPath[0] === '') srcPath[0] = result.host;\n else srcPath.unshift(result.host);\n }\n result.host = '';\n if (relative.protocol) {\n relative.hostname = null;\n relative.port = null;\n if (relative.host) {\n if (relPath[0] === '') relPath[0] = relative.host;\n else relPath.unshift(relative.host);\n }\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n }\n var authInHost;\n if (isRelAbs) {\n // it's absolute.\n result.host = (relative.host || relative.host === '') ?\n relative.host : result.host;\n result.hostname = (relative.hostname || relative.hostname === '') ?\n relative.hostname : result.hostname;\n result.search = relative.search;\n result.query = relative.query;\n srcPath = relPath;\n // fall through to the dot-handling below.\n } else if (relPath.length) {\n // it's relative\n // throw away the existing file, and take the new path instead.\n if (!srcPath) srcPath = [];\n srcPath.pop();\n srcPath = srcPath.concat(relPath);\n result.search = relative.search;\n result.query = relative.query;\n } else if (!isNullOrUndefined(relative.search)) {\n // just pull out the search.\n // like href='?foo'.\n // Put this after the other two cases because it simplifies the booleans\n if (psychotic) {\n result.hostname = result.host = srcPath.shift();\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n result.search = relative.search;\n result.query = relative.query;\n //to support http.request\n if (!isNull(result.pathname) || !isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.href = result.format();\n return result;\n }\n\n if (!srcPath.length) {\n // no path at all. easy.\n // we've already handled the other stuff above.\n result.pathname = null;\n //to support http.request\n if (result.search) {\n result.path = '/' + result.search;\n } else {\n result.path = null;\n }\n result.href = result.format();\n return result;\n }\n\n // if a url ENDs in . or .., then it must get a trailing slash.\n // however, if it ends in anything else non-slashy,\n // then it must NOT get a trailing slash.\n var last = srcPath.slice(-1)[0];\n var hasTrailingSlash = (\n (result.host || relative.host || srcPath.length > 1) &&\n (last === '.' || last === '..') || last === '');\n\n // strip single dots, resolve double dots to parent dir\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = srcPath.length; i >= 0; i--) {\n last = srcPath[i];\n if (last === '.') {\n srcPath.splice(i, 1);\n } else if (last === '..') {\n srcPath.splice(i, 1);\n up++;\n } else if (up) {\n srcPath.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (!mustEndAbs && !removeAllDots) {\n for (; up--; up) {\n srcPath.unshift('..');\n }\n }\n\n if (mustEndAbs && srcPath[0] !== '' &&\n (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n srcPath.unshift('');\n }\n\n if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n srcPath.push('');\n }\n\n var isAbsolute = srcPath[0] === '' ||\n (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n // put the host back\n if (psychotic) {\n result.hostname = result.host = isAbsolute ? '' :\n srcPath.length ? srcPath.shift() : '';\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n\n mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n if (mustEndAbs && !isAbsolute) {\n srcPath.unshift('');\n }\n\n if (!srcPath.length) {\n result.pathname = null;\n result.path = null;\n } else {\n result.pathname = srcPath.join('/');\n }\n\n //to support request.http\n if (!isNull(result.pathname) || !isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.auth = relative.auth || result.auth;\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n};\n\nUrl.prototype.parseHost = function() {\n return parseHost(this);\n};\n\nfunction parseHost(self) {\n var host = self.host;\n var port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== ':') {\n self.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) self.hostname = host;\n}\n","// TODO: These constants should be removed in favor of reading them out of a\n// Syscall account\n\n/**\n * @internal\n */\nexport const NUM_TICKS_PER_SECOND = 160;\n\n/**\n * @internal\n */\nexport const DEFAULT_TICKS_PER_SLOT = 64;\n\n/**\n * @internal\n */\nexport const NUM_SLOTS_PER_SECOND =\n NUM_TICKS_PER_SECOND / DEFAULT_TICKS_PER_SLOT;\n\n/**\n * @internal\n */\nexport const MS_PER_SLOT = 1000 / NUM_SLOTS_PER_SECOND;\n","export function promiseTimeout<T>(\n promise: Promise<T>,\n timeoutMs: number,\n): Promise<T | null> {\n let timeoutId: ReturnType<typeof setTimeout>;\n const timeoutPromise: Promise<null> = new Promise(resolve => {\n timeoutId = setTimeout(() => resolve(null), timeoutMs);\n });\n\n return Promise.race([promise, timeoutPromise]).then((result: T | null) => {\n clearTimeout(timeoutId);\n return result;\n });\n}\n","import assert from 'assert';\nimport bs58 from 'bs58';\nimport {Buffer} from 'buffer';\nimport {parse as urlParse, format as urlFormat} from 'url';\nimport fetch, {Response} from 'node-fetch';\nimport {\n type as pick,\n number,\n string,\n array,\n boolean,\n literal,\n record,\n union,\n optional,\n nullable,\n coerce,\n instance,\n create,\n tuple,\n unknown,\n any,\n} from 'superstruct';\nimport type {Struct} from 'superstruct';\nimport {Client as RpcWebSocketClient} from 'rpc-websockets';\nimport RpcClient from 'jayson/lib/client/browser';\nimport {IWSRequestParams} from 'rpc-websockets/dist/lib/client';\n\nimport {AgentManager} from './agent-manager';\nimport {NonceAccount} from './nonce-account';\nimport {PublicKey} from './publickey';\nimport {MS_PER_SLOT} from './timing';\nimport {Transaction} from './transaction';\nimport {Message} from './message';\nimport {sleep} from './util/sleep';\nimport {promiseTimeout} from './util/promise-timeout';\nimport {toBuffer} from './util/to-buffer';\nimport type {Blockhash} from './blockhash';\nimport type {FeeCalculator} from './fee-calculator';\nimport type {Account} from './account';\nimport type {TransactionSignature} from './transaction';\nimport type {CompiledInstruction} from './message';\n\nconst PublicKeyFromString = coerce(\n instance(PublicKey),\n string(),\n value => new PublicKey(value),\n);\n\nconst RawAccountDataResult = tuple([string(), literal('base64')]);\n\nconst BufferFromRawAccountData = coerce(\n instance(Buffer),\n RawAccountDataResult,\n value => Buffer.from(value[0], 'base64'),\n);\n\n/**\n * Attempt to use a recent blockhash for up to 30 seconds\n * @internal\n */\nexport const BLOCKHASH_CACHE_TIMEOUT_MS = 30 * 1000;\n\ntype RpcRequest = (methodName: string, args: Array<any>) => any;\n\ntype RpcBatchRequest = (requests: RpcParams[]) => any;\n\n/**\n * @internal\n */\nexport type RpcParams = {\n methodName: string;\n args: Array<any>;\n};\n\nexport type TokenAccountsFilter =\n | {\n mint: PublicKey;\n }\n | {\n programId: PublicKey;\n };\n\n/**\n * Extra contextual information for RPC responses\n */\nexport type Context = {\n slot: number;\n};\n\n/**\n * Options for sending transactions\n */\nexport type SendOptions = {\n /** disable transaction verification step */\n skipPreflight?: boolean;\n /** preflight commitment level */\n preflightCommitment?: Commitment;\n};\n\n/**\n * Options for confirming transactions\n */\nexport type ConfirmOptions = {\n /** disable transaction verification step */\n skipPreflight?: boolean;\n /** desired commitment level */\n commitment?: Commitment;\n /** preflight commitment level */\n preflightCommitment?: Commitment;\n};\n\n/**\n * Options for getConfirmedSignaturesForAddress2\n *\n * @typedef {Object} ConfirmedSignaturesForAddress2Options\n */\nexport type ConfirmedSignaturesForAddress2Options = {\n /**\n * Start searching backwards from this transaction signature.\n * @remark If not provided the search starts from the highest max confirmed block.\n */\n before?: TransactionSignature;\n /** Maximum transaction signatures to return (between 1 and 1,000, default: 1,000). */\n limit?: number;\n};\n\n/**\n * RPC Response with extra contextual information\n */\nexport type RpcResponseAndContext<T> = {\n /** response context */\n context: Context;\n /** response value */\n value: T;\n};\n\n/**\n * @internal\n */\nfunction createRpcResult<T, U>(result: Struct<T, U>) {\n return union([\n pick({\n jsonrpc: literal('2.0'),\n id: string(),\n result,\n }),\n pick({\n jsonrpc: literal('2.0'),\n id: string(),\n error: pick({\n code: unknown(),\n message: string(),\n data: optional(any()),\n }),\n }),\n ]);\n}\n\nconst UnknownRpcResult = createRpcResult(unknown());\n\n/**\n * @internal\n */\nfunction jsonRpcResult<T, U>(schema: Struct<T, U>) {\n return coerce(createRpcResult(schema), UnknownRpcResult, value => {\n if ('error' in value) {\n return value;\n } else {\n return {\n ...value,\n result: create(value.result, schema),\n };\n }\n });\n}\n\n/**\n * @internal\n */\nfunction jsonRpcResultAndContext<T, U>(value: Struct<T, U>) {\n return jsonRpcResult(\n pick({\n context: pick({\n slot: number(),\n }),\n value,\n }),\n );\n}\n\n/**\n * @internal\n */\nfunction notificationResultAndContext<T, U>(value: Struct<T, U>) {\n return pick({\n context: pick({\n slot: number(),\n }),\n value,\n });\n}\n\n/**\n * The level of commitment desired when querying state\n * <pre>\n * 'processed': Query the most recent block which has reached 1 confirmation by the connected node\n * 'confirmed': Query the most recent block which has reached 1 confirmation by the cluster\n * 'finalized': Query the most recent block which has been finalized by the cluster\n * </pre>\n *\n * @typedef {'processed' | 'confirmed' | 'finalized'} Commitment\n */\nexport type Commitment =\n | 'processed'\n | 'confirmed'\n | 'finalized'\n | 'recent' // Deprecated as of v1.5.5\n | 'single' // Deprecated as of v1.5.5\n | 'singleGossip' // Deprecated as of v1.5.5\n | 'root' // Deprecated as of v1.5.5\n | 'max'; // Deprecated as of v1.5.5\n\n/**\n * Filter for largest accounts query\n * <pre>\n * 'circulating': Return the largest accounts that are part of the circulating supply\n * 'nonCirculating': Return the largest accounts that are not part of the circulating supply\n * </pre>\n *\n * @typedef {'circulating' | 'nonCirculating'} LargestAccountsFilter\n */\nexport type LargestAccountsFilter = 'circulating' | 'nonCirculating';\n\n/**\n * Configuration object for changing `getLargestAccounts` query behavior\n *\n * @typedef {Object} GetLargestAccountsConfig\n * @property {Commitment|undefined} commitment The level of commitment desired\n * @property {LargestAccountsFilter|undefined} filter Filter largest accounts by whether they are part of the circulating supply\n */\nexport type GetLargestAccountsConfig = {\n commitment?: Commitment;\n filter?: LargestAccountsFilter;\n};\n\n/**\n * Configuration object for changing query behavior\n *\n * @typedef {Object} SignatureStatusConfig\n * @property {boolean} searchTransactionHistory enable searching status history, not needed for recent transactions\n */\nexport type SignatureStatusConfig = {\n searchTransactionHistory: boolean;\n};\n\n/**\n * Information describing a cluster node\n *\n * @typedef {Object} ContactInfo\n * @property {string} pubkey Identity public key of the node\n * @property {string|null} gossip Gossip network address for the node\n * @property {string|null} tpu TPU network address for the node (null if not available)\n * @property {string|null} rpc JSON RPC network address for the node (null if not available)\n * @property {string|null} version Software version of the node (null if not available)\n */\nexport type ContactInfo = {\n pubkey: string;\n gossip: string | null;\n tpu: string | null;\n rpc: string | null;\n version: string | null;\n};\n\n/**\n * Information describing a vote account\n *\n * @typedef {Object} VoteAccountInfo\n * @property {string} votePubkey Public key of the vote account\n * @property {string} nodePubkey Identity public key of the node voting with this account\n * @property {number} activatedStake The stake, in lamports, delegated to this vote account and activated\n * @property {boolean} epochVoteAccount Whether the vote account is staked for this epoch\n * @property {Array<Array<number>>} epochCredits Recent epoch voting credit history for this voter\n * @property {number} commission A percentage (0-100) of rewards payout owed to the voter\n * @property {number} lastVote Most recent slot voted on by this vote account\n */\nexport type VoteAccountInfo = {\n votePubkey: string;\n nodePubkey: string;\n activatedStake: number;\n epochVoteAccount: boolean;\n epochCredits: Array<[number, number, number]>;\n commission: number;\n lastVote: number;\n};\n\n/**\n * A collection of cluster vote accounts\n *\n * @typedef {Object} VoteAccountStatus\n * @property {Array<VoteAccountInfo>} current Active vote accounts\n * @property {Array<VoteAccountInfo>} delinquent Inactive vote accounts\n */\nexport type VoteAccountStatus = {\n current: Array<VoteAccountInfo>;\n delinquent: Array<VoteAccountInfo>;\n};\n\n/**\n * Network Inflation\n * (see https://docs.solana.com/implemented-proposals/ed_overview)\n *\n * @typedef {Object} InflationGovernor\n * @property {number} foundation\n * @property {number} foundation_term\n * @property {number} initial\n * @property {number} taper\n * @property {number} terminal\n */\nexport type InflationGovernor = {\n foundation: number;\n foundationTerm: number;\n initial: number;\n taper: number;\n terminal: number;\n};\n\nconst GetInflationGovernorResult = pick({\n foundation: number(),\n foundationTerm: number(),\n initial: number(),\n taper: number(),\n terminal: number(),\n});\n\n/**\n * Information about the current epoch\n *\n * @typedef {Object} EpochInfo\n * @property {number} epoch\n * @property {number} slotIndex\n * @property {number} slotsInEpoch\n * @property {number} absoluteSlot\n * @property {number} blockHeight\n * @property {number} transactionCount\n */\nexport type EpochInfo = {\n epoch: number;\n slotIndex: number;\n slotsInEpoch: number;\n absoluteSlot: number;\n blockHeight?: number;\n transactionCount?: number;\n};\n\nconst GetEpochInfoResult = pick({\n epoch: number(),\n slotIndex: number(),\n slotsInEpoch: number(),\n absoluteSlot: number(),\n blockHeight: optional(number()),\n transactionCount: optional(number()),\n});\n\n/**\n * Epoch schedule\n * (see https://docs.solana.com/terminology#epoch)\n *\n * @typedef {Object} EpochSchedule\n * @property {number} slotsPerEpoch The maximum number of slots in each epoch\n * @property {number} leaderScheduleSlotOffset The number of slots before beginning of an epoch to calculate a leader schedule for that epoch\n * @property {boolean} warmup Indicates whether epochs start short and grow\n * @property {number} firstNormalEpoch The first epoch with `slotsPerEpoch` slots\n * @property {number} firstNormalSlot The first slot of `firstNormalEpoch`\n */\nexport type EpochSchedule = {\n slotsPerEpoch: number;\n leaderScheduleSlotOffset: number;\n warmup: boolean;\n firstNormalEpoch: number;\n firstNormalSlot: number;\n};\n\nconst GetEpochScheduleResult = pick({\n slotsPerEpoch: number(),\n leaderScheduleSlotOffset: number(),\n warmup: boolean(),\n firstNormalEpoch: number(),\n firstNormalSlot: number(),\n});\n\n/**\n * Leader schedule\n * (see https://docs.solana.com/terminology#leader-schedule)\n *\n * @typedef {Object} LeaderSchedule\n */\nexport type LeaderSchedule = {\n [address: string]: number[];\n};\n\nconst GetLeaderScheduleResult = record(string(), array(number()));\n\n/**\n * Transaction error or null\n */\nconst TransactionErrorResult = nullable(pick({}));\n\n/**\n * Signature status for a transaction\n */\nconst SignatureStatusResult = pick({\n err: TransactionErrorResult,\n});\n\n/**\n * Transaction signature received notification\n */\nconst SignatureReceivedResult = literal('receivedSignature');\n\nexport type Version = {\n 'solana-core': string;\n 'feature-set'?: number;\n};\n\n/**\n * Version info for a node\n *\n * @typedef {Object} Version\n * @property {string} solana-core Version of solana-core\n */\nconst VersionResult = pick({\n 'solana-core': string(),\n 'feature-set': optional(number()),\n});\n\nexport type SimulatedTransactionResponse = {\n err: TransactionError | string | null;\n logs: Array<string> | null;\n};\n\nconst SimulatedTransactionResponseStruct = jsonRpcResultAndContext(\n pick({\n err: nullable(union([pick({}), string()])),\n logs: nullable(array(string())),\n }),\n);\n\nexport type ParsedInnerInstruction = {\n index: number;\n instructions: (ParsedInstruction | PartiallyDecodedInstruction)[];\n};\n\nexport type TokenBalance = {\n accountIndex: number;\n mint: string;\n uiTokenAmount: TokenAmount;\n};\n\n/**\n * Metadata for a parsed confirmed transaction on the ledger\n *\n * @typedef {Object} ParsedConfirmedTransactionMeta\n * @property {number} fee The fee charged for processing the transaction\n * @property {Array<ParsedInnerInstruction>} innerInstructions An array of cross program invoked parsed instructions\n * @property {Array<number>} preBalances The balances of the transaction accounts before processing\n * @property {Array<number>} postBalances The balances of the transaction accounts after processing\n * @property {Array<string>} logMessages An array of program log messages emitted during a transaction\n * @property {Array<TokenBalance>} preTokenBalances The token balances of the transaction accounts before processing\n * @property {Array<TokenBalance>} postTokenBalances The token balances of the transaction accounts after processing\n * @property {object|null} err The error result of transaction processing\n */\nexport type ParsedConfirmedTransactionMeta = {\n fee: number;\n innerInstructions?: ParsedInnerInstruction[] | null;\n preBalances: Array<number>;\n postBalances: Array<number>;\n logMessages?: Array<string> | null;\n preTokenBalances?: Array<TokenBalance> | null;\n postTokenBalances?: Array<TokenBalance> | null;\n err: TransactionError | null;\n};\n\nexport type CompiledInnerInstruction = {\n index: number;\n instructions: CompiledInstruction[];\n};\n\n/**\n * Metadata for a confirmed transaction on the ledger\n *\n * @typedef {Object} ConfirmedTransactionMeta\n * @property {number} fee The fee charged for processing the transaction\n * @property {Array<CompiledInnerInstruction>} innerInstructions An array of cross program invoked instructions\n * @property {Array<number>} preBalances The balances of the transaction accounts before processing\n * @property {Array<number>} postBalances The balances of the transaction accounts after processing\n * @property {Array<string>} logMessages An array of program log messages emitted during a transaction\n * @property {Array<TokenBalance>} preTokenBalances The token balances of the transaction accounts before processing\n * @property {Array<TokenBalance>} postTokenBalances The token balances of the transaction accounts after processing\n * @property {object|null} err The error result of transaction processing\n */\nexport type ConfirmedTransactionMeta = {\n fee: number;\n innerInstructions?: CompiledInnerInstruction[] | null;\n preBalances: Array<number>;\n postBalances: Array<number>;\n logMessages?: Array<string> | null;\n preTokenBalances?: Array<TokenBalance> | null;\n postTokenBalances?: Array<TokenBalance> | null;\n err: TransactionError | null;\n};\n\n/**\n * A confirmed transaction on the ledger\n *\n * @typedef {Object} ConfirmedTransaction\n * @property {number} slot The slot during which the transaction was processed\n * @property {Transaction} transaction The details of the transaction\n * @property {ConfirmedTransactionMeta|null} meta Metadata produced from the transaction\n * @property {number|null|undefined} blockTime The unix timestamp of when the transaction was processed\n */\nexport type ConfirmedTransaction = {\n slot: number;\n transaction: Transaction;\n meta: ConfirmedTransactionMeta | null;\n blockTime?: number | null;\n};\n\n/**\n * A partially decoded transaction instruction\n */\nexport type PartiallyDecodedInstruction = {\n /** Program id called by this instruction */\n programId: PublicKey;\n /** Public keys of accounts passed to this instruction */\n accounts: Array<PublicKey>;\n /** Raw base-58 instruction data */\n data: string;\n};\n\n/**\n * A parsed transaction message account\n *\n * @typedef {Object} ParsedMessageAccount\n * @property {PublicKey} pubkey Public key of the account\n * @property {boolean} signer Indicates if the account signed the transaction\n * @property {boolean} writable Indicates if the account is writable for this transaction\n */\nexport type ParsedMessageAccount = {\n pubkey: PublicKey;\n signer: boolean;\n writable: boolean;\n};\n\n/**\n * A parsed transaction instruction\n *\n * @typedef {Object} ParsedInstruction\n * @property {string} program Name of the program for this instruction\n * @property {PublicKey} programId ID of the program for this instruction\n * @property {any} parsed Parsed instruction info\n */\nexport type ParsedInstruction = {\n program: string;\n programId: PublicKey;\n parsed: any;\n};\n\n/**\n * A parsed transaction message\n *\n * @typedef {Object} ParsedMessage\n * @property {Array<ParsedMessageAccount>} accountKeys Accounts used in the instructions\n * @property {Array<ParsedInstruction | PartiallyDecodedInstruction>} instructions The atomically executed instructions for the transaction\n * @property {string} recentBlockhash Recent blockhash\n */\nexport type ParsedMessage = {\n accountKeys: ParsedMessageAccount[];\n instructions: (ParsedInstruction | PartiallyDecodedInstruction)[];\n recentBlockhash: string;\n};\n\n/**\n * A parsed transaction\n *\n * @typedef {Object} ParsedTransaction\n * @property {Array<string>} signatures Signatures for the transaction\n * @property {ParsedMessage} message Message of the transaction\n */\nexport type ParsedTransaction = {\n signatures: Array<string>;\n message: ParsedMessage;\n};\n\n/**\n * A parsed and confirmed transaction on the ledger\n *\n * @typedef {Object} ParsedConfirmedTransaction\n * @property {number} slot The slot during which the transaction was processed\n * @property {ParsedTransaction} transaction The details of the transaction\n * @property {ConfirmedTransactionMeta|null} meta Metadata produced from the transaction\n * @property {number|null|undefined} blockTime The unix timestamp of when the transaction was processed\n */\nexport type ParsedConfirmedTransaction = {\n slot: number;\n transaction: ParsedTransaction;\n meta: ParsedConfirmedTransactionMeta | null;\n blockTime?: number | null;\n};\n\n/**\n * A ConfirmedBlock on the ledger\n *\n * @typedef {Object} ConfirmedBlock\n * @property {Blockhash} blockhash Blockhash of this block\n * @property {Blockhash} previousBlockhash Blockhash of this block's parent\n * @property {number} parentSlot Slot index of this block's parent\n * @property {Array<object>} transactions Vector of transactions and status metas\n * @property {Array<object>} rewards Vector of block rewards\n * @property {number|null} blockTime The unix timestamp of when the block was processed\n */\nexport type ConfirmedBlock = {\n blockhash: Blockhash;\n previousBlockhash: Blockhash;\n parentSlot: number;\n transactions: Array<{\n transaction: Transaction;\n meta: ConfirmedTransactionMeta | null;\n }>;\n rewards?: Array<{\n pubkey: string;\n lamports: number;\n postBalance: number | null;\n rewardType: string | null;\n }>;\n blockTime: number | null;\n};\n\n/**\n * A performance sample\n *\n * @typedef {Object} PerfSample\n * @property {number} slot Slot number of sample\n * @property {number} numTransactions Number of transactions in a sample window\n * @property {number} numSlots Number of slots in a sample window\n * @property {number} samplePeriodSecs Sample window in seconds\n */\nexport type PerfSample = {\n slot: number;\n numTransactions: number;\n numSlots: number;\n samplePeriodSecs: number;\n};\n\nfunction createRpcClient(url: string, useHttps: boolean): RpcClient {\n let agentManager: AgentManager | undefined;\n if (!process.env.BROWSER) {\n agentManager = new AgentManager(useHttps);\n }\n\n const clientBrowser = new RpcClient(async (request, callback) => {\n const agent = agentManager ? agentManager.requestStart() : undefined;\n const options = {\n method: 'POST',\n body: request,\n agent,\n headers: {\n 'Content-Type': 'application/json',\n },\n };\n\n try {\n let too_many_requests_retries = 5;\n let res: Response;\n let waitTime = 500;\n for (;;) {\n res = await fetch(url, options);\n if (res.status !== 429 /* Too many requests */) {\n break;\n }\n too_many_requests_retries -= 1;\n if (too_many_requests_retries === 0) {\n break;\n }\n console.log(\n `Server responded with ${res.status} ${res.statusText}. Retrying after ${waitTime}ms delay...`,\n );\n await sleep(waitTime);\n waitTime *= 2;\n }\n\n const text = await res.text();\n if (res.ok) {\n callback(null, text);\n } else {\n callback(new Error(`${res.status} ${res.statusText}: ${text}`));\n }\n } catch (err) {\n callback(err);\n } finally {\n agentManager && agentManager.requestEnd();\n }\n }, {});\n\n return clientBrowser;\n}\n\nfunction createRpcRequest(client: RpcClient): RpcRequest {\n return (method, args) => {\n return new Promise((resolve, reject) => {\n client.request(method, args, (err: any, response: any) => {\n if (err) {\n reject(err);\n return;\n }\n resolve(response);\n });\n });\n };\n}\n\nfunction createRpcBatchRequest(client: RpcClient): RpcBatchRequest {\n return (requests: RpcParams[]) => {\n return new Promise((resolve, reject) => {\n const batch = requests.map((params: RpcParams) => {\n return client.request(params.methodName, params.args);\n });\n\n client.request(batch, (err: any, response: any) => {\n if (err) {\n reject(err);\n return;\n }\n resolve(response);\n });\n });\n };\n}\n\n/**\n * Expected JSON RPC response for the \"getInflationGovernor\" message\n */\nconst GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);\n\n/**\n * Expected JSON RPC response for the \"getEpochInfo\" message\n */\nconst GetEpochInfoRpcResult = jsonRpcResult(GetEpochInfoResult);\n\n/**\n * Expected JSON RPC response for the \"getEpochSchedule\" message\n */\nconst GetEpochScheduleRpcResult = jsonRpcResult(GetEpochScheduleResult);\n\n/**\n * Expected JSON RPC response for the \"getLeaderSchedule\" message\n */\nconst GetLeaderScheduleRpcResult = jsonRpcResult(GetLeaderScheduleResult);\n\n/**\n * Expected JSON RPC response for the \"minimumLedgerSlot\" and \"getFirstAvailableBlock\" messages\n */\nconst SlotRpcResult = jsonRpcResult(number());\n\n/**\n * Supply\n *\n * @typedef {Object} Supply\n * @property {number} total Total supply in lamports\n * @property {number} circulating Circulating supply in lamports\n * @property {number} nonCirculating Non-circulating supply in lamports\n * @property {Array<PublicKey>} nonCirculatingAccounts List of non-circulating account addresses\n */\nexport type Supply = {\n total: number;\n circulating: number;\n nonCirculating: number;\n nonCirculatingAccounts: Array<PublicKey>;\n};\n\n/**\n * Expected JSON RPC response for the \"getSupply\" message\n */\nconst GetSupplyRpcResult = jsonRpcResultAndContext(\n pick({\n total: number(),\n circulating: number(),\n nonCirculating: number(),\n nonCirculatingAccounts: array(PublicKeyFromString),\n }),\n);\n\n/**\n * Token amount object which returns a token amount in different formats\n * for various client use cases.\n *\n * @typedef {Object} TokenAmount\n * @property {string} amount Raw amount of tokens as string ignoring decimals\n * @property {number} decimals Number of decimals configured for token's mint\n * @property {number | null} uiAmount Token amount as float, accounts for decimals\n * @property {string | undefined} uiAmountString Token amount as string, accounts for decimals\n */\nexport type TokenAmount = {\n amount: string;\n decimals: number;\n uiAmount: number | null;\n uiAmountString?: string;\n};\n\n/**\n * Expected JSON RPC structure for token amounts\n */\nconst TokenAmountResult = pick({\n amount: string(),\n uiAmount: nullable(number()),\n decimals: number(),\n uiAmountString: optional(string()),\n});\n\n/**\n * Token address and balance.\n *\n * @typedef {Object} TokenAccountBalancePair\n * @property {PublicKey} address Address of the token account\n * @property {string} amount Raw amount of tokens as string ignoring decimals\n * @property {number} decimals Number of decimals configured for token's mint\n * @property {number | null} uiAmount Token amount as float, accounts for decimals\n * @property {string | undefined} uiAmountString Token amount as string, accounts for decimals\n */\nexport type TokenAccountBalancePair = {\n address: PublicKey;\n amount: string;\n decimals: number;\n uiAmount: number | null;\n uiAmountString?: string;\n};\n\n/**\n * Expected JSON RPC response for the \"getTokenLargestAccounts\" message\n */\nconst GetTokenLargestAccountsResult = jsonRpcResultAndContext(\n array(\n pick({\n address: PublicKeyFromString,\n amount: string(),\n uiAmount: nullable(number()),\n decimals: number(),\n uiAmountString: optional(string()),\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"getTokenAccountsByOwner\" message\n */\nconst GetTokenAccountsByOwner = jsonRpcResultAndContext(\n array(\n pick({\n pubkey: PublicKeyFromString,\n account: pick({\n executable: boolean(),\n owner: PublicKeyFromString,\n lamports: number(),\n data: BufferFromRawAccountData,\n rentEpoch: number(),\n }),\n }),\n ),\n);\n\nconst ParsedAccountDataResult = pick({\n program: string(),\n parsed: unknown(),\n space: number(),\n});\n\n/**\n * Expected JSON RPC response for the \"getTokenAccountsByOwner\" message with parsed data\n */\nconst GetParsedTokenAccountsByOwner = jsonRpcResultAndContext(\n array(\n pick({\n pubkey: PublicKeyFromString,\n account: pick({\n executable: boolean(),\n owner: PublicKeyFromString,\n lamports: number(),\n data: ParsedAccountDataResult,\n rentEpoch: number(),\n }),\n }),\n ),\n);\n\n/**\n * Pair of an account address and its balance\n *\n * @typedef {Object} AccountBalancePair\n * @property {PublicKey} address\n * @property {number} lamports\n */\nexport type AccountBalancePair = {\n address: PublicKey;\n lamports: number;\n};\n\n/**\n * Expected JSON RPC response for the \"getLargestAccounts\" message\n */\nconst GetLargestAccountsRpcResult = jsonRpcResultAndContext(\n array(\n pick({\n lamports: number(),\n address: PublicKeyFromString,\n }),\n ),\n);\n\n/**\n * @internal\n */\nconst AccountInfoResult = pick({\n executable: boolean(),\n owner: PublicKeyFromString,\n lamports: number(),\n data: BufferFromRawAccountData,\n rentEpoch: number(),\n});\n\n/**\n * @internal\n */\nconst KeyedAccountInfoResult = pick({\n pubkey: PublicKeyFromString,\n account: AccountInfoResult,\n});\n\nconst ParsedOrRawAccountData = coerce(\n union([instance(Buffer), ParsedAccountDataResult]),\n union([RawAccountDataResult, ParsedAccountDataResult]),\n value => {\n if (Array.isArray(value)) {\n return create(value, BufferFromRawAccountData);\n } else {\n return value;\n }\n },\n);\n\n/**\n * @internal\n */\nconst ParsedAccountInfoResult = pick({\n executable: boolean(),\n owner: PublicKeyFromString,\n lamports: number(),\n data: ParsedOrRawAccountData,\n rentEpoch: number(),\n});\n\nconst KeyedParsedAccountInfoResult = pick({\n pubkey: PublicKeyFromString,\n account: ParsedAccountInfoResult,\n});\n\n/**\n * @internal\n */\nconst StakeActivationResult = pick({\n state: union([\n literal('active'),\n literal('inactive'),\n literal('activating'),\n literal('deactivating'),\n ]),\n active: number(),\n inactive: number(),\n});\n\n/**\n * Expected JSON RPC response for the \"getConfirmedSignaturesForAddress\" message\n */\nconst GetConfirmedSignaturesForAddressRpcResult = jsonRpcResult(\n array(string()),\n);\n\n/**\n * Expected JSON RPC response for the \"getConfirmedSignaturesForAddress2\" message\n */\n\nconst GetConfirmedSignaturesForAddress2RpcResult = jsonRpcResult(\n array(\n pick({\n signature: string(),\n slot: number(),\n err: TransactionErrorResult,\n memo: nullable(string()),\n blockTime: optional(nullable(number())),\n }),\n ),\n);\n\n/***\n * Expected JSON RPC response for the \"accountNotification\" message\n */\nconst AccountNotificationResult = pick({\n subscription: number(),\n result: notificationResultAndContext(AccountInfoResult),\n});\n\n/**\n * @internal\n */\nconst ProgramAccountInfoResult = pick({\n pubkey: PublicKeyFromString,\n account: AccountInfoResult,\n});\n\n/***\n * Expected JSON RPC response for the \"programNotification\" message\n */\nconst ProgramAccountNotificationResult = pick({\n subscription: number(),\n result: notificationResultAndContext(ProgramAccountInfoResult),\n});\n\n/**\n * @internal\n */\nconst SlotInfoResult = pick({\n parent: number(),\n slot: number(),\n root: number(),\n});\n\n/**\n * Expected JSON RPC response for the \"slotNotification\" message\n */\nconst SlotNotificationResult = pick({\n subscription: number(),\n result: SlotInfoResult,\n});\n\n/**\n * Expected JSON RPC response for the \"signatureNotification\" message\n */\nconst SignatureNotificationResult = pick({\n subscription: number(),\n result: notificationResultAndContext(\n union([SignatureStatusResult, SignatureReceivedResult]),\n ),\n});\n\n/**\n * Expected JSON RPC response for the \"rootNotification\" message\n */\nconst RootNotificationResult = pick({\n subscription: number(),\n result: number(),\n});\n\nconst ContactInfoResult = pick({\n pubkey: string(),\n gossip: nullable(string()),\n tpu: nullable(string()),\n rpc: nullable(string()),\n version: nullable(string()),\n});\n\nconst VoteAccountInfoResult = pick({\n votePubkey: string(),\n nodePubkey: string(),\n activatedStake: number(),\n epochVoteAccount: boolean(),\n epochCredits: array(tuple([number(), number(), number()])),\n commission: number(),\n lastVote: number(),\n rootSlot: nullable(number()),\n});\n\n/**\n * Expected JSON RPC response for the \"getVoteAccounts\" message\n */\nconst GetVoteAccounts = jsonRpcResult(\n pick({\n current: array(VoteAccountInfoResult),\n delinquent: array(VoteAccountInfoResult),\n }),\n);\n\nconst ConfirmationStatus = union([\n literal('processed'),\n literal('confirmed'),\n literal('finalized'),\n]);\n\nconst SignatureStatusResponse = pick({\n slot: number(),\n confirmations: nullable(number()),\n err: TransactionErrorResult,\n confirmationStatus: optional(ConfirmationStatus),\n});\n\n/**\n * Expected JSON RPC response for the \"getSignatureStatuses\" message\n */\nconst GetSignatureStatusesRpcResult = jsonRpcResultAndContext(\n array(nullable(SignatureStatusResponse)),\n);\n\n/**\n * Expected JSON RPC response for the \"getMinimumBalanceForRentExemption\" message\n */\nconst GetMinimumBalanceForRentExemptionRpcResult = jsonRpcResult(number());\n\n/**\n * @internal\n */\nconst ConfirmedTransactionResult = pick({\n signatures: array(string()),\n message: pick({\n accountKeys: array(string()),\n header: pick({\n numRequiredSignatures: number(),\n numReadonlySignedAccounts: number(),\n numReadonlyUnsignedAccounts: number(),\n }),\n instructions: array(\n pick({\n accounts: array(number()),\n data: string(),\n programIdIndex: number(),\n }),\n ),\n recentBlockhash: string(),\n }),\n});\n\nconst TransactionFromConfirmed = coerce(\n instance(Transaction),\n ConfirmedTransactionResult,\n result => {\n const {message, signatures} = result;\n return Transaction.populate(new Message(message), signatures);\n },\n);\n\nconst ParsedInstructionResult = pick({\n parsed: unknown(),\n program: string(),\n programId: PublicKeyFromString,\n});\n\nconst RawInstructionResult = pick({\n accounts: array(PublicKeyFromString),\n data: string(),\n programId: PublicKeyFromString,\n});\n\nconst InstructionResult = union([\n RawInstructionResult,\n ParsedInstructionResult,\n]);\n\nconst UnknownInstructionResult = union([\n pick({\n parsed: unknown(),\n program: string(),\n programId: string(),\n }),\n pick({\n accounts: array(string()),\n data: string(),\n programId: string(),\n }),\n]);\n\nconst ParsedOrRawInstruction = coerce(\n InstructionResult,\n UnknownInstructionResult,\n value => {\n if ('accounts' in value) {\n return create(value, RawInstructionResult);\n } else {\n return create(value, ParsedInstructionResult);\n }\n },\n);\n\n/**\n * @internal\n */\nconst ParsedConfirmedTransactionResult = pick({\n signatures: array(string()),\n message: pick({\n accountKeys: array(\n pick({\n pubkey: PublicKeyFromString,\n signer: boolean(),\n writable: boolean(),\n }),\n ),\n instructions: array(ParsedOrRawInstruction),\n recentBlockhash: string(),\n }),\n});\n\nconst TokenBalanceResult = pick({\n accountIndex: number(),\n mint: string(),\n uiTokenAmount: TokenAmountResult,\n});\n\n/**\n * @internal\n */\nconst ConfirmedTransactionMetaResult = pick({\n err: TransactionErrorResult,\n fee: number(),\n innerInstructions: optional(\n nullable(\n array(\n pick({\n index: number(),\n instructions: array(\n pick({\n accounts: array(number()),\n data: string(),\n programIdIndex: number(),\n }),\n ),\n }),\n ),\n ),\n ),\n preBalances: array(number()),\n postBalances: array(number()),\n logMessages: optional(nullable(array(string()))),\n preTokenBalances: optional(nullable(array(TokenBalanceResult))),\n postTokenBalances: optional(nullable(array(TokenBalanceResult))),\n});\n\n/**\n * @internal\n */\nconst ParsedConfirmedTransactionMetaResult = pick({\n err: TransactionErrorResult,\n fee: number(),\n innerInstructions: optional(\n nullable(\n array(\n pick({\n index: number(),\n instructions: array(ParsedOrRawInstruction),\n }),\n ),\n ),\n ),\n preBalances: array(number()),\n postBalances: array(number()),\n logMessages: optional(nullable(array(string()))),\n preTokenBalances: optional(nullable(array(TokenBalanceResult))),\n postTokenBalances: optional(nullable(array(TokenBalanceResult))),\n});\n\n/**\n * Expected JSON RPC response for the \"getConfirmedBlock\" message\n */\nexport const GetConfirmedBlockRpcResult = jsonRpcResult(\n nullable(\n pick({\n blockhash: string(),\n previousBlockhash: string(),\n parentSlot: number(),\n transactions: array(\n pick({\n transaction: TransactionFromConfirmed,\n meta: nullable(ConfirmedTransactionMetaResult),\n }),\n ),\n rewards: optional(\n array(\n pick({\n pubkey: string(),\n lamports: number(),\n postBalance: nullable(number()),\n rewardType: nullable(string()),\n }),\n ),\n ),\n blockTime: nullable(number()),\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"getConfirmedTransaction\" message\n */\nconst GetConfirmedTransactionRpcResult = jsonRpcResult(\n nullable(\n pick({\n slot: number(),\n transaction: TransactionFromConfirmed,\n meta: ConfirmedTransactionMetaResult,\n blockTime: optional(nullable(number())),\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"getConfirmedTransaction\" message\n */\nconst GetParsedConfirmedTransactionRpcResult = jsonRpcResult(\n nullable(\n pick({\n slot: number(),\n transaction: ParsedConfirmedTransactionResult,\n meta: nullable(ParsedConfirmedTransactionMetaResult),\n blockTime: optional(nullable(number())),\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"getRecentBlockhash\" message\n */\nconst GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(\n pick({\n blockhash: string(),\n feeCalculator: pick({\n lamportsPerSignature: number(),\n }),\n }),\n);\n\nconst PerfSampleResult = pick({\n slot: number(),\n numTransactions: number(),\n numSlots: number(),\n samplePeriodSecs: number(),\n});\n\n/*\n * Expected JSON RPC response for \"getRecentPerformanceSamples\" message\n */\nconst GetRecentPerformanceSamplesRpcResult = jsonRpcResult(\n array(PerfSampleResult),\n);\n\n/**\n * Expected JSON RPC response for the \"getFeeCalculatorForBlockhash\" message\n */\nconst GetFeeCalculatorRpcResult = jsonRpcResultAndContext(\n nullable(\n pick({\n feeCalculator: pick({\n lamportsPerSignature: number(),\n }),\n }),\n ),\n);\n\n/**\n * Expected JSON RPC response for the \"requestAirdrop\" message\n */\nconst RequestAirdropRpcResult = jsonRpcResult(string());\n\n/**\n * Expected JSON RPC response for the \"sendTransaction\" message\n */\nconst SendTransactionRpcResult = jsonRpcResult(string());\n\n/**\n * Information about the latest slot being processed by a node\n *\n * @typedef {Object} SlotInfo\n * @property {number} slot Currently processing slot\n * @property {number} parent Parent of the current slot\n * @property {number} root The root block of the current slot's fork\n */\nexport type SlotInfo = {\n slot: number;\n parent: number;\n root: number;\n};\n\n/**\n * Parsed account data\n *\n * @typedef {Object} ParsedAccountData\n * @property {string} program Name of the program that owns this account\n * @property {any} parsed Parsed account data\n * @property {number} space Space used by account data\n */\nexport type ParsedAccountData = {\n program: string;\n parsed: any;\n space: number;\n};\n\n/**\n * Stake Activation data\n *\n * @typedef {Object} StakeActivationData\n * @property {string} state: <string - the stake account's activation state, one of: active, inactive, activating, deactivating\n * @property {number} active: stake active during the epoch\n * @property {number} inactive: stake inactive during the epoch\n */\nexport type StakeActivationData = {\n state: 'active' | 'inactive' | 'activating' | 'deactivating';\n active: number;\n inactive: number;\n};\n\n/**\n * Information describing an account\n *\n * @typedef {Object} AccountInfo\n * @property {number} lamports Number of lamports assigned to the account\n * @property {PublicKey} owner Identifier of the program that owns the account\n * @property {T} data Optional data assigned to the account\n * @property {boolean} executable `true` if this account's data contains a loaded program\n */\nexport type AccountInfo<T> = {\n executable: boolean;\n owner: PublicKey;\n lamports: number;\n data: T;\n};\n\n/**\n * Account information identified by pubkey\n *\n * @typedef {Object} KeyedAccountInfo\n * @property {PublicKey} accountId\n * @property {AccountInfo<Buffer>} accountInfo\n */\nexport type KeyedAccountInfo = {\n accountId: PublicKey;\n accountInfo: AccountInfo<Buffer>;\n};\n\n/**\n * Callback function for account change notifications\n */\nexport type AccountChangeCallback = (\n accountInfo: AccountInfo<Buffer>,\n context: Context,\n) => void;\n\n/**\n * @internal\n */\ntype SubscriptionId = 'subscribing' | number;\n\n/**\n * @internal\n */\ntype AccountSubscriptionInfo = {\n publicKey: string; // PublicKey of the account as a base 58 string\n callback: AccountChangeCallback;\n commitment?: Commitment;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n};\n\n/**\n * Callback function for program account change notifications\n */\nexport type ProgramAccountChangeCallback = (\n keyedAccountInfo: KeyedAccountInfo,\n context: Context,\n) => void;\n\n/**\n * @internal\n */\ntype ProgramAccountSubscriptionInfo = {\n programId: string; // PublicKey of the program as a base 58 string\n callback: ProgramAccountChangeCallback;\n commitment?: Commitment;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n};\n\n/**\n * Callback function for slot change notifications\n */\nexport type SlotChangeCallback = (slotInfo: SlotInfo) => void;\n\n/**\n * @internal\n */\ntype SlotSubscriptionInfo = {\n callback: SlotChangeCallback;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n};\n\n/**\n * Callback function for signature status notifications\n */\nexport type SignatureResultCallback = (\n signatureResult: SignatureResult,\n context: Context,\n) => void;\n\n/**\n * Signature status notification with transaction result\n */\nexport type SignatureStatusNotification = {\n type: 'status';\n result: SignatureResult;\n};\n\n/**\n * Signature received notification\n */\nexport type SignatureReceivedNotification = {\n type: 'received';\n};\n\n/**\n * Callback function for signature notifications\n */\nexport type SignatureSubscriptionCallback = (\n notification: SignatureStatusNotification | SignatureReceivedNotification,\n context: Context,\n) => void;\n\n/**\n * Signature subscription options\n */\nexport type SignatureSubscriptionOptions = {\n commitment?: Commitment;\n enableReceivedNotification?: boolean;\n};\n\n/**\n * @internal\n */\ntype SignatureSubscriptionInfo = {\n signature: TransactionSignature; // TransactionSignature as a base 58 string\n callback: SignatureSubscriptionCallback;\n options?: SignatureSubscriptionOptions;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n};\n\n/**\n * Callback function for root change notifications\n */\nexport type RootChangeCallback = (root: number) => void;\n\n/**\n * @internal\n */\ntype RootSubscriptionInfo = {\n callback: RootChangeCallback;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n};\n\n/**\n * @internal\n */\nconst LogsResult = pick({\n err: TransactionErrorResult,\n logs: array(string()),\n signature: string(),\n});\n\n/**\n * Logs result.\n *\n * @typedef {Object} Logs.\n */\nexport type Logs = {\n err: TransactionError | null;\n logs: string[];\n signature: string;\n};\n\n/**\n * Expected JSON RPC response for the \"logsNotification\" message.\n */\nconst LogsNotificationResult = pick({\n result: notificationResultAndContext(LogsResult),\n subscription: number(),\n});\n\n/**\n * Filter for log subscriptions.\n */\nexport type LogsFilter = PublicKey | 'all' | 'allWithVotes';\n\n/**\n * Callback function for log notifications.\n */\nexport type LogsCallback = (logs: Logs, ctx: Context) => void;\n\n/**\n * @private\n */\ntype LogsSubscriptionInfo = {\n callback: LogsCallback;\n filter: LogsFilter;\n subscriptionId: SubscriptionId | null; // null when there's no current server subscription id\n commitment?: Commitment;\n};\n\n/**\n * Signature result\n *\n * @typedef {Object} SignatureResult\n */\nexport type SignatureResult = {\n err: TransactionError | null;\n};\n\n/**\n * Transaction error\n *\n * @typedef {Object} TransactionError\n */\nexport type TransactionError = {};\n\n/**\n * Transaction confirmation status\n * <pre>\n * 'processed': Transaction landed in a block which has reached 1 confirmation by the connected node\n * 'confirmed': Transaction landed in a block which has reached 1 confirmation by the cluster\n * 'finalized': Transaction landed in a block which has been finalized by the cluster\n * </pre>\n */\nexport type TransactionConfirmationStatus =\n | 'processed'\n | 'confirmed'\n | 'finalized';\n\n/**\n * Signature status\n */\nexport type SignatureStatus = {\n /** when the transaction was processed */\n slot: number;\n /** the number of blocks that have been confirmed and voted on in the fork containing `slot` */\n confirmations: number | null;\n /** transaction error, if any */\n err: TransactionError | null;\n /** cluster confirmation status, if data available. Possible responses: `processed`, `confirmed`, `finalized` */\n confirmationStatus?: TransactionConfirmationStatus;\n};\n\n/**\n * A confirmed signature with its status\n *\n * @typedef {Object} ConfirmedSignatureInfo\n * @property {string} signature the transaction signature\n * @property {number} slot when the transaction was processed\n * @property {TransactionError | null} err error, if any\n * @property {string | null} memo memo associated with the transaction, if any\n * @property {number | null | undefined} blockTime The unix timestamp of when the transaction was processed\n */\nexport type ConfirmedSignatureInfo = {\n signature: string;\n slot: number;\n err: TransactionError | null;\n memo: string | null;\n blockTime?: number | null;\n};\n\n/**\n * A connection to a fullnode JSON RPC endpoint\n */\nexport class Connection {\n /** @internal */ _commitment?: Commitment;\n /** @internal */ _rpcEndpoint: string;\n /** @internal */ _rpcClient: RpcClient;\n /** @internal */ _rpcRequest: RpcRequest;\n /** @internal */ _rpcBatchRequest: RpcBatchRequest;\n /** @internal */ _rpcWebSocket: RpcWebSocketClient;\n /** @internal */ _rpcWebSocketConnected: boolean = false;\n /** @internal */ _rpcWebSocketHeartbeat: ReturnType<\n typeof setInterval\n > | null = null;\n /** @internal */ _rpcWebSocketIdleTimeout: ReturnType<\n typeof setTimeout\n > | null = null;\n\n /** @internal */ _disableBlockhashCaching: boolean = false;\n /** @internal */ _pollingBlockhash: boolean = false;\n /** @internal */ _blockhashInfo: {\n recentBlockhash: Blockhash | null;\n lastFetch: number;\n simulatedSignatures: Array<string>;\n transactionSignatures: Array<string>;\n };\n\n /** @internal */ _accountChangeSubscriptionCounter: number = 0;\n /** @internal */ _accountChangeSubscriptions: {\n [id: number]: AccountSubscriptionInfo;\n } = {};\n\n /** @internal */ _programAccountChangeSubscriptionCounter: number = 0;\n /** @internal */ _programAccountChangeSubscriptions: {\n [id: number]: ProgramAccountSubscriptionInfo;\n } = {};\n\n /** @internal */ _rootSubscriptionCounter: number = 0;\n /** @internal */ _rootSubscriptions: {\n [id: number]: RootSubscriptionInfo;\n } = {};\n\n /** @internal */ _signatureSubscriptionCounter: number = 0;\n /** @internal */ _signatureSubscriptions: {\n [id: number]: SignatureSubscriptionInfo;\n } = {};\n\n /** @internal */ _slotSubscriptionCounter: number = 0;\n /** @internal */ _slotSubscriptions: {\n [id: number]: SlotSubscriptionInfo;\n } = {};\n\n /** @internal */ _logsSubscriptionCounter: number = 0;\n /** @internal */ _logsSubscriptions: {\n [id: number]: LogsSubscriptionInfo;\n } = {};\n\n /**\n * Establish a JSON RPC connection\n *\n * @param endpoint URL to the fullnode JSON RPC endpoint\n * @param commitment optional default commitment level\n */\n constructor(endpoint: string, commitment?: Commitment) {\n this._rpcEndpoint = endpoint;\n\n let url = urlParse(endpoint);\n const useHttps = url.protocol === 'https:';\n\n this._rpcClient = createRpcClient(url.href, useHttps);\n this._rpcRequest = createRpcRequest(this._rpcClient);\n this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient);\n this._commitment = commitment;\n this._blockhashInfo = {\n recentBlockhash: null,\n lastFetch: 0,\n transactionSignatures: [],\n simulatedSignatures: [],\n };\n\n url.protocol = useHttps ? 'wss:' : 'ws:';\n url.host = '';\n // Only shift the port by +1 as a convention for ws(s) only if given endpoint\n // is explictly specifying the endpoint port (HTTP-based RPC), assuming\n // we're directly trying to connect to solana-validator's ws listening port.\n // When the endpoint omits the port, we're connecting to the protocol\n // default ports: http(80) or https(443) and it's assumed we're behind a reverse\n // proxy which manages WebSocket upgrade and backend port redirection.\n if (url.port !== null) {\n url.port = String(Number(url.port) + 1);\n }\n this._rpcWebSocket = new RpcWebSocketClient(urlFormat(url), {\n autoconnect: false,\n max_reconnects: Infinity,\n });\n this._rpcWebSocket.on('open', this._wsOnOpen.bind(this));\n this._rpcWebSocket.on('error', this._wsOnError.bind(this));\n this._rpcWebSocket.on('close', this._wsOnClose.bind(this));\n this._rpcWebSocket.on(\n 'accountNotification',\n this._wsOnAccountNotification.bind(this),\n );\n this._rpcWebSocket.on(\n 'programNotification',\n this._wsOnProgramAccountNotification.bind(this),\n );\n this._rpcWebSocket.on(\n 'slotNotification',\n this._wsOnSlotNotification.bind(this),\n );\n this._rpcWebSocket.on(\n 'signatureNotification',\n this._wsOnSignatureNotification.bind(this),\n );\n this._rpcWebSocket.on(\n 'rootNotification',\n this._wsOnRootNotification.bind(this),\n );\n this._rpcWebSocket.on(\n 'logsNotification',\n this._wsOnLogsNotification.bind(this),\n );\n }\n\n /**\n * The default commitment used for requests\n */\n get commitment(): Commitment | undefined {\n return this._commitment;\n }\n\n /**\n * Fetch the balance for the specified public key, return with context\n */\n async getBalanceAndContext(\n publicKey: PublicKey,\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<number>> {\n const args = this._buildArgs([publicKey.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getBalance', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(number()));\n if ('error' in res) {\n throw new Error(\n 'failed to get balance for ' +\n publicKey.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch the balance for the specified public key\n */\n async getBalance(\n publicKey: PublicKey,\n commitment?: Commitment,\n ): Promise<number> {\n return await this.getBalanceAndContext(publicKey, commitment)\n .then(x => x.value)\n .catch(e => {\n throw new Error(\n 'failed to get balance of account ' + publicKey.toBase58() + ': ' + e,\n );\n });\n }\n\n /**\n * Fetch the estimated production time of a block\n */\n async getBlockTime(slot: number): Promise<number | null> {\n const unsafeRes = await this._rpcRequest('getBlockTime', [slot]);\n const res = create(unsafeRes, jsonRpcResult(nullable(number())));\n if ('error' in res) {\n throw new Error(\n 'failed to get block time for slot ' + slot + ': ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch the lowest slot that the node has information about in its ledger.\n * This value may increase over time if the node is configured to purge older ledger data\n */\n async getMinimumLedgerSlot(): Promise<number> {\n const unsafeRes = await this._rpcRequest('minimumLedgerSlot', []);\n const res = create(unsafeRes, jsonRpcResult(number()));\n if ('error' in res) {\n throw new Error(\n 'failed to get minimum ledger slot: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch the slot of the lowest confirmed block that has not been purged from the ledger\n */\n async getFirstAvailableBlock(): Promise<number> {\n const unsafeRes = await this._rpcRequest('getFirstAvailableBlock', []);\n const res = create(unsafeRes, SlotRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get first available block: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch information about the current supply\n */\n async getSupply(\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<Supply>> {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getSupply', args);\n const res = create(unsafeRes, GetSupplyRpcResult);\n if ('error' in res) {\n throw new Error('failed to get supply: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current supply of a token mint\n */\n async getTokenSupply(\n tokenMintAddress: PublicKey,\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<TokenAmount>> {\n const args = this._buildArgs([tokenMintAddress.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getTokenSupply', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(TokenAmountResult));\n if ('error' in res) {\n throw new Error('failed to get token supply: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current balance of a token account\n */\n async getTokenAccountBalance(\n tokenAddress: PublicKey,\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<TokenAmount>> {\n const args = this._buildArgs([tokenAddress.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getTokenAccountBalance', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(TokenAmountResult));\n if ('error' in res) {\n throw new Error(\n 'failed to get token account balance: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch all the token accounts owned by the specified account\n *\n * @return {Promise<RpcResponseAndContext<Array<{pubkey: PublicKey, account: AccountInfo<Buffer>}>>>}\n */\n async getTokenAccountsByOwner(\n ownerAddress: PublicKey,\n filter: TokenAccountsFilter,\n commitment?: Commitment,\n ): Promise<\n RpcResponseAndContext<\n Array<{pubkey: PublicKey; account: AccountInfo<Buffer>}>\n >\n > {\n let _args: any[] = [ownerAddress.toBase58()];\n if ('mint' in filter) {\n _args.push({mint: filter.mint.toBase58()});\n } else {\n _args.push({programId: filter.programId.toBase58()});\n }\n\n const args = this._buildArgs(_args, commitment, 'base64');\n const unsafeRes = await this._rpcRequest('getTokenAccountsByOwner', args);\n const res = create(unsafeRes, GetTokenAccountsByOwner);\n if ('error' in res) {\n throw new Error(\n 'failed to get token accounts owned by account ' +\n ownerAddress.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch parsed token accounts owned by the specified account\n *\n * @return {Promise<RpcResponseAndContext<Array<{pubkey: PublicKey, account: AccountInfo<ParsedAccountData>}>>>}\n */\n async getParsedTokenAccountsByOwner(\n ownerAddress: PublicKey,\n filter: TokenAccountsFilter,\n commitment?: Commitment,\n ): Promise<\n RpcResponseAndContext<\n Array<{pubkey: PublicKey; account: AccountInfo<ParsedAccountData>}>\n >\n > {\n let _args: any[] = [ownerAddress.toBase58()];\n if ('mint' in filter) {\n _args.push({mint: filter.mint.toBase58()});\n } else {\n _args.push({programId: filter.programId.toBase58()});\n }\n\n const args = this._buildArgs(_args, commitment, 'jsonParsed');\n const unsafeRes = await this._rpcRequest('getTokenAccountsByOwner', args);\n const res = create(unsafeRes, GetParsedTokenAccountsByOwner);\n if ('error' in res) {\n throw new Error(\n 'failed to get token accounts owned by account ' +\n ownerAddress.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch the 20 largest accounts with their current balances\n */\n async getLargestAccounts(\n config?: GetLargestAccountsConfig,\n ): Promise<RpcResponseAndContext<Array<AccountBalancePair>>> {\n const arg = {\n ...config,\n commitment: (config && config.commitment) || this.commitment,\n };\n const args = arg.filter || arg.commitment ? [arg] : [];\n const unsafeRes = await this._rpcRequest('getLargestAccounts', args);\n const res = create(unsafeRes, GetLargestAccountsRpcResult);\n if ('error' in res) {\n throw new Error('failed to get largest accounts: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the 20 largest token accounts with their current balances\n * for a given mint.\n */\n async getTokenLargestAccounts(\n mintAddress: PublicKey,\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<Array<TokenAccountBalancePair>>> {\n const args = this._buildArgs([mintAddress.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getTokenLargestAccounts', args);\n const res = create(unsafeRes, GetTokenLargestAccountsResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get token largest accounts: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch all the account info for the specified public key, return with context\n */\n async getAccountInfoAndContext(\n publicKey: PublicKey,\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<AccountInfo<Buffer> | null>> {\n const args = this._buildArgs([publicKey.toBase58()], commitment, 'base64');\n const unsafeRes = await this._rpcRequest('getAccountInfo', args);\n const res = create(\n unsafeRes,\n jsonRpcResultAndContext(nullable(AccountInfoResult)),\n );\n if ('error' in res) {\n throw new Error(\n 'failed to get info about account ' +\n publicKey.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch parsed account info for the specified public key\n */\n async getParsedAccountInfo(\n publicKey: PublicKey,\n commitment?: Commitment,\n ): Promise<\n RpcResponseAndContext<AccountInfo<Buffer | ParsedAccountData> | null>\n > {\n const args = this._buildArgs(\n [publicKey.toBase58()],\n commitment,\n 'jsonParsed',\n );\n const unsafeRes = await this._rpcRequest('getAccountInfo', args);\n const res = create(\n unsafeRes,\n jsonRpcResultAndContext(nullable(ParsedAccountInfoResult)),\n );\n if ('error' in res) {\n throw new Error(\n 'failed to get info about account ' +\n publicKey.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch all the account info for the specified public key\n */\n async getAccountInfo(\n publicKey: PublicKey,\n commitment?: Commitment,\n ): Promise<AccountInfo<Buffer> | null> {\n try {\n const res = await this.getAccountInfoAndContext(publicKey, commitment);\n return res.value;\n } catch (e) {\n throw new Error(\n 'failed to get info about account ' + publicKey.toBase58() + ': ' + e,\n );\n }\n }\n\n /**\n * Returns epoch activation information for a stake account that has been delegated\n */\n async getStakeActivation(\n publicKey: PublicKey,\n commitment?: Commitment,\n epoch?: number,\n ): Promise<StakeActivationData> {\n const args = this._buildArgs(\n [publicKey.toBase58()],\n commitment,\n undefined,\n epoch !== undefined ? {epoch} : undefined,\n );\n\n const unsafeRes = await this._rpcRequest('getStakeActivation', args);\n const res = create(unsafeRes, jsonRpcResult(StakeActivationResult));\n if ('error' in res) {\n throw new Error(\n `failed to get Stake Activation ${publicKey.toBase58()}: ${\n res.error.message\n }`,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch all the accounts owned by the specified program id\n *\n * @return {Promise<Array<{pubkey: PublicKey, account: AccountInfo<Buffer>}>>}\n */\n async getProgramAccounts(\n programId: PublicKey,\n commitment?: Commitment,\n ): Promise<Array<{pubkey: PublicKey; account: AccountInfo<Buffer>}>> {\n const args = this._buildArgs([programId.toBase58()], commitment, 'base64');\n const unsafeRes = await this._rpcRequest('getProgramAccounts', args);\n const res = create(unsafeRes, jsonRpcResult(array(KeyedAccountInfoResult)));\n if ('error' in res) {\n throw new Error(\n 'failed to get accounts owned by program ' +\n programId.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch and parse all the accounts owned by the specified program id\n *\n * @return {Promise<Array<{pubkey: PublicKey, account: AccountInfo<Buffer | ParsedAccountData>}>>}\n */\n async getParsedProgramAccounts(\n programId: PublicKey,\n commitment?: Commitment,\n ): Promise<\n Array<{\n pubkey: PublicKey;\n account: AccountInfo<Buffer | ParsedAccountData>;\n }>\n > {\n const args = this._buildArgs(\n [programId.toBase58()],\n commitment,\n 'jsonParsed',\n );\n const unsafeRes = await this._rpcRequest('getProgramAccounts', args);\n const res = create(\n unsafeRes,\n jsonRpcResult(array(KeyedParsedAccountInfoResult)),\n );\n if ('error' in res) {\n throw new Error(\n 'failed to get accounts owned by program ' +\n programId.toBase58() +\n ': ' +\n res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Confirm the transaction identified by the specified signature.\n */\n async confirmTransaction(\n signature: TransactionSignature,\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<SignatureResult>> {\n let decodedSignature;\n try {\n decodedSignature = bs58.decode(signature);\n } catch (err) {\n throw new Error('signature must be base58 encoded: ' + signature);\n }\n\n assert(decodedSignature.length === 64, 'signature has invalid length');\n\n const start = Date.now();\n const subscriptionCommitment = commitment || this.commitment;\n\n let subscriptionId;\n let response: RpcResponseAndContext<SignatureResult> | null = null;\n const confirmPromise = new Promise((resolve, reject) => {\n try {\n subscriptionId = this.onSignature(\n signature,\n (result: SignatureResult, context: Context) => {\n subscriptionId = undefined;\n response = {\n context,\n value: result,\n };\n resolve(null);\n },\n subscriptionCommitment,\n );\n } catch (err) {\n reject(err);\n }\n });\n\n let timeoutMs = 60 * 1000;\n switch (subscriptionCommitment) {\n case 'processed':\n case 'recent':\n case 'single':\n case 'confirmed':\n case 'singleGossip': {\n timeoutMs = 30 * 1000;\n break;\n }\n // exhaust enums to ensure full coverage\n case 'finalized':\n case 'max':\n case 'root':\n }\n\n try {\n await promiseTimeout(confirmPromise, timeoutMs);\n } finally {\n if (subscriptionId) {\n this.removeSignatureListener(subscriptionId);\n }\n }\n\n if (response === null) {\n const duration = (Date.now() - start) / 1000;\n throw new Error(\n `Transaction was not confirmed in ${duration.toFixed(\n 2,\n )} seconds. It is unknown if it succeeded or failed. Check signature ${signature} using the Solana Explorer or CLI tools.`,\n );\n }\n\n return response;\n }\n\n /**\n * Return the list of nodes that are currently participating in the cluster\n */\n async getClusterNodes(): Promise<Array<ContactInfo>> {\n const unsafeRes = await this._rpcRequest('getClusterNodes', []);\n const res = create(unsafeRes, jsonRpcResult(array(ContactInfoResult)));\n if ('error' in res) {\n throw new Error('failed to get cluster nodes: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Return the list of nodes that are currently participating in the cluster\n */\n async getVoteAccounts(commitment?: Commitment): Promise<VoteAccountStatus> {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getVoteAccounts', args);\n const res = create(unsafeRes, GetVoteAccounts);\n if ('error' in res) {\n throw new Error('failed to get vote accounts: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current slot that the node is processing\n */\n async getSlot(commitment?: Commitment): Promise<number> {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getSlot', args);\n const res = create(unsafeRes, jsonRpcResult(number()));\n if ('error' in res) {\n throw new Error('failed to get slot: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current slot leader of the cluster\n */\n async getSlotLeader(commitment?: Commitment): Promise<string> {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getSlotLeader', args);\n const res = create(unsafeRes, jsonRpcResult(string()));\n if ('error' in res) {\n throw new Error('failed to get slot leader: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current status of a signature\n */\n async getSignatureStatus(\n signature: TransactionSignature,\n config?: SignatureStatusConfig,\n ): Promise<RpcResponseAndContext<SignatureStatus | null>> {\n const {context, value: values} = await this.getSignatureStatuses(\n [signature],\n config,\n );\n assert(values.length === 1);\n const value = values[0];\n return {context, value};\n }\n\n /**\n * Fetch the current statuses of a batch of signatures\n */\n async getSignatureStatuses(\n signatures: Array<TransactionSignature>,\n config?: SignatureStatusConfig,\n ): Promise<RpcResponseAndContext<Array<SignatureStatus | null>>> {\n const params: any[] = [signatures];\n if (config) {\n params.push(config);\n }\n const unsafeRes = await this._rpcRequest('getSignatureStatuses', params);\n const res = create(unsafeRes, GetSignatureStatusesRpcResult);\n if ('error' in res) {\n throw new Error('failed to get signature status: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current transaction count of the cluster\n */\n async getTransactionCount(commitment?: Commitment): Promise<number> {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getTransactionCount', args);\n const res = create(unsafeRes, jsonRpcResult(number()));\n if ('error' in res) {\n throw new Error('failed to get transaction count: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the current total currency supply of the cluster in lamports\n */\n async getTotalSupply(commitment?: Commitment): Promise<number> {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getTotalSupply', args);\n const res = create(unsafeRes, jsonRpcResult(number()));\n if ('error' in res) {\n throw new Error('failed to get total supply: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the cluster InflationGovernor parameters\n */\n async getInflationGovernor(\n commitment?: Commitment,\n ): Promise<InflationGovernor> {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getInflationGovernor', args);\n const res = create(unsafeRes, GetInflationGovernorRpcResult);\n if ('error' in res) {\n throw new Error('failed to get inflation: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the Epoch Info parameters\n */\n async getEpochInfo(commitment?: Commitment): Promise<EpochInfo> {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getEpochInfo', args);\n const res = create(unsafeRes, GetEpochInfoRpcResult);\n if ('error' in res) {\n throw new Error('failed to get epoch info: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the Epoch Schedule parameters\n */\n async getEpochSchedule(): Promise<EpochSchedule> {\n const unsafeRes = await this._rpcRequest('getEpochSchedule', []);\n const res = create(unsafeRes, GetEpochScheduleRpcResult);\n if ('error' in res) {\n throw new Error('failed to get epoch schedule: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the leader schedule for the current epoch\n * @return {Promise<RpcResponseAndContext<LeaderSchedule>>}\n */\n async getLeaderSchedule(): Promise<LeaderSchedule> {\n const unsafeRes = await this._rpcRequest('getLeaderSchedule', []);\n const res = create(unsafeRes, GetLeaderScheduleRpcResult);\n if ('error' in res) {\n throw new Error('failed to get leader schedule: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch the minimum balance needed to exempt an account of `dataLength`\n * size from rent\n */\n async getMinimumBalanceForRentExemption(\n dataLength: number,\n commitment?: Commitment,\n ): Promise<number> {\n const args = this._buildArgs([dataLength], commitment);\n const unsafeRes = await this._rpcRequest(\n 'getMinimumBalanceForRentExemption',\n args,\n );\n const res = create(unsafeRes, GetMinimumBalanceForRentExemptionRpcResult);\n if ('error' in res) {\n console.warn('Unable to fetch minimum balance for rent exemption');\n return 0;\n }\n return res.result;\n }\n\n /**\n * Fetch a recent blockhash from the cluster, return with context\n * @return {Promise<RpcResponseAndContext<{blockhash: Blockhash, feeCalculator: FeeCalculator}>>}\n */\n async getRecentBlockhashAndContext(\n commitment?: Commitment,\n ): Promise<\n RpcResponseAndContext<{blockhash: Blockhash; feeCalculator: FeeCalculator}>\n > {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getRecentBlockhash', args);\n const res = create(unsafeRes, GetRecentBlockhashAndContextRpcResult);\n if ('error' in res) {\n throw new Error('failed to get recent blockhash: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch recent performance samples\n * @return {Promise<Array<PerfSample>>}\n */\n async getRecentPerformanceSamples(\n limit?: number,\n ): Promise<Array<PerfSample>> {\n const args = this._buildArgs(limit ? [limit] : []);\n const unsafeRes = await this._rpcRequest(\n 'getRecentPerformanceSamples',\n args,\n );\n const res = create(unsafeRes, GetRecentPerformanceSamplesRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get recent performance samples: ' + res.error.message,\n );\n }\n\n return res.result;\n }\n\n /**\n * Fetch the fee calculator for a recent blockhash from the cluster, return with context\n */\n async getFeeCalculatorForBlockhash(\n blockhash: Blockhash,\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<FeeCalculator | null>> {\n const args = this._buildArgs([blockhash], commitment);\n const unsafeRes = await this._rpcRequest(\n 'getFeeCalculatorForBlockhash',\n args,\n );\n\n const res = create(unsafeRes, GetFeeCalculatorRpcResult);\n if ('error' in res) {\n throw new Error('failed to get fee calculator: ' + res.error.message);\n }\n const {context, value} = res.result;\n return {\n context,\n value: value !== null ? value.feeCalculator : null,\n };\n }\n\n /**\n * Fetch a recent blockhash from the cluster\n * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}\n */\n async getRecentBlockhash(\n commitment?: Commitment,\n ): Promise<{blockhash: Blockhash; feeCalculator: FeeCalculator}> {\n try {\n const res = await this.getRecentBlockhashAndContext(commitment);\n return res.value;\n } catch (e) {\n throw new Error('failed to get recent blockhash: ' + e);\n }\n }\n\n /**\n * Fetch the node version\n */\n async getVersion(): Promise<Version> {\n const unsafeRes = await this._rpcRequest('getVersion', []);\n const res = create(unsafeRes, jsonRpcResult(VersionResult));\n if ('error' in res) {\n throw new Error('failed to get version: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Fetch a list of Transactions and transaction statuses from the cluster\n * for a confirmed block\n */\n async getConfirmedBlock(slot: number): Promise<ConfirmedBlock> {\n const unsafeRes = await this._rpcRequest('getConfirmedBlock', [slot]);\n const res = create(unsafeRes, GetConfirmedBlockRpcResult);\n if ('error' in res) {\n throw new Error('failed to get confirmed block: ' + res.error.message);\n }\n const result = res.result;\n if (!result) {\n throw new Error('Confirmed block ' + slot + ' not found');\n }\n return result;\n }\n\n /**\n * Fetch a transaction details for a confirmed transaction\n */\n async getConfirmedTransaction(\n signature: TransactionSignature,\n ): Promise<ConfirmedTransaction | null> {\n const unsafeRes = await this._rpcRequest('getConfirmedTransaction', [\n signature,\n ]);\n const res = create(unsafeRes, GetConfirmedTransactionRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get confirmed transaction: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch parsed transaction details for a confirmed transaction\n */\n async getParsedConfirmedTransaction(\n signature: TransactionSignature,\n ): Promise<ParsedConfirmedTransaction | null> {\n const unsafeRes = await this._rpcRequest('getConfirmedTransaction', [\n signature,\n 'jsonParsed',\n ]);\n const res = create(unsafeRes, GetParsedConfirmedTransactionRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get confirmed transaction: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch parsed transaction details for a batch of confirmed transactions\n */\n async getParsedConfirmedTransactions(\n signatures: TransactionSignature[],\n ): Promise<(ParsedConfirmedTransaction | null)[]> {\n const batch = signatures.map(signature => {\n return {\n methodName: 'getConfirmedTransaction',\n args: [signature, 'jsonParsed'],\n };\n });\n\n const unsafeRes = await this._rpcBatchRequest(batch);\n const res = unsafeRes.map((unsafeRes: any) => {\n const res = create(unsafeRes, GetParsedConfirmedTransactionRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get confirmed transactions: ' + res.error.message,\n );\n }\n return res.result;\n });\n\n return res;\n }\n\n /**\n * Fetch a list of all the confirmed signatures for transactions involving an address\n * within a specified slot range. Max range allowed is 10,000 slots.\n *\n * @param address queried address\n * @param startSlot start slot, inclusive\n * @param endSlot end slot, inclusive\n */\n async getConfirmedSignaturesForAddress(\n address: PublicKey,\n startSlot: number,\n endSlot: number,\n ): Promise<Array<TransactionSignature>> {\n const unsafeRes = await this._rpcRequest(\n 'getConfirmedSignaturesForAddress',\n [address.toBase58(), startSlot, endSlot],\n );\n const res = create(unsafeRes, GetConfirmedSignaturesForAddressRpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get confirmed signatures for address: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Returns confirmed signatures for transactions involving an\n * address backwards in time from the provided signature or most recent confirmed block\n *\n *\n * @param address queried address\n * @param options\n */\n async getConfirmedSignaturesForAddress2(\n address: PublicKey,\n options?: ConfirmedSignaturesForAddress2Options,\n ): Promise<Array<ConfirmedSignatureInfo>> {\n const unsafeRes = await this._rpcRequest(\n 'getConfirmedSignaturesForAddress2',\n [address.toBase58(), options],\n );\n const res = create(unsafeRes, GetConfirmedSignaturesForAddress2RpcResult);\n if ('error' in res) {\n throw new Error(\n 'failed to get confirmed signatures for address: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * Fetch the contents of a Nonce account from the cluster, return with context\n */\n async getNonceAndContext(\n nonceAccount: PublicKey,\n commitment?: Commitment,\n ): Promise<RpcResponseAndContext<NonceAccount | null>> {\n const {context, value: accountInfo} = await this.getAccountInfoAndContext(\n nonceAccount,\n commitment,\n );\n\n let value = null;\n if (accountInfo !== null) {\n value = NonceAccount.fromAccountData(accountInfo.data);\n }\n\n return {\n context,\n value,\n };\n }\n\n /**\n * Fetch the contents of a Nonce account from the cluster\n */\n async getNonce(\n nonceAccount: PublicKey,\n commitment?: Commitment,\n ): Promise<NonceAccount | null> {\n return await this.getNonceAndContext(nonceAccount, commitment)\n .then(x => x.value)\n .catch(e => {\n throw new Error(\n 'failed to get nonce for account ' +\n nonceAccount.toBase58() +\n ': ' +\n e,\n );\n });\n }\n\n /**\n * Request an allocation of lamports to the specified account\n */\n async requestAirdrop(\n to: PublicKey,\n amount: number,\n ): Promise<TransactionSignature> {\n const unsafeRes = await this._rpcRequest('requestAirdrop', [\n to.toBase58(),\n amount,\n ]);\n const res = create(unsafeRes, RequestAirdropRpcResult);\n if ('error' in res) {\n throw new Error(\n 'airdrop to ' + to.toBase58() + ' failed: ' + res.error.message,\n );\n }\n return res.result;\n }\n\n /**\n * @internal\n */\n async _recentBlockhash(disableCache: boolean): Promise<Blockhash> {\n if (!disableCache) {\n // Wait for polling to finish\n while (this._pollingBlockhash) {\n await sleep(100);\n }\n const timeSinceFetch = Date.now() - this._blockhashInfo.lastFetch;\n const expired = timeSinceFetch >= BLOCKHASH_CACHE_TIMEOUT_MS;\n if (this._blockhashInfo.recentBlockhash !== null && !expired) {\n return this._blockhashInfo.recentBlockhash;\n }\n }\n\n return await this._pollNewBlockhash();\n }\n\n /**\n * @internal\n */\n async _pollNewBlockhash(): Promise<Blockhash> {\n this._pollingBlockhash = true;\n try {\n const startTime = Date.now();\n for (let i = 0; i < 50; i++) {\n const {blockhash} = await this.getRecentBlockhash('finalized');\n\n if (this._blockhashInfo.recentBlockhash != blockhash) {\n this._blockhashInfo = {\n recentBlockhash: blockhash,\n lastFetch: Date.now(),\n transactionSignatures: [],\n simulatedSignatures: [],\n };\n return blockhash;\n }\n\n // Sleep for approximately half a slot\n await sleep(MS_PER_SLOT / 2);\n }\n\n throw new Error(\n `Unable to obtain a new blockhash after ${Date.now() - startTime}ms`,\n );\n } finally {\n this._pollingBlockhash = false;\n }\n }\n\n /**\n * Simulate a transaction\n */\n async simulateTransaction(\n transaction: Transaction,\n signers?: Array<Account>,\n ): Promise<RpcResponseAndContext<SimulatedTransactionResponse>> {\n if (transaction.nonceInfo && signers) {\n transaction.sign(...signers);\n } else {\n let disableCache = this._disableBlockhashCaching;\n for (;;) {\n transaction.recentBlockhash = await this._recentBlockhash(disableCache);\n\n if (!signers) break;\n\n transaction.sign(...signers);\n if (!transaction.signature) {\n throw new Error('!signature'); // should never happen\n }\n\n // If the signature of this transaction has not been seen before with the\n // current recentBlockhash, all done.\n const signature = transaction.signature.toString('base64');\n if (\n !this._blockhashInfo.simulatedSignatures.includes(signature) &&\n !this._blockhashInfo.transactionSignatures.includes(signature)\n ) {\n this._blockhashInfo.simulatedSignatures.push(signature);\n break;\n } else {\n disableCache = true;\n }\n }\n }\n\n const signData = transaction.serializeMessage();\n const wireTransaction = transaction._serialize(signData);\n const encodedTransaction = wireTransaction.toString('base64');\n const config: any = {\n encoding: 'base64',\n commitment: this.commitment,\n };\n\n if (signers) {\n config.sigVerify = true;\n }\n\n const args = [encodedTransaction, config];\n const unsafeRes = await this._rpcRequest('simulateTransaction', args);\n const res = create(unsafeRes, SimulatedTransactionResponseStruct);\n if ('error' in res) {\n throw new Error('failed to simulate transaction: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * Sign and send a transaction\n */\n async sendTransaction(\n transaction: Transaction,\n signers: Array<Account>,\n options?: SendOptions,\n ): Promise<TransactionSignature> {\n if (transaction.nonceInfo) {\n transaction.sign(...signers);\n } else {\n let disableCache = this._disableBlockhashCaching;\n for (;;) {\n transaction.recentBlockhash = await this._recentBlockhash(disableCache);\n transaction.sign(...signers);\n if (!transaction.signature) {\n throw new Error('!signature'); // should never happen\n }\n\n // If the signature of this transaction has not been seen before with the\n // current recentBlockhash, all done.\n const signature = transaction.signature.toString('base64');\n if (!this._blockhashInfo.transactionSignatures.includes(signature)) {\n this._blockhashInfo.transactionSignatures.push(signature);\n break;\n } else {\n disableCache = true;\n }\n }\n }\n\n const wireTransaction = transaction.serialize();\n return await this.sendRawTransaction(wireTransaction, options);\n }\n\n /**\n * Send a transaction that has already been signed and serialized into the\n * wire format\n */\n async sendRawTransaction(\n rawTransaction: Buffer | Uint8Array | Array<number>,\n options?: SendOptions,\n ): Promise<TransactionSignature> {\n const encodedTransaction = toBuffer(rawTransaction).toString('base64');\n const result = await this.sendEncodedTransaction(\n encodedTransaction,\n options,\n );\n return result;\n }\n\n /**\n * Send a transaction that has already been signed, serialized into the\n * wire format, and encoded as a base64 string\n */\n async sendEncodedTransaction(\n encodedTransaction: string,\n options?: SendOptions,\n ): Promise<TransactionSignature> {\n const config: any = {encoding: 'base64'};\n const skipPreflight = options && options.skipPreflight;\n const preflightCommitment =\n (options && options.preflightCommitment) || this.commitment;\n\n if (skipPreflight) {\n config.skipPreflight = skipPreflight;\n }\n if (preflightCommitment) {\n config.preflightCommitment = preflightCommitment;\n }\n\n const args = [encodedTransaction, config];\n const unsafeRes = await this._rpcRequest('sendTransaction', args);\n const res = create(unsafeRes, SendTransactionRpcResult);\n if ('error' in res) {\n if ('data' in res.error) {\n const logs = res.error.data.logs;\n if (logs && Array.isArray(logs)) {\n const traceIndent = '\\n ';\n const logTrace = traceIndent + logs.join(traceIndent);\n console.error(res.error.message, logTrace);\n }\n }\n throw new Error('failed to send transaction: ' + res.error.message);\n }\n return res.result;\n }\n\n /**\n * @internal\n */\n _wsOnOpen() {\n this._rpcWebSocketConnected = true;\n this._rpcWebSocketHeartbeat = setInterval(() => {\n // Ping server every 5s to prevent idle timeouts\n this._rpcWebSocket.notify('ping').catch(() => {});\n }, 5000);\n this._updateSubscriptions();\n }\n\n /**\n * @internal\n */\n _wsOnError(err: Error) {\n console.error('ws error:', err.message);\n }\n\n /**\n * @internal\n */\n _wsOnClose(code: number) {\n if (this._rpcWebSocketHeartbeat) {\n clearInterval(this._rpcWebSocketHeartbeat);\n this._rpcWebSocketHeartbeat = null;\n }\n\n if (code === 1000) {\n // explicit close, check if any subscriptions have been made since close\n this._updateSubscriptions();\n return;\n }\n\n // implicit close, prepare subscriptions for auto-reconnect\n this._resetSubscriptions();\n }\n\n /**\n * @internal\n */\n async _subscribe(\n sub: {subscriptionId: SubscriptionId | null},\n rpcMethod: string,\n rpcArgs: IWSRequestParams,\n ) {\n if (sub.subscriptionId == null) {\n sub.subscriptionId = 'subscribing';\n try {\n const id = await this._rpcWebSocket.call(rpcMethod, rpcArgs);\n if (typeof id === 'number' && sub.subscriptionId === 'subscribing') {\n // eslint-disable-next-line require-atomic-updates\n sub.subscriptionId = id;\n }\n } catch (err) {\n if (sub.subscriptionId === 'subscribing') {\n // eslint-disable-next-line require-atomic-updates\n sub.subscriptionId = null;\n }\n console.error(`${rpcMethod} error for argument`, rpcArgs, err.message);\n }\n }\n }\n\n /**\n * @internal\n */\n async _unsubscribe(\n sub: {subscriptionId: SubscriptionId | null},\n rpcMethod: string,\n ) {\n const subscriptionId = sub.subscriptionId;\n if (subscriptionId != null && typeof subscriptionId != 'string') {\n const unsubscribeId: number = subscriptionId;\n try {\n await this._rpcWebSocket.call(rpcMethod, [unsubscribeId]);\n } catch (err) {\n console.error(`${rpcMethod} error:`, err.message);\n }\n }\n }\n\n /**\n * @internal\n */\n _resetSubscriptions() {\n Object.values(this._accountChangeSubscriptions).forEach(\n s => (s.subscriptionId = null),\n );\n Object.values(this._programAccountChangeSubscriptions).forEach(\n s => (s.subscriptionId = null),\n );\n Object.values(this._signatureSubscriptions).forEach(\n s => (s.subscriptionId = null),\n );\n Object.values(this._slotSubscriptions).forEach(\n s => (s.subscriptionId = null),\n );\n Object.values(this._rootSubscriptions).forEach(\n s => (s.subscriptionId = null),\n );\n }\n\n /**\n * @internal\n */\n _updateSubscriptions() {\n const accountKeys = Object.keys(this._accountChangeSubscriptions).map(\n Number,\n );\n const programKeys = Object.keys(\n this._programAccountChangeSubscriptions,\n ).map(Number);\n const slotKeys = Object.keys(this._slotSubscriptions).map(Number);\n const signatureKeys = Object.keys(this._signatureSubscriptions).map(Number);\n const rootKeys = Object.keys(this._rootSubscriptions).map(Number);\n const logsKeys = Object.keys(this._logsSubscriptions).map(Number);\n if (\n accountKeys.length === 0 &&\n programKeys.length === 0 &&\n slotKeys.length === 0 &&\n signatureKeys.length === 0 &&\n rootKeys.length === 0 &&\n logsKeys.length === 0\n ) {\n if (this._rpcWebSocketConnected) {\n this._rpcWebSocketConnected = false;\n this._rpcWebSocketIdleTimeout = setTimeout(() => {\n this._rpcWebSocketIdleTimeout = null;\n this._rpcWebSocket.close();\n }, 500);\n }\n return;\n }\n\n if (this._rpcWebSocketIdleTimeout !== null) {\n clearTimeout(this._rpcWebSocketIdleTimeout);\n this._rpcWebSocketIdleTimeout = null;\n this._rpcWebSocketConnected = true;\n }\n\n if (!this._rpcWebSocketConnected) {\n this._rpcWebSocket.connect();\n return;\n }\n\n for (let id of accountKeys) {\n const sub = this._accountChangeSubscriptions[id];\n this._subscribe(\n sub,\n 'accountSubscribe',\n this._buildArgs([sub.publicKey], sub.commitment, 'base64'),\n );\n }\n\n for (let id of programKeys) {\n const sub = this._programAccountChangeSubscriptions[id];\n this._subscribe(\n sub,\n 'programSubscribe',\n this._buildArgs([sub.programId], sub.commitment, 'base64'),\n );\n }\n\n for (let id of slotKeys) {\n const sub = this._slotSubscriptions[id];\n this._subscribe(sub, 'slotSubscribe', []);\n }\n\n for (let id of signatureKeys) {\n const sub = this._signatureSubscriptions[id];\n const args: any[] = [sub.signature];\n if (sub.options) args.push(sub.options);\n this._subscribe(sub, 'signatureSubscribe', args);\n }\n\n for (let id of rootKeys) {\n const sub = this._rootSubscriptions[id];\n this._subscribe(sub, 'rootSubscribe', []);\n }\n\n for (let id of logsKeys) {\n const sub = this._logsSubscriptions[id];\n let filter;\n if (typeof sub.filter === 'object') {\n filter = {mentions: [sub.filter.toString()]};\n } else {\n filter = sub.filter;\n }\n this._subscribe(\n sub,\n 'logsSubscribe',\n this._buildArgs([filter], sub.commitment),\n );\n }\n }\n\n /**\n * @internal\n */\n _wsOnAccountNotification(notification: object) {\n const res = create(notification, AccountNotificationResult);\n for (const sub of Object.values(this._accountChangeSubscriptions)) {\n if (sub.subscriptionId === res.subscription) {\n sub.callback(res.result.value, res.result.context);\n return;\n }\n }\n }\n\n /**\n * Register a callback to be invoked whenever the specified account changes\n *\n * @param publicKey Public key of the account to monitor\n * @param callback Function to invoke whenever the account is changed\n * @param commitment Specify the commitment level account changes must reach before notification\n * @return subscription id\n */\n onAccountChange(\n publicKey: PublicKey,\n callback: AccountChangeCallback,\n commitment?: Commitment,\n ): number {\n const id = ++this._accountChangeSubscriptionCounter;\n this._accountChangeSubscriptions[id] = {\n publicKey: publicKey.toBase58(),\n callback,\n commitment,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister an account notification callback\n *\n * @param id subscription id to deregister\n */\n async removeAccountChangeListener(id: number): Promise<void> {\n if (this._accountChangeSubscriptions[id]) {\n const subInfo = this._accountChangeSubscriptions[id];\n delete this._accountChangeSubscriptions[id];\n await this._unsubscribe(subInfo, 'accountUnsubscribe');\n this._updateSubscriptions();\n } else {\n throw new Error(`Unknown account change id: ${id}`);\n }\n }\n\n /**\n * @internal\n */\n _wsOnProgramAccountNotification(notification: Object) {\n const res = create(notification, ProgramAccountNotificationResult);\n for (const sub of Object.values(this._programAccountChangeSubscriptions)) {\n if (sub.subscriptionId === res.subscription) {\n const {value, context} = res.result;\n sub.callback(\n {\n accountId: value.pubkey,\n accountInfo: value.account,\n },\n context,\n );\n return;\n }\n }\n }\n\n /**\n * Register a callback to be invoked whenever accounts owned by the\n * specified program change\n *\n * @param programId Public key of the program to monitor\n * @param callback Function to invoke whenever the account is changed\n * @param commitment Specify the commitment level account changes must reach before notification\n * @return subscription id\n */\n onProgramAccountChange(\n programId: PublicKey,\n callback: ProgramAccountChangeCallback,\n commitment?: Commitment,\n ): number {\n const id = ++this._programAccountChangeSubscriptionCounter;\n this._programAccountChangeSubscriptions[id] = {\n programId: programId.toBase58(),\n callback,\n commitment,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister an account notification callback\n *\n * @param id subscription id to deregister\n */\n async removeProgramAccountChangeListener(id: number): Promise<void> {\n if (this._programAccountChangeSubscriptions[id]) {\n const subInfo = this._programAccountChangeSubscriptions[id];\n delete this._programAccountChangeSubscriptions[id];\n await this._unsubscribe(subInfo, 'programUnsubscribe');\n this._updateSubscriptions();\n } else {\n throw new Error(`Unknown program account change id: ${id}`);\n }\n }\n\n /**\n * Registers a callback to be invoked whenever logs are emitted.\n */\n onLogs(\n filter: LogsFilter,\n callback: LogsCallback,\n commitment?: Commitment,\n ): number {\n const id = ++this._logsSubscriptionCounter;\n this._logsSubscriptions[id] = {\n filter,\n callback,\n commitment,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister a logs callback.\n *\n * @param id subscription id to deregister.\n */\n async removeOnLogsListener(id: number): Promise<void> {\n if (!this._logsSubscriptions[id]) {\n throw new Error(`Unknown logs id: ${id}`);\n }\n const subInfo = this._logsSubscriptions[id];\n delete this._logsSubscriptions[id];\n await this._unsubscribe(subInfo, 'logsUnsubscribe');\n this._updateSubscriptions();\n }\n\n /**\n * @internal\n */\n _wsOnLogsNotification(notification: Object) {\n const res = create(notification, LogsNotificationResult);\n const keys = Object.keys(this._logsSubscriptions).map(Number);\n for (let id of keys) {\n const sub = this._logsSubscriptions[id];\n if (sub.subscriptionId === res.subscription) {\n sub.callback(res.result.value, res.result.context);\n return;\n }\n }\n }\n\n /**\n * @internal\n */\n _wsOnSlotNotification(notification: Object) {\n const res = create(notification, SlotNotificationResult);\n for (const sub of Object.values(this._slotSubscriptions)) {\n if (sub.subscriptionId === res.subscription) {\n sub.callback(res.result);\n return;\n }\n }\n }\n\n /**\n * Register a callback to be invoked upon slot changes\n *\n * @param callback Function to invoke whenever the slot changes\n * @return subscription id\n */\n onSlotChange(callback: SlotChangeCallback): number {\n const id = ++this._slotSubscriptionCounter;\n this._slotSubscriptions[id] = {\n callback,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister a slot notification callback\n *\n * @param id subscription id to deregister\n */\n async removeSlotChangeListener(id: number): Promise<void> {\n if (this._slotSubscriptions[id]) {\n const subInfo = this._slotSubscriptions[id];\n delete this._slotSubscriptions[id];\n await this._unsubscribe(subInfo, 'slotUnsubscribe');\n this._updateSubscriptions();\n } else {\n throw new Error(`Unknown slot change id: ${id}`);\n }\n }\n\n /**\n * @internal\n */\n _buildArgs(\n args: Array<any>,\n override?: Commitment,\n encoding?: 'jsonParsed' | 'base64',\n extra?: any,\n ): Array<any> {\n const commitment = override || this._commitment;\n if (commitment || encoding || extra) {\n let options: any = {};\n if (encoding) {\n options.encoding = encoding;\n }\n if (commitment) {\n options.commitment = commitment;\n }\n if (extra) {\n options = Object.assign(options, extra);\n }\n args.push(options);\n }\n return args;\n }\n\n /**\n * @internal\n */\n _wsOnSignatureNotification(notification: Object) {\n const res = create(notification, SignatureNotificationResult);\n for (const [id, sub] of Object.entries(this._signatureSubscriptions)) {\n if (sub.subscriptionId === res.subscription) {\n if (res.result.value === 'receivedSignature') {\n sub.callback(\n {\n type: 'received',\n },\n res.result.context,\n );\n } else {\n // Signatures subscriptions are auto-removed by the RPC service so\n // no need to explicitly send an unsubscribe message\n delete this._signatureSubscriptions[Number(id)];\n this._updateSubscriptions();\n sub.callback(\n {\n type: 'status',\n result: res.result.value,\n },\n res.result.context,\n );\n }\n return;\n }\n }\n }\n\n /**\n * Register a callback to be invoked upon signature updates\n *\n * @param signature Transaction signature string in base 58\n * @param callback Function to invoke on signature notifications\n * @param commitment Specify the commitment level signature must reach before notification\n * @return subscription id\n */\n onSignature(\n signature: TransactionSignature,\n callback: SignatureResultCallback,\n commitment?: Commitment,\n ): number {\n const id = ++this._signatureSubscriptionCounter;\n this._signatureSubscriptions[id] = {\n signature,\n callback: (notification, context) => {\n if (notification.type === 'status') {\n callback(notification.result, context);\n }\n },\n options: {commitment},\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Register a callback to be invoked when a transaction is\n * received and/or processed.\n *\n * @param signature Transaction signature string in base 58\n * @param callback Function to invoke on signature notifications\n * @param options Enable received notifications and set the commitment\n * level that signature must reach before notification\n * @return subscription id\n */\n onSignatureWithOptions(\n signature: TransactionSignature,\n callback: SignatureSubscriptionCallback,\n options?: SignatureSubscriptionOptions,\n ): number {\n const id = ++this._signatureSubscriptionCounter;\n this._signatureSubscriptions[id] = {\n signature,\n callback,\n options,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister a signature notification callback\n *\n * @param id subscription id to deregister\n */\n async removeSignatureListener(id: number): Promise<void> {\n if (this._signatureSubscriptions[id]) {\n const subInfo = this._signatureSubscriptions[id];\n delete this._signatureSubscriptions[id];\n await this._unsubscribe(subInfo, 'signatureUnsubscribe');\n this._updateSubscriptions();\n } else {\n throw new Error(`Unknown signature result id: ${id}`);\n }\n }\n\n /**\n * @internal\n */\n _wsOnRootNotification(notification: Object) {\n const res = create(notification, RootNotificationResult);\n for (const sub of Object.values(this._rootSubscriptions)) {\n if (sub.subscriptionId === res.subscription) {\n sub.callback(res.result);\n return;\n }\n }\n }\n\n /**\n * Register a callback to be invoked upon root changes\n *\n * @param callback Function to invoke whenever the root changes\n * @return subscription id\n */\n onRootChange(callback: RootChangeCallback): number {\n const id = ++this._rootSubscriptionCounter;\n this._rootSubscriptions[id] = {\n callback,\n subscriptionId: null,\n };\n this._updateSubscriptions();\n return id;\n }\n\n /**\n * Deregister a root notification callback\n *\n * @param id subscription id to deregister\n */\n async removeRootChangeListener(id: number): Promise<void> {\n if (this._rootSubscriptions[id]) {\n const subInfo = this._rootSubscriptions[id];\n delete this._rootSubscriptions[id];\n await this._unsubscribe(subInfo, 'rootUnsubscribe');\n this._updateSubscriptions();\n } else {\n throw new Error(`Unknown root change id: ${id}`);\n }\n }\n}\n","import * as BufferLayout from 'buffer-layout';\n\nimport {encodeData, decodeData, InstructionType} from './instruction';\nimport * as Layout from './layout';\nimport {PublicKey} from './publickey';\nimport {SystemProgram} from './system-program';\nimport {\n SYSVAR_CLOCK_PUBKEY,\n SYSVAR_RENT_PUBKEY,\n SYSVAR_STAKE_HISTORY_PUBKEY,\n} from './sysvar';\nimport {Transaction, TransactionInstruction} from './transaction';\n\n/**\n * Address of the stake config account which configures the rate\n * of stake warmup and cooldown as well as the slashing penalty.\n */\nexport const STAKE_CONFIG_ID = new PublicKey(\n 'StakeConfig11111111111111111111111111111111',\n);\n\n/**\n * Stake account authority info\n */\nexport class Authorized {\n /** stake authority */\n staker: PublicKey;\n /** withdraw authority */\n withdrawer: PublicKey;\n\n /**\n * Create a new Authorized object\n * @param staker the stake authority\n * @param withdrawer the withdraw authority\n */\n constructor(staker: PublicKey, withdrawer: PublicKey) {\n this.staker = staker;\n this.withdrawer = withdrawer;\n }\n}\n\n/**\n * Stake account lockup info\n */\nexport class Lockup {\n /** Unix timestamp of lockup expiration */\n unixTimestamp: number;\n /** Epoch of lockup expiration */\n epoch: number;\n /** Lockup custodian authority */\n custodian: PublicKey;\n\n /**\n * Create a new Lockup object\n */\n constructor(unixTimestamp: number, epoch: number, custodian: PublicKey) {\n this.unixTimestamp = unixTimestamp;\n this.epoch = epoch;\n this.custodian = custodian;\n }\n}\n\n/**\n * Create stake account transaction params\n */\nexport type CreateStakeAccountParams = {\n /** Address of the account which will fund creation */\n fromPubkey: PublicKey;\n /** Address of the new stake account */\n stakePubkey: PublicKey;\n /** Authorities of the new stake account */\n authorized: Authorized;\n /** Lockup of the new stake account */\n lockup: Lockup;\n /** Funding amount */\n lamports: number;\n};\n\n/**\n * Create stake account with seed transaction params\n */\nexport type CreateStakeAccountWithSeedParams = {\n fromPubkey: PublicKey;\n stakePubkey: PublicKey;\n basePubkey: PublicKey;\n seed: string;\n authorized: Authorized;\n lockup: Lockup;\n lamports: number;\n};\n\n/**\n * Initialize stake instruction params\n */\nexport type InitializeStakeParams = {\n stakePubkey: PublicKey;\n authorized: Authorized;\n lockup: Lockup;\n};\n\n/**\n * Delegate stake instruction params\n */\nexport type DelegateStakeParams = {\n stakePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n votePubkey: PublicKey;\n};\n\n/**\n * Authorize stake instruction params\n */\nexport type AuthorizeStakeParams = {\n stakePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n newAuthorizedPubkey: PublicKey;\n stakeAuthorizationType: StakeAuthorizationType;\n custodianPubkey?: PublicKey;\n};\n\n/**\n * Authorize stake instruction params using a derived key\n */\nexport type AuthorizeWithSeedStakeParams = {\n stakePubkey: PublicKey;\n authorityBase: PublicKey;\n authoritySeed: string;\n authorityOwner: PublicKey;\n newAuthorizedPubkey: PublicKey;\n stakeAuthorizationType: StakeAuthorizationType;\n custodianPubkey?: PublicKey;\n};\n\n/**\n * Split stake instruction params\n */\nexport type SplitStakeParams = {\n stakePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n splitStakePubkey: PublicKey;\n lamports: number;\n};\n\n/**\n * Withdraw stake instruction params\n */\nexport type WithdrawStakeParams = {\n stakePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n toPubkey: PublicKey;\n lamports: number;\n custodianPubkey?: PublicKey;\n};\n\n/**\n * Deactivate stake instruction params\n */\nexport type DeactivateStakeParams = {\n stakePubkey: PublicKey;\n authorizedPubkey: PublicKey;\n};\n\n/**\n * Stake Instruction class\n */\nexport class StakeInstruction {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Decode a stake instruction and retrieve the instruction type.\n */\n static decodeInstructionType(\n instruction: TransactionInstruction,\n ): StakeInstructionType {\n this.checkProgramId(instruction.programId);\n\n const instructionTypeLayout = BufferLayout.u32('instruction');\n const typeIndex = instructionTypeLayout.decode(instruction.data);\n\n let type: StakeInstructionType | undefined;\n for (const [ixType, layout] of Object.entries(STAKE_INSTRUCTION_LAYOUTS)) {\n if (layout.index == typeIndex) {\n type = ixType as StakeInstructionType;\n break;\n }\n }\n\n if (!type) {\n throw new Error('Instruction type incorrect; not a StakeInstruction');\n }\n\n return type;\n }\n\n /**\n * Decode a initialize stake instruction and retrieve the instruction params.\n */\n static decodeInitialize(\n instruction: TransactionInstruction,\n ): InitializeStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n\n const {authorized, lockup} = decodeData(\n STAKE_INSTRUCTION_LAYOUTS.Initialize,\n instruction.data,\n );\n\n return {\n stakePubkey: instruction.keys[0].pubkey,\n authorized: new Authorized(\n new PublicKey(authorized.staker),\n new PublicKey(authorized.withdrawer),\n ),\n lockup: new Lockup(\n lockup.unixTimestamp,\n lockup.epoch,\n new PublicKey(lockup.custodian),\n ),\n };\n }\n\n /**\n * Decode a delegate stake instruction and retrieve the instruction params.\n */\n static decodeDelegate(\n instruction: TransactionInstruction,\n ): DelegateStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 6);\n decodeData(STAKE_INSTRUCTION_LAYOUTS.Delegate, instruction.data);\n\n return {\n stakePubkey: instruction.keys[0].pubkey,\n votePubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[5].pubkey,\n };\n }\n\n /**\n * Decode an authorize stake instruction and retrieve the instruction params.\n */\n static decodeAuthorize(\n instruction: TransactionInstruction,\n ): AuthorizeStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {newAuthorized, stakeAuthorizationType} = decodeData(\n STAKE_INSTRUCTION_LAYOUTS.Authorize,\n instruction.data,\n );\n\n const o: AuthorizeStakeParams = {\n stakePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n newAuthorizedPubkey: new PublicKey(newAuthorized),\n stakeAuthorizationType: {\n index: stakeAuthorizationType,\n },\n };\n if (instruction.keys.length > 3) {\n o.custodianPubkey = instruction.keys[3].pubkey;\n }\n return o;\n }\n\n /**\n * Decode an authorize-with-seed stake instruction and retrieve the instruction params.\n */\n static decodeAuthorizeWithSeed(\n instruction: TransactionInstruction,\n ): AuthorizeWithSeedStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n\n const {\n newAuthorized,\n stakeAuthorizationType,\n authoritySeed,\n authorityOwner,\n } = decodeData(\n STAKE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed,\n instruction.data,\n );\n\n const o: AuthorizeWithSeedStakeParams = {\n stakePubkey: instruction.keys[0].pubkey,\n authorityBase: instruction.keys[1].pubkey,\n authoritySeed: authoritySeed,\n authorityOwner: new PublicKey(authorityOwner),\n newAuthorizedPubkey: new PublicKey(newAuthorized),\n stakeAuthorizationType: {\n index: stakeAuthorizationType,\n },\n };\n if (instruction.keys.length > 3) {\n o.custodianPubkey = instruction.keys[3].pubkey;\n }\n return o;\n }\n\n /**\n * Decode a split stake instruction and retrieve the instruction params.\n */\n static decodeSplit(instruction: TransactionInstruction): SplitStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {lamports} = decodeData(\n STAKE_INSTRUCTION_LAYOUTS.Split,\n instruction.data,\n );\n\n return {\n stakePubkey: instruction.keys[0].pubkey,\n splitStakePubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n lamports,\n };\n }\n\n /**\n * Decode a withdraw stake instruction and retrieve the instruction params.\n */\n static decodeWithdraw(\n instruction: TransactionInstruction,\n ): WithdrawStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 5);\n const {lamports} = decodeData(\n STAKE_INSTRUCTION_LAYOUTS.Withdraw,\n instruction.data,\n );\n\n const o: WithdrawStakeParams = {\n stakePubkey: instruction.keys[0].pubkey,\n toPubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[4].pubkey,\n lamports,\n };\n if (instruction.keys.length > 5) {\n o.custodianPubkey = instruction.keys[5].pubkey;\n }\n return o;\n }\n\n /**\n * Decode a deactivate stake instruction and retrieve the instruction params.\n */\n static decodeDeactivate(\n instruction: TransactionInstruction,\n ): DeactivateStakeParams {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n decodeData(STAKE_INSTRUCTION_LAYOUTS.Deactivate, instruction.data);\n\n return {\n stakePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n };\n }\n\n /**\n * @internal\n */\n static checkProgramId(programId: PublicKey) {\n if (!programId.equals(StakeProgram.programId)) {\n throw new Error('invalid instruction; programId is not StakeProgram');\n }\n }\n\n /**\n * @internal\n */\n static checkKeyLength(keys: Array<any>, expectedLength: number) {\n if (keys.length < expectedLength) {\n throw new Error(\n `invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`,\n );\n }\n }\n}\n\n/**\n * An enumeration of valid StakeInstructionType's\n */\nexport type StakeInstructionType =\n | 'AuthorizeWithSeed'\n | 'Authorize'\n | 'Deactivate'\n | 'Delegate'\n | 'Initialize'\n | 'Split'\n | 'Withdraw';\n\n/**\n * An enumeration of valid stake InstructionType's\n */\nexport const STAKE_INSTRUCTION_LAYOUTS: {\n [type in StakeInstructionType]: InstructionType;\n} = Object.freeze({\n Initialize: {\n index: 0,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.authorized(),\n Layout.lockup(),\n ]),\n },\n Authorize: {\n index: 1,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('newAuthorized'),\n BufferLayout.u32('stakeAuthorizationType'),\n ]),\n },\n Delegate: {\n index: 2,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')]),\n },\n Split: {\n index: 3,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.ns64('lamports'),\n ]),\n },\n Withdraw: {\n index: 4,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n BufferLayout.ns64('lamports'),\n ]),\n },\n Deactivate: {\n index: 5,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')]),\n },\n AuthorizeWithSeed: {\n index: 8,\n layout: BufferLayout.struct([\n BufferLayout.u32('instruction'),\n Layout.publicKey('newAuthorized'),\n BufferLayout.u32('stakeAuthorizationType'),\n Layout.rustString('authoritySeed'),\n Layout.publicKey('authorityOwner'),\n ]),\n },\n});\n\n/**\n * @typedef {Object} StakeAuthorizationType\n * @property (index} The Stake Authorization index (from solana-stake-program)\n */\nexport type StakeAuthorizationType = {\n index: number;\n};\n\n/**\n * An enumeration of valid StakeAuthorizationLayout's\n */\nexport const StakeAuthorizationLayout = Object.freeze({\n Staker: {\n index: 0,\n },\n Withdrawer: {\n index: 1,\n },\n});\n\n/**\n * Factory class for transactions to interact with the Stake program\n */\nexport class StakeProgram {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the Stake program\n */\n static get programId(): PublicKey {\n return new PublicKey('Stake11111111111111111111111111111111111111');\n }\n\n /**\n * Max space of a Stake account\n *\n * This is generated from the solana-stake-program StakeState struct as\n * `std::mem::size_of::<StakeState>()`:\n * https://docs.rs/solana-stake-program/1.4.4/solana_stake_program/stake_state/enum.StakeState.html\n */\n static get space(): number {\n return 200;\n }\n\n /**\n * Generate an Initialize instruction to add to a Stake Create transaction\n */\n static initialize(params: InitializeStakeParams): TransactionInstruction {\n const {stakePubkey, authorized, lockup} = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Initialize;\n const data = encodeData(type, {\n authorized: {\n staker: authorized.staker.toBuffer(),\n withdrawer: authorized.withdrawer.toBuffer(),\n },\n lockup: {\n unixTimestamp: lockup.unixTimestamp,\n epoch: lockup.epoch,\n custodian: lockup.custodian.toBuffer(),\n },\n });\n const instructionData = {\n keys: [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: SYSVAR_RENT_PUBKEY, isSigner: false, isWritable: false},\n ],\n programId: this.programId,\n data,\n };\n return new TransactionInstruction(instructionData);\n }\n\n /**\n * Generate a Transaction that creates a new Stake account at\n * an address generated with `from`, a seed, and the Stake programId\n */\n static createAccountWithSeed(\n params: CreateStakeAccountWithSeedParams,\n ): Transaction {\n const transaction = new Transaction();\n transaction.add(\n SystemProgram.createAccountWithSeed({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.stakePubkey,\n basePubkey: params.basePubkey,\n seed: params.seed,\n lamports: params.lamports,\n space: this.space,\n programId: this.programId,\n }),\n );\n\n const {stakePubkey, authorized, lockup} = params;\n return transaction.add(this.initialize({stakePubkey, authorized, lockup}));\n }\n\n /**\n * Generate a Transaction that creates a new Stake account\n */\n static createAccount(params: CreateStakeAccountParams): Transaction {\n const transaction = new Transaction();\n transaction.add(\n SystemProgram.createAccount({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.stakePubkey,\n lamports: params.lamports,\n space: this.space,\n programId: this.programId,\n }),\n );\n\n const {stakePubkey, authorized, lockup} = params;\n return transaction.add(this.initialize({stakePubkey, authorized, lockup}));\n }\n\n /**\n * Generate a Transaction that delegates Stake tokens to a validator\n * Vote PublicKey. This transaction can also be used to redelegate Stake\n * to a new validator Vote PublicKey.\n */\n static delegate(params: DelegateStakeParams): Transaction {\n const {stakePubkey, authorizedPubkey, votePubkey} = params;\n\n const type = STAKE_INSTRUCTION_LAYOUTS.Delegate;\n const data = encodeData(type);\n\n return new Transaction().add({\n keys: [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: votePubkey, isSigner: false, isWritable: false},\n {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: false},\n {\n pubkey: SYSVAR_STAKE_HISTORY_PUBKEY,\n isSigner: false,\n isWritable: false,\n },\n {pubkey: STAKE_CONFIG_ID, isSigner: false, isWritable: false},\n {pubkey: authorizedPubkey, isSigner: true, isWritable: false},\n ],\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a Transaction that authorizes a new PublicKey as Staker\n * or Withdrawer on the Stake account.\n */\n static authorize(params: AuthorizeStakeParams): Transaction {\n const {\n stakePubkey,\n authorizedPubkey,\n newAuthorizedPubkey,\n stakeAuthorizationType,\n custodianPubkey,\n } = params;\n\n const type = STAKE_INSTRUCTION_LAYOUTS.Authorize;\n const data = encodeData(type, {\n newAuthorized: newAuthorizedPubkey.toBuffer(),\n stakeAuthorizationType: stakeAuthorizationType.index,\n });\n\n const keys = [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: true},\n {pubkey: authorizedPubkey, isSigner: true, isWritable: false},\n ];\n if (custodianPubkey) {\n keys.push({pubkey: custodianPubkey, isSigner: false, isWritable: false});\n }\n return new Transaction().add({\n keys,\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a Transaction that authorizes a new PublicKey as Staker\n * or Withdrawer on the Stake account.\n */\n static authorizeWithSeed(params: AuthorizeWithSeedStakeParams): Transaction {\n const {\n stakePubkey,\n authorityBase,\n authoritySeed,\n authorityOwner,\n newAuthorizedPubkey,\n stakeAuthorizationType,\n custodianPubkey,\n } = params;\n\n const type = STAKE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed;\n const data = encodeData(type, {\n newAuthorized: newAuthorizedPubkey.toBuffer(),\n stakeAuthorizationType: stakeAuthorizationType.index,\n authoritySeed: authoritySeed,\n authorityOwner: authorityOwner.toBuffer(),\n });\n\n const keys = [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: authorityBase, isSigner: true, isWritable: false},\n {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: false},\n ];\n if (custodianPubkey) {\n keys.push({pubkey: custodianPubkey, isSigner: false, isWritable: false});\n }\n return new Transaction().add({\n keys,\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a Transaction that splits Stake tokens into another stake account\n */\n static split(params: SplitStakeParams): Transaction {\n const {stakePubkey, authorizedPubkey, splitStakePubkey, lamports} = params;\n\n const transaction = new Transaction();\n transaction.add(\n SystemProgram.createAccount({\n fromPubkey: authorizedPubkey,\n newAccountPubkey: splitStakePubkey,\n lamports: 0,\n space: this.space,\n programId: this.programId,\n }),\n );\n const type = STAKE_INSTRUCTION_LAYOUTS.Split;\n const data = encodeData(type, {lamports});\n\n return transaction.add({\n keys: [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: splitStakePubkey, isSigner: false, isWritable: true},\n {pubkey: authorizedPubkey, isSigner: true, isWritable: false},\n ],\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a Transaction that withdraws deactivated Stake tokens.\n */\n static withdraw(params: WithdrawStakeParams): Transaction {\n const {\n stakePubkey,\n authorizedPubkey,\n toPubkey,\n lamports,\n custodianPubkey,\n } = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Withdraw;\n const data = encodeData(type, {lamports});\n\n const keys = [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: toPubkey, isSigner: false, isWritable: true},\n {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: false},\n {\n pubkey: SYSVAR_STAKE_HISTORY_PUBKEY,\n isSigner: false,\n isWritable: false,\n },\n {pubkey: authorizedPubkey, isSigner: true, isWritable: false},\n ];\n if (custodianPubkey) {\n keys.push({pubkey: custodianPubkey, isSigner: false, isWritable: false});\n }\n return new Transaction().add({\n keys,\n programId: this.programId,\n data,\n });\n }\n\n /**\n * Generate a Transaction that deactivates Stake tokens.\n */\n static deactivate(params: DeactivateStakeParams): Transaction {\n const {stakePubkey, authorizedPubkey} = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Deactivate;\n const data = encodeData(type);\n\n return new Transaction().add({\n keys: [\n {pubkey: stakePubkey, isSigner: false, isWritable: true},\n {pubkey: SYSVAR_CLOCK_PUBKEY, isSigner: false, isWritable: false},\n {pubkey: authorizedPubkey, isSigner: true, isWritable: false},\n ],\n programId: this.programId,\n data,\n });\n }\n}\n","import {Buffer} from 'buffer';\nimport * as BufferLayout from 'buffer-layout';\nimport secp256k1 from 'secp256k1';\nimport assert from 'assert';\nimport {keccak_256} from 'js-sha3';\n\nimport {PublicKey} from './publickey';\nimport {TransactionInstruction} from './transaction';\nimport {toBuffer} from './util/to-buffer';\n\nconst {publicKeyCreate, ecdsaSign} = secp256k1;\n\nconst PRIVATE_KEY_BYTES = 32;\nconst ETHEREUM_ADDRESS_BYTES = 20;\nconst PUBLIC_KEY_BYTES = 64;\nconst SIGNATURE_OFFSETS_SERIALIZED_SIZE = 11;\n\n/**\n * Params for creating an secp256k1 instruction using a public key\n * @typedef {Object} CreateSecp256k1InstructionWithPublicKeyParams\n * @property {Buffer | Uint8Array | Array<number>} publicKey\n * @property {Buffer | Uint8Array | Array<number>} message\n * @property {Buffer | Uint8Array | Array<number>} signature\n * @property {number} recoveryId\n */\nexport type CreateSecp256k1InstructionWithPublicKeyParams = {\n publicKey: Buffer | Uint8Array | Array<number>;\n message: Buffer | Uint8Array | Array<number>;\n signature: Buffer | Uint8Array | Array<number>;\n recoveryId: number;\n};\n\n/**\n * Params for creating an secp256k1 instruction using an Ethereum address\n * @typedef {Object} CreateSecp256k1InstructionWithEthAddressParams\n * @property {Buffer | Uint8Array | Array<number>} ethAddress\n * @property {Buffer | Uint8Array | Array<number>} message\n * @property {Buffer | Uint8Array | Array<number>} signature\n * @property {number} recoveryId\n */\nexport type CreateSecp256k1InstructionWithEthAddressParams = {\n ethAddress: Buffer | Uint8Array | Array<number> | string;\n message: Buffer | Uint8Array | Array<number>;\n signature: Buffer | Uint8Array | Array<number>;\n recoveryId: number;\n};\n\n/**\n * Params for creating an secp256k1 instruction using a private key\n * @typedef {Object} CreateSecp256k1InstructionWithPrivateKeyParams\n * @property {Buffer | Uint8Array | Array<number>} privateKey\n * @property {Buffer | Uint8Array | Array<number>} message\n */\nexport type CreateSecp256k1InstructionWithPrivateKeyParams = {\n privateKey: Buffer | Uint8Array | Array<number>;\n message: Buffer | Uint8Array | Array<number>;\n};\n\nconst SECP256K1_INSTRUCTION_LAYOUT = BufferLayout.struct([\n BufferLayout.u8('numSignatures'),\n BufferLayout.u16('signatureOffset'),\n BufferLayout.u8('signatureInstructionIndex'),\n BufferLayout.u16('ethAddressOffset'),\n BufferLayout.u8('ethAddressInstructionIndex'),\n BufferLayout.u16('messageDataOffset'),\n BufferLayout.u16('messageDataSize'),\n BufferLayout.u8('messageInstructionIndex'),\n BufferLayout.blob(20, 'ethAddress'),\n BufferLayout.blob(64, 'signature'),\n BufferLayout.u8('recoveryId'),\n]);\n\nexport class Secp256k1Program {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the secp256k1 program\n */\n static get programId(): PublicKey {\n return new PublicKey('KeccakSecp256k11111111111111111111111111111');\n }\n\n /**\n * Construct an Ethereum address from a secp256k1 public key buffer.\n * @param {Buffer} publicKey a 64 byte secp256k1 public key buffer\n */\n static publicKeyToEthAddress(\n publicKey: Buffer | Uint8Array | Array<number>,\n ): Buffer {\n assert(\n publicKey.length === PUBLIC_KEY_BYTES,\n `Public key must be ${PUBLIC_KEY_BYTES} bytes but received ${publicKey.length} bytes`,\n );\n\n try {\n return Buffer.from(keccak_256.update(toBuffer(publicKey)).digest()).slice(\n -ETHEREUM_ADDRESS_BYTES,\n );\n } catch (error) {\n throw new Error(`Error constructing Ethereum address: ${error}`);\n }\n }\n\n /**\n * Create an secp256k1 instruction with a public key. The public key\n * must be a buffer that is 64 bytes long.\n */\n static createInstructionWithPublicKey(\n params: CreateSecp256k1InstructionWithPublicKeyParams,\n ): TransactionInstruction {\n const {publicKey, message, signature, recoveryId} = params;\n return Secp256k1Program.createInstructionWithEthAddress({\n ethAddress: Secp256k1Program.publicKeyToEthAddress(publicKey),\n message,\n signature,\n recoveryId,\n });\n }\n\n /**\n * Create an secp256k1 instruction with an Ethereum address. The address\n * must be a hex string or a buffer that is 20 bytes long.\n */\n static createInstructionWithEthAddress(\n params: CreateSecp256k1InstructionWithEthAddressParams,\n ): TransactionInstruction {\n const {ethAddress: rawAddress, message, signature, recoveryId} = params;\n\n let ethAddress;\n if (typeof rawAddress === 'string') {\n if (rawAddress.startsWith('0x')) {\n ethAddress = Buffer.from(rawAddress.substr(2), 'hex');\n } else {\n ethAddress = Buffer.from(rawAddress, 'hex');\n }\n } else {\n ethAddress = rawAddress;\n }\n\n assert(\n ethAddress.length === ETHEREUM_ADDRESS_BYTES,\n `Address must be ${ETHEREUM_ADDRESS_BYTES} bytes but received ${ethAddress.length} bytes`,\n );\n\n const dataStart = 1 + SIGNATURE_OFFSETS_SERIALIZED_SIZE;\n const ethAddressOffset = dataStart;\n const signatureOffset = dataStart + ethAddress.length;\n const messageDataOffset = signatureOffset + signature.length + 1;\n const numSignatures = 1;\n\n const instructionData = Buffer.alloc(\n SECP256K1_INSTRUCTION_LAYOUT.span + message.length,\n );\n\n SECP256K1_INSTRUCTION_LAYOUT.encode(\n {\n numSignatures,\n signatureOffset,\n signatureInstructionIndex: 0,\n ethAddressOffset,\n ethAddressInstructionIndex: 0,\n messageDataOffset,\n messageDataSize: message.length,\n messageInstructionIndex: 0,\n signature: toBuffer(signature),\n ethAddress: toBuffer(ethAddress),\n recoveryId,\n },\n instructionData,\n );\n\n instructionData.fill(toBuffer(message), SECP256K1_INSTRUCTION_LAYOUT.span);\n\n return new TransactionInstruction({\n keys: [],\n programId: Secp256k1Program.programId,\n data: instructionData,\n });\n }\n\n /**\n * Create an secp256k1 instruction with a private key. The private key\n * must be a buffer that is 32 bytes long.\n */\n static createInstructionWithPrivateKey(\n params: CreateSecp256k1InstructionWithPrivateKeyParams,\n ): TransactionInstruction {\n const {privateKey: pkey, message} = params;\n\n assert(\n pkey.length === PRIVATE_KEY_BYTES,\n `Private key must be ${PRIVATE_KEY_BYTES} bytes but received ${pkey.length} bytes`,\n );\n\n let privateKey;\n if (Array.isArray(pkey)) {\n privateKey = Uint8Array.from(pkey);\n } else {\n privateKey = pkey;\n }\n\n try {\n const publicKey = publicKeyCreate(privateKey, false).slice(1); // throw away leading byte\n const messageHash = Buffer.from(\n keccak_256.update(toBuffer(message)).digest(),\n );\n const {signature, recid: recoveryId} = ecdsaSign(messageHash, privateKey);\n\n return this.createInstructionWithPublicKey({\n publicKey,\n message,\n signature,\n recoveryId,\n });\n } catch (error) {\n throw new Error(`Error creating instruction; ${error}`);\n }\n }\n}\n","import {Buffer} from 'buffer';\nimport {\n assert as assertType,\n optional,\n string,\n type as pick,\n} from 'superstruct';\n\nimport * as Layout from './layout';\nimport * as shortvec from './util/shortvec-encoding';\nimport {PublicKey} from './publickey';\nimport {guardedShift, guardedSplice} from './util/guarded-array-utils';\n\nexport const VALIDATOR_INFO_KEY = new PublicKey(\n 'Va1idator1nfo111111111111111111111111111111',\n);\n\n/**\n * @internal\n */\ntype ConfigKey = {\n publicKey: PublicKey;\n isSigner: boolean;\n};\n\n/**\n * Info used to identity validators.\n *\n * @typedef {Object} Info\n * @property {string} name validator name\n * @property {?string} website optional, validator website\n * @property {?string} details optional, extra information the validator chose to share\n * @property {?string} keybaseUsername optional, used to identify validators on keybase.io\n */\nexport type Info = {\n name: string;\n website?: string;\n details?: string;\n keybaseUsername?: string;\n};\n\nconst InfoString = pick({\n name: string(),\n website: optional(string()),\n details: optional(string()),\n keybaseUsername: optional(string()),\n});\n\n/**\n * ValidatorInfo class\n */\nexport class ValidatorInfo {\n /**\n * validator public key\n */\n key: PublicKey;\n /**\n * validator information\n */\n info: Info;\n\n /**\n * Construct a valid ValidatorInfo\n *\n * @param key validator public key\n * @param info validator information\n */\n constructor(key: PublicKey, info: Info) {\n this.key = key;\n this.info = info;\n }\n\n /**\n * Deserialize ValidatorInfo from the config account data. Exactly two config\n * keys are required in the data.\n *\n * @param buffer config account data\n * @return null if info was not found\n */\n static fromConfigData(\n buffer: Buffer | Uint8Array | Array<number>,\n ): ValidatorInfo | null {\n const PUBKEY_LENGTH = 32;\n\n let byteArray = [...buffer];\n const configKeyCount = shortvec.decodeLength(byteArray);\n if (configKeyCount !== 2) return null;\n\n const configKeys: Array<ConfigKey> = [];\n for (let i = 0; i < 2; i++) {\n const publicKey = new PublicKey(\n guardedSplice(byteArray, 0, PUBKEY_LENGTH),\n );\n const isSigner = guardedShift(byteArray) === 1;\n configKeys.push({publicKey, isSigner});\n }\n\n if (configKeys[0].publicKey.equals(VALIDATOR_INFO_KEY)) {\n if (configKeys[1].isSigner) {\n const rawInfo = Layout.rustString().decode(Buffer.from(byteArray));\n const info = JSON.parse(rawInfo);\n assertType(info, InfoString);\n return new ValidatorInfo(configKeys[1].publicKey, info);\n }\n }\n\n return null;\n }\n}\n","import * as BufferLayout from 'buffer-layout';\n\nimport * as Layout from './layout';\nimport {PublicKey} from './publickey';\nimport {toBuffer} from './util/to-buffer';\n\nexport const VOTE_PROGRAM_ID = new PublicKey(\n 'Vote111111111111111111111111111111111111111',\n);\n\nexport type Lockout = {\n slot: number;\n confirmationCount: number;\n};\n\n/**\n * History of how many credits earned by the end of each epoch\n */\nexport type EpochCredits = {\n epoch: number;\n credits: number;\n prevCredits: number;\n};\n\n/**\n * See https://github.com/solana-labs/solana/blob/8a12ed029cfa38d4a45400916c2463fb82bbec8c/programs/vote_api/src/vote_state.rs#L68-L88\n *\n * @internal\n */\nconst VoteAccountLayout = BufferLayout.struct([\n Layout.publicKey('nodePubkey'),\n Layout.publicKey('authorizedVoterPubkey'),\n Layout.publicKey('authorizedWithdrawerPubkey'),\n BufferLayout.u8('commission'),\n BufferLayout.nu64(), // votes.length\n BufferLayout.seq(\n BufferLayout.struct([\n BufferLayout.nu64('slot'),\n BufferLayout.u32('confirmationCount'),\n ]),\n BufferLayout.offset(BufferLayout.u32(), -8),\n 'votes',\n ),\n BufferLayout.u8('rootSlotValid'),\n BufferLayout.nu64('rootSlot'),\n BufferLayout.nu64('epoch'),\n BufferLayout.nu64('credits'),\n BufferLayout.nu64('lastEpochCredits'),\n BufferLayout.nu64(), // epochCredits.length\n BufferLayout.seq(\n BufferLayout.struct([\n BufferLayout.nu64('epoch'),\n BufferLayout.nu64('credits'),\n BufferLayout.nu64('prevCredits'),\n ]),\n BufferLayout.offset(BufferLayout.u32(), -8),\n 'epochCredits',\n ),\n]);\n\ntype VoteAccountArgs = {\n nodePubkey: PublicKey;\n authorizedVoterPubkey: PublicKey;\n authorizedWithdrawerPubkey: PublicKey;\n commission: number;\n votes: Array<Lockout>;\n rootSlot: number | null;\n epoch: number;\n credits: number;\n lastEpochCredits: number;\n epochCredits: Array<EpochCredits>;\n};\n\n/**\n * VoteAccount class\n */\nexport class VoteAccount {\n nodePubkey: PublicKey;\n authorizedVoterPubkey: PublicKey;\n authorizedWithdrawerPubkey: PublicKey;\n commission: number;\n votes: Array<Lockout>;\n rootSlot: number | null;\n epoch: number;\n credits: number;\n lastEpochCredits: number;\n epochCredits: Array<EpochCredits>;\n\n /**\n * @internal\n */\n constructor(args: VoteAccountArgs) {\n this.nodePubkey = args.nodePubkey;\n this.authorizedVoterPubkey = args.authorizedVoterPubkey;\n this.authorizedWithdrawerPubkey = args.authorizedWithdrawerPubkey;\n this.commission = args.commission;\n this.votes = args.votes;\n this.rootSlot = args.rootSlot;\n this.epoch = args.epoch;\n this.credits = args.credits;\n this.lastEpochCredits = args.lastEpochCredits;\n this.epochCredits = args.epochCredits;\n }\n\n /**\n * Deserialize VoteAccount from the account data.\n *\n * @param buffer account data\n * @return VoteAccount\n */\n static fromAccountData(\n buffer: Buffer | Uint8Array | Array<number>,\n ): VoteAccount {\n const va = VoteAccountLayout.decode(toBuffer(buffer), 0);\n\n let rootSlot: number | null = va.rootSlot;\n if (!va.rootSlotValid) {\n rootSlot = null;\n }\n\n return new VoteAccount({\n nodePubkey: new PublicKey(va.nodePubkey),\n authorizedVoterPubkey: new PublicKey(va.authorizedVoterPubkey),\n authorizedWithdrawerPubkey: new PublicKey(va.authorizedWithdrawerPubkey),\n commission: va.commission,\n votes: va.votes,\n rootSlot,\n epoch: va.epoch,\n credits: va.credits,\n lastEpochCredits: va.lastEpochCredits,\n epochCredits: va.epochCredits,\n });\n }\n}\n","import {Connection} from '../connection';\nimport type {TransactionSignature} from '../transaction';\nimport type {ConfirmOptions} from '../connection';\n\n/**\n * Send and confirm a raw transaction\n *\n * If `commitment` option is not specified, defaults to 'max' commitment.\n *\n * @param {Connection} connection\n * @param {Buffer} rawTransaction\n * @param {ConfirmOptions} [options]\n * @returns {Promise<TransactionSignature>}\n */\nexport async function sendAndConfirmRawTransaction(\n connection: Connection,\n rawTransaction: Buffer,\n options?: ConfirmOptions,\n): Promise<TransactionSignature> {\n const sendOptions = options && {\n skipPreflight: options.skipPreflight,\n preflightCommitment: options.preflightCommitment || options.commitment,\n };\n\n const signature = await connection.sendRawTransaction(\n rawTransaction,\n sendOptions,\n );\n\n const status = (\n await connection.confirmTransaction(\n signature,\n options && options.commitment,\n )\n ).value;\n\n if (status.err) {\n throw new Error(\n `Raw transaction ${signature} failed (${JSON.stringify(status)})`,\n );\n }\n\n return signature;\n}\n","const endpoint = {\n http: {\n devnet: 'http://devnet.solana.com',\n testnet: 'http://testnet.solana.com',\n 'mainnet-beta': 'http://api.mainnet-beta.solana.com',\n },\n https: {\n devnet: 'https://devnet.solana.com',\n testnet: 'https://testnet.solana.com',\n 'mainnet-beta': 'https://api.mainnet-beta.solana.com',\n },\n};\n\nexport type Cluster = 'devnet' | 'testnet' | 'mainnet-beta';\n\n/**\n * Retrieves the RPC API URL for the specified cluster\n */\nexport function clusterApiUrl(cluster?: Cluster, tls?: boolean): string {\n const key = tls === false ? 'http' : 'https';\n\n if (!cluster) {\n return endpoint[key]['devnet'];\n }\n\n const url = endpoint[key][cluster];\n if (!url) {\n throw new Error(`Unknown ${key} cluster: ${cluster}`);\n }\n return url;\n}\n","export * from './account';\nexport * from './blockhash';\nexport * from './bpf-loader-deprecated';\nexport * from './bpf-loader';\nexport * from './connection';\nexport * from './fee-calculator';\nexport * from './loader';\nexport * from './message';\nexport * from './nonce-account';\nexport * from './publickey';\nexport * from './stake-program';\nexport * from './system-program';\nexport * from './secp256k1-program';\nexport * from './transaction';\nexport * from './validator-info';\nexport * from './vote-account';\nexport * from './sysvar';\nexport * from './util/send-and-confirm-transaction';\nexport * from './util/send-and-confirm-raw-transaction';\nexport * from './util/cluster';\n\n/**\n * There are 1-billion lamports in one SOL\n */\nexport const LAMPORTS_PER_SOL = 1000000000;\n"],"names":["base64","toBuffer","arr","Buffer","Uint8Array","from","buffer","byteOffset","byteLength","require$$0","basex","MAX_SEED_LENGTH","PublicKey","constructor","value","decoded","bs58","decode","length","Error","_bn","BN","equals","publicKey","eq","toBase58","encode","b","toArrayLike","zeroPad","alloc","copy","toString","createWithSeed","fromPublicKey","seed","programId","concat","hash","sha256","createProgramAddress","seeds","forEach","publicKeyBytes","toArray","undefined","is_on_curve","findProgramAddress","nonce","address","seedsWithNonce","err","naclLowLevel","nacl","lowlevel","p","r","gf","t","chk","num","den","den2","den4","den6","set25519","gf1","unpack25519","S","M","D","Z","A","pow2523","neq25519","I","a","c","d","pack25519","crypto_verify_32","Account","secretKey","_keypair","sign","keyPair","fromSecretKey","BPF_LOADER_DEPRECATED_PROGRAM_ID","inspect","isArray","hasOwnProperty","objectKeys","isBuffer","global","assert","inherits","utilInspect","property","BufferLayout","rustString","rsl","_decode","bind","_encode","offset","data","chars","str","span","authorized","lockup","getAlloc","type","fields","layout","item","decodeLength","bytes","len","size","elem","shift","encodeLength","rem_len","push","END_OF_BUFFER_ERROR_MESSAGE","guardedShift","byteArray","guardedSplice","args","_args$","start","splice","PUBKEY_LENGTH","Message","header","accountKeys","map","account","recentBlockhash","instructions","isAccountWritable","index","numRequiredSignatures","numReadonlySignedAccounts","numReadonlyUnsignedAccounts","serialize","numKeys","keyCount","shortvec","instruction","accounts","programIdIndex","keyIndicesCount","dataCount","keyIndices","dataLength","instructionCount","instructionBuffer","PACKET_DATA_SIZE","instructionBufferLength","instructionLayout","slice","signDataLayout","Layout","transaction","keys","key","signData","accountCount","i","dataSlice","messageArgs","DEFAULT_SIGNATURE","fill","SIGNATURE_LENGTH","TransactionInstruction","opts","Transaction","signature","signatures","Object","assign","add","items","compileMessage","nonceInfo","nonceInstruction","unshift","feePayer","programIds","accountMetas","accountMeta","includes","pubkey","isSigner","isWritable","sort","x","y","checkSigner","checkWritable","uniqueMetas","pubkeyString","uniqueIndex","findIndex","feePayerIndex","payerMeta","console","warn","signedKeys","unsignedKeys","indexOf","meta","invariant","keyIndex","_compile","message","valid","every","pair","serializeMessage","setSigners","signers","seen","Set","filter","has","uniqueSigners","signer","_partialSign","_verifySignatures","partialSign","detached","_addSignature","addSignature","sigpair","verifySignatures","requireAllSignatures","verify","config","_serialize","signatureCount","transactionLength","wireTransaction","keyObj","populate","sigPubkeyPair","some","SYSVAR_CLOCK_PUBKEY","SYSVAR_RECENT_BLOCKHASHES_PUBKEY","SYSVAR_RENT_PUBKEY","SYSVAR_REWARDS_PUBKEY","SYSVAR_STAKE_HISTORY_PUBKEY","SYSVAR_INSTRUCTIONS_PUBKEY","sendAndConfirmTransaction","connection","options","sendOptions","skipPreflight","preflightCommitment","commitment","sendTransaction","status","confirmTransaction","JSON","stringify","sleep","ms","Promise","resolve","setTimeout","encodeData","allocLength","layoutFields","decodeData","FeeCalculatorLayout","NonceAccountLayout","NONCE_ACCOUNT_LENGTH","NonceAccount","authorizedPubkey","feeCalculator","fromAccountData","nonceAccount","SystemInstruction","decodeInstructionType","checkProgramId","instructionTypeLayout","typeIndex","ixType","entries","SYSTEM_INSTRUCTION_LAYOUTS","decodeCreateAccount","checkKeyLength","lamports","space","Create","fromPubkey","newAccountPubkey","decodeTransfer","Transfer","toPubkey","decodeTransferWithSeed","TransferWithSeed","basePubkey","decodeAllocate","Allocate","accountPubkey","decodeAllocateWithSeed","base","AllocateWithSeed","decodeAssign","Assign","decodeAssignWithSeed","AssignWithSeed","decodeCreateWithSeed","CreateWithSeed","decodeNonceInitialize","InitializeNonceAccount","noncePubkey","decodeNonceAdvance","AdvanceNonceAccount","decodeNonceWithdraw","WithdrawNonceAccount","decodeNonceAuthorize","AuthorizeNonceAccount","newAuthorizedPubkey","SystemProgram","expectedLength","freeze","createAccount","params","transfer","createAccountWithSeed","createNonceAccount","initParams","nonceInitialize","instructionData","nonceAdvance","nonceWithdraw","nonceAuthorize","allocate","Loader","chunkSize","getMinNumSignatures","Math","ceil","load","payer","program","balanceNeeded","getMinimumBalanceForRentExemption","programInfo","getAccountInfo","executable","error","owner","dataLayout","array","transactions","_rpcEndpoint","REQUESTS_PER_SECOND","all","BPF_LOADER_PROGRAM_ID","BpfLoader","elf","loaderProgramId","parse","qsParse","qsStringify","NUM_TICKS_PER_SECOND","DEFAULT_TICKS_PER_SLOT","NUM_SLOTS_PER_SECOND","MS_PER_SLOT","promiseTimeout","promise","timeoutMs","timeoutId","timeoutPromise","race","then","result","clearTimeout","PublicKeyFromString","coerce","instance","string","RawAccountDataResult","tuple","literal","BufferFromRawAccountData","BLOCKHASH_CACHE_TIMEOUT_MS","createRpcResult","union","pick","jsonrpc","id","code","unknown","optional","any","UnknownRpcResult","jsonRpcResult","schema","create","jsonRpcResultAndContext","context","slot","number","notificationResultAndContext","GetInflationGovernorResult","foundation","foundationTerm","initial","taper","terminal","GetEpochInfoResult","epoch","slotIndex","slotsInEpoch","absoluteSlot","blockHeight","transactionCount","GetEpochScheduleResult","slotsPerEpoch","leaderScheduleSlotOffset","warmup","boolean","firstNormalEpoch","firstNormalSlot","GetLeaderScheduleResult","record","TransactionErrorResult","nullable","SignatureStatusResult","SignatureReceivedResult","VersionResult","SimulatedTransactionResponseStruct","logs","createRpcClient","url","useHttps","clientBrowser","RpcClient","request","callback","agent","method","body","headers","too_many_requests_retries","res","waitTime","fetch","log","statusText","text","ok","createRpcRequest","client","reject","response","createRpcBatchRequest","requests","batch","methodName","GetInflationGovernorRpcResult","GetEpochInfoRpcResult","GetEpochScheduleRpcResult","GetLeaderScheduleRpcResult","SlotRpcResult","GetSupplyRpcResult","total","circulating","nonCirculating","nonCirculatingAccounts","TokenAmountResult","amount","uiAmount","decimals","uiAmountString","GetTokenLargestAccountsResult","GetTokenAccountsByOwner","rentEpoch","ParsedAccountDataResult","parsed","GetParsedTokenAccountsByOwner","GetLargestAccountsRpcResult","AccountInfoResult","KeyedAccountInfoResult","ParsedOrRawAccountData","Array","ParsedAccountInfoResult","KeyedParsedAccountInfoResult","StakeActivationResult","state","active","inactive","GetConfirmedSignaturesForAddressRpcResult","GetConfirmedSignaturesForAddress2RpcResult","memo","blockTime","AccountNotificationResult","subscription","ProgramAccountInfoResult","ProgramAccountNotificationResult","SlotInfoResult","parent","root","SlotNotificationResult","SignatureNotificationResult","RootNotificationResult","ContactInfoResult","gossip","tpu","rpc","version","VoteAccountInfoResult","votePubkey","nodePubkey","activatedStake","epochVoteAccount","epochCredits","commission","lastVote","rootSlot","GetVoteAccounts","current","delinquent","ConfirmationStatus","SignatureStatusResponse","confirmations","confirmationStatus","GetSignatureStatusesRpcResult","GetMinimumBalanceForRentExemptionRpcResult","ConfirmedTransactionResult","TransactionFromConfirmed","ParsedInstructionResult","RawInstructionResult","InstructionResult","UnknownInstructionResult","ParsedOrRawInstruction","ParsedConfirmedTransactionResult","writable","TokenBalanceResult","accountIndex","mint","uiTokenAmount","ConfirmedTransactionMetaResult","fee","innerInstructions","preBalances","postBalances","logMessages","preTokenBalances","postTokenBalances","ParsedConfirmedTransactionMetaResult","GetConfirmedBlockRpcResult","blockhash","previousBlockhash","parentSlot","rewards","postBalance","rewardType","GetConfirmedTransactionRpcResult","GetParsedConfirmedTransactionRpcResult","GetRecentBlockhashAndContextRpcResult","lamportsPerSignature","PerfSampleResult","numTransactions","numSlots","samplePeriodSecs","GetRecentPerformanceSamplesRpcResult","GetFeeCalculatorRpcResult","RequestAirdropRpcResult","SendTransactionRpcResult","LogsResult","LogsNotificationResult","Connection","endpoint","urlParse","protocol","_rpcClient","href","_rpcRequest","_rpcBatchRequest","_commitment","_blockhashInfo","lastFetch","transactionSignatures","simulatedSignatures","host","port","String","Number","_rpcWebSocket","RpcWebSocketClient","urlFormat","autoconnect","max_reconnects","Infinity","on","_wsOnOpen","_wsOnError","_wsOnClose","_wsOnAccountNotification","_wsOnProgramAccountNotification","_wsOnSlotNotification","_wsOnSignatureNotification","_wsOnRootNotification","_wsOnLogsNotification","getBalanceAndContext","_buildArgs","unsafeRes","getBalance","catch","e","getBlockTime","getMinimumLedgerSlot","getFirstAvailableBlock","getSupply","getTokenSupply","tokenMintAddress","getTokenAccountBalance","tokenAddress","getTokenAccountsByOwner","ownerAddress","_args","getParsedTokenAccountsByOwner","getLargestAccounts","arg","getTokenLargestAccounts","mintAddress","getAccountInfoAndContext","getParsedAccountInfo","getStakeActivation","getProgramAccounts","getParsedProgramAccounts","decodedSignature","Date","now","subscriptionCommitment","subscriptionId","confirmPromise","onSignature","removeSignatureListener","duration","toFixed","getClusterNodes","getVoteAccounts","getSlot","getSlotLeader","getSignatureStatus","values","getSignatureStatuses","getTransactionCount","getTotalSupply","getInflationGovernor","getEpochInfo","getEpochSchedule","getLeaderSchedule","getRecentBlockhashAndContext","getRecentPerformanceSamples","limit","getFeeCalculatorForBlockhash","getRecentBlockhash","getVersion","getConfirmedBlock","getConfirmedTransaction","getParsedConfirmedTransaction","getParsedConfirmedTransactions","getConfirmedSignaturesForAddress","startSlot","endSlot","getConfirmedSignaturesForAddress2","getNonceAndContext","accountInfo","getNonce","requestAirdrop","to","_recentBlockhash","disableCache","_pollingBlockhash","timeSinceFetch","expired","_pollNewBlockhash","startTime","simulateTransaction","_disableBlockhashCaching","encodedTransaction","encoding","sigVerify","sendRawTransaction","rawTransaction","sendEncodedTransaction","traceIndent","logTrace","join","_rpcWebSocketConnected","_rpcWebSocketHeartbeat","setInterval","notify","_updateSubscriptions","clearInterval","_resetSubscriptions","_subscribe","sub","rpcMethod","rpcArgs","call","_unsubscribe","unsubscribeId","_accountChangeSubscriptions","s","_programAccountChangeSubscriptions","_signatureSubscriptions","_slotSubscriptions","_rootSubscriptions","programKeys","slotKeys","signatureKeys","rootKeys","logsKeys","_logsSubscriptions","_rpcWebSocketIdleTimeout","close","connect","mentions","notification","onAccountChange","_accountChangeSubscriptionCounter","removeAccountChangeListener","subInfo","accountId","onProgramAccountChange","_programAccountChangeSubscriptionCounter","removeProgramAccountChangeListener","onLogs","_logsSubscriptionCounter","removeOnLogsListener","onSlotChange","_slotSubscriptionCounter","removeSlotChangeListener","override","extra","_signatureSubscriptionCounter","onSignatureWithOptions","onRootChange","_rootSubscriptionCounter","removeRootChangeListener","STAKE_CONFIG_ID","Authorized","staker","withdrawer","Lockup","unixTimestamp","custodian","StakeInstruction","STAKE_INSTRUCTION_LAYOUTS","decodeInitialize","Initialize","stakePubkey","decodeDelegate","Delegate","decodeAuthorize","newAuthorized","stakeAuthorizationType","Authorize","o","custodianPubkey","decodeAuthorizeWithSeed","authoritySeed","authorityOwner","AuthorizeWithSeed","authorityBase","decodeSplit","Split","splitStakePubkey","decodeWithdraw","Withdraw","decodeDeactivate","Deactivate","StakeProgram","StakeAuthorizationLayout","Staker","Withdrawer","initialize","delegate","authorize","authorizeWithSeed","split","withdraw","deactivate","publicKeyCreate","ecdsaSign","secp256k1","PRIVATE_KEY_BYTES","ETHEREUM_ADDRESS_BYTES","PUBLIC_KEY_BYTES","SIGNATURE_OFFSETS_SERIALIZED_SIZE","SECP256K1_INSTRUCTION_LAYOUT","Secp256k1Program","publicKeyToEthAddress","keccak_256","update","digest","createInstructionWithPublicKey","recoveryId","createInstructionWithEthAddress","ethAddress","rawAddress","startsWith","substr","dataStart","ethAddressOffset","signatureOffset","messageDataOffset","numSignatures","signatureInstructionIndex","ethAddressInstructionIndex","messageDataSize","messageInstructionIndex","createInstructionWithPrivateKey","privateKey","pkey","messageHash","recid","VALIDATOR_INFO_KEY","InfoString","name","website","details","keybaseUsername","ValidatorInfo","info","fromConfigData","configKeyCount","configKeys","rawInfo","assertType","VOTE_PROGRAM_ID","VoteAccountLayout","VoteAccount","authorizedVoterPubkey","authorizedWithdrawerPubkey","votes","credits","lastEpochCredits","va","rootSlotValid","sendAndConfirmRawTransaction","http","devnet","testnet","https","clusterApiUrl","cluster","tls","LAMPORTS_PER_SOL"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,gBAAkB,GAAG,WAAU;AAC/B,iBAAmB,GAAG,YAAW;AACjC,mBAAqB,GAAG,cAAa;AACrC;AACA,IAAI,MAAM,GAAG,GAAE;AACf,IAAI,SAAS,GAAG,GAAE;AAClB,IAAI,GAAG,GAAG,OAAO,UAAU,KAAK,WAAW,GAAG,UAAU,GAAG,MAAK;AAChE;AACA,IAAI,IAAI,GAAG,mEAAkE;AAC7E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE;AACjD,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAC;AACrB,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,EAAC;AACnC,CAAC;AACD;AACA;AACA;AACA,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,GAAE;AACjC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,GAAE;AACjC;AACA,SAAS,OAAO,EAAE,GAAG,EAAE;AACvB,EAAE,IAAI,GAAG,GAAG,GAAG,CAAC,OAAM;AACtB;AACA,EAAE,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE;AACnB,IAAI,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC;AACrE,GAAG;AACH;AACA;AACA;AACA,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,EAAC;AAC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