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
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* NOTICE: This file was generated. Editing this file manually is not recommended.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.TransactionsResponse = exports.TransactionStateProof = exports.TransactionSignatureMultisigSubsignature = exports.TransactionSignatureMultisig = exports.TransactionSignatureLogicsig = exports.TransactionSignature = exports.TransactionResponse = exports.TransactionPayment = exports.TransactionKeyreg = exports.TransactionHeartbeat = exports.TransactionAssetTransfer = exports.TransactionAssetFreeze = exports.TransactionAssetConfig = exports.TransactionApplication = void 0;
|
|
6
|
+
exports.TealValue = exports.TealKeyValue = exports.StateSchema = exports.StateProofVerifier = exports.StateProofTracking = exports.StateProofSignature = exports.StateProofSigSlot = exports.StateProofReveal = exports.StateProofParticipant = exports.StateProofFields = exports.ParticipationUpdates = exports.MiniAssetHolding = exports.MerkleArrayProof = exports.IndexerStateProofMessage = exports.HealthCheck = exports.HbProofFields = exports.HashFactory = exports.EvalDeltaKeyValue = exports.EvalDelta = exports.ErrorResponse = exports.BoxesResponse = exports.BoxReference = exports.BoxDescriptor = exports.Box = exports.BlockUpgradeVote = exports.BlockUpgradeState = exports.BlockRewards = exports.BlockHeadersResponse = exports.Block = exports.AssetsResponse = exports.AssetResponse = exports.AssetParams = exports.AssetHoldingsResponse = exports.AssetHolding = exports.AssetBalancesResponse = exports.Asset = exports.ApplicationsResponse = exports.ApplicationStateSchema = exports.ApplicationResponse = exports.ApplicationParams = exports.ApplicationLogsResponse = exports.ApplicationLogData = exports.ApplicationLocalStatesResponse = exports.ApplicationLocalState = exports.Application = exports.AccountsResponse = exports.AccountStateDelta = exports.AccountResponse = exports.AccountParticipation = exports.Account = void 0;
|
|
7
|
+
exports.TransactionsResponse = exports.TransactionStateProof = exports.TransactionSignatureMultisigSubsignature = exports.TransactionSignatureMultisig = exports.TransactionSignatureLogicsig = exports.TransactionSignature = exports.TransactionResponse = exports.TransactionPayment = exports.TransactionKeyreg = exports.TransactionHeartbeat = exports.TransactionAssetTransfer = exports.TransactionAssetFreeze = exports.TransactionAssetConfig = exports.TransactionApplication = exports.Transaction = void 0;
|
|
8
8
|
/* eslint-disable no-use-before-define */
|
|
9
9
|
const utils_js_1 = require("../../../../utils/utils.js");
|
|
10
10
|
const index_js_1 = require("../../../../encoding/schema/index.js");
|
|
@@ -2413,6 +2413,48 @@ class BoxDescriptor {
|
|
|
2413
2413
|
}
|
|
2414
2414
|
}
|
|
2415
2415
|
exports.BoxDescriptor = BoxDescriptor;
|
|
2416
|
+
/**
|
|
2417
|
+
* BoxReference names a box by its name and the application ID it belongs to.
|
|
2418
|
+
*/
|
|
2419
|
+
class BoxReference {
|
|
2420
|
+
static get encodingSchema() {
|
|
2421
|
+
if (!this.encodingSchemaValue) {
|
|
2422
|
+
this.encodingSchemaValue = new index_js_1.NamedMapSchema([]);
|
|
2423
|
+
this.encodingSchemaValue.pushEntries({ key: 'app', valueSchema: new index_js_1.Uint64Schema(), omitEmpty: true }, { key: 'name', valueSchema: new index_js_1.ByteArraySchema(), omitEmpty: true });
|
|
2424
|
+
}
|
|
2425
|
+
return this.encodingSchemaValue;
|
|
2426
|
+
}
|
|
2427
|
+
/**
|
|
2428
|
+
* Creates a new `BoxReference` object.
|
|
2429
|
+
* @param app - Application ID to which the box belongs, or zero if referring to the called
|
|
2430
|
+
* application.
|
|
2431
|
+
* @param name - Base64 encoded box name
|
|
2432
|
+
*/
|
|
2433
|
+
constructor({ app, name, }) {
|
|
2434
|
+
this.app = (0, utils_js_1.ensureSafeInteger)(app);
|
|
2435
|
+
this.name = typeof name === 'string' ? (0, binarydata_js_1.base64ToBytes)(name) : name;
|
|
2436
|
+
}
|
|
2437
|
+
// eslint-disable-next-line class-methods-use-this
|
|
2438
|
+
getEncodingSchema() {
|
|
2439
|
+
return BoxReference.encodingSchema;
|
|
2440
|
+
}
|
|
2441
|
+
toEncodingData() {
|
|
2442
|
+
return new Map([
|
|
2443
|
+
['app', this.app],
|
|
2444
|
+
['name', this.name],
|
|
2445
|
+
]);
|
|
2446
|
+
}
|
|
2447
|
+
static fromEncodingData(data) {
|
|
2448
|
+
if (!(data instanceof Map)) {
|
|
2449
|
+
throw new Error(`Invalid decoded BoxReference: ${data}`);
|
|
2450
|
+
}
|
|
2451
|
+
return new BoxReference({
|
|
2452
|
+
app: data.get('app'),
|
|
2453
|
+
name: data.get('name'),
|
|
2454
|
+
});
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
exports.BoxReference = BoxReference;
|
|
2416
2458
|
/**
|
|
2417
2459
|
* Box names of an application
|
|
2418
2460
|
*/
|
|
@@ -4233,6 +4275,10 @@ class TransactionApplication {
|
|
|
4233
4275
|
key: 'approval-program',
|
|
4234
4276
|
valueSchema: new index_js_1.OptionalSchema(new index_js_1.ByteArraySchema()),
|
|
4235
4277
|
omitEmpty: true,
|
|
4278
|
+
}, {
|
|
4279
|
+
key: 'box-references',
|
|
4280
|
+
valueSchema: new index_js_1.OptionalSchema(new index_js_1.ArraySchema(BoxReference.encodingSchema)),
|
|
4281
|
+
omitEmpty: true,
|
|
4236
4282
|
}, {
|
|
4237
4283
|
key: 'clear-state-program',
|
|
4238
4284
|
valueSchema: new index_js_1.OptionalSchema(new index_js_1.ByteArraySchema()),
|
|
@@ -4261,6 +4307,10 @@ class TransactionApplication {
|
|
|
4261
4307
|
key: 'on-completion',
|
|
4262
4308
|
valueSchema: new index_js_1.OptionalSchema(new index_js_1.StringSchema()),
|
|
4263
4309
|
omitEmpty: true,
|
|
4310
|
+
}, {
|
|
4311
|
+
key: 'reject-version',
|
|
4312
|
+
valueSchema: new index_js_1.OptionalSchema(new index_js_1.Uint64Schema()),
|
|
4313
|
+
omitEmpty: true,
|
|
4264
4314
|
});
|
|
4265
4315
|
}
|
|
4266
4316
|
return this.encodingSchemaValue;
|
|
@@ -4276,6 +4326,8 @@ class TransactionApplication {
|
|
|
4276
4326
|
* on-completion is set to "clear". It can read and write global state for the
|
|
4277
4327
|
* application, as well as account-specific local state. Approval programs may
|
|
4278
4328
|
* reject the transaction.
|
|
4329
|
+
* @param boxReferences - (apbx) the boxes that can be accessed by this transaction (and others in the
|
|
4330
|
+
* same group).
|
|
4279
4331
|
* @param clearStateProgram - (apsu) Logic executed for application transactions with on-completion set to
|
|
4280
4332
|
* "clear". It can read and write global state for the application, as well as
|
|
4281
4333
|
* account-specific local state. Clear state programs cannot reject the
|
|
@@ -4303,8 +4355,10 @@ class TransactionApplication {
|
|
|
4303
4355
|
* * update
|
|
4304
4356
|
* * update
|
|
4305
4357
|
* * delete
|
|
4358
|
+
* @param rejectVersion - (aprv) the lowest application version for which this transaction should
|
|
4359
|
+
* immediately fail. 0 indicates that no version check should be performed.
|
|
4306
4360
|
*/
|
|
4307
|
-
constructor({ applicationId, accounts, applicationArgs, approvalProgram, clearStateProgram, extraProgramPages, foreignApps, foreignAssets, globalStateSchema, localStateSchema, onCompletion, }) {
|
|
4361
|
+
constructor({ applicationId, accounts, applicationArgs, approvalProgram, boxReferences, clearStateProgram, extraProgramPages, foreignApps, foreignAssets, globalStateSchema, localStateSchema, onCompletion, rejectVersion, }) {
|
|
4308
4362
|
this.applicationId = (0, utils_js_1.ensureBigInt)(applicationId);
|
|
4309
4363
|
this.accounts =
|
|
4310
4364
|
typeof accounts !== 'undefined'
|
|
@@ -4315,6 +4369,7 @@ class TransactionApplication {
|
|
|
4315
4369
|
typeof approvalProgram === 'string'
|
|
4316
4370
|
? (0, binarydata_js_1.base64ToBytes)(approvalProgram)
|
|
4317
4371
|
: approvalProgram;
|
|
4372
|
+
this.boxReferences = boxReferences;
|
|
4318
4373
|
this.clearStateProgram =
|
|
4319
4374
|
typeof clearStateProgram === 'string'
|
|
4320
4375
|
? (0, binarydata_js_1.base64ToBytes)(clearStateProgram)
|
|
@@ -4334,6 +4389,10 @@ class TransactionApplication {
|
|
|
4334
4389
|
this.globalStateSchema = globalStateSchema;
|
|
4335
4390
|
this.localStateSchema = localStateSchema;
|
|
4336
4391
|
this.onCompletion = onCompletion;
|
|
4392
|
+
this.rejectVersion =
|
|
4393
|
+
typeof rejectVersion === 'undefined'
|
|
4394
|
+
? undefined
|
|
4395
|
+
: (0, utils_js_1.ensureSafeInteger)(rejectVersion);
|
|
4337
4396
|
}
|
|
4338
4397
|
// eslint-disable-next-line class-methods-use-this
|
|
4339
4398
|
getEncodingSchema() {
|
|
@@ -4350,6 +4409,12 @@ class TransactionApplication {
|
|
|
4350
4409
|
],
|
|
4351
4410
|
['application-args', this.applicationArgs],
|
|
4352
4411
|
['approval-program', this.approvalProgram],
|
|
4412
|
+
[
|
|
4413
|
+
'box-references',
|
|
4414
|
+
typeof this.boxReferences !== 'undefined'
|
|
4415
|
+
? this.boxReferences.map((v) => v.toEncodingData())
|
|
4416
|
+
: undefined,
|
|
4417
|
+
],
|
|
4353
4418
|
['clear-state-program', this.clearStateProgram],
|
|
4354
4419
|
['extra-program-pages', this.extraProgramPages],
|
|
4355
4420
|
['foreign-apps', this.foreignApps],
|
|
@@ -4367,6 +4432,7 @@ class TransactionApplication {
|
|
|
4367
4432
|
: undefined,
|
|
4368
4433
|
],
|
|
4369
4434
|
['on-completion', this.onCompletion],
|
|
4435
|
+
['reject-version', this.rejectVersion],
|
|
4370
4436
|
]);
|
|
4371
4437
|
}
|
|
4372
4438
|
static fromEncodingData(data) {
|
|
@@ -4378,6 +4444,11 @@ class TransactionApplication {
|
|
|
4378
4444
|
accounts: data.get('accounts'),
|
|
4379
4445
|
applicationArgs: data.get('application-args'),
|
|
4380
4446
|
approvalProgram: data.get('approval-program'),
|
|
4447
|
+
boxReferences: typeof data.get('box-references') !== 'undefined'
|
|
4448
|
+
? data
|
|
4449
|
+
.get('box-references')
|
|
4450
|
+
.map((v) => BoxReference.fromEncodingData(v))
|
|
4451
|
+
: undefined,
|
|
4381
4452
|
clearStateProgram: data.get('clear-state-program'),
|
|
4382
4453
|
extraProgramPages: data.get('extra-program-pages'),
|
|
4383
4454
|
foreignApps: data.get('foreign-apps'),
|
|
@@ -4389,6 +4460,7 @@ class TransactionApplication {
|
|
|
4389
4460
|
? StateSchema.fromEncodingData(data.get('local-state-schema'))
|
|
4390
4461
|
: undefined,
|
|
4391
4462
|
onCompletion: data.get('on-completion'),
|
|
4463
|
+
rejectVersion: data.get('reject-version'),
|
|
4392
4464
|
});
|
|
4393
4465
|
}
|
|
4394
4466
|
}
|