@ar.io/sdk 1.2.1 → 2.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +5 -1
  2. package/bundles/web.bundle.min.js +132 -331
  3. package/lib/cjs/common/ant.js +1 -351
  4. package/lib/cjs/common/index.js +0 -4
  5. package/lib/cjs/common/io.js +1 -1
  6. package/lib/cjs/common/logger.js +27 -15
  7. package/lib/cjs/types.js +0 -1
  8. package/lib/cjs/utils/arweave.js +1 -15
  9. package/lib/cjs/utils/graphql/index.js +0 -1
  10. package/lib/cjs/utils/index.js +0 -1
  11. package/lib/cjs/version.js +1 -1
  12. package/lib/esm/common/ant.js +2 -350
  13. package/lib/esm/common/index.js +0 -4
  14. package/lib/esm/common/io.js +1 -1
  15. package/lib/esm/common/logger.js +27 -12
  16. package/lib/esm/types.js +0 -1
  17. package/lib/esm/utils/arweave.js +0 -12
  18. package/lib/esm/utils/graphql/index.js +0 -1
  19. package/lib/esm/utils/index.js +0 -1
  20. package/lib/esm/version.js +1 -1
  21. package/lib/types/common/ant.d.ts +1 -274
  22. package/lib/types/common/index.d.ts +0 -3
  23. package/lib/types/common/logger.d.ts +2 -2
  24. package/lib/types/common.d.ts +1 -138
  25. package/lib/types/types.d.ts +0 -1
  26. package/lib/types/utils/arweave.d.ts +0 -5
  27. package/lib/types/utils/graphql/index.d.ts +0 -1
  28. package/lib/types/utils/index.d.ts +0 -1
  29. package/lib/types/version.d.ts +1 -1
  30. package/package.json +5 -10
  31. package/lib/cjs/arns-service.js +0 -2
  32. package/lib/cjs/common/ar-io.js +0 -741
  33. package/lib/cjs/common/contracts/remote-contract.js +0 -55
  34. package/lib/cjs/common/contracts/warp-contract.js +0 -176
  35. package/lib/cjs/common/warp.js +0 -25
  36. package/lib/cjs/utils/graphql/smartweave.js +0 -309
  37. package/lib/cjs/utils/smartweave.js +0 -58
  38. package/lib/esm/arns-service.js +0 -1
  39. package/lib/esm/common/ar-io.js +0 -735
  40. package/lib/esm/common/contracts/remote-contract.js +0 -51
  41. package/lib/esm/common/contracts/warp-contract.js +0 -172
  42. package/lib/esm/common/warp.js +0 -22
  43. package/lib/esm/utils/graphql/smartweave.js +0 -303
  44. package/lib/esm/utils/smartweave.js +0 -50
  45. package/lib/types/arns-service.d.ts +0 -23
  46. package/lib/types/common/ar-io.d.ts +0 -551
  47. package/lib/types/common/contracts/remote-contract.d.ts +0 -38
  48. package/lib/types/common/contracts/warp-contract.d.ts +0 -43
  49. package/lib/types/common/warp.d.ts +0 -1
  50. package/lib/types/utils/graphql/smartweave.d.ts +0 -47
  51. package/lib/types/utils/smartweave.d.ts +0 -41
package/README.md CHANGED
@@ -147,7 +147,8 @@ const io = IO.init();
147
147
  const gateways = await io.getGateways();
148
148
  ```
149
149
 
150
- > _**Note**: polyfills are only provided when using the named `@ar.io/sdk/web` export (which requires `moduleResolution: nodenext` in `tsconfig.json`). If you are using the default export within a Typescript project (e.g. `moduleResolution: node`), you will need to provide your own polyfills - specifically `crypto`, `fs` and `buffer`. Refer to [examples/webpack] and [examples/vite] for references in how to properly provide those polyfills. For other project configurations, refer to your bundler's documentation for more information on how to provide the necessary polyfills._
150
+ > [!WARNING]
151
+ > Polyfills are not provided by default for bundled web projects (Vite, ESBuild, Webpack, Rollup, etc.) . Depending on your apps bundler configuration and plugins, you will need to provide polyfills for various imports including `crypto`, `process` and `buffer`. Refer to [examples/webpack] and [examples/vite] for examples. For other project configurations, refer to your bundler's documentation for more information on how to provide the necessary polyfills.
151
152
 
152
153
  #### Browser
153
154
 
@@ -190,6 +191,9 @@ const gateways = await io.getGateways();
190
191
 
191
192
  The SDK provides TypeScript types. When you import the SDK in a TypeScript project types are exported from `./lib/types/[node/web]/index.d.ts` and should be automatically recognized by package managers, offering benefits such as type-checking and autocompletion.
192
193
 
194
+ > [!NOTE]
195
+ > Typescript version 5.3 or higher is recommended.
196
+
193
197
  ## IOToken & mIOToken
194
198
 
195
199
  The IO process stores all values as mIO (milli-IO) to avoid floating-point arithmetic issues. The SDK provides an `IOToken` and `mIOToken` classes to handle the conversion between IO and mIO, along with rounding logic for precision.