Skip to content

Commit

Permalink
Merge branch 'release/v1.24.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
algolucky committed Dec 5, 2022
2 parents c8d1d0a + 9888f42 commit 607515e
Show file tree
Hide file tree
Showing 9 changed files with 403 additions and 548 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# v1.24.0

## What's Changed

### Bugfixes

- Bug-Fix: encode ABI string with non-ASCII characters by @ahangsu in https://github.com/algorand/js-algorand-sdk/pull/700

### Enhancements

- Tests: Migrate v1 algod dependencies to v2 in cucumber tests by @algochoi in https://github.com/algorand/js-algorand-sdk/pull/693
- REST API: Add KV counts to NodeStatusResponse by @michaeldiamant in https://github.com/algorand/js-algorand-sdk/pull/696
- Fix: createMultisigTransaction name in comments by @nullun in https://github.com/algorand/js-algorand-sdk/pull/694
- Enhancement: allowing zero-length static array by @ahangsu in https://github.com/algorand/js-algorand-sdk/pull/698
- ABI: Refactor ABI encoding test to round-trip by @michaeldiamant in https://github.com/algorand/js-algorand-sdk/pull/701

## New Contributors

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

**Full Changelog**: https://github.com/algorand/js-algorand-sdk/compare/v1.23.2...v1.24.0

# v1.23.2

## What's Changed
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Include a minified browser bundle directly in your HTML like so:

```html
<script
src="https://unpkg.com/algosdk@v1.23.2/dist/browser/algosdk.min.js"
integrity="sha384-1gIB0FiLMNmJ7adAfBOdH20Mnw0DZarB9D3PTozUAhKn/uT9CpHdaSbBIpmZTgrU"
src="https://unpkg.com/algosdk@v1.24.0/dist/browser/algosdk.min.js"
integrity="sha384-PgD+QJZqpxjiZn/vLc2OPg8jbbOv7i0Scv2y3aB+VoUNIP4P93CR96QdzEQctWY9"
crossorigin="anonymous"
></script>
```
Expand All @@ -32,8 +32,8 @@ or

```html
<script
src="https://cdn.jsdelivr.net/npm/algosdk@v1.23.2/dist/browser/algosdk.min.js"
integrity="sha384-1gIB0FiLMNmJ7adAfBOdH20Mnw0DZarB9D3PTozUAhKn/uT9CpHdaSbBIpmZTgrU"
src="https://cdn.jsdelivr.net/npm/algosdk@v1.24.0/dist/browser/algosdk.min.js"
integrity="sha384-PgD+QJZqpxjiZn/vLc2OPg8jbbOv7i0Scv2y3aB+VoUNIP4P93CR96QdzEQctWY9"
crossorigin="anonymous"
></script>
```
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "algosdk",
"version": "1.23.2",
"version": "1.24.0",
"description": "The official JavaScript SDK for Algorand",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
15 changes: 10 additions & 5 deletions src/abi/abi_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface Segment {
right: number;
}

const staticArrayRegexp = /^([a-z\d[\](),]+)\[([1-9][\d]*)]$/;
const staticArrayRegexp = /^([a-z\d[\](),]+)\[(0|[1-9][\d]*)]$/;
const ufixedRegexp = /^ufixed([1-9][\d]*)x([1-9][\d]*)$/;

