algosdk 2.9.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/browser/algosdk.min.js +1 -1
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/client/v2/algod/block.js +21 -0
- package/dist/cjs/client/v2/algod/block.js.map +1 -1
- package/dist/cjs/client/v2/indexer/indexer.js +15 -0
- package/dist/cjs/client/v2/indexer/indexer.js.map +1 -1
- package/dist/cjs/client/v2/indexer/models/types.js +168 -3
- package/dist/cjs/client/v2/indexer/models/types.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchForBlockHeaders.js +209 -0
- package/dist/cjs/client/v2/indexer/searchForBlockHeaders.js.map +1 -0
- package/dist/cjs/transaction.js +102 -0
- package/dist/cjs/transaction.js.map +1 -1
- package/dist/cjs/types/transactions/base.js +6 -1
- package/dist/cjs/types/transactions/base.js.map +1 -1
- package/dist/cjs/types/transactions/heartbeat.js +3 -0
- package/dist/cjs/types/transactions/heartbeat.js.map +1 -0
- package/dist/cjs/types/transactions/index.js.map +1 -1
- package/dist/esm/client/v2/algod/block.js +21 -0
- package/dist/esm/client/v2/algod/block.js.map +1 -1
- package/dist/esm/client/v2/indexer/indexer.js +15 -0
- package/dist/esm/client/v2/indexer/indexer.js.map +1 -1
- package/dist/esm/client/v2/indexer/models/types.js +163 -1
- package/dist/esm/client/v2/indexer/models/types.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchForBlockHeaders.js +203 -0
- package/dist/esm/client/v2/indexer/searchForBlockHeaders.js.map +1 -0
- package/dist/esm/transaction.js +102 -0
- package/dist/esm/transaction.js.map +1 -1
- package/dist/esm/types/transactions/base.js +6 -1
- package/dist/esm/types/transactions/base.js.map +1 -1
- package/dist/esm/types/transactions/heartbeat.js +2 -0
- package/dist/esm/types/transactions/heartbeat.js.map +1 -0
- package/dist/esm/types/transactions/index.js.map +1 -1
- package/dist/types/client/v2/algod/block.d.ts +18 -0
- package/dist/types/client/v2/indexer/indexer.d.ts +13 -0
- package/dist/types/client/v2/indexer/models/types.d.ts +134 -1
- package/dist/types/client/v2/indexer/searchForBlockHeaders.d.ts +172 -0
- package/dist/types/transaction.d.ts +30 -2
- package/dist/types/types/transactions/base.d.ts +17 -1
- package/dist/types/types/transactions/encoded.d.ts +54 -0
- package/dist/types/types/transactions/heartbeat.d.ts +8 -0
- package/dist/types/types/transactions/index.d.ts +3 -1
- package/package.json +1 -1
- package/src/client/v2/algod/block.ts +22 -0
- package/src/client/v2/indexer/indexer.ts +16 -0
- package/src/client/v2/indexer/models/types.ts +294 -0
- package/src/client/v2/indexer/searchForBlockHeaders.ts +212 -0
- package/src/transaction.ts +131 -0
- package/src/types/transactions/base.ts +20 -1
- package/src/types/transactions/encoded.ts +65 -0
- package/src/types/transactions/heartbeat.ts +14 -0
- package/src/types/transactions/index.ts +4 -1
|
@@ -2467,6 +2467,68 @@ export class Block extends BaseModel {
|
|
|
2467
2467
|
}
|
|
2468
2468
|
}
|
|
2469
2469
|
|
|
2470
|
+
/**
|
|
2471
|
+
*
|
|
2472
|
+
*/
|
|
2473
|
+
export class BlockHeadersResponse extends BaseModel {
|
|
2474
|
+
public blocks?: Block[];
|
|
2475
|
+
|
|
2476
|
+
/**
|
|
2477
|
+
* Round at which the results were computed.
|
|
2478
|
+
*/
|
|
2479
|
+
public currentRound?: number | bigint;
|
|
2480
|
+
|
|
2481
|
+
/**
|
|
2482
|
+
* Used for pagination, when making another request provide this token with the
|
|
2483
|
+
* next parameter.
|
|
2484
|
+
*/
|
|
2485
|
+
public nextToken?: string;
|
|
2486
|
+
|
|
2487
|
+
/**
|
|
2488
|
+
* Creates a new `BlockHeadersResponse` object.
|
|
2489
|
+
* @param blocks -
|
|
2490
|
+
* @param currentRound - Round at which the results were computed.
|
|
2491
|
+
* @param nextToken - Used for pagination, when making another request provide this token with the
|
|
2492
|
+
* next parameter.
|
|
2493
|
+
*/
|
|
2494
|
+
constructor({
|
|
2495
|
+
blocks,
|
|
2496
|
+
currentRound,
|
|
2497
|
+
nextToken,
|
|
2498
|
+
}: {
|
|
2499
|
+
blocks?: Block[];
|
|
2500
|
+
currentRound?: number | bigint;
|
|
2501
|
+
nextToken?: string;
|
|
2502
|
+
}) {
|
|
2503
|
+
super();
|
|
2504
|
+
this.blocks = blocks;
|
|
2505
|
+
this.currentRound = currentRound;
|
|
2506
|
+
this.nextToken = nextToken;
|
|
2507
|
+
|
|
2508
|
+
this.attribute_map = {
|
|
2509
|
+
blocks: 'blocks',
|
|
2510
|
+
currentRound: 'current-round',
|
|
2511
|
+
nextToken: 'next-token',
|
|
2512
|
+
};
|
|
2513
|
+
}
|
|
2514
|
+
|
|
2515
|
+
// eslint-disable-next-line camelcase
|
|
2516
|
+
static from_obj_for_encoding(
|
|
2517
|
+
data: Record<string, any>
|
|
2518
|
+
): BlockHeadersResponse {
|
|
2519
|
+
/* eslint-disable dot-notation */
|
|
2520
|
+
return new BlockHeadersResponse({
|
|
2521
|
+
blocks:
|
|
2522
|
+
typeof data['blocks'] !== 'undefined'
|
|
2523
|
+
? data['blocks'].map(Block.from_obj_for_encoding)
|
|
2524
|
+
: undefined,
|
|
2525
|
+
currentRound: data['current-round'],
|
|
2526
|
+
nextToken: data['next-token'],
|
|
2527
|
+
});
|
|
2528
|
+
/* eslint-enable dot-notation */
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2470
2532
|
/**
|
|
2471
2533
|
* Fields relating to rewards,
|
|
2472
2534
|
*/
|
|
@@ -3080,6 +3142,106 @@ export class HashFactory extends BaseModel {
|
|
|
3080
3142
|
}
|
|
3081
3143
|
}
|
|
3082
3144
|
|
|
3145
|
+
/**
|
|
3146
|
+
* (hbprf) HbProof is a signature using HeartbeatAddress's partkey, thereby showing
|
|
3147
|
+
* it is online.
|
|
3148
|
+
*/
|
|
3149
|
+
export class HbProofFields extends BaseModel {
|
|
3150
|
+
/**
|
|
3151
|
+
* (p) Public key of the heartbeat message.
|
|
3152
|
+
*/
|
|
3153
|
+
public hbPk?: Uint8Array;
|
|
3154
|
+
|
|
3155
|
+
/**
|
|
3156
|
+
* (p1s) Signature of OneTimeSignatureSubkeyOffsetID(PK, Batch, Offset) under the
|
|
3157
|
+
* key PK2.
|
|
3158
|
+
*/
|
|
3159
|
+
public hbPk1sig?: Uint8Array;
|
|
3160
|
+
|
|
3161
|
+
/**
|
|
3162
|
+
* (p2) Key for new-style two-level ephemeral signature.
|
|
3163
|
+
*/
|
|
3164
|
+
public hbPk2?: Uint8Array;
|
|
3165
|
+
|
|
3166
|
+
/**
|
|
3167
|
+
* (p2s) Signature of OneTimeSignatureSubkeyBatchID(PK2, Batch) under the master
|
|
3168
|
+
* key (OneTimeSignatureVerifier).
|
|
3169
|
+
*/
|
|
3170
|
+
public hbPk2sig?: Uint8Array;
|
|
3171
|
+
|
|
3172
|
+
/**
|
|
3173
|
+
* (s) Signature of the heartbeat message.
|
|
3174
|
+
*/
|
|
3175
|
+
public hbSig?: Uint8Array;
|
|
3176
|
+
|
|
3177
|
+
/**
|
|
3178
|
+
* Creates a new `HbProofFields` object.
|
|
3179
|
+
* @param hbPk - (p) Public key of the heartbeat message.
|
|
3180
|
+
* @param hbPk1sig - (p1s) Signature of OneTimeSignatureSubkeyOffsetID(PK, Batch, Offset) under the
|
|
3181
|
+
* key PK2.
|
|
3182
|
+
* @param hbPk2 - (p2) Key for new-style two-level ephemeral signature.
|
|
3183
|
+
* @param hbPk2sig - (p2s) Signature of OneTimeSignatureSubkeyBatchID(PK2, Batch) under the master
|
|
3184
|
+
* key (OneTimeSignatureVerifier).
|
|
3185
|
+
* @param hbSig - (s) Signature of the heartbeat message.
|
|
3186
|
+
*/
|
|
3187
|
+
constructor({
|
|
3188
|
+
hbPk,
|
|
3189
|
+
hbPk1sig,
|
|
3190
|
+
hbPk2,
|
|
3191
|
+
hbPk2sig,
|
|
3192
|
+
hbSig,
|
|
3193
|
+
}: {
|
|
3194
|
+
hbPk?: string | Uint8Array;
|
|
3195
|
+
hbPk1sig?: string | Uint8Array;
|
|
3196
|
+
hbPk2?: string | Uint8Array;
|
|
3197
|
+
hbPk2sig?: string | Uint8Array;
|
|
3198
|
+
hbSig?: string | Uint8Array;
|
|
3199
|
+
}) {
|
|
3200
|
+
super();
|
|
3201
|
+
this.hbPk =
|
|
3202
|
+
typeof hbPk === 'string'
|
|
3203
|
+
? new Uint8Array(Buffer.from(hbPk, 'base64'))
|
|
3204
|
+
: hbPk;
|
|
3205
|
+
this.hbPk1sig =
|
|
3206
|
+
typeof hbPk1sig === 'string'
|
|
3207
|
+
? new Uint8Array(Buffer.from(hbPk1sig, 'base64'))
|
|
3208
|
+
: hbPk1sig;
|
|
3209
|
+
this.hbPk2 =
|
|
3210
|
+
typeof hbPk2 === 'string'
|
|
3211
|
+
? new Uint8Array(Buffer.from(hbPk2, 'base64'))
|
|
3212
|
+
: hbPk2;
|
|
3213
|
+
this.hbPk2sig =
|
|
3214
|
+
typeof hbPk2sig === 'string'
|
|
3215
|
+
? new Uint8Array(Buffer.from(hbPk2sig, 'base64'))
|
|
3216
|
+
: hbPk2sig;
|
|
3217
|
+
this.hbSig =
|
|
3218
|
+
typeof hbSig === 'string'
|
|
3219
|
+
? new Uint8Array(Buffer.from(hbSig, 'base64'))
|
|
3220
|
+
: hbSig;
|
|
3221
|
+
|
|
3222
|
+
this.attribute_map = {
|
|
3223
|
+
hbPk: 'hb-pk',
|
|
3224
|
+
hbPk1sig: 'hb-pk1sig',
|
|
3225
|
+
hbPk2: 'hb-pk2',
|
|
3226
|
+
hbPk2sig: 'hb-pk2sig',
|
|
3227
|
+
hbSig: 'hb-sig',
|
|
3228
|
+
};
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3231
|
+
// eslint-disable-next-line camelcase
|
|
3232
|
+
static from_obj_for_encoding(data: Record<string, any>): HbProofFields {
|
|
3233
|
+
/* eslint-disable dot-notation */
|
|
3234
|
+
return new HbProofFields({
|
|
3235
|
+
hbPk: data['hb-pk'],
|
|
3236
|
+
hbPk1sig: data['hb-pk1sig'],
|
|
3237
|
+
hbPk2: data['hb-pk2'],
|
|
3238
|
+
hbPk2sig: data['hb-pk2sig'],
|
|
3239
|
+
hbSig: data['hb-sig'],
|
|
3240
|
+
});
|
|
3241
|
+
/* eslint-enable dot-notation */
|
|
3242
|
+
}
|
|
3243
|
+
}
|
|
3244
|
+
|
|
3083
3245
|
/**
|
|
3084
3246
|
* A health check response.
|
|
3085
3247
|
*/
|
|
@@ -4195,6 +4357,13 @@ export class Transaction extends BaseModel {
|
|
|
4195
4357
|
*/
|
|
4196
4358
|
public group?: Uint8Array;
|
|
4197
4359
|
|
|
4360
|
+
/**
|
|
4361
|
+
* Fields for a heartbeat transaction.
|
|
4362
|
+
* Definition:
|
|
4363
|
+
* data/transactions/heartbeat.go : HeartbeatTxnFields
|
|
4364
|
+
*/
|
|
4365
|
+
public heartbeatTransaction?: TransactionHeartbeat;
|
|
4366
|
+
|
|
4198
4367
|
/**
|
|
4199
4368
|
* Transaction ID
|
|
4200
4369
|
*/
|
|
@@ -4295,6 +4464,7 @@ export class Transaction extends BaseModel {
|
|
|
4295
4464
|
* * (afrz) asset-freeze-transaction
|
|
4296
4465
|
* * (appl) application-transaction
|
|
4297
4466
|
* * (stpf) state-proof-transaction
|
|
4467
|
+
* * (hb) heartbeat-transaction
|
|
4298
4468
|
*/
|
|
4299
4469
|
public txType?: string;
|
|
4300
4470
|
|
|
@@ -4334,6 +4504,9 @@ export class Transaction extends BaseModel {
|
|
|
4334
4504
|
* @param group - (grp) Base64 encoded byte array of a sha512/256 digest. When present indicates
|
|
4335
4505
|
* that this transaction is part of a transaction group and the value is the
|
|
4336
4506
|
* sha512/256 hash of the transactions in that group.
|
|
4507
|
+
* @param heartbeatTransaction - Fields for a heartbeat transaction.
|
|
4508
|
+
* Definition:
|
|
4509
|
+
* data/transactions/heartbeat.go : HeartbeatTxnFields
|
|
4337
4510
|
* @param id - Transaction ID
|
|
4338
4511
|
* @param innerTxns - Inner transactions produced by application execution.
|
|
4339
4512
|
* @param intraRoundOffset - Offset into the round where this transaction was confirmed.
|
|
@@ -4373,6 +4546,7 @@ export class Transaction extends BaseModel {
|
|
|
4373
4546
|
* * (afrz) asset-freeze-transaction
|
|
4374
4547
|
* * (appl) application-transaction
|
|
4375
4548
|
* * (stpf) state-proof-transaction
|
|
4549
|
+
* * (hb) heartbeat-transaction
|
|
4376
4550
|
*/
|
|
4377
4551
|
constructor({
|
|
4378
4552
|
fee,
|
|
@@ -4393,6 +4567,7 @@ export class Transaction extends BaseModel {
|
|
|
4393
4567
|
genesisId,
|
|
4394
4568
|
globalStateDelta,
|
|
4395
4569
|
group,
|
|
4570
|
+
heartbeatTransaction,
|
|
4396
4571
|
id,
|
|
4397
4572
|
innerTxns,
|
|
4398
4573
|
intraRoundOffset,
|
|
@@ -4428,6 +4603,7 @@ export class Transaction extends BaseModel {
|
|
|
4428
4603
|
genesisId?: string;
|
|
4429
4604
|
globalStateDelta?: EvalDeltaKeyValue[];
|
|
4430
4605
|
group?: string | Uint8Array;
|
|
4606
|
+
heartbeatTransaction?: TransactionHeartbeat;
|
|
4431
4607
|
id?: string;
|
|
4432
4608
|
innerTxns?: Transaction[];
|
|
4433
4609
|
intraRoundOffset?: number | bigint;
|
|
@@ -4470,6 +4646,7 @@ export class Transaction extends BaseModel {
|
|
|
4470
4646
|
typeof group === 'string'
|
|
4471
4647
|
? new Uint8Array(Buffer.from(group, 'base64'))
|
|
4472
4648
|
: group;
|
|
4649
|
+
this.heartbeatTransaction = heartbeatTransaction;
|
|
4473
4650
|
this.id = id;
|
|
4474
4651
|
this.innerTxns = innerTxns;
|
|
4475
4652
|
this.intraRoundOffset = intraRoundOffset;
|
|
@@ -4512,6 +4689,7 @@ export class Transaction extends BaseModel {
|
|
|
4512
4689
|
genesisId: 'genesis-id',
|
|
4513
4690
|
globalStateDelta: 'global-state-delta',
|
|
4514
4691
|
group: 'group',
|
|
4692
|
+
heartbeatTransaction: 'heartbeat-transaction',
|
|
4515
4693
|
id: 'id',
|
|
4516
4694
|
innerTxns: 'inner-txns',
|
|
4517
4695
|
intraRoundOffset: 'intra-round-offset',
|
|
@@ -4590,6 +4768,12 @@ export class Transaction extends BaseModel {
|
|
|
4590
4768
|
)
|
|
4591
4769
|
: undefined,
|
|
4592
4770
|
group: data['group'],
|
|
4771
|
+
heartbeatTransaction:
|
|
4772
|
+
typeof data['heartbeat-transaction'] !== 'undefined'
|
|
4773
|
+
? TransactionHeartbeat.from_obj_for_encoding(
|
|
4774
|
+
data['heartbeat-transaction']
|
|
4775
|
+
)
|
|
4776
|
+
: undefined,
|
|
4593
4777
|
id: data['id'],
|
|
4594
4778
|
innerTxns:
|
|
4595
4779
|
typeof data['inner-txns'] !== 'undefined'
|
|
@@ -5094,6 +5278,116 @@ export class TransactionAssetTransfer extends BaseModel {
|
|
|
5094
5278
|
}
|
|
5095
5279
|
}
|
|
5096
5280
|
|
|
5281
|
+
/**
|
|
5282
|
+
* Fields for a heartbeat transaction.
|
|
5283
|
+
* Definition:
|
|
5284
|
+
* data/transactions/heartbeat.go : HeartbeatTxnFields
|
|
5285
|
+
*/
|
|
5286
|
+
export class TransactionHeartbeat extends BaseModel {
|
|
5287
|
+
/**
|
|
5288
|
+
* (hbad) HbAddress is the account this txn is proving onlineness for.
|
|
5289
|
+
*/
|
|
5290
|
+
public hbAddress: string;
|
|
5291
|
+
|
|
5292
|
+
/**
|
|
5293
|
+
* (hbkd) HbKeyDilution must match HbAddress account's current KeyDilution.
|
|
5294
|
+
*/
|
|
5295
|
+
public hbKeyDilution: number | bigint;
|
|
5296
|
+
|
|
5297
|
+
/**
|
|
5298
|
+
* (hbprf) HbProof is a signature using HeartbeatAddress's partkey, thereby showing
|
|
5299
|
+
* it is online.
|
|
5300
|
+
*/
|
|
5301
|
+
public hbProof: HbProofFields;
|
|
5302
|
+
|
|
5303
|
+
/**
|
|
5304
|
+
* (hbsd) HbSeed must be the block seed for the this transaction's firstValid
|
|
5305
|
+
* block.
|
|
5306
|
+
*/
|
|
5307
|
+
public hbSeed: Uint8Array;
|
|
5308
|
+
|
|
5309
|
+
/**
|
|
5310
|
+
* (hbvid) HbVoteID must match the HbAddress account's current VoteID.
|
|
5311
|
+
*/
|
|
5312
|
+
public hbVoteId: Uint8Array;
|
|
5313
|
+
|
|
5314
|
+
/**
|
|
5315
|
+
* Creates a new `TransactionHeartbeat` object.
|
|
5316
|
+
* @param hbAddress - (hbad) HbAddress is the account this txn is proving onlineness for.
|
|
5317
|
+
* @param hbKeyDilution - (hbkd) HbKeyDilution must match HbAddress account's current KeyDilution.
|
|
5318
|
+
* @param hbProof - (hbprf) HbProof is a signature using HeartbeatAddress's partkey, thereby showing
|
|
5319
|
+
* it is online.
|
|
5320
|
+
* @param hbSeed - (hbsd) HbSeed must be the block seed for the this transaction's firstValid
|
|
5321
|
+
* block.
|
|
5322
|
+
* @param hbVoteId - (hbvid) HbVoteID must match the HbAddress account's current VoteID.
|
|
5323
|
+
*/
|
|
5324
|
+
constructor({
|
|
5325
|
+
hbAddress,
|
|
5326
|
+
hbKeyDilution,
|
|
5327
|
+
hbProof,
|
|
5328
|
+
hbSeed,
|
|
5329
|
+
hbVoteId,
|
|
5330
|
+
}: {
|
|
5331
|
+
hbAddress: string;
|
|
5332
|
+
hbKeyDilution: number | bigint;
|
|
5333
|
+
hbProof: HbProofFields;
|
|
5334
|
+
hbSeed: string | Uint8Array;
|
|
5335
|
+
hbVoteId: string | Uint8Array;
|
|
5336
|
+
}) {
|
|
5337
|
+
super();
|
|
5338
|
+
this.hbAddress = hbAddress;
|
|
5339
|
+
this.hbKeyDilution = hbKeyDilution;
|
|
5340
|
+
this.hbProof = hbProof;
|
|
5341
|
+
this.hbSeed =
|
|
5342
|
+
typeof hbSeed === 'string'
|
|
5343
|
+
? new Uint8Array(Buffer.from(hbSeed, 'base64'))
|
|
5344
|
+
: hbSeed;
|
|
5345
|
+
this.hbVoteId =
|
|
5346
|
+
typeof hbVoteId === 'string'
|
|
5347
|
+
? new Uint8Array(Buffer.from(hbVoteId, 'base64'))
|
|
5348
|
+
: hbVoteId;
|
|
5349
|
+
|
|
5350
|
+
this.attribute_map = {
|
|
5351
|
+
hbAddress: 'hb-address',
|
|
5352
|
+
hbKeyDilution: 'hb-key-dilution',
|
|
5353
|
+
hbProof: 'hb-proof',
|
|
5354
|
+
hbSeed: 'hb-seed',
|
|
5355
|
+
hbVoteId: 'hb-vote-id',
|
|
5356
|
+
};
|
|
5357
|
+
}
|
|
5358
|
+
|
|
5359
|
+
// eslint-disable-next-line camelcase
|
|
5360
|
+
static from_obj_for_encoding(
|
|
5361
|
+
data: Record<string, any>
|
|
5362
|
+
): TransactionHeartbeat {
|
|
5363
|
+
/* eslint-disable dot-notation */
|
|
5364
|
+
if (typeof data['hb-address'] === 'undefined')
|
|
5365
|
+
throw new Error(
|
|
5366
|
+
`Response is missing required field 'hb-address': ${data}`
|
|
5367
|
+
);
|
|
5368
|
+
if (typeof data['hb-key-dilution'] === 'undefined')
|
|
5369
|
+
throw new Error(
|
|
5370
|
+
`Response is missing required field 'hb-key-dilution': ${data}`
|
|
5371
|
+
);
|
|
5372
|
+
if (typeof data['hb-proof'] === 'undefined')
|
|
5373
|
+
throw new Error(`Response is missing required field 'hb-proof': ${data}`);
|
|
5374
|
+
if (typeof data['hb-seed'] === 'undefined')
|
|
5375
|
+
throw new Error(`Response is missing required field 'hb-seed': ${data}`);
|
|
5376
|
+
if (typeof data['hb-vote-id'] === 'undefined')
|
|
5377
|
+
throw new Error(
|
|
5378
|
+
`Response is missing required field 'hb-vote-id': ${data}`
|
|
5379
|
+
);
|
|
5380
|
+
return new TransactionHeartbeat({
|
|
5381
|
+
hbAddress: data['hb-address'],
|
|
5382
|
+
hbKeyDilution: data['hb-key-dilution'],
|
|
5383
|
+
hbProof: HbProofFields.from_obj_for_encoding(data['hb-proof']),
|
|
5384
|
+
hbSeed: data['hb-seed'],
|
|
5385
|
+
hbVoteId: data['hb-vote-id'],
|
|
5386
|
+
});
|
|
5387
|
+
/* eslint-enable dot-notation */
|
|
5388
|
+
}
|
|
5389
|
+
}
|
|
5390
|
+
|
|
5097
5391
|
/**
|
|
5098
5392
|
* Fields for a keyreg transaction.
|
|
5099
5393
|
* Definition:
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import JSONRequest from '../jsonrequest';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Returns information about indexed block headers.
|
|
5
|
+
*
|
|
6
|
+
* #### Example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* const bhs = await indexerClient.searchForBlockHeaders().do();
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/indexer/#get-v2block-headers)
|
|
12
|
+
* @category GET
|
|
13
|
+
*/
|
|
14
|
+
export default class SearchForBlockHeaders extends JSONRequest {
|
|
15
|
+
/**
|
|
16
|
+
* @returns `/v2/block-headers`
|
|
17
|
+
*/
|
|
18
|
+
// eslint-disable-next-line class-methods-use-this
|
|
19
|
+
path() {
|
|
20
|
+
return '/v2/block-headers';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Accounts marked as absent in the block header's participation updates.
|
|
25
|
+
*
|
|
26
|
+
* #### Example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const address1 = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
29
|
+
* const address2 = "4H5UNRBJ2Q6JENAXQ6HNTGKLKINP4J4VTQBEPK5F3I6RDICMZBPGNH6KD4";
|
|
30
|
+
* const bhs = await indexerClient
|
|
31
|
+
* .searchForBlockHeaders()
|
|
32
|
+
* .absent([address1,address2])
|
|
33
|
+
* .do();
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @param absent - a comma separated list of addresses
|
|
37
|
+
* @category query
|
|
38
|
+
*/
|
|
39
|
+
absent(absent: string[]) {
|
|
40
|
+
this.query.absent = absent;
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Include results after the given time.
|
|
46
|
+
*
|
|
47
|
+
* #### Example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const afterTime = "2022-10-21T00:00:11.55Z";
|
|
50
|
+
* const bhs = await indexerClient
|
|
51
|
+
* .searchForBlockHeaders()
|
|
52
|
+
* .afterTime(afterTime)
|
|
53
|
+
* .do();
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @param after - rfc3339 string
|
|
57
|
+
* @category query
|
|
58
|
+
*/
|
|
59
|
+
afterTime(after: string) {
|
|
60
|
+
this.query['after-time'] = after;
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Include results before the given time.
|
|
66
|
+
*
|
|
67
|
+
* #### Example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const beforeTime = "2022-02-02T20:20:22.02Z";
|
|
70
|
+
* const bhs = await indexerClient
|
|
71
|
+
* .searchForBlockHeaders()
|
|
72
|
+
* .beforeTime(beforeTime)
|
|
73
|
+
* .do();
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @param before - rfc3339 string
|
|
77
|
+
* @category query
|
|
78
|
+
*/
|
|
79
|
+
beforeTime(before: string) {
|
|
80
|
+
this.query['before-time'] = before;
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Accounts marked as expired in the block header's participation updates.
|
|
86
|
+
*
|
|
87
|
+
* #### Example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const address1 = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
90
|
+
* const address2 = "4H5UNRBJ2Q6JENAXQ6HNTGKLKINP4J4VTQBEPK5F3I6RDICMZBPGNH6KD4";
|
|
91
|
+
* const bhs = await indexerClient
|
|
92
|
+
* .searchForBlockHeaders()
|
|
93
|
+
* .expired([address1,address2])
|
|
94
|
+
* .do();
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* @param expired - - a comma separated list of addresses
|
|
98
|
+
* @category query
|
|
99
|
+
*/
|
|
100
|
+
expired(expired: string[]) {
|
|
101
|
+
this.query.expired = expired;
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Maximum number of results to return.
|
|
107
|
+
*
|
|
108
|
+
* #### Example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* const maxResults = 25;
|
|
111
|
+
* const bhs = await indexerClient
|
|
112
|
+
* .searchForBlockHeaders()
|
|
113
|
+
* .limit(maxResults)
|
|
114
|
+
* .do();
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
* @param limit
|
|
118
|
+
* @category query
|
|
119
|
+
*/
|
|
120
|
+
limit(limit: number) {
|
|
121
|
+
this.query.limit = limit;
|
|
122
|
+
return this;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Include results at or before the specified max-round.
|
|
127
|
+
*
|
|
128
|
+
* #### Example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* const maxRound = 18309917;
|
|
131
|
+
* const bhs = await indexerClient
|
|
132
|
+
* .searchForBlockHeaders()
|
|
133
|
+
* .maxRound(maxRound)
|
|
134
|
+
* .do();
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
* @param round
|
|
138
|
+
* @category query
|
|
139
|
+
*/
|
|
140
|
+
maxRound(round: number) {
|
|
141
|
+
this.query['max-round'] = round;
|
|
142
|
+
return this;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Include results at or after the specified min-round.
|
|
147
|
+
*
|
|
148
|
+
* #### Example
|
|
149
|
+
* ```typescript
|
|
150
|
+
* const minRound = 18309917;
|
|
151
|
+
* const bhs = await indexerClient
|
|
152
|
+
* .searchForBlockHeaders()
|
|
153
|
+
* .minRound(minRound)
|
|
154
|
+
* .do();
|
|
155
|
+
* ```
|
|
156
|
+
*
|
|
157
|
+
* @param round
|
|
158
|
+
* @category query
|
|
159
|
+
*/
|
|
160
|
+
minRound(round: number) {
|
|
161
|
+
this.query['min-round'] = round;
|
|
162
|
+
return this;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* The next page of results.
|
|
167
|
+
*
|
|
168
|
+
* #### Example
|
|
169
|
+
* ```typescript
|
|
170
|
+
* const maxResults = 25;
|
|
171
|
+
*
|
|
172
|
+
* const bh1 = await indexerClient
|
|
173
|
+
* .searchForBlockHeaders()
|
|
174
|
+
* .limit(maxResults)
|
|
175
|
+
* .do();
|
|
176
|
+
*
|
|
177
|
+
* const bh2 = await indexerClient
|
|
178
|
+
* .searchForBlockHeaders()
|
|
179
|
+
* .limit(maxResults)
|
|
180
|
+
* .nextToken(bh1["next-token"])
|
|
181
|
+
* .do();
|
|
182
|
+
* ```
|
|
183
|
+
*
|
|
184
|
+
* @param nextToken - provided by the previous results
|
|
185
|
+
* @category query
|
|
186
|
+
*/
|
|
187
|
+
nextToken(nextToken: string) {
|
|
188
|
+
this.query.next = nextToken;
|
|
189
|
+
return this;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Accounts marked as proposer in the block header's participation updates.
|
|
194
|
+
*
|
|
195
|
+
* #### Example
|
|
196
|
+
* ```typescript
|
|
197
|
+
* const address1 = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
198
|
+
* const address2 = "4H5UNRBJ2Q6JENAXQ6HNTGKLKINP4J4VTQBEPK5F3I6RDICMZBPGNH6KD4";
|
|
199
|
+
* const bhs = await indexerClient
|
|
200
|
+
* .searchForBlockHeaders()
|
|
201
|
+
* .proposers([address1,address2])
|
|
202
|
+
* .do();
|
|
203
|
+
* ```
|
|
204
|
+
*
|
|
205
|
+
* @param proposers - a comma separated list of addresses
|
|
206
|
+
* @category query
|
|
207
|
+
*/
|
|
208
|
+
proposers(proposers: string[]) {
|
|
209
|
+
this.query.proposers = proposers;
|
|
210
|
+
return this;
|
|
211
|
+
}
|
|
212
|
+
}
|