Skip to content

Commit

Permalink
fix(main): merge main back to alpha, release hotfixes on alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Sep 26, 2024
2 parents 86984d9 + 4ba3cca commit 9299427
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 64 deletions.
18 changes: 9 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# [2.3.0-alpha.1](https://github.com/ar-io/ar-io-sdk/compare/v2.2.3...v2.3.0-alpha.1) (2024-09-25)

### Features

### Bug Fixes
* **io:** add api for querying get registration fees handler to AoIORead class ([7b3909f](https://github.com/ar-io/ar-io-sdk/commit/7b3909fb9def0e864dc59d87d1d78c9718feb830))

* **types:** update type and tests ([877b03f](https://github.com/ar-io/ar-io-sdk/commit/877b03f4124894cafbd0bc60b9d55b8803365cec))

## [2.2.5](https://github.com/ar-io/ar-io-sdk/compare/v2.2.4...v2.2.5) (2024-09-26)

### Features

* **io:** add api for querying get registration fees handler to AoIORead class ([7b3909f](https://github.com/ar-io/ar-io-sdk/commit/7b3909fb9def0e864dc59d87d1d78c9718feb830))
* **ant:** allow sending tags on ant write interactions ([99c24f8](https://github.com/ar-io/ar-io-sdk/commit/99c24f85e7e5829fb009f23702fa25243cf603da))

## [2.2.3](https://github.com/ar-io/ar-io-sdk/compare/v2.2.2...v2.2.3) (2024-09-25)
## [2.2.4](https://github.com/ar-io/ar-io-sdk/compare/v2.2.3...v2.2.4) (2024-09-26)


### Bug Fixes

* **ants:** bump lua id to zeglqubvIKvBEZaxAUuenLGGtQ1pJp9LZjd5hDe0-J0 ([ba6101d](https://github.com/ar-io/ar-io-sdk/commit/ba6101da59e889ef47d5980eca155e4d172ca121))

## [2.2.3-alpha.1](https://github.com/ar-io/ar-io-sdk/compare/v2.2.2...v2.2.3-alpha.1) (2024-09-25)
* **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)

### Bug Fixes

* **ants:** bump lua id to zeglqubvIKvBEZaxAUuenLGGtQ1pJp9LZjd5hDe0-J0 ([ba6101d](https://github.com/ar-io/ar-io-sdk/commit/ba6101da59e889ef47d5980eca155e4d172ca121))
* **types:** update type and tests ([877b03f](https://github.com/ar-io/ar-io-sdk/commit/877b03f4124894cafbd0bc60b9d55b8803365cec))


## [2.2.2](https://github.com/ar-io/ar-io-sdk/compare/v2.2.1...v2.2.2) (2024-09-23)

Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```

Expand Down
83 changes: 56 additions & 27 deletions src/common/ant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
ProcessConfiguration,
WalletAddress,
WithSigner,
WriteOptions,
isProcessConfiguration,
isProcessIdConfiguration,
} from '../types.js';
Expand Down Expand Up @@ -245,8 +246,12 @@ export class AoANTWriteable extends AoANTReadable implements AoANTWrite {
* ant.transfer({ target: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" });
* ```
*/
async transfer({ target }: { target: string }): Promise<AoMessageResult> {
async transfer(
{ target }: { target: string },
options?: WriteOptions,
): Promise<AoMessageResult> {
const tags = [
...(options?.tags ?? []),
{ name: 'Action', value: 'Transfer' },
{ name: 'Recipient', value: target },
];
Expand All @@ -265,12 +270,16 @@ export class AoANTWriteable extends AoANTReadable implements AoANTWrite {
* ant.setController({ controller: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" });
* ```
*/
async addController({
controller,
}: {
controller: string;
}): Promise<AoMessageResult> {
async addController(
{
controller,
}: {
controller: string;
},
options?: WriteOptions,
): Promise<AoMessageResult> {
const tags = [
...(options?.tags ?? []),
{ name: 'Action', value: 'Add-Controller' },
{ name: 'Controller', value: controller },
];
Expand All @@ -289,12 +298,16 @@ export class AoANTWriteable extends AoANTReadable implements AoANTWrite {
* ant.removeController({ controller: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" });
* ```
*/
async removeController({
controller,
}: {
controller: string;
}): Promise<AoMessageResult> {
async removeController(
{
controller,
}: {
controller: string;
},
options?: WriteOptions,
): Promise<AoMessageResult> {
const tags = [
...(options?.tags ?? []),
{ name: 'Action', value: 'Remove-Controller' },
{ name: 'Controller', value: controller },
];
Expand All @@ -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<AoMessageResult> {
async setRecord(
{
undername,
transactionId,
ttlSeconds,
}: {
undername: string;
transactionId: string;
ttlSeconds: number;
},
options?: WriteOptions,
): Promise<AoMessageResult> {
return this.process.send({
tags: [
...(options?.tags ?? []),
{ name: 'Action', value: 'Set-Record' },
{ name: 'Sub-Domain', value: undername },
{ name: 'Transaction-Id', value: transactionId },
Expand All @@ -343,13 +360,17 @@ export class AoANTWriteable extends AoANTReadable implements AoANTWrite {
* ant.removeRecord({ subDomain: "shorts" });
* ```
*/
async removeRecord({
undername,
}: {
undername: string;
}): Promise<AoMessageResult> {
async removeRecord(
{
undername,
}: {
undername: string;
},
options?: WriteOptions,
): Promise<AoMessageResult> {
return this.process.send({
tags: [
...(options?.tags ?? []),
{ name: 'Action', value: 'Remove-Record' },
{ name: 'Sub-Domain', value: undername },
],
Expand All @@ -365,9 +386,13 @@ export class AoANTWriteable extends AoANTReadable implements AoANTWrite {
* ant.setTicker({ ticker: "KAPOW" });
* ```
*/
async setTicker({ ticker }: { ticker: string }): Promise<AoMessageResult> {
async setTicker(
{ ticker }: { ticker: string },
options?: WriteOptions,
): Promise<AoMessageResult> {
return this.process.send({
tags: [
...(options?.tags ?? []),
{ name: 'Action', value: 'Set-Ticker' },
{ name: 'Ticker', value: ticker },
],
Expand All @@ -382,9 +407,13 @@ export class AoANTWriteable extends AoANTReadable implements AoANTWrite {
* ant.setName({ name: "ships at sea" });
* ```
*/
async setName({ name }: { name: string }): Promise<AoMessageResult> {
async setName(
{ name }: { name: string },
options?: WriteOptions,
): Promise<AoMessageResult> {
return this.process.send({
tags: [
...(options?.tags ?? []),
{ name: 'Action', value: 'Set-Name' },
{ name: 'Name', value: name },
],
Expand Down
4 changes: 4 additions & 0 deletions src/common/io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,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' }],
});
Expand Down
58 changes: 36 additions & 22 deletions src/io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ export interface AoIORead {
Name: string;
Logo: string;
Denomination: number;
Handlers: string[];
LastTickedEpochIndex: number;
}>;
getTokenSupply(): Promise<number>;
getEpochSettings(params?: EpochInput): Promise<AoEpochSettings>;
Expand Down Expand Up @@ -477,28 +479,40 @@ export interface AoANTRead {

export interface AoANTWrite extends AoANTRead {
transfer({ target }: { target: WalletAddress }): Promise<AoMessageResult>;
addController({
controller,
}: {
controller: WalletAddress;
}): Promise<AoMessageResult>;
removeController({
controller,
}: {
controller: WalletAddress;
}): Promise<AoMessageResult>;
setRecord({
undername,
transactionId,
ttlSeconds,
}: {
undername: string;
transactionId: string;
ttlSeconds: number;
}): Promise<AoMessageResult>;
removeRecord({ undername }: { undername: string }): Promise<AoMessageResult>;
setTicker({ ticker }): Promise<AoMessageResult>;
setName({ name }): Promise<AoMessageResult>;
addController(
{
controller,
}: {
controller: WalletAddress;
},
options?: WriteOptions,
): Promise<AoMessageResult>;
removeController(
{
controller,
}: {
controller: WalletAddress;
},
options?: WriteOptions,
): Promise<AoMessageResult>;
setRecord(
{
undername,
transactionId,
ttlSeconds,
}: {
undername: string;
transactionId: string;
ttlSeconds: number;
},
options,
): Promise<AoMessageResult>;
removeRecord(
{ undername }: { undername: string },
options,
): Promise<AoMessageResult>;
setTicker({ ticker }, options): Promise<AoMessageResult>;
setName({ name }, options): Promise<AoMessageResult>;
}

export interface AoANTRegistryRead {
Expand Down
10 changes: 8 additions & 2 deletions tests/e2e/esm/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit 9299427

Please sign in to comment.