diff --git a/src/client/v2/algod/models/types.ts b/src/client/v2/algod/models/types.ts index ba908cd48..f09e3ea46 100644 --- a/src/client/v2/algod/models/types.ts +++ b/src/client/v2/algod/models/types.ts @@ -95,9 +95,7 @@ export class Account extends BaseModel { public appsTotalExtraPages?: number | bigint; /** - * (tsch) stores the sum of all of the local schemas and global schemas in this - * account. - * Note: the raw account uses `StateSchema` for this type. + * Specifies maximums on the number of each type that may be stored. */ public appsTotalSchema?: ApplicationStateSchema; @@ -201,9 +199,7 @@ export class Account extends BaseModel { * @param appsLocalState - (appl) applications local data stored in this account. * Note the raw object uses `map[int] -> AppLocalState` for this type. * @param appsTotalExtraPages - (teap) the sum of all extra application program pages for this account. - * @param appsTotalSchema - (tsch) stores the sum of all of the local schemas and global schemas in this - * account. - * Note: the raw account uses `StateSchema` for this type. + * @param appsTotalSchema - Specifies maximums on the number of each type that may be stored. * @param assets - (asset) assets held by this account. * Note the raw object uses `map[int] -> AssetHolding` for this type. * @param authAddr - (spend) the address against which signing should be checked. If empty, the @@ -452,50 +448,44 @@ export class Account extends BaseModel { */ export class AccountApplicationResponse extends BaseModel { /** - * The round for which this information is relevant. + * Stores local state associated with an application. */ - public round: number | bigint; + public appLocalState?: ApplicationLocalState; /** - * (appl) the application local data stored in this account. - * The raw account uses `AppLocalState` for this type. + * Stores the global information associated with an application. */ - public appLocalState?: ApplicationLocalState; + public createdApp?: ApplicationParams; /** - * (appp) parameters of the application created by this account including app - * global data. - * The raw account uses `AppParams` for this type. + * The round for which this information is relevant. */ - public createdApp?: ApplicationParams; + public round?: number | bigint; /** * Creates a new `AccountApplicationResponse` object. + * @param appLocalState - Stores local state associated with an application. + * @param createdApp - Stores the global information associated with an application. * @param round - The round for which this information is relevant. - * @param appLocalState - (appl) the application local data stored in this account. - * The raw account uses `AppLocalState` for this type. - * @param createdApp - (appp) parameters of the application created by this account including app - * global data. - * The raw account uses `AppParams` for this type. */ constructor({ - round, appLocalState, createdApp, + round, }: { - round: number | bigint; appLocalState?: ApplicationLocalState; createdApp?: ApplicationParams; + round?: number | bigint; }) { super(); - this.round = round; this.appLocalState = appLocalState; this.createdApp = createdApp; + this.round = round; this.attribute_map = { - round: 'round', appLocalState: 'app-local-state', createdApp: 'created-app', + round: 'round', }; } @@ -504,10 +494,7 @@ export class AccountApplicationResponse extends BaseModel { data: Record, ): AccountApplicationResponse { /* eslint-disable dot-notation */ - if (typeof data['round'] === 'undefined') - throw new Error(`Response is missing required field 'round': ${data}`); return new AccountApplicationResponse({ - round: data['round'], appLocalState: typeof data['app-local-state'] !== 'undefined' ? ApplicationLocalState.from_obj_for_encoding(data['app-local-state']) @@ -516,6 +503,7 @@ export class AccountApplicationResponse extends BaseModel { typeof data['created-app'] !== 'undefined' ? ApplicationParams.from_obj_for_encoding(data['created-app']) : undefined, + round: data['round'], }); /* eslint-enable dot-notation */ } @@ -527,23 +515,29 @@ export class AccountApplicationResponse extends BaseModel { */ export class AccountAssetHolding extends BaseModel { /** - * (asset) Details about the asset held by this account. - * The raw account uses `AssetHolding` for this type. + * Describes an asset held by an account. + * Definition: + * data/basics/userBalance.go : AssetHolding */ public assetHolding: AssetHolding; /** - * (apar) parameters of the asset held by this account. - * The raw account uses `AssetParams` for this type. + * AssetParams specifies the parameters for an asset. + * (apar) when part of an AssetConfig transaction. + * Definition: + * data/transactions/asset.go : AssetParams */ public assetParams?: AssetParams; /** * Creates a new `AccountAssetHolding` object. - * @param assetHolding - (asset) Details about the asset held by this account. - * The raw account uses `AssetHolding` for this type. - * @param assetParams - (apar) parameters of the asset held by this account. - * The raw account uses `AssetParams` for this type. + * @param assetHolding - Describes an asset held by an account. + * Definition: + * data/basics/userBalance.go : AssetHolding + * @param assetParams - AssetParams specifies the parameters for an asset. + * (apar) when part of an AssetConfig transaction. + * Definition: + * data/transactions/asset.go : AssetParams */ constructor({ assetHolding, @@ -587,48 +581,54 @@ export class AccountAssetHolding extends BaseModel { */ export class AccountAssetResponse extends BaseModel { /** - * The round for which this information is relevant. + * Describes an asset held by an account. + * Definition: + * data/basics/userBalance.go : AssetHolding */ - public round: number | bigint; + public assetHolding?: AssetHolding; /** - * (asset) Details about the asset held by this account. - * The raw account uses `AssetHolding` for this type. + * AssetParams specifies the parameters for an asset. + * (apar) when part of an AssetConfig transaction. + * Definition: + * data/transactions/asset.go : AssetParams */ - public assetHolding?: AssetHolding; + public createdAsset?: AssetParams; /** - * (apar) parameters of the asset created by this account. - * The raw account uses `AssetParams` for this type. + * The round for which this information is relevant. */ - public createdAsset?: AssetParams; + public round?: number | bigint; /** * Creates a new `AccountAssetResponse` object. + * @param assetHolding - Describes an asset held by an account. + * Definition: + * data/basics/userBalance.go : AssetHolding + * @param createdAsset - AssetParams specifies the parameters for an asset. + * (apar) when part of an AssetConfig transaction. + * Definition: + * data/transactions/asset.go : AssetParams * @param round - The round for which this information is relevant. - * @param assetHolding - (asset) Details about the asset held by this account. - * The raw account uses `AssetHolding` for this type. - * @param createdAsset - (apar) parameters of the asset created by this account. - * The raw account uses `AssetParams` for this type. */ constructor({ - round, assetHolding, createdAsset, + round, }: { - round: number | bigint; assetHolding?: AssetHolding; createdAsset?: AssetParams; + round?: number | bigint; }) { super(); - this.round = round; this.assetHolding = assetHolding; this.createdAsset = createdAsset; + this.round = round; this.attribute_map = { - round: 'round', assetHolding: 'asset-holding', createdAsset: 'created-asset', + round: 'round', }; } @@ -637,10 +637,7 @@ export class AccountAssetResponse extends BaseModel { data: Record, ): AccountAssetResponse { /* eslint-disable dot-notation */ - if (typeof data['round'] === 'undefined') - throw new Error(`Response is missing required field 'round': ${data}`); return new AccountAssetResponse({ - round: data['round'], assetHolding: typeof data['asset-holding'] !== 'undefined' ? AssetHolding.from_obj_for_encoding(data['asset-holding']) @@ -649,6 +646,7 @@ export class AccountAssetResponse extends BaseModel { typeof data['created-asset'] !== 'undefined' ? AssetParams.from_obj_for_encoding(data['created-asset']) : undefined, + round: data['round'], }); /* eslint-enable dot-notation */ } @@ -658,11 +656,6 @@ export class AccountAssetResponse extends BaseModel { * AccountAssetsInformationResponse contains a list of assets held by an account. */ export class AccountAssetsInformationResponse extends BaseModel { - /** - * The round for which this information is relevant. - */ - public round: number | bigint; - public assetHoldings?: AccountAssetHolding[]; /** @@ -671,31 +664,36 @@ export class AccountAssetsInformationResponse extends BaseModel { */ public nextToken?: string; + /** + * The round for which this information is relevant. + */ + public round?: number | bigint; + /** * Creates a new `AccountAssetsInformationResponse` object. - * @param round - The round for which this information is relevant. * @param assetHoldings - * @param nextToken - Used for pagination, when making another request provide this token with the * next parameter. + * @param round - The round for which this information is relevant. */ constructor({ - round, assetHoldings, nextToken, + round, }: { - round: number | bigint; assetHoldings?: AccountAssetHolding[]; nextToken?: string; + round?: number | bigint; }) { super(); - this.round = round; this.assetHoldings = assetHoldings; this.nextToken = nextToken; + this.round = round; this.attribute_map = { - round: 'round', assetHoldings: 'asset-holdings', nextToken: 'next-token', + round: 'round', }; } @@ -704,10 +702,7 @@ export class AccountAssetsInformationResponse extends BaseModel { data: Record, ): AccountAssetsInformationResponse { /* eslint-disable dot-notation */ - if (typeof data['round'] === 'undefined') - throw new Error(`Response is missing required field 'round': ${data}`); return new AccountAssetsInformationResponse({ - round: data['round'], assetHoldings: typeof data['asset-holdings'] !== 'undefined' ? data['asset-holdings'].map( @@ -715,6 +710,7 @@ export class AccountAssetsInformationResponse extends BaseModel { ) : undefined, nextToken: data['next-token'], + round: data['round'], }); /* eslint-enable dot-notation */ } @@ -974,14 +970,14 @@ export class Application extends BaseModel { public id: number | bigint; /** - * (appparams) application parameters. + * Stores the global information associated with an application. */ public params: ApplicationParams; /** * Creates a new `Application` object. * @param id - (appidx) application index. - * @param params - (appparams) application parameters. + * @param params - Stores the global information associated with an application. */ constructor({ id, @@ -1202,20 +1198,20 @@ export class ApplicationLocalState extends BaseModel { public id: number | bigint; /** - * (hsch) schema. + * Specifies maximums on the number of each type that may be stored. */ public schema: ApplicationStateSchema; /** - * (tkv) storage. + * Represents a key-value store for use in an application. */ public keyValue?: TealKeyValue[]; /** * Creates a new `ApplicationLocalState` object. * @param id - The application which this local state is for. - * @param schema - (hsch) schema. - * @param keyValue - (tkv) storage. + * @param schema - Specifies maximums on the number of each type that may be stored. + * @param keyValue - Represents a key-value store for use in an application. */ constructor({ id, @@ -1285,17 +1281,17 @@ export class ApplicationParams extends BaseModel { public extraProgramPages?: number | bigint; /** - * (gs) global state + * Represents a key-value store for use in an application. */ public globalState?: TealKeyValue[]; /** - * (gsch) global schema + * Specifies maximums on the number of each type that may be stored. */ public globalStateSchema?: ApplicationStateSchema; /** - * (lsch) local schema + * Specifies maximums on the number of each type that may be stored. */ public localStateSchema?: ApplicationStateSchema; @@ -1306,9 +1302,9 @@ export class ApplicationParams extends BaseModel { * @param creator - The address that created this application. This is the address where the * parameters and global state for this application can be found. * @param extraProgramPages - (epp) the amount of extra program pages available to this app. - * @param globalState - (gs) global state - * @param globalStateSchema - (gsch) global schema - * @param localStateSchema - (lsch) local schema + * @param globalState - Represents a key-value store for use in an application. + * @param globalStateSchema - Specifies maximums on the number of each type that may be stored. + * @param localStateSchema - Specifies maximums on the number of each type that may be stored. */ constructor({ approvalProgram, @@ -2069,13 +2065,13 @@ export class BlockHashResponse extends BaseModel { /** * Block header hash. */ - public blockhash: string; + public blockhash?: string; /** * Creates a new `BlockHashResponse` object. * @param blockhash - Block header hash. */ - constructor({ blockhash }: { blockhash: string }) { + constructor({ blockhash }: { blockhash?: string }) { super(); this.blockhash = blockhash; @@ -2087,10 +2083,6 @@ export class BlockHashResponse extends BaseModel { // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): BlockHashResponse { /* eslint-disable dot-notation */ - if (typeof data['blockHash'] === 'undefined') - throw new Error( - `Response is missing required field 'blockHash': ${data}`, - ); return new BlockHashResponse({ blockhash: data['blockHash'], }); @@ -2098,6 +2090,38 @@ export class BlockHashResponse extends BaseModel { } } +/** + * Block header. + */ +export class BlockHeaderResponse extends BaseModel { + /** + * Block header data. + */ + public blockheader?: BlockHeader; + + /** + * Creates a new `BlockHeaderResponse` object. + * @param blockheader - Block header data. + */ + constructor({ blockheader }: { blockheader?: BlockHeader }) { + super(); + this.blockheader = blockheader; + + this.attribute_map = { + blockheader: 'blockHeader', + }; + } + + // eslint-disable-next-line camelcase + static from_obj_for_encoding(data: Record): BlockHeaderResponse { + /* eslint-disable dot-notation */ + return new BlockHeaderResponse({ + blockheader: data['blockHeader'], + }); + /* eslint-enable dot-notation */ + } +} + /** * All logs emitted in the given round. Each app call, whether top-level or inner, * that contains logs results in a separate AppCallLogs object. Therefore there may @@ -2108,13 +2132,13 @@ export class BlockHashResponse extends BaseModel { * inner app calls) */ export class BlockLogsResponse extends BaseModel { - public logs: AppCallLogs[]; + public logs?: AppCallLogs[]; /** * Creates a new `BlockLogsResponse` object. * @param logs - */ - constructor({ logs }: { logs: AppCallLogs[] }) { + constructor({ logs }: { logs?: AppCallLogs[] }) { super(); this.logs = logs; @@ -2126,12 +2150,11 @@ export class BlockLogsResponse extends BaseModel { // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): BlockLogsResponse { /* eslint-disable dot-notation */ - if (!Array.isArray(data['logs'])) - throw new Error( - `Response is missing required array field 'logs': ${data}`, - ); return new BlockLogsResponse({ - logs: data['logs'].map(AppCallLogs.from_obj_for_encoding), + logs: + typeof data['logs'] !== 'undefined' + ? data['logs'].map(AppCallLogs.from_obj_for_encoding) + : undefined, }); /* eslint-enable dot-notation */ } @@ -2144,7 +2167,7 @@ export class BlockResponse extends BaseModel { /** * Block header data. */ - public block: BlockHeader; + public block?: BlockHeader; /** * Optional certificate object. This is only included when the format is set to @@ -2162,7 +2185,7 @@ export class BlockResponse extends BaseModel { block, cert, }: { - block: BlockHeader; + block?: BlockHeader; cert?: Record; }) { super(); @@ -2178,8 +2201,6 @@ export class BlockResponse extends BaseModel { // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): BlockResponse { /* eslint-disable dot-notation */ - if (typeof data['block'] === 'undefined') - throw new Error(`Response is missing required field 'block': ${data}`); return new BlockResponse({ block: data['block'], cert: data['cert'], @@ -2195,13 +2216,13 @@ export class BlockTxidsResponse extends BaseModel { /** * Block transaction IDs. */ - public blocktxids: string[]; + public blocktxids?: string[]; /** * Creates a new `BlockTxidsResponse` object. * @param blocktxids - Block transaction IDs. */ - constructor({ blocktxids }: { blocktxids: string[] }) { + constructor({ blocktxids }: { blocktxids?: string[] }) { super(); this.blocktxids = blocktxids; @@ -2213,10 +2234,6 @@ export class BlockTxidsResponse extends BaseModel { // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): BlockTxidsResponse { /* eslint-disable dot-notation */ - if (!Array.isArray(data['blockTxids'])) - throw new Error( - `Response is missing required array field 'blockTxids': ${data}`, - ); return new BlockTxidsResponse({ blocktxids: data['blockTxids'], }); @@ -2389,13 +2406,13 @@ export class BoxReference extends BaseModel { * Box names of an application */ export class BoxesResponse extends BaseModel { - public boxes: BoxDescriptor[]; + public boxes?: BoxDescriptor[]; /** * Creates a new `BoxesResponse` object. * @param boxes - */ - constructor({ boxes }: { boxes: BoxDescriptor[] }) { + constructor({ boxes }: { boxes?: BoxDescriptor[] }) { super(); this.boxes = boxes; @@ -2407,12 +2424,11 @@ export class BoxesResponse extends BaseModel { // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): BoxesResponse { /* eslint-disable dot-notation */ - if (!Array.isArray(data['boxes'])) - throw new Error( - `Response is missing required array field 'boxes': ${data}`, - ); return new BoxesResponse({ - boxes: data['boxes'].map(BoxDescriptor.from_obj_for_encoding), + boxes: + typeof data['boxes'] !== 'undefined' + ? data['boxes'].map(BoxDescriptor.from_obj_for_encoding) + : undefined, }); /* eslint-enable dot-notation */ } @@ -2504,6 +2520,74 @@ export class BuildVersion extends BaseModel { } } +/** + * + */ +export class CatchpointAbortResponse extends BaseModel { + /** + * Catchup abort response string + */ + public catchupMessage?: string; + + /** + * Creates a new `CatchpointAbortResponse` object. + * @param catchupMessage - Catchup abort response string + */ + constructor({ catchupMessage }: { catchupMessage?: string }) { + super(); + this.catchupMessage = catchupMessage; + + this.attribute_map = { + catchupMessage: 'catchup-message', + }; + } + + // eslint-disable-next-line camelcase + static from_obj_for_encoding( + data: Record, + ): CatchpointAbortResponse { + /* eslint-disable dot-notation */ + return new CatchpointAbortResponse({ + catchupMessage: data['catchup-message'], + }); + /* eslint-enable dot-notation */ + } +} + +/** + * + */ +export class CatchpointStartResponse extends BaseModel { + /** + * Catchup start response string + */ + public catchupMessage?: string; + + /** + * Creates a new `CatchpointStartResponse` object. + * @param catchupMessage - Catchup start response string + */ + constructor({ catchupMessage }: { catchupMessage?: string }) { + super(); + this.catchupMessage = catchupMessage; + + this.attribute_map = { + catchupMessage: 'catchup-message', + }; + } + + // eslint-disable-next-line camelcase + static from_obj_for_encoding( + data: Record, + ): CatchpointStartResponse { + /* eslint-disable dot-notation */ + return new CatchpointStartResponse({ + catchupMessage: data['catchup-message'], + }); + /* eslint-enable dot-notation */ + } +} + /** * Teal compile Result */ @@ -2511,12 +2595,12 @@ export class CompileResponse extends BaseModel { /** * base32 SHA512_256 of program bytes (Address style) */ - public hash: string; + public hash?: string; /** * base64 encoded program bytes */ - public result: string; + public result?: string; /** * JSON of the source map @@ -2534,8 +2618,8 @@ export class CompileResponse extends BaseModel { result, sourcemap, }: { - hash: string; - result: string; + hash?: string; + result?: string; sourcemap?: Record; }) { super(); @@ -2553,10 +2637,6 @@ export class CompileResponse extends BaseModel { // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): CompileResponse { /* eslint-disable dot-notation */ - if (typeof data['hash'] === 'undefined') - throw new Error(`Response is missing required field 'hash': ${data}`); - if (typeof data['result'] === 'undefined') - throw new Error(`Response is missing required field 'result': ${data}`); return new CompileResponse({ hash: data['hash'], result: data['result'], @@ -2566,6 +2646,59 @@ export class CompileResponse extends BaseModel { } } +/** + * algod mutex and blocking profiling state. + */ +export class DebugSettingsProf extends BaseModel { + /** + * The rate of blocking events. The profiler aims to sample an average of one + * blocking event per rate nanoseconds spent blocked. To turn off profiling + * entirely, pass rate 0. + */ + public blockRate?: number | bigint; + + /** + * The rate of mutex events. On average 1/rate events are reported. To turn off + * profiling entirely, pass rate 0 + */ + public mutexRate?: number | bigint; + + /** + * Creates a new `DebugSettingsProf` object. + * @param blockRate - The rate of blocking events. The profiler aims to sample an average of one + * blocking event per rate nanoseconds spent blocked. To turn off profiling + * entirely, pass rate 0. + * @param mutexRate - The rate of mutex events. On average 1/rate events are reported. To turn off + * profiling entirely, pass rate 0 + */ + constructor({ + blockRate, + mutexRate, + }: { + blockRate?: number | bigint; + mutexRate?: number | bigint; + }) { + super(); + this.blockRate = blockRate; + this.mutexRate = mutexRate; + + this.attribute_map = { + blockRate: 'block-rate', + mutexRate: 'mutex-rate', + }; + } + + // eslint-disable-next-line camelcase + static from_obj_for_encoding(data: Record): DebugSettingsProf { + /* eslint-disable dot-notation */ + return new DebugSettingsProf({ + blockRate: data['block-rate'], + mutexRate: data['mutex-rate'], + }); + /* eslint-enable dot-notation */ + } +} + /** * Teal disassembly Result */ @@ -2573,13 +2706,13 @@ export class DisassembleResponse extends BaseModel { /** * disassembled Teal code */ - public result: string; + public result?: string; /** * Creates a new `DisassembleResponse` object. * @param result - disassembled Teal code */ - constructor({ result }: { result: string }) { + constructor({ result }: { result?: string }) { super(); this.result = result; @@ -2591,8 +2724,6 @@ export class DisassembleResponse extends BaseModel { // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): DisassembleResponse { /* eslint-disable dot-notation */ - if (typeof data['result'] === 'undefined') - throw new Error(`Response is missing required field 'result': ${data}`); return new DisassembleResponse({ result: data['result'], }); @@ -2727,14 +2858,14 @@ export class DryrunRequest extends BaseModel { * DryrunResponse contains per-txn debug information from a dryrun. */ export class DryrunResponse extends BaseModel { - public error: string; + public error?: string; /** * Protocol version is the protocol version Dryrun was operated under. */ - public protocolVersion: string; + public protocolVersion?: string; - public txns: DryrunTxnResult[]; + public txns?: DryrunTxnResult[]; /** * Creates a new `DryrunResponse` object. @@ -2747,9 +2878,9 @@ export class DryrunResponse extends BaseModel { protocolVersion, txns, }: { - error: string; - protocolVersion: string; - txns: DryrunTxnResult[]; + error?: string; + protocolVersion?: string; + txns?: DryrunTxnResult[]; }) { super(); this.error = error; @@ -2766,20 +2897,13 @@ export class DryrunResponse extends BaseModel { // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): DryrunResponse { /* eslint-disable dot-notation */ - if (typeof data['error'] === 'undefined') - throw new Error(`Response is missing required field 'error': ${data}`); - if (typeof data['protocol-version'] === 'undefined') - throw new Error( - `Response is missing required field 'protocol-version': ${data}`, - ); - if (!Array.isArray(data['txns'])) - throw new Error( - `Response is missing required array field 'txns': ${data}`, - ); return new DryrunResponse({ error: data['error'], protocolVersion: data['protocol-version'], - txns: data['txns'].map(DryrunTxnResult.from_obj_for_encoding), + txns: + typeof data['txns'] !== 'undefined' + ? data['txns'].map(DryrunTxnResult.from_obj_for_encoding) + : undefined, }); /* eslint-enable dot-notation */ } @@ -3246,13 +3370,13 @@ export class GetBlockTimeStampOffsetResponse extends BaseModel { /** * Timestamp offset in seconds. */ - public offset: number | bigint; + public offset?: number | bigint; /** * Creates a new `GetBlockTimeStampOffsetResponse` object. * @param offset - Timestamp offset in seconds. */ - constructor({ offset }: { offset: number | bigint }) { + constructor({ offset }: { offset?: number | bigint }) { super(); this.offset = offset; @@ -3266,8 +3390,6 @@ export class GetBlockTimeStampOffsetResponse extends BaseModel { data: Record, ): GetBlockTimeStampOffsetResponse { /* eslint-disable dot-notation */ - if (typeof data['offset'] === 'undefined') - throw new Error(`Response is missing required field 'offset': ${data}`); return new GetBlockTimeStampOffsetResponse({ offset: data['offset'], }); @@ -3282,13 +3404,13 @@ export class GetSyncRoundResponse extends BaseModel { /** * The minimum sync round for the ledger. */ - public round: number | bigint; + public round?: number | bigint; /** * Creates a new `GetSyncRoundResponse` object. * @param round - The minimum sync round for the ledger. */ - constructor({ round }: { round: number | bigint }) { + constructor({ round }: { round?: number | bigint }) { super(); this.round = round; @@ -3302,8 +3424,6 @@ export class GetSyncRoundResponse extends BaseModel { data: Record, ): GetSyncRoundResponse { /* eslint-disable dot-notation */ - if (typeof data['round'] === 'undefined') - throw new Error(`Response is missing required field 'round': ${data}`); return new GetSyncRoundResponse({ round: data['round'], }); @@ -3488,48 +3608,6 @@ export class LightBlockHeaderProof extends BaseModel { * */ export class NodeStatusResponse extends BaseModel { - /** - * CatchupTime in nanoseconds - */ - public catchupTime: number | bigint; - - /** - * LastRound indicates the last round seen - */ - public lastRound: number | bigint; - - /** - * LastVersion indicates the last consensus version supported - */ - public lastVersion: string; - - /** - * NextVersion of consensus protocol to use - */ - public nextVersion: string; - - /** - * NextVersionRound is the round at which the next consensus version will apply - */ - public nextVersionRound: number | bigint; - - /** - * NextVersionSupported indicates whether the next consensus version is supported - * by this node - */ - public nextVersionSupported: boolean; - - /** - * StoppedAtUnsupportedRound indicates that the node does not support the new - * rounds and has stopped making progress - */ - public stoppedAtUnsupportedRound: boolean; - - /** - * TimeSinceLastRound in nanoseconds - */ - public timeSinceLastRound: number | bigint; - /** * The current catchpoint that is being caught up to */ @@ -3581,11 +3659,53 @@ export class NodeStatusResponse extends BaseModel { */ public catchpointVerifiedKvs?: number | bigint; + /** + * CatchupTime in nanoseconds + */ + public catchupTime?: number | bigint; + /** * The last catchpoint seen by the node */ public lastCatchpoint?: string; + /** + * LastRound indicates the last round seen + */ + public lastRound?: number | bigint; + + /** + * LastVersion indicates the last consensus version supported + */ + public lastVersion?: string; + + /** + * NextVersion of consensus protocol to use + */ + public nextVersion?: string; + + /** + * NextVersionRound is the round at which the next consensus version will apply + */ + public nextVersionRound?: number | bigint; + + /** + * NextVersionSupported indicates whether the next consensus version is supported + * by this node + */ + public nextVersionSupported?: boolean; + + /** + * StoppedAtUnsupportedRound indicates that the node does not support the new + * rounds and has stopped making progress + */ + public stoppedAtUnsupportedRound?: boolean; + + /** + * TimeSinceLastRound in nanoseconds + */ + public timeSinceLastRound?: number | bigint; + /** * Upgrade delay */ @@ -3628,16 +3748,6 @@ export class NodeStatusResponse extends BaseModel { /** * Creates a new `NodeStatusResponse` object. - * @param catchupTime - CatchupTime in nanoseconds - * @param lastRound - LastRound indicates the last round seen - * @param lastVersion - LastVersion indicates the last consensus version supported - * @param nextVersion - NextVersion of consensus protocol to use - * @param nextVersionRound - NextVersionRound is the round at which the next consensus version will apply - * @param nextVersionSupported - NextVersionSupported indicates whether the next consensus version is supported - * by this node - * @param stoppedAtUnsupportedRound - StoppedAtUnsupportedRound indicates that the node does not support the new - * rounds and has stopped making progress - * @param timeSinceLastRound - TimeSinceLastRound in nanoseconds * @param catchpoint - The current catchpoint that is being caught up to * @param catchpointAcquiredBlocks - The number of blocks that have already been obtained by the node as part of the * catchup @@ -3653,7 +3763,17 @@ export class NodeStatusResponse extends BaseModel { * far as part of the catchup * @param catchpointVerifiedKvs - The number of key-values (KVs) from the current catchpoint that have been * verified so far as part of the catchup + * @param catchupTime - CatchupTime in nanoseconds * @param lastCatchpoint - The last catchpoint seen by the node + * @param lastRound - LastRound indicates the last round seen + * @param lastVersion - LastVersion indicates the last consensus version supported + * @param nextVersion - NextVersion of consensus protocol to use + * @param nextVersionRound - NextVersionRound is the round at which the next consensus version will apply + * @param nextVersionSupported - NextVersionSupported indicates whether the next consensus version is supported + * by this node + * @param stoppedAtUnsupportedRound - StoppedAtUnsupportedRound indicates that the node does not support the new + * rounds and has stopped making progress + * @param timeSinceLastRound - TimeSinceLastRound in nanoseconds * @param upgradeDelay - Upgrade delay * @param upgradeNextProtocolVoteBefore - Next protocol round * @param upgradeNoVotes - No votes cast for consensus upgrade @@ -3664,14 +3784,6 @@ export class NodeStatusResponse extends BaseModel { * @param upgradeYesVotes - Yes votes cast for consensus upgrade */ constructor({ - catchupTime, - lastRound, - lastVersion, - nextVersion, - nextVersionRound, - nextVersionSupported, - stoppedAtUnsupportedRound, - timeSinceLastRound, catchpoint, catchpointAcquiredBlocks, catchpointProcessedAccounts, @@ -3681,7 +3793,15 @@ export class NodeStatusResponse extends BaseModel { catchpointTotalKvs, catchpointVerifiedAccounts, catchpointVerifiedKvs, + catchupTime, lastCatchpoint, + lastRound, + lastVersion, + nextVersion, + nextVersionRound, + nextVersionSupported, + stoppedAtUnsupportedRound, + timeSinceLastRound, upgradeDelay, upgradeNextProtocolVoteBefore, upgradeNoVotes, @@ -3691,14 +3811,6 @@ export class NodeStatusResponse extends BaseModel { upgradeVotesRequired, upgradeYesVotes, }: { - catchupTime: number | bigint; - lastRound: number | bigint; - lastVersion: string; - nextVersion: string; - nextVersionRound: number | bigint; - nextVersionSupported: boolean; - stoppedAtUnsupportedRound: boolean; - timeSinceLastRound: number | bigint; catchpoint?: string; catchpointAcquiredBlocks?: number | bigint; catchpointProcessedAccounts?: number | bigint; @@ -3708,7 +3820,15 @@ export class NodeStatusResponse extends BaseModel { catchpointTotalKvs?: number | bigint; catchpointVerifiedAccounts?: number | bigint; catchpointVerifiedKvs?: number | bigint; + catchupTime?: number | bigint; lastCatchpoint?: string; + lastRound?: number | bigint; + lastVersion?: string; + nextVersion?: string; + nextVersionRound?: number | bigint; + nextVersionSupported?: boolean; + stoppedAtUnsupportedRound?: boolean; + timeSinceLastRound?: number | bigint; upgradeDelay?: number | bigint; upgradeNextProtocolVoteBefore?: number | bigint; upgradeNoVotes?: number | bigint; @@ -3719,14 +3839,6 @@ export class NodeStatusResponse extends BaseModel { upgradeYesVotes?: number | bigint; }) { super(); - this.catchupTime = catchupTime; - this.lastRound = lastRound; - this.lastVersion = lastVersion; - this.nextVersion = nextVersion; - this.nextVersionRound = nextVersionRound; - this.nextVersionSupported = nextVersionSupported; - this.stoppedAtUnsupportedRound = stoppedAtUnsupportedRound; - this.timeSinceLastRound = timeSinceLastRound; this.catchpoint = catchpoint; this.catchpointAcquiredBlocks = catchpointAcquiredBlocks; this.catchpointProcessedAccounts = catchpointProcessedAccounts; @@ -3736,7 +3848,15 @@ export class NodeStatusResponse extends BaseModel { this.catchpointTotalKvs = catchpointTotalKvs; this.catchpointVerifiedAccounts = catchpointVerifiedAccounts; this.catchpointVerifiedKvs = catchpointVerifiedKvs; + this.catchupTime = catchupTime; this.lastCatchpoint = lastCatchpoint; + this.lastRound = lastRound; + this.lastVersion = lastVersion; + this.nextVersion = nextVersion; + this.nextVersionRound = nextVersionRound; + this.nextVersionSupported = nextVersionSupported; + this.stoppedAtUnsupportedRound = stoppedAtUnsupportedRound; + this.timeSinceLastRound = timeSinceLastRound; this.upgradeDelay = upgradeDelay; this.upgradeNextProtocolVoteBefore = upgradeNextProtocolVoteBefore; this.upgradeNoVotes = upgradeNoVotes; @@ -3747,14 +3867,6 @@ export class NodeStatusResponse extends BaseModel { this.upgradeYesVotes = upgradeYesVotes; this.attribute_map = { - catchupTime: 'catchup-time', - lastRound: 'last-round', - lastVersion: 'last-version', - nextVersion: 'next-version', - nextVersionRound: 'next-version-round', - nextVersionSupported: 'next-version-supported', - stoppedAtUnsupportedRound: 'stopped-at-unsupported-round', - timeSinceLastRound: 'time-since-last-round', catchpoint: 'catchpoint', catchpointAcquiredBlocks: 'catchpoint-acquired-blocks', catchpointProcessedAccounts: 'catchpoint-processed-accounts', @@ -3764,7 +3876,15 @@ export class NodeStatusResponse extends BaseModel { catchpointTotalKvs: 'catchpoint-total-kvs', catchpointVerifiedAccounts: 'catchpoint-verified-accounts', catchpointVerifiedKvs: 'catchpoint-verified-kvs', + catchupTime: 'catchup-time', lastCatchpoint: 'last-catchpoint', + lastRound: 'last-round', + lastVersion: 'last-version', + nextVersion: 'next-version', + nextVersionRound: 'next-version-round', + nextVersionSupported: 'next-version-supported', + stoppedAtUnsupportedRound: 'stopped-at-unsupported-round', + timeSinceLastRound: 'time-since-last-round', upgradeDelay: 'upgrade-delay', upgradeNextProtocolVoteBefore: 'upgrade-next-protocol-vote-before', upgradeNoVotes: 'upgrade-no-votes', @@ -3779,47 +3899,7 @@ export class NodeStatusResponse extends BaseModel { // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): NodeStatusResponse { /* eslint-disable dot-notation */ - if (typeof data['catchup-time'] === 'undefined') - throw new Error( - `Response is missing required field 'catchup-time': ${data}`, - ); - if (typeof data['last-round'] === 'undefined') - throw new Error( - `Response is missing required field 'last-round': ${data}`, - ); - if (typeof data['last-version'] === 'undefined') - throw new Error( - `Response is missing required field 'last-version': ${data}`, - ); - if (typeof data['next-version'] === 'undefined') - throw new Error( - `Response is missing required field 'next-version': ${data}`, - ); - if (typeof data['next-version-round'] === 'undefined') - throw new Error( - `Response is missing required field 'next-version-round': ${data}`, - ); - if (typeof data['next-version-supported'] === 'undefined') - throw new Error( - `Response is missing required field 'next-version-supported': ${data}`, - ); - if (typeof data['stopped-at-unsupported-round'] === 'undefined') - throw new Error( - `Response is missing required field 'stopped-at-unsupported-round': ${data}`, - ); - if (typeof data['time-since-last-round'] === 'undefined') - throw new Error( - `Response is missing required field 'time-since-last-round': ${data}`, - ); return new NodeStatusResponse({ - catchupTime: data['catchup-time'], - lastRound: data['last-round'], - lastVersion: data['last-version'], - nextVersion: data['next-version'], - nextVersionRound: data['next-version-round'], - nextVersionSupported: data['next-version-supported'], - stoppedAtUnsupportedRound: data['stopped-at-unsupported-round'], - timeSinceLastRound: data['time-since-last-round'], catchpoint: data['catchpoint'], catchpointAcquiredBlocks: data['catchpoint-acquired-blocks'], catchpointProcessedAccounts: data['catchpoint-processed-accounts'], @@ -3829,7 +3909,15 @@ export class NodeStatusResponse extends BaseModel { catchpointTotalKvs: data['catchpoint-total-kvs'], catchpointVerifiedAccounts: data['catchpoint-verified-accounts'], catchpointVerifiedKvs: data['catchpoint-verified-kvs'], + catchupTime: data['catchup-time'], lastCatchpoint: data['last-catchpoint'], + lastRound: data['last-round'], + lastVersion: data['last-version'], + nextVersion: data['next-version'], + nextVersionRound: data['next-version-round'], + nextVersionSupported: data['next-version-supported'], + stoppedAtUnsupportedRound: data['stopped-at-unsupported-round'], + timeSinceLastRound: data['time-since-last-round'], upgradeDelay: data['upgrade-delay'], upgradeNextProtocolVoteBefore: data['upgrade-next-protocol-vote-before'], upgradeNoVotes: data['upgrade-no-votes'], @@ -3892,8 +3980,7 @@ export class PendingTransactionResponse extends BaseModel { public confirmedRound?: number | bigint; /** - * Global state key/value changes for the application being executed by this - * transaction. + * Application state delta. */ public globalStateDelta?: EvalDeltaKeyValue[]; @@ -3936,8 +4023,7 @@ export class PendingTransactionResponse extends BaseModel { * @param closeRewards - Rewards in microalgos applied to the close remainder to account. * @param closingAmount - Closing amount for the transaction. * @param confirmedRound - The round where this transaction was confirmed, if present. - * @param globalStateDelta - Global state key/value changes for the application being executed by this - * transaction. + * @param globalStateDelta - Application state delta. * @param innerTxns - Inner transactions produced by application execution. * @param localStateDelta - Local state key/value changes for the application being executed by this * transaction. @@ -4065,12 +4151,12 @@ export class PendingTransactionsResponse extends BaseModel { /** * An array of signed transaction objects. */ - public topTransactions: EncodedSignedTransaction[]; + public topTransactions?: EncodedSignedTransaction[]; /** * Total number of transactions in the pool. */ - public totalTransactions: number | bigint; + public totalTransactions?: number | bigint; /** * Creates a new `PendingTransactionsResponse` object. @@ -4081,8 +4167,8 @@ export class PendingTransactionsResponse extends BaseModel { topTransactions, totalTransactions, }: { - topTransactions: EncodedSignedTransaction[]; - totalTransactions: number | bigint; + topTransactions?: EncodedSignedTransaction[]; + totalTransactions?: number | bigint; }) { super(); this.topTransactions = topTransactions; @@ -4099,14 +4185,6 @@ export class PendingTransactionsResponse extends BaseModel { data: Record, ): PendingTransactionsResponse { /* eslint-disable dot-notation */ - if (!Array.isArray(data['top-transactions'])) - throw new Error( - `Response is missing required array field 'top-transactions': ${data}`, - ); - if (typeof data['total-transactions'] === 'undefined') - throw new Error( - `Response is missing required field 'total-transactions': ${data}`, - ); return new PendingTransactionsResponse({ topTransactions: data['top-transactions'], totalTransactions: data['total-transactions'], @@ -4122,13 +4200,13 @@ export class PostTransactionsResponse extends BaseModel { /** * encoding of the transaction hash. */ - public txid: string; + public txid?: string; /** * Creates a new `PostTransactionsResponse` object. * @param txid - encoding of the transaction hash. */ - constructor({ txid }: { txid: string }) { + constructor({ txid }: { txid?: string }) { super(); this.txid = txid; @@ -4142,8 +4220,6 @@ export class PostTransactionsResponse extends BaseModel { data: Record, ): PostTransactionsResponse { /* eslint-disable dot-notation */ - if (typeof data['txId'] === 'undefined') - throw new Error(`Response is missing required field 'txId': ${data}`); return new PostTransactionsResponse({ txid: data['txId'], }); @@ -4424,102 +4500,87 @@ export class SimulateRequestTransactionGroup extends BaseModel { */ export class SimulateResponse extends BaseModel { /** - * The round immediately preceding this simulation. State changes through this - * round were used to run this simulation. + * The set of parameters and limits override during simulation. If this set of + * parameters is present, then evaluation parameters may differ from standard + * evaluation in certain ways. */ - public lastRound: number | bigint; + public evalOverrides?: SimulationEvalOverrides; /** - * A result object for each transaction group that was simulated. + * An object that configures simulation execution trace. */ - public txnGroups: SimulateTransactionGroupResult[]; + public execTraceConfig?: SimulateTraceConfig; /** - * The version of this response object. + * Initial states of resources that were accessed during simulation. */ - public version: number | bigint; + public initialStates?: SimulateInitialStates; /** - * The set of parameters and limits override during simulation. If this set of - * parameters is present, then evaluation parameters may differ from standard - * evaluation in certain ways. + * The round immediately preceding this simulation. State changes through this + * round were used to run this simulation. */ - public evalOverrides?: SimulationEvalOverrides; + public lastRound?: number | bigint; /** - * An object that configures simulation execution trace. + * A result object for each transaction group that was simulated. */ - public execTraceConfig?: SimulateTraceConfig; + public txnGroups?: SimulateTransactionGroupResult[]; /** - * Initial states of resources that were accessed during simulation. + * The version of this response object. */ - public initialStates?: SimulateInitialStates; + public version?: number | bigint; /** * Creates a new `SimulateResponse` object. - * @param lastRound - The round immediately preceding this simulation. State changes through this - * round were used to run this simulation. - * @param txnGroups - A result object for each transaction group that was simulated. - * @param version - The version of this response object. * @param evalOverrides - The set of parameters and limits override during simulation. If this set of * parameters is present, then evaluation parameters may differ from standard * evaluation in certain ways. * @param execTraceConfig - An object that configures simulation execution trace. * @param initialStates - Initial states of resources that were accessed during simulation. + * @param lastRound - The round immediately preceding this simulation. State changes through this + * round were used to run this simulation. + * @param txnGroups - A result object for each transaction group that was simulated. + * @param version - The version of this response object. */ constructor({ - lastRound, - txnGroups, - version, evalOverrides, execTraceConfig, initialStates, + lastRound, + txnGroups, + version, }: { - lastRound: number | bigint; - txnGroups: SimulateTransactionGroupResult[]; - version: number | bigint; evalOverrides?: SimulationEvalOverrides; execTraceConfig?: SimulateTraceConfig; initialStates?: SimulateInitialStates; + lastRound?: number | bigint; + txnGroups?: SimulateTransactionGroupResult[]; + version?: number | bigint; }) { super(); - this.lastRound = lastRound; - this.txnGroups = txnGroups; - this.version = version; this.evalOverrides = evalOverrides; this.execTraceConfig = execTraceConfig; this.initialStates = initialStates; + this.lastRound = lastRound; + this.txnGroups = txnGroups; + this.version = version; this.attribute_map = { - lastRound: 'last-round', - txnGroups: 'txn-groups', - version: 'version', evalOverrides: 'eval-overrides', execTraceConfig: 'exec-trace-config', initialStates: 'initial-states', + lastRound: 'last-round', + txnGroups: 'txn-groups', + version: 'version', }; } // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): SimulateResponse { /* eslint-disable dot-notation */ - if (typeof data['last-round'] === 'undefined') - throw new Error( - `Response is missing required field 'last-round': ${data}`, - ); - if (!Array.isArray(data['txn-groups'])) - throw new Error( - `Response is missing required array field 'txn-groups': ${data}`, - ); - if (typeof data['version'] === 'undefined') - throw new Error(`Response is missing required field 'version': ${data}`); return new SimulateResponse({ - lastRound: data['last-round'], - txnGroups: data['txn-groups'].map( - SimulateTransactionGroupResult.from_obj_for_encoding, - ), - version: data['version'], evalOverrides: typeof data['eval-overrides'] !== 'undefined' ? SimulationEvalOverrides.from_obj_for_encoding( @@ -4534,6 +4595,14 @@ export class SimulateResponse extends BaseModel { typeof data['initial-states'] !== 'undefined' ? SimulateInitialStates.from_obj_for_encoding(data['initial-states']) : undefined, + lastRound: data['last-round'], + txnGroups: + typeof data['txn-groups'] !== 'undefined' + ? data['txn-groups'].map( + SimulateTransactionGroupResult.from_obj_for_encoding, + ) + : undefined, + version: data['version'], }); /* eslint-enable dot-notation */ } @@ -5552,17 +5621,17 @@ export class SupplyResponse extends BaseModel { /** * Round */ - public currentRound: number | bigint; + public currentRound?: number | bigint; /** * OnlineMoney */ - public onlineMoney: number | bigint; + public onlineMoney?: number | bigint; /** * TotalMoney */ - public totalMoney: number | bigint; + public totalMoney?: number | bigint; /** * Creates a new `SupplyResponse` object. @@ -5575,9 +5644,9 @@ export class SupplyResponse extends BaseModel { onlineMoney, totalMoney, }: { - currentRound: number | bigint; - onlineMoney: number | bigint; - totalMoney: number | bigint; + currentRound?: number | bigint; + onlineMoney?: number | bigint; + totalMoney?: number | bigint; }) { super(); this.currentRound = currentRound; @@ -5594,18 +5663,6 @@ export class SupplyResponse extends BaseModel { // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): SupplyResponse { /* eslint-disable dot-notation */ - if (typeof data['current_round'] === 'undefined') - throw new Error( - `Response is missing required field 'current_round': ${data}`, - ); - if (typeof data['online-money'] === 'undefined') - throw new Error( - `Response is missing required field 'online-money': ${data}`, - ); - if (typeof data['total-money'] === 'undefined') - throw new Error( - `Response is missing required field 'total-money': ${data}`, - ); return new SupplyResponse({ currentRound: data['current_round'], onlineMoney: data['online-money'], @@ -5726,13 +5783,13 @@ export class TealValue extends BaseModel { * associated Ids, in a single round. */ export class TransactionGroupLedgerStateDeltasForRoundResponse extends BaseModel { - public deltas: LedgerStateDeltaForTransactionGroup[]; + public deltas?: LedgerStateDeltaForTransactionGroup[]; /** * Creates a new `TransactionGroupLedgerStateDeltasForRoundResponse` object. * @param deltas - */ - constructor({ deltas }: { deltas: LedgerStateDeltaForTransactionGroup[] }) { + constructor({ deltas }: { deltas?: LedgerStateDeltaForTransactionGroup[] }) { super(); this.deltas = deltas; @@ -5746,14 +5803,13 @@ export class TransactionGroupLedgerStateDeltasForRoundResponse extends BaseModel data: Record, ): TransactionGroupLedgerStateDeltasForRoundResponse { /* eslint-disable dot-notation */ - if (!Array.isArray(data['Deltas'])) - throw new Error( - `Response is missing required array field 'Deltas': ${data}`, - ); return new TransactionGroupLedgerStateDeltasForRoundResponse({ - deltas: data['Deltas'].map( - LedgerStateDeltaForTransactionGroup.from_obj_for_encoding, - ), + deltas: + typeof data['Deltas'] !== 'undefined' + ? data['Deltas'].map( + LedgerStateDeltaForTransactionGroup.from_obj_for_encoding, + ) + : undefined, }); /* eslint-enable dot-notation */ } @@ -5768,7 +5824,7 @@ export class TransactionParametersResponse extends BaseModel { * ConsensusVersion indicates the consensus protocol version * as of LastRound. */ - public consensusVersion: string; + public consensusVersion?: string; /** * Fee is the suggested transaction fee @@ -5776,28 +5832,28 @@ export class TransactionParametersResponse extends BaseModel { * Fee may fall to zero but transactions must still have a fee of * at least MinTxnFee for the current network protocol. */ - public fee: number | bigint; + public fee?: number | bigint; /** * GenesisHash is the hash of the genesis block. */ - public genesisHash: Uint8Array; + public genesisHash?: Uint8Array; /** * GenesisID is an ID listed in the genesis block. */ - public genesisId: string; + public genesisId?: string; /** * LastRound indicates the last round seen */ - public lastRound: number | bigint; + public lastRound?: number | bigint; /** * The minimum transaction fee (not per byte) required for the * txn to validate for the current network protocol. */ - public minFee: number | bigint; + public minFee?: number | bigint; /** * Creates a new `TransactionParametersResponse` object. @@ -5821,12 +5877,12 @@ export class TransactionParametersResponse extends BaseModel { lastRound, minFee, }: { - consensusVersion: string; - fee: number | bigint; - genesisHash: string | Uint8Array; - genesisId: string; - lastRound: number | bigint; - minFee: number | bigint; + consensusVersion?: string; + fee?: number | bigint; + genesisHash?: string | Uint8Array; + genesisId?: string; + lastRound?: number | bigint; + minFee?: number | bigint; }) { super(); this.consensusVersion = consensusVersion; @@ -5854,26 +5910,6 @@ export class TransactionParametersResponse extends BaseModel { data: Record, ): TransactionParametersResponse { /* eslint-disable dot-notation */ - if (typeof data['consensus-version'] === 'undefined') - throw new Error( - `Response is missing required field 'consensus-version': ${data}`, - ); - if (typeof data['fee'] === 'undefined') - throw new Error(`Response is missing required field 'fee': ${data}`); - if (typeof data['genesis-hash'] === 'undefined') - throw new Error( - `Response is missing required field 'genesis-hash': ${data}`, - ); - if (typeof data['genesis-id'] === 'undefined') - throw new Error( - `Response is missing required field 'genesis-id': ${data}`, - ); - if (typeof data['last-round'] === 'undefined') - throw new Error( - `Response is missing required field 'last-round': ${data}`, - ); - if (typeof data['min-fee'] === 'undefined') - throw new Error(`Response is missing required field 'min-fee': ${data}`); return new TransactionParametersResponse({ consensusVersion: data['consensus-version'], fee: data['fee'], @@ -5890,59 +5926,60 @@ export class TransactionParametersResponse extends BaseModel { * Proof of transaction in a block. */ export class TransactionProofResponse extends BaseModel { + /** + * The type of hash function used to create the proof, must be one of: + * * sha512_256 + * * sha256 + */ + public hashtype?: string; + /** * Index of the transaction in the block's payset. */ - public idx: number | bigint; + public idx?: number | bigint; /** * Proof of transaction membership. */ - public proof: Uint8Array; + public proof?: Uint8Array; /** * Hash of SignedTxnInBlock for verifying proof. */ - public stibhash: Uint8Array; + public stibhash?: Uint8Array; /** * Represents the depth of the tree that is being proven, i.e. the number of edges * from a leaf to the root. */ - public treedepth: number | bigint; + public treedepth?: number | bigint; /** - * The type of hash function used to create the proof, must be one of: + * Creates a new `TransactionProofResponse` object. + * @param hashtype - The type of hash function used to create the proof, must be one of: * * sha512_256 * * sha256 - */ - public hashtype?: string; - - /** - * Creates a new `TransactionProofResponse` object. * @param idx - Index of the transaction in the block's payset. * @param proof - Proof of transaction membership. * @param stibhash - Hash of SignedTxnInBlock for verifying proof. * @param treedepth - Represents the depth of the tree that is being proven, i.e. the number of edges * from a leaf to the root. - * @param hashtype - The type of hash function used to create the proof, must be one of: - * * sha512_256 - * * sha256 */ constructor({ + hashtype, idx, proof, stibhash, treedepth, - hashtype, }: { - idx: number | bigint; - proof: string | Uint8Array; - stibhash: string | Uint8Array; - treedepth: number | bigint; hashtype?: string; + idx?: number | bigint; + proof?: string | Uint8Array; + stibhash?: string | Uint8Array; + treedepth?: number | bigint; }) { super(); + this.hashtype = hashtype; this.idx = idx; this.proof = typeof proof === 'string' @@ -5953,14 +5990,13 @@ export class TransactionProofResponse extends BaseModel { ? new Uint8Array(Buffer.from(stibhash, 'base64')) : stibhash; this.treedepth = treedepth; - this.hashtype = hashtype; this.attribute_map = { + hashtype: 'hashtype', idx: 'idx', proof: 'proof', stibhash: 'stibhash', treedepth: 'treedepth', - hashtype: 'hashtype', }; } @@ -5969,22 +6005,12 @@ export class TransactionProofResponse extends BaseModel { data: Record, ): TransactionProofResponse { /* eslint-disable dot-notation */ - if (typeof data['idx'] === 'undefined') - throw new Error(`Response is missing required field 'idx': ${data}`); - if (typeof data['proof'] === 'undefined') - throw new Error(`Response is missing required field 'proof': ${data}`); - if (typeof data['stibhash'] === 'undefined') - throw new Error(`Response is missing required field 'stibhash': ${data}`); - if (typeof data['treedepth'] === 'undefined') - throw new Error( - `Response is missing required field 'treedepth': ${data}`, - ); return new TransactionProofResponse({ + hashtype: data['hashtype'], idx: data['idx'], proof: data['proof'], stibhash: data['stibhash'], treedepth: data['treedepth'], - hashtype: data['hashtype'], }); /* eslint-enable dot-notation */ } diff --git a/src/client/v2/indexer/models/types.ts b/src/client/v2/indexer/models/types.ts index 084c1b389..fad6d072c 100644 --- a/src/client/v2/indexer/models/types.ts +++ b/src/client/v2/indexer/models/types.ts @@ -104,8 +104,7 @@ export class Account extends BaseModel { public appsTotalExtraPages?: number | bigint; /** - * the sum of all of the local schemas and global schemas in this account. - * Note: the raw account uses `StateSchema` for this type. + * Specifies maximums on the number of each type that may be stored. */ public appsTotalSchema?: ApplicationStateSchema; @@ -216,8 +215,7 @@ export class Account extends BaseModel { * @param appsLocalState - application local data stored in this account. * Note the raw object uses `map[int] -> AppLocalState` for this type. * @param appsTotalExtraPages - the sum of all extra application program pages for this account. - * @param appsTotalSchema - the sum of all of the local schemas and global schemas in this account. - * Note: the raw account uses `StateSchema` for this type. + * @param appsTotalSchema - Specifies maximums on the number of each type that may be stored. * @param assets - assets held by this account. * Note the raw object uses `map[int] -> AssetHolding` for this type. * @param authAddr - The address against which signing should be checked. If empty, the address of @@ -613,12 +611,12 @@ export class AccountResponse extends BaseModel { * Definition: * data/basics/userBalance.go : AccountData */ - public account: Account; + public account?: Account; /** * Round at which the results were computed. */ - public currentRound: number | bigint; + public currentRound?: number | bigint; /** * Creates a new `AccountResponse` object. @@ -631,8 +629,8 @@ export class AccountResponse extends BaseModel { account, currentRound, }: { - account: Account; - currentRound: number | bigint; + account?: Account; + currentRound?: number | bigint; }) { super(); this.account = account; @@ -647,14 +645,11 @@ export class AccountResponse extends BaseModel { // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): AccountResponse { /* eslint-disable dot-notation */ - if (typeof data['account'] === 'undefined') - throw new Error(`Response is missing required field 'account': ${data}`); - if (typeof data['current-round'] === 'undefined') - throw new Error( - `Response is missing required field 'current-round': ${data}`, - ); return new AccountResponse({ - account: Account.from_obj_for_encoding(data['account']), + account: + typeof data['account'] !== 'undefined' + ? Account.from_obj_for_encoding(data['account']) + : undefined, currentRound: data['current-round'], }); /* eslint-enable dot-notation */ @@ -715,12 +710,12 @@ export class AccountStateDelta extends BaseModel { * */ export class AccountsResponse extends BaseModel { - public accounts: Account[]; + public accounts?: Account[]; /** * Round at which the results were computed. */ - public currentRound: number | bigint; + public currentRound?: number | bigint; /** * Used for pagination, when making another request provide this token with the @@ -740,8 +735,8 @@ export class AccountsResponse extends BaseModel { currentRound, nextToken, }: { - accounts: Account[]; - currentRound: number | bigint; + accounts?: Account[]; + currentRound?: number | bigint; nextToken?: string; }) { super(); @@ -759,16 +754,11 @@ export class AccountsResponse extends BaseModel { // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): AccountsResponse { /* eslint-disable dot-notation */ - if (!Array.isArray(data['accounts'])) - throw new Error( - `Response is missing required array field 'accounts': ${data}`, - ); - if (typeof data['current-round'] === 'undefined') - throw new Error( - `Response is missing required field 'current-round': ${data}`, - ); return new AccountsResponse({ - accounts: data['accounts'].map(Account.from_obj_for_encoding), + accounts: + typeof data['accounts'] !== 'undefined' + ? data['accounts'].map(Account.from_obj_for_encoding) + : undefined, currentRound: data['current-round'], nextToken: data['next-token'], }); @@ -786,7 +776,7 @@ export class Application extends BaseModel { public id: number | bigint; /** - * application parameters. + * Stores the global information associated with an application. */ public params: ApplicationParams; @@ -808,7 +798,7 @@ export class Application extends BaseModel { /** * Creates a new `Application` object. * @param id - application index. - * @param params - application parameters. + * @param params - Stores the global information associated with an application. * @param createdAtRound - Round when this application was created. * @param deleted - Whether or not this application is currently deleted. * @param deletedAtRound - Round when this application was deleted. @@ -870,7 +860,7 @@ export class ApplicationLocalState extends BaseModel { public id: number | bigint; /** - * schema. + * Specifies maximums on the number of each type that may be stored. */ public schema: ApplicationStateSchema; @@ -886,7 +876,7 @@ export class ApplicationLocalState extends BaseModel { public deleted?: boolean; /** - * storage. + * Represents a key-value store for use in an application. */ public keyValue?: TealKeyValue[]; @@ -898,11 +888,11 @@ export class ApplicationLocalState extends BaseModel { /** * Creates a new `ApplicationLocalState` object. * @param id - The application which this local state is for. - * @param schema - schema. + * @param schema - Specifies maximums on the number of each type that may be stored. * @param closedOutAtRound - Round when account closed out of the application. * @param deleted - Whether or not the application local state is currently deleted from its * account. - * @param keyValue - storage. + * @param keyValue - Represents a key-value store for use in an application. * @param optedInAtRound - Round when the account opted into the application. */ constructor({ @@ -966,12 +956,12 @@ export class ApplicationLocalState extends BaseModel { * */ export class ApplicationLocalStatesResponse extends BaseModel { - public appsLocalStates: ApplicationLocalState[]; + public appsLocalStates?: ApplicationLocalState[]; /** * Round at which the results were computed. */ - public currentRound: number | bigint; + public currentRound?: number | bigint; /** * Used for pagination, when making another request provide this token with the @@ -991,8 +981,8 @@ export class ApplicationLocalStatesResponse extends BaseModel { currentRound, nextToken, }: { - appsLocalStates: ApplicationLocalState[]; - currentRound: number | bigint; + appsLocalStates?: ApplicationLocalState[]; + currentRound?: number | bigint; nextToken?: string; }) { super(); @@ -1012,18 +1002,13 @@ export class ApplicationLocalStatesResponse extends BaseModel { data: Record, ): ApplicationLocalStatesResponse { /* eslint-disable dot-notation */ - if (!Array.isArray(data['apps-local-states'])) - throw new Error( - `Response is missing required array field 'apps-local-states': ${data}`, - ); - if (typeof data['current-round'] === 'undefined') - throw new Error( - `Response is missing required field 'current-round': ${data}`, - ); return new ApplicationLocalStatesResponse({ - appsLocalStates: data['apps-local-states'].map( - ApplicationLocalState.from_obj_for_encoding, - ), + appsLocalStates: + typeof data['apps-local-states'] !== 'undefined' + ? data['apps-local-states'].map( + ApplicationLocalState.from_obj_for_encoding, + ) + : undefined, currentRound: data['current-round'], nextToken: data['next-token'], }); @@ -1085,12 +1070,12 @@ export class ApplicationLogsResponse extends BaseModel { /** * (appidx) application index. */ - public applicationId: number | bigint; + public applicationId?: number | bigint; /** * Round at which the results were computed. */ - public currentRound: number | bigint; + public currentRound?: number | bigint; public logData?: ApplicationLogData[]; @@ -1114,8 +1099,8 @@ export class ApplicationLogsResponse extends BaseModel { logData, nextToken, }: { - applicationId: number | bigint; - currentRound: number | bigint; + applicationId?: number | bigint; + currentRound?: number | bigint; logData?: ApplicationLogData[]; nextToken?: string; }) { @@ -1138,14 +1123,6 @@ export class ApplicationLogsResponse extends BaseModel { data: Record, ): ApplicationLogsResponse { /* eslint-disable dot-notation */ - if (typeof data['application-id'] === 'undefined') - throw new Error( - `Response is missing required field 'application-id': ${data}`, - ); - if (typeof data['current-round'] === 'undefined') - throw new Error( - `Response is missing required field 'current-round': ${data}`, - ); return new ApplicationLogsResponse({ applicationId: data['application-id'], currentRound: data['current-round'], @@ -1185,17 +1162,17 @@ export class ApplicationParams extends BaseModel { public extraProgramPages?: number | bigint; /** - * global state + * Represents a key-value store for use in an application. */ public globalState?: TealKeyValue[]; /** - * global schema + * Specifies maximums on the number of each type that may be stored. */ public globalStateSchema?: ApplicationStateSchema; /** - * local schema + * Specifies maximums on the number of each type that may be stored. */ public localStateSchema?: ApplicationStateSchema; @@ -1206,9 +1183,9 @@ export class ApplicationParams extends BaseModel { * @param creator - The address that created this application. This is the address where the * parameters and global state for this application can be found. * @param extraProgramPages - the number of extra program pages available to this app. - * @param globalState - global state - * @param globalStateSchema - global schema - * @param localStateSchema - local schema + * @param globalState - Represents a key-value store for use in an application. + * @param globalStateSchema - Specifies maximums on the number of each type that may be stored. + * @param localStateSchema - Specifies maximums on the number of each type that may be stored. */ constructor({ approvalProgram, @@ -1295,50 +1272,46 @@ export class ApplicationParams extends BaseModel { */ export class ApplicationResponse extends BaseModel { /** - * Round at which the results were computed. + * Application index and its parameters */ - public currentRound: number | bigint; + public application?: Application; /** - * Application index and its parameters + * Round at which the results were computed. */ - public application?: Application; + public currentRound?: number | bigint; /** * Creates a new `ApplicationResponse` object. - * @param currentRound - Round at which the results were computed. * @param application - Application index and its parameters + * @param currentRound - Round at which the results were computed. */ constructor({ - currentRound, application, + currentRound, }: { - currentRound: number | bigint; application?: Application; + currentRound?: number | bigint; }) { super(); - this.currentRound = currentRound; this.application = application; + this.currentRound = currentRound; this.attribute_map = { - currentRound: 'current-round', application: 'application', + currentRound: 'current-round', }; } // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): ApplicationResponse { /* eslint-disable dot-notation */ - if (typeof data['current-round'] === 'undefined') - throw new Error( - `Response is missing required field 'current-round': ${data}`, - ); return new ApplicationResponse({ - currentRound: data['current-round'], application: typeof data['application'] !== 'undefined' ? Application.from_obj_for_encoding(data['application']) : undefined, + currentRound: data['current-round'], }); /* eslint-enable dot-notation */ } @@ -1403,12 +1376,12 @@ export class ApplicationStateSchema extends BaseModel { * */ export class ApplicationsResponse extends BaseModel { - public applications: Application[]; + public applications?: Application[]; /** * Round at which the results were computed. */ - public currentRound: number | bigint; + public currentRound?: number | bigint; /** * Used for pagination, when making another request provide this token with the @@ -1428,8 +1401,8 @@ export class ApplicationsResponse extends BaseModel { currentRound, nextToken, }: { - applications: Application[]; - currentRound: number | bigint; + applications?: Application[]; + currentRound?: number | bigint; nextToken?: string; }) { super(); @@ -1449,16 +1422,11 @@ export class ApplicationsResponse extends BaseModel { data: Record, ): ApplicationsResponse { /* eslint-disable dot-notation */ - if (!Array.isArray(data['applications'])) - throw new Error( - `Response is missing required array field 'applications': ${data}`, - ); - if (typeof data['current-round'] === 'undefined') - throw new Error( - `Response is missing required field 'current-round': ${data}`, - ); return new ApplicationsResponse({ - applications: data['applications'].map(Application.from_obj_for_encoding), + applications: + typeof data['applications'] !== 'undefined' + ? data['applications'].map(Application.from_obj_for_encoding) + : undefined, currentRound: data['current-round'], nextToken: data['next-token'], }); @@ -1560,12 +1528,12 @@ export class Asset extends BaseModel { * */ export class AssetBalancesResponse extends BaseModel { - public balances: MiniAssetHolding[]; + public balances?: MiniAssetHolding[]; /** * Round at which the results were computed. */ - public currentRound: number | bigint; + public currentRound?: number | bigint; /** * Used for pagination, when making another request provide this token with the @@ -1585,8 +1553,8 @@ export class AssetBalancesResponse extends BaseModel { currentRound, nextToken, }: { - balances: MiniAssetHolding[]; - currentRound: number | bigint; + balances?: MiniAssetHolding[]; + currentRound?: number | bigint; nextToken?: string; }) { super(); @@ -1606,16 +1574,11 @@ export class AssetBalancesResponse extends BaseModel { data: Record, ): AssetBalancesResponse { /* eslint-disable dot-notation */ - if (!Array.isArray(data['balances'])) - throw new Error( - `Response is missing required array field 'balances': ${data}`, - ); - if (typeof data['current-round'] === 'undefined') - throw new Error( - `Response is missing required field 'current-round': ${data}`, - ); return new AssetBalancesResponse({ - balances: data['balances'].map(MiniAssetHolding.from_obj_for_encoding), + balances: + typeof data['balances'] !== 'undefined' + ? data['balances'].map(MiniAssetHolding.from_obj_for_encoding) + : undefined, currentRound: data['current-round'], nextToken: data['next-token'], }); @@ -1728,12 +1691,12 @@ export class AssetHolding extends BaseModel { * */ export class AssetHoldingsResponse extends BaseModel { - public assets: AssetHolding[]; + public assets?: AssetHolding[]; /** * Round at which the results were computed. */ - public currentRound: number | bigint; + public currentRound?: number | bigint; /** * Used for pagination, when making another request provide this token with the @@ -1753,8 +1716,8 @@ export class AssetHoldingsResponse extends BaseModel { currentRound, nextToken, }: { - assets: AssetHolding[]; - currentRound: number | bigint; + assets?: AssetHolding[]; + currentRound?: number | bigint; nextToken?: string; }) { super(); @@ -1774,16 +1737,11 @@ export class AssetHoldingsResponse extends BaseModel { data: Record, ): AssetHoldingsResponse { /* eslint-disable dot-notation */ - if (!Array.isArray(data['assets'])) - throw new Error( - `Response is missing required array field 'assets': ${data}`, - ); - if (typeof data['current-round'] === 'undefined') - throw new Error( - `Response is missing required field 'current-round': ${data}`, - ); return new AssetHoldingsResponse({ - assets: data['assets'].map(AssetHolding.from_obj_for_encoding), + assets: + typeof data['assets'] !== 'undefined' + ? data['assets'].map(AssetHolding.from_obj_for_encoding) + : undefined, currentRound: data['current-round'], nextToken: data['next-token'], }); @@ -2031,12 +1989,12 @@ export class AssetResponse extends BaseModel { /** * Specifies both the unique identifier and the parameters for an asset */ - public asset: Asset; + public asset?: Asset; /** * Round at which the results were computed. */ - public currentRound: number | bigint; + public currentRound?: number | bigint; /** * Creates a new `AssetResponse` object. @@ -2047,8 +2005,8 @@ export class AssetResponse extends BaseModel { asset, currentRound, }: { - asset: Asset; - currentRound: number | bigint; + asset?: Asset; + currentRound?: number | bigint; }) { super(); this.asset = asset; @@ -2063,14 +2021,11 @@ export class AssetResponse extends BaseModel { // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): AssetResponse { /* eslint-disable dot-notation */ - if (typeof data['asset'] === 'undefined') - throw new Error(`Response is missing required field 'asset': ${data}`); - if (typeof data['current-round'] === 'undefined') - throw new Error( - `Response is missing required field 'current-round': ${data}`, - ); return new AssetResponse({ - asset: Asset.from_obj_for_encoding(data['asset']), + asset: + typeof data['asset'] !== 'undefined' + ? Asset.from_obj_for_encoding(data['asset']) + : undefined, currentRound: data['current-round'], }); /* eslint-enable dot-notation */ @@ -2081,12 +2036,12 @@ export class AssetResponse extends BaseModel { * */ export class AssetsResponse extends BaseModel { - public assets: Asset[]; + public assets?: Asset[]; /** * Round at which the results were computed. */ - public currentRound: number | bigint; + public currentRound?: number | bigint; /** * Used for pagination, when making another request provide this token with the @@ -2106,8 +2061,8 @@ export class AssetsResponse extends BaseModel { currentRound, nextToken, }: { - assets: Asset[]; - currentRound: number | bigint; + assets?: Asset[]; + currentRound?: number | bigint; nextToken?: string; }) { super(); @@ -2125,16 +2080,11 @@ export class AssetsResponse extends BaseModel { // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): AssetsResponse { /* eslint-disable dot-notation */ - if (!Array.isArray(data['assets'])) - throw new Error( - `Response is missing required array field 'assets': ${data}`, - ); - if (typeof data['current-round'] === 'undefined') - throw new Error( - `Response is missing required field 'current-round': ${data}`, - ); return new AssetsResponse({ - assets: data['assets'].map(Asset.from_obj_for_encoding), + assets: + typeof data['assets'] !== 'undefined' + ? data['assets'].map(Asset.from_obj_for_encoding) + : undefined, currentRound: data['current-round'], nextToken: data['next-token'], }); @@ -2467,6 +2417,68 @@ export class Block extends BaseModel { } } +/** + * + */ +export class BlockHeadersResponse extends BaseModel { + public blocks?: Block[]; + + /** + * Round at which the results were computed. + */ + public currentRound?: number | bigint; + + /** + * Used for pagination, when making another request provide this token with the + * next parameter. + */ + public nextToken?: string; + + /** + * Creates a new `BlockHeadersResponse` object. + * @param blocks - + * @param currentRound - Round at which the results were computed. + * @param nextToken - Used for pagination, when making another request provide this token with the + * next parameter. + */ + constructor({ + blocks, + currentRound, + nextToken, + }: { + blocks?: Block[]; + currentRound?: number | bigint; + nextToken?: string; + }) { + super(); + this.blocks = blocks; + this.currentRound = currentRound; + this.nextToken = nextToken; + + this.attribute_map = { + blocks: 'blocks', + currentRound: 'current-round', + nextToken: 'next-token', + }; + } + + // eslint-disable-next-line camelcase + static from_obj_for_encoding( + data: Record, + ): BlockHeadersResponse { + /* eslint-disable dot-notation */ + return new BlockHeadersResponse({ + blocks: + typeof data['blocks'] !== 'undefined' + ? data['blocks'].map(Block.from_obj_for_encoding) + : undefined, + currentRound: data['current-round'], + nextToken: data['next-token'], + }); + /* eslint-enable dot-notation */ + } +} + /** * Fields relating to rewards, */ @@ -2848,9 +2860,9 @@ export class BoxesResponse extends BaseModel { /** * (appidx) application index. */ - public applicationId: number | bigint; + public applicationId?: number | bigint; - public boxes: BoxDescriptor[]; + public boxes?: BoxDescriptor[]; /** * Used for pagination, when making another request provide this token with the @@ -2870,8 +2882,8 @@ export class BoxesResponse extends BaseModel { boxes, nextToken, }: { - applicationId: number | bigint; - boxes: BoxDescriptor[]; + applicationId?: number | bigint; + boxes?: BoxDescriptor[]; nextToken?: string; }) { super(); @@ -2889,17 +2901,12 @@ export class BoxesResponse extends BaseModel { // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): BoxesResponse { /* eslint-disable dot-notation */ - if (typeof data['application-id'] === 'undefined') - throw new Error( - `Response is missing required field 'application-id': ${data}`, - ); - if (!Array.isArray(data['boxes'])) - throw new Error( - `Response is missing required array field 'boxes': ${data}`, - ); return new BoxesResponse({ applicationId: data['application-id'], - boxes: data['boxes'].map(BoxDescriptor.from_obj_for_encoding), + boxes: + typeof data['boxes'] !== 'undefined' + ? data['boxes'].map(BoxDescriptor.from_obj_for_encoding) + : undefined, nextToken: data['next-token'], }); /* eslint-enable dot-notation */ @@ -2910,40 +2917,38 @@ export class BoxesResponse extends BaseModel { * Response for errors */ export class ErrorResponse extends BaseModel { - public message: string; - public data?: Record; + public message?: string; + /** * Creates a new `ErrorResponse` object. - * @param message - * @param data - + * @param message - */ constructor({ - message, data, + message, }: { - message: string; data?: Record; + message?: string; }) { super(); - this.message = message; this.data = data; + this.message = message; this.attribute_map = { - message: 'message', data: 'data', + message: 'message', }; } // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): ErrorResponse { /* eslint-disable dot-notation */ - if (typeof data['message'] === 'undefined') - throw new Error(`Response is missing required field 'message': ${data}`); return new ErrorResponse({ - message: data['message'], data: data['data'], + message: data['message'], }); /* eslint-enable dot-notation */ } @@ -3080,6 +3085,106 @@ export class HashFactory extends BaseModel { } } +/** + * (hbprf) HbProof is a signature using HeartbeatAddress's partkey, thereby showing + * it is online. + */ +export class HbProofFields extends BaseModel { + /** + * (p) Public key of the heartbeat message. + */ + public hbPk?: Uint8Array; + + /** + * (p1s) Signature of OneTimeSignatureSubkeyOffsetID(PK, Batch, Offset) under the + * key PK2. + */ + public hbPk1sig?: Uint8Array; + + /** + * (p2) Key for new-style two-level ephemeral signature. + */ + public hbPk2?: Uint8Array; + + /** + * (p2s) Signature of OneTimeSignatureSubkeyBatchID(PK2, Batch) under the master + * key (OneTimeSignatureVerifier). + */ + public hbPk2sig?: Uint8Array; + + /** + * (s) Signature of the heartbeat message. + */ + public hbSig?: Uint8Array; + + /** + * Creates a new `HbProofFields` object. + * @param hbPk - (p) Public key of the heartbeat message. + * @param hbPk1sig - (p1s) Signature of OneTimeSignatureSubkeyOffsetID(PK, Batch, Offset) under the + * key PK2. + * @param hbPk2 - (p2) Key for new-style two-level ephemeral signature. + * @param hbPk2sig - (p2s) Signature of OneTimeSignatureSubkeyBatchID(PK2, Batch) under the master + * key (OneTimeSignatureVerifier). + * @param hbSig - (s) Signature of the heartbeat message. + */ + constructor({ + hbPk, + hbPk1sig, + hbPk2, + hbPk2sig, + hbSig, + }: { + hbPk?: string | Uint8Array; + hbPk1sig?: string | Uint8Array; + hbPk2?: string | Uint8Array; + hbPk2sig?: string | Uint8Array; + hbSig?: string | Uint8Array; + }) { + super(); + this.hbPk = + typeof hbPk === 'string' + ? new Uint8Array(Buffer.from(hbPk, 'base64')) + : hbPk; + this.hbPk1sig = + typeof hbPk1sig === 'string' + ? new Uint8Array(Buffer.from(hbPk1sig, 'base64')) + : hbPk1sig; + this.hbPk2 = + typeof hbPk2 === 'string' + ? new Uint8Array(Buffer.from(hbPk2, 'base64')) + : hbPk2; + this.hbPk2sig = + typeof hbPk2sig === 'string' + ? new Uint8Array(Buffer.from(hbPk2sig, 'base64')) + : hbPk2sig; + this.hbSig = + typeof hbSig === 'string' + ? new Uint8Array(Buffer.from(hbSig, 'base64')) + : hbSig; + + this.attribute_map = { + hbPk: 'hb-pk', + hbPk1sig: 'hb-pk1sig', + hbPk2: 'hb-pk2', + hbPk2sig: 'hb-pk2sig', + hbSig: 'hb-sig', + }; + } + + // eslint-disable-next-line camelcase + static from_obj_for_encoding(data: Record): HbProofFields { + /* eslint-disable dot-notation */ + return new HbProofFields({ + hbPk: data['hb-pk'], + hbPk1sig: data['hb-pk1sig'], + hbPk2: data['hb-pk2'], + hbPk2sig: data['hb-pk2sig'], + hbSig: data['hb-sig'], + }); + /* eslint-enable dot-notation */ + } +} + /** * A health check response. */ @@ -3465,9 +3570,6 @@ export class ParticipationUpdates extends BaseModel { * crypto/stateproof/structs.go : StateProof */ export class StateProofFields extends BaseModel { - /** - * (P) - */ public partProofs?: MerkleArrayProof; /** @@ -3491,9 +3593,6 @@ export class StateProofFields extends BaseModel { */ public sigCommit?: Uint8Array; - /** - * (S) - */ public sigProofs?: MerkleArrayProof; /** @@ -3503,13 +3602,13 @@ export class StateProofFields extends BaseModel { /** * Creates a new `StateProofFields` object. - * @param partProofs - (P) + * @param partProofs - * @param positionsToReveal - (pr) Sequence of reveal positions. * @param reveals - (r) Note that this is actually stored as a map[uint64] - Reveal in the actual * msgp * @param saltVersion - (v) Salt version of the merkle signature. * @param sigCommit - (c) - * @param sigProofs - (S) + * @param sigProofs - * @param signedWeight - (w) */ constructor({ @@ -3578,9 +3677,6 @@ export class StateProofFields extends BaseModel { } export class StateProofParticipant extends BaseModel { - /** - * (p) - */ public verifier?: StateProofVerifier; /** @@ -3590,7 +3686,7 @@ export class StateProofParticipant extends BaseModel { /** * Creates a new `StateProofParticipant` object. - * @param verifier - (p) + * @param verifier - * @param weight - (w) */ constructor({ @@ -3627,9 +3723,6 @@ export class StateProofParticipant extends BaseModel { } export class StateProofReveal extends BaseModel { - /** - * (p) - */ public participant?: StateProofParticipant; /** @@ -3638,17 +3731,14 @@ export class StateProofReveal extends BaseModel { */ public position?: number | bigint; - /** - * (s) - */ public sigSlot?: StateProofSigSlot; /** * Creates a new `StateProofReveal` object. - * @param participant - (p) + * @param participant - * @param position - The position in the signature and participants arrays corresponding to this * entry. - * @param sigSlot - (s) + * @param sigSlot - */ constructor({ participant, @@ -4183,8 +4273,7 @@ export class Transaction extends BaseModel { public genesisId?: string; /** - * (gd) Global state key/value changes for the application being executed by this - * transaction. + * Application state delta. */ public globalStateDelta?: EvalDeltaKeyValue[]; @@ -4195,6 +4284,13 @@ export class Transaction extends BaseModel { */ public group?: Uint8Array; + /** + * Fields for a heartbeat transaction. + * Definition: + * data/transactions/heartbeat.go : HeartbeatTxnFields + */ + public heartbeatTransaction?: TransactionHeartbeat; + /** * Transaction ID */ @@ -4295,6 +4391,7 @@ export class Transaction extends BaseModel { * * (afrz) asset-freeze-transaction * * (appl) application-transaction * * (stpf) state-proof-transaction + * * (hb) heartbeat-transaction */ public txType?: string; @@ -4329,11 +4426,13 @@ export class Transaction extends BaseModel { * @param createdAssetIndex - Specifies an asset index (ID) if an asset was created with this transaction. * @param genesisHash - (gh) Hash of genesis block. * @param genesisId - (gen) genesis block ID. - * @param globalStateDelta - (gd) Global state key/value changes for the application being executed by this - * transaction. + * @param globalStateDelta - Application state delta. * @param group - (grp) Base64 encoded byte array of a sha512/256 digest. When present indicates * that this transaction is part of a transaction group and the value is the * sha512/256 hash of the transactions in that group. + * @param heartbeatTransaction - Fields for a heartbeat transaction. + * Definition: + * data/transactions/heartbeat.go : HeartbeatTxnFields * @param id - Transaction ID * @param innerTxns - Inner transactions produced by application execution. * @param intraRoundOffset - Offset into the round where this transaction was confirmed. @@ -4373,6 +4472,7 @@ export class Transaction extends BaseModel { * * (afrz) asset-freeze-transaction * * (appl) application-transaction * * (stpf) state-proof-transaction + * * (hb) heartbeat-transaction */ constructor({ fee, @@ -4393,6 +4493,7 @@ export class Transaction extends BaseModel { genesisId, globalStateDelta, group, + heartbeatTransaction, id, innerTxns, intraRoundOffset, @@ -4428,6 +4529,7 @@ export class Transaction extends BaseModel { genesisId?: string; globalStateDelta?: EvalDeltaKeyValue[]; group?: string | Uint8Array; + heartbeatTransaction?: TransactionHeartbeat; id?: string; innerTxns?: Transaction[]; intraRoundOffset?: number | bigint; @@ -4470,6 +4572,7 @@ export class Transaction extends BaseModel { typeof group === 'string' ? new Uint8Array(Buffer.from(group, 'base64')) : group; + this.heartbeatTransaction = heartbeatTransaction; this.id = id; this.innerTxns = innerTxns; this.intraRoundOffset = intraRoundOffset; @@ -4512,6 +4615,7 @@ export class Transaction extends BaseModel { genesisId: 'genesis-id', globalStateDelta: 'global-state-delta', group: 'group', + heartbeatTransaction: 'heartbeat-transaction', id: 'id', innerTxns: 'inner-txns', intraRoundOffset: 'intra-round-offset', @@ -4590,6 +4694,12 @@ export class Transaction extends BaseModel { ) : undefined, group: data['group'], + heartbeatTransaction: + typeof data['heartbeat-transaction'] !== 'undefined' + ? TransactionHeartbeat.from_obj_for_encoding( + data['heartbeat-transaction'], + ) + : undefined, id: data['id'], innerTxns: typeof data['inner-txns'] !== 'undefined' @@ -4656,7 +4766,7 @@ export class TransactionApplication extends BaseModel { * (apaa) transaction specific arguments accessed from the application's * approval-program and clear-state-program. */ - public applicationArgs?: Uint8Array[]; + public applicationArgs?: string[]; /** * (apap) Logic executed for every application transaction, except when @@ -4775,7 +4885,7 @@ export class TransactionApplication extends BaseModel { }: { applicationId: number | bigint; accounts?: string[]; - applicationArgs?: Uint8Array[]; + applicationArgs?: string[]; approvalProgram?: string | Uint8Array; clearStateProgram?: string | Uint8Array; extraProgramPages?: number | bigint; @@ -5094,6 +5204,116 @@ export class TransactionAssetTransfer extends BaseModel { } } +/** + * Fields for a heartbeat transaction. + * Definition: + * data/transactions/heartbeat.go : HeartbeatTxnFields + */ +export class TransactionHeartbeat extends BaseModel { + /** + * (hbad) HbAddress is the account this txn is proving onlineness for. + */ + public hbAddress: string; + + /** + * (hbkd) HbKeyDilution must match HbAddress account's current KeyDilution. + */ + public hbKeyDilution: number | bigint; + + /** + * (hbprf) HbProof is a signature using HeartbeatAddress's partkey, thereby showing + * it is online. + */ + public hbProof: HbProofFields; + + /** + * (hbsd) HbSeed must be the block seed for the this transaction's firstValid + * block. + */ + public hbSeed: Uint8Array; + + /** + * (hbvid) HbVoteID must match the HbAddress account's current VoteID. + */ + public hbVoteId: Uint8Array; + + /** + * Creates a new `TransactionHeartbeat` object. + * @param hbAddress - (hbad) HbAddress is the account this txn is proving onlineness for. + * @param hbKeyDilution - (hbkd) HbKeyDilution must match HbAddress account's current KeyDilution. + * @param hbProof - (hbprf) HbProof is a signature using HeartbeatAddress's partkey, thereby showing + * it is online. + * @param hbSeed - (hbsd) HbSeed must be the block seed for the this transaction's firstValid + * block. + * @param hbVoteId - (hbvid) HbVoteID must match the HbAddress account's current VoteID. + */ + constructor({ + hbAddress, + hbKeyDilution, + hbProof, + hbSeed, + hbVoteId, + }: { + hbAddress: string; + hbKeyDilution: number | bigint; + hbProof: HbProofFields; + hbSeed: string | Uint8Array; + hbVoteId: string | Uint8Array; + }) { + super(); + this.hbAddress = hbAddress; + this.hbKeyDilution = hbKeyDilution; + this.hbProof = hbProof; + this.hbSeed = + typeof hbSeed === 'string' + ? new Uint8Array(Buffer.from(hbSeed, 'base64')) + : hbSeed; + this.hbVoteId = + typeof hbVoteId === 'string' + ? new Uint8Array(Buffer.from(hbVoteId, 'base64')) + : hbVoteId; + + this.attribute_map = { + hbAddress: 'hb-address', + hbKeyDilution: 'hb-key-dilution', + hbProof: 'hb-proof', + hbSeed: 'hb-seed', + hbVoteId: 'hb-vote-id', + }; + } + + // eslint-disable-next-line camelcase + static from_obj_for_encoding( + data: Record, + ): TransactionHeartbeat { + /* eslint-disable dot-notation */ + if (typeof data['hb-address'] === 'undefined') + throw new Error( + `Response is missing required field 'hb-address': ${data}`, + ); + if (typeof data['hb-key-dilution'] === 'undefined') + throw new Error( + `Response is missing required field 'hb-key-dilution': ${data}`, + ); + if (typeof data['hb-proof'] === 'undefined') + throw new Error(`Response is missing required field 'hb-proof': ${data}`); + if (typeof data['hb-seed'] === 'undefined') + throw new Error(`Response is missing required field 'hb-seed': ${data}`); + if (typeof data['hb-vote-id'] === 'undefined') + throw new Error( + `Response is missing required field 'hb-vote-id': ${data}`, + ); + return new TransactionHeartbeat({ + hbAddress: data['hb-address'], + hbKeyDilution: data['hb-key-dilution'], + hbProof: HbProofFields.from_obj_for_encoding(data['hb-proof']), + hbSeed: data['hb-seed'], + hbVoteId: data['hb-vote-id'], + }); + /* eslint-enable dot-notation */ + } +} + /** * Fields for a keyreg transaction. * Definition: @@ -5295,7 +5515,7 @@ export class TransactionResponse extends BaseModel { /** * Round at which the results were computed. */ - public currentRound: number | bigint; + public currentRound?: number | bigint; /** * Contains all fields common to all transactions and serves as an envelope to all @@ -5304,7 +5524,7 @@ export class TransactionResponse extends BaseModel { * data/transactions/signedtxn.go : SignedTxn * data/transactions/transaction.go : Transaction */ - public transaction: Transaction; + public transaction?: Transaction; /** * Creates a new `TransactionResponse` object. @@ -5319,8 +5539,8 @@ export class TransactionResponse extends BaseModel { currentRound, transaction, }: { - currentRound: number | bigint; - transaction: Transaction; + currentRound?: number | bigint; + transaction?: Transaction; }) { super(); this.currentRound = currentRound; @@ -5335,17 +5555,12 @@ export class TransactionResponse extends BaseModel { // eslint-disable-next-line camelcase static from_obj_for_encoding(data: Record): TransactionResponse { /* eslint-disable dot-notation */ - if (typeof data['current-round'] === 'undefined') - throw new Error( - `Response is missing required field 'current-round': ${data}`, - ); - if (typeof data['transaction'] === 'undefined') - throw new Error( - `Response is missing required field 'transaction': ${data}`, - ); return new TransactionResponse({ currentRound: data['current-round'], - transaction: Transaction.from_obj_for_encoding(data['transaction']), + transaction: + typeof data['transaction'] !== 'undefined' + ? Transaction.from_obj_for_encoding(data['transaction']) + : undefined, }); /* eslint-enable dot-notation */ } @@ -5444,7 +5659,7 @@ export class TransactionSignatureLogicsig extends BaseModel { /** * (arg) Logic arguments, base64 encoded. */ - public args?: Uint8Array[]; + public args?: string[]; /** * (msig) structure holding multiple subsignatures. @@ -5475,7 +5690,7 @@ export class TransactionSignatureLogicsig extends BaseModel { signature, }: { logic: string | Uint8Array; - args?: Uint8Array[]; + args?: string[]; multisigSignature?: TransactionSignatureMultisig; signature?: string | Uint8Array; }) { @@ -5646,9 +5861,6 @@ export class TransactionSignatureMultisigSubsignature extends BaseModel { * data/transactions/stateproof.go : StateProofTxnFields */ export class TransactionStateProof extends BaseModel { - /** - * (spmsg) - */ public message?: IndexerStateProofMessage; /** @@ -5666,7 +5878,7 @@ export class TransactionStateProof extends BaseModel { /** * Creates a new `TransactionStateProof` object. - * @param message - (spmsg) + * @param message - * @param stateProof - (sp) represents a state proof. * Definition: * crypto/stateproof/structs.go : StateProof @@ -5721,9 +5933,7 @@ export class TransactionsResponse extends BaseModel { /** * Round at which the results were computed. */ - public currentRound: number | bigint; - - public transactions: Transaction[]; + public currentRound?: number | bigint; /** * Used for pagination, when making another request provide this token with the @@ -5731,31 +5941,33 @@ export class TransactionsResponse extends BaseModel { */ public nextToken?: string; + public transactions?: Transaction[]; + /** * Creates a new `TransactionsResponse` object. * @param currentRound - Round at which the results were computed. - * @param transactions - * @param nextToken - Used for pagination, when making another request provide this token with the * next parameter. + * @param transactions - */ constructor({ currentRound, - transactions, nextToken, + transactions, }: { - currentRound: number | bigint; - transactions: Transaction[]; + currentRound?: number | bigint; nextToken?: string; + transactions?: Transaction[]; }) { super(); this.currentRound = currentRound; - this.transactions = transactions; this.nextToken = nextToken; + this.transactions = transactions; this.attribute_map = { currentRound: 'current-round', - transactions: 'transactions', nextToken: 'next-token', + transactions: 'transactions', }; } @@ -5764,18 +5976,13 @@ export class TransactionsResponse extends BaseModel { data: Record, ): TransactionsResponse { /* eslint-disable dot-notation */ - if (typeof data['current-round'] === 'undefined') - throw new Error( - `Response is missing required field 'current-round': ${data}`, - ); - if (!Array.isArray(data['transactions'])) - throw new Error( - `Response is missing required array field 'transactions': ${data}`, - ); return new TransactionsResponse({ currentRound: data['current-round'], - transactions: data['transactions'].map(Transaction.from_obj_for_encoding), nextToken: data['next-token'], + transactions: + typeof data['transactions'] !== 'undefined' + ? data['transactions'].map(Transaction.from_obj_for_encoding) + : undefined, }); /* eslint-enable dot-notation */ }