Skip to content

Commit

Permalink
Merge pull request #835 from algorand/3.0.0-merge-develop
Browse files Browse the repository at this point in the history
Merge develop into 3.0.0
  • Loading branch information
jasonpaulos authored Oct 6, 2023
2 parents 6d17cd3 + fb81c1d commit a4f44c6
Show file tree
Hide file tree
Showing 22 changed files with 1,259 additions and 140 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ commands:
<< parameters.sudo >> apt -y update
<< parameters.sudo >> apt -y install curl make git build-essential jq unzip
- node/install:
node-version: '16'
node-version: '18'
- run:
name: npm ci
command: |
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
env: {
browser: true,
es2021: true,
'shared-node-browser': true,
},
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18

- name: Update Version References in Source
env:
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# v2.6.0

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

## What's Changed

### Bugfixes

- signer: Only merge multisigs if there are more than 1 by @acfunk in https://github.com/algorand/js-algorand-sdk/pull/822

### New Features

- Simulate: Application State Change and Hash of Executed Bytecode by @ahangsu in https://github.com/algorand/js-algorand-sdk/pull/818

### Enhancements

- node: Update to node 18, drop support for node 16 by @jasonpaulos in https://github.com/algorand/js-algorand-sdk/pull/827
- api: Regenerate client. by @winder in https://github.com/algorand/js-algorand-sdk/pull/826

## New Contributors

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

**Full Changelog**: https://github.com/algorand/js-algorand-sdk/compare/v2.5.0...v2.6.0

# v2.5.0

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

```html
<script
src="https://unpkg.com/algosdk@v2.5.0/dist/browser/algosdk.min.js"
integrity="sha384-6PTPyb/CJ0CVqEu9Ff7ss4fpdAI0H9DgjQ1y0ftafqNMTC0I9sJvkSu1rHuWT5vf"
src="https://unpkg.com/algosdk@v2.6.0/dist/browser/algosdk.min.js"
integrity="sha384-lQFw8cXCcsNWUXAkEbZNvOieLVDwHbFLQILZZ2yr3CQlzBYQKUE0MjsiQe7GsP09"
crossorigin="anonymous"
></script>
```
Expand All @@ -30,8 +30,8 @@ or

```html
<script
src="https://cdn.jsdelivr.net/npm/algosdk@v2.5.0/dist/browser/algosdk.min.js"
integrity="sha384-6PTPyb/CJ0CVqEu9Ff7ss4fpdAI0H9DgjQ1y0ftafqNMTC0I9sJvkSu1rHuWT5vf"
src="https://cdn.jsdelivr.net/npm/algosdk@v2.6.0/dist/browser/algosdk.min.js"
integrity="sha384-lQFw8cXCcsNWUXAkEbZNvOieLVDwHbFLQILZZ2yr3CQlzBYQKUE0MjsiQe7GsP09"
crossorigin="anonymous"
></script>
```
Expand Down
2 changes: 1 addition & 1 deletion examples/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async function main() {
3
);
// Grab app id from confirmed transaction result
const appId = result.applicationIndex;
const appId = Number(result.applicationIndex);
console.log(`Created app with index: ${appId}`);
// example: APP_CREATE

Expand Down
2 changes: 1 addition & 1 deletion examples/asa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function main() {
3
);

const { assetIndex } = result;
const assetIndex = Number(result.assetIndex);
console.log(`Asset ID created: ${assetIndex}`);
// example: ASSET_CREATE

Expand Down
2 changes: 1 addition & 1 deletion examples/atc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async function main() {
createTxn.txID().toString(),
3
);
const appIndex = response.applicationIndex;
const appIndex = Number(response.applicationIndex);

// example: ATC_CREATE
const atc = new algosdk.AtomicTransactionComposer();
Expand Down
2 changes: 1 addition & 1 deletion examples/block_fetcher/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function removeNulls(obj) {

while (true) {
// Get latest round number
let { lastRound } = status;
let lastRound = Number(status.lastRound);
console.log(`Round: ${lastRound}`);

// Fetch block
Expand Down
88 changes: 3 additions & 85 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "algosdk",
"version": "2.5.0",
"version": "2.6.0",
"description": "The official JavaScript SDK for Algorand",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand All @@ -22,7 +22,6 @@
},
"dependencies": {
"algo-msgpack-with-bigint": "^2.1.1",
"cross-fetch": "^4.0.0",
"hi-base32": "^0.5.1",
"js-sha256": "^0.9.0",
"js-sha3": "^0.8.0",
Expand Down Expand Up @@ -79,6 +78,6 @@
"author": "Algorand, llc",
"license": "MIT",
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
}
}
1 change: 0 additions & 1 deletion src/client/urlTokenBaseHTTPClient.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { fetch, Response, Headers } from 'cross-fetch';
import {
BaseHTTPClient,
BaseHTTPClientResponse,
Expand Down
18 changes: 18 additions & 0 deletions src/client/v2/algod/algod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Genesis from './genesis';
import GetAssetByID from './getAssetByID';
import GetApplicationByID from './getApplicationByID';
import GetBlockHash from './getBlockHash';
import GetBlockTxids from './getBlockTxids';
import GetApplicationBoxByName from './getApplicationBoxByName';
import GetApplicationBoxes from './getApplicationBoxes';
import HealthCheck from './healthCheck';
Expand Down Expand Up @@ -238,6 +239,23 @@ export default class AlgodClient extends ServiceClient {
return new GetBlockHash(this.c, this.intDecoding, roundNumber);
}

/**
* Get the top level transaction IDs for the block on the given round.
*
* #### Example
* ```typescript
* const roundNumber = 18038133;
* const block = await algodClient.getBlockTxids(roundNumber).do();
* ```
*
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2blocksroundtxids)
* @param roundNumber - The round number of the block to get.
* @category GET
*/
getBlockTxids(roundNumber: number) {
return new GetBlockTxids(this.c, this.intDecoding, roundNumber);
}

/**
* Returns the transaction information for a specific pending transaction.
*
Expand Down
18 changes: 18 additions & 0 deletions src/client/v2/algod/getBlockTxids.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import JSONRequest from '../jsonrequest';
import HTTPClient from '../../client';
import IntDecoding from '../../../types/intDecoding';

export default class GetBlockTxids extends JSONRequest {
round: number;

constructor(c: HTTPClient, intDecoding: IntDecoding, roundNumber: number) {
super(c, intDecoding);
if (!Number.isInteger(roundNumber))
throw Error('roundNumber should be an integer');
this.round = roundNumber;
}

path() {
return `/v2/blocks/${this.round}/txids`;
}
}
Loading

0 comments on commit a4f44c6

Please sign in to comment.