@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.
- package/README.md +28 -3
- package/bundles/web.bundle.min.js +63 -63
- package/lib/cjs/common/ant-registry.js +8 -8
- package/lib/cjs/common/ant.js +47 -24
- package/lib/cjs/common/io.js +1 -1
- package/lib/cjs/node/index.js +1 -1
- package/lib/cjs/types/ant.js +122 -0
- package/lib/cjs/types/common.js +2 -0
- package/lib/cjs/{io.js → types/io.js} +1 -1
- package/lib/cjs/{token.js → types/token.js} +1 -1
- package/lib/cjs/utils/ao.js +1 -35
- package/lib/cjs/utils/arweave.js +15 -0
- package/lib/cjs/utils/index.js +1 -0
- package/lib/cjs/utils/processes.js +1 -0
- package/lib/cjs/utils/schema.js +17 -0
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/web/index.js +1 -1
- package/lib/esm/common/ant-registry.js +1 -1
- package/lib/esm/common/ant.js +40 -17
- package/lib/esm/common/io.js +1 -1
- package/lib/esm/node/index.js +1 -1
- package/lib/esm/types/ant.js +118 -0
- package/lib/esm/types/common.js +1 -0
- package/lib/esm/{io.js → types/io.js} +1 -1
- package/lib/esm/{token.js → types/token.js} +1 -1
- package/lib/esm/utils/ao.js +0 -33
- package/lib/esm/utils/arweave.js +15 -0
- package/lib/esm/utils/index.js +1 -0
- package/lib/esm/utils/processes.js +1 -0
- package/lib/esm/utils/schema.js +13 -0
- package/lib/esm/version.js +1 -1
- package/lib/esm/web/index.js +1 -1
- package/lib/types/common/ant-registry.d.ts +2 -1
- package/lib/types/common/ant.d.ts +23 -29
- package/lib/types/common/contracts/ao-process.d.ts +1 -1
- package/lib/types/common/http.d.ts +1 -1
- package/lib/types/common/io.d.ts +3 -3
- package/lib/types/node/index.d.ts +1 -1
- package/lib/types/types/ant-registry.d.ts +29 -0
- package/lib/types/types/ant.d.ts +190 -0
- package/lib/types/{common.d.ts → types/common.d.ts} +20 -0
- package/lib/types/{io.d.ts → types/io.d.ts} +2 -103
- package/lib/types/utils/ao.d.ts +2 -60
- package/lib/types/utils/arweave.d.ts +1 -16
- package/lib/types/utils/index.d.ts +1 -0
- package/lib/types/utils/processes.d.ts +2 -1
- package/lib/types/utils/schema.d.ts +23 -0
- package/lib/types/version.d.ts +1 -1
- package/lib/types/web/index.d.ts +1 -1
- package/package.json +1 -1
- /package/lib/cjs/{common.js → types/ant-registry.js} +0 -0
- /package/lib/cjs/{types.js → types/index.js} +0 -0
- /package/lib/esm/{common.js → types/ant-registry.js} +0 -0
- /package/lib/esm/{types.js → types/index.js} +0 -0
- /package/lib/types/{types.d.ts → types/index.d.ts} +0 -0
- /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
|
-
> [!
|
|
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()
|
|
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.
|