@ar.io/sdk 2.3.2-alpha.4 → 2.3.3-alpha.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 (56) hide show
  1. package/README.md +28 -3
  2. package/bundles/web.bundle.min.js +63 -63
  3. package/lib/cjs/common/ant-registry.js +8 -8
  4. package/lib/cjs/common/ant.js +47 -24
  5. package/lib/cjs/common/io.js +1 -1
  6. package/lib/cjs/node/index.js +1 -1
  7. package/lib/cjs/types/ant.js +122 -0
  8. package/lib/cjs/types/common.js +2 -0
  9. package/lib/cjs/{io.js → types/io.js} +1 -1
  10. package/lib/cjs/{token.js → types/token.js} +1 -1
  11. package/lib/cjs/utils/ao.js +1 -35
  12. package/lib/cjs/utils/arweave.js +15 -0
  13. package/lib/cjs/utils/index.js +1 -0
  14. package/lib/cjs/utils/processes.js +1 -0
  15. package/lib/cjs/utils/schema.js +17 -0
  16. package/lib/cjs/version.js +1 -1
  17. package/lib/cjs/web/index.js +1 -1
  18. package/lib/esm/common/ant-registry.js +1 -1
  19. package/lib/esm/common/ant.js +40 -17
  20. package/lib/esm/common/io.js +1 -1
  21. package/lib/esm/node/index.js +1 -1
  22. package/lib/esm/types/ant.js +118 -0
  23. package/lib/esm/types/common.js +1 -0
  24. package/lib/esm/{io.js → types/io.js} +1 -1
  25. package/lib/esm/{token.js → types/token.js} +1 -1
  26. package/lib/esm/utils/ao.js +0 -33
  27. package/lib/esm/utils/arweave.js +15 -0
  28. package/lib/esm/utils/index.js +1 -0
  29. package/lib/esm/utils/processes.js +1 -0
  30. package/lib/esm/utils/schema.js +13 -0
  31. package/lib/esm/version.js +1 -1
  32. package/lib/esm/web/index.js +1 -1
  33. package/lib/types/common/ant-registry.d.ts +2 -1
  34. package/lib/types/common/ant.d.ts +23 -29
  35. package/lib/types/common/contracts/ao-process.d.ts +1 -1
  36. package/lib/types/common/http.d.ts +1 -1
  37. package/lib/types/common/io.d.ts +3 -3
  38. package/lib/types/node/index.d.ts +1 -1
  39. package/lib/types/types/ant-registry.d.ts +29 -0
  40. package/lib/types/types/ant.d.ts +190 -0
  41. package/lib/types/{common.d.ts → types/common.d.ts} +20 -0
  42. package/lib/types/{io.d.ts → types/io.d.ts} +2 -103
  43. package/lib/types/utils/ao.d.ts +2 -60
  44. package/lib/types/utils/arweave.d.ts +1 -16
  45. package/lib/types/utils/index.d.ts +1 -0
  46. package/lib/types/utils/processes.d.ts +2 -1
  47. package/lib/types/utils/schema.d.ts +23 -0
  48. package/lib/types/version.d.ts +1 -1
  49. package/lib/types/web/index.d.ts +1 -1
  50. package/package.json +1 -1
  51. /package/lib/cjs/{common.js → types/ant-registry.js} +0 -0
  52. /package/lib/cjs/{types.js → types/index.js} +0 -0
  53. /package/lib/esm/{common.js → types/ant-registry.js} +0 -0
  54. /package/lib/esm/{types.js → types/index.js} +0 -0
  55. /package/lib/types/{types.d.ts → types/index.d.ts} +0 -0
  56. /package/lib/types/{token.d.ts → types/token.d.ts} +0 -0
package/README.md CHANGED
@@ -103,7 +103,7 @@ or
103
103
  yarn add @ar.io/sdk --ignore-engines
104
104
  ```
105
105
 
106
- > [!Info]
106
+ > [!NOTE]
107
107
  > The `--ignore-engines` flag is required when using yarn, as [permaweb/aoconnect] recommends only the use of npm. Alternatively, you can add a `.yarnrc.yml` file to your project containing `ignore-engines true` to ignore the engines check.
108
108
 
109
109
  ## Quick Start
@@ -292,13 +292,38 @@ const info = await io.getInfo();
292
292
 
293
293
  #### `getTokenSupply()`
294
294
 
295
- Retrieves the total supply of tokens, returned in mIO.
295
+ Retrieves the total supply of tokens, returned in mIO. The total supply includes the following:
296
+
297
+ - `total` - the total supply of all tokens
298
+ - `circulating` - the total supply minus locked, withdrawn, delegated, and staked
299
+ - `locked` - tokens that are locked in the protocol (a.k.a. vaulted)
300
+ - `withdrawn` - tokens that have been withdrawn from the protocol by operators and delegators
301
+ - `delegated` - tokens that have been delegated to gateways
302
+ - `staked` - tokens that are staked in the protocol by gateway operators
303
+ - `protocolBalance` - tokens that are held in the protocol's treasury. This is included in the circulating supply.
296
304
 
297
305
  ```typescript
298
306
  const io = IO.init();
299
- const supply = await io.getTokenSupply().then((s) => new mIOToken(s).toIO()); // convert it to IO for readability
307
+ const supply = await io.getTokenSupply();
308
+ ```
309
+
310
+ <details>
311
+ <summary>Output</summary>
312
+
313
+ ```json
314
+ {
315
+ "total": 1000000000000000000,
316
+ "circulating": 998094653842520,
317
+ "locked": 0,
318
+ "withdrawn": 560563387278,
319
+ "delegated": 1750000000,
320
+ "staked": 1343032770199,
321
+ "protocolBalance": 46317263683761
322
+ }
300
323
  ```
301
324
 
325
+ </details>
326
+
302
327
  #### `getBalance({ address })`
303
328
 
304
329
  Retrieves the balance of the specified wallet address.