Application Status
Status: Submitted on 17.01.2025
Last updated: 17.01.2025
Submitted by Ilia Shekhovtsov [[email protected]]
Team: Ilia Shekhovtsov, Denis Davidyuk
Approved Budget (in h): 120
Used Budget (in h): 0
Planned Delivery: 17.03.2025
Specify the funding category
Open Source Development
Application Title
Generator of TypeScript interfaces based on Aeternity Contract Interface
Applicant
Ilia Shekhovtsov - GitHub
Denis Davidyuk – GitHub
Value Application
The goal is to implement a code generator. This generator will speed up the development by automating the definition of contract types, currently done manually.
Definition of Terms
ACI - Aeternity Contract Interface, JSON document containing definition of aeternity contract methods.
TypeScript - A version of JavaScript with type checking.
Status Quo
If the developer needs type-checking of contract methods, he must manually define the contract interface. For example, having a contract
contract Identity =
entrypoint getArg(x : int) = x
it needs to be defined as
import { Contract } from '@aeternity/aepp-sdk';
const contract = new Contract<{
// extra work, can be extacted from contract source
getArg: (x: number | bigint) => bigint;
}>(options);
Required Work
To implemet a unit generating a TypeScript interface by ACI. The generated interface should explain contract methods in TypeScript and compatible with JavaScript SDK. For example, it should be usable as:
import { Contract } from '@aeternity/aepp-sdk';
import IdentityInterface from './generated.ts';
const identity = new Contract<IdentityInterface>(options);