Skip to content

Commit

Permalink
Merge branch 'feat/updated_arc56' into feat/cblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-p committed Sep 21, 2024
2 parents 9b14e3b + 13ed4f6 commit 673a8ce
Showing 1 changed file with 14 additions and 27 deletions.
41 changes: 14 additions & 27 deletions src/types/arc56.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-use-before-define */
/** Describes the entire contract. This interface is an extension of the interface described in ARC-4 */
export interface ARC56Contract {
/** The ARCs used and/or supported by this contract. All contracts implicity support ARC4 and ARC56 */
Expand Down Expand Up @@ -51,16 +52,9 @@ export interface ARC56Contract {
/** Supported bare actions for the contract. An action is a combination of call/create and an OnComplete */
bareActions: {
/** OnCompletes this method allows when appID === 0 */
create: ("NoOp" | "OptIn" | "DeleteApplication")[];
create: ('NoOp' | 'OptIn' | 'DeleteApplication')[];
/** OnCompletes this method allows when appID !== 0 */
call: (
| "NoOp"
| "OptIn"
| "CloseOut"
| "ClearState"
| "UpdateApplication"
| "DeleteApplication"
)[];
call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[];
};
/** Information about the TEAL programs */
sourceInfo?: {
Expand All @@ -86,7 +80,7 @@ export interface ARC56Contract {
/** Information used to get the given byteCode and/or PC values in sourceInfo. MUST be given if byteCode or PC values are present */
compilerInfo?: {
/** The name of the compiler */
compiler: "algod" | "puya";
compiler: 'algod' | 'puya';
/** Compiler version information */
compilerVersion: {
major: number;
Expand Down Expand Up @@ -142,8 +136,8 @@ export interface Method {
* - global: The data key signifies the global state key to read the value from
* - local: The data key signifies the local state key to read the value from (for the sender)
* - literal: the value is a literal and should be passed directly as the argument
*/
source: 'box' | 'global' | 'local' | 'literal;
*/
source: 'box' | 'global' | 'local' | 'literal';
};
}>;
/** Information about the method's return value */
Expand All @@ -158,16 +152,9 @@ export interface Method {
/** an action is a combination of call/create and an OnComplete */
actions: {
/** OnCompletes this method allows when appID === 0 */
create: ("NoOp" | "OptIn" | "DeleteApplication")[];
create: ('NoOp' | 'OptIn' | 'DeleteApplication')[];
/** OnCompletes this method allows when appID !== 0 */
call: (
| "NoOp"
| "OptIn"
| "CloseOut"
| "ClearState"
| "UpdateApplication"
| "DeleteApplication"
)[];
call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[];
};
/** If this method does not write anything to the ledger (ARC-22) */
readonly?: boolean;
Expand Down Expand Up @@ -222,17 +209,17 @@ type ABIType = string;
type StructName = string;

/** Raw byteslice without the length prefixed that is specified in ARC-4 */
type AVMBytes = "AVMBytes";
type AVMBytes = 'AVMBytes';

/** A string without the length prefix that is specified in ARC-4 */
type AVMString = "AVMString";
type AVMString = 'AVMString';

/** Information about a single field in a struct */
export interface StructField = {
export interface StructField {
/** The name of the struct field */
name: string;
/** The type of the struct field's value */
type: ABIType | StructName;
type: ABIType | StructName | StructField[];
}

/** Describes a single key in app storage */
Expand All @@ -255,7 +242,7 @@ export interface StorageMap {
keyType: ABIType | AVMString | AVMBytes | StructName;
/** The type of the values in the map */
valueType: ABIType | AVMString | AVMBytes | StructName;
/** The base64-encoded prefix of the map keys*/
/** The base64-encoded prefix of the map keys */
prefix?: string;
}

Expand All @@ -268,4 +255,4 @@ export interface SourceInfo {
errorMessage?: string;
/** The line of the dissasembled TEAL this line of pre-compiled TEAL corresponds to */
disassembledTeal?: number;
}
}

0 comments on commit 673a8ce

Please sign in to comment.