@airgap/coinlib-core 0.13.10 → 0.13.11-beta.1

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.
Files changed (644) hide show
  1. package/package.json +6 -3
  2. package/actions/Action.d.ts +0 -24
  3. package/actions/Action.js +0 -119
  4. package/actions/Action.js.map +0 -1
  5. package/actions/LinkedAction.d.ts +0 -10
  6. package/actions/LinkedAction.js +0 -95
  7. package/actions/LinkedAction.js.map +0 -1
  8. package/actions/RepeatableAction.d.ts +0 -8
  9. package/actions/RepeatableAction.js +0 -92
  10. package/actions/RepeatableAction.js.map +0 -1
  11. package/actions/SimpleAction.d.ts +0 -7
  12. package/actions/SimpleAction.js +0 -80
  13. package/actions/SimpleAction.js.map +0 -1
  14. package/actions/StateMachine.d.ts +0 -9
  15. package/actions/StateMachine.js +0 -42
  16. package/actions/StateMachine.js.map +0 -1
  17. package/airgap-coinlib-core.min.js +0 -31685
  18. package/data/KeyPair.d.ts +0 -5
  19. package/data/KeyPair.js +0 -3
  20. package/data/KeyPair.js.map +0 -1
  21. package/data/Lazy.d.ts +0 -14
  22. package/data/Lazy.js +0 -83
  23. package/data/Lazy.js.map +0 -1
  24. package/data/RPCBody.d.ts +0 -7
  25. package/data/RPCBody.js +0 -16
  26. package/data/RPCBody.js.map +0 -1
  27. package/dependencies/src/@stablelib/binary-1.0.1/packages/binary/binary.d.ts +0 -230
  28. package/dependencies/src/@stablelib/binary-1.0.1/packages/binary/binary.js +0 -471
  29. package/dependencies/src/@stablelib/binary-1.0.1/packages/binary/binary.js.map +0 -1
  30. package/dependencies/src/@stablelib/blake2b-1.0.1/packages/blake2b/blake2b.d.ts +0 -76
  31. package/dependencies/src/@stablelib/blake2b-1.0.1/packages/blake2b/blake2b.js +0 -455
  32. package/dependencies/src/@stablelib/blake2b-1.0.1/packages/blake2b/blake2b.js.map +0 -1
  33. package/dependencies/src/@stablelib/ed25519-1.0.3/packages/ed25519/ed25519.d.ts +0 -27
  34. package/dependencies/src/@stablelib/ed25519-1.0.3/packages/ed25519/ed25519.js +0 -848
  35. package/dependencies/src/@stablelib/ed25519-1.0.3/packages/ed25519/ed25519.js.map +0 -1
  36. package/dependencies/src/@stablelib/hash-1.0.1/packages/hash/hash.d.ts +0 -22
  37. package/dependencies/src/@stablelib/hash-1.0.1/packages/hash/hash.js +0 -14
  38. package/dependencies/src/@stablelib/hash-1.0.1/packages/hash/hash.js.map +0 -1
  39. package/dependencies/src/@stablelib/int-1.0.1/packages/int/int.d.ts +0 -29
  40. package/dependencies/src/@stablelib/int-1.0.1/packages/int/int.js +0 -63
  41. package/dependencies/src/@stablelib/int-1.0.1/packages/int/int.js.map +0 -1
  42. package/dependencies/src/@stablelib/random-1.0.2/packages/random/random.d.ts +0 -36
  43. package/dependencies/src/@stablelib/random-1.0.2/packages/random/random.js +0 -87
  44. package/dependencies/src/@stablelib/random-1.0.2/packages/random/random.js.map +0 -1
  45. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/browser.d.ts +0 -8
  46. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/browser.js +0 -33
  47. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/browser.js.map +0 -1
  48. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/index.d.ts +0 -11
  49. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/index.js +0 -5
  50. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/index.js.map +0 -1
  51. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/node.d.ts +0 -8
  52. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/node.js +0 -43
  53. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/node.js.map +0 -1
  54. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/system.d.ts +0 -8
  55. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/system.js +0 -37
  56. package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/system.js.map +0 -1
  57. package/dependencies/src/@stablelib/sha512/packages/sha512/sha512.d.ts +0 -73
  58. package/dependencies/src/@stablelib/sha512/packages/sha512/sha512.js +0 -552
  59. package/dependencies/src/@stablelib/sha512/packages/sha512/sha512.js.map +0 -1
  60. package/dependencies/src/@stablelib/sha512-1.0.1/packages/sha512/sha512.d.ts +0 -73
  61. package/dependencies/src/@stablelib/sha512-1.0.1/packages/sha512/sha512.js +0 -552
  62. package/dependencies/src/@stablelib/sha512-1.0.1/packages/sha512/sha512.js.map +0 -1
  63. package/dependencies/src/@stablelib/wipe-1.0.1/packages/wipe/wipe.d.ts +0 -18
  64. package/dependencies/src/@stablelib/wipe-1.0.1/packages/wipe/wipe.js +0 -29
  65. package/dependencies/src/@stablelib/wipe-1.0.1/packages/wipe/wipe.js.map +0 -1
  66. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/codec.d.ts +0 -57
  67. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/codec.js +0 -384
  68. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/codec.js.map +0 -1
  69. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/constants.d.ts +0 -63
  70. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/constants.js +0 -264
  71. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/constants.js.map +0 -1
  72. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/decoder.d.ts +0 -5
  73. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/decoder.js +0 -82
  74. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/decoder.js.map +0 -1
  75. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/encoder.d.ts +0 -4
  76. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/encoder.js +0 -67
  77. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/encoder.js.map +0 -1
  78. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/error.d.ts +0 -89
  79. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/error.js +0 -169
  80. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/error.js.map +0 -1
  81. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/interface.d.ts +0 -9
  82. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/interface.js +0 -3
  83. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/interface.js.map +0 -1
  84. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/michelson/codec.d.ts +0 -42
  85. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/michelson/codec.js +0 -270
  86. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/michelson/codec.js.map +0 -1
  87. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/codec-proto14.d.ts +0 -15
  88. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/codec-proto14.js +0 -80
  89. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/codec-proto14.js.map +0 -1
  90. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/constants-proto14.d.ts +0 -12
  91. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/constants-proto14.js +0 -184
  92. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/constants-proto14.js.map +0 -1
  93. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/decoder-proto14.d.ts +0 -5
  94. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/decoder-proto14.js +0 -81
  95. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/decoder-proto14.js.map +0 -1
  96. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/encoder-proto14.d.ts +0 -4
  97. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/encoder-proto14.js +0 -76
  98. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/encoder-proto14.js.map +0 -1
  99. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/michelson/codec-proto14.d.ts +0 -14
  100. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/michelson/codec-proto14.js +0 -150
  101. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/michelson/codec-proto14.js.map +0 -1
  102. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/protocols.d.ts +0 -17
  103. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/protocols.js +0 -41
  104. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/protocols.js.map +0 -1
  105. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/schema/operation.d.ts +0 -150
  106. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/schema/operation.js +0 -217
  107. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/schema/operation.js.map +0 -1
  108. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/taquito-local-forging.d.ts +0 -26
  109. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/taquito-local-forging.js +0 -115
  110. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/taquito-local-forging.js.map +0 -1
  111. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/uint8array-consumer.d.ts +0 -9
  112. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/uint8array-consumer.js +0 -35
  113. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/uint8array-consumer.js.map +0 -1
  114. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/utils.d.ts +0 -3
  115. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/utils.js +0 -26
  116. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/utils.js.map +0 -1
  117. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/validator.d.ts +0 -13
  118. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/validator.js +0 -52
  119. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/validator.js.map +0 -1
  120. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/version.d.ts +0 -4
  121. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/version.js +0 -9
  122. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/version.js.map +0 -1
  123. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/opkind.d.ts +0 -34
  124. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/opkind.js +0 -39
  125. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/opkind.js.map +0 -1
  126. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/types.d.ts +0 -1590
  127. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/types.js +0 -35
  128. package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/types.js.map +0 -1
  129. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/constants.d.ts +0 -91
  130. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/constants.js +0 -127
  131. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/constants.js.map +0 -1
  132. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/errors.d.ts +0 -145
  133. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/errors.js +0 -270
  134. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/errors.js.map +0 -1
  135. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/format.d.ts +0 -4
  136. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/format.js +0 -33
  137. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/format.js.map +0 -1
  138. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/taquito-utils.d.ts +0 -163
  139. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/taquito-utils.js +0 -438
  140. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/taquito-utils.js.map +0 -1
  141. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/validators.d.ts +0 -158
  142. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/validators.js +0 -254
  143. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/validators.js.map +0 -1
  144. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/verify-signature.d.ts +0 -24
  145. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/verify-signature.js +0 -126
  146. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/verify-signature.js.map +0 -1
  147. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/version.d.ts +0 -4
  148. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/version.js +0 -9
  149. package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/version.js.map +0 -1
  150. package/dependencies/src/axios-0.19.0/index.d.ts +0 -152
  151. package/dependencies/src/axios-0.19.0/index.js +0 -1
  152. package/dependencies/src/axios-0.19.0/lib/adapters/http.js +0 -275
  153. package/dependencies/src/axios-0.19.0/lib/adapters/xhr.js +0 -174
  154. package/dependencies/src/axios-0.19.0/lib/axios.js +0 -53
  155. package/dependencies/src/axios-0.19.0/lib/cancel/Cancel.js +0 -19
  156. package/dependencies/src/axios-0.19.0/lib/cancel/CancelToken.js +0 -57
  157. package/dependencies/src/axios-0.19.0/lib/cancel/isCancel.js +0 -5
  158. package/dependencies/src/axios-0.19.0/lib/core/Axios.js +0 -86
  159. package/dependencies/src/axios-0.19.0/lib/core/InterceptorManager.js +0 -52
  160. package/dependencies/src/axios-0.19.0/lib/core/createError.js +0 -18
  161. package/dependencies/src/axios-0.19.0/lib/core/dispatchRequest.js +0 -86
  162. package/dependencies/src/axios-0.19.0/lib/core/enhanceError.js +0 -42
  163. package/dependencies/src/axios-0.19.0/lib/core/mergeConfig.js +0 -51
  164. package/dependencies/src/axios-0.19.0/lib/core/settle.js +0 -25
  165. package/dependencies/src/axios-0.19.0/lib/core/transformData.js +0 -20
  166. package/dependencies/src/axios-0.19.0/lib/defaults.js +0 -98
  167. package/dependencies/src/axios-0.19.0/lib/helpers/bind.js +0 -11
  168. package/dependencies/src/axios-0.19.0/lib/helpers/buildURL.js +0 -71
  169. package/dependencies/src/axios-0.19.0/lib/helpers/combineURLs.js +0 -14
  170. package/dependencies/src/axios-0.19.0/lib/helpers/cookies.js +0 -53
  171. package/dependencies/src/axios-0.19.0/lib/helpers/deprecatedMethod.js +0 -24
  172. package/dependencies/src/axios-0.19.0/lib/helpers/isAbsoluteURL.js +0 -14
  173. package/dependencies/src/axios-0.19.0/lib/helpers/isURLSameOrigin.js +0 -68
  174. package/dependencies/src/axios-0.19.0/lib/helpers/normalizeHeaderName.js +0 -12
  175. package/dependencies/src/axios-0.19.0/lib/helpers/parseHeaders.js +0 -53
  176. package/dependencies/src/axios-0.19.0/lib/helpers/spread.js +0 -27
  177. package/dependencies/src/axios-0.19.0/lib/utils.js +0 -334
  178. package/dependencies/src/axios-0.19.0/package.json +0 -85
  179. package/dependencies/src/base-x-3.0.7/src/index.d.ts +0 -10
  180. package/dependencies/src/base-x-3.0.7/src/index.js +0 -120
  181. package/dependencies/src/base64-js-1.3.1/index.js +0 -152
  182. package/dependencies/src/bech32-0.0.3/index.js +0 -139
  183. package/dependencies/src/bech32-1.1.3/index.js +0 -147
  184. package/dependencies/src/big-integer-1.6.45/BigInteger.d.ts +0 -2393
  185. package/dependencies/src/big-integer-1.6.45/BigInteger.js +0 -1452
  186. package/dependencies/src/bigi-1.4.2/lib/bigi.js +0 -1509
  187. package/dependencies/src/bigi-1.4.2/lib/convert.js +0 -91
  188. package/dependencies/src/bigi-1.4.2/lib/index.js +0 -6
  189. package/dependencies/src/bigi-1.4.2/package.json +0 -55
  190. package/dependencies/src/bignumber.js-9.0.0/bignumber.d.ts +0 -1829
  191. package/dependencies/src/bignumber.js-9.0.0/bignumber.js +0 -2902
  192. package/dependencies/src/bip32-2.0.4/src/bip32.js +0 -290
  193. package/dependencies/src/bip32-2.0.4/src/crypto.js +0 -26
  194. package/dependencies/src/bip32-2.0.4/src/index.js +0 -7
  195. package/dependencies/src/bip32-path-0.4.2/index.js +0 -96
  196. package/dependencies/src/bip39-2.5.0/index.js +0 -153
  197. package/dependencies/src/bip39-2.5.0/wordlists/chinese_simplified.json +0 -2050
  198. package/dependencies/src/bip39-2.5.0/wordlists/chinese_traditional.json +0 -2050
  199. package/dependencies/src/bip39-2.5.0/wordlists/english.json +0 -2050
  200. package/dependencies/src/bip39-2.5.0/wordlists/french.json +0 -2050
  201. package/dependencies/src/bip39-2.5.0/wordlists/italian.json +0 -2050
  202. package/dependencies/src/bip39-2.5.0/wordlists/japanese.json +0 -2050
  203. package/dependencies/src/bip39-2.5.0/wordlists/korean.json +0 -2050
  204. package/dependencies/src/bip39-2.5.0/wordlists/spanish.json +0 -2050
  205. package/dependencies/src/bip66-1.1.5/index.js +0 -113
  206. package/dependencies/src/bitcoin-ops-1.4.1/index.json +0 -120
  207. package/dependencies/src/bitcoin-ops-1.4.1/map.js +0 -9
  208. package/dependencies/src/bitcoinjs-message-2.1.1/index.js +0 -157
  209. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/address.js +0 -109
  210. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/block.js +0 -234
  211. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/bufferWriter.js +0 -40
  212. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/bufferutils.js +0 -65
  213. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/coins.js +0 -53
  214. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/crypto.js +0 -43
  215. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/ecdsa.js +0 -161
  216. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/ecpair.js +0 -155
  217. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/ecsignature.js +0 -97
  218. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/fastcurve.js +0 -92
  219. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/hdnode.js +0 -363
  220. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/index.js +0 -24
  221. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/networks.js +0 -214
  222. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/script.js +0 -214
  223. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/script_number.js +0 -68
  224. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/index.js +0 -74
  225. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/multisig/index.js +0 -4
  226. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/multisig/input.js +0 -71
  227. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/multisig/output.js +0 -64
  228. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/nulldata.js +0 -39
  229. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/pubkey/index.js +0 -4
  230. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/pubkey/input.js +0 -39
  231. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/pubkey/output.js +0 -33
  232. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/pubkeyhash/index.js +0 -4
  233. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/pubkeyhash/input.js +0 -51
  234. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/pubkeyhash/output.js +0 -42
  235. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/scripthash/index.js +0 -4
  236. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/scripthash/input.js +0 -84
  237. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/scripthash/output.js +0 -34
  238. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/witnesscommitment/index.js +0 -3
  239. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/witnesscommitment/output.js +0 -42
  240. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/witnesspubkeyhash/index.js +0 -4
  241. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/witnesspubkeyhash/input.js +0 -44
  242. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/witnesspubkeyhash/output.js +0 -33
  243. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/witnessscripthash/index.js +0 -4
  244. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/witnessscripthash/input.js +0 -63
  245. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/templates/witnessscripthash/output.js +0 -33
  246. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/transaction.js +0 -1125
  247. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/transaction_builder.js +0 -892
  248. package/dependencies/src/bitgo-utxo-lib-5d91049fd7a988382df81c8260e244ee56d57aac/src/types.js +0 -55
  249. package/dependencies/src/blake2b-6268e6dd678661e0acc4359e9171b97eb1ebf8ac/index.js +0 -313
  250. package/dependencies/src/blake2b-wasm-193cdb71656c1a6c7f89b05d0327bb9b758d071b/blake2b.js +0 -63
  251. package/dependencies/src/blake2b-wasm-193cdb71656c1a6c7f89b05d0327bb9b758d071b/index.js +0 -128
  252. package/dependencies/src/blakejs-1.1.0/blake2b.js +0 -273
  253. package/dependencies/src/blakejs-1.1.0/blake2s.js +0 -190
  254. package/dependencies/src/blakejs-1.1.0/index.js +0 -15
  255. package/dependencies/src/blakejs-1.1.0/util.js +0 -81
  256. package/dependencies/src/bn.js-4.11.8/lib/bn.js +0 -3427
  257. package/dependencies/src/brorand-1.1.0/index.js +0 -65
  258. package/dependencies/src/bs58-4.0.1/index.js +0 -4
  259. package/dependencies/src/bs58check-2.1.2/base.js +0 -50
  260. package/dependencies/src/bs58check-2.1.2/index.js +0 -12
  261. package/dependencies/src/bs58grscheck-2.1.2/base.js +0 -50
  262. package/dependencies/src/bs58grscheck-2.1.2/index.js +0 -12
  263. package/dependencies/src/buffer-5.6.0/index.d.ts +0 -186
  264. package/dependencies/src/buffer-5.6.0/index.js +0 -1794
  265. package/dependencies/src/buffer-equals-1.0.4/index.js +0 -26
  266. package/dependencies/src/cbor-sync-1.0.4/index.d.ts +0 -11
  267. package/dependencies/src/cbor-sync-1.0.4/index.js +0 -632
  268. package/dependencies/src/cipher-base-1.0.4/index.js +0 -99
  269. package/dependencies/src/cosmjs/index.d.ts +0 -379
  270. package/dependencies/src/cosmjs/index.js +0 -1297
  271. package/dependencies/src/cosmjs/index.js.map +0 -1
  272. package/dependencies/src/create-hash-1.2.0/browser.js +0 -30
  273. package/dependencies/src/create-hash-1.2.0/index.js +0 -1
  274. package/dependencies/src/create-hash-1.2.0/md5.js +0 -5
  275. package/dependencies/src/create-hmac-1.1.4/browser.js +0 -68
  276. package/dependencies/src/create-hmac-1.1.4/index.js +0 -1
  277. package/dependencies/src/create-hmac-1.1.7/browser.js +0 -62
  278. package/dependencies/src/create-hmac-1.1.7/legacy.js +0 -46
  279. package/dependencies/src/cryptocompare-0.5.0/index.js +0 -138
  280. package/dependencies/src/cuint-0.2.2/index.js +0 -2
  281. package/dependencies/src/cuint-0.2.2/lib/uint32.js +0 -451
  282. package/dependencies/src/cuint-0.2.2/lib/uint64.js +0 -648
  283. package/dependencies/src/debug-3.1.0/src/browser.js +0 -195
  284. package/dependencies/src/debug-3.1.0/src/debug.js +0 -225
  285. package/dependencies/src/drbg.js-1.0.1/hash.js +0 -92
  286. package/dependencies/src/drbg.js-1.0.1/hmac.js +0 -71
  287. package/dependencies/src/drbg.js-1.0.1/index.js +0 -4
  288. package/dependencies/src/drbg.js-1.0.1/lib/hash-info.json +0 -27
  289. package/dependencies/src/drbg.js-1.0.1/lib/util.js +0 -36
  290. package/dependencies/src/eciesjs-0.3.9/src/index.d.ts +0 -12
  291. package/dependencies/src/eciesjs-0.3.9/src/index.js +0 -35
  292. package/dependencies/src/eciesjs-0.3.9/src/index.js.map +0 -1
  293. package/dependencies/src/eciesjs-0.3.9/src/keys/PrivateKey.d.ts +0 -12
  294. package/dependencies/src/eciesjs-0.3.9/src/keys/PrivateKey.js +0 -62
  295. package/dependencies/src/eciesjs-0.3.9/src/keys/PrivateKey.js.map +0 -1
  296. package/dependencies/src/eciesjs-0.3.9/src/keys/PublicKey.d.ts +0 -11
  297. package/dependencies/src/eciesjs-0.3.9/src/keys/PublicKey.js +0 -65
  298. package/dependencies/src/eciesjs-0.3.9/src/keys/PublicKey.js.map +0 -1
  299. package/dependencies/src/eciesjs-0.3.9/src/keys/index.d.ts +0 -2
  300. package/dependencies/src/eciesjs-0.3.9/src/keys/index.js +0 -11
  301. package/dependencies/src/eciesjs-0.3.9/src/keys/index.js.map +0 -1
  302. package/dependencies/src/eciesjs-0.3.9/src/utils.d.ts +0 -6
  303. package/dependencies/src/eciesjs-0.3.9/src/utils.js +0 -65
  304. package/dependencies/src/eciesjs-0.3.9/src/utils.js.map +0 -1
  305. package/dependencies/src/ecurve-1.0.6/lib/curve.js +0 -77
  306. package/dependencies/src/ecurve-1.0.6/lib/curves.json +0 -65
  307. package/dependencies/src/ecurve-1.0.6/lib/index.js +0 -10
  308. package/dependencies/src/ecurve-1.0.6/lib/names.js +0 -21
  309. package/dependencies/src/ecurve-1.0.6/lib/point.js +0 -244
  310. package/dependencies/src/elliptic-6.5.1/lib/elliptic/curve/base.js +0 -374
  311. package/dependencies/src/elliptic-6.5.1/lib/elliptic/curve/edwards.js +0 -432
  312. package/dependencies/src/elliptic-6.5.1/lib/elliptic/curve/index.js +0 -8
  313. package/dependencies/src/elliptic-6.5.1/lib/elliptic/curve/mont.js +0 -178
  314. package/dependencies/src/elliptic-6.5.1/lib/elliptic/curve/short.js +0 -937
  315. package/dependencies/src/elliptic-6.5.1/lib/elliptic/curves.js +0 -206
  316. package/dependencies/src/elliptic-6.5.1/lib/elliptic/ec/index.js +0 -241
  317. package/dependencies/src/elliptic-6.5.1/lib/elliptic/ec/key.js +0 -118
  318. package/dependencies/src/elliptic-6.5.1/lib/elliptic/ec/signature.js +0 -134
  319. package/dependencies/src/elliptic-6.5.1/lib/elliptic/eddsa/index.js +0 -118
  320. package/dependencies/src/elliptic-6.5.1/lib/elliptic/eddsa/key.js +0 -95
  321. package/dependencies/src/elliptic-6.5.1/lib/elliptic/eddsa/signature.js +0 -65
  322. package/dependencies/src/elliptic-6.5.1/lib/elliptic/precomputed/secp256k1.js +0 -780
  323. package/dependencies/src/elliptic-6.5.1/lib/elliptic/utils.js +0 -120
  324. package/dependencies/src/elliptic-6.5.1/lib/elliptic.js +0 -13
  325. package/dependencies/src/elliptic-6.5.1/package.json +0 -55
  326. package/dependencies/src/elliptic-6.5.3/lib/elliptic/curve/base.js +0 -376
  327. package/dependencies/src/elliptic-6.5.3/lib/elliptic/curve/edwards.js +0 -432
  328. package/dependencies/src/elliptic-6.5.3/lib/elliptic/curve/index.js +0 -8
  329. package/dependencies/src/elliptic-6.5.3/lib/elliptic/curve/mont.js +0 -178
  330. package/dependencies/src/elliptic-6.5.3/lib/elliptic/curve/short.js +0 -937
  331. package/dependencies/src/elliptic-6.5.3/lib/elliptic/curves.js +0 -206
  332. package/dependencies/src/elliptic-6.5.3/lib/elliptic/ec/index.js +0 -241
  333. package/dependencies/src/elliptic-6.5.3/lib/elliptic/ec/key.js +0 -118
  334. package/dependencies/src/elliptic-6.5.3/lib/elliptic/ec/signature.js +0 -166
  335. package/dependencies/src/elliptic-6.5.3/lib/elliptic/eddsa/index.js +0 -118
  336. package/dependencies/src/elliptic-6.5.3/lib/elliptic/eddsa/key.js +0 -95
  337. package/dependencies/src/elliptic-6.5.3/lib/elliptic/eddsa/signature.js +0 -65
  338. package/dependencies/src/elliptic-6.5.3/lib/elliptic/precomputed/secp256k1.js +0 -780
  339. package/dependencies/src/elliptic-6.5.3/lib/elliptic/utils.js +0 -119
  340. package/dependencies/src/elliptic-6.5.3/lib/elliptic.js +0 -13
  341. package/dependencies/src/elliptic-6.5.3/package.json +0 -55
  342. package/dependencies/src/ethereum-common-0.2.1/bootstrapNodes.json +0 -92
  343. package/dependencies/src/ethereum-common-0.2.1/genesisState.json +0 -8895
  344. package/dependencies/src/ethereum-common-0.2.1/index.js +0 -4
  345. package/dependencies/src/ethereum-common-0.2.1/params.json +0 -245
  346. package/dependencies/src/ethereumjs-tx-1.3.7/index.js +0 -298
  347. package/dependencies/src/ethereumjs-util-5.2.0/index.js +0 -714
  348. package/dependencies/src/ethjs-util-0.1.4/src/index.js +0 -203
  349. package/dependencies/src/follow-redirects-1.5.10/http.js +0 -1
  350. package/dependencies/src/follow-redirects-1.5.10/https.js +0 -1
  351. package/dependencies/src/follow-redirects-1.5.10/index.js +0 -322
  352. package/dependencies/src/futoin-hkdf-1.3.3/hkdf.d.ts +0 -29
  353. package/dependencies/src/futoin-hkdf-1.3.3/hkdf.js +0 -174
  354. package/dependencies/src/groestl-hash-js-ef6a04f1c4d2f0448f0882b5f213ef7a0659baee/index.js +0 -39
  355. package/dependencies/src/groestl-hash-js-ef6a04f1c4d2f0448f0882b5f213ef7a0659baee/lib/groestl.js +0 -1248
  356. package/dependencies/src/groestl-hash-js-ef6a04f1c4d2f0448f0882b5f213ef7a0659baee/lib/helper.js +0 -253
  357. package/dependencies/src/groestl-hash-js-ef6a04f1c4d2f0448f0882b5f213ef7a0659baee/lib/op.js +0 -462
  358. package/dependencies/src/groestlcoinjs-message-2.1.0/index.js +0 -245
  359. package/dependencies/src/hash-base-3.0.4/index.js +0 -95
  360. package/dependencies/src/hash.js-1.1.7/lib/hash/common.js +0 -92
  361. package/dependencies/src/hash.js-1.1.7/lib/hash/hmac.js +0 -47
  362. package/dependencies/src/hash.js-1.1.7/lib/hash/ripemd.js +0 -146
  363. package/dependencies/src/hash.js-1.1.7/lib/hash/sha/1.js +0 -74
  364. package/dependencies/src/hash.js-1.1.7/lib/hash/sha/224.js +0 -30
  365. package/dependencies/src/hash.js-1.1.7/lib/hash/sha/256.js +0 -105
  366. package/dependencies/src/hash.js-1.1.7/lib/hash/sha/384.js +0 -35
  367. package/dependencies/src/hash.js-1.1.7/lib/hash/sha/512.js +0 -330
  368. package/dependencies/src/hash.js-1.1.7/lib/hash/sha/common.js +0 -49
  369. package/dependencies/src/hash.js-1.1.7/lib/hash/sha.js +0 -7
  370. package/dependencies/src/hash.js-1.1.7/lib/hash/utils.js +0 -278
  371. package/dependencies/src/hash.js-1.1.7/lib/hash.js +0 -15
  372. package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.d.ts +0 -15
  373. package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.js +0 -101
  374. package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.js.map +0 -1
  375. package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.d.ts +0 -3
  376. package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.js +0 -37
  377. package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.js.map +0 -1
  378. package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/index.d.ts +0 -1
  379. package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/index.js +0 -34
  380. package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/index.js.map +0 -1
  381. package/dependencies/src/hmac-drbg-1.0.1/lib/hmac-drbg.js +0 -113
  382. package/dependencies/src/idna-uts46-hx-3.4.0/idna-map.js +0 -23865
  383. package/dependencies/src/idna-uts46-hx-3.4.0/index.d.ts +0 -6
  384. package/dependencies/src/idna-uts46-hx-3.4.0/uts46.js +0 -170
  385. package/dependencies/src/ieee754-1.1.13/index.js +0 -84
  386. package/dependencies/src/inherits-2.0.4/inherits.js +0 -9
  387. package/dependencies/src/inherits-2.0.4/inherits_browser.js +0 -27
  388. package/dependencies/src/is-buffer-2.0.3/index.js +0 -11
  389. package/dependencies/src/is-hex-prefixed-1.0.0/src/index.js +0 -13
  390. package/dependencies/src/js-cuint-0.2.2/index.js +0 -2
  391. package/dependencies/src/js-cuint-0.2.2/lib/uint32.js +0 -451
  392. package/dependencies/src/js-cuint-0.2.2/lib/uint64.js +0 -648
  393. package/dependencies/src/keccak-1.0.2/js.js +0 -2
  394. package/dependencies/src/keccak-1.0.2/lib/api/index.js +0 -28
  395. package/dependencies/src/keccak-1.0.2/lib/api/keccak.js +0 -83
  396. package/dependencies/src/keccak-1.0.2/lib/api/shake.js +0 -74
  397. package/dependencies/src/keccak-1.0.2/lib/keccak-state.js +0 -187
  398. package/dependencies/src/keccak-1.0.2/lib/keccak.js +0 -69
  399. package/dependencies/src/md5.js-1.3.5/index.js +0 -146
  400. package/dependencies/src/merkle-lib-2.0.10/fastRoot.js +0 -24
  401. package/dependencies/src/merkle-lib-2.0.10/index.js +0 -34
  402. package/dependencies/src/minimalistic-assert-1.0.1/index.js +0 -11
  403. package/dependencies/src/minimalistic-crypto-utils-1.0.1/lib/utils.js +0 -58
  404. package/dependencies/src/ms-2.1.2/index.js +0 -162
  405. package/dependencies/src/nan-2.14.0/include_dirs.js +0 -1
  406. package/dependencies/src/nanoassert-1.1.0/index.js +0 -22
  407. package/dependencies/src/pako-2.0.3/index.js +0 -18
  408. package/dependencies/src/pako-2.0.3/lib/deflate.js +0 -373
  409. package/dependencies/src/pako-2.0.3/lib/inflate.js +0 -402
  410. package/dependencies/src/pako-2.0.3/lib/utils/common.js +0 -48
  411. package/dependencies/src/pako-2.0.3/lib/utils/strings.js +0 -187
  412. package/dependencies/src/pako-2.0.3/lib/zlib/adler32.js +0 -50
  413. package/dependencies/src/pako-2.0.3/lib/zlib/constants.js +0 -66
  414. package/dependencies/src/pako-2.0.3/lib/zlib/crc32.js +0 -58
  415. package/dependencies/src/pako-2.0.3/lib/zlib/deflate.js +0 -1849
  416. package/dependencies/src/pako-2.0.3/lib/zlib/gzheader.js +0 -58
  417. package/dependencies/src/pako-2.0.3/lib/zlib/inffast.js +0 -347
  418. package/dependencies/src/pako-2.0.3/lib/zlib/inflate.js +0 -1625
  419. package/dependencies/src/pako-2.0.3/lib/zlib/inftrees.js +0 -462
  420. package/dependencies/src/pako-2.0.3/lib/zlib/messages.js +0 -32
  421. package/dependencies/src/pako-2.0.3/lib/zlib/trees.js +0 -1192
  422. package/dependencies/src/pako-2.0.3/lib/zlib/zstream.js +0 -47
  423. package/dependencies/src/pbkdf2-3.0.17/bench/index.js +0 -35
  424. package/dependencies/src/pbkdf2-3.0.17/bench/old.js +0 -47
  425. package/dependencies/src/pbkdf2-3.0.17/browser.js +0 -2
  426. package/dependencies/src/pbkdf2-3.0.17/index.js +0 -31
  427. package/dependencies/src/pbkdf2-3.0.17/lib/async.js +0 -100
  428. package/dependencies/src/pbkdf2-3.0.17/lib/default-encoding.js +0 -10
  429. package/dependencies/src/pbkdf2-3.0.17/lib/precondition.js +0 -28
  430. package/dependencies/src/pbkdf2-3.0.17/lib/sync-browser.js +0 -104
  431. package/dependencies/src/pbkdf2-3.0.17/lib/sync.js +0 -51
  432. package/dependencies/src/punycode-2.1.1/punycode.js +0 -429
  433. package/dependencies/src/pushdata-bitcoin-1.0.1/index.js +0 -77
  434. package/dependencies/src/randombytes-2.1.0/browser.js +0 -50
  435. package/dependencies/src/randombytes-2.1.0/index.js +0 -1
  436. package/dependencies/src/ripemd160-2.0.2/index.js +0 -163
  437. package/dependencies/src/rlp-2.2.3/index.js +0 -230
  438. package/dependencies/src/safe-buffer-5.2.0/index.js +0 -64
  439. package/dependencies/src/secp256k1-3.7.1/elliptic.js +0 -2
  440. package/dependencies/src/secp256k1-3.7.1/lib/assert.js +0 -44
  441. package/dependencies/src/secp256k1-3.7.1/lib/der.js +0 -193
  442. package/dependencies/src/secp256k1-3.7.1/lib/elliptic/index.js +0 -263
  443. package/dependencies/src/secp256k1-3.7.1/lib/index.js +0 -245
  444. package/dependencies/src/secp256k1-3.7.1/lib/messages.json +0 -37
  445. package/dependencies/src/secp256k1-4.0.2/elliptic.js +0 -1
  446. package/dependencies/src/secp256k1-4.0.2/lib/elliptic.js +0 -402
  447. package/dependencies/src/secp256k1-4.0.2/lib/index.js +0 -336
  448. package/dependencies/src/sha.js-2.4.11/hash.js +0 -81
  449. package/dependencies/src/sha.js-2.4.11/index.js +0 -16
  450. package/dependencies/src/sha.js-2.4.11/sha.js +0 -94
  451. package/dependencies/src/sha.js-2.4.11/sha1.js +0 -99
  452. package/dependencies/src/sha.js-2.4.11/sha224.js +0 -53
  453. package/dependencies/src/sha.js-2.4.11/sha256.js +0 -135
  454. package/dependencies/src/sha.js-2.4.11/sha384.js +0 -57
  455. package/dependencies/src/sha.js-2.4.11/sha512.js +0 -260
  456. package/dependencies/src/strip-hex-prefix-1.0.0/src/index.js +0 -14
  457. package/dependencies/src/tiny-secp256k1-1.1.3/js.js +0 -276
  458. package/dependencies/src/tiny-secp256k1-1.1.3/rfc6979.js +0 -62
  459. package/dependencies/src/tweetnacl-1.0.1/nacl.d.ts +0 -98
  460. package/dependencies/src/tweetnacl-1.0.1/nacl.js +0 -1164
  461. package/dependencies/src/tweetnacl-auth-1.0.1/nacl-auth.js +0 -47
  462. package/dependencies/src/typedarray-to-buffer-4.0.0/index.js +0 -17
  463. package/dependencies/src/typeforce-1.18.0/errors.js +0 -110
  464. package/dependencies/src/typeforce-1.18.0/extra.js +0 -91
  465. package/dependencies/src/typeforce-1.18.0/index.js +0 -260
  466. package/dependencies/src/typeforce-1.18.0/native.js +0 -21
  467. package/dependencies/src/unorm-1.6.0/lib/unorm.js +0 -452
  468. package/dependencies/src/utf8-3.0.0/utf8.js +0 -202
  469. package/dependencies/src/validate.js-0.13.1/validate.d.ts +0 -55
  470. package/dependencies/src/validate.js-0.13.1/validate.js +0 -1253
  471. package/dependencies/src/varuint-bitcoin-1.1.2/index.d.ts +0 -13
  472. package/dependencies/src/varuint-bitcoin-1.1.2/index.js +0 -90
  473. package/dependencies/src/wif-2.0.6/index.js +0 -63
  474. package/dependencies/src/xxhashjs-0.2.2/lib/index.js +0 -4
  475. package/dependencies/src/xxhashjs-0.2.2/lib/xxhash.js +0 -389
  476. package/dependencies/src/xxhashjs-0.2.2/lib/xxhash64.js +0 -444
  477. package/errors/coinlib-error.d.ts +0 -30
  478. package/errors/coinlib-error.js +0 -62
  479. package/errors/coinlib-error.js.map +0 -1
  480. package/errors/index.d.ts +0 -156
  481. package/errors/index.js +0 -281
  482. package/errors/index.js.map +0 -1
  483. package/errors/network.d.ts +0 -0
  484. package/errors/network.js +0 -2
  485. package/errors/network.js.map +0 -1
  486. package/index.d.ts +0 -33
  487. package/index.js +0 -58
  488. package/index.js.map +0 -1
  489. package/interfaces/IAirGapAddress.d.ts +0 -10
  490. package/interfaces/IAirGapAddress.js +0 -3
  491. package/interfaces/IAirGapAddress.js.map +0 -1
  492. package/interfaces/IAirGapSignedTransaction.d.ts +0 -1
  493. package/interfaces/IAirGapSignedTransaction.js +0 -3
  494. package/interfaces/IAirGapSignedTransaction.js.map +0 -1
  495. package/interfaces/IAirGapTransaction.d.ts +0 -53
  496. package/interfaces/IAirGapTransaction.js +0 -22
  497. package/interfaces/IAirGapTransaction.js.map +0 -1
  498. package/interfaces/IAirGapWallet.d.ts +0 -6
  499. package/interfaces/IAirGapWallet.js +0 -3
  500. package/interfaces/IAirGapWallet.js.map +0 -1
  501. package/interfaces/JSONConvertible.d.ts +0 -3
  502. package/interfaces/JSONConvertible.js +0 -3
  503. package/interfaces/JSONConvertible.js.map +0 -1
  504. package/interfaces/RPCConvertible.d.ts +0 -3
  505. package/interfaces/RPCConvertible.js +0 -3
  506. package/interfaces/RPCConvertible.js.map +0 -1
  507. package/networks.d.ts +0 -19
  508. package/networks.js +0 -1341
  509. package/networks.js.map +0 -1
  510. package/protocols/BlockExplorerProtocol.d.ts +0 -6
  511. package/protocols/BlockExplorerProtocol.js +0 -60
  512. package/protocols/BlockExplorerProtocol.js.map +0 -1
  513. package/protocols/CryptoClient.d.ts +0 -15
  514. package/protocols/CryptoClient.js +0 -84
  515. package/protocols/CryptoClient.js.map +0 -1
  516. package/protocols/Ed25519CryptoClient.d.ts +0 -8
  517. package/protocols/Ed25519CryptoClient.js +0 -107
  518. package/protocols/Ed25519CryptoClient.js.map +0 -1
  519. package/protocols/HasConfigurableContract.d.ts +0 -4
  520. package/protocols/HasConfigurableContract.js +0 -3
  521. package/protocols/HasConfigurableContract.js.map +0 -1
  522. package/protocols/ICoinBaseProtocol.d.ts +0 -107
  523. package/protocols/ICoinBaseProtocol.js +0 -3
  524. package/protocols/ICoinBaseProtocol.js.map +0 -1
  525. package/protocols/ICoinDelegateProtocol.d.ts +0 -40
  526. package/protocols/ICoinDelegateProtocol.js +0 -3
  527. package/protocols/ICoinDelegateProtocol.js.map +0 -1
  528. package/protocols/ICoinOfflineProtocol.d.ts +0 -24
  529. package/protocols/ICoinOfflineProtocol.js +0 -3
  530. package/protocols/ICoinOfflineProtocol.js.map +0 -1
  531. package/protocols/ICoinOnlineProtocol.d.ts +0 -46
  532. package/protocols/ICoinOnlineProtocol.js +0 -3
  533. package/protocols/ICoinOnlineProtocol.js.map +0 -1
  534. package/protocols/ICoinProtocol.d.ts +0 -9
  535. package/protocols/ICoinProtocol.js +0 -3
  536. package/protocols/ICoinProtocol.js.map +0 -1
  537. package/protocols/ICoinSubProtocol.d.ts +0 -22
  538. package/protocols/ICoinSubProtocol.js +0 -9
  539. package/protocols/ICoinSubProtocol.js.map +0 -1
  540. package/protocols/NonExtendedProtocol.d.ts +0 -17
  541. package/protocols/NonExtendedProtocol.js +0 -49
  542. package/protocols/NonExtendedProtocol.js.map +0 -1
  543. package/protocols/Secp256k1CryptoClient.d.ts +0 -8
  544. package/protocols/Secp256k1CryptoClient.js +0 -79
  545. package/protocols/Secp256k1CryptoClient.js.map +0 -1
  546. package/protocols/Sr25519CryptoClient.d.ts +0 -8
  547. package/protocols/Sr25519CryptoClient.js +0 -82
  548. package/protocols/Sr25519CryptoClient.js.map +0 -1
  549. package/types/signed-transaction.d.ts +0 -4
  550. package/types/signed-transaction.js +0 -3
  551. package/types/signed-transaction.js.map +0 -1
  552. package/types/unsigned-transaction.d.ts +0 -5
  553. package/types/unsigned-transaction.js +0 -3
  554. package/types/unsigned-transaction.js.map +0 -1
  555. package/utils/AES.d.ts +0 -10
  556. package/utils/AES.js +0 -165
  557. package/utils/AES.js.map +0 -1
  558. package/utils/ErrorWithData.d.ts +0 -4
  559. package/utils/ErrorWithData.js +0 -29
  560. package/utils/ErrorWithData.js.map +0 -1
  561. package/utils/Network.d.ts +0 -2
  562. package/utils/Network.js +0 -8
  563. package/utils/Network.js.map +0 -1
  564. package/utils/ProtocolBlockExplorer.d.ts +0 -6
  565. package/utils/ProtocolBlockExplorer.js +0 -11
  566. package/utils/ProtocolBlockExplorer.js.map +0 -1
  567. package/utils/ProtocolNetwork.d.ts +0 -15
  568. package/utils/ProtocolNetwork.js +0 -35
  569. package/utils/ProtocolNetwork.js.map +0 -1
  570. package/utils/ProtocolOptions.d.ts +0 -5
  571. package/utils/ProtocolOptions.js +0 -3
  572. package/utils/ProtocolOptions.js.map +0 -1
  573. package/utils/ProtocolSymbols.d.ts +0 -45
  574. package/utils/ProtocolSymbols.js +0 -59
  575. package/utils/ProtocolSymbols.js.map +0 -1
  576. package/utils/array.d.ts +0 -4
  577. package/utils/array.js +0 -36
  578. package/utils/array.js.map +0 -1
  579. package/utils/assert.d.ts +0 -2
  580. package/utils/assert.js +0 -20
  581. package/utils/assert.js.map +0 -1
  582. package/utils/base64Check.d.ts +0 -7
  583. package/utils/base64Check.js +0 -39
  584. package/utils/base64Check.js.map +0 -1
  585. package/utils/blake2b.d.ts +0 -7
  586. package/utils/blake2b.js +0 -23
  587. package/utils/blake2b.js.map +0 -1
  588. package/utils/buffer.d.ts +0 -2
  589. package/utils/buffer.js +0 -8
  590. package/utils/buffer.js.map +0 -1
  591. package/utils/cache.d.ts +0 -15
  592. package/utils/cache.js +0 -97
  593. package/utils/cache.js.map +0 -1
  594. package/utils/error.d.ts +0 -1
  595. package/utils/error.js +0 -8
  596. package/utils/error.js.map +0 -1
  597. package/utils/hex.d.ts +0 -14
  598. package/utils/hex.js +0 -112
  599. package/utils/hex.js.map +0 -1
  600. package/utils/interfaces.d.ts +0 -3
  601. package/utils/interfaces.js +0 -18
  602. package/utils/interfaces.js.map +0 -1
  603. package/utils/object.d.ts +0 -1
  604. package/utils/object.js +0 -23
  605. package/utils/object.js.map +0 -1
  606. package/utils/padStart.d.ts +0 -1
  607. package/utils/padStart.js +0 -20
  608. package/utils/padStart.js.map +0 -1
  609. package/utils/remote-data/HttpRemoteData.d.ts +0 -8
  610. package/utils/remote-data/HttpRemoteData.js +0 -117
  611. package/utils/remote-data/HttpRemoteData.js.map +0 -1
  612. package/utils/remote-data/IpfsRemoteData.d.ts +0 -8
  613. package/utils/remote-data/IpfsRemoteData.js +0 -142
  614. package/utils/remote-data/IpfsRemoteData.js.map +0 -1
  615. package/utils/remote-data/RemoteData.d.ts +0 -11
  616. package/utils/remote-data/RemoteData.js +0 -11
  617. package/utils/remote-data/RemoteData.js.map +0 -1
  618. package/utils/remote-data/RemoteDataFactory.d.ts +0 -11
  619. package/utils/remote-data/RemoteDataFactory.js +0 -29
  620. package/utils/remote-data/RemoteDataFactory.js.map +0 -1
  621. package/utils/remote-data/Sha256RemoteData.d.ts +0 -11
  622. package/utils/remote-data/Sha256RemoteData.js +0 -139
  623. package/utils/remote-data/Sha256RemoteData.js.map +0 -1
  624. package/utils/string.d.ts +0 -7
  625. package/utils/string.js +0 -50
  626. package/utils/string.js.map +0 -1
  627. package/utils/type.d.ts +0 -1
  628. package/utils/type.js +0 -16
  629. package/utils/type.js.map +0 -1
  630. package/utils/xxhash.d.ts +0 -5
  631. package/utils/xxhash.js +0 -18
  632. package/utils/xxhash.js.map +0 -1
  633. package/wallet/AirGapCoinWallet.d.ts +0 -19
  634. package/wallet/AirGapCoinWallet.js +0 -199
  635. package/wallet/AirGapCoinWallet.js.map +0 -1
  636. package/wallet/AirGapMarketWallet.d.ts +0 -40
  637. package/wallet/AirGapMarketWallet.js +0 -221
  638. package/wallet/AirGapMarketWallet.js.map +0 -1
  639. package/wallet/AirGapNFTWallet.d.ts +0 -15
  640. package/wallet/AirGapNFTWallet.js +0 -179
  641. package/wallet/AirGapNFTWallet.js.map +0 -1
  642. package/wallet/AirGapWallet.d.ts +0 -35
  643. package/wallet/AirGapWallet.js +0 -142
  644. package/wallet/AirGapWallet.js.map +0 -1