export type ABIValue =
Expand Down Expand Up @@ -380,8 +380,13 @@ export class ABIStringType extends ABIType {
throw new Error(`Cannot encode value as string: ${value}`);
}
const encodedBytes = Buffer.from(value);
const encodedLength = bigIntToBytes(value.length, LENGTH_ENCODE_BYTE_SIZE);
const mergedBytes = new Uint8Array(value.length + LENGTH_ENCODE_BYTE_SIZE);
const encodedLength = bigIntToBytes(
encodedBytes.length,
LENGTH_ENCODE_BYTE_SIZE
);
const mergedBytes = new Uint8Array(
encodedBytes.length + LENGTH_ENCODE_BYTE_SIZE
);
mergedBytes.set(encodedLength);
mergedBytes.set(encodedBytes, LENGTH_ENCODE_BYTE_SIZE);
return mergedBytes;
Expand Down Expand Up @@ -414,9 +419,9 @@ export class ABIArrayStaticType extends ABIType {

constructor(argType: ABIType, arrayLength: number) {
super();
if (arrayLength < 1) {
if (arrayLength < 0) {
throw new Error(
`static array must have a length greater than 0: ${arrayLength}`
`static array must have a non negative length: ${arrayLength}`
);
}
this.childType = argType;
Expand Down
37 changes: 37 additions & 0 deletions src/client/v2/algod/models/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2530,6 +2530,12 @@ export class NodeStatusResponse extends BaseModel {
*/
public catchpointProcessedAccounts?: number | bigint;

/**
* The number of key-values (KVs) from the current catchpoint that have been
* processed so far as part of the catchup
*/
public catchpointProcessedKvs?: number | bigint;

/**
* The total number of accounts included in the current catchpoint
*/
Expand All @@ -2541,12 +2547,23 @@ export class NodeStatusResponse extends BaseModel {
*/
public catchpointTotalBlocks?: number | bigint;

/**
* The total number of key-values (KVs) included in the current catchpoint
*/
public catchpointTotalKvs?: number | bigint;

/**
* The number of accounts from the current catchpoint that have been verified so
* far as part of the catchup
*/
public catchpointVerifiedAccounts?: number | bigint;

/**
* The number of key-values (KVs) from the current catchpoint that have been
* verified so far as part of the catchup
*/
public catchpointVerifiedKvs?: number | bigint;

/**
* The last catchpoint seen by the node
*/
Expand All @@ -2569,11 +2586,16 @@ export class NodeStatusResponse extends BaseModel {
* catchup
* @param catchpointProcessedAccounts - The number of accounts from the current catchpoint that have been processed so
* far as part of the catchup
* @param catchpointProcessedKvs - The number of key-values (KVs) from the current catchpoint that have been
* processed so far as part of the catchup
* @param catchpointTotalAccounts - The total number of accounts included in the current catchpoint
* @param catchpointTotalBlocks - The total number of blocks that are required to complete the current catchpoint
* catchup
* @param catchpointTotalKvs - The total number of key-values (KVs) included in the current catchpoint
* @param catchpointVerifiedAccounts - The number of accounts from the current catchpoint that have been verified so
* far as part of the catchup
* @param catchpointVerifiedKvs - The number of key-values (KVs) from the current catchpoint that have been
* verified so far as part of the catchup
* @param lastCatchpoint - The last catchpoint seen by the node
*/
constructor({
Expand All @@ -2588,9 +2610,12 @@ export class NodeStatusResponse extends BaseModel {
catchpoint,
catchpointAcquiredBlocks,
catchpointProcessedAccounts,
catchpointProcessedKvs,
catchpointTotalAccounts,
catchpointTotalBlocks,
catchpointTotalKvs,
catchpointVerifiedAccounts,
catchpointVerifiedKvs,
lastCatchpoint,
}: {
catchupTime: number | bigint;
Expand All @@ -2604,9 +2629,12 @@ export class NodeStatusResponse extends BaseModel {
catchpoint?: string;
catchpointAcquiredBlocks?: number | bigint;
catchpointProcessedAccounts?: number | bigint;
catchpointProcessedKvs?: number | bigint;
catchpointTotalAccounts?: number | bigint;
catchpointTotalBlocks?: number | bigint;
catchpointTotalKvs?: number | bigint;
catchpointVerifiedAccounts?: number | bigint;
catchpointVerifiedKvs?: number | bigint;
lastCatchpoint?: string;
}) {
super();
Expand All @@ -2621,9 +2649,12 @@ export class NodeStatusResponse extends BaseModel {
this.catchpoint = catchpoint;
this.catchpointAcquiredBlocks = catchpointAcquiredBlocks;
this.catchpointProcessedAccounts = catchpointProcessedAccounts;
this.catchpointProcessedKvs = catchpointProcessedKvs;
this.catchpointTotalAccounts = catchpointTotalAccounts;
this.catchpointTotalBlocks = catchpointTotalBlocks;
this.catchpointTotalKvs = catchpointTotalKvs;
this.catchpointVerifiedAccounts = catchpointVerifiedAccounts;
this.catchpointVerifiedKvs = catchpointVerifiedKvs;
this.lastCatchpoint = lastCatchpoint;

this.attribute_map = {
Expand All @@ -2638,9 +2669,12 @@ export class NodeStatusResponse extends BaseModel {
catchpoint: 'catchpoint',
catchpointAcquiredBlocks: 'catchpoint-acquired-blocks',
catchpointProcessedAccounts: 'catchpoint-processed-accounts',
catchpointProcessedKvs: 'catchpoint-processed-kvs',
catchpointTotalAccounts: 'catchpoint-total-accounts',
catchpointTotalBlocks: 'catchpoint-total-blocks',
catchpointTotalKvs: 'catchpoint-total-kvs',
catchpointVerifiedAccounts: 'catchpoint-verified-accounts',
catchpointVerifiedKvs: 'catchpoint-verified-kvs',
lastCatchpoint: 'last-catchpoint',
};
}
Expand Down Expand Up @@ -2692,9 +2726,12 @@ export class NodeStatusResponse extends BaseModel {
catchpoint: data['catchpoint'],
catchpointAcquiredBlocks: data['catchpoint-acquired-blocks'],
catchpointProcessedAccounts: data['catchpoint-processed-accounts'],
catchpointProcessedKvs: data['catchpoint-processed-kvs'],
catchpointTotalAccounts: data['catchpoint-total-accounts'],
catchpointTotalBlocks: data['catchpoint-total-blocks'],
catchpointTotalKvs: data['catchpoint-total-kvs'],
catchpointVerifiedAccounts: data['catchpoint-verified-accounts'],
catchpointVerifiedKvs: data['catchpoint-verified-kvs'],
lastCatchpoint: data['last-catchpoint'],
});
/* eslint-enable dot-notation */
Expand Down
2 changes: 1 addition & 1 deletion src/multisig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ interface MultisigMetadataWithPks extends Omit<MultisigMetadata, 'addrs'> {
}

/**
* createRawMultisigTransaction creates a raw, unsigned multisig transaction blob.
* createMultisigTransaction creates a raw, unsigned multisig transaction blob.
* @param txn - the actual transaction.
* @param version - multisig version
* @param threshold - multisig threshold
Expand Down
Loading

0 comments on commit 607515e

Please sign in to comment.