Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(PE-5825): ANT read interface #19

Merged
merged 11 commits into from
Mar 18, 2024
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,6 @@ const auction = await arIO.getAuction({ domain });
Retrieves all active auctions.

```typescript

const auctions = await arIO.getAuctions({ evaluationOptions });

// output
Expand All @@ -545,7 +544,33 @@ const auctions = await arIO.getAuctions({ evaluationOptions });
// "type": "permabuy"
// }
// }
```

## ANT API's
atticusofsparta marked this conversation as resolved.
Show resolved Hide resolved

The ANT contract class allows for fetching data given a provided ANT contract ID.
Copy link
Collaborator

@dtfiedler dtfiedler Mar 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ANT contract client class exposes APIs relevant to compliant Arweave Name Token contract's. It can be configured to use any contract ID that adheres to the ANT contract spec. You must provide either a custom contract data provider or a contractTxId to the ANT class constructor to use.


### `getRecords({ evaluationOptions })`

Returns all records on the configured ANT contract, including the required `@` record that resolve connected ArNS names.

```typescript
const contractTxId = 'bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM';
const ant = new ANT({ contractTxId });
const records = await ANT.getRecords();
atticusofsparta marked this conversation as resolved.
Show resolved Hide resolved

// output
// {
// "@": {
// "transactionId": "nOXJjj_vk0Dc1yCgdWD8kti_1iHruGzLQLNNBHVpN0Y",
// "ttlSeconds": 3600
// },
// "cn": {
// "transactionId": "_HquerT6pfGFXrVxRxQTkJ7PV5RciZCqvMjLtUY0C1k",
// "ttlSeconds": 3300
// }
// }
```

## Developers

Expand Down Expand Up @@ -591,4 +616,7 @@ For more information on how to contribute, please see [CONTRIBUTING.md].
[examples]: ./examples
[arns-service]: https://github.com/ar-io/arns-service
[CONTRIBUTING.md]: ./CONTRIBUTING.md

```

```
dtfiedler marked this conversation as resolved.
Show resolved Hide resolved
Loading