@airgap/coinlib-core 0.13.11-beta.0 → 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,1253 +0,0 @@
1
- /*!
2
- * validate.js 0.13.1
3
- *
4
- * (c) 2013-2019 Nicklas Ansman, 2013 Wrapp
5
- * Validate.js may be freely distributed under the MIT license.
6
- * For all details and documentation:
7
- * http://validatejs.org/
8
- */
9
-
10
- (function(exports, module, define) {
11
- "use strict";
12
-
13
- // The main function that calls the validators specified by the constraints.
14
- // The options are the following:
15
- // - format (string) - An option that controls how the returned value is formatted
16
- // * flat - Returns a flat array of just the error messages
17
- // * grouped - Returns the messages grouped by attribute (default)
18
- // * detailed - Returns an array of the raw validation data
19
- // - fullMessages (boolean) - If `true` (default) the attribute name is prepended to the error.
20
- //
21
- // Please note that the options are also passed to each validator.
22
- var validate = function(attributes, constraints, options) {
23
- options = v.extend({}, v.options, options);
24
-
25
- var results = v.runValidations(attributes, constraints, options)
26
- , attr
27
- , validator;
28
-
29
- if (results.some(function(r) { return v.isPromise(r.error); })) {
30
- throw new Error("Use validate.async if you want support for promises");
31
- }
32
- return validate.processValidationResults(results, options);
33
- };
34
-
35
- var v = validate;
36
-
37
- // Copies over attributes from one or more sources to a single destination.
38
- // Very much similar to underscore's extend.
39
- // The first argument is the target object and the remaining arguments will be
40
- // used as sources.
41
- v.extend = function(obj) {
42
- [].slice.call(arguments, 1).forEach(function(source) {
43
- for (var attr in source) {
44
- obj[attr] = source[attr];
45
- }
46
- });
47
- return obj;
48
- };
49
-
50
- v.extend(validate, {
51
- // This is the version of the library as a semver.
52
- // The toString function will allow it to be coerced into a string
53
- version: {
54
- major: 0,
55
- minor: 13,
56
- patch: 1,
57
- metadata: null,
58
- toString: function() {
59
- var version = v.format("%{major}.%{minor}.%{patch}", v.version);
60
- if (!v.isEmpty(v.version.metadata)) {
61
- version += "+" + v.version.metadata;
62
- }
63
- return version;
64
- }
65
- },
66
-
67
- // Below is the dependencies that are used in validate.js
68
-
69
- // The constructor of the Promise implementation.
70
- // If you are using Q.js, RSVP or any other A+ compatible implementation
71
- // override this attribute to be the constructor of that promise.
72
- // Since jQuery promises aren't A+ compatible they won't work.
73
- Promise: typeof Promise !== "undefined" ? Promise : /* istanbul ignore next */ null,
74
-
75
- EMPTY_STRING_REGEXP: /^\s*$/,
76
-
77
- // Runs the validators specified by the constraints object.
78
- // Will return an array of the format:
79
- // [{attribute: "<attribute name>", error: "<validation result>"}, ...]
80
- runValidations: function(attributes, constraints, options) {
81
- var results = []
82
- , attr
83
- , validatorName
84
- , value
85
- , validators
86
- , validator
87
- , validatorOptions
88
- , error;
89
-
90
- if (v.isDomElement(attributes) || v.isJqueryElement(attributes)) {
91
- attributes = v.collectFormValues(attributes);
92
- }
93
-
94
- // Loops through each constraints, finds the correct validator and run it.
95
- for (attr in constraints) {
96
- value = v.getDeepObjectValue(attributes, attr);
97
- // This allows the constraints for an attribute to be a function.
98
- // The function will be called with the value, attribute name, the complete dict of
99
- // attributes as well as the options and constraints passed in.
100
- // This is useful when you want to have different
101
- // validations depending on the attribute value.
102
- validators = v.result(constraints[attr], value, attributes, attr, options, constraints);
103
-
104
- for (validatorName in validators) {
105
- validator = v.validators[validatorName];
106
-
107
- if (!validator) {
108
- error = v.format("Unknown validator %{name}", {name: validatorName});
109
- throw new Error(error);
110
- }
111
-
112
- validatorOptions = validators[validatorName];
113
- // This allows the options to be a function. The function will be
114
- // called with the value, attribute name, the complete dict of
115
- // attributes as well as the options and constraints passed in.
116
- // This is useful when you want to have different
117
- // validations depending on the attribute value.
118
- validatorOptions = v.result(validatorOptions, value, attributes, attr, options, constraints);
119
- if (!validatorOptions) {
120
- continue;
121
- }
122
- results.push({
123
- attribute: attr,
124
- value: value,
125
- validator: validatorName,
126
- globalOptions: options,
127
- attributes: attributes,
128
- options: validatorOptions,
129
- error: validator.call(validator,
130
- value,
131
- validatorOptions,
132
- attr,
133
- attributes,
134
- options)
135
- });
136
- }
137
- }
138
-
139
- return results;
140
- },
141
-
142
- // Takes the output from runValidations and converts it to the correct
143
- // output format.
144
- processValidationResults: function(errors, options) {
145
- errors = v.pruneEmptyErrors(errors, options);
146
- errors = v.expandMultipleErrors(errors, options);
147
- errors = v.convertErrorMessages(errors, options);
148
-
149
- var format = options.format || "grouped";
150
-
151
- if (typeof v.formatters[format] === 'function') {
152
- errors = v.formatters[format](errors);
153
- } else {
154
- throw new Error(v.format("Unknown format %{format}", options));
155
- }
156
-
157
- return v.isEmpty(errors) ? undefined : errors;
158
- },
159
-
160
- // Runs the validations with support for promises.
161
- // This function will return a promise that is settled when all the
162
- // validation promises have been completed.
163
- // It can be called even if no validations returned a promise.
164
- async: function(attributes, constraints, options) {
165
- options = v.extend({}, v.async.options, options);
166
-
167
- var WrapErrors = options.wrapErrors || function(errors) {
168
- return errors;
169
- };
170
-
171
- // Removes unknown attributes
172
- if (options.cleanAttributes !== false) {
173
- attributes = v.cleanAttributes(attributes, constraints);
174
- }
175
-
176
- var results = v.runValidations(attributes, constraints, options);
177
-
178
- return new v.Promise(function(resolve, reject) {
179
- v.waitForResults(results).then(function() {
180
- var errors = v.processValidationResults(results, options);
181
- if (errors) {
182
- reject(new WrapErrors(errors, options, attributes, constraints));
183
- } else {
184
- resolve(attributes);
185
- }
186
- }, function(err) {
187
- reject(err);
188
- });
189
- });
190
- },
191
-
192
- single: function(value, constraints, options) {
193
- options = v.extend({}, v.single.options, options, {
194
- format: "flat",
195
- fullMessages: false
196
- });
197
- return v({single: value}, {single: constraints}, options);
198
- },
199
-
200
- // Returns a promise that is resolved when all promises in the results array
201
- // are settled. The promise returned from this function is always resolved,
202
- // never rejected.
203
- // This function modifies the input argument, it replaces the promises
204
- // with the value returned from the promise.
205
- waitForResults: function(results) {
206
- // Create a sequence of all the results starting with a resolved promise.
207
- return results.reduce(function(memo, result) {
208
- // If this result isn't a promise skip it in the sequence.
209
- if (!v.isPromise(result.error)) {
210
- return memo;
211
- }
212
-
213
- return memo.then(function() {
214
- return result.error.then(function(error) {
215
- result.error = error || null;
216
- });
217
- });
218
- }, new v.Promise(function(r) { r(); })); // A resolved promise
219
- },
220
-
221
- // If the given argument is a call: function the and: function return the value
222
- // otherwise just return the value. Additional arguments will be passed as
223
- // arguments to the function.
224
- // Example:
225
- // ```
226
- // result('foo') // 'foo'
227
- // result(Math.max, 1, 2) // 2
228
- // ```
229
- result: function(value) {
230
- var args = [].slice.call(arguments, 1);
231
- if (typeof value === 'function') {
232
- value = value.apply(null, args);
233
- }
234
- return value;
235
- },
236
-
237
- // Checks if the value is a number. This function does not consider NaN a
238
- // number like many other `isNumber` functions do.
239
- isNumber: function(value) {
240
- return typeof value === 'number' && !isNaN(value);
241
- },
242
-
243
- // Returns false if the object is not a function
244
- isFunction: function(value) {
245
- return typeof value === 'function';
246
- },
247
-
248
- // A simple check to verify that the value is an integer. Uses `isNumber`
249
- // and a simple modulo check.
250
- isInteger: function(value) {
251
- return v.isNumber(value) && value % 1 === 0;
252
- },
253
-
254
- // Checks if the value is a boolean
255
- isBoolean: function(value) {
256
- return typeof value === 'boolean';
257
- },
258
-
259
- // Uses the `Object` function to check if the given argument is an object.
260
- isObject: function(obj) {
261
- return obj === Object(obj);
262
- },
263
-
264
- // Simply checks if the object is an instance of a date
265
- isDate: function(obj) {
266
- return obj instanceof Date;
267
- },
268
-
269
- // Returns false if the object is `null` of `undefined`
270
- isDefined: function(obj) {
271
- return obj !== null && obj !== undefined;
272
- },
273
-
274
- // Checks if the given argument is a promise. Anything with a `then`
275
- // function is considered a promise.
276
- isPromise: function(p) {
277
- return !!p && v.isFunction(p.then);
278
- },
279
-
280
- isJqueryElement: function(o) {
281
- return o && v.isString(o.jquery);
282
- },
283
-
284
- isDomElement: function(o) {
285
- if (!o) {
286
- return false;
287
- }
288
-
289
- if (!o.querySelectorAll || !o.querySelector) {
290
- return false;
291
- }
292
-
293
- if (v.isObject(document) && o === document) {
294
- return true;
295
- }
296
-
297
- // http://stackoverflow.com/a/384380/699304
298
- /* istanbul ignore else */
299
- if (typeof HTMLElement === "object") {
300
- return o instanceof HTMLElement;
301
- } else {
302
- return o &&
303
- typeof o === "object" &&
304
- o !== null &&
305
- o.nodeType === 1 &&
306
- typeof o.nodeName === "string";
307
- }
308
- },
309
-
310
- isEmpty: function(value) {
311
- var attr;
312
-
313
- // Null and undefined are empty
314
- if (!v.isDefined(value)) {
315
- return true;
316
- }
317
-
318
- // functions are non empty
319
- if (v.isFunction(value)) {
320
- return false;
321
- }
322
-
323
- // Whitespace only strings are empty
324
- if (v.isString(value)) {
325
- return v.EMPTY_STRING_REGEXP.test(value);
326
- }
327
-
328
- // For arrays we use the length property
329
- if (v.isArray(value)) {
330
- return value.length === 0;
331
- }
332
-
333
- // Dates have no attributes but aren't empty
334
- if (v.isDate(value)) {
335
- return false;
336
- }
337
-
338
- // If we find at least one property we consider it non empty
339
- if (v.isObject(value)) {
340
- for (attr in value) {
341
- return false;
342
- }
343
- return true;
344
- }
345
-
346
- return false;
347
- },
348
-
349
- // Formats the specified strings with the given values like so:
350
- // ```
351
- // format("Foo: %{foo}", {foo: "bar"}) // "Foo bar"
352
- // ```
353
- // If you want to write %{...} without having it replaced simply
354
- // prefix it with % like this `Foo: %%{foo}` and it will be returned
355
- // as `"Foo: %{foo}"`
356
- format: v.extend(function(str, vals) {
357
- if (!v.isString(str)) {
358
- return str;
359
- }
360
- return str.replace(v.format.FORMAT_REGEXP, function(m0, m1, m2) {
361
- if (m1 === '%') {
362
- return "%{" + m2 + "}";
363
- } else {
364
- return String(vals[m2]);
365
- }
366
- });
367
- }, {
368
- // Finds %{key} style patterns in the given string
369
- FORMAT_REGEXP: /(%?)%\{([^\}]+)\}/g
370
- }),
371
-
372
- // "Prettifies" the given string.
373
- // Prettifying means replacing [.\_-] with spaces as well as splitting
374
- // camel case words.
375
- prettify: function(str) {
376
- if (v.isNumber(str)) {
377
- // If there are more than 2 decimals round it to two
378
- if ((str * 100) % 1 === 0) {
379
- return "" + str;
380
- } else {
381
- return parseFloat(Math.round(str * 100) / 100).toFixed(2);
382
- }
383
- }
384
-
385
- if (v.isArray(str)) {
386
- return str.map(function(s) { return v.prettify(s); }).join(", ");
387
- }
388
-
389
- if (v.isObject(str)) {
390
- if (!v.isDefined(str.toString)) {
391
- return JSON.stringify(str);
392
- }
393
-
394
- return str.toString();
395
- }
396
-
397
- // Ensure the string is actually a string
398
- str = "" + str;
399
-
400
- return str
401
- // Splits keys separated by periods
402
- .replace(/([^\s])\.([^\s])/g, '$1 $2')
403
- // Removes backslashes
404
- .replace(/\\+/g, '')
405
- // Replaces - and - with space
406
- .replace(/[_-]/g, ' ')
407
- // Splits camel cased words
408
- .replace(/([a-z])([A-Z])/g, function(m0, m1, m2) {
409
- return "" + m1 + " " + m2.toLowerCase();
410
- })
411
- .toLowerCase();
412
- },
413
-
414
- stringifyValue: function(value, options) {
415
- var prettify = options && options.prettify || v.prettify;
416
- return prettify(value);
417
- },
418
-
419
- isString: function(value) {
420
- return typeof value === 'string';
421
- },
422
-
423
- isArray: function(value) {
424
- return {}.toString.call(value) === '[object Array]';
425
- },
426
-
427
- // Checks if the object is a hash, which is equivalent to an object that
428
- // is neither an array nor a function.
429
- isHash: function(value) {
430
- return v.isObject(value) && !v.isArray(value) && !v.isFunction(value);
431
- },
432
-
433
- contains: function(obj, value) {
434
- if (!v.isDefined(obj)) {
435
- return false;
436
- }
437
- if (v.isArray(obj)) {
438
- return obj.indexOf(value) !== -1;
439
- }
440
- return value in obj;
441
- },
442
-
443
- unique: function(array) {
444
- if (!v.isArray(array)) {
445
- return array;
446
- }
447
- return array.filter(function(el, index, array) {
448
- return array.indexOf(el) == index;
449
- });
450
- },
451
-
452
- forEachKeyInKeypath: function(object, keypath, callback) {
453
- if (!v.isString(keypath)) {
454
- return undefined;
455
- }
456
-
457
- var key = ""
458
- , i
459
- , escape = false;
460
-
461
- for (i = 0; i < keypath.length; ++i) {
462
- switch (keypath[i]) {
463
- case '.':
464
- if (escape) {
465
- escape = false;
466
- key += '.';
467
- } else {
468
- object = callback(object, key, false);
469
- key = "";
470
- }
471
- break;
472
-
473
- case '\\':
474
- if (escape) {
475
- escape = false;
476
- key += '\\';
477
- } else {
478
- escape = true;
479
- }
480
- break;
481
-
482
- default:
483
- escape = false;
484
- key += keypath[i];
485
- break;
486
- }
487
- }
488
-
489
- return callback(object, key, true);
490
- },
491
-
492
- getDeepObjectValue: function(obj, keypath) {
493
- if (!v.isObject(obj)) {
494
- return undefined;
495
- }
496
-
497
- return v.forEachKeyInKeypath(obj, keypath, function(obj, key) {
498
- if (v.isObject(obj)) {
499
- return obj[key];
500
- }
501
- });
502
- },
503
-
504
- // This returns an object with all the values of the form.
505
- // It uses the input name as key and the value as value
506
- // So for example this:
507
- // <input type="text" name="email" value="foo@bar.com" />
508
- // would return:
509
- // {email: "foo@bar.com"}
510
- collectFormValues: function(form, options) {
511
- var values = {}
512
- , i
513
- , j
514
- , input
515
- , inputs
516
- , option
517
- , value;
518
-
519
- if (v.isJqueryElement(form)) {
520
- form = form[0];
521
- }
522
-
523
- if (!form) {
524
- return values;
525
- }
526
-
527
- options = options || {};
528
-
529
- inputs = form.querySelectorAll("input[name], textarea[name]");
530
- for (i = 0; i < inputs.length; ++i) {
531
- input = inputs.item(i);
532
-
533
- if (v.isDefined(input.getAttribute("data-ignored"))) {
534
- continue;
535
- }
536
-
537
- var name = input.name.replace(/\./g, "\\\\.");
538
- value = v.sanitizeFormValue(input.value, options);
539
- if (input.type === "number") {
540
- value = value ? +value : null;
541
- } else if (input.type === "checkbox") {
542
- if (input.attributes.value) {
543
- if (!input.checked) {
544
- value = values[name] || null;
545
- }
546
- } else {
547
- value = input.checked;
548
- }
549
- } else if (input.type === "radio") {
550
- if (!input.checked) {
551
- value = values[name] || null;
552
- }
553
- }
554
- values[name] = value;
555
- }
556
-
557
- inputs = form.querySelectorAll("select[name]");
558
- for (i = 0; i < inputs.length; ++i) {
559
- input = inputs.item(i);
560
- if (v.isDefined(input.getAttribute("data-ignored"))) {
561
- continue;
562
- }
563
-
564
- if (input.multiple) {
565
- value = [];
566
- for (j in input.options) {
567
- option = input.options[j];
568
- if (option && option.selected) {
569
- value.push(v.sanitizeFormValue(option.value, options));
570
- }
571
- }
572
- } else {
573
- var _val = typeof input.options[input.selectedIndex] !== 'undefined' ? input.options[input.selectedIndex].value : /* istanbul ignore next */ '';
574
- value = v.sanitizeFormValue(_val, options);
575
- }
576
- values[input.name] = value;
577
- }
578
-
579
- return values;
580
- },
581
-
582
- sanitizeFormValue: function(value, options) {
583
- if (options.trim && v.isString(value)) {
584
- value = value.trim();
585
- }
586
-
587
- if (options.nullify !== false && value === "") {
588
- return null;
589
- }
590
- return value;
591
- },
592
-
593
- capitalize: function(str) {
594
- if (!v.isString(str)) {
595
- return str;
596
- }
597
- return str[0].toUpperCase() + str.slice(1);
598
- },
599
-
600
- // Remove all errors who's error attribute is empty (null or undefined)
601
- pruneEmptyErrors: function(errors) {
602
- return errors.filter(function(error) {
603
- return !v.isEmpty(error.error);
604
- });
605
- },
606
-
607
- // In
608
- // [{error: ["err1", "err2"], ...}]
609
- // Out
610
- // [{error: "err1", ...}, {error: "err2", ...}]
611
- //
612
- // All attributes in an error with multiple messages are duplicated
613
- // when expanding the errors.
614
- expandMultipleErrors: function(errors) {
615
- var ret = [];
616
- errors.forEach(function(error) {
617
- // Removes errors without a message
618
- if (v.isArray(error.error)) {
619
- error.error.forEach(function(msg) {
620
- ret.push(v.extend({}, error, {error: msg}));
621
- });
622
- } else {
623
- ret.push(error);
624
- }
625
- });
626
- return ret;
627
- },
628
-
629
- // Converts the error mesages by prepending the attribute name unless the
630
- // message is prefixed by ^
631
- convertErrorMessages: function(errors, options) {
632
- options = options || {};
633
-
634
- var ret = []
635
- , prettify = options.prettify || v.prettify;
636
- errors.forEach(function(errorInfo) {
637
- var error = v.result(errorInfo.error,
638
- errorInfo.value,
639
- errorInfo.attribute,
640
- errorInfo.options,
641
- errorInfo.attributes,
642
- errorInfo.globalOptions);
643
-
644
- if (!v.isString(error)) {
645
- ret.push(errorInfo);
646
- return;
647
- }
648
-
649
- if (error[0] === '^') {
650
- error = error.slice(1);
651
- } else if (options.fullMessages !== false) {
652
- error = v.capitalize(prettify(errorInfo.attribute)) + " " + error;
653
- }
654
- error = error.replace(/\\\^/g, "^");
655
- error = v.format(error, {
656
- value: v.stringifyValue(errorInfo.value, options)
657
- });
658
- ret.push(v.extend({}, errorInfo, {error: error}));
659
- });
660
- return ret;
661
- },
662
-
663
- // In:
664
- // [{attribute: "<attributeName>", ...}]
665
- // Out:
666
- // {"<attributeName>": [{attribute: "<attributeName>", ...}]}
667
- groupErrorsByAttribute: function(errors) {
668
- var ret = {};
669
- errors.forEach(function(error) {
670
- var list = ret[error.attribute];
671
- if (list) {
672
- list.push(error);
673
- } else {
674
- ret[error.attribute] = [error];
675
- }
676
- });
677
- return ret;
678
- },
679
-
680
- // In:
681
- // [{error: "<message 1>", ...}, {error: "<message 2>", ...}]
682
- // Out:
683
- // ["<message 1>", "<message 2>"]
684
- flattenErrorsToArray: function(errors) {
685
- return errors
686
- .map(function(error) { return error.error; })
687
- .filter(function(value, index, self) {
688
- return self.indexOf(value) === index;
689
- });
690
- },
691
-
692
- cleanAttributes: function(attributes, whitelist) {
693
- function whitelistCreator(obj, key, last) {
694
- if (v.isObject(obj[key])) {
695
- return obj[key];
696
- }
697
- return (obj[key] = last ? true : {});
698
- }
699
-
700
- function buildObjectWhitelist(whitelist) {
701
- var ow = {}
702
- , lastObject
703
- , attr;
704
- for (attr in whitelist) {
705
- if (!whitelist[attr]) {
706
- continue;
707
- }
708
- v.forEachKeyInKeypath(ow, attr, whitelistCreator);
709
- }
710
- return ow;
711
- }
712
-
713
- function cleanRecursive(attributes, whitelist) {
714
- if (!v.isObject(attributes)) {
715
- return attributes;
716
- }
717
-
718
- var ret = v.extend({}, attributes)
719
- , w
720
- , attribute;
721
-
722
- for (attribute in attributes) {
723
- w = whitelist[attribute];
724
-
725
- if (v.isObject(w)) {
726
- ret[attribute] = cleanRecursive(ret[attribute], w);
727
- } else if (!w) {
728
- delete ret[attribute];
729
- }
730
- }
731
- return ret;
732
- }
733
-
734
- if (!v.isObject(whitelist) || !v.isObject(attributes)) {
735
- return {};
736
- }
737
-
738
- whitelist = buildObjectWhitelist(whitelist);
739
- return cleanRecursive(attributes, whitelist);
740
- },
741
-
742
- exposeModule: function(validate, root, exports, module, define) {
743
- if (exports) {
744
- if (module && module.exports) {
745
- exports = module.exports = validate;
746
- }
747
- exports.validate = validate;
748
- } else {
749
- root.validate = validate;
750
- if (validate.isFunction(define) && define.amd) {
751
- define([], function () { return validate; });
752
- }
753
- }
754
- },
755
-
756
- warn: function(msg) {
757
- if (typeof console !== "undefined" && console.warn) {
758
- console.warn("[validate.js] " + msg);
759
- }
760
- },
761
-
762
- error: function(msg) {
763
- if (typeof console !== "undefined" && console.error) {
764
- console.error("[validate.js] " + msg);
765
- }
766
- }
767
- });
768
-
769
- validate.validators = {
770
- // Presence validates that the value isn't empty
771
- presence: function(value, options) {
772
- options = v.extend({}, this.options, options);
773
- if (options.allowEmpty !== false ? !v.isDefined(value) : v.isEmpty(value)) {
774
- return options.message || this.message || "can't be blank";
775
- }
776
- },
777
- length: function(value, options, attribute) {
778
- // Empty values are allowed
779
- if (!v.isDefined(value)) {
780
- return;
781
- }
782
-
783
- options = v.extend({}, this.options, options);
784
-
785
- var is = options.is
786
- , maximum = options.maximum
787
- , minimum = options.minimum
788
- , tokenizer = options.tokenizer || function(val) { return val; }
789
- , err
790
- , errors = [];
791
-
792
- value = tokenizer(value);
793
- var length = value.length;
794
- if(!v.isNumber(length)) {
795
- return options.message || this.notValid || "has an incorrect length";
796
- }
797
-
798
- // Is checks
799
- if (v.isNumber(is) && length !== is) {
800
- err = options.wrongLength ||
801
- this.wrongLength ||
802
- "is the wrong length (should be %{count} characters)";
803
- errors.push(v.format(err, {count: is}));
804
- }
805
-
806
- if (v.isNumber(minimum) && length < minimum) {
807
- err = options.tooShort ||
808
- this.tooShort ||
809
- "is too short (minimum is %{count} characters)";
810
- errors.push(v.format(err, {count: minimum}));
811
- }
812
-
813
- if (v.isNumber(maximum) && length > maximum) {
814
- err = options.tooLong ||
815
- this.tooLong ||
816
- "is too long (maximum is %{count} characters)";
817
- errors.push(v.format(err, {count: maximum}));
818
- }
819
-
820
- if (errors.length > 0) {
821
- return options.message || errors;
822
- }
823
- },
824
- numericality: function(value, options, attribute, attributes, globalOptions) {
825
- // Empty values are fine
826
- if (!v.isDefined(value)) {
827
- return;
828
- }
829
-
830
- options = v.extend({}, this.options, options);
831
-
832
- var errors = []
833
- , name
834
- , count
835
- , checks = {
836
- greaterThan: function(v, c) { return v > c; },
837
- greaterThanOrEqualTo: function(v, c) { return v >= c; },
838
- equalTo: function(v, c) { return v === c; },
839
- lessThan: function(v, c) { return v < c; },
840
- lessThanOrEqualTo: function(v, c) { return v <= c; },
841
- divisibleBy: function(v, c) { return v % c === 0; }
842
- }
843
- , prettify = options.prettify ||
844
- (globalOptions && globalOptions.prettify) ||
845
- v.prettify;
846
-
847
- // Strict will check that it is a valid looking number
848
- if (v.isString(value) && options.strict) {
849
- var pattern = "^-?(0|[1-9]\\d*)";
850
- if (!options.onlyInteger) {
851
- pattern += "(\\.\\d+)?";
852
- }
853
- pattern += "$";
854
-
855
- if (!(new RegExp(pattern).test(value))) {
856
- return options.message ||
857
- options.notValid ||
858
- this.notValid ||
859
- this.message ||
860
- "must be a valid number";
861
- }
862
- }
863
-
864
- // Coerce the value to a number unless we're being strict.
865
- if (options.noStrings !== true && v.isString(value) && !v.isEmpty(value)) {
866
- value = +value;
867
- }
868
-
869
- // If it's not a number we shouldn't continue since it will compare it.
870
- if (!v.isNumber(value)) {
871
- return options.message ||
872
- options.notValid ||
873
- this.notValid ||
874
- this.message ||
875
- "is not a number";
876
- }
877
-
878
- // Same logic as above, sort of. Don't bother with comparisons if this
879
- // doesn't pass.
880
- if (options.onlyInteger && !v.isInteger(value)) {
881
- return options.message ||
882
- options.notInteger ||
883
- this.notInteger ||
884
- this.message ||
885
- "must be an integer";
886
- }
887
-
888
- for (name in checks) {
889
- count = options[name];
890
- if (v.isNumber(count) && !checks[name](value, count)) {
891
- // This picks the default message if specified
892
- // For example the greaterThan check uses the message from
893
- // this.notGreaterThan so we capitalize the name and prepend "not"
894
- var key = "not" + v.capitalize(name);
895
- var msg = options[key] ||
896
- this[key] ||
897
- this.message ||
898
- "must be %{type} %{count}";
899
-
900
- errors.push(v.format(msg, {
901
- count: count,
902
- type: prettify(name)
903
- }));
904
- }
905
- }
906
-
907
- if (options.odd && value % 2 !== 1) {
908
- errors.push(options.notOdd ||
909
- this.notOdd ||
910
- this.message ||
911
- "must be odd");
912
- }
913
- if (options.even && value % 2 !== 0) {
914
- errors.push(options.notEven ||
915
- this.notEven ||
916
- this.message ||
917
- "must be even");
918
- }
919
-
920
- if (errors.length) {
921
- return options.message || errors;
922
- }
923
- },
924
- datetime: v.extend(function(value, options) {
925
- if (!v.isFunction(this.parse) || !v.isFunction(this.format)) {
926
- throw new Error("Both the parse and format functions needs to be set to use the datetime/date validator");
927
- }
928
-
929
- // Empty values are fine
930
- if (!v.isDefined(value)) {
931
- return;
932
- }
933
-
934
- options = v.extend({}, this.options, options);
935
-
936
- var err
937
- , errors = []
938
- , earliest = options.earliest ? this.parse(options.earliest, options) : NaN
939
- , latest = options.latest ? this.parse(options.latest, options) : NaN;
940
-
941
- value = this.parse(value, options);
942
-
943
- // 86400000 is the number of milliseconds in a day, this is used to remove
944
- // the time from the date
945
- if (isNaN(value) || options.dateOnly && value % 86400000 !== 0) {
946
- err = options.notValid ||
947
- options.message ||
948
- this.notValid ||
949
- "must be a valid date";
950
- return v.format(err, {value: arguments[0]});
951
- }
952
-
953
- if (!isNaN(earliest) && value < earliest) {
954
- err = options.tooEarly ||
955
- options.message ||
956
- this.tooEarly ||
957
- "must be no earlier than %{date}";
958
- err = v.format(err, {
959
- value: this.format(value, options),
960
- date: this.format(earliest, options)
961
- });
962
- errors.push(err);
963
- }
964
-
965
- if (!isNaN(latest) && value > latest) {
966
- err = options.tooLate ||
967
- options.message ||
968
- this.tooLate ||
969
- "must be no later than %{date}";
970
- err = v.format(err, {
971
- date: this.format(latest, options),
972
- value: this.format(value, options)
973
- });
974
- errors.push(err);
975
- }
976
-
977
- if (errors.length) {
978
- return v.unique(errors);
979
- }
980
- }, {
981
- parse: null,
982
- format: null
983
- }),
984
- date: function(value, options) {
985
- options = v.extend({}, options, {dateOnly: true});
986
- return v.validators.datetime.call(v.validators.datetime, value, options);
987
- },
988
- format: function(value, options) {
989
- if (v.isString(options) || (options instanceof RegExp)) {
990
- options = {pattern: options};
991
- }
992
-
993
- options = v.extend({}, this.options, options);
994
-
995
- var message = options.message || this.message || "is invalid"
996
- , pattern = options.pattern
997
- , match;
998
-
999
- // Empty values are allowed
1000
- if (!v.isDefined(value)) {
1001
- return;
1002
- }
1003
- if (!v.isString(value)) {
1004
- return message;
1005
- }
1006
-
1007
- if (v.isString(pattern)) {
1008
- pattern = new RegExp(options.pattern, options.flags);
1009
- }
1010
- match = pattern.exec(value);
1011
- if (!match || match[0].length != value.length) {
1012
- return message;
1013
- }
1014
- },
1015
- inclusion: function(value, options) {
1016
- // Empty values are fine
1017
- if (!v.isDefined(value)) {
1018
- return;
1019
- }
1020
- if (v.isArray(options)) {
1021
- options = {within: options};
1022
- }
1023
- options = v.extend({}, this.options, options);
1024
- if (v.contains(options.within, value)) {
1025
- return;
1026
- }
1027
- var message = options.message ||
1028
- this.message ||
1029
- "^%{value} is not included in the list";
1030
- return v.format(message, {value: value});
1031
- },
1032
- exclusion: function(value, options) {
1033
- // Empty values are fine
1034
- if (!v.isDefined(value)) {
1035
- return;
1036
- }
1037
- if (v.isArray(options)) {
1038
- options = {within: options};
1039
- }
1040
- options = v.extend({}, this.options, options);
1041
- if (!v.contains(options.within, value)) {
1042
- return;
1043
- }
1044
- var message = options.message || this.message || "^%{value} is restricted";
1045
- if (v.isString(options.within[value])) {
1046
- value = options.within[value];
1047
- }
1048
- return v.format(message, {value: value});
1049
- },
1050
- email: v.extend(function(value, options) {
1051
- options = v.extend({}, this.options, options);
1052
- var message = options.message || this.message || "is not a valid email";
1053
- // Empty values are fine
1054
- if (!v.isDefined(value)) {
1055
- return;
1056
- }
1057
- if (!v.isString(value)) {
1058
- return message;
1059
- }
1060
- if (!this.PATTERN.exec(value)) {
1061
- return message;
1062
- }
1063
- }, {
1064
- PATTERN: /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i
1065
- }),
1066
- equality: function(value, options, attribute, attributes, globalOptions) {
1067
- if (!v.isDefined(value)) {
1068
- return;
1069
- }
1070
-
1071
- if (v.isString(options)) {
1072
- options = {attribute: options};
1073
- }
1074
- options = v.extend({}, this.options, options);
1075
- var message = options.message ||
1076
- this.message ||
1077
- "is not equal to %{attribute}";
1078
-
1079
- if (v.isEmpty(options.attribute) || !v.isString(options.attribute)) {
1080
- throw new Error("The attribute must be a non empty string");
1081
- }
1082
-
1083
- var otherValue = v.getDeepObjectValue(attributes, options.attribute)
1084
- , comparator = options.comparator || function(v1, v2) {
1085
- return v1 === v2;
1086
- }
1087
- , prettify = options.prettify ||
1088
- (globalOptions && globalOptions.prettify) ||
1089
- v.prettify;
1090
-
1091
- if (!comparator(value, otherValue, options, attribute, attributes)) {
1092
- return v.format(message, {attribute: prettify(options.attribute)});
1093
- }
1094
- },
1095
- // A URL validator that is used to validate URLs with the ability to
1096
- // restrict schemes and some domains.
1097
- url: function(value, options) {
1098
- if (!v.isDefined(value)) {
1099
- return;
1100
- }
1101
-
1102
- options = v.extend({}, this.options, options);
1103
-
1104
- var message = options.message || this.message || "is not a valid url"
1105
- , schemes = options.schemes || this.schemes || ['http', 'https']
1106
- , allowLocal = options.allowLocal || this.allowLocal || false
1107
- , allowDataUrl = options.allowDataUrl || this.allowDataUrl || false;
1108
- if (!v.isString(value)) {
1109
- return message;
1110
- }
1111
-
1112
- // https://gist.github.com/dperini/729294
1113
- var regex =
1114
- "^" +
1115
- // protocol identifier
1116
- "(?:(?:" + schemes.join("|") + ")://)" +
1117
- // user:pass authentication
1118
- "(?:\\S+(?::\\S*)?@)?" +
1119
- "(?:";
1120
-
1121
- var tld = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";
1122
-
1123
- if (allowLocal) {
1124
- tld += "?";
1125
- } else {
1126
- regex +=
1127
- // IP address exclusion
1128
- // private & local networks
1129
- "(?!(?:10|127)(?:\\.\\d{1,3}){3})" +
1130
- "(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})" +
1131
- "(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})";
1132
- }
1133
-
1134
- regex +=
1135
- // IP address dotted notation octets
1136
- // excludes loopback network 0.0.0.0
1137
- // excludes reserved space >= 224.0.0.0
1138
- // excludes network & broacast addresses
1139
- // (first & last IP address of each class)
1140
- "(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])" +
1141
- "(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}" +
1142
- "(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))" +
1143
- "|" +
1144
- // host name
1145
- "(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)" +
1146
- // domain name
1147
- "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*" +
1148
- tld +
1149
- ")" +
1150
- // port number
1151
- "(?::\\d{2,5})?" +
1152
- // resource path
1153
- "(?:[/?#]\\S*)?" +
1154
- "$";
1155
-
1156
- if (allowDataUrl) {
1157
- // RFC 2397
1158
- var mediaType = "\\w+\\/[-+.\\w]+(?:;[\\w=]+)*";
1159
- var urlchar = "[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*";
1160
- var dataurl = "data:(?:"+mediaType+")?(?:;base64)?,"+urlchar;
1161
- regex = "(?:"+regex+")|(?:^"+dataurl+"$)";
1162
- }
1163
-
1164
- var PATTERN = new RegExp(regex, 'i');
1165
- if (!PATTERN.exec(value)) {
1166
- return message;
1167
- }
1168
- },
1169
- type: v.extend(function(value, originalOptions, attribute, attributes, globalOptions) {
1170
- if (v.isString(originalOptions)) {
1171
- originalOptions = {type: originalOptions};
1172
- }
1173
-
1174
- if (!v.isDefined(value)) {
1175
- return;
1176
- }
1177
-
1178
- var options = v.extend({}, this.options, originalOptions);
1179
-
1180
- var type = options.type;
1181
- if (!v.isDefined(type)) {
1182
- throw new Error("No type was specified");
1183
- }
1184
-
1185
- var check;
1186
- if (v.isFunction(type)) {
1187
- check = type;
1188
- } else {
1189
- check = this.types[type];
1190
- }
1191
-
1192
- if (!v.isFunction(check)) {
1193
- throw new Error("validate.validators.type.types." + type + " must be a function.");
1194
- }
1195
-
1196
- if (!check(value, options, attribute, attributes, globalOptions)) {
1197
- var message = originalOptions.message ||
1198
- this.messages[type] ||
1199
- this.message ||
1200
- options.message ||
1201
- (v.isFunction(type) ? "must be of the correct type" : "must be of type %{type}");
1202
-
1203
- if (v.isFunction(message)) {
1204
- message = message(value, originalOptions, attribute, attributes, globalOptions);
1205
- }
1206
-
1207
- return v.format(message, {attribute: v.prettify(attribute), type: type});
1208
- }
1209
- }, {
1210
- types: {
1211
- object: function(value) {
1212
- return v.isObject(value) && !v.isArray(value);
1213
- },
1214
- array: v.isArray,
1215
- integer: v.isInteger,
1216
- number: v.isNumber,
1217
- string: v.isString,
1218
- date: v.isDate,
1219
- boolean: v.isBoolean
1220
- },
1221
- messages: {}
1222
- })
1223
- };
1224
-
1225
- validate.formatters = {
1226
- detailed: function(errors) {return errors;},
1227
- flat: v.flattenErrorsToArray,
1228
- grouped: function(errors) {
1229
- var attr;
1230
-
1231
- errors = v.groupErrorsByAttribute(errors);
1232
- for (attr in errors) {
1233
- errors[attr] = v.flattenErrorsToArray(errors[attr]);
1234
- }
1235
- return errors;
1236
- },
1237
- constraint: function(errors) {
1238
- var attr;
1239
- errors = v.groupErrorsByAttribute(errors);
1240
- for (attr in errors) {
1241
- errors[attr] = errors[attr].map(function(result) {
1242
- return result.validator;
1243
- }).sort();
1244
- }
1245
- return errors;
1246
- }
1247
- };
1248
-
1249
- validate.exposeModule(validate, this, exports, module, define);
1250
- }).call(this,
1251
- typeof exports !== 'undefined' ? /* istanbul ignore next */ exports : null,
1252
- typeof module !== 'undefined' ? /* istanbul ignore next */ module : null,
1253
- typeof define !== 'undefined' ? /* istanbul ignore next */ define : null);