From feab4612d4e95b0fea14a4e0fa9f17a5c57779e1 Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Mon, 14 Oct 2024 20:53:29 -0500 Subject: [PATCH 1/3] fix(io): add getDemandFactor api --- src/common/io.ts | 6 ++++++ src/io.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/src/common/io.ts b/src/common/io.ts index 4193f711..628fb558 100644 --- a/src/common/io.ts +++ b/src/common/io.ts @@ -583,6 +583,12 @@ export class IOReadable implements AoIORead { tags: [{ name: 'Action', value: 'Get-Registration-Fees' }], }); } + + async getDemandFactor(): Promise { + return this.process.read({ + tags: [{ name: 'Action', value: 'Demand-Factor' }], + }); + } } export class IOWriteable extends IOReadable implements AoIOWrite { diff --git a/src/io.ts b/src/io.ts index 568ce397..fdbec661 100644 --- a/src/io.ts +++ b/src/io.ts @@ -372,6 +372,7 @@ export interface AoIORead { quantity?: number; }): Promise; getRegistrationFees(): Promise; + getDemandFactor(): Promise; } export interface AoIOWrite extends AoIORead { From 4e9a0f47d859b6e6d1f2194750cc22acf77449d9 Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Mon, 14 Oct 2024 20:56:56 -0500 Subject: [PATCH 2/3] chore(docs): update README --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 5103f05d..d6998459 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting - [`getGateways({ cursor, limit, sortBy, sortOrder })`](#getgateways-cursor-limit-sortby-sortorder-) - [`getArNSRecord({ name })`](#getarnsrecord-name-) - [`getArNSRecords({ cursor, limit, sortBy, sortOrder })`](#getarnsrecords-cursor-limit-sortby-sortorder-) + - [`getDemandFactor()`](#getdemandfactor) - [`getObservations({ epochIndex })`](#getobservations-epochindex-) - [`getDistributions({ epochIndex })`](#getdistributions-epochindex-) - [`getEpoch({ epochIndex })`](#getepoch-epochindex-) @@ -571,6 +572,24 @@ Available `sortBy` options are any of the keys on the record object, e.g. `name` +#### `getDemandFactor()` + +Retrieves the current demand factor of the network. The demand factor is a multiplier applied to the cost of ArNS interactions based on the current network demand. + +```typescript +const io = IO.init(); +const demandFactor = await io.getDemandFactor(); +``` + +
+ Output + +```json +1.05256 +``` + +
+ #### `getObservations({ epochIndex })` Returns the epoch-indexed observation list. From 2a42ba4ef3d01f024bae68aeb070910e1747f333 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 15 Oct 2024 13:02:50 +0000 Subject: [PATCH 3/3] chore(release): 2.3.2-alpha.2 [skip ci] ## [2.3.2-alpha.2](https://github.com/ar-io/ar-io-sdk/compare/v2.3.2-alpha.1...v2.3.2-alpha.2) (2024-10-15) ### Bug Fixes * **io:** add getDemandFactor api ([feab461](https://github.com/ar-io/ar-io-sdk/commit/feab4612d4e95b0fea14a4e0fa9f17a5c57779e1)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- src/version.ts | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0e08854..0dceba56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.3.2-alpha.2](https://github.com/ar-io/ar-io-sdk/compare/v2.3.2-alpha.1...v2.3.2-alpha.2) (2024-10-15) + + +### Bug Fixes + +* **io:** add getDemandFactor api ([feab461](https://github.com/ar-io/ar-io-sdk/commit/feab4612d4e95b0fea14a4e0fa9f17a5c57779e1)) + ## [2.3.2-alpha.1](https://github.com/ar-io/ar-io-sdk/compare/v2.3.1...v2.3.2-alpha.1) (2024-10-14) diff --git a/package.json b/package.json index 5636094e..5c090e20 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ar.io/sdk", - "version": "2.3.2-alpha.1", + "version": "2.3.2-alpha.2", "repository": { "type": "git", "url": "git+https://github.com/ar-io/ar-io-sdk.git" diff --git a/src/version.ts b/src/version.ts index 64e8123e..e8aaecf5 100644 --- a/src/version.ts +++ b/src/version.ts @@ -16,4 +16,4 @@ // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH -export const version = '2.3.2-alpha.1'; +export const version = '2.3.2-alpha.2';