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

chore: release v2.1.0 #172

Merged
merged 96 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
47bfe20
feat(evolve): add evolve util
atticusofsparta Jul 8, 2024
a6261e5
fix(evolve): call eval twice to ensure evolve txid is set
atticusofsparta Jul 9, 2024
509e271
Merge remote-tracking branch 'origin/alpha' into PE-6314-evolve-ant
atticusofsparta Jul 10, 2024
a44cca1
fix(types): check info on evolve util first
atticusofsparta Jul 10, 2024
a2a9121
fix(evolve): dont double eval
atticusofsparta Jul 11, 2024
4edac1a
Merge remote-tracking branch 'origin/alpha' into PE-6314-evolve-ant
atticusofsparta Jul 11, 2024
b06503b
fix(evolve): fixed evolve somehow
atticusofsparta Jul 11, 2024
e4c3aaf
fix(lua id): set new lua id in constants
atticusofsparta Jul 11, 2024
134ab5a
Merge pull request #164 from ar-io/main
dtfiedler Jul 11, 2024
dd46eff
Merge pull request #167 from ar-io/main
dtfiedler Jul 12, 2024
8cbd564
fix(ant lua id): update to version Flwio4Lr08g6s6uim6lEJNnVGD9ylvz0_a…
atticusofsparta Jul 12, 2024
8775896
fix(arns): update event emitter to provide more events and logs while…
Jul 12, 2024
5b919ac
fix: use custom event names to avoid overlap
Jul 12, 2024
1d67dfe
fix(events): use arns name space for events
Jul 12, 2024
9a54bc3
Merge pull request #168 from ar-io/fix-arns-emitter
dtfiedler Jul 12, 2024
e6b7b8a
chore(release): 2.0.3-alpha.1 [skip ci]
semantic-release-bot Jul 12, 2024
b5485b9
Merge branch 'alpha' into PE-6314-evolve-ant
dtfiedler Jul 15, 2024
d1d5147
fix(example): dont spawn in example
atticusofsparta Jul 15, 2024
d0035c0
fix(example): remove unused arweave instance
atticusofsparta Jul 15, 2024
b72dc1f
fix(format): fix linting issues in format
atticusofsparta Jul 15, 2024
6b33775
Merge pull request #154 from ar-io/PE-6314-evolve-ant
dtfiedler Jul 16, 2024
77cc6c8
chore(release): 2.1.0-alpha.1 [skip ci]
semantic-release-bot Jul 16, 2024
261c85c
fix(io): add api that returns the total token supply
Jul 16, 2024
7aa3bfe
Merge pull request #170 from ar-io/token-supply-api
dtfiedler Jul 16, 2024
d689599
chore(release): 2.1.0-alpha.2 [skip ci]
semantic-release-bot Jul 16, 2024
3fb6b10
chore(github): add slack webhook to tests
Jul 16, 2024
ec36ee0
Merge pull request #171 from ar-io/slack-webhooks
dtfiedler Jul 16, 2024
99edbad
fix(types): update type name to what contract returns
atticusofsparta Jul 25, 2024
b6f2157
fix(emitter): add page size param for emitter to increase amount of r…
atticusofsparta Jul 25, 2024
ab9fad1
Merge pull request #173 from ar-io/PE-6491-arns-emitter-pagination
atticusofsparta Jul 25, 2024
d43278e
chore(release): 2.1.0-alpha.3 [skip ci]
semantic-release-bot Jul 25, 2024
a59b166
fix(gateway stats): update gateway stat types
atticusofsparta Jul 25, 2024
60d1674
Merge pull request #174 from ar-io/fix-gateway-types
atticusofsparta Jul 25, 2024
aee7a3e
chore(release): 2.1.0-alpha.4 [skip ci]
semantic-release-bot Jul 25, 2024
7596aec
feat(signing): add window arweave wallet to available signing options
atticusofsparta Jul 25, 2024
cba16e3
fix(signer): pass in signing function instead of signer class
atticusofsparta Jul 26, 2024
7f6f87d
fix(actions): ignore engines in action
atticusofsparta Jul 26, 2024
4604524
fix(naming): name AoSigner property aoSigner
atticusofsparta Jul 26, 2024
c8f7087
chore(docs): update getBalance docs example
dtfiedler Jul 29, 2024
7f7a0e6
fix(signer): move createAoSigner to be a util
atticusofsparta Jul 29, 2024
700c39b
Merge pull request #176 from ar-io/docs-balance
dtfiedler Jul 29, 2024
8e95edd
fix(signer): use AoSigner type as return type
atticusofsparta Jul 29, 2024
5d8579d
Merge remote-tracking branch 'origin/alpha' into PE-6432-signer-fixes
atticusofsparta Jul 29, 2024
34f07d2
fix(deps): move arconnect to dev deps
atticusofsparta Jul 29, 2024
3b23f80
fix(signer): describe signing function as signer vs aoSigner in case …
atticusofsparta Jul 29, 2024
8497a20
Merge pull request #175 from ar-io/PE-6432-signer-fixes
atticusofsparta Jul 29, 2024
4e84bd2
chore(release): 2.1.0-alpha.5 [skip ci]
semantic-release-bot Jul 29, 2024
2056674
feat(ant registry): add ant registry class
atticusofsparta Jul 30, 2024
5368668
fix(types): update AoGateway to include weights
Jul 31, 2024
54e5acc
chore(docs): update README to include weights in getGateways examples
Jul 31, 2024
171f935
chore(test): add test that validates weights of gateway
Jul 31, 2024
97855b0
chore(test): assert response for prescribed observers
Jul 31, 2024
3cf60f3
Merge pull request #178 from ar-io/PE-6528-gateway-weights
dtfiedler Jul 31, 2024
cb8a226
chore(release): 2.1.0-alpha.6 [skip ci]
semantic-release-bot Jul 31, 2024
bb04f79
chore(docs): add getState API to readme for ANTs
Jul 31, 2024
1bf95b7
chore(docs): add closing deatils tag
Jul 31, 2024
7542752
chore(docs): fix README
Jul 31, 2024
16ff813
Merge remote-tracking branch 'origin/alpha' into PE-6516-ant-registry
atticusofsparta Aug 1, 2024
1290739
chore(yarn): update github action and add .yarnrc file
Aug 1, 2024
1c12188
Merge remote-tracking branch 'origin/alpha' into PE-6516-ant-registry
atticusofsparta Aug 1, 2024
28dae7f
fix(spawn): update spawn to use ant registry id in the tags
atticusofsparta Aug 1, 2024
d10c9bb
chore(deps): add toc generator plugin to always update toc
Aug 2, 2024
1c3c8e0
Merge pull request #179 from ar-io/toc-generator
dtfiedler Aug 2, 2024
c959c81
fix(utils): revert new util
atticusofsparta Aug 5, 2024
df479f6
Merge remote-tracking branch 'origin/alpha' into PE-6516-ant-registry
atticusofsparta Aug 5, 2024
584aee1
fix(ao): update AoProcess to only support string | undefined
Aug 5, 2024
0f267c1
fix(ant): remove data from ant object, none of our ant methods requir…
Aug 5, 2024
c017b52
fix(io): no longer add data to save observations
Aug 5, 2024
edb0e5d
Merge pull request #180 from ar-io/ao-process
dtfiedler Aug 5, 2024
8dc11a2
chore(release): 2.1.0-alpha.7 [skip ci]
semantic-release-bot Aug 5, 2024
d5a60cd
Merge remote-tracking branch 'origin/alpha' into PE-6516-ant-registry
atticusofsparta Aug 5, 2024
b2223d4
fix(utils): update util to use ant registry
atticusofsparta Aug 5, 2024
e55a67b
fix(records): update arns emitter to use ant registry
atticusofsparta Aug 5, 2024
e532f4e
fix(lint): fix lint errors and warnings
atticusofsparta Aug 5, 2024
7887af9
fix(emiter): use a set to filter out duplicate
atticusofsparta Aug 5, 2024
d0ca3c2
chore(tests): added e2e testing for ant registry
atticusofsparta Aug 5, 2024
9e61cc7
fix(constants): do not set env var for ant registry
atticusofsparta Aug 5, 2024
f14ed5a
fix(errors): use any type on error
atticusofsparta Aug 5, 2024
b9a584f
chore(comments): flag util as beta
atticusofsparta Aug 5, 2024
a61e0bf
fix(tests): update e2e tests to only read from ant registry
atticusofsparta Aug 5, 2024
c868522
fix(todo): remove completed todo comment
atticusofsparta Aug 5, 2024
9dac280
fix(test): use a known wallet adddress in tests
atticusofsparta Aug 5, 2024
350bab1
fix(tests): check the return of ACL on ant tests more granularly
atticusofsparta Aug 5, 2024
9f965e1
fix(tests): use const for unchanging test vars
atticusofsparta Aug 5, 2024
38ca913
fix(tests): update web test to use ANT registry in app
atticusofsparta Aug 6, 2024
93741cb
fix(test): update browser test with data test id and render checks
atticusofsparta Aug 6, 2024
6386929
Merge pull request #177 from ar-io/PE-6516-ant-registry
atticusofsparta Aug 6, 2024
adba856
chore(release): 2.1.0-alpha.8 [skip ci]
semantic-release-bot Aug 6, 2024
c674876
fix(types): remove deprecated types
Jul 12, 2024
aaabbb0
Merge pull request #169 from ar-io/types
dtfiedler Aug 6, 2024
df2b903
chore(release): 2.1.0-alpha.9 [skip ci]
semantic-release-bot Aug 6, 2024
e725198
fix(types): add gateway weights to AoGateway
Aug 6, 2024
b552e62
chore(release): 2.1.0-alpha.10 [skip ci]
semantic-release-bot Aug 6, 2024
d618458
chore(docs): prep CHANGELOG for release
Aug 7, 2024
9d15237
chore(docs): update examples
Aug 7, 2024
32b58d9
chore(git): update github slack messages
Aug 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ concurrency:
group: ${{ github.ref_name }}
cancel-in-progress: true

