Skip to content

Conversation

@PhearZero
Copy link
Contributor

@PhearZero PhearZero commented Mar 11, 2025

Overview

  • adds ApplicationCallTransaction for appl

TODO:

  • Proper encoding for appl
  • Transaction Crafter methods

Co-authored-by: Meet Thosar <meetthosar@gmail.com>
@PhearZero PhearZero self-assigned this Mar 11, 2025
@PhearZero PhearZero changed the base branch from fix/axfer-amt to main March 12, 2025 14:55
@PhearZero PhearZero force-pushed the feat/application-transaction branch from 53e63a3 to 3d2ef13 Compare March 12, 2025 18:03
@PhearZero PhearZero force-pushed the feat/application-transaction branch from 3d2ef13 to 24edd5f Compare March 12, 2025 18:49
@PhearZero PhearZero marked this pull request as ready for review March 12, 2025 18:50
@ehanoc ehanoc requested a review from Copilot October 29, 2025 10:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for Algorand Application Call transactions, enabling the creation, configuration, and interaction with smart contracts on the Algorand blockchain. The implementation includes transaction builders, JSON schema definitions, and comprehensive end-to-end tests.

  • Introduces ApplicationCallTransaction class and ApplicationCallTxBuilder for creating application transactions
  • Adds JSON schema files for application transactions and state schema definitions
  • Implements E2E test covering application creation and method invocation

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
lib/algorand.transaction.appl.ts New file implementing ApplicationCallTransaction class and builder with methods for configuring application transactions
lib/algorand.transaction.ts Updated Transaction type alias to include ApplicationCallTransaction
lib/index.ts Added export for the new application transaction module
lib/schemas/state.schema.json New JSON schema defining state schema structure for application storage
lib/schemas/appl.transaction.json New JSON schema defining the structure of application call transactions
lib/e2e.spec.ts Added comprehensive E2E test for application creation and method calls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +8 to +12
"typeof": "bigint",
"description": "Maximum number of integer values that may be stored in the [global || local] application key/value store."
},
"nbs": {
"typeof": "bigint",
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSON Schema keyword should be 'type', not 'typeof'. The value should also be a valid JSON Schema type like 'integer' or 'number', not 'bigint' which is not a standard JSON Schema type.

Suggested change
"typeof": "bigint",
"description": "Maximum number of integer values that may be stored in the [global || local] application key/value store."
},
"nbs": {
"typeof": "bigint",
"type": "integer",
"description": "Maximum number of integer values that may be stored in the [global || local] application key/value store."
},
"nbs": {
"type": "integer",

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +12
"typeof": "bigint",
"description": "Maximum number of integer values that may be stored in the [global || local] application key/value store."
},
"nbs": {
"typeof": "bigint",
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSON Schema keyword should be 'type', not 'typeof'. The value should also be a valid JSON Schema type like 'integer' or 'number', not 'bigint' which is not a standard JSON Schema type.

Suggested change
"typeof": "bigint",
"description": "Maximum number of integer values that may be stored in the [global || local] application key/value store."
},
"nbs": {
"typeof": "bigint",
"type": "integer",
"description": "Maximum number of integer values that may be stored in the [global || local] application key/value store."
},
"nbs": {
"type": "integer",

Copilot uses AI. Check for mistakes.
},
"apid": {
"title": "Application ID",
"typeof": "bigint",
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSON Schema keyword should be 'type', not 'typeof'. The value should also be a valid JSON Schema type like 'integer' or 'number', not 'bigint' which is not a standard JSON Schema type.

Copilot uses AI. Check for mistakes.
"type": "array",
"description": "List of accounts in addition to the sender that may be accessed from the application's approval-program and clear-state-program.",
"items": {
"typeof" : "Uint8Array",
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSON Schema keyword should be 'type', not 'typeof'. 'Uint8Array' is not a standard JSON Schema type. Consider using 'string' with format 'byte' or 'binary' for binary data.

Copilot uses AI. Check for mistakes.
},
"apap": {
"title": "Approval Program",
"typeof" : "Uint8Array",
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSON Schema keyword should be 'type', not 'typeof'. 'Uint8Array' is not a standard JSON Schema type. Consider using 'string' with format 'byte' or 'binary' for binary data.

Copilot uses AI. Check for mistakes.
addLocalSchema(apls: StateSchema): IApplicationCallTxBuilder;
/**
* {@inheritDoc ApplicationCallTransaction#apep}
* @param {StateSchema} apep - Number of pages to add
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter type annotation is incorrect. It should be @param {number} apep instead of @param {StateSchema} apep, as apep is a number representing the count of extra program pages.

Suggested change
* @param {StateSchema} apep - Number of pages to add
* @param {number} apep - Number of pages to add

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +6
AlgorandTransactionCrafter, ApplicationCallTransaction,
ApplicationCallTxBuilder,
AssetConfigTransaction,
AssetParamsBuilder, Transaction
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused imports ApplicationCallTransaction, Transaction.

Suggested change
AlgorandTransactionCrafter, ApplicationCallTransaction,
ApplicationCallTxBuilder,
AssetConfigTransaction,
AssetParamsBuilder, Transaction
AlgorandTransactionCrafter,
ApplicationCallTxBuilder,
AssetConfigTransaction,
AssetParamsBuilder

Copilot uses AI. Check for mistakes.
AssetConfigTransaction,
AssetParamsBuilder, Transaction
} from "./index";
import algosdk, {ABIStringType, Address, SuggestedParams} from "algosdk";
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused imports ABIStringType, algosdk.

Suggested change
import algosdk, {ABIStringType, Address, SuggestedParams} from "algosdk";
import {Address, SuggestedParams} from "algosdk";

Copilot uses AI. Check for mistakes.
import {encode} from "hi-base32";
import {sha512_256} from "js-sha512";
import {Arc56Contract} from "@algorandfoundation/algokit-utils/types/app-arc56";
import {decode} from "algorand-msgpack";
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import decode.

Suggested change
import {decode} from "algorand-msgpack";

Copilot uses AI. Check for mistakes.
import {sha512_256} from "js-sha512";
import {Arc56Contract} from "@algorandfoundation/algokit-utils/types/app-arc56";
import {decode} from "algorand-msgpack";
import * as msgpack from "algo-msgpack-with-bigint";
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import msgpack.

Suggested change
import * as msgpack from "algo-msgpack-with-bigint";

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants