Skip to content
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

API: Regenerate algod and indexer models #845

Merged
merged 3 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/client/v2/algod/models/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4931,6 +4931,19 @@ export class SimulationTransactionExecTrace extends BaseModel {
*/
public clearStateProgramTrace?: SimulationOpcodeTraceUnit[];

/**
* If true, indicates that the clear state program failed and any persistent state
* changes it produced should be reverted once the program exits.
*/
public clearStateRollback?: boolean;

/**
* The error message explaining why the clear state program failed. This field will
* only be populated if clear-state-rollback is true and the failure was due to an
* execution error.
*/
public clearStateRollbackError?: string;

/**
* An array of SimulationTransactionExecTrace representing the execution trace of
* any inner transactions executed.
Expand All @@ -4953,6 +4966,11 @@ export class SimulationTransactionExecTrace extends BaseModel {
* @param approvalProgramTrace - Program trace that contains a trace of opcode effects in an approval program.
* @param clearStateProgramHash - SHA512_256 hash digest of the clear state program executed in transaction.
* @param clearStateProgramTrace - Program trace that contains a trace of opcode effects in a clear state program.
* @param clearStateRollback - If true, indicates that the clear state program failed and any persistent state
* changes it produced should be reverted once the program exits.
* @param clearStateRollbackError - The error message explaining why the clear state program failed. This field will
* only be populated if clear-state-rollback is true and the failure was due to an
* execution error.
* @param innerTrace - An array of SimulationTransactionExecTrace representing the execution trace of
* any inner transactions executed.
* @param logicSigHash - SHA512_256 hash digest of the logic sig executed in transaction.
Expand All @@ -4963,6 +4981,8 @@ export class SimulationTransactionExecTrace extends BaseModel {
approvalProgramTrace,
clearStateProgramHash,
clearStateProgramTrace,
clearStateRollback,
clearStateRollbackError,
innerTrace,
logicSigHash,
logicSigTrace,
Expand All @@ -4971,6 +4991,8 @@ export class SimulationTransactionExecTrace extends BaseModel {
approvalProgramTrace?: SimulationOpcodeTraceUnit[];
clearStateProgramHash?: string | Uint8Array;
clearStateProgramTrace?: SimulationOpcodeTraceUnit[];
clearStateRollback?: boolean;
clearStateRollbackError?: string;
innerTrace?: SimulationTransactionExecTrace[];
logicSigHash?: string | Uint8Array;
logicSigTrace?: SimulationOpcodeTraceUnit[];
Expand All @@ -4986,6 +5008,8 @@ export class SimulationTransactionExecTrace extends BaseModel {
? new Uint8Array(Buffer.from(clearStateProgramHash, 'base64'))
: clearStateProgramHash;
this.clearStateProgramTrace = clearStateProgramTrace;
this.clearStateRollback = clearStateRollback;
this.clearStateRollbackError = clearStateRollbackError;
this.innerTrace = innerTrace;
this.logicSigHash =
typeof logicSigHash === 'string'
Expand All @@ -4998,6 +5022,8 @@ export class SimulationTransactionExecTrace extends BaseModel {
approvalProgramTrace: 'approval-program-trace',
clearStateProgramHash: 'clear-state-program-hash',
clearStateProgramTrace: 'clear-state-program-trace',
clearStateRollback: 'clear-state-rollback',
clearStateRollbackError: 'clear-state-rollback-error',
innerTrace: 'inner-trace',
logicSigHash: 'logic-sig-hash',
logicSigTrace: 'logic-sig-trace',
Expand All @@ -5024,6 +5050,8 @@ export class SimulationTransactionExecTrace extends BaseModel {
SimulationOpcodeTraceUnit.from_obj_for_encoding
)
: undefined,
clearStateRollback: data['clear-state-rollback'],
clearStateRollbackError: data['clear-state-rollback-error'],
innerTrace:
typeof data['inner-trace'] !== 'undefined'
? data['inner-trace'].map(
Expand Down
17 changes: 15 additions & 2 deletions src/client/v2/indexer/models/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2653,6 +2653,11 @@ export class Box extends BaseModel {
*/
public name: Uint8Array;

/**
* The round for which this information is relevant
*/
public round: number | bigint;

/**
* (value) box value, base64 encoded.
*/
Expand All @@ -2661,27 +2666,32 @@ export class Box extends BaseModel {
/**
* Creates a new `Box` object.
* @param name - (name) box name, base64 encoded
* @param round - The round for which this information is relevant
* @param value - (value) box value, base64 encoded.
*/
constructor({
name,
round,
value,
}: {
name: string | Uint8Array;
round: number | bigint;
value: string | Uint8Array;
}) {
super();
this.name =
typeof name === 'string'
? new Uint8Array(Buffer.from(name, 'base64'))
: name;
this.round = round;
this.value =
typeof value === 'string'
? new Uint8Array(Buffer.from(value, 'base64'))
: value;

this.attribute_map = {
name: 'name',
round: 'round',
value: 'value',
};
}
Expand All @@ -2691,10 +2701,13 @@ export class Box extends BaseModel {
/* eslint-disable dot-notation */
if (typeof data['name'] === 'undefined')
throw new Error(`Response is missing required field 'name': ${data}`);
if (typeof data['round'] === 'undefined')
throw new Error(`Response is missing required field 'round': ${data}`);
if (typeof data['value'] === 'undefined')
throw new Error(`Response is missing required field 'value': ${data}`);
return new Box({
name: data['name'],
round: data['round'],
value: data['value'],
});
/* eslint-enable dot-notation */
Expand Down Expand Up @@ -4892,7 +4905,7 @@ export class TransactionAssetTransfer extends BaseModel {
public receiver: string;

/**
* Number of assets transfered to the close-to account as part of the transaction.
* Number of assets transferred to the close-to account as part of the transaction.
*/
public closeAmount?: number | bigint;

Expand All @@ -4916,7 +4929,7 @@ export class TransactionAssetTransfer extends BaseModel {
* that asset in the account's Assets map.
* @param assetId - (xaid) ID of the asset being transferred.
* @param receiver - (arcv) Recipient address of the transfer.
* @param closeAmount - Number of assets transfered to the close-to account as part of the transaction.
* @param closeAmount - Number of assets transferred to the close-to account as part of the transaction.
* @param closeTo - (aclose) Indicates that the asset should be removed from the account's Assets
* map, and specifies where the remaining asset holdings should be transferred.
* It's always valid to transfer remaining asset holdings to the creator account.
Expand Down
Loading