on:
pull_request:
workflow_call:
on: [push, workflow_dispatch]

jobs:
build:
Expand All @@ -31,16 +29,13 @@ jobs:

test:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [18.x]
steps:
- uses: actions/checkout@v4

- name: Set Up node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
node-version-file: .nvmrc
cache: 'yarn'

- name: Install dependencies
Expand All @@ -53,3 +48,10 @@ jobs:
uses: codecov/codecov-action@v4.0.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Send Slack notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_TITLE: ${{ job.status == 'success' && 'Build / E2E tests succeeded!' || 'Build / E2E tests failed!' }}
SLACK_COLOR: ${{ job.status == 'success' && 'good' || 'danger' }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ignore-engines true
125 changes: 103 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,27 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting

## Table of Contents

<!-- toc -->

- [Table of Contents](#table-of-contents)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Usage](#usage)
- [Web](#web)
- [Bundlers (Webpack, Rollup, ESbuild, etc.)](#bundlers-webpack-rollup-esbuild-etc)
- [Browser](#browser)
- [Node](#node)
- [ESM (NodeNext)](#esm-nodenext)
- [CJS](#cjs)
- [Typescript](#typescript)
- [IOToken & mIOToken](#iotoken--miotoken)
- [Converting IO to mIO](#converting-io-to-mio)
- [IO Process](#io-process)

- [IO APIs](#apis)
- [APIs](#apis)
- [`init({ signer })`](#init-signer-)
- [`getInfo()`](#getinfo)
- [`getTokenSupply()`](#gettokensupply)
- [`getBalance({ address })`](#getbalance-address-)
- [`getBalances({ cursor, limit, sortBy, sortOrder })`](#getbalances-cursor-limit-sortby-sortorder-)
- [`getGateway({ address })`](#getgateway-address-)
Expand All @@ -31,6 +38,7 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
- [`getEpoch({ epochIndex })`](#getepoch-epochindex-)
- [`getCurrentEpoch()`](#getcurrentepoch)
- [`getPrescribedObservers({ epochIndex })`](#getprescribedobservers-epochindex-)
- [`getTokenCost({ intent, ...args })`](#gettokencost-intent-args-)
- [`joinNetwork(params)`](#joinnetworkparams)
- [`leaveNetwork()`](#leavenetwork)
- [`updateGatewaySettings(gatewaySettings)`](#updategatewaysettingsgatewaysettings)
Expand All @@ -42,13 +50,12 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
- [`transfer({ target, qty })`](#transfer-target-qty-)
- [`increaseUndernameLimit({ name, qty })`](#increaseundernamelimit-name-qty-)
- [`extendLease({ name, years })`](#extendlease-name-years-)
- [Configuration](#custom-configuration)

- [Configuration](#configuration)
- [Arweave Name Tokens (ANT's)](#arweave-name-tokens-ants)

- [ANT APIs](#ant-apis)
- [`init({ processId, signer })`](#init-processid-signer-)
- [`getInfo()`](#getinfo)
- [`getInfo()`](#getinfo-1)
- [`getState()`](#getstate)
- [`getOwner()`](#getowner)
- [`getControllers()`](#getcontrollers)
- [`getRecords()`](#getrecords)
Expand All @@ -59,21 +66,19 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
- [`removeRecord({ undername })`](#removerecord-undername-)
- [`setName({ name })`](#setname-name-)
- [`setTicker({ ticker })`](#setticker-ticker-)
- [Configuration](#configuration)

- [Configuration](#configuration-1)
- [Logging](#logging)

- [Configuration](#configuration)

- [Configuration](#configuration-2)
- [Pagination](#pagination)

- [Developers](#developers)
- [Requirements](#requirements)
- [Setup \& Build](#setup--build)
- [Setup & Build](#setup--build)
- [Testing](#testing)
- [Linting \& Formatting](#linting--formatting)
- [Linting & Formatting](#linting--formatting)
- [Architecture](#architecture)

<!-- tocstop -->

## Prerequisites

- `node>=v18.0.0`
Expand Down Expand Up @@ -123,11 +128,19 @@ const gateways = await io.getGateways();
"failedConsecutiveEpochs": 0,
"passedEpochCount": 30,
"submittedEpochCount": 30,
"totalEpochParticipationCount": 31,
"totalEpochCount": 31,
"totalEpochsPrescribedCount": 31
},
"status": "joined",
"vaults": {}
"vaults": {},
"weights": {
"compositeWeight": 0.97688888893556,
"gatewayRewardRatioWeight": 1,
"tenureWeight": 0.19444444444444,
"observerRewardRatioWeight": 1,
"normalizedCompositeWeight": 0.19247316211083,
"stakeWeight": 5.02400000024
}
}
],
"hasMore": true,
Expand Down Expand Up @@ -265,6 +278,15 @@ const info = await io.getInfo();

</details>

#### `getTokenSupply()`

Retrieves the total supply of tokens, returned in mIO.

```typescript
const io = IO.init();
const supply = await io.getTokenSupply().then((s) => new mIOToken(s).toIO()); // convert it to IO for readability
```

#### `getBalance({ address })`

Retrieves the balance of the specified wallet address.
Expand All @@ -276,7 +298,7 @@ const balance = await io
.getBalance({
address: 'QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ',
})
.then((balance) => new mIOToken().toIO()); // convert it to IO for readability
.then((balance: number) => new mIOToken(balance).toIO()); // convert it to IO for readability
```

<details>
Expand Down Expand Up @@ -354,11 +376,19 @@ const gateway = await io.getGateway({
"failedConsecutiveEpochs": 0,
"passedEpochCount": 30,
"submittedEpochCount": 30,
"totalEpochParticipationCount": 31,
"totalEpochCount": 31,
"totalEpochsPrescribedCount": 31
},
"status": "joined",
"vaults": {}
"vaults": {},
"weights": {
"compositeWeight": 0.97688888893556,
"gatewayRewardRatioWeight": 1,
"tenureWeight": 0.19444444444444,
"observerRewardRatioWeight": 1,
"normalizedCompositeWeight": 0.19247316211083,
"stakeWeight": 5.02400000024
}
}
```

Expand Down Expand Up @@ -402,11 +432,19 @@ Available `sortBy` options are any of the keys on the gateway object, e.g. `oper
"failedConsecutiveEpochs": 0,
"passedEpochCount": 30,
"submittedEpochCount": 30,
"totalEpochParticipationCount": 31,
"totalEpochCount": 31,
"totalEpochsPrescribedCount": 31
},
"status": "joined",
"vaults": {}
"vaults": {},
"weights": {
"compositeWeight": 0.97688888893556,
"gatewayRewardRatioWeight": 1,
"tenureWeight": 0.19444444444444,
"observerRewardRatioWeight": 1,
"normalizedCompositeWeight": 0.19247316211083,
"stakeWeight": 5.02400000024
}
}
],
"hasMore": true,
Expand Down Expand Up @@ -971,7 +1009,7 @@ The ANT client class exposes APIs relevant to compliant Arweave Name Token proce

### ANT APIs

#### `init({ processId, signer )`
#### `init({ processId, signer })`

Factory function to that creates a read-only or writeable client. By providing a `signer` additional write APIs that require signing, like `setRecord` and `transfer` are available. By default, a read-only client is returned and no write APIs are available.

Expand Down Expand Up @@ -1011,6 +1049,49 @@ const info = await ant.getInfo();

</details>

#### `getState()`

Retrieves the state of the ANT process.

```typescript
const state = await ant.getState();
```

<details>
<summary>Output</summary>

```json
{
"TotalSupply": 1,
"Balances": {
"98O1_xqDLrBKRfQPWjF5p7xZ4Jx6GM8P5PeJn26xwUY": 1
},
"Controllers": [],
"Records": {
"v1-0-0_whitepaper": {
"transactionId": "lNjWn3LpyhKC95Kqe-x8X2qgju0j98MhucdDKK85vc4",
"ttlSeconds": 900
},
"@": {
"transactionId": "2rMLb2uHAyEt7jSu6bXtKx8e-jOfIf7E-DOgQnm8EtU",
"ttlSeconds": 3600
},
"whitepaper": {
"transactionId": "lNjWn3LpyhKC95Kqe-x8X2qgju0j98MhucdDKK85vc4",
"ttlSeconds": 900
}
},
"Initialized": true,
"Ticker": "ANT-AR-IO",
"Logo": "Sie_26dvgyok0PZD_-iQAFOhOd5YxDTkczOLoqTTL_A",
"Denomination": 0,
"Name": "AR.IO Foundation",
"Owner": "98O1_xqDLrBKRfQPWjF5p7xZ4Jx6GM8P5PeJn26xwUY"
}
```

</details>

#### `getOwner()`

Returns the owner of the configured ANT process.
Expand Down
20 changes: 7 additions & 13 deletions examples/cjs/index.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { IO, ioDevnetProcessId, Logger } = require('@ar.io/sdk');
const { IO, Logger, IO_TESTNET_PROCESS_ID } = require('@ar.io/sdk');

(async () => {
// set the log level for the SDK
Expand All @@ -8,15 +8,13 @@ const { IO, ioDevnetProcessId, Logger } = require('@ar.io/sdk');
// testnet gateways
const testnetGateways = await arIO.getGateways();
const protocolBalance = await arIO.getBalance({
address: ioDevnetProcessId,
address: IO_TESTNET_PROCESS_ID,
});
const ardriveRecord = await arIO.getArNSRecord({ name: 'ardrive' });
const partialRecords = await arIO
.getArNSRecords({
page: 10,
pageSize: 5,
})
.then((page) => page.items);
const partialRecords = await arIO.getArNSRecords({
page: 10,
pageSize: 5,
});
const oldEpoch = await arIO.getEpoch({
epochIndex: 0,
});
Expand All @@ -29,12 +27,8 @@ const { IO, ioDevnetProcessId, Logger } = require('@ar.io/sdk');
{
testnetGateways,
ardriveRecord,
partialRecords,
partialRecords: partialRecords.items,
protocolBalance,
arnsStats: {
'registered domains': Object.keys(allRecords).length,
ardrive: allRecords.ardrive,
},
oldEpoch,
epoch,
observations,
Expand Down
Loading
Loading