@ar.io/sdk 2.1.0-alpha.6 → 2.1.0-alpha.8

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 CHANGED
@@ -6,18 +6,24 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
6
6
 
7
7
  ## Table of Contents
8
8
 
9
+ <!-- toc -->
10
+
11
+ - [Table of Contents](#table-of-contents)
9
12
  - [Prerequisites](#prerequisites)
10
13
  - [Installation](#installation)
11
14
  - [Quick Start](#quick-start)
12
15
  - [Usage](#usage)
13
16
  - [Web](#web)
17
+ - [Bundlers (Webpack, Rollup, ESbuild, etc.)](#bundlers-webpack-rollup-esbuild-etc)
18
+ - [Browser](#browser)
14
19
  - [Node](#node)
20
+ - [ESM (NodeNext)](#esm-nodenext)
21
+ - [CJS](#cjs)
15
22
  - [Typescript](#typescript)
16
23
  - [IOToken & mIOToken](#iotoken--miotoken)
17
24
  - [Converting IO to mIO](#converting-io-to-mio)
18
25
  - [IO Process](#io-process)
19
-
20
- - [IO APIs](#apis)
26
+ - [APIs](#apis)
21
27
  - [`init({ signer })`](#init-signer-)
22
28
  - [`getInfo()`](#getinfo)
23
29
  - [`getTokenSupply()`](#gettokensupply)
@@ -32,6 +38,7 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
32
38
  - [`getEpoch({ epochIndex })`](#getepoch-epochindex-)
33
39
  - [`getCurrentEpoch()`](#getcurrentepoch)
34
40
  - [`getPrescribedObservers({ epochIndex })`](#getprescribedobservers-epochindex-)
41
+ - [`getTokenCost({ intent, ...args })`](#gettokencost-intent-args-)
35
42
  - [`joinNetwork(params)`](#joinnetworkparams)
36
43
  - [`leaveNetwork()`](#leavenetwork)
37
44
  - [`updateGatewaySettings(gatewaySettings)`](#updategatewaysettingsgatewaysettings)
@@ -43,13 +50,12 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
43
50
  - [`transfer({ target, qty })`](#transfer-target-qty-)
44
51
  - [`increaseUndernameLimit({ name, qty })`](#increaseundernamelimit-name-qty-)
45
52
  - [`extendLease({ name, years })`](#extendlease-name-years-)
46
- - [Configuration](#custom-configuration)
47
-
53
+ - [Configuration](#configuration)
48
54
  - [Arweave Name Tokens (ANT's)](#arweave-name-tokens-ants)
49
-
50
55
  - [ANT APIs](#ant-apis)
51
56
  - [`init({ processId, signer })`](#init-processid-signer-)
52
- - [`getInfo()`](#getinfo)
57
+ - [`getInfo()`](#getinfo-1)
58
+ - [`getState()`](#getstate)
53
59
  - [`getOwner()`](#getowner)
54
60
  - [`getControllers()`](#getcontrollers)
55
61
  - [`getRecords()`](#getrecords)
@@ -60,21 +66,19 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
60
66
  - [`removeRecord({ undername })`](#removerecord-undername-)
61
67
  - [`setName({ name })`](#setname-name-)
62
68
  - [`setTicker({ ticker })`](#setticker-ticker-)
63
- - [Configuration](#configuration)
64
-
69
+ - [Configuration](#configuration-1)
65
70
  - [Logging](#logging)
66
-
67
- - [Configuration](#configuration)
68
-
71
+ - [Configuration](#configuration-2)
69
72
  - [Pagination](#pagination)
70
-
71
73
  - [Developers](#developers)
72
74
  - [Requirements](#requirements)
73
- - [Setup \& Build](#setup--build)
75
+ - [Setup & Build](#setup--build)
74
76
  - [Testing](#testing)
75
- - [Linting \& Formatting](#linting--formatting)
77
+ - [Linting & Formatting](#linting--formatting)
76
78
  - [Architecture](#architecture)
77
79
 
80
+ <!-- tocstop -->
81
+
78
82
  ## Prerequisites
79
83
 
80
84
  - `node>=v18.0.0`
@@ -1005,7 +1009,7 @@ The ANT client class exposes APIs relevant to compliant Arweave Name Token proce
1005
1009
 
1006
1010
  ### ANT APIs
1007
1011
 
1008
- #### `init({ processId, signer )`
1012
+ #### `init({ processId, signer })`
1009
1013
 
1010
1014
  Factory function to that creates a read-only or writeable client. By providing a `signer` additional write APIs that require signing, like `setRecord` and `transfer` are available. By default, a read-only client is returned and no write APIs are available.
1011
1015
 
@@ -1045,6 +1049,49 @@ const info = await ant.getInfo();
1045
1049
 
1046
1050
  </details>
1047
1051
 
1052
+ #### `getState()`
1053
+
1054
+ Retrieves the state of the ANT process.
1055
+
1056
+ ```typescript
1057
+ const state = await ant.getState();
1058
+ ```
1059
+
1060
+ <details>
1061
+ <summary>Output</summary>
1062
+
1063
+ ```json
1064
+ {
1065
+ "TotalSupply": 1,
1066
+ "Balances": {
1067
+ "98O1_xqDLrBKRfQPWjF5p7xZ4Jx6GM8P5PeJn26xwUY": 1
1068
+ },
1069
+ "Controllers": [],
1070
+ "Records": {
1071
+ "v1-0-0_whitepaper": {
1072
+ "transactionId": "lNjWn3LpyhKC95Kqe-x8X2qgju0j98MhucdDKK85vc4",
1073
+ "ttlSeconds": 900
1074
+ },
1075
+ "@": {
1076
+ "transactionId": "2rMLb2uHAyEt7jSu6bXtKx8e-jOfIf7E-DOgQnm8EtU",
1077
+ "ttlSeconds": 3600
1078
+ },
1079
+ "whitepaper": {
1080
+ "transactionId": "lNjWn3LpyhKC95Kqe-x8X2qgju0j98MhucdDKK85vc4",
1081
+ "ttlSeconds": 900
1082
+ }
1083
+ },
1084
+ "Initialized": true,
1085
+ "Ticker": "ANT-AR-IO",
1086
+ "Logo": "Sie_26dvgyok0PZD_-iQAFOhOd5YxDTkczOLoqTTL_A",
1087
+ "Denomination": 0,
1088
+ "Name": "AR.IO Foundation",
1089
+ "Owner": "98O1_xqDLrBKRfQPWjF5p7xZ4Jx6GM8P5PeJn26xwUY"
1090
+ }
1091
+ ```
1092
+
1093
+ </details>
1094
+
1048
1095
  #### `getOwner()`
1049
1096
 
1050
1097
  Returns the owner of the configured ANT process.