Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: algorand/js-algorand-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.7.0
Choose a base ref
...
head repository: algorand/js-algorand-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.8.0
Choose a head ref
  • 6 commits
  • 14 files changed
  • 6 contributors

Commits on Dec 18, 2023

  1. API: Regenerate algod and indexer models (#845)

    * Regenerate algod and indexer models
    
    * Use fix-js-github-action branch of generator
    
    * revert codegen job changes
    jasonpaulos authored Dec 18, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6fdfa11 View commit details

Commits on Feb 27, 2024

  1. Fix: Update chromedriver deps, make install conditional in CI, and fi…

    …x indexer sync error in cucumber tests (#859)
    jasonpaulos authored Feb 27, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a4eccfb View commit details

Commits on Apr 25, 2024

  1. fix: allow either boolean value for nonParticipation offline keyregs (#…

    joe-p authored Apr 25, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    981905a View commit details

Commits on Jun 3, 2024

  1. Spec: Regenerate code from specification file f633b019 (#870)

    * Regenerate code from specification file
    
    * Enable the minbalance cucumber tests.
    
    ---------
    
    Co-authored-by: Algorand Generation Bot <codegen@algorand.com>
    gmalouf and algo-dev-service authored Jun 3, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1d09e42 View commit details

Commits on Jun 5, 2024

  1. bump up version to v2.8.0

    gmalouf committed Jun 5, 2024
    Copy the full SHA
    3976e18 View commit details
  2. Merge branch 'release/v2.8.0'

    Algo-devops-service committed Jun 5, 2024
    Copy the full SHA
    8aaa432 View commit details
Showing with 1,494 additions and 192 deletions.
  1. +13 −3 .circleci/config.yml
  2. +22 −0 CHANGELOG.md
  3. +4 −4 README.md
  4. +5 −3 examples/asa.ts
  5. +8 −2 examples/indexer.ts
  6. +0 −1 examples/participation.ts
  7. +35 −0 examples/utils.ts
  8. +834 −46 package-lock.json
  9. +2 −2 package.json
  10. +298 −0 src/client/v2/algod/models/types.ts
  11. +241 −127 src/client/v2/indexer/models/types.ts
  12. +1 −1 src/makeTxn.ts
  13. +30 −3 tests/cucumber/steps/steps.js
  14. +1 −0 tests/cucumber/unit.tags
16 changes: 13 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ version: 2.1
orbs:
node: circleci/node@5.0.0
slack: circleci/slack@4.4.2
browser-tools: circleci/browser-tools@1.4.3
browser-tools: circleci/browser-tools@1.4.8
gh-pages: sugarshin/gh-pages@1.0.0

parameters:
@@ -77,6 +77,7 @@ jobs:
- checkout
- install_dependencies:
sudo: 'sudo'
browser: << parameters.browser >>
- run:
name: Install docker
command: |
@@ -89,7 +90,13 @@ jobs:
$(lsb_release -cs) stable" | $SUDO tee /etc/apt/sources.list.d/docker.list > /dev/null
$SUDO apt update
$SUDO apt -y install docker-ce docker-ce-cli containerd.io
- browser-tools/install-browser-tools
- when:
condition:
not:
equal: ['node', << parameters.browser >>]
steps:
browser-tools/install-browser-tools:
replace-existing-chrome: true
- run:
name: << parameters.browser >> test
command: |
@@ -120,6 +127,9 @@ commands:
sudo:
type: string
default: ''
browser:
type: string
default: ''
steps:
- run:
name: Install Dependencies
@@ -133,4 +143,4 @@ commands:
command: |
set -e
npm ci
npm install chromedriver@latest
if [ "<< parameters.browser >>" == "chrome" ]; then npm install chromedriver@latest; fi
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# v2.8.0

<!-- Release notes generated using configuration in .github/release.yml at release/v2.8.0 -->

## What's Changed

### Bugfixes

- Fix: Update chromedriver deps, make install conditional in CI, and fix indexer sync error in cucumber tests by @jasonpaulos in https://github.com/algorand/js-algorand-sdk/pull/859
- fix: allow either boolean value for nonParticipation offline keyregs by @joe-p in https://github.com/algorand/js-algorand-sdk/pull/866

### Enhancements

- API: Regenerate algod and indexer models by @jasonpaulos in https://github.com/algorand/js-algorand-sdk/pull/845
- Spec: Regenerate code from specification file f633b019 by @gmalouf in https://github.com/algorand/js-algorand-sdk/pull/870

## New Contributors

- @gmalouf made their first contribution in https://github.com/algorand/js-algorand-sdk/pull/870

**Full Changelog**: https://github.com/algorand/js-algorand-sdk/compare/v2.7.0...v2.8.0

# v2.7.0

<!-- Release notes generated using configuration in .github/release.yml at release/v2.7.0 -->
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -20,8 +20,8 @@ Include a minified browser bundle directly in your HTML like so:

```html
<script
src="https://unpkg.com/algosdk@v2.7.0/dist/browser/algosdk.min.js"
integrity="sha384-OP8U0zDUgTdYdeyxnrhicwju6SuPxm2tx4WaTYDeP5JiMS/OyifldTK5Y3vzPK9K"
src="https://unpkg.com/algosdk@v2.8.0/dist/browser/algosdk.min.js"
integrity="sha384-Yf0K01l2B3xzeVyU5y0g9/1cE753a/mHjarJ3l73s43RWU4t3ZCaW72qDKQXfr78"
crossorigin="anonymous"
></script>
```
@@ -30,8 +30,8 @@ or

```html
<script
src="https://cdn.jsdelivr.net/npm/algosdk@v2.7.0/dist/browser/algosdk.min.js"
integrity="sha384-OP8U0zDUgTdYdeyxnrhicwju6SuPxm2tx4WaTYDeP5JiMS/OyifldTK5Y3vzPK9K"
src="https://cdn.jsdelivr.net/npm/algosdk@v2.8.0/dist/browser/algosdk.min.js"
integrity="sha384-Yf0K01l2B3xzeVyU5y0g9/1cE753a/mHjarJ3l73s43RWU4t3ZCaW72qDKQXfr78"
crossorigin="anonymous"
></script>
```
8 changes: 5 additions & 3 deletions examples/asa.ts
Original file line number Diff line number Diff line change
@@ -7,10 +7,12 @@ import {
getLocalAlgodClient,
getLocalAccounts,
getLocalIndexerClient,
indexerWaitForRound,
} from './utils';

async function main() {
const algodClient = getLocalAlgodClient();
const indexerClient = getLocalIndexerClient();
const accounts = await getLocalAccounts();
const creator = accounts[0];

@@ -49,11 +51,11 @@ async function main() {
console.log(`Asset Params: ${assetInfo.params}`);
// example: ASSET_INFO

await new Promise((f) => setTimeout(f, 45000)); // sleep to ensure indexer is caught up
// ensure indexer is caught up
await indexerWaitForRound(indexerClient, result['confirmed-round'], 30);

// example: INDEXER_LOOKUP_ASSET
const indexer = getLocalIndexerClient();
const indexerAssetInfo = await indexer.lookupAssetByID(assetIndex).do();
const indexerAssetInfo = await indexerClient.lookupAssetByID(assetIndex).do();
console.log('Indexer Asset Info:', indexerAssetInfo);
// example: INDEXER_LOOKUP_ASSET

10 changes: 8 additions & 2 deletions examples/indexer.ts
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ import {
getLocalIndexerClient,
getLocalAccounts,
getLocalAlgodClient,
indexerWaitForRound,
} from './utils';
import algosdk from '../src';

@@ -73,9 +74,14 @@ async function main() {
});

await client.sendRawTransaction(txn.signTxn(sender.privateKey)).do();
await algosdk.waitForConfirmation(client, txn.txID().toString(), 3);
const result = await algosdk.waitForConfirmation(
client,
txn.txID().toString(),
3
);

await new Promise((f) => setTimeout(f, 1000)); // sleep to ensure indexer is caught up
// ensure indexer is caught up
await indexerWaitForRound(indexerClient, result['confirmed-round'], 30);

// example: INDEXER_PREFIX_SEARCH
const txnsWithNotePrefix = await indexerClient
1 change: 0 additions & 1 deletion examples/participation.ts
Original file line number Diff line number Diff line change
@@ -49,7 +49,6 @@ async function main() {
{
from: addr,
suggestedParams,
nonParticipation: true,
}
);
console.log(offlineKeyReg.get_obj_for_encoding());
35 changes: 35 additions & 0 deletions examples/utils.ts
Original file line number Diff line number Diff line change
@@ -45,6 +45,41 @@ export function getLocalAlgodClient() {
return algodClient;
}

function sleep(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}

export async function indexerWaitForRound(
client: algosdk.Indexer,
round: number | bigint,
maxAttempts: number
) {
let indexerRound = 0;
let attempts = 0;

for (;;) {
// eslint-disable-next-line no-await-in-loop
const status = await client.makeHealthCheck().do();
indexerRound = status.round;

if (indexerRound >= round) {
// Success
break;
}

// eslint-disable-next-line no-await-in-loop
await sleep(1000); // Sleep 1 second and check again
attempts += 1;

if (attempts > maxAttempts) {
// Failsafe to prevent infinite loop
throw new Error(
`Timeout waiting for indexer to catch up to round ${round}. It is currently on ${indexerRound}`
);
}
}
}

export interface SandboxAccount {
addr: string;
privateKey: Uint8Array;
Loading