algosdk 3.3.0 → 3.4.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 +5 -5
- package/dist/browser/algosdk.min.js +1 -1
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/client/v2/algod/getApplicationBoxes.js +1 -58
- package/dist/cjs/client/v2/algod/getApplicationBoxes.js.map +1 -1
- package/dist/cjs/client/v2/algod/getTransactionProof.js +1 -1
- package/dist/cjs/client/v2/algod/getTransactionProof.js.map +1 -1
- package/dist/cjs/client/v2/algod/models/types.js +53 -35
- package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
- package/dist/cjs/client/v2/indexer/models/types.js +75 -3
- package/dist/cjs/client/v2/indexer/models/types.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchForTransactions.js +19 -0
- package/dist/cjs/client/v2/indexer/searchForTransactions.js.map +1 -1
- package/dist/cjs/encoding/schema/bytearray.js +3 -0
- package/dist/cjs/encoding/schema/bytearray.js.map +1 -1
- package/dist/esm/client/v2/algod/getApplicationBoxes.js +1 -58
- package/dist/esm/client/v2/algod/getApplicationBoxes.js.map +1 -1
- package/dist/esm/client/v2/algod/getTransactionProof.js +2 -2
- package/dist/esm/client/v2/algod/getTransactionProof.js.map +1 -1
- package/dist/esm/client/v2/algod/models/types.js +49 -32
- package/dist/esm/client/v2/algod/models/types.js.map +1 -1
- package/dist/esm/client/v2/indexer/models/types.js +72 -1
- package/dist/esm/client/v2/indexer/models/types.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchForTransactions.js +19 -0
- package/dist/esm/client/v2/indexer/searchForTransactions.js.map +1 -1
- package/dist/esm/encoding/schema/bytearray.js +3 -0
- package/dist/esm/encoding/schema/bytearray.js.map +1 -1
- package/dist/types/client/v2/algod/getApplicationBoxes.d.ts +1 -49
- package/dist/types/client/v2/algod/getTransactionProof.d.ts +3 -3
- package/dist/types/client/v2/algod/models/types.d.ts +32 -25
- package/dist/types/client/v2/indexer/models/types.d.ts +46 -1
- package/dist/types/client/v2/indexer/searchForTransactions.d.ts +16 -0
- package/package.json +2 -2
- package/src/client/v2/algod/getApplicationBoxes.ts +1 -61
- package/src/client/v2/algod/getTransactionProof.ts +4 -4
- package/src/client/v2/algod/models/types.ts +72 -66
- package/src/client/v2/indexer/models/types.ts +119 -0
- package/src/client/v2/indexer/searchForTransactions.ts +20 -0
- package/src/encoding/schema/bytearray.ts +3 -0
|
@@ -3113,16 +3113,8 @@ export class Box implements Encodable {
|
|
|
3113
3113
|
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
3114
3114
|
(this.encodingSchemaValue as NamedMapSchema).pushEntries(
|
|
3115
3115
|
{ key: 'name', valueSchema: new ByteArraySchema(), omitEmpty: true },
|
|
3116
|
-
{
|
|
3117
|
-
|
|
3118
|
-
valueSchema: new OptionalSchema(new Uint64Schema()),
|
|
3119
|
-
omitEmpty: true,
|
|
3120
|
-
},
|
|
3121
|
-
{
|
|
3122
|
-
key: 'value',
|
|
3123
|
-
valueSchema: new OptionalSchema(new ByteArraySchema()),
|
|
3124
|
-
omitEmpty: true,
|
|
3125
|
-
}
|
|
3116
|
+
{ key: 'round', valueSchema: new Uint64Schema(), omitEmpty: true },
|
|
3117
|
+
{ key: 'value', valueSchema: new ByteArraySchema(), omitEmpty: true }
|
|
3126
3118
|
);
|
|
3127
3119
|
}
|
|
3128
3120
|
return this.encodingSchemaValue;
|
|
@@ -3136,12 +3128,12 @@ export class Box implements Encodable {
|
|
|
3136
3128
|
/**
|
|
3137
3129
|
* The round for which this information is relevant
|
|
3138
3130
|
*/
|
|
3139
|
-
public round
|
|
3131
|
+
public round: bigint;
|
|
3140
3132
|
|
|
3141
3133
|
/**
|
|
3142
3134
|
* The box value, base64 encoded.
|
|
3143
3135
|
*/
|
|
3144
|
-
public value
|
|
3136
|
+
public value: Uint8Array;
|
|
3145
3137
|
|
|
3146
3138
|
/**
|
|
3147
3139
|
* Creates a new `Box` object.
|
|
@@ -3155,11 +3147,11 @@ export class Box implements Encodable {
|
|
|
3155
3147
|
value,
|
|
3156
3148
|
}: {
|
|
3157
3149
|
name: string | Uint8Array;
|
|
3158
|
-
round
|
|
3159
|
-
value
|
|
3150
|
+
round: number | bigint;
|
|
3151
|
+
value: string | Uint8Array;
|
|
3160
3152
|
}) {
|
|
3161
3153
|
this.name = typeof name === 'string' ? base64ToBytes(name) : name;
|
|
3162
|
-
this.round =
|
|
3154
|
+
this.round = ensureBigInt(round);
|
|
3163
3155
|
this.value = typeof value === 'string' ? base64ToBytes(value) : value;
|
|
3164
3156
|
}
|
|
3165
3157
|
|
|
@@ -3188,6 +3180,56 @@ export class Box implements Encodable {
|
|
|
3188
3180
|
}
|
|
3189
3181
|
}
|
|
3190
3182
|
|
|
3183
|
+
/**
|
|
3184
|
+
* Box descriptor describes a Box.
|
|
3185
|
+
*/
|
|
3186
|
+
export class BoxDescriptor implements Encodable {
|
|
3187
|
+
private static encodingSchemaValue: Schema | undefined;
|
|
3188
|
+
|
|
3189
|
+
static get encodingSchema(): Schema {
|
|
3190
|
+
if (!this.encodingSchemaValue) {
|
|
3191
|
+
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
3192
|
+
(this.encodingSchemaValue as NamedMapSchema).pushEntries({
|
|
3193
|
+
key: 'name',
|
|
3194
|
+
valueSchema: new ByteArraySchema(),
|
|
3195
|
+
omitEmpty: true,
|
|
3196
|
+
});
|
|
3197
|
+
}
|
|
3198
|
+
return this.encodingSchemaValue;
|
|
3199
|
+
}
|
|
3200
|
+
|
|
3201
|
+
/**
|
|
3202
|
+
* Base64 encoded box name
|
|
3203
|
+
*/
|
|
3204
|
+
public name: Uint8Array;
|
|
3205
|
+
|
|
3206
|
+
/**
|
|
3207
|
+
* Creates a new `BoxDescriptor` object.
|
|
3208
|
+
* @param name - Base64 encoded box name
|
|
3209
|
+
*/
|
|
3210
|
+
constructor({ name }: { name: string | Uint8Array }) {
|
|
3211
|
+
this.name = typeof name === 'string' ? base64ToBytes(name) : name;
|
|
3212
|
+
}
|
|
3213
|
+
|
|
3214
|
+
// eslint-disable-next-line class-methods-use-this
|
|
3215
|
+
getEncodingSchema(): Schema {
|
|
3216
|
+
return BoxDescriptor.encodingSchema;
|
|
3217
|
+
}
|
|
3218
|
+
|
|
3219
|
+
toEncodingData(): Map<string, unknown> {
|
|
3220
|
+
return new Map<string, unknown>([['name', this.name]]);
|
|
3221
|
+
}
|
|
3222
|
+
|
|
3223
|
+
static fromEncodingData(data: unknown): BoxDescriptor {
|
|
3224
|
+
if (!(data instanceof Map)) {
|
|
3225
|
+
throw new Error(`Invalid decoded BoxDescriptor: ${data}`);
|
|
3226
|
+
}
|
|
3227
|
+
return new BoxDescriptor({
|
|
3228
|
+
name: data.get('name'),
|
|
3229
|
+
});
|
|
3230
|
+
}
|
|
3231
|
+
}
|
|
3232
|
+
|
|
3191
3233
|
/**
|
|
3192
3234
|
* References a box of an application.
|
|
3193
3235
|
*/
|
|
@@ -3255,7 +3297,7 @@ export class BoxReference implements Encodable {
|
|
|
3255
3297
|
}
|
|
3256
3298
|
|
|
3257
3299
|
/**
|
|
3258
|
-
*
|
|
3300
|
+
* Box names of an application
|
|
3259
3301
|
*/
|
|
3260
3302
|
export class BoxesResponse implements Encodable {
|
|
3261
3303
|
private static encodingSchemaValue: Schema | undefined;
|
|
@@ -3263,55 +3305,23 @@ export class BoxesResponse implements Encodable {
|
|
|
3263
3305
|
static get encodingSchema(): Schema {
|
|
3264
3306
|
if (!this.encodingSchemaValue) {
|
|
3265
3307
|
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
3266
|
-
(this.encodingSchemaValue as NamedMapSchema).pushEntries(
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
},
|
|
3272
|
-
{ key: 'round', valueSchema: new Uint64Schema(), omitEmpty: true },
|
|
3273
|
-
{
|
|
3274
|
-
key: 'next-token',
|
|
3275
|
-
valueSchema: new OptionalSchema(new StringSchema()),
|
|
3276
|
-
omitEmpty: true,
|
|
3277
|
-
}
|
|
3278
|
-
);
|
|
3308
|
+
(this.encodingSchemaValue as NamedMapSchema).pushEntries({
|
|
3309
|
+
key: 'boxes',
|
|
3310
|
+
valueSchema: new ArraySchema(BoxDescriptor.encodingSchema),
|
|
3311
|
+
omitEmpty: true,
|
|
3312
|
+
});
|
|
3279
3313
|
}
|
|
3280
3314
|
return this.encodingSchemaValue;
|
|
3281
3315
|
}
|
|
3282
3316
|
|
|
3283
|
-
public boxes:
|
|
3284
|
-
|
|
3285
|
-
/**
|
|
3286
|
-
* The round for which this information is relevant.
|
|
3287
|
-
*/
|
|
3288
|
-
public round: number;
|
|
3289
|
-
|
|
3290
|
-
/**
|
|
3291
|
-
* Used for pagination, when making another request provide this token with the
|
|
3292
|
-
* next parameter.
|
|
3293
|
-
*/
|
|
3294
|
-
public nextToken?: string;
|
|
3317
|
+
public boxes: BoxDescriptor[];
|
|
3295
3318
|
|
|
3296
3319
|
/**
|
|
3297
3320
|
* Creates a new `BoxesResponse` object.
|
|
3298
3321
|
* @param boxes -
|
|
3299
|
-
* @param round - The round for which this information is relevant.
|
|
3300
|
-
* @param nextToken - Used for pagination, when making another request provide this token with the
|
|
3301
|
-
* next parameter.
|
|
3302
3322
|
*/
|
|
3303
|
-
constructor({
|
|
3304
|
-
boxes,
|
|
3305
|
-
round,
|
|
3306
|
-
nextToken,
|
|
3307
|
-
}: {
|
|
3308
|
-
boxes: Box[];
|
|
3309
|
-
round: number | bigint;
|
|
3310
|
-
nextToken?: string;
|
|
3311
|
-
}) {
|
|
3323
|
+
constructor({ boxes }: { boxes: BoxDescriptor[] }) {
|
|
3312
3324
|
this.boxes = boxes;
|
|
3313
|
-
this.round = ensureSafeInteger(round);
|
|
3314
|
-
this.nextToken = nextToken;
|
|
3315
3325
|
}
|
|
3316
3326
|
|
|
3317
3327
|
// eslint-disable-next-line class-methods-use-this
|
|
@@ -3322,8 +3332,6 @@ export class BoxesResponse implements Encodable {
|
|
|
3322
3332
|
toEncodingData(): Map<string, unknown> {
|
|
3323
3333
|
return new Map<string, unknown>([
|
|
3324
3334
|
['boxes', this.boxes.map((v) => v.toEncodingData())],
|
|
3325
|
-
['round', this.round],
|
|
3326
|
-
['next-token', this.nextToken],
|
|
3327
3335
|
]);
|
|
3328
3336
|
}
|
|
3329
3337
|
|
|
@@ -3333,10 +3341,8 @@ export class BoxesResponse implements Encodable {
|
|
|
3333
3341
|
}
|
|
3334
3342
|
return new BoxesResponse({
|
|
3335
3343
|
boxes: (data.get('boxes') ?? []).map((v: unknown) =>
|
|
3336
|
-
|
|
3344
|
+
BoxDescriptor.fromEncodingData(v)
|
|
3337
3345
|
),
|
|
3338
|
-
round: data.get('round'),
|
|
3339
|
-
nextToken: data.get('next-token'),
|
|
3340
3346
|
});
|
|
3341
3347
|
}
|
|
3342
3348
|
}
|
|
@@ -8433,7 +8439,7 @@ export class TransactionParametersResponse implements Encodable {
|
|
|
8433
8439
|
/**
|
|
8434
8440
|
* Proof of transaction in a block.
|
|
8435
8441
|
*/
|
|
8436
|
-
export class
|
|
8442
|
+
export class TransactionProof implements Encodable {
|
|
8437
8443
|
private static encodingSchemaValue: Schema | undefined;
|
|
8438
8444
|
|
|
8439
8445
|
static get encodingSchema(): Schema {
|
|
@@ -8487,7 +8493,7 @@ export class TransactionProofResponse implements Encodable {
|
|
|
8487
8493
|
public hashtype?: string;
|
|
8488
8494
|
|
|
8489
8495
|
/**
|
|
8490
|
-
* Creates a new `
|
|
8496
|
+
* Creates a new `TransactionProof` object.
|
|
8491
8497
|
* @param idx - Index of the transaction in the block's payset.
|
|
8492
8498
|
* @param proof - Proof of transaction membership.
|
|
8493
8499
|
* @param stibhash - Hash of SignedTxnInBlock for verifying proof.
|
|
@@ -8520,7 +8526,7 @@ export class TransactionProofResponse implements Encodable {
|
|
|
8520
8526
|
|
|
8521
8527
|
// eslint-disable-next-line class-methods-use-this
|
|
8522
8528
|
getEncodingSchema(): Schema {
|
|
8523
|
-
return
|
|
8529
|
+
return TransactionProof.encodingSchema;
|
|
8524
8530
|
}
|
|
8525
8531
|
|
|
8526
8532
|
toEncodingData(): Map<string, unknown> {
|
|
@@ -8533,11 +8539,11 @@ export class TransactionProofResponse implements Encodable {
|
|
|
8533
8539
|
]);
|
|
8534
8540
|
}
|
|
8535
8541
|
|
|
8536
|
-
static fromEncodingData(data: unknown):
|
|
8542
|
+
static fromEncodingData(data: unknown): TransactionProof {
|
|
8537
8543
|
if (!(data instanceof Map)) {
|
|
8538
|
-
throw new Error(`Invalid decoded
|
|
8544
|
+
throw new Error(`Invalid decoded TransactionProof: ${data}`);
|
|
8539
8545
|
}
|
|
8540
|
-
return new
|
|
8546
|
+
return new TransactionProof({
|
|
8541
8547
|
idx: data.get('idx'),
|
|
8542
8548
|
proof: data.get('proof'),
|
|
8543
8549
|
stibhash: data.get('stibhash'),
|
|
@@ -4016,6 +4016,74 @@ export class BoxDescriptor implements Encodable {
|
|
|
4016
4016
|
}
|
|
4017
4017
|
}
|
|
4018
4018
|
|
|
4019
|
+
/**
|
|
4020
|
+
* BoxReference names a box by its name and the application ID it belongs to.
|
|
4021
|
+
*/
|
|
4022
|
+
export class BoxReference implements Encodable {
|
|
4023
|
+
private static encodingSchemaValue: Schema | undefined;
|
|
4024
|
+
|
|
4025
|
+
static get encodingSchema(): Schema {
|
|
4026
|
+
if (!this.encodingSchemaValue) {
|
|
4027
|
+
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
4028
|
+
(this.encodingSchemaValue as NamedMapSchema).pushEntries(
|
|
4029
|
+
{ key: 'app', valueSchema: new Uint64Schema(), omitEmpty: true },
|
|
4030
|
+
{ key: 'name', valueSchema: new ByteArraySchema(), omitEmpty: true }
|
|
4031
|
+
);
|
|
4032
|
+
}
|
|
4033
|
+
return this.encodingSchemaValue;
|
|
4034
|
+
}
|
|
4035
|
+
|
|
4036
|
+
/**
|
|
4037
|
+
* Application ID to which the box belongs, or zero if referring to the called
|
|
4038
|
+
* application.
|
|
4039
|
+
*/
|
|
4040
|
+
public app: number;
|
|
4041
|
+
|
|
4042
|
+
/**
|
|
4043
|
+
* Base64 encoded box name
|
|
4044
|
+
*/
|
|
4045
|
+
public name: Uint8Array;
|
|
4046
|
+
|
|
4047
|
+
/**
|
|
4048
|
+
* Creates a new `BoxReference` object.
|
|
4049
|
+
* @param app - Application ID to which the box belongs, or zero if referring to the called
|
|
4050
|
+
* application.
|
|
4051
|
+
* @param name - Base64 encoded box name
|
|
4052
|
+
*/
|
|
4053
|
+
constructor({
|
|
4054
|
+
app,
|
|
4055
|
+
name,
|
|
4056
|
+
}: {
|
|
4057
|
+
app: number | bigint;
|
|
4058
|
+
name: string | Uint8Array;
|
|
4059
|
+
}) {
|
|
4060
|
+
this.app = ensureSafeInteger(app);
|
|
4061
|
+
this.name = typeof name === 'string' ? base64ToBytes(name) : name;
|
|
4062
|
+
}
|
|
4063
|
+
|
|
4064
|
+
// eslint-disable-next-line class-methods-use-this
|
|
4065
|
+
getEncodingSchema(): Schema {
|
|
4066
|
+
return BoxReference.encodingSchema;
|
|
4067
|
+
}
|
|
4068
|
+
|
|
4069
|
+
toEncodingData(): Map<string, unknown> {
|
|
4070
|
+
return new Map<string, unknown>([
|
|
4071
|
+
['app', this.app],
|
|
4072
|
+
['name', this.name],
|
|
4073
|
+
]);
|
|
4074
|
+
}
|
|
4075
|
+
|
|
4076
|
+
static fromEncodingData(data: unknown): BoxReference {
|
|
4077
|
+
if (!(data instanceof Map)) {
|
|
4078
|
+
throw new Error(`Invalid decoded BoxReference: ${data}`);
|
|
4079
|
+
}
|
|
4080
|
+
return new BoxReference({
|
|
4081
|
+
app: data.get('app'),
|
|
4082
|
+
name: data.get('name'),
|
|
4083
|
+
});
|
|
4084
|
+
}
|
|
4085
|
+
}
|
|
4086
|
+
|
|
4019
4087
|
/**
|
|
4020
4088
|
* Box names of an application
|
|
4021
4089
|
*/
|
|
@@ -6909,6 +6977,13 @@ export class TransactionApplication implements Encodable {
|
|
|
6909
6977
|
valueSchema: new OptionalSchema(new ByteArraySchema()),
|
|
6910
6978
|
omitEmpty: true,
|
|
6911
6979
|
},
|
|
6980
|
+
{
|
|
6981
|
+
key: 'box-references',
|
|
6982
|
+
valueSchema: new OptionalSchema(
|
|
6983
|
+
new ArraySchema(BoxReference.encodingSchema)
|
|
6984
|
+
),
|
|
6985
|
+
omitEmpty: true,
|
|
6986
|
+
},
|
|
6912
6987
|
{
|
|
6913
6988
|
key: 'clear-state-program',
|
|
6914
6989
|
valueSchema: new OptionalSchema(new ByteArraySchema()),
|
|
@@ -6943,6 +7018,11 @@ export class TransactionApplication implements Encodable {
|
|
|
6943
7018
|
key: 'on-completion',
|
|
6944
7019
|
valueSchema: new OptionalSchema(new StringSchema()),
|
|
6945
7020
|
omitEmpty: true,
|
|
7021
|
+
},
|
|
7022
|
+
{
|
|
7023
|
+
key: 'reject-version',
|
|
7024
|
+
valueSchema: new OptionalSchema(new Uint64Schema()),
|
|
7025
|
+
omitEmpty: true,
|
|
6946
7026
|
}
|
|
6947
7027
|
);
|
|
6948
7028
|
}
|
|
@@ -6974,6 +7054,12 @@ export class TransactionApplication implements Encodable {
|
|
|
6974
7054
|
*/
|
|
6975
7055
|
public approvalProgram?: Uint8Array;
|
|
6976
7056
|
|
|
7057
|
+
/**
|
|
7058
|
+
* (apbx) the boxes that can be accessed by this transaction (and others in the
|
|
7059
|
+
* same group).
|
|
7060
|
+
*/
|
|
7061
|
+
public boxReferences?: BoxReference[];
|
|
7062
|
+
|
|
6977
7063
|
/**
|
|
6978
7064
|
* (apsu) Logic executed for application transactions with on-completion set to
|
|
6979
7065
|
* "clear". It can read and write global state for the application, as well as
|
|
@@ -7029,6 +7115,12 @@ export class TransactionApplication implements Encodable {
|
|
|
7029
7115
|
*/
|
|
7030
7116
|
public onCompletion?: string;
|
|
7031
7117
|
|
|
7118
|
+
/**
|
|
7119
|
+
* (aprv) the lowest application version for which this transaction should
|
|
7120
|
+
* immediately fail. 0 indicates that no version check should be performed.
|
|
7121
|
+
*/
|
|
7122
|
+
public rejectVersion?: number;
|
|
7123
|
+
|
|
7032
7124
|
/**
|
|
7033
7125
|
* Creates a new `TransactionApplication` object.
|
|
7034
7126
|
* @param applicationId - (apid) ID of the application being configured or empty if creating.
|
|
@@ -7040,6 +7132,8 @@ export class TransactionApplication implements Encodable {
|
|
|
7040
7132
|
* on-completion is set to "clear". It can read and write global state for the
|
|
7041
7133
|
* application, as well as account-specific local state. Approval programs may
|
|
7042
7134
|
* reject the transaction.
|
|
7135
|
+
* @param boxReferences - (apbx) the boxes that can be accessed by this transaction (and others in the
|
|
7136
|
+
* same group).
|
|
7043
7137
|
* @param clearStateProgram - (apsu) Logic executed for application transactions with on-completion set to
|
|
7044
7138
|
* "clear". It can read and write global state for the application, as well as
|
|
7045
7139
|
* account-specific local state. Clear state programs cannot reject the
|
|
@@ -7067,12 +7161,15 @@ export class TransactionApplication implements Encodable {
|
|
|
7067
7161
|
* * update
|
|
7068
7162
|
* * update
|
|
7069
7163
|
* * delete
|
|
7164
|
+
* @param rejectVersion - (aprv) the lowest application version for which this transaction should
|
|
7165
|
+
* immediately fail. 0 indicates that no version check should be performed.
|
|
7070
7166
|
*/
|
|
7071
7167
|
constructor({
|
|
7072
7168
|
applicationId,
|
|
7073
7169
|
accounts,
|
|
7074
7170
|
applicationArgs,
|
|
7075
7171
|
approvalProgram,
|
|
7172
|
+
boxReferences,
|
|
7076
7173
|
clearStateProgram,
|
|
7077
7174
|
extraProgramPages,
|
|
7078
7175
|
foreignApps,
|
|
@@ -7080,11 +7177,13 @@ export class TransactionApplication implements Encodable {
|
|
|
7080
7177
|
globalStateSchema,
|
|
7081
7178
|
localStateSchema,
|
|
7082
7179
|
onCompletion,
|
|
7180
|
+
rejectVersion,
|
|
7083
7181
|
}: {
|
|
7084
7182
|
applicationId: number | bigint;
|
|
7085
7183
|
accounts?: (Address | string)[];
|
|
7086
7184
|
applicationArgs?: Uint8Array[];
|
|
7087
7185
|
approvalProgram?: string | Uint8Array;
|
|
7186
|
+
boxReferences?: BoxReference[];
|
|
7088
7187
|
clearStateProgram?: string | Uint8Array;
|
|
7089
7188
|
extraProgramPages?: number | bigint;
|
|
7090
7189
|
foreignApps?: (number | bigint)[];
|
|
@@ -7092,6 +7191,7 @@ export class TransactionApplication implements Encodable {
|
|
|
7092
7191
|
globalStateSchema?: StateSchema;
|
|
7093
7192
|
localStateSchema?: StateSchema;
|
|
7094
7193
|
onCompletion?: string;
|
|
7194
|
+
rejectVersion?: number | bigint;
|
|
7095
7195
|
}) {
|
|
7096
7196
|
this.applicationId = ensureBigInt(applicationId);
|
|
7097
7197
|
this.accounts =
|
|
@@ -7105,6 +7205,7 @@ export class TransactionApplication implements Encodable {
|
|
|
7105
7205
|
typeof approvalProgram === 'string'
|
|
7106
7206
|
? base64ToBytes(approvalProgram)
|
|
7107
7207
|
: approvalProgram;
|
|
7208
|
+
this.boxReferences = boxReferences;
|
|
7108
7209
|
this.clearStateProgram =
|
|
7109
7210
|
typeof clearStateProgram === 'string'
|
|
7110
7211
|
? base64ToBytes(clearStateProgram)
|
|
@@ -7124,6 +7225,10 @@ export class TransactionApplication implements Encodable {
|
|
|
7124
7225
|
this.globalStateSchema = globalStateSchema;
|
|
7125
7226
|
this.localStateSchema = localStateSchema;
|
|
7126
7227
|
this.onCompletion = onCompletion;
|
|
7228
|
+
this.rejectVersion =
|
|
7229
|
+
typeof rejectVersion === 'undefined'
|
|
7230
|
+
? undefined
|
|
7231
|
+
: ensureSafeInteger(rejectVersion);
|
|
7127
7232
|
}
|
|
7128
7233
|
|
|
7129
7234
|
// eslint-disable-next-line class-methods-use-this
|
|
@@ -7142,6 +7247,12 @@ export class TransactionApplication implements Encodable {
|
|
|
7142
7247
|
],
|
|
7143
7248
|
['application-args', this.applicationArgs],
|
|
7144
7249
|
['approval-program', this.approvalProgram],
|
|
7250
|
+
[
|
|
7251
|
+
'box-references',
|
|
7252
|
+
typeof this.boxReferences !== 'undefined'
|
|
7253
|
+
? this.boxReferences.map((v) => v.toEncodingData())
|
|
7254
|
+
: undefined,
|
|
7255
|
+
],
|
|
7145
7256
|
['clear-state-program', this.clearStateProgram],
|
|
7146
7257
|
['extra-program-pages', this.extraProgramPages],
|
|
7147
7258
|
['foreign-apps', this.foreignApps],
|
|
@@ -7159,6 +7270,7 @@ export class TransactionApplication implements Encodable {
|
|
|
7159
7270
|
: undefined,
|
|
7160
7271
|
],
|
|
7161
7272
|
['on-completion', this.onCompletion],
|
|
7273
|
+
['reject-version', this.rejectVersion],
|
|
7162
7274
|
]);
|
|
7163
7275
|
}
|
|
7164
7276
|
|
|
@@ -7171,6 +7283,12 @@ export class TransactionApplication implements Encodable {
|
|
|
7171
7283
|
accounts: data.get('accounts'),
|
|
7172
7284
|
applicationArgs: data.get('application-args'),
|
|
7173
7285
|
approvalProgram: data.get('approval-program'),
|
|
7286
|
+
boxReferences:
|
|
7287
|
+
typeof data.get('box-references') !== 'undefined'
|
|
7288
|
+
? data
|
|
7289
|
+
.get('box-references')
|
|
7290
|
+
.map((v: unknown) => BoxReference.fromEncodingData(v))
|
|
7291
|
+
: undefined,
|
|
7174
7292
|
clearStateProgram: data.get('clear-state-program'),
|
|
7175
7293
|
extraProgramPages: data.get('extra-program-pages'),
|
|
7176
7294
|
foreignApps: data.get('foreign-apps'),
|
|
@@ -7184,6 +7302,7 @@ export class TransactionApplication implements Encodable {
|
|
|
7184
7302
|
? StateSchema.fromEncodingData(data.get('local-state-schema'))
|
|
7185
7303
|
: undefined,
|
|
7186
7304
|
onCompletion: data.get('on-completion'),
|
|
7305
|
+
rejectVersion: data.get('reject-version'),
|
|
7187
7306
|
});
|
|
7188
7307
|
}
|
|
7189
7308
|
}
|
|
@@ -106,6 +106,26 @@ export default class SearchForTransactions extends JSONRequest<TransactionsRespo
|
|
|
106
106
|
return this;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Lookup transactions by group ID.
|
|
111
|
+
*
|
|
112
|
+
* #### Example
|
|
113
|
+
* ```typescript
|
|
114
|
+
* const groupIdBase64Encoded = "A62qVigWtWo0laUzcE1iZY8+KXWzK1vSkgwN/eKgvjc=";
|
|
115
|
+
* const txns = await indexerClient
|
|
116
|
+
* .searchForTransactions()
|
|
117
|
+
* .groupid(groupIdBase64Encoded)
|
|
118
|
+
* .do();
|
|
119
|
+
* ```
|
|
120
|
+
*
|
|
121
|
+
* @param groupid - base64 string or uint8array
|
|
122
|
+
* @category query
|
|
123
|
+
*/
|
|
124
|
+
groupid(groupid: Uint8Array | string) {
|
|
125
|
+
this.query['group-id'] = base64StringFunnel(groupid);
|
|
126
|
+
return this;
|
|
127
|
+
}
|
|
128
|
+
|
|
109
129
|
/**
|
|
110
130
|
* Include results for the specified round.
|
|
111
131
|
*
|
|
@@ -48,6 +48,9 @@ export class ByteArraySchema extends Schema {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
public fromPreparedJSON(encoded: JSONEncodingData): Uint8Array {
|
|
51
|
+
if (encoded === null || encoded === undefined) {
|
|
52
|
+
return this.defaultValue();
|
|
53
|
+
}
|
|
51
54
|
if (typeof encoded === 'string') {
|
|
52
55
|
return base64ToBytes(encoded);
|
|
53
56
|
}
|