From 99cccd499de0254f07e43ae68f4214b2775fa7b8 Mon Sep 17 00:00:00 2001 From: Derek Sonnenberg Date: Mon, 2 Dec 2024 13:54:21 -0600 Subject: [PATCH 01/12] fix: use `Keywords` for setKeywords --- src/common/ant.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/ant.ts b/src/common/ant.ts index 82260ea3..a1f59b4f 100644 --- a/src/common/ant.ts +++ b/src/common/ant.ts @@ -528,7 +528,7 @@ export class AoANTWriteable extends AoANTReadable implements AoANTWrite { tags: [ ...(options?.tags ?? []), { name: 'Action', value: 'Set-Keywords' }, - { name: 'Description', value: JSON.stringify(keywords) }, + { name: 'Keywords', value: JSON.stringify(keywords) }, ], signer: this.signer, }); From b8179ec9d52ed5cd8f0c7bcfa1e3171394bf9dfe Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 2 Dec 2024 20:21:28 +0000 Subject: [PATCH 02/12] chore(release): 2.5.4-alpha.2 [skip ci] ## [2.5.4-alpha.2](https://github.com/ar-io/ar-io-sdk/compare/v2.5.4-alpha.1...v2.5.4-alpha.2) (2024-12-02) ### Bug Fixes * use `Keywords` for setKeywords ([99cccd4](https://github.com/ar-io/ar-io-sdk/commit/99cccd499de0254f07e43ae68f4214b2775fa7b8)) --- 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 77c1ba61..2be21364 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.5.4-alpha.2](https://github.com/ar-io/ar-io-sdk/compare/v2.5.4-alpha.1...v2.5.4-alpha.2) (2024-12-02) + + +### Bug Fixes + +* use `Keywords` for setKeywords ([99cccd4](https://github.com/ar-io/ar-io-sdk/commit/99cccd499de0254f07e43ae68f4214b2775fa7b8)) + ## [2.5.3](https://github.com/ar-io/ar-io-sdk/compare/v2.5.2...v2.5.3) (2024-11-27) diff --git a/package.json b/package.json index 5f430035..67277c11 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ar.io/sdk", - "version": "2.5.4-alpha.1", + "version": "2.5.4-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 f811f390..fb06e832 100644 --- a/src/version.ts +++ b/src/version.ts @@ -15,4 +15,4 @@ */ // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH -export const version = '2.5.4-alpha.1'; +export const version = '2.5.4-alpha.2'; From 58092e65a2868a3a4bdaded76de7754d49b38903 Mon Sep 17 00:00:00 2001 From: Derek Sonnenberg Date: Mon, 2 Dec 2024 16:03:33 -0600 Subject: [PATCH 03/12] test: add coverage for get gateway registry settings PE-6895 --- tests/e2e/esm/index.test.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/e2e/esm/index.test.js b/tests/e2e/esm/index.test.js index cf16f275..15540632 100644 --- a/tests/e2e/esm/index.test.js +++ b/tests/e2e/esm/index.test.js @@ -718,6 +718,34 @@ describe('e2e esm tests', async () => { assert.equal(redelegationFee.redelegationFeeRate, 0); assert.equal(redelegationFee.feeResetTimestamp, undefined); }); + + it('should be able to get gateway registry settings', async () => { + const registrySettings = await io.getGatewayRegistrySettings(); + assert.ok(registrySettings); + assert.ok(typeof registrySettings.delegates.minStake === 'number'); + assert.ok( + typeof registrySettings.delegates.withdrawLengthMs === 'number', + ); + assert.ok(typeof registrySettings.observers.maxPerEpoch === 'number'); + assert.ok(typeof registrySettings.observers.maxTenureWeight === 'number'); + assert.ok( + typeof registrySettings.observers.tenureWeightDays === 'number', + ); + assert.ok( + typeof registrySettings.observers.tenureWeightPeriod === 'number', + ); + assert.ok( + typeof registrySettings.operators.failedEpochCountMax === 'number', + ); + assert.ok( + typeof registrySettings.operators.failedEpochSlashRate === 'number', + ); + assert.ok(typeof registrySettings.operators.leaveLengthMs === 'number'); + assert.ok(typeof registrySettings.operators.minStake === 'number'); + assert.ok( + typeof registrySettings.operators.withdrawLengthMs === 'number', + ); + }); }); describe('ANTRegistry', async () => { From bb7b6b4581f2b5e39c800749f0d7e2414fb9dd1c Mon Sep 17 00:00:00 2001 From: Derek Sonnenberg Date: Mon, 2 Dec 2024 16:04:03 -0600 Subject: [PATCH 04/12] feat: init get gateway registry settings PE-6895 --- src/common/io.ts | 7 +++++++ src/types/io.ts | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/common/io.ts b/src/common/io.ts index 8105ecae..784941ba 100644 --- a/src/common/io.ts +++ b/src/common/io.ts @@ -51,6 +51,7 @@ import { AoEpochSettings, AoGateway, AoGatewayDelegateWithAddress, + AoGatewayRegistrySettings, AoGatewayVault, AoIORead, AoIOWrite, @@ -725,6 +726,12 @@ export class IOReadable implements AoIORead { ], }); } + + async getGatewayRegistrySettings(): Promise { + return this.process.read({ + tags: [{ name: 'Action', value: 'Gateway-Registry-Settings' }], + }); + } } export class IOWriteable extends IOReadable implements AoIOWrite { diff --git a/src/types/io.ts b/src/types/io.ts index 61bfbf0f..446f557c 100644 --- a/src/types/io.ts +++ b/src/types/io.ts @@ -323,6 +323,26 @@ export type AoJoinNetworkParams = Pick< export type AoUpdateGatewaySettingsParams = AtLeastOne; +export type AoGatewayRegistrySettings = { + delegates: { + minStake: number; + withdrawLengthMs: number; + }; + observers: { + tenureWeightDays: number; + tenureWeightPeriod: number; + maxTenureWeight: number; + maxPerEpoch: number; + }; + operators: { + minStake: number; + withdrawLengthMs: number; + leaveLengthMs: number; + failedEpochCountMax: number; + failedEpochSlashRate: number; + }; +}; + // Interfaces export interface AoIORead { @@ -455,6 +475,7 @@ export interface AoIORead { getRedelegationFee(params: { address: WalletAddress; }): Promise; + getGatewayRegistrySettings(): Promise; } export interface AoIOWrite extends AoIORead { From ebdd74a959df9d6d006e927f2f07e3fe7c3351ab Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 2 Dec 2024 22:37:45 +0000 Subject: [PATCH 05/12] chore(release): 2.6.0-alpha.1 [skip ci] # [2.6.0-alpha.1](https://github.com/ar-io/ar-io-sdk/compare/v2.5.4-alpha.2...v2.6.0-alpha.1) (2024-12-02) ### Features * init get gateway registry settings PE-6895 ([bb7b6b4](https://github.com/ar-io/ar-io-sdk/commit/bb7b6b4581f2b5e39c800749f0d7e2414fb9dd1c)) --- 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 2be21364..ba0e4ebb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [2.6.0-alpha.1](https://github.com/ar-io/ar-io-sdk/compare/v2.5.4-alpha.2...v2.6.0-alpha.1) (2024-12-02) + + +### Features + +* init get gateway registry settings PE-6895 ([bb7b6b4](https://github.com/ar-io/ar-io-sdk/commit/bb7b6b4581f2b5e39c800749f0d7e2414fb9dd1c)) + ## [2.5.4-alpha.2](https://github.com/ar-io/ar-io-sdk/compare/v2.5.4-alpha.1...v2.5.4-alpha.2) (2024-12-02) diff --git a/package.json b/package.json index 67277c11..b9607a8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ar.io/sdk", - "version": "2.5.4-alpha.2", + "version": "2.6.0-alpha.1", "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 fb06e832..db636daf 100644 --- a/src/version.ts +++ b/src/version.ts @@ -15,4 +15,4 @@ */ // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH -export const version = '2.5.4-alpha.2'; +export const version = '2.6.0-alpha.1'; From 4ab4296f0f5b39dc5b0060ee1e50181983d9360d Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 2 Dec 2024 22:44:23 +0000 Subject: [PATCH 06/12] chore(release): 2.6.0-alpha.2 [skip ci] # [2.6.0-alpha.2](https://github.com/ar-io/ar-io-sdk/compare/v2.6.0-alpha.1...v2.6.0-alpha.2) (2024-12-02) ### Bug Fixes * **io:** update gateway delegates api, add to README ([65aa6a8](https://github.com/ar-io/ar-io-sdk/commit/65aa6a8e280a6d0b6044caf9ba88f47a61d08022)) --- 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 01077f87..bc25d046 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [2.6.0-alpha.2](https://github.com/ar-io/ar-io-sdk/compare/v2.6.0-alpha.1...v2.6.0-alpha.2) (2024-12-02) + + +### Bug Fixes + +* **io:** update gateway delegates api, add to README ([65aa6a8](https://github.com/ar-io/ar-io-sdk/commit/65aa6a8e280a6d0b6044caf9ba88f47a61d08022)) + ## [2.5.5](https://github.com/ar-io/ar-io-sdk/compare/v2.5.4...v2.5.5) (2024-11-28) diff --git a/package.json b/package.json index 63ec184e..12a3ca93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ar.io/sdk", - "version": "2.5.5", + "version": "2.6.0-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 3ae6dd37..d94fa17f 100644 --- a/src/version.ts +++ b/src/version.ts @@ -15,4 +15,4 @@ */ // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH -export const version = '2.5.5'; +export const version = '2.6.0-alpha.2'; From 53b11f068006020102177d706315d9b6ad6108b5 Mon Sep 17 00:00:00 2001 From: Derek Sonnenberg Date: Wed, 4 Dec 2024 10:24:56 -0600 Subject: [PATCH 07/12] docs: fix requestPrimaryName function definition --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b68ad059..c95ace4e 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting - [Primary Names](#primary-names) - [`getPrimaryNames({ cursor, limit, sortBy, sortOrder })`](#getprimarynames-cursor-limit-sortby-sortorder-) - [`getPrimaryName({ name, address })`](#getprimaryname-name-address-) - - [`requestPrimaryName({ name, address })`](#requestprimaryname-name-address-) + - [`requestPrimaryName({ name })`](#requestprimaryname-name-) - [`getPrimaryNameRequest({ initiator })`](#getprimarynamerequest-initiator-) - [Configuration](#configuration) - [Arweave Name Tokens (ANT's)](#arweave-name-tokens-ants) @@ -1688,7 +1688,7 @@ const name = await io.getPrimaryName({ -#### `requestPrimaryName({ name, address })` +#### `requestPrimaryName({ name })` Requests a primary name for the caller's address. The request must be approved by the new owner of the requested name via the `approvePrimaryNameRequest`[#approveprimarynamerequest-name-address-] API. From 9e8e7e83deb7aef9fc6d94f294d6087840ade3e0 Mon Sep 17 00:00:00 2001 From: atticusofsparta Date: Wed, 4 Dec 2024 15:43:44 -0600 Subject: [PATCH 08/12] fix(lua id): bump lua id for ANT 9 --- src/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants.ts b/src/constants.ts index 376bac3e..b6137129 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -40,6 +40,6 @@ export const IO_TESTNET_PROCESS_ID = export const ANT_REGISTRY_ID = 'i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc'; export const MIO_PER_IO = 1_000_000; export const AOS_MODULE_ID = 'cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk'; -export const ANT_LUA_ID = 'XP9_LFTae8C0yvCb_DUJaC5LXaiZIbiGT1yY25X0JCg'; +export const ANT_LUA_ID = 'ezS3Z57rq_0skoG0WYmIqJ33mJiu0HbYNn9vEu12Mc4'; export const DEFAULT_SCHEDULER_ID = '_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA'; From 615579293670fbd2e43c41e7849cb6ff26af2b91 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 5 Dec 2024 16:16:56 +0000 Subject: [PATCH 09/12] chore(release): 2.6.0-alpha.3 [skip ci] # [2.6.0-alpha.3](https://github.com/ar-io/ar-io-sdk/compare/v2.6.0-alpha.2...v2.6.0-alpha.3) (2024-12-05) ### Bug Fixes * **lua id:** bump lua id for ANT 9 ([9e8e7e8](https://github.com/ar-io/ar-io-sdk/commit/9e8e7e83deb7aef9fc6d94f294d6087840ade3e0)) --- 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 bc25d046..67697d5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [2.6.0-alpha.3](https://github.com/ar-io/ar-io-sdk/compare/v2.6.0-alpha.2...v2.6.0-alpha.3) (2024-12-05) + + +### Bug Fixes + +* **lua id:** bump lua id for ANT 9 ([9e8e7e8](https://github.com/ar-io/ar-io-sdk/commit/9e8e7e83deb7aef9fc6d94f294d6087840ade3e0)) + # [2.6.0-alpha.2](https://github.com/ar-io/ar-io-sdk/compare/v2.6.0-alpha.1...v2.6.0-alpha.2) (2024-12-02) diff --git a/package.json b/package.json index 12a3ca93..37bad823 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ar.io/sdk", - "version": "2.6.0-alpha.2", + "version": "2.6.0-alpha.3", "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 d94fa17f..fa2a3c5c 100644 --- a/src/version.ts +++ b/src/version.ts @@ -15,4 +15,4 @@ */ // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH -export const version = '2.6.0-alpha.2'; +export const version = '2.6.0-alpha.3'; From 07ff6c69964dfb0123bf3f574f0b2b21b446278a Mon Sep 17 00:00:00 2001 From: Derek Sonnenberg Date: Thu, 5 Dec 2024 12:05:59 -0600 Subject: [PATCH 10/12] test(get demand factor settings): init coverage for new method PE-6894 --- tests/e2e/esm/index.test.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/e2e/esm/index.test.js b/tests/e2e/esm/index.test.js index 15540632..7b453052 100644 --- a/tests/e2e/esm/index.test.js +++ b/tests/e2e/esm/index.test.js @@ -143,6 +143,29 @@ describe('e2e esm tests', async () => { assert.ok(epochSettings); }); + it('should be able to get demand factor settings', async () => { + const demandFactorSettings = await io.getDemandFactorSettings(); + assert.ok(demandFactorSettings); + assert.equal( + typeof demandFactorSettings.periodZeroStartTimestamp, + 'number', + ); + assert.equal(typeof demandFactorSettings.movingAvgPeriodCount, 'number'); + assert.equal(typeof demandFactorSettings.periodLengthMs, 'number'); + assert.equal(typeof demandFactorSettings.demandFactorBaseValue, 'number'); + assert.equal(typeof demandFactorSettings.demandFactorMin, 'number'); + assert.equal( + typeof demandFactorSettings.demandFactorUpAdjustment, + 'number', + ); + assert.equal( + typeof demandFactorSettings.demandFactorDownAdjustment, + 'number', + ); + assert.equal(typeof demandFactorSettings.stepDownThreshold, 'number'); + assert.equal(typeof demandFactorSettings.criteria, 'string'); + }); + it('should be able to get reserved names', async () => { const reservedNames = await io.getArNSReservedNames(); assert.ok(reservedNames); From ad2eb366328439fa1693de10c7c2ced12623385f Mon Sep 17 00:00:00 2001 From: Derek Sonnenberg Date: Thu, 5 Dec 2024 12:06:47 -0600 Subject: [PATCH 11/12] feat(get demand factor settings): init new IO method PE-6894 --- src/common/io.ts | 7 +++++++ src/types/io.ts | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/common/io.ts b/src/common/io.ts index 784941ba..8704aaf4 100644 --- a/src/common/io.ts +++ b/src/common/io.ts @@ -58,6 +58,7 @@ import { AoRegistrationFees, AoVaultData, AoWalletVault, + DemandFactorSettings, EpochInput, isProcessConfiguration, isProcessIdConfiguration, @@ -535,6 +536,12 @@ export class IOReadable implements AoIORead { }); } + async getDemandFactorSettings(): Promise { + return this.process.read({ + tags: [{ name: 'Action', value: 'Demand-Factor-Settings' }], + }); + } + // Auctions async getArNSAuctions( params?: PaginationParams, diff --git a/src/types/io.ts b/src/types/io.ts index 612d8f93..7dd95fb6 100644 --- a/src/types/io.ts +++ b/src/types/io.ts @@ -342,6 +342,18 @@ export type AoGatewayRegistrySettings = { }; }; +export type DemandFactorSettings = { + periodZeroStartTimestamp: number; + movingAvgPeriodCount: number; + periodLengthMs: number; + demandFactorBaseValue: number; + demandFactorMin: number; + demandFactorUpAdjustment: number; + demandFactorDownAdjustment: number; + stepDownThreshold: number; + criteria: string; +}; + // Interfaces export interface AoIORead { @@ -449,6 +461,7 @@ export interface AoIORead { }): Promise; // TODO: add getCostDetails API that provides funding cost and discount details getRegistrationFees(): Promise; getDemandFactor(): Promise; + getDemandFactorSettings(): Promise; getVaults( params?: PaginationParams, ): Promise>; From 41051630ae332e590086442ac8d36d77ad3dd096 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 5 Dec 2024 18:41:05 +0000 Subject: [PATCH 12/12] chore(release): 2.6.0-alpha.4 [skip ci] # [2.6.0-alpha.4](https://github.com/ar-io/ar-io-sdk/compare/v2.6.0-alpha.3...v2.6.0-alpha.4) (2024-12-05) ### Features * **get demand factor settings:** init new IO method PE-6894 ([ad2eb36](https://github.com/ar-io/ar-io-sdk/commit/ad2eb366328439fa1693de10c7c2ced12623385f)) --- 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 67697d5e..0ea43dd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [2.6.0-alpha.4](https://github.com/ar-io/ar-io-sdk/compare/v2.6.0-alpha.3...v2.6.0-alpha.4) (2024-12-05) + + +### Features + +* **get demand factor settings:** init new IO method PE-6894 ([ad2eb36](https://github.com/ar-io/ar-io-sdk/commit/ad2eb366328439fa1693de10c7c2ced12623385f)) + # [2.6.0-alpha.3](https://github.com/ar-io/ar-io-sdk/compare/v2.6.0-alpha.2...v2.6.0-alpha.3) (2024-12-05) diff --git a/package.json b/package.json index 37bad823..5737b878 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ar.io/sdk", - "version": "2.6.0-alpha.3", + "version": "2.6.0-alpha.4", "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 fa2a3c5c..dde3fa31 100644 --- a/src/version.ts +++ b/src/version.ts @@ -15,4 +15,4 @@ */ // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH -export const version = '2.6.0-alpha.3'; +export const version = '2.6.0-alpha.4';