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

Docs/language guide #92

Merged
merged 18 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ and debugged on a Node.js virtual machine with transpilation to EcmaScript and r

Algorand TypeScript is compiled for execution on the AVM by PuyaTs, a TypeScript frontend for the [Puya](https://github.com/algorandfoundation/puya) optimising compiler that ensures the resulting AVM bytecode execution semantics that match the given TypeScript code. PuyaTs produces output that is directly compatible with AlgoKit typed clients to make deployment and calling easy.

[Documentation](./docs/README.md)
## Documentation

- [Language Guide](docs/language-guide.md)
- [API Docs](docs/api/README.md)
- [CLI Docs](docs/cli.md)
11 changes: 11 additions & 0 deletions docs/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
**@algorandfoundation/algorand-typescript**

***

# @algorandfoundation/algorand-typescript

## Modules

- [arc4](arc4/README.md)
- [index](index/README.md)
- [op](op/README.md)
27 changes: 27 additions & 0 deletions docs/api/arc4/-internal-/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[**@algorandfoundation/algorand-typescript**](../../README.md)

***

[@algorandfoundation/algorand-typescript](../../README.md) / [arc4](../README.md) / \<internal\>

# \<internal\>

## Classes

- [Arc4ArrayBase](classes/Arc4ArrayBase.md)
- [StructBase](classes/StructBase.md)

## Interfaces

- [ClassMethodDecoratorContext](interfaces/ClassMethodDecoratorContext.md)
- [IterableIterator](interfaces/IterableIterator.md)

## Type Aliases

- [BigUintBitSize](type-aliases/BigUintBitSize.md)
- [CompatForArc4Int](type-aliases/CompatForArc4Int.md)
- [ContractMethod](type-aliases/ContractMethod.md)
- [NativeForArc4Int](type-aliases/NativeForArc4Int.md)
- [Readonly](type-aliases/Readonly.md)
- [StructConstructor](type-aliases/StructConstructor.md)
- [UintBitSize](type-aliases/UintBitSize.md)
218 changes: 218 additions & 0 deletions docs/api/arc4/-internal-/classes/Arc4ArrayBase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
[**@algorandfoundation/algorand-typescript**](../../../README.md)

***

[@algorandfoundation/algorand-typescript](../../../README.md) / [arc4](../../README.md) / [\<internal\>](../README.md) / Arc4ArrayBase

# Class: `abstract` Arc4ArrayBase\<TItem\>

Defined in: [packages/algo-ts/src/arc4/encoded-types.ts:232](https://github.com/algorandfoundation/puya-ts/blob/main/packages/algo-ts/src/arc4/encoded-types.ts#L232)

A base type for arc4 array types

## Extends

- [`ARC4Encoded`](../../classes/ARC4Encoded.md)

## Extended by

- [`StaticArray`](../../classes/StaticArray.md)
- [`DynamicArray`](../../classes/DynamicArray.md)
- [`Address`](../../classes/Address.md)
- [`DynamicBytes`](../../classes/DynamicBytes.md)
- [`StaticBytes`](../../classes/StaticBytes.md)

## Type Parameters

• **TItem** *extends* [`ARC4Encoded`](../../classes/ARC4Encoded.md)

## Indexable

\[`index`: [`uint64`](../../../index/type-aliases/uint64.md)\]: `TItem`

## Constructors

### new Arc4ArrayBase()

> `protected` **new Arc4ArrayBase**\<`TItem`\>(): [`Arc4ArrayBase`](Arc4ArrayBase.md)\<`TItem`\>

Defined in: [packages/algo-ts/src/arc4/encoded-types.ts:233](https://github.com/algorandfoundation/puya-ts/blob/main/packages/algo-ts/src/arc4/encoded-types.ts#L233)

#### Returns

[`Arc4ArrayBase`](Arc4ArrayBase.md)\<`TItem`\>

#### Overrides

[`ARC4Encoded`](../../classes/ARC4Encoded.md).[`constructor`](../../classes/ARC4Encoded.md#constructors)

## Accessors

### bytes

#### Get Signature

> **get** **bytes**(): [`bytes`](../../../index/type-aliases/bytes.md)

Defined in: [packages/algo-ts/src/arc4/encoded-types.ts:97](https://github.com/algorandfoundation/puya-ts/blob/main/packages/algo-ts/src/arc4/encoded-types.ts#L97)

Retrieve the encoded bytes for this type

##### Returns

[`bytes`](../../../index/type-aliases/bytes.md)

#### Inherited from

[`ARC4Encoded`](../../classes/ARC4Encoded.md).[`bytes`](../../classes/ARC4Encoded.md#bytes)

***

### length

#### Get Signature

> **get** **length**(): [`uint64`](../../../index/type-aliases/uint64.md)

Defined in: [packages/algo-ts/src/arc4/encoded-types.ts:240](https://github.com/algorandfoundation/puya-ts/blob/main/packages/algo-ts/src/arc4/encoded-types.ts#L240)

Returns the current length of this array

##### Returns

[`uint64`](../../../index/type-aliases/uint64.md)

## Methods

### \[iterator\]()

> **\[iterator\]**(): [`IterableIterator`](../interfaces/IterableIterator.md)\<`TItem`\>

Defined in: [packages/algo-ts/src/arc4/encoded-types.ts:277](https://github.com/algorandfoundation/puya-ts/blob/main/packages/algo-ts/src/arc4/encoded-types.ts#L277)

Returns an iterator for the items in this array

#### Returns

[`IterableIterator`](../interfaces/IterableIterator.md)\<`TItem`\>

***

### at()

> **at**(`index`): `TItem`

Defined in: [packages/algo-ts/src/arc4/encoded-types.ts:249](https://github.com/algorandfoundation/puya-ts/blob/main/packages/algo-ts/src/arc4/encoded-types.ts#L249)

Returns the item at the given index.
Negative indexes are taken from the end.

#### Parameters

##### index

[`Uint64Compat`](../../../index/type-aliases/Uint64Compat.md)

The index of the item to retrieve

#### Returns

`TItem`

***

### entries()

> **entries**(): [`IterableIterator`](../interfaces/IterableIterator.md)\<readonly \[[`uint64`](../../../index/type-aliases/uint64.md), `TItem`\]\>

Defined in: [packages/algo-ts/src/arc4/encoded-types.ts:284](https://github.com/algorandfoundation/puya-ts/blob/main/packages/algo-ts/src/arc4/encoded-types.ts#L284)

Returns an iterator for a tuple of the indexes and items in this array

#### Returns

[`IterableIterator`](../interfaces/IterableIterator.md)\<readonly \[[`uint64`](../../../index/type-aliases/uint64.md), `TItem`\]\>

***

### keys()

> **keys**(): [`IterableIterator`](../interfaces/IterableIterator.md)\<[`uint64`](../../../index/type-aliases/uint64.md)\>

Defined in: [packages/algo-ts/src/arc4/encoded-types.ts:291](https://github.com/algorandfoundation/puya-ts/blob/main/packages/algo-ts/src/arc4/encoded-types.ts#L291)

Returns an iterator for the indexes in this array

#### Returns

[`IterableIterator`](../interfaces/IterableIterator.md)\<[`uint64`](../../../index/type-aliases/uint64.md)\>

***

### slice()

#### Call Signature

> **slice**(): [`DynamicArray`](../../classes/DynamicArray.md)\<`TItem`\>

Defined in: [packages/algo-ts/src/arc4/encoded-types.ts:256](https://github.com/algorandfoundation/puya-ts/blob/main/packages/algo-ts/src/arc4/encoded-types.ts#L256)

**`Internal`**

Create a new Dynamic array with all items from this array

##### Returns

[`DynamicArray`](../../classes/DynamicArray.md)\<`TItem`\>

#### Call Signature

> **slice**(`end`): [`DynamicArray`](../../classes/DynamicArray.md)\<`TItem`\>

Defined in: [packages/algo-ts/src/arc4/encoded-types.ts:262](https://github.com/algorandfoundation/puya-ts/blob/main/packages/algo-ts/src/arc4/encoded-types.ts#L262)

**`Internal`**

Create a new DynamicArray with all items up till `end`.
Negative indexes are taken from the end.

##### Parameters

###### end

[`Uint64Compat`](../../../index/type-aliases/Uint64Compat.md)

An index in which to stop copying items.

##### Returns

[`DynamicArray`](../../classes/DynamicArray.md)\<`TItem`\>

#### Call Signature

> **slice**(`start`, `end`): [`DynamicArray`](../../classes/DynamicArray.md)\<`TItem`\>

Defined in: [packages/algo-ts/src/arc4/encoded-types.ts:269](https://github.com/algorandfoundation/puya-ts/blob/main/packages/algo-ts/src/arc4/encoded-types.ts#L269)

**`Internal`**

Create a new DynamicArray with items from `start`, up until `end`
Negative indexes are taken from the end.

##### Parameters

###### start

[`Uint64Compat`](../../../index/type-aliases/Uint64Compat.md)

An index in which to start copying items.

###### end

[`Uint64Compat`](../../../index/type-aliases/Uint64Compat.md)

An index in which to stop copying items

##### Returns

[`DynamicArray`](../../classes/DynamicArray.md)\<`TItem`\>
67 changes: 67 additions & 0 deletions docs/api/arc4/-internal-/classes/StructBase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[**@algorandfoundation/algorand-typescript**](../../../README.md)

***

[@algorandfoundation/algorand-typescript](../../../README.md) / [arc4](../../README.md) / [\<internal\>](../README.md) / StructBase

# Class: StructBase\<T\>

Defined in: [packages/algo-ts/src/arc4/encoded-types.ts:466](https://github.com/algorandfoundation/puya-ts/blob/main/packages/algo-ts/src/arc4/encoded-types.ts#L466)

The base type for arc4 structs

## Extends

- [`ARC4Encoded`](../../classes/ARC4Encoded.md)

## Type Parameters

• **T**

## Constructors

### new StructBase()

> **new StructBase**\<`T`\>(): [`StructBase`](StructBase.md)\<`T`\>

#### Returns

[`StructBase`](StructBase.md)\<`T`\>

#### Inherited from

[`ARC4Encoded`](../../classes/ARC4Encoded.md).[`constructor`](../../classes/ARC4Encoded.md#constructors)

## Accessors

### bytes

#### Get Signature

> **get** **bytes**(): [`bytes`](../../../index/type-aliases/bytes.md)

Defined in: [packages/algo-ts/src/arc4/encoded-types.ts:97](https://github.com/algorandfoundation/puya-ts/blob/main/packages/algo-ts/src/arc4/encoded-types.ts#L97)

Retrieve the encoded bytes for this type

##### Returns

[`bytes`](../../../index/type-aliases/bytes.md)

#### Inherited from

[`ARC4Encoded`](../../classes/ARC4Encoded.md).[`bytes`](../../classes/ARC4Encoded.md#bytes)

***

### native

#### Get Signature

> **get** **native**(): `T`

Defined in: [packages/algo-ts/src/arc4/encoded-types.ts:470](https://github.com/algorandfoundation/puya-ts/blob/main/packages/algo-ts/src/arc4/encoded-types.ts#L470)

##### Returns

`T`
Loading