From 7a0d20da45373ef370617db9dc07e7bf54feab4f Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Thu, 26 Sep 2024 11:34:14 -0600 Subject: [PATCH 1/6] fix(types): update getInfo types on IO --- src/io.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/io.ts b/src/io.ts index 38b61c3a..1704c2aa 100644 --- a/src/io.ts +++ b/src/io.ts @@ -287,6 +287,8 @@ export interface AoIORead { Name: string; Logo: string; Denomination: number; + Handlers: string[]; + LastTickedEpochIndex: number; }>; getTokenSupply(): Promise; getEpochSettings(params?: EpochInput): Promise; From 48c4c511175653da2979504db234f9f2b732936e Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Thu, 26 Sep 2024 12:08:22 -0600 Subject: [PATCH 2/6] chore(docs): update README --- README.md | 10 ++++++---- src/common/io.ts | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b4923f88..9d9052ea 100644 --- a/README.md +++ b/README.md @@ -274,10 +274,12 @@ const info = await io.getInfo(); ```json { - "name": "Testnet IO", - "ticker": "tIO", - "owner": "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ", - "denomination": "6" + "Name": "Testnet IO", + "Ticker": "tIO", + "Owner": "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ", + "Denomination": 6, + "Handlers": ["_eval", "_default_"], // full list of handlers, useful for debugging + "LastTickedEpochIndex": 31 // epoch index of the last tick } ``` diff --git a/src/common/io.ts b/src/common/io.ts index 247f9e26..ebd1856b 100644 --- a/src/common/io.ts +++ b/src/common/io.ts @@ -115,12 +115,16 @@ export class IOReadable implements AoIORead { Ticker: string; Logo: string; Denomination: number; + Handlers: string[]; + LastTickedEpochIndex: number; }> { return this.process.read<{ Name: string; Ticker: string; Logo: string; Denomination: number; + Handlers: string[]; + LastTickedEpochIndex: number; }>({ tags: [{ name: 'Action', value: 'Info' }], }); From 4c87a060f7f2c9466e6725156d806b96bb4a84f5 Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Thu, 26 Sep 2024 14:46:07 -0600 Subject: [PATCH 3/6] chore(test): update info test to check handlers array --- tests/e2e/esm/index.test.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/e2e/esm/index.test.js b/tests/e2e/esm/index.test.js index 02422f2d..ae136cb4 100644 --- a/tests/e2e/esm/index.test.js +++ b/tests/e2e/esm/index.test.js @@ -58,8 +58,14 @@ describe('IO', async () => { }); it('should be able to get the process information', async () => { - const epoch = await io.getInfo(); - assert.ok(epoch); + const info = await io.getInfo(); + assert.ok(info); + assert(typeof info.Name === 'string'); + assert(typeof info.Ticker === 'string'); + assert(typeof info.Logo === 'string'); + assert(typeof info.Denomination === 'number'); + assert(Array.isArray(info.Handlers)); + assert(typeof info.LastTickedEpochIndex === 'number'); }); it('should be able to get the total token supply', async () => { From 56dbc052f35318d93b58d8978f0b1b22a3cf070c Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 26 Sep 2024 20:48:40 +0000 Subject: [PATCH 4/6] chore(release): 2.2.4 [skip ci] ## [2.2.4](https://github.com/ar-io/ar-io-sdk/compare/v2.2.3...v2.2.4) (2024-09-26) ### Bug Fixes * **types:** update getInfo types on IO ([7a0d20d](https://github.com/ar-io/ar-io-sdk/commit/7a0d20da45373ef370617db9dc07e7bf54feab4f)) --- 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 1ad656f9..3d7bb44f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.2.4](https://github.com/ar-io/ar-io-sdk/compare/v2.2.3...v2.2.4) (2024-09-26) + + +### Bug Fixes + +* **types:** update getInfo types on IO ([7a0d20d](https://github.com/ar-io/ar-io-sdk/commit/7a0d20da45373ef370617db9dc07e7bf54feab4f)) + ## [2.2.3](https://github.com/ar-io/ar-io-sdk/compare/v2.2.2...v2.2.3) (2024-09-25) diff --git a/package.json b/package.json index cc1b6140..574bf919 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ar.io/sdk", - "version": "2.2.3", + "version": "2.2.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 da8d0a18..e8a46e4b 100644 --- a/src/version.ts +++ b/src/version.ts @@ -16,4 +16,4 @@ // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH -export const version = '2.2.3'; +export const version = '2.2.4'; From 99c24f85e7e5829fb009f23702fa25243cf603da Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Thu, 26 Sep 2024 14:54:09 -0600 Subject: [PATCH 5/6] fix(ant): allow sending tags on ant write interactions --- src/common/ant.ts | 83 ++++++++++++++++++++++++++++++++--------------- src/io.ts | 56 +++++++++++++++++++------------- 2 files changed, 90 insertions(+), 49 deletions(-) diff --git a/src/common/ant.ts b/src/common/ant.ts index 1de2c8e4..7b6602c9 100644 --- a/src/common/ant.ts +++ b/src/common/ant.ts @@ -24,6 +24,7 @@ import { ProcessConfiguration, WalletAddress, WithSigner, + WriteOptions, isProcessConfiguration, isProcessIdConfiguration, } from '../types.js'; @@ -245,8 +246,12 @@ export class AoANTWriteable extends AoANTReadable implements AoANTWrite { * ant.transfer({ target: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" }); * ``` */ - async transfer({ target }: { target: string }): Promise { + async transfer( + { target }: { target: string }, + options?: WriteOptions, + ): Promise { const tags = [ + ...(options?.tags ?? []), { name: 'Action', value: 'Transfer' }, { name: 'Recipient', value: target }, ]; @@ -265,12 +270,16 @@ export class AoANTWriteable extends AoANTReadable implements AoANTWrite { * ant.setController({ controller: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" }); * ``` */ - async addController({ - controller, - }: { - controller: string; - }): Promise { + async addController( + { + controller, + }: { + controller: string; + }, + options?: WriteOptions, + ): Promise { const tags = [ + ...(options?.tags ?? []), { name: 'Action', value: 'Add-Controller' }, { name: 'Controller', value: controller }, ]; @@ -289,12 +298,16 @@ export class AoANTWriteable extends AoANTReadable implements AoANTWrite { * ant.removeController({ controller: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" }); * ``` */ - async removeController({ - controller, - }: { - controller: string; - }): Promise { + async removeController( + { + controller, + }: { + controller: string; + }, + options?: WriteOptions, + ): Promise { const tags = [ + ...(options?.tags ?? []), { name: 'Action', value: 'Remove-Controller' }, { name: 'Controller', value: controller }, ]; @@ -315,17 +328,21 @@ export class AoANTWriteable extends AoANTReadable implements AoANTWrite { * ant.setController({ controller: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" }); * ``` */ - async setRecord({ - undername, - transactionId, - ttlSeconds, - }: { - undername: string; - transactionId: string; - ttlSeconds: number; - }): Promise { + async setRecord( + { + undername, + transactionId, + ttlSeconds, + }: { + undername: string; + transactionId: string; + ttlSeconds: number; + }, + options?: WriteOptions, + ): Promise { return this.process.send({ tags: [ + ...(options?.tags ?? []), { name: 'Action', value: 'Set-Record' }, { name: 'Sub-Domain', value: undername }, { name: 'Transaction-Id', value: transactionId }, @@ -343,13 +360,17 @@ export class AoANTWriteable extends AoANTReadable implements AoANTWrite { * ant.removeRecord({ subDomain: "shorts" }); * ``` */ - async removeRecord({ - undername, - }: { - undername: string; - }): Promise { + async removeRecord( + { + undername, + }: { + undername: string; + }, + options?: WriteOptions, + ): Promise { return this.process.send({ tags: [ + ...(options?.tags ?? []), { name: 'Action', value: 'Remove-Record' }, { name: 'Sub-Domain', value: undername }, ], @@ -365,9 +386,13 @@ export class AoANTWriteable extends AoANTReadable implements AoANTWrite { * ant.setTicker({ ticker: "KAPOW" }); * ``` */ - async setTicker({ ticker }: { ticker: string }): Promise { + async setTicker( + { ticker }: { ticker: string }, + options?: WriteOptions, + ): Promise { return this.process.send({ tags: [ + ...(options?.tags ?? []), { name: 'Action', value: 'Set-Ticker' }, { name: 'Ticker', value: ticker }, ], @@ -382,9 +407,13 @@ export class AoANTWriteable extends AoANTReadable implements AoANTWrite { * ant.setName({ name: "ships at sea" }); * ``` */ - async setName({ name }: { name: string }): Promise { + async setName( + { name }: { name: string }, + options?: WriteOptions, + ): Promise { return this.process.send({ tags: [ + ...(options?.tags ?? []), { name: 'Action', value: 'Set-Name' }, { name: 'Name', value: name }, ], diff --git a/src/io.ts b/src/io.ts index 1704c2aa..b16473f6 100644 --- a/src/io.ts +++ b/src/io.ts @@ -466,28 +466,40 @@ export interface AoANTRead { export interface AoANTWrite extends AoANTRead { transfer({ target }: { target: WalletAddress }): Promise; - addController({ - controller, - }: { - controller: WalletAddress; - }): Promise; - removeController({ - controller, - }: { - controller: WalletAddress; - }): Promise; - setRecord({ - undername, - transactionId, - ttlSeconds, - }: { - undername: string; - transactionId: string; - ttlSeconds: number; - }): Promise; - removeRecord({ undername }: { undername: string }): Promise; - setTicker({ ticker }): Promise; - setName({ name }): Promise; + addController( + { + controller, + }: { + controller: WalletAddress; + }, + options?: WriteOptions, + ): Promise; + removeController( + { + controller, + }: { + controller: WalletAddress; + }, + options?: WriteOptions, + ): Promise; + setRecord( + { + undername, + transactionId, + ttlSeconds, + }: { + undername: string; + transactionId: string; + ttlSeconds: number; + }, + options, + ): Promise; + removeRecord( + { undername }: { undername: string }, + options, + ): Promise; + setTicker({ ticker }, options): Promise; + setName({ name }, options): Promise; } export interface AoANTRegistryRead { From 4ba3ccac673907e4da356cfb442819912b843093 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 26 Sep 2024 21:00:58 +0000 Subject: [PATCH 6/6] chore(release): 2.2.5 [skip ci] ## [2.2.5](https://github.com/ar-io/ar-io-sdk/compare/v2.2.4...v2.2.5) (2024-09-26) ### Bug Fixes * **ant:** allow sending tags on ant write interactions ([99c24f8](https://github.com/ar-io/ar-io-sdk/commit/99c24f85e7e5829fb009f23702fa25243cf603da)) --- 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 3d7bb44f..46e6902f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.2.5](https://github.com/ar-io/ar-io-sdk/compare/v2.2.4...v2.2.5) (2024-09-26) + + +### Bug Fixes + +* **ant:** allow sending tags on ant write interactions ([99c24f8](https://github.com/ar-io/ar-io-sdk/commit/99c24f85e7e5829fb009f23702fa25243cf603da)) + ## [2.2.4](https://github.com/ar-io/ar-io-sdk/compare/v2.2.3...v2.2.4) (2024-09-26) diff --git a/package.json b/package.json index 574bf919..de0c94a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ar.io/sdk", - "version": "2.2.4", + "version": "2.2.5", "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 e8a46e4b..93b2bc7f 100644 --- a/src/version.ts +++ b/src/version.ts @@ -16,4 +16,4 @@ // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH -export const version = '2.2.4'; +export const version = '2.2.5';