-
Notifications
You must be signed in to change notification settings - Fork 5
feat: application transaction #27
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Meet Thosar <meetthosar@gmail.com>
53e63a3 to
3d2ef13
Compare
3d2ef13 to
24edd5f
Compare
There was a problem hiding this 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
ApplicationCallTransactionclass andApplicationCallTxBuilderfor 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.
| "typeof": "bigint", | ||
| "description": "Maximum number of integer values that may be stored in the [global || local] application key/value store." | ||
| }, | ||
| "nbs": { | ||
| "typeof": "bigint", |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
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.
| "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", |
| "typeof": "bigint", | ||
| "description": "Maximum number of integer values that may be stored in the [global || local] application key/value store." | ||
| }, | ||
| "nbs": { | ||
| "typeof": "bigint", |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
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.
| "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", |
| }, | ||
| "apid": { | ||
| "title": "Application ID", | ||
| "typeof": "bigint", |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
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.
| "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", |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
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.
| }, | ||
| "apap": { | ||
| "title": "Approval Program", | ||
| "typeof" : "Uint8Array", |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
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.
| addLocalSchema(apls: StateSchema): IApplicationCallTxBuilder; | ||
| /** | ||
| * {@inheritDoc ApplicationCallTransaction#apep} | ||
| * @param {StateSchema} apep - Number of pages to add |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
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.
| * @param {StateSchema} apep - Number of pages to add | |
| * @param {number} apep - Number of pages to add |
| AlgorandTransactionCrafter, ApplicationCallTransaction, | ||
| ApplicationCallTxBuilder, | ||
| AssetConfigTransaction, | ||
| AssetParamsBuilder, Transaction |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused imports ApplicationCallTransaction, Transaction.
| AlgorandTransactionCrafter, ApplicationCallTransaction, | |
| ApplicationCallTxBuilder, | |
| AssetConfigTransaction, | |
| AssetParamsBuilder, Transaction | |
| AlgorandTransactionCrafter, | |
| ApplicationCallTxBuilder, | |
| AssetConfigTransaction, | |
| AssetParamsBuilder |
| AssetConfigTransaction, | ||
| AssetParamsBuilder, Transaction | ||
| } from "./index"; | ||
| import algosdk, {ABIStringType, Address, SuggestedParams} from "algosdk"; |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused imports ABIStringType, algosdk.
| import algosdk, {ABIStringType, Address, SuggestedParams} from "algosdk"; | |
| import {Address, SuggestedParams} from "algosdk"; |
| 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"; |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import decode.
| import {decode} from "algorand-msgpack"; |
| 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"; |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import msgpack.
| import * as msgpack from "algo-msgpack-with-bigint"; |
Overview
ApplicationCallTransactionforapplTODO:
appl