@@ -1,1452 +0,0 @@
1
- var bigInt = (function (undefined) {
2
- "use strict";
3
-
4
- var BASE = 1e7,
5
- LOG_BASE = 7,
6
- MAX_INT = 9007199254740992,
7
- MAX_INT_ARR = smallToArray(MAX_INT),
8
- DEFAULT_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
9
-
10
- var supportsNativeBigInt = typeof BigInt === "function";
11
-
12
- function Integer(v, radix, alphabet, caseSensitive) {
13
- if (typeof v === "undefined") return Integer[0];
14
- if (typeof radix !== "undefined") return +radix === 10 && !alphabet ? parseValue(v) : parseBase(v, radix, alphabet, caseSensitive);
15
- return parseValue(v);
16
- }
17
-
18
- function BigInteger(value, sign) {
19
- this.value = value;
20
- this.sign = sign;
21
- this.isSmall = false;
22
- }
23
- BigInteger.prototype = Object.create(Integer.prototype);
24
-
25
- function SmallInteger(value) {
26
- this.value = value;
27
- this.sign = value < 0;
28
- this.isSmall = true;
29
- }
30
- SmallInteger.prototype = Object.create(Integer.prototype);
31
-
32
- function NativeBigInt(value) {
33
- this.value = value;
34
- }
35
- NativeBigInt.prototype = Object.create(Integer.prototype);
36
-
37
- function isPrecise(n) {
38
- return -MAX_INT < n && n < MAX_INT;
39
- }
40
-
41
- function smallToArray(n) { // For performance reasons doesn't reference BASE, need to change this function if BASE changes
42
- if (n < 1e7)
43
- return [n];
44
- if (n < 1e14)
45
- return [n % 1e7, Math.floor(n / 1e7)];
46
- return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)];
47
- }
48
-
49
- function arrayToSmall(arr) { // If BASE changes this function may need to change
50
- trim(arr);
51
- var length = arr.length;
52
- if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) {
53
- switch (length) {
54
- case 0: return 0;
55
- case 1: return arr[0];
56
- case 2: return arr[0] + arr[1] * BASE;
57
- default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE;
58
- }
59
- }
60
- return arr;
61
- }
62
-
63
- function trim(v) {
64
- var i = v.length;
65
- while (v[--i] === 0);
66
- v.length = i + 1;
67
- }
68
-
69
- function createArray(length) { // function shamelessly stolen from Yaffle's library https://github.com/Yaffle/BigInteger
70
- var x = new Array(length);
71
- var i = -1;
72
- while (++i < length) {
73
- x[i] = 0;
74
- }
75
- return x;
76
- }
77
-
78
- function truncate(n) {
79
- if (n > 0) return Math.floor(n);
80
- return Math.ceil(n);
81
- }
82
-
83
- function add(a, b) { // assumes a and b are arrays with a.length >= b.length
84
- var l_a = a.length,
85
- l_b = b.length,
86
- r = new Array(l_a),
87
- carry = 0,
88
- base = BASE,
89
- sum, i;
90
- for (i = 0; i < l_b; i++) {
91
- sum = a[i] + b[i] + carry;
92
- carry = sum >= base ? 1 : 0;
93
- r[i] = sum - carry * base;
94
- }
95
- while (i < l_a) {
96
- sum = a[i] + carry;
97
- carry = sum === base ? 1 : 0;
98
- r[i++] = sum - carry * base;
99
- }
100
- if (carry > 0) r.push(carry);
101
- return r;
102
- }
103
-
104
- function addAny(a, b) {
105
- if (a.length >= b.length) return add(a, b);
106
- return add(b, a);
107
- }
108
-
109
- function addSmall(a, carry) { // assumes a is array, carry is number with 0 <= carry < MAX_INT
110
- var l = a.length,
111
- r = new Array(l),
112
- base = BASE,
113
- sum, i;
114
- for (i = 0; i < l; i++) {
115
- sum = a[i] - base + carry;
116
- carry = Math.floor(sum / base);
117
- r[i] = sum - carry * base;
118
- carry += 1;
119
- }
120
- while (carry > 0) {
121
- r[i++] = carry % base;
122
- carry = Math.floor(carry / base);
123
- }
124
- return r;
125
- }
126
-
127
- BigInteger.prototype.add = function (v) {
128
- var n = parseValue(v);
129
- if (this.sign !== n.sign) {
130
- return this.subtract(n.negate());
131
- }
132
- var a = this.value, b = n.value;
133
- if (n.isSmall) {
134
- return new BigInteger(addSmall(a, Math.abs(b)), this.sign);
135
- }
136
- return new BigInteger(addAny(a, b), this.sign);
137
- };
138
- BigInteger.prototype.plus = BigInteger.prototype.add;
139
-
140
- SmallInteger.prototype.add = function (v) {
141
- var n = parseValue(v);
142
- var a = this.value;
143
- if (a < 0 !== n.sign) {
144
- return this.subtract(n.negate());
145
- }
146
- var b = n.value;
147
- if (n.isSmall) {
148
- if (isPrecise(a + b)) return new SmallInteger(a + b);
149
- b = smallToArray(Math.abs(b));
150
- }
151
- return new BigInteger(addSmall(b, Math.abs(a)), a < 0);
152
- };
153
- SmallInteger.prototype.plus = SmallInteger.prototype.add;
154
-
155
- NativeBigInt.prototype.add = function (v) {
156
- return new NativeBigInt(this.value + parseValue(v).value);
157
- }
158
- NativeBigInt.prototype.plus = NativeBigInt.prototype.add;
159
-
160
- function subtract(a, b) { // assumes a and b are arrays with a >= b
161
- var a_l = a.length,
162
- b_l = b.length,
163
- r = new Array(a_l),
164
- borrow = 0,
165
- base = BASE,
166
- i, difference;
167
- for (i = 0; i < b_l; i++) {
168
- difference = a[i] - borrow - b[i];
169
- if (difference < 0) {
170
- difference += base;
171
- borrow = 1;
172
- } else borrow = 0;
173
- r[i] = difference;
174
- }
175
- for (i = b_l; i < a_l; i++) {
176
- difference = a[i] - borrow;
177
- if (difference < 0) difference += base;
178
- else {
179
- r[i++] = difference;
180
- break;
181
- }
182
- r[i] = difference;
183
- }
184
- for (; i < a_l; i++) {
185
- r[i] = a[i];
186
- }
187
- trim(r);
188
- return r;
189
- }
190
-
191
- function subtractAny(a, b, sign) {
192
- var value;
193
- if (compareAbs(a, b) >= 0) {
194
- value = subtract(a, b);
195
- } else {
196
- value = subtract(b, a);
197
- sign = !sign;
198
- }
199
- value = arrayToSmall(value);
200
- if (typeof value === "number") {
201
- if (sign) value = -value;
202
- return new SmallInteger(value);
203
- }
204
- return new BigInteger(value, sign);
205
- }
206
-
207
- function subtractSmall(a, b, sign) { // assumes a is array, b is number with 0 <= b < MAX_INT
208
- var l = a.length,
209
- r = new Array(l),
210
- carry = -b,
211
- base = BASE,
212
- i, difference;
213
- for (i = 0; i < l; i++) {
214
- difference = a[i] + carry;
215
- carry = Math.floor(difference / base);
216
- difference %= base;
217
- r[i] = difference < 0 ? difference + base : difference;
218
- }
219
- r = arrayToSmall(r);
220
- if (typeof r === "number") {
221
- if (sign) r = -r;
222
- return new SmallInteger(r);
223
- } return new BigInteger(r, sign);
224
- }
225
-
226
- BigInteger.prototype.subtract = function (v) {
227
- var n = parseValue(v);
228
- if (this.sign !== n.sign) {
229
- return this.add(n.negate());
230
- }
231
- var a = this.value, b = n.value;
232
- if (n.isSmall)
233
- return subtractSmall(a, Math.abs(b), this.sign);
234
- return subtractAny(a, b, this.sign);
235
- };
236
- BigInteger.prototype.minus = BigInteger.prototype.subtract;
237
-
238
- SmallInteger.prototype.subtract = function (v) {
239
- var n = parseValue(v);
240
- var a = this.value;
241
- if (a < 0 !== n.sign) {
242
- return this.add(n.negate());
243
- }
244
- var b = n.value;
245
- if (n.isSmall) {
246
- return new SmallInteger(a - b);
247
- }
248
- return subtractSmall(b, Math.abs(a), a >= 0);
249
- };
250
- SmallInteger.prototype.minus = SmallInteger.prototype.subtract;
251
-
252
- NativeBigInt.prototype.subtract = function (v) {
253
- return new NativeBigInt(this.value - parseValue(v).value);
254
- }
255
- NativeBigInt.prototype.minus = NativeBigInt.prototype.subtract;
256
-
257
- BigInteger.prototype.negate = function () {
258
- return new BigInteger(this.value, !this.sign);
259
- };
260
- SmallInteger.prototype.negate = function () {
261
- var sign = this.sign;
262
- var small = new SmallInteger(-this.value);
263
- small.sign = !sign;
264
- return small;
265
- };
266
- NativeBigInt.prototype.negate = function () {
267
- return new NativeBigInt(-this.value);
268
- }
269
-
270
- BigInteger.prototype.abs = function () {
271
- return new BigInteger(this.value, false);
272
- };
273
- SmallInteger.prototype.abs = function () {
274
- return new SmallInteger(Math.abs(this.value));
275
- };
276
- NativeBigInt.prototype.abs = function () {
277
- return new NativeBigInt(this.value >= 0 ? this.value : -this.value);
278
- }
279
-
280
-
281
- function multiplyLong(a, b) {
282
- var a_l = a.length,
283
- b_l = b.length,
284
- l = a_l + b_l,
285
- r = createArray(l),
286
- base = BASE,
287
- product, carry, i, a_i, b_j;
288
- for (i = 0; i < a_l; ++i) {
289
- a_i = a[i];
290
- for (var j = 0; j < b_l; ++j) {
291
- b_j = b[j];
292
- product = a_i * b_j + r[i + j];
293
- carry = Math.floor(product / base);
294
- r[i + j] = product - carry * base;
295
- r[i + j + 1] += carry;
296
- }
297
- }
298
- trim(r);
299
- return r;
300
- }
301
-
302
- function multiplySmall(a, b) { // assumes a is array, b is number with |b| < BASE
303
- var l = a.length,
304
- r = new Array(l),
305
- base = BASE,
306
- carry = 0,
307
- product, i;
308
- for (i = 0; i < l; i++) {
309
- product = a[i] * b + carry;
310
- carry = Math.floor(product / base);
311
- r[i] = product - carry * base;
312
- }
313
- while (carry > 0) {
314
- r[i++] = carry % base;
315
- carry = Math.floor(carry / base);
316
- }
317
- return r;
318
- }
319
-
320
- function shiftLeft(x, n) {
321
- var r = [];
322
- while (n-- > 0) r.push(0);
323
- return r.concat(x);
324
- }
325
-
326
- function multiplyKaratsuba(x, y) {
327
- var n = Math.max(x.length, y.length);
328
-
329
- if (n <= 30) return multiplyLong(x, y);
330
- n = Math.ceil(n / 2);
331
-
332
- var b = x.slice(n),
333
- a = x.slice(0, n),
334
- d = y.slice(n),
335
- c = y.slice(0, n);
336
-
337
- var ac = multiplyKaratsuba(a, c),
338
- bd = multiplyKaratsuba(b, d),
339
- abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d));
340
-
341
- var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n));
342
- trim(product);
343
- return product;
344
- }
345
-
346
- // The following function is derived from a surface fit of a graph plotting the performance difference
347
- // between long multiplication and karatsuba multiplication versus the lengths of the two arrays.
348
- function useKaratsuba(l1, l2) {
349
- return -0.012 * l1 - 0.012 * l2 + 0.000015 * l1 * l2 > 0;
350
- }
351
-
352
- BigInteger.prototype.multiply = function (v) {
353
- var n = parseValue(v),
354
- a = this.value, b = n.value,
355
- sign = this.sign !== n.sign,
356
- abs;
357
- if (n.isSmall) {
358
- if (b === 0) return Integer[0];
359
- if (b === 1) return this;
360
- if (b === -1) return this.negate();
361
- abs = Math.abs(b);
362
- if (abs < BASE) {
363
- return new BigInteger(multiplySmall(a, abs), sign);
364
- }
365
- b = smallToArray(abs);
366
- }
367
- if (useKaratsuba(a.length, b.length)) // Karatsuba is only faster for certain array sizes
368
- return new BigInteger(multiplyKaratsuba(a, b), sign);
369
- return new BigInteger(multiplyLong(a, b), sign);
370
- };
371
-
372
- BigInteger.prototype.times = BigInteger.prototype.multiply;
373
-
374
- function multiplySmallAndArray(a, b, sign) { // a >= 0
375
- if (a < BASE) {
376
- return new BigInteger(multiplySmall(b, a), sign);
377
- }
378
- return new BigInteger(multiplyLong(b, smallToArray(a)), sign);
379
- }
380
- SmallInteger.prototype._multiplyBySmall = function (a) {
381
- if (isPrecise(a.value * this.value)) {
382
- return new SmallInteger(a.value * this.value);
383
- }
384
- return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign);
385
- };
386
- BigInteger.prototype._multiplyBySmall = function (a) {
387
- if (a.value === 0) return Integer[0];
388
- if (a.value === 1) return this;
389
- if (a.value === -1) return this.negate();
390
- return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign);
391
- };
392
- SmallInteger.prototype.multiply = function (v) {
393
- return parseValue(v)._multiplyBySmall(this);
394
- };
395
- SmallInteger.prototype.times = SmallInteger.prototype.multiply;
396
-
397
- NativeBigInt.prototype.multiply = function (v) {
398
- return new NativeBigInt(this.value * parseValue(v).value);
399
- }
400
- NativeBigInt.prototype.times = NativeBigInt.prototype.multiply;
401
-
402
- function square(a) {
403
- //console.assert(2 * BASE * BASE < MAX_INT);
404
- var l = a.length,
405
- r = createArray(l + l),
406
- base = BASE,
407
- product, carry, i, a_i, a_j;
408
- for (i = 0; i < l; i++) {
409
- a_i = a[i];
410
- carry = 0 - a_i * a_i;
411
- for (var j = i; j < l; j++) {
412
- a_j = a[j];
413
- product = 2 * (a_i * a_j) + r[i + j] + carry;
414
- carry = Math.floor(product / base);
415
- r[i + j] = product - carry * base;
416
- }
417
- r[i + l] = carry;
418
- }
419
- trim(r);
420
- return r;
421
- }
422
-
423
- BigInteger.prototype.square = function () {
424
- return new BigInteger(square(this.value), false);
425
- };
426
-
427
- SmallInteger.prototype.square = function () {
428
- var value = this.value * this.value;
429
- if (isPrecise(value)) return new SmallInteger(value);
430
- return new BigInteger(square(smallToArray(Math.abs(this.value))), false);
431
- };
432
-
433
- NativeBigInt.prototype.square = function (v) {
434
- return new NativeBigInt(this.value * this.value);
435
- }
436
-
437
- function divMod1(a, b) { // Left over from previous version. Performs faster than divMod2 on smaller input sizes.
438
- var a_l = a.length,
439
- b_l = b.length,
440
- base = BASE,
441
- result = createArray(b.length),
442
- divisorMostSignificantDigit = b[b_l - 1],
443
- // normalization
444
- lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)),
445
- remainder = multiplySmall(a, lambda),
446
- divisor = multiplySmall(b, lambda),
447
- quotientDigit, shift, carry, borrow, i, l, q;
448
- if (remainder.length <= a_l) remainder.push(0);
449
- divisor.push(0);
450
- divisorMostSignificantDigit = divisor[b_l - 1];
451
- for (shift = a_l - b_l; shift >= 0; shift--) {
452
- quotientDigit = base - 1;
453
- if (remainder[shift + b_l] !== divisorMostSignificantDigit) {
454
- quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit);
455
- }
456
- // quotientDigit <= base - 1
457
- carry = 0;
458
- borrow = 0;
459
- l = divisor.length;
460
- for (i = 0; i < l; i++) {
461
- carry += quotientDigit * divisor[i];
462
- q = Math.floor(carry / base);
463
- borrow += remainder[shift + i] - (carry - q * base);
464
- carry = q;
465
- if (borrow < 0) {
466
- remainder[shift + i] = borrow + base;
467
- borrow = -1;
468
- } else {
469
- remainder[shift + i] = borrow;
470
- borrow = 0;
471
- }
472
- }
473
- while (borrow !== 0) {
474
- quotientDigit -= 1;
475
- carry = 0;
476
- for (i = 0; i < l; i++) {
477
- carry += remainder[shift + i] - base + divisor[i];
478
- if (carry < 0) {
479
- remainder[shift + i] = carry + base;
480
- carry = 0;
481
- } else {
482
- remainder[shift + i] = carry;
483
- carry = 1;
484
- }
485
- }
486
- borrow += carry;
487
- }
488
- result[shift] = quotientDigit;
489
- }
490
- // denormalization
491
- remainder = divModSmall(remainder, lambda)[0];
492
- return [arrayToSmall(result), arrayToSmall(remainder)];
493
- }
494
-
495
- function divMod2(a, b) { // Implementation idea shamelessly stolen from Silent Matt's library http://silentmatt.com/biginteger/
496
- // Performs faster than divMod1 on larger input sizes.
497
- var a_l = a.length,
498
- b_l = b.length,
499
- result = [],
500
- part = [],
501
- base = BASE,
502
- guess, xlen, highx, highy, check;
503
- while (a_l) {
504
- part.unshift(a[--a_l]);
505
- trim(part);
506
- if (compareAbs(part, b) < 0) {
507
- result.push(0);
508
- continue;
509
- }
510
- xlen = part.length;
511
- highx = part[xlen - 1] * base + part[xlen - 2];
512
- highy = b[b_l - 1] * base + b[b_l - 2];
513
- if (xlen > b_l) {
514
- highx = (highx + 1) * base;
515
- }
516
- guess = Math.ceil(highx / highy);
517
- do {
518
- check = multiplySmall(b, guess);
519
- if (compareAbs(check, part) <= 0) break;
520
- guess--;
521
- } while (guess);
522
- result.push(guess);
523
- part = subtract(part, check);
524
- }
525
- result.reverse();
526
- return [arrayToSmall(result), arrayToSmall(part)];
527
- }
528
-
529
- function divModSmall(value, lambda) {
530
- var length = value.length,
531
- quotient = createArray(length),
532
- base = BASE,
533
- i, q, remainder, divisor;
534
- remainder = 0;
535
- for (i = length - 1; i >= 0; --i) {
536
- divisor = remainder * base + value[i];
537
- q = truncate(divisor / lambda);
538
- remainder = divisor - q * lambda;
539
- quotient[i] = q | 0;
540
- }
541
- return [quotient, remainder | 0];
542
- }
543
-
544
- function divModAny(self, v) {
545
- var value, n = parseValue(v);
546
- if (supportsNativeBigInt) {
547
- return [new NativeBigInt(self.value / n.value), new NativeBigInt(self.value % n.value)];
548
- }
549
- var a = self.value, b = n.value;
550
- var quotient;
551
- if (b === 0) throw new Error("Cannot divide by zero");
552
- if (self.isSmall) {
553
- if (n.isSmall) {
554
- return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)];
555
- }
556
- return [Integer[0], self];
557
- }
558
- if (n.isSmall) {
559
- if (b === 1) return [self, Integer[0]];
560
- if (b == -1) return [self.negate(), Integer[0]];
561
- var abs = Math.abs(b);
562
- if (abs < BASE) {
563
- value = divModSmall(a, abs);
564
- quotient = arrayToSmall(value[0]);
565
- var remainder = value[1];
566
- if (self.sign) remainder = -remainder;
567
- if (typeof quotient === "number") {
568
- if (self.sign !== n.sign) quotient = -quotient;
569
- return [new SmallInteger(quotient), new SmallInteger(remainder)];
570
- }
571
- return [new BigInteger(quotient, self.sign !== n.sign), new SmallInteger(remainder)];
572
- }
573
- b = smallToArray(abs);
574
- }
575
- var comparison = compareAbs(a, b);
576
- if (comparison === -1) return [Integer[0], self];
577
- if (comparison === 0) return [Integer[self.sign === n.sign ? 1 : -1], Integer[0]];
578
-
579
- // divMod1 is faster on smaller input sizes
580
- if (a.length + b.length <= 200)
581
- value = divMod1(a, b);
582
- else value = divMod2(a, b);
583
-
584
- quotient = value[0];
585
- var qSign = self.sign !== n.sign,
586
- mod = value[1],
587
- mSign = self.sign;
588
- if (typeof quotient === "number") {
589
- if (qSign) quotient = -quotient;
590
- quotient = new SmallInteger(quotient);
591
- } else quotient = new BigInteger(quotient, qSign);
592
- if (typeof mod === "number") {
593
- if (mSign) mod = -mod;
594
- mod = new SmallInteger(mod);
595
- } else mod = new BigInteger(mod, mSign);
596
- return [quotient, mod];
597
- }
598
-
599
- BigInteger.prototype.divmod = function (v) {
600
- var result = divModAny(this, v);
601
- return {
602
- quotient: result[0],
603
- remainder: result[1]
604
- };
605
- };
606
- NativeBigInt.prototype.divmod = SmallInteger.prototype.divmod = BigInteger.prototype.divmod;
607
-
608
-
609
- BigInteger.prototype.divide = function (v) {
610
- return divModAny(this, v)[0];
611
- };
612
- NativeBigInt.prototype.over = NativeBigInt.prototype.divide = function (v) {
613
- return new NativeBigInt(this.value / parseValue(v).value);
614
- };
615
- SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide;
616
-
617
- BigInteger.prototype.mod = function (v) {
618
- return divModAny(this, v)[1];
619
- };
620
- NativeBigInt.prototype.mod = NativeBigInt.prototype.remainder = function (v) {
621
- return new NativeBigInt(this.value % parseValue(v).value);
622
- };
623
- SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod;
624
-
625
- BigInteger.prototype.pow = function (v) {
626
- var n = parseValue(v),
627
- a = this.value,
628
- b = n.value,
629
- value, x, y;
630
- if (b === 0) return Integer[1];
631
- if (a === 0) return Integer[0];
632
- if (a === 1) return Integer[1];
633
- if (a === -1) return n.isEven() ? Integer[1] : Integer[-1];
634
- if (n.sign) {
635
- return Integer[0];
636
- }
637
- if (!n.isSmall) throw new Error("The exponent " + n.toString() + " is too large.");
638
- if (this.isSmall) {
639
- if (isPrecise(value = Math.pow(a, b)))
640
- return new SmallInteger(truncate(value));
641
- }
642
- x = this;
643
- y = Integer[1];
644
- while (true) {
645
- if (b & 1 === 1) {
646
- y = y.times(x);
647
- --b;
648
- }
649
- if (b === 0) break;
650
- b /= 2;
651
- x = x.square();
652
- }
653
- return y;
654
- };
655
- SmallInteger.prototype.pow = BigInteger.prototype.pow;
656
-
657
- NativeBigInt.prototype.pow = function (v) {
658
- var n = parseValue(v);
659
- var a = this.value, b = n.value;
660
- var _0 = BigInt(0), _1 = BigInt(1), _2 = BigInt(2);
661
- if (b === _0) return Integer[1];
662
- if (a === _0) return Integer[0];
663
- if (a === _1) return Integer[1];
664
- if (a === BigInt(-1)) return n.isEven() ? Integer[1] : Integer[-1];
665
- if (n.isNegative()) return new NativeBigInt(_0);
666
- var x = this;
667
- var y = Integer[1];
668
- while (true) {
669
- if ((b & _1) === _1) {
670
- y = y.times(x);
671
- --b;
672
- }
673
- if (b === _0) break;
674
- b /= _2;
675
- x = x.square();
676
- }
677
- return y;
678
- }
679
-
680
- BigInteger.prototype.modPow = function (exp, mod) {
681
- exp = parseValue(exp);
682
- mod = parseValue(mod);
683
- if (mod.isZero()) throw new Error("Cannot take modPow with modulus 0");
684
- var r = Integer[1],
685
- base = this.mod(mod);
686
- if (exp.isNegative()) {
687
- exp = exp.multiply(Integer[-1]);
688
- base = base.modInv(mod);
689
- }
690
- while (exp.isPositive()) {
691
- if (base.isZero()) return Integer[0];
692
- if (exp.isOdd()) r = r.multiply(base).mod(mod);
693
- exp = exp.divide(2);
694
- base = base.square().mod(mod);
695
- }
696
- return r;
697
- };
698
- NativeBigInt.prototype.modPow = SmallInteger.prototype.modPow = BigInteger.prototype.modPow;
699
-
700
- function compareAbs(a, b) {
701
- if (a.length !== b.length) {
702
- return a.length > b.length ? 1 : -1;
703
- }
704
- for (var i = a.length - 1; i >= 0; i--) {
705
- if (a[i] !== b[i]) return a[i] > b[i] ? 1 : -1;
706
- }
707
- return 0;
708
- }
709
-
710
- BigInteger.prototype.compareAbs = function (v) {
711
- var n = parseValue(v),
712
- a = this.value,
713
- b = n.value;
714
- if (n.isSmall) return 1;
715
- return compareAbs(a, b);
716
- };
717
- SmallInteger.prototype.compareAbs = function (v) {
718
- var n = parseValue(v),
719
- a = Math.abs(this.value),
720
- b = n.value;
721
- if (n.isSmall) {
722
- b = Math.abs(b);
723
- return a === b ? 0 : a > b ? 1 : -1;
724
- }
725
- return -1;
726
- };
727
- NativeBigInt.prototype.compareAbs = function (v) {
728
- var a = this.value;
729
- var b = parseValue(v).value;
730
- a = a >= 0 ? a : -a;
731
- b = b >= 0 ? b : -b;
732
- return a === b ? 0 : a > b ? 1 : -1;
733
- }
734
-
735
- BigInteger.prototype.compare = function (v) {
736
- // See discussion about comparison with Infinity:
737
- // https://github.com/peterolson/BigInteger.js/issues/61
738
- if (v === Infinity) {
739
- return -1;
740
- }
741
- if (v === -Infinity) {
742
- return 1;
743
- }
744
-
745
- var n = parseValue(v),
746
- a = this.value,
747
- b = n.value;
748
- if (this.sign !== n.sign) {
749
- return n.sign ? 1 : -1;
750
- }
751
- if (n.isSmall) {
752
- return this.sign ? -1 : 1;
753
- }
754
- return compareAbs(a, b) * (this.sign ? -1 : 1);
755
- };
756
- BigInteger.prototype.compareTo = BigInteger.prototype.compare;
757
-
758
- SmallInteger.prototype.compare = function (v) {
759
- if (v === Infinity) {
760
- return -1;
761
- }
762
- if (v === -Infinity) {
763
- return 1;
764
- }
765
-
766
- var n = parseValue(v),
767
- a = this.value,
768
- b = n.value;
769
- if (n.isSmall) {
770
- return a == b ? 0 : a > b ? 1 : -1;
771
- }
772
- if (a < 0 !== n.sign) {
773
- return a < 0 ? -1 : 1;
774
- }
775
- return a < 0 ? 1 : -1;
776
- };
777
- SmallInteger.prototype.compareTo = SmallInteger.prototype.compare;
778
-
779
- NativeBigInt.prototype.compare = function (v) {
780
- if (v === Infinity) {
781
- return -1;
782
- }
783
- if (v === -Infinity) {
784
- return 1;
785
- }
786
- var a = this.value;
787
- var b = parseValue(v).value;
788
- return a === b ? 0 : a > b ? 1 : -1;
789
- }
790
- NativeBigInt.prototype.compareTo = NativeBigInt.prototype.compare;
791
-
792
- BigInteger.prototype.equals = function (v) {
793
- return this.compare(v) === 0;
794
- };
795
- NativeBigInt.prototype.eq = NativeBigInt.prototype.equals = SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals;
796
-
797
- BigInteger.prototype.notEquals = function (v) {
798
- return this.compare(v) !== 0;
799
- };
800
- NativeBigInt.prototype.neq = NativeBigInt.prototype.notEquals = SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals;
801
-
802
- BigInteger.prototype.greater = function (v) {
803
- return this.compare(v) > 0;
804
- };
805
- NativeBigInt.prototype.gt = NativeBigInt.prototype.greater = SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater;
806
-
807
- BigInteger.prototype.lesser = function (v) {
808
- return this.compare(v) < 0;
809
- };
810
- NativeBigInt.prototype.lt = NativeBigInt.prototype.lesser = SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser;
811
-
812
- BigInteger.prototype.greaterOrEquals = function (v) {
813
- return this.compare(v) >= 0;
814
- };
815
- NativeBigInt.prototype.geq = NativeBigInt.prototype.greaterOrEquals = SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals;
816
-
817
- BigInteger.prototype.lesserOrEquals = function (v) {
818
- return this.compare(v) <= 0;
819
- };
820
- NativeBigInt.prototype.leq = NativeBigInt.prototype.lesserOrEquals = SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals;
821
-
822
- BigInteger.prototype.isEven = function () {
823
- return (this.value[0] & 1) === 0;
824
- };
825
- SmallInteger.prototype.isEven = function () {
826
- return (this.value & 1) === 0;
827
- };
828
- NativeBigInt.prototype.isEven = function () {
829
- return (this.value & BigInt(1)) === BigInt(0);
830
- }
831
-
832
- BigInteger.prototype.isOdd = function () {
833
- return (this.value[0] & 1) === 1;
834
- };
835
- SmallInteger.prototype.isOdd = function () {
836
- return (this.value & 1) === 1;
837
- };
838
- NativeBigInt.prototype.isOdd = function () {
839
- return (this.value & BigInt(1)) === BigInt(1);
840
- }
841
-
842
- BigInteger.prototype.isPositive = function () {
843
- return !this.sign;
844
- };
845
- SmallInteger.prototype.isPositive = function () {
846
- return this.value > 0;
847
- };
848
- NativeBigInt.prototype.isPositive = SmallInteger.prototype.isPositive;
849
-
850
- BigInteger.prototype.isNegative = function () {
851
- return this.sign;
852
- };
853
- SmallInteger.prototype.isNegative = function () {
854
- return this.value < 0;
855
- };
856
- NativeBigInt.prototype.isNegative = SmallInteger.prototype.isNegative;
857
-
858
- BigInteger.prototype.isUnit = function () {
859
- return false;
860
- };
861
- SmallInteger.prototype.isUnit = function () {
862
- return Math.abs(this.value) === 1;
863
- };
864
- NativeBigInt.prototype.isUnit = function () {
865
- return this.abs().value === BigInt(1);
866
- }
867
-
868
- BigInteger.prototype.isZero = function () {
869
- return false;
870
- };
871
- SmallInteger.prototype.isZero = function () {
872
- return this.value === 0;
873
- };
874
- NativeBigInt.prototype.isZero = function () {
875
- return this.value === BigInt(0);
876
- }
877
-
878
- BigInteger.prototype.isDivisibleBy = function (v) {
879
- var n = parseValue(v);
880
- if (n.isZero()) return false;
881
- if (n.isUnit()) return true;
882
- if (n.compareAbs(2) === 0) return this.isEven();
883
- return this.mod(n).isZero();
884
- };
885
- NativeBigInt.prototype.isDivisibleBy = SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy;
886
-
887
- function isBasicPrime(v) {
888
- var n = v.abs();
889
- if (n.isUnit()) return false;
890
- if (n.equals(2) || n.equals(3) || n.equals(5)) return true;
891
- if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false;
892
- if (n.lesser(49)) return true;
893
- // we don't know if it's prime: let the other functions figure it out
894
- }
895
-
896
- function millerRabinTest(n, a) {
897
- var nPrev = n.prev(),
898
- b = nPrev,
899
- r = 0,
900
- d, t, i, x;
901
- while (b.isEven()) b = b.divide(2), r++;
902
- next: for (i = 0; i < a.length; i++) {
903
- if (n.lesser(a[i])) continue;
904
- x = bigInt(a[i]).modPow(b, n);
905
- if (x.isUnit() || x.equals(nPrev)) continue;
906
- for (d = r - 1; d != 0; d--) {
907
- x = x.square().mod(n);
908
- if (x.isUnit()) return false;
909
- if (x.equals(nPrev)) continue next;
910
- }
911
- return false;
912
- }
913
- return true;
914
- }
915
-
916
- // Set "strict" to true to force GRH-supported lower bound of 2*log(N)^2
917
- BigInteger.prototype.isPrime = function (strict) {
918
- var isPrime = isBasicPrime(this);
919
- if (isPrime !== undefined) return isPrime;
920
- var n = this.abs();
921
- var bits = n.bitLength();
922
- if (bits <= 64)
923
- return millerRabinTest(n, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
924
- var logN = Math.log(2) * bits.toJSNumber();
925
- var t = Math.ceil((strict === true) ? (2 * Math.pow(logN, 2)) : logN);
926
- for (var a = [], i = 0; i < t; i++) {
927
- a.push(bigInt(i + 2));
928
- }
929
- return millerRabinTest(n, a);
930
- };
931
- NativeBigInt.prototype.isPrime = SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime;
932
-
933
- BigInteger.prototype.isProbablePrime = function (iterations) {
934
- var isPrime = isBasicPrime(this);
935
- if (isPrime !== undefined) return isPrime;
936
- var n = this.abs();
937
- var t = iterations === undefined ? 5 : iterations;
938
- for (var a = [], i = 0; i < t; i++) {
939
- a.push(bigInt.randBetween(2, n.minus(2)));
940
- }
941
- return millerRabinTest(n, a);
942
- };
943
- NativeBigInt.prototype.isProbablePrime = SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;
944
-
945
- BigInteger.prototype.modInv = function (n) {
946
- var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR;
947
- while (!newR.isZero()) {
948
- q = r.divide(newR);
949
- lastT = t;
950
- lastR = r;
951
- t = newT;
952
- r = newR;
953
- newT = lastT.subtract(q.multiply(newT));
954
- newR = lastR.subtract(q.multiply(newR));
955
- }
956
- if (!r.isUnit()) throw new Error(this.toString() + " and " + n.toString() + " are not co-prime");
957
- if (t.compare(0) === -1) {
958
- t = t.add(n);
959
- }
960
- if (this.isNegative()) {
961
- return t.negate();
962
- }
963
- return t;
964
- };
965
-
966
- NativeBigInt.prototype.modInv = SmallInteger.prototype.modInv = BigInteger.prototype.modInv;
967
-
968
- BigInteger.prototype.next = function () {
969
- var value = this.value;
970
- if (this.sign) {
971
- return subtractSmall(value, 1, this.sign);
972
- }
973
- return new BigInteger(addSmall(value, 1), this.sign);
974
- };
975
- SmallInteger.prototype.next = function () {
976
- var value = this.value;
977
- if (value + 1 < MAX_INT) return new SmallInteger(value + 1);
978
- return new BigInteger(MAX_INT_ARR, false);
979
- };
980
- NativeBigInt.prototype.next = function () {
981
- return new NativeBigInt(this.value + BigInt(1));
982
- }
983
-
984
- BigInteger.prototype.prev = function () {
985
- var value = this.value;
986
- if (this.sign) {
987
- return new BigInteger(addSmall(value, 1), true);
988
- }
989
- return subtractSmall(value, 1, this.sign);
990
- };
991
- SmallInteger.prototype.prev = function () {
992
- var value = this.value;
993
- if (value - 1 > -MAX_INT) return new SmallInteger(value - 1);
994
- return new BigInteger(MAX_INT_ARR, true);
995
- };
996
- NativeBigInt.prototype.prev = function () {
997
- return new NativeBigInt(this.value - BigInt(1));
998
- }
999
-
1000
- var powersOfTwo = [1];
1001
- while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]);
1002
- var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1];
1003
-
1004
- function shift_isSmall(n) {
1005
- return Math.abs(n) <= BASE;
1006
- }
1007
-
1008
- BigInteger.prototype.shiftLeft = function (v) {
1009
- var n = parseValue(v).toJSNumber();
1010
- if (!shift_isSmall(n)) {
1011
- throw new Error(String(n) + " is too large for shifting.");
1012
- }
1013
- if (n < 0) return this.shiftRight(-n);
1014
- var result = this;
1015
- if (result.isZero()) return result;
1016
- while (n >= powers2Length) {
1017
- result = result.multiply(highestPower2);
1018
- n -= powers2Length - 1;
1019
- }
1020
- return result.multiply(powersOfTwo[n]);
1021
- };
1022
- NativeBigInt.prototype.shiftLeft = SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft;
1023
-
1024
- BigInteger.prototype.shiftRight = function (v) {
1025
- var remQuo;
1026
- var n = parseValue(v).toJSNumber();
1027
- if (!shift_isSmall(n)) {
1028
- throw new Error(String(n) + " is too large for shifting.");
1029
- }
1030
- if (n < 0) return this.shiftLeft(-n);
1031
- var result = this;
1032
- while (n >= powers2Length) {
1033
- if (result.isZero() || (result.isNegative() && result.isUnit())) return result;
1034
- remQuo = divModAny(result, highestPower2);
1035
- result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
1036
- n -= powers2Length - 1;
1037
- }
1038
- remQuo = divModAny(result, powersOfTwo[n]);
1039
- return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
1040
- };
1041
- NativeBigInt.prototype.shiftRight = SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight;
1042
-
1043
- function bitwise(x, y, fn) {
1044
- y = parseValue(y);
1045
- var xSign = x.isNegative(), ySign = y.isNegative();
1046
- var xRem = xSign ? x.not() : x,
1047
- yRem = ySign ? y.not() : y;
1048
- var xDigit = 0, yDigit = 0;
1049
- var xDivMod = null, yDivMod = null;
1050
- var result = [];
1051
- while (!xRem.isZero() || !yRem.isZero()) {
1052
- xDivMod = divModAny(xRem, highestPower2);
1053
- xDigit = xDivMod[1].toJSNumber();
1054
- if (xSign) {
1055
- xDigit = highestPower2 - 1 - xDigit; // two's complement for negative numbers
1056
- }
1057
-
1058
- yDivMod = divModAny(yRem, highestPower2);
1059
- yDigit = yDivMod[1].toJSNumber();
1060
- if (ySign) {
1061
- yDigit = highestPower2 - 1 - yDigit; // two's complement for negative numbers
1062
- }
1063
-
1064
- xRem = xDivMod[0];
1065
- yRem = yDivMod[0];
1066
- result.push(fn(xDigit, yDigit));
1067
- }
1068
- var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0);
1069
- for (var i = result.length - 1; i >= 0; i -= 1) {
1070
- sum = sum.multiply(highestPower2).add(bigInt(result[i]));
1071
- }
1072
- return sum;
1073
- }
1074
-
1075
- BigInteger.prototype.not = function () {
1076
- return this.negate().prev();
1077
- };
1078
- NativeBigInt.prototype.not = SmallInteger.prototype.not = BigInteger.prototype.not;
1079
-
1080
- BigInteger.prototype.and = function (n) {
1081
- return bitwise(this, n, function (a, b) { return a & b; });
1082
- };
1083
- NativeBigInt.prototype.and = SmallInteger.prototype.and = BigInteger.prototype.and;
1084
-
1085
- BigInteger.prototype.or = function (n) {
1086
- return bitwise(this, n, function (a, b) { return a | b; });
1087
- };
1088
- NativeBigInt.prototype.or = SmallInteger.prototype.or = BigInteger.prototype.or;
1089
-
1090
- BigInteger.prototype.xor = function (n) {
1091
- return bitwise(this, n, function (a, b) { return a ^ b; });
1092
- };
1093
- NativeBigInt.prototype.xor = SmallInteger.prototype.xor = BigInteger.prototype.xor;
1094
-
1095
- var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I;
1096
- function roughLOB(n) { // get lowestOneBit (rough)
1097
- // SmallInteger: return Min(lowestOneBit(n), 1 << 30)
1098
- // BigInteger: return Min(lowestOneBit(n), 1 << 14) [BASE=1e7]
1099
- var v = n.value,
1100
- x = typeof v === "number" ? v | LOBMASK_I :
1101
- typeof v === "bigint" ? v | BigInt(LOBMASK_I) :
1102
- v[0] + v[1] * BASE | LOBMASK_BI;
1103
- return x & -x;
1104
- }
1105
-
1106
- function integerLogarithm(value, base) {
1107
- if (base.compareTo(value) <= 0) {
1108
- var tmp = integerLogarithm(value, base.square(base));
1109
- var p = tmp.p;
1110
- var e = tmp.e;
1111
- var t = p.multiply(base);
1112
- return t.compareTo(value) <= 0 ? { p: t, e: e * 2 + 1 } : { p: p, e: e * 2 };
1113
- }
1114
- return { p: bigInt(1), e: 0 };
1115
- }
1116
-
1117
- BigInteger.prototype.bitLength = function () {
1118
- var n = this;
1119
- if (n.compareTo(bigInt(0)) < 0) {
1120
- n = n.negate().subtract(bigInt(1));
1121
- }
1122
- if (n.compareTo(bigInt(0)) === 0) {
1123
- return bigInt(0);
1124
- }
1125
- return bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1));
1126
- }
1127
- NativeBigInt.prototype.bitLength = SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength;
1128
-
1129
- function max(a, b) {
1130
- a = parseValue(a);
1131
- b = parseValue(b);
1132
- return a.greater(b) ? a : b;
1133
- }
1134
- function min(a, b) {
1135
- a = parseValue(a);
1136
- b = parseValue(b);
1137
- return a.lesser(b) ? a : b;
1138
- }
1139
- function gcd(a, b) {
1140
- a = parseValue(a).abs();
1141
- b = parseValue(b).abs();
1142
- if (a.equals(b)) return a;
1143
- if (a.isZero()) return b;
1144
- if (b.isZero()) return a;
1145
- var c = Integer[1], d, t;
1146
- while (a.isEven() && b.isEven()) {
1147
- d = min(roughLOB(a), roughLOB(b));
1148
- a = a.divide(d);
1149
- b = b.divide(d);
1150
- c = c.multiply(d);
1151
- }
1152
- while (a.isEven()) {
1153
- a = a.divide(roughLOB(a));
1154
- }
1155
- do {
1156
- while (b.isEven()) {
1157
- b = b.divide(roughLOB(b));
1158
- }
1159
- if (a.greater(b)) {
1160
- t = b; b = a; a = t;
1161
- }
1162
- b = b.subtract(a);
1163
- } while (!b.isZero());
1164
- return c.isUnit() ? a : a.multiply(c);
1165
- }
1166
- function lcm(a, b) {
1167
- a = parseValue(a).abs();
1168
- b = parseValue(b).abs();
1169
- return a.divide(gcd(a, b)).multiply(b);
1170
- }
1171
- function randBetween(a, b) {
1172
- a = parseValue(a);
1173
- b = parseValue(b);
1174
- var low = min(a, b), high = max(a, b);
1175
- var range = high.subtract(low).add(1);
1176
- if (range.isSmall) return low.add(Math.floor(Math.random() * range));
1177
- var digits = toBase(range, BASE).value;
1178
- var result = [], restricted = true;
1179
- for (var i = 0; i < digits.length; i++) {
1180
- var top = restricted ? digits[i] : BASE;
1181
- var digit = truncate(Math.random() * top);
1182
- result.push(digit);
1183
- if (digit < top) restricted = false;
1184
- }
1185
- return low.add(Integer.fromArray(result, BASE, false));
1186
- }
1187
-
1188
- var parseBase = function (text, base, alphabet, caseSensitive) {
1189
- alphabet = alphabet || DEFAULT_ALPHABET;
1190
- text = String(text);
1191
- if (!caseSensitive) {
1192
- text = text.toLowerCase();
1193
- alphabet = alphabet.toLowerCase();
1194
- }
1195
- var length = text.length;
1196
- var i;
1197
- var absBase = Math.abs(base);
1198
- var alphabetValues = {};
1199
- for (i = 0; i < alphabet.length; i++) {
1200
- alphabetValues[alphabet[i]] = i;
1201
- }
1202
- for (i = 0; i < length; i++) {
1203
- var c = text[i];
1204
- if (c === "-") continue;
1205
- if (c in alphabetValues) {
1206
- if (alphabetValues[c] >= absBase) {
1207
- if (c === "1" && absBase === 1) continue;
1208
- throw new Error(c + " is not a valid digit in base " + base + ".");
1209
- }
1210
- }
1211
- }
1212
- base = parseValue(base);
1213
- var digits = [];
1214
- var isNegative = text[0] === "-";
1215
- for (i = isNegative ? 1 : 0; i < text.length; i++) {
1216
- var c = text[i];
1217
- if (c in alphabetValues) digits.push(parseValue(alphabetValues[c]));
1218
- else if (c === "<") {
1219
- var start = i;
1220
- do { i++; } while (text[i] !== ">" && i < text.length);
1221
- digits.push(parseValue(text.slice(start + 1, i)));
1222
- }
1223
- else throw new Error(c + " is not a valid character");
1224
- }
1225
- return parseBaseFromArray(digits, base, isNegative);
1226
- };
1227
-
1228
- function parseBaseFromArray(digits, base, isNegative) {
1229
- var val = Integer[0], pow = Integer[1], i;
1230
- for (i = digits.length - 1; i >= 0; i--) {
1231
- val = val.add(digits[i].times(pow));
1232
- pow = pow.times(base);
1233
- }
1234
- return isNegative ? val.negate() : val;
1235
- }
1236
-
1237
- function stringify(digit, alphabet) {
1238
- alphabet = alphabet || DEFAULT_ALPHABET;
1239
- if (digit < alphabet.length) {
1240
- return alphabet[digit];
1241
- }
1242
- return "<" + digit + ">";
1243
- }
1244
-
1245
- function toBase(n, base) {
1246
- base = bigInt(base);
1247
- if (base.isZero()) {
1248
- if (n.isZero()) return { value: [0], isNegative: false };
1249
- throw new Error("Cannot convert nonzero numbers to base 0.");
1250
- }
1251
- if (base.equals(-1)) {
1252
- if (n.isZero()) return { value: [0], isNegative: false };
1253
- if (n.isNegative())
1254
- return {
1255
- value: [].concat.apply([], Array.apply(null, Array(-n.toJSNumber()))
1256
- .map(Array.prototype.valueOf, [1, 0])
1257
- ),
1258
- isNegative: false
1259
- };
1260
-
1261
- var arr = Array.apply(null, Array(n.toJSNumber() - 1))
1262
- .map(Array.prototype.valueOf, [0, 1]);
1263
- arr.unshift([1]);
1264
- return {
1265
- value: [].concat.apply([], arr),
1266
- isNegative: false
1267
- };
1268
- }
1269
-
1270
- var neg = false;
1271
- if (n.isNegative() && base.isPositive()) {
1272
- neg = true;
1273
- n = n.abs();
1274
- }
1275
- if (base.isUnit()) {
1276
- if (n.isZero()) return { value: [0], isNegative: false };
1277
-
1278
- return {
1279
- value: Array.apply(null, Array(n.toJSNumber()))
1280
- .map(Number.prototype.valueOf, 1),
1281
- isNegative: neg
1282
- };
1283
- }
1284
- var out = [];
1285
- var left = n, divmod;
1286
- while (left.isNegative() || left.compareAbs(base) >= 0) {
1287
- divmod = left.divmod(base);
1288
- left = divmod.quotient;
1289
- var digit = divmod.remainder;
1290
- if (digit.isNegative()) {
1291
- digit = base.minus(digit).abs();
1292
- left = left.next();
1293
- }
1294
- out.push(digit.toJSNumber());
1295
- }
1296
- out.push(left.toJSNumber());
1297
- return { value: out.reverse(), isNegative: neg };
1298
- }
1299
-
1300
- function toBaseString(n, base, alphabet) {
1301
- var arr = toBase(n, base);
1302
- return (arr.isNegative ? "-" : "") + arr.value.map(function (x) {
1303
- return stringify(x, alphabet);
1304
- }).join('');
1305
- }
1306
-
1307
- BigInteger.prototype.toArray = function (radix) {
1308
- return toBase(this, radix);
1309
- };
1310
-
1311
- SmallInteger.prototype.toArray = function (radix) {
1312
- return toBase(this, radix);
1313
- };
1314
-
1315
- NativeBigInt.prototype.toArray = function (radix) {
1316
- return toBase(this, radix);
1317
- };
1318
-
1319
- BigInteger.prototype.toString = function (radix, alphabet) {
1320
- if (radix === undefined) radix = 10;
1321
- if (radix !== 10) return toBaseString(this, radix, alphabet);
1322
- var v = this.value, l = v.length, str = String(v[--l]), zeros = "0000000", digit;
1323
- while (--l >= 0) {
1324
- digit = String(v[l]);
1325
- str += zeros.slice(digit.length) + digit;
1326
- }
1327
- var sign = this.sign ? "-" : "";
1328
- return sign + str;
1329
- };
1330
-
1331
- SmallInteger.prototype.toString = function (radix, alphabet) {
1332
- if (radix === undefined) radix = 10;
1333
- if (radix != 10) return toBaseString(this, radix, alphabet);
1334
- return String(this.value);
1335
- };
1336
-
1337
- NativeBigInt.prototype.toString = SmallInteger.prototype.toString;
1338
-
1339
- NativeBigInt.prototype.toJSON = BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function () { return this.toString(); }
1340
-
1341
- BigInteger.prototype.valueOf = function () {
1342
- return parseInt(this.toString(), 10);
1343
- };
1344
- BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf;
1345
-
1346
- SmallInteger.prototype.valueOf = function () {
1347
- return this.value;
1348
- };
1349
- SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf;
1350
- NativeBigInt.prototype.valueOf = NativeBigInt.prototype.toJSNumber = function () {
1351
- return parseInt(this.toString(), 10);
1352
- }
1353
-
1354
- function parseStringValue(v) {
1355
- if (isPrecise(+v)) {
1356
- var x = +v;
1357
- if (x === truncate(x))
1358
- return supportsNativeBigInt ? new NativeBigInt(BigInt(x)) : new SmallInteger(x);
1359
- throw new Error("Invalid integer: " + v);
1360
- }
1361
- var sign = v[0] === "-";
1362
- if (sign) v = v.slice(1);
1363
- var split = v.split(/e/i);
1364
- if (split.length > 2) throw new Error("Invalid integer: " + split.join("e"));
1365
- if (split.length === 2) {
1366
- var exp = split[1];
1367
- if (exp[0] === "+") exp = exp.slice(1);
1368
- exp = +exp;
1369
- if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error("Invalid integer: " + exp + " is not a valid exponent.");
1370
- var text = split[0];
1371
- var decimalPlace = text.indexOf(".");
1372
- if (decimalPlace >= 0) {
1373
- exp -= text.length - decimalPlace - 1;
1374
- text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1);
1375
- }
1376
- if (exp < 0) throw new Error("Cannot include negative exponent part for integers");
1377
- text += (new Array(exp + 1)).join("0");
1378
- v = text;
1379
- }
1380
- var isValid = /^([0-9][0-9]*)$/.test(v);
1381
- if (!isValid) throw new Error("Invalid integer: " + v);
1382
- if (supportsNativeBigInt) {
1383
- return new NativeBigInt(BigInt(sign ? "-" + v : v));
1384
- }
1385
- var r = [], max = v.length, l = LOG_BASE, min = max - l;
1386
- while (max > 0) {
1387
- r.push(+v.slice(min, max));
1388
- min -= l;
1389
- if (min < 0) min = 0;
1390
- max -= l;
1391
- }
1392
- trim(r);
1393
- return new BigInteger(r, sign);
1394
- }
1395
-
1396
- function parseNumberValue(v) {
1397
- if (supportsNativeBigInt) {
1398
- return new NativeBigInt(BigInt(v));
1399
- }
1400
- if (isPrecise(v)) {
1401
- if (v !== truncate(v)) throw new Error(v + " is not an integer.");
1402
- return new SmallInteger(v);
1403
- }
1404
- return parseStringValue(v.toString());
1405
- }
1406
-
1407
- function parseValue(v) {
1408
- if (typeof v === "number") {
1409
- return parseNumberValue(v);
1410
- }
1411
- if (typeof v === "string") {
1412
- return parseStringValue(v);
1413
- }
1414
- if (typeof v === "bigint") {
1415
- return new NativeBigInt(v);
1416
- }
1417
- return v;
1418
- }
1419
- // Pre-define numbers in range [-999,999]
1420
- for (var i = 0; i < 1000; i++) {
1421
- Integer[i] = parseValue(i);
1422
- if (i > 0) Integer[-i] = parseValue(-i);
1423
- }
1424
- // Backwards compatibility
1425
- Integer.one = Integer[1];
1426
- Integer.zero = Integer[0];
1427
- Integer.minusOne = Integer[-1];
1428
- Integer.max = max;
1429
- Integer.min = min;
1430
- Integer.gcd = gcd;
1431
- Integer.lcm = lcm;
1432
- Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger || x instanceof NativeBigInt; };
1433
- Integer.randBetween = randBetween;
1434
-
1435
- Integer.fromArray = function (digits, base, isNegative) {
1436
- return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative);
1437
- };
1438
-
1439
- return Integer;
1440
- })();
1441
-
1442
- // Node.js check
1443
- if (typeof module !== "undefined" && module.hasOwnProperty("exports")) {
1444
- module.exports = bigInt;
1445
- }
1446
-
1447
- //amd check
1448
- if (typeof define === "function" && define.amd) {
1449
- define("big-integer", [], function () {
1450
- return bigInt;
1451
- });
1452
- }