@ar.io/sdk 2.0.0-alpha.1 → 2.0.0-alpha.3
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 +24 -1
- package/bundles/web.bundle.min.js +131 -98
- package/lib/cjs/common/ant.js +294 -3
- package/lib/cjs/common/contracts/ao-process.js +1 -1
- package/lib/cjs/common/http.js +1 -2
- package/lib/cjs/common/index.js +0 -1
- package/lib/cjs/common/io.js +0 -4
- package/lib/cjs/common/logger.js +31 -19
- package/lib/cjs/utils/http-client.js +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/ant.js +290 -1
- package/lib/esm/common/contracts/ao-process.js +2 -2
- package/lib/esm/common/http.js +2 -3
- package/lib/esm/common/index.js +0 -1
- package/lib/esm/common/io.js +0 -4
- package/lib/esm/common/logger.js +29 -14
- package/lib/esm/utils/http-client.js +2 -2
- package/lib/esm/version.js +1 -1
- package/lib/types/common/ant.d.ts +176 -1
- package/lib/types/common/contracts/ao-process.d.ts +2 -2
- package/lib/types/common/http.d.ts +3 -2
- package/lib/types/common/index.d.ts +0 -1
- package/lib/types/common/logger.d.ts +10 -3
- package/lib/types/common.d.ts +0 -7
- package/lib/types/utils/http-client.d.ts +2 -2
- package/lib/types/version.d.ts +1 -1
- package/package.json +5 -5
- package/lib/cjs/common/ant-ao.js +0 -297
- package/lib/esm/common/ant-ao.js +0 -292
- package/lib/types/common/ant-ao.d.ts +0 -194
package/README.md
CHANGED
|
@@ -42,6 +42,7 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
|
|
|
42
42
|
- [Configuration](#custom-configuration)
|
|
43
43
|
|
|
44
44
|
- [Arweave Name Tokens (ANT's)](#arweave-name-tokens-ants)
|
|
45
|
+
|
|
45
46
|
- [ANT APIs](#ant-apis)
|
|
46
47
|
- [`init({ signer})`](#init-signer-)
|
|
47
48
|
- [`getInfo()`](#getinfo)
|
|
@@ -56,6 +57,11 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
|
|
|
56
57
|
- [`setName({ name })`](#setname-name-)
|
|
57
58
|
- [`setTicker({ ticker })`](#setticker-ticker-)
|
|
58
59
|
- [Configuration](#configuration)
|
|
60
|
+
|
|
61
|
+
- [Logging](#logging)
|
|
62
|
+
|
|
63
|
+
- [Configuration](#configuration)
|
|
64
|
+
|
|
59
65
|
- [Developers](#developers)
|
|
60
66
|
- [Requirements](#requirements)
|
|
61
67
|
- [Setup \& Build](#setup--build)
|
|
@@ -148,7 +154,7 @@ const gateways = await io.getGateways();
|
|
|
148
154
|
```
|
|
149
155
|
|
|
150
156
|
> [!WARNING]
|
|
151
|
-
> Polyfills are not provided by default for
|
|
157
|
+
> 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.
|
|
152
158
|
|
|
153
159
|
#### Browser
|
|
154
160
|
|
|
@@ -1136,6 +1142,22 @@ const ant = ANT.init({
|
|
|
1136
1142
|
});
|
|
1137
1143
|
```
|
|
1138
1144
|
|
|
1145
|
+
## Logging
|
|
1146
|
+
|
|
1147
|
+
The library uses the [Winston] logger for node based projects, and `console` logger for web based projects by default. You can configure the log level via `setLogLevel()` API. Alternatively you can set a custom logger as the default logger so long as it satisfes the `ILogger` interface.
|
|
1148
|
+
|
|
1149
|
+
### Configuration
|
|
1150
|
+
|
|
1151
|
+
```typescript
|
|
1152
|
+
import { Logger } from '@ar.io/sdk';
|
|
1153
|
+
|
|
1154
|
+
// set the log level
|
|
1155
|
+
Logger.default.setLogLevel('debug');
|
|
1156
|
+
|
|
1157
|
+
// provide your own logger
|
|
1158
|
+
Logger.default = winston.createLogger({ ...loggerConfigs }); // or some other logger that satisifes ILogger interface
|
|
1159
|
+
```
|
|
1160
|
+
|
|
1139
1161
|
## Developers
|
|
1140
1162
|
|
|
1141
1163
|
### Requirements
|
|
@@ -1184,3 +1206,4 @@ For more information on how to contribute, please see [CONTRIBUTING.md].
|
|
|
1184
1206
|
[AO Connect]: https://github.com/permaweb/ao/tree/main/connect
|
|
1185
1207
|
[IO testnet process]: https://www.ao.link/#/entity/agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA
|
|
1186
1208
|
[IO Network spec]: https://github.com/ar-io/ar-io-network-process?tab=readme-ov-file#contract-spec
|
|
1209
|
+
[Winston]: https://www.npmjs.com/package/winston
|