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: bump typedoc dependencies #7

Merged
merged 2 commits into from
Sep 30, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 6 additions & 88 deletions docs/code/README.md
Original file line number Diff line number Diff line change
@@ -1,93 +1,11 @@
@algorandfoundation/algokit-utils-debug
**@algorandfoundation/algokit-utils-debug** • **Docs**

# @algorandfoundation/algokit-utils-debug

## Table of contents

### Functions
***

- [registerDebugEventHandlers](README.md#registerdebugeventhandlers)
- [writeAVMDebugTrace](README.md#writeavmdebugtrace)
- [writeTealDebugSourceMaps](README.md#writetealdebugsourcemaps)
# @algorandfoundation/algokit-utils-debug

## Functions

### registerDebugEventHandlers

▸ **registerDebugEventHandlers**(): `void`

Registers event handlers for debugging events in Algorand development.

This function sets up handlers for the following events:
- 'TxnGroupSimulated': Calls the `writeAVMDebugTrace` function to generate and persist an AVM debug trace.
- 'AppCompiled': Calls the `writeTealDebugSourceMaps` function to generate and persist TEAL source maps.

These handlers help in debugging Algorand smart contracts by providing detailed traces and source maps.

#### Returns

`void`

#### Defined in

[index.ts:17](https://github.com/algorandfoundation/algokit-utils-ts-debug/blob/main/src/index.ts#L17)

___

### writeAVMDebugTrace

▸ **writeAVMDebugTrace**(`input`): `Promise`\<`void`\>

Generates an AVM debug trace from the provided simulation response and persists it to a file.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `input` | `AVMTracesEventData` | The AVMTracesEventData containing the simulation response and other relevant information. |

#### Returns

`Promise`\<`void`\>

An object containing the output file path and the trace content as a string.

**`Example`**

```ts
const eventData: AVMTracesEventData = {
simulateResponse: // ... simulation response object
};

const result = await writeAVMDebugTrace(eventData);
console.log(`Debug trace saved to: ${result.outputPath}`);
console.log(`Trace content: ${result.traceContent}`);
```

#### Defined in

[debugging/writeAVMDebugTrace.ts:20](https://github.com/algorandfoundation/algokit-utils-ts-debug/blob/main/src/debugging/writeAVMDebugTrace.ts#L20)

___

### writeTealDebugSourceMaps

▸ **writeTealDebugSourceMaps**(`input`): `Promise`\<`void`\>

Generates a source map for the given Teal source code.

#### Parameters

| Name | Type |
| :------ | :------ |
| `input` | `TealSourcesDebugEventData` |

#### Returns

`Promise`\<`void`\>

A promise that resolves when the source map has been generated.

#### Defined in

[debugging/writeTealDebugSourceMaps.ts:36](https://github.com/algorandfoundation/algokit-utils-ts-debug/blob/main/src/debugging/writeTealDebugSourceMaps.ts#L36)
- [registerDebugEventHandlers](functions/registerDebugEventHandlers.md)
- [writeAVMDebugTrace](functions/writeAVMDebugTrace.md)
- [writeTealDebugSourceMaps](functions/writeTealDebugSourceMaps.md)
25 changes: 25 additions & 0 deletions docs/code/functions/registerDebugEventHandlers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[**@algorandfoundation/algokit-utils-debug**](../README.md) • **Docs**

***

[@algorandfoundation/algokit-utils-debug](../README.md) / registerDebugEventHandlers

# Function: registerDebugEventHandlers()

> **registerDebugEventHandlers**(): `void`

Registers event handlers for debugging events in Algorand development.

This function sets up handlers for the following events:
- 'TxnGroupSimulated': Calls the `writeAVMDebugTrace` function to generate and persist an AVM debug trace.
- 'AppCompiled': Calls the `writeTealDebugSourceMaps` function to generate and persist TEAL source maps.

These handlers help in debugging Algorand smart contracts by providing detailed traces and source maps.

## Returns

`void`

## Defined in

[index.ts:17](https://github.com/algorandfoundation/algokit-utils-ts-debug/blob/main/src/index.ts#L17)
39 changes: 39 additions & 0 deletions docs/code/functions/writeAVMDebugTrace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[**@algorandfoundation/algokit-utils-debug**](../README.md) • **Docs**

***

[@algorandfoundation/algokit-utils-debug](../README.md) / writeAVMDebugTrace

# Function: writeAVMDebugTrace()

> **writeAVMDebugTrace**(`input`): `Promise`\<`void`\>

Generates an AVM debug trace from the provided simulation response and persists it to a file.

## Parameters

• **input**: `AVMTracesEventData`

The AVMTracesEventData containing the simulation response and other relevant information.

## Returns

`Promise`\<`void`\>

An object containing the output file path and the trace content as a string.

## Example

```ts
const eventData: AVMTracesEventData = {
simulateResponse: // ... simulation response object
};

const result = await writeAVMDebugTrace(eventData);
console.log(`Debug trace saved to: ${result.outputPath}`);
console.log(`Trace content: ${result.traceContent}`);
```

## Defined in

[debugging/writeAVMDebugTrace.ts:20](https://github.com/algorandfoundation/algokit-utils-ts-debug/blob/main/src/debugging/writeAVMDebugTrace.ts#L20)
31 changes: 31 additions & 0 deletions docs/code/functions/writeTealDebugSourceMaps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[**@algorandfoundation/algokit-utils-debug**](../README.md) • **Docs**

***

[@algorandfoundation/algokit-utils-debug](../README.md) / writeTealDebugSourceMaps

# Function: writeTealDebugSourceMaps()

> **writeTealDebugSourceMaps**(`input`): `Promise`\<`void`\>

Generates and writes debug source maps for multiple TEAL sources.

## Parameters

• **input**: `TealSourcesDebugEventData`

An object of type TealSourcesDebugEventData containing an array of TEAL sources.

## Returns

`Promise`\<`void`\>

A promise that resolves when all source maps have been generated and written.

## Throws

Will throw an error if there's an issue during the source map generation or writing process.

## Defined in

[debugging/writeTealDebugSourceMaps.ts:37](https://github.com/algorandfoundation/algokit-utils-ts-debug/blob/main/src/debugging/writeTealDebugSourceMaps.ts#L37)
Loading
Loading