diff --git a/.gitignore b/.gitignore index 5e2f0fa6..32ff1c4e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ dist cache # IDEs and editors -.vscode .DS_Store yarn-error.log diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..1979959e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,25 @@ +{ + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + "editor.formatOnPaste": true, + "editor.formatOnSaveMode": "file", + "prettier.configPath": ".prettierrc", + "prettier.prettierPath": "./node_modules/prettier/index.cjs", + "[typescript]": { + "editor.formatOnSave": true + }, + "[markdown]": { + "editor.formatOnSave": true + }, + "search.exclude": { + "**/node_modules": true, + "**/lib": true, + "**/dist": true, + "**/coverage": true + }, + "markdownlint.config": { + "MD033": { + "allowed_elements": ["details", "summary"] + } + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md index c855a13a..d008e811 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.0.1](https://github.com/ar-io/ar-io-sdk/compare/v1.0.0...v1.0.1) (2024-04-23) + + +### Bug Fixes + +* **docs:** improve README docs interface documentation for ArIO clients ([b0da48c](https://github.com/ar-io/ar-io-sdk/commit/b0da48c77718020f79dc56fe04ca49a11f018fa6)) + # 1.0.0 (2024-04-23) diff --git a/README.md b/README.md index abbb36b5..ed83d4a7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# @ar-io/sdk +# @ar.io/sdk [![codecov](https://codecov.io/gh/ar-io/ar-io-sdk/graph/badge.svg?token=7dXKcT7dJy)](https://codecov.io/gh/ar-io/ar-io-sdk) @@ -67,65 +67,65 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting ## Installation ```shell -npm install @ar-io/sdk +npm install @ar.io/sdk ``` or ```shell -yarn add @ar-io/sdk +yarn add @ar.io/sdk ``` ## Quick Start ```typescript -import { ArIO } from '@ar-io/sdk'; +import { ArIO } from '@ar.io/sdk'; const arIO = ArIO.init(); -const gateways = arIO.getGateways(); - -// outputs: - -// { -// "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ": { -// "end": 0, -// "observerWallet": "IPdwa3Mb_9pDD8c2IaJx6aad51Ss-_TfStVwBuhtXMs", -// "operatorStake": 250000, -// "settings": { -// "fqdn": "ar-io.dev", -// "label": "AR.IO Test", -// "note": "Test Gateway operated by PDS for the AR.IO ecosystem.", -// "port": 443, -// "properties": "raJgvbFU-YAnku-WsupIdbTsqqGLQiYpGzoqk9SCVgY", -// "protocol": "https" -// }, -// "start": 1256694, -// "stats": { -// "failedConsecutiveEpochs": 0, -// "passedEpochCount": 30, -// "submittedEpochCount": 30, -// "totalEpochParticipationCount": 31, -// "totalEpochsPrescribedCount": 31 -// }, -// "status": "joined", -// "vaults": {}, -// "weights": { -// "stakeWeight": 25, -// "tenureWeight": 0.9031327160493827, -// "gatewayRewardRatioWeight": 0.96875, -// "observerRewardRatioWeight": 0.96875, -// "compositeWeight": 21.189222170982834, -// "normalizedCompositeWeight": 0.27485583057217183 -// } -// }, -// "-RlCrWmyn9OaJ86tsr5qhmFRc0h5ovT5xjKQwySGZy0": { -// "end": 0, -// "observerWallet": "-RlCrWmyn9OaJ86tsr5qhmFRc0h5ovT5xjKQwySGZy0", -// "operatorStake": 11300, -// ... -// } +const gateways = await arIO.getGateways(); +``` + +
+ Output + +```json +{ + "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ": { + "end": 0, + "observerWallet": "IPdwa3Mb_9pDD8c2IaJx6aad51Ss-_TfStVwBuhtXMs", + "operatorStake": 250000, + "settings": { + "fqdn": "ar-io.dev", + "label": "AR.IO Test", + "note": "Test Gateway operated by PDS for the AR.IO ecosystem.", + "port": 443, + "properties": "raJgvbFU-YAnku-WsupIdbTsqqGLQiYpGzoqk9SCVgY", + "protocol": "https" + }, + "start": 1256694, + "stats": { + "failedConsecutiveEpochs": 0, + "passedEpochCount": 30, + "submittedEpochCount": 30, + "totalEpochParticipationCount": 31, + "totalEpochsPrescribedCount": 31 + }, + "status": "joined", + "vaults": {}, + "weights": { + "stakeWeight": 25, + "tenureWeight": 0.9031327160493827, + "gatewayRewardRatioWeight": 0.96875, + "observerRewardRatioWeight": 0.96875, + "compositeWeight": 21.189222170982834, + "normalizedCompositeWeight": 0.27485583057217183 + } + } +} ``` +
+ ## Usage The SDK is provided in both CommonJS and ESM formats and is compatible with bundlers such as Webpack, Rollup, and ESbuild. Utilize the appropriately named exports provided by this SDK's [package.json] based on your project's configuration. Refer to the [examples] directory to see how to use the SDK in various environments. @@ -135,19 +135,19 @@ The SDK is provided in both CommonJS and ESM formats and is compatible with bund #### Bundlers (Webpack, Rollup, ESbuild, etc.) ```javascript -import { ArIO } from '@ar-io/sdk'; +import { ArIO } from '@ar.io/sdk'; // set up client const arIO = ArIO.init(); // fetch gateways -const gateways = arIO.getGateways(); +const gateways = await arIO.getGateways(); ``` #### Browser ```html