UNPKG

bitgo

Version:
407 lines (357 loc) • 12.7 kB
/* * [hi-base32]{@link https://github.com/emn178/hi-base32} * * @version 0.5.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT */ /* * [js-sha512]{@link https://github.com/emn178/js-sha512} * * @version 0.8.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2014-2018 * @license MIT */ /* object-assign (c) Sindre Sorhus @license MIT */ /* @preserve * The MIT License (MIT) * * Copyright (c) 2013-2018 Petka Antonov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ /*! * decimal.js v10.4.3 * An arbitrary-precision Decimal type for JavaScript. * https://github.com/MikeMcl/decimal.js * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com> * MIT Licence */ /*! * mustache.js - Logic-less {{mustache}} templates with JavaScript * http://github.com/janl/mustache.js */ /*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version v4.2.8+1e68dce6 */ /*! * @wasmer/wasi * Isomorphic Javascript library for interacting with WASI Modules in Node.js and the Browser. * * @version v1.2.2 * @author Wasmer Engineering Team <engineering@wasmer.io> * @homepage https://github.com/wasmerio/wasmer-js * @repository https://github.com/wasmerio/wasmer-js * @license MIT */ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> * @license MIT */ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <https://feross.org> * @license MIT */ /*! * URI.js - Mutating URLs * * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ * * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * */ /*! * URI.js - Mutating URLs * IPv6 Support * * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ * * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * */ /*! * URI.js - Mutating URLs * Second Level Domain (SLD) Support * * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ * * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * */ /*! * URI.js - Mutating URLs * URI Template Support - http://tools.ietf.org/html/rfc6570 * * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ * * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * */ /*! * depd * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /*! * http-errors * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed */ /*! * is-plain-object <https://github.com/jonschlinkert/is-plain-object> * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ /*! * statuses * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed */ /*! * toidentifier * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed */ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /*! @preserve * * tcomb.js - Type checking and DDD for JavaScript * * The MIT License (MIT) * * Copyright (c) 2014-2016 Giulio Canti * */ /*! For license information please see algosdk.min.js.LICENSE.txt */ /*! For license information please see lib.js.LICENSE.txt */ /*! OpenPGP.js v5.10.1 - 2023-08-29 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */ /*! bignumber.js v4.1.0 https://github.com/MikeMcl/bignumber.js/LICENCE */ /*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */ /*! https://mths.be/punycode v1.4.0 by @mathias */ /*! https://mths.be/punycode v1.4.1 by @mathias */ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! musig-js - MIT License (c) 2022 Brandon Black */ /*! noble-bls12-381 - MIT License (c) Paul Miller (paulmillr.com) */ /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ /*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */ /** * @file Web Cryptography API shim * @author Artem S Vybornov <vybornov@gmail.com> * @license MIT */ /** * @license * Lodash <https://lodash.com/> * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** * @license Long.js (c) 2013 Daniel Wirtz <dcode@dcode.io> * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/Long.js for details */ /** * @license bytebuffer.js (c) 2015 Daniel Wirtz <dcode@dcode.io> * Backing buffer: ArrayBuffer, Accessor: Uint8Array * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/bytebuffer.js for details */ /** * @license long.js (c) 2013 Daniel Wirtz <dcode@dcode.io> * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/long.js for details */ /** * Support for translating between Uint8Array instances and JavaScript * native types. * * {@link module:Layout~Layout|Layout} is the basis of a class * hierarchy that associates property names with sequences of encoded * bytes. * * Layouts are supported for these scalar (numeric) types: * * {@link module:Layout~UInt|Unsigned integers in little-endian * format} with {@link module:Layout.u8|8-bit}, {@link * module:Layout.u16|16-bit}, {@link module:Layout.u24|24-bit}, * {@link module:Layout.u32|32-bit}, {@link * module:Layout.u40|40-bit}, and {@link module:Layout.u48|48-bit} * representation ranges; * * {@link module:Layout~UIntBE|Unsigned integers in big-endian * format} with {@link module:Layout.u16be|16-bit}, {@link * module:Layout.u24be|24-bit}, {@link module:Layout.u32be|32-bit}, * {@link module:Layout.u40be|40-bit}, and {@link * module:Layout.u48be|48-bit} representation ranges; * * {@link module:Layout~Int|Signed integers in little-endian * format} with {@link module:Layout.s8|8-bit}, {@link * module:Layout.s16|16-bit}, {@link module:Layout.s24|24-bit}, * {@link module:Layout.s32|32-bit}, {@link * module:Layout.s40|40-bit}, and {@link module:Layout.s48|48-bit} * representation ranges; * * {@link module:Layout~IntBE|Signed integers in big-endian format} * with {@link module:Layout.s16be|16-bit}, {@link * module:Layout.s24be|24-bit}, {@link module:Layout.s32be|32-bit}, * {@link module:Layout.s40be|40-bit}, and {@link * module:Layout.s48be|48-bit} representation ranges; * * 64-bit integral values that decode to an exact (if magnitude is * less than 2^53) or nearby integral Number in {@link * module:Layout.nu64|unsigned little-endian}, {@link * module:Layout.nu64be|unsigned big-endian}, {@link * module:Layout.ns64|signed little-endian}, and {@link * module:Layout.ns64be|unsigned big-endian} encodings; * * 32-bit floating point values with {@link * module:Layout.f32|little-endian} and {@link * module:Layout.f32be|big-endian} representations; * * 64-bit floating point values with {@link * module:Layout.f64|little-endian} and {@link * module:Layout.f64be|big-endian} representations; * * {@link module:Layout.const|Constants} that take no space in the * encoded expression. * * and for these aggregate types: * * {@link module:Layout.seq|Sequence}s of instances of a {@link * module:Layout~Layout|Layout}, with JavaScript representation as * an Array and constant or data-dependent {@link * module:Layout~Sequence#count|length}; * * {@link module:Layout.struct|Structure}s that aggregate a * heterogeneous sequence of {@link module:Layout~Layout|Layout} * instances, with JavaScript representation as an Object; * * {@link module:Layout.union|Union}s that support multiple {@link * module:Layout~VariantLayout|variant layouts} over a fixed * (padded) or variable (not padded) span of bytes, using an * unsigned integer at the start of the data or a separate {@link * module:Layout.unionLayoutDiscriminator|layout element} to * determine which layout to use when interpreting the buffer * contents; * * {@link module:Layout.bits|BitStructure}s that contain a sequence * of individual {@link * module:Layout~BitStructure#addField|BitField}s packed into an 8, * 16, 24, or 32-bit unsigned integer starting at the least- or * most-significant bit; * * {@link module:Layout.cstr|C strings} of varying length; * * {@link module:Layout.blob|Blobs} of fixed- or variable-{@link * module:Layout~Blob#length|length} raw data. * * All {@link module:Layout~Layout|Layout} instances are immutable * after construction, to prevent internal state from becoming * inconsistent. * * @local Layout * @local ExternalLayout * @local GreedyCount * @local OffsetLayout * @local UInt * @local UIntBE * @local Int * @local IntBE * @local NearUInt64 * @local NearUInt64BE * @local NearInt64 * @local NearInt64BE * @local Float * @local FloatBE * @local Double * @local DoubleBE * @local Sequence * @local Structure * @local UnionDiscriminator * @local UnionLayoutDiscriminator * @local Union * @local VariantLayout * @local BitStructure * @local BitField * @local Boolean * @local Blob * @local CString * @local Constant * @local bindConstructorLayout * @module Layout * @license MIT * @author Peter A. Bigot * @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub} */ /** * [js-sha256]{@link https://github.com/emn178/js-sha256} * * @version 0.9.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2014-2017 * @license MIT */ /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.8.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT */ // @license MIT // @preserve author Alexander Stetsyuk // @preserve author Glenn Rempe <glenn@rempe.us>