Skip to content

Commit 1d09e42

Browse files
Spec: Regenerate code from specification file f633b019 (#870)
* Regenerate code from specification file * Enable the minbalance cucumber tests. --------- Co-authored-by: Algorand Generation Bot <codegen@algorand.com>
1 parent 981905a commit 1d09e42

File tree

3 files changed

+497
-125
lines changed

3 files changed

+497
-125
lines changed

src/client/v2/algod/models/types.ts

Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,23 @@ export class Account extends BaseModel {
127127
*/
128128
public createdAssets?: Asset[];
129129

130+
/**
131+
* Whether or not the account can receive block incentives if its balance is in
132+
* range at proposal time.
133+
*/
134+
public incentiveEligible?: boolean;
135+
136+
/**
137+
* The round in which this account last went online, or explicitly renewed their
138+
* online status.
139+
*/
140+
public lastHeartbeat?: number | bigint;
141+
142+
/**
143+
* The round in which this account last proposed the block.
144+
*/
145+
public lastProposed?: number | bigint;
146+
130147
/**
131148
* AccountParticipation describes the parameters used by this account in consensus
132149
* protocol.
@@ -197,6 +214,11 @@ export class Account extends BaseModel {
197214
* Note: the raw account uses `map[int] -> AppParams` for this type.
198215
* @param createdAssets - (apar) parameters of assets created by this account.
199216
* Note: the raw account uses `map[int] -> Asset` for this type.
217+
* @param incentiveEligible - Whether or not the account can receive block incentives if its balance is in
218+
* range at proposal time.
219+
* @param lastHeartbeat - The round in which this account last went online, or explicitly renewed their
220+
* online status.
221+
* @param lastProposed - The round in which this account last proposed the block.
200222
* @param participation - AccountParticipation describes the parameters used by this account in consensus
201223
* protocol.
202224
* @param rewardBase - (ebase) used as part of the rewards computation. Only applicable to accounts
@@ -229,6 +251,9 @@ export class Account extends BaseModel {
229251
authAddr,
230252
createdApps,
231253
createdAssets,
254+
incentiveEligible,
255+
lastHeartbeat,
256+
lastProposed,
232257
participation,
233258
rewardBase,
234259
sigType,
@@ -254,6 +279,9 @@ export class Account extends BaseModel {
254279
authAddr?: string;
255280
createdApps?: Application[];
256281
createdAssets?: Asset[];
282+
incentiveEligible?: boolean;
283+
lastHeartbeat?: number | bigint;
284+
lastProposed?: number | bigint;
257285
participation?: AccountParticipation;
258286
rewardBase?: number | bigint;
259287
sigType?: string;
@@ -280,6 +308,9 @@ export class Account extends BaseModel {
280308
this.authAddr = authAddr;
281309
this.createdApps = createdApps;
282310
this.createdAssets = createdAssets;
311+
this.incentiveEligible = incentiveEligible;
312+
this.lastHeartbeat = lastHeartbeat;
313+
this.lastProposed = lastProposed;
283314
this.participation = participation;
284315
this.rewardBase = rewardBase;
285316
this.sigType = sigType;
@@ -306,6 +337,9 @@ export class Account extends BaseModel {
306337
authAddr: 'auth-addr',
307338
createdApps: 'created-apps',
308339
createdAssets: 'created-assets',
340+
incentiveEligible: 'incentive-eligible',
341+
lastHeartbeat: 'last-heartbeat',
342+
lastProposed: 'last-proposed',
309343
participation: 'participation',
310344
rewardBase: 'reward-base',
311345
sigType: 'sig-type',
@@ -394,6 +428,9 @@ export class Account extends BaseModel {
394428
typeof data['created-assets'] !== 'undefined'
395429
? data['created-assets'].map(Asset.from_obj_for_encoding)
396430
: undefined,
431+
incentiveEligible: data['incentive-eligible'],
432+
lastHeartbeat: data['last-heartbeat'],
433+
lastProposed: data['last-proposed'],
397434
participation:
398435
typeof data['participation'] !== 'undefined'
399436
? AccountParticipation.from_obj_for_encoding(data['participation'])
@@ -484,6 +521,65 @@ export class AccountApplicationResponse extends BaseModel {
484521
}
485522
}
486523

524+
/**
525+
* AccountAssetHolding describes the account's asset holding and asset parameters
526+
* (if either exist) for a specific asset ID.
527+
*/
528+
export class AccountAssetHolding extends BaseModel {
529+
/**
530+
* (asset) Details about the asset held by this account.
531+
* The raw account uses `AssetHolding` for this type.
532+
*/
533+
public assetHolding: AssetHolding;
534+
535+
/**
536+
* (apar) parameters of the asset held by this account.
537+
* The raw account uses `AssetParams` for this type.
538+
*/
539+
public assetParams?: AssetParams;
540+
541+
/**
542+
* Creates a new `AccountAssetHolding` object.
543+
* @param assetHolding - (asset) Details about the asset held by this account.
544+
* The raw account uses `AssetHolding` for this type.
545+
* @param assetParams - (apar) parameters of the asset held by this account.
546+
* The raw account uses `AssetParams` for this type.
547+
*/
548+
constructor({
549+
assetHolding,
550+
assetParams,
551+
}: {
552+
assetHolding: AssetHolding;
553+
assetParams?: AssetParams;
554+
}) {
555+
super();
556+
this.assetHolding = assetHolding;
557+
this.assetParams = assetParams;
558+
559+
this.attribute_map = {
560+
assetHolding: 'asset-holding',
561+
assetParams: 'asset-params',
562+
};
563+
}
564+
565+
// eslint-disable-next-line camelcase
566+
static from_obj_for_encoding(data: Record<string, any>): AccountAssetHolding {
567+
/* eslint-disable dot-notation */
568+
if (typeof data['asset-holding'] === 'undefined')
569+
throw new Error(
570+
`Response is missing required field 'asset-holding': ${data}`
571+
);
572+
return new AccountAssetHolding({
573+
assetHolding: AssetHolding.from_obj_for_encoding(data['asset-holding']),
574+
assetParams:
575+
typeof data['asset-params'] !== 'undefined'
576+
? AssetParams.from_obj_for_encoding(data['asset-params'])
577+
: undefined,
578+
});
579+
/* eslint-enable dot-notation */
580+
}
581+
}
582+
487583
/**
488584
* AccountAssetResponse describes the account's asset holding and asset parameters
489585
* (if either exist) for a specific asset ID. Asset parameters will only be
@@ -558,6 +654,72 @@ export class AccountAssetResponse extends BaseModel {
558654
}
559655
}
560656

657+
/**
658+
* AccountAssetsInformationResponse contains a list of assets held by an account.
659+
*/
660+
export class AccountAssetsInformationResponse extends BaseModel {
661+
/**
662+
* The round for which this information is relevant.
663+
*/
664+
public round: number | bigint;
665+
666+
public assetHoldings?: AccountAssetHolding[];
667+
668+
/**
669+
* Used for pagination, when making another request provide this token with the
670+
* next parameter.
671+
*/
672+
public nextToken?: string;
673+
674+
/**
675+
* Creates a new `AccountAssetsInformationResponse` object.
676+
* @param round - The round for which this information is relevant.
677+
* @param assetHoldings -
678+
* @param nextToken - Used for pagination, when making another request provide this token with the
679+
* next parameter.
680+
*/
681+
constructor({
682+
round,
683+
assetHoldings,
684+
nextToken,
685+
}: {
686+
round: number | bigint;
687+
assetHoldings?: AccountAssetHolding[];
688+
nextToken?: string;
689+
}) {
690+
super();
691+
this.round = round;
692+
this.assetHoldings = assetHoldings;
693+
this.nextToken = nextToken;
694+
695+
this.attribute_map = {
696+
round: 'round',
697+
assetHoldings: 'asset-holdings',
698+
nextToken: 'next-token',
699+
};
700+
}
701+
702+
// eslint-disable-next-line camelcase
703+
static from_obj_for_encoding(
704+
data: Record<string, any>
705+
): AccountAssetsInformationResponse {
706+
/* eslint-disable dot-notation */
707+
if (typeof data['round'] === 'undefined')
708+
throw new Error(`Response is missing required field 'round': ${data}`);
709+
return new AccountAssetsInformationResponse({
710+
round: data['round'],
711+
assetHoldings:
712+
typeof data['asset-holdings'] !== 'undefined'
713+
? data['asset-holdings'].map(
714+
AccountAssetHolding.from_obj_for_encoding
715+
)
716+
: undefined,
717+
nextToken: data['next-token'],
718+
});
719+
/* eslint-enable dot-notation */
720+
}
721+
}
722+
561723
/**
562724
* AccountParticipation describes the parameters used by this account in consensus
563725
* protocol.
@@ -733,6 +895,75 @@ export class AccountStateDelta extends BaseModel {
733895
}
734896
}
735897

898+
/**
899+
* The logged messages from an app call along with the app ID and outer transaction
900+
* ID. Logs appear in the same order that they were emitted.
901+
*/
902+
export class AppCallLogs extends BaseModel {
903+
/**
904+
* The application from which the logs were generated
905+
*/
906+
public applicationIndex: number | bigint;
907+
908+
/**
909+
* An array of logs
910+
*/
911+
public logs: Uint8Array[];
912+
913+
/**
914+
* The transaction ID of the outer app call that lead to these logs
915+
*/
916+
public txid: string;
917+
918+
/**
919+
* Creates a new `AppCallLogs` object.
920+
* @param applicationIndex - The application from which the logs were generated
921+
* @param logs - An array of logs
922+
* @param txid - The transaction ID of the outer app call that lead to these logs
923+
*/
924+
constructor({
925+
applicationIndex,
926+
logs,
927+
txid,
928+
}: {
929+
applicationIndex: number | bigint;
930+
logs: Uint8Array[];
931+
txid: string;
932+
}) {
933+
super();
934+
this.applicationIndex = applicationIndex;
935+
this.logs = logs;
936+
this.txid = txid;
937+
938+
this.attribute_map = {
939+
applicationIndex: 'application-index',
940+
logs: 'logs',
941+
txid: 'txId',
942+
};
943+
}
944+
945+
// eslint-disable-next-line camelcase
946+
static from_obj_for_encoding(data: Record<string, any>): AppCallLogs {
947+
/* eslint-disable dot-notation */
948+
if (typeof data['application-index'] === 'undefined')
949+
throw new Error(
950+
`Response is missing required field 'application-index': ${data}`
951+
);
952+
if (!Array.isArray(data['logs']))
953+
throw new Error(
954+
`Response is missing required array field 'logs': ${data}`
955+
);
956+
if (typeof data['txId'] === 'undefined')
957+
throw new Error(`Response is missing required field 'txId': ${data}`);
958+
return new AppCallLogs({
959+
applicationIndex: data['application-index'],
960+
logs: data['logs'],
961+
txid: data['txId'],
962+
});
963+
/* eslint-enable dot-notation */
964+
}
965+
}
966+
736967
/**
737968
* Application index and its parameters
738969
*/
@@ -1867,6 +2098,45 @@ export class BlockHashResponse extends BaseModel {
18672098
}
18682099
}
18692100

2101+
/**
2102+
* All logs emitted in the given round. Each app call, whether top-level or inner,
2103+
* that contains logs results in a separate AppCallLogs object. Therefore there may
2104+
* be multiple AppCallLogs with the same application ID and outer transaction ID in
2105+
* the event of multiple inner app calls to the same app. App calls with no logs
2106+
* are not included in the response. AppCallLogs are returned in the same order
2107+
* that their corresponding app call appeared in the block (pre-order traversal of
2108+
* inner app calls)
2109+
*/
2110+
export class BlockLogsResponse extends BaseModel {
2111+
public logs: AppCallLogs[];
2112+
2113+
/**
2114+
* Creates a new `BlockLogsResponse` object.
2115+
* @param logs -
2116+
*/
2117+
constructor({ logs }: { logs: AppCallLogs[] }) {
2118+
super();
2119+
this.logs = logs;
2120+
2121+
this.attribute_map = {
2122+
logs: 'logs',
2123+
};
2124+
}
2125+
2126+
// eslint-disable-next-line camelcase
2127+
static from_obj_for_encoding(data: Record<string, any>): BlockLogsResponse {
2128+
/* eslint-disable dot-notation */
2129+
if (!Array.isArray(data['logs']))
2130+
throw new Error(
2131+
`Response is missing required array field 'logs': ${data}`
2132+
);
2133+
return new BlockLogsResponse({
2134+
logs: data['logs'].map(AppCallLogs.from_obj_for_encoding),
2135+
});
2136+
/* eslint-enable dot-notation */
2137+
}
2138+
}
2139+
18702140
/**
18712141
* Encoded block object.
18722142
*/

0 commit comments

Comments
 (0)