index.ts 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /**
  2. * There are many simple utilities required to interact with
  3. * Ethereum and to simplify the library, without increasing
  4. * the library dependencies for simple functions.
  5. *
  6. * @_section api/utils:Utilities [about-utils]
  7. */
  8. export { decodeBase58, encodeBase58 } from "./base58.js";
  9. export { decodeBase64, encodeBase64 } from "./base64.js";
  10. export {
  11. getBytes, getBytesCopy, isHexString, isBytesLike, hexlify, concat, dataLength, dataSlice,
  12. stripZerosLeft, zeroPadValue, zeroPadBytes
  13. } from "./data.js";
  14. export {
  15. isCallException, isError,
  16. assert, assertArgument, assertArgumentCount, assertPrivate, assertNormalize, makeError
  17. } from "./errors.js"
  18. export { EventPayload } from "./events.js";
  19. export {
  20. FetchRequest, FetchResponse, FetchCancelSignal,
  21. } from "./fetch.js";
  22. export { FixedNumber } from "./fixednumber.js"
  23. export {
  24. fromTwos, toTwos, mask,
  25. getBigInt, getNumber, getUint, toBigInt, toNumber, toBeHex, toBeArray, toQuantity
  26. } from "./maths.js";
  27. export { resolveProperties, defineProperties} from "./properties.js";
  28. export { decodeRlp } from "./rlp-decode.js";
  29. export { encodeRlp } from "./rlp-encode.js";
  30. export { formatEther, parseEther, formatUnits, parseUnits } from "./units.js";
  31. export {
  32. toUtf8Bytes,
  33. toUtf8CodePoints,
  34. toUtf8String,
  35. Utf8ErrorFuncs,
  36. } from "./utf8.js";
  37. export { uuidV4 } from "./uuid.js";
  38. /////////////////////////////
  39. // Types
  40. export type { BytesLike } from "./data.js";
  41. export type {
  42. //ErrorFetchRequestWithBody, ErrorFetchRequest,
  43. //ErrorFetchResponseWithBody, ErrorFetchResponse,
  44. ErrorCode,
  45. EthersError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError,
  46. ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError,
  47. NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError,
  48. CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError,
  49. ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError,
  50. ActionRejectedError,
  51. CallExceptionAction, CallExceptionTransaction,
  52. CodedEthersError
  53. } from "./errors.js"
  54. export type { EventEmitterable, Listener } from "./events.js";
  55. export type {
  56. GetUrlResponse,
  57. FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc,
  58. FetchGatewayFunc, FetchGetUrlFunc
  59. } from "./fetch.js";
  60. export type { FixedFormat } from "./fixednumber.js"
  61. export type { BigNumberish, Numeric } from "./maths.js";
  62. export type { RlpStructuredData, RlpStructuredDataish } from "./rlp.js";
  63. export type {
  64. Utf8ErrorFunc,
  65. UnicodeNormalizationForm,
  66. Utf8ErrorReason
  67. } from "./utf8.js";