algosdk 2.4.0 → 2.6.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/urlTokenBaseHTTPClient.js +0 -3
- package/dist/cjs/client/urlTokenBaseHTTPClient.js.map +1 -1
- package/dist/cjs/client/v2/algod/algod.js +17 -0
- package/dist/cjs/client/v2/algod/algod.js.map +1 -1
- package/dist/cjs/client/v2/algod/getBlockTxids.js +19 -0
- package/dist/cjs/client/v2/algod/getBlockTxids.js.map +1 -0
- package/dist/cjs/client/v2/algod/models/types.js +716 -18
- package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js +2 -3
- package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAssetBalances.js +2 -1
- package/dist/cjs/client/v2/indexer/lookupAssetBalances.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js +2 -4
- package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchAccounts.js +2 -1
- package/dist/cjs/client/v2/indexer/searchAccounts.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchForTransactions.js +61 -62
- package/dist/cjs/client/v2/indexer/searchForTransactions.js.map +1 -1
- package/dist/cjs/nacl/naclWrappers.js +4 -0
- package/dist/cjs/nacl/naclWrappers.js.map +1 -1
- package/dist/cjs/signer.js +6 -1
- package/dist/cjs/signer.js.map +1 -1
- package/dist/cjs/utils/utils.js +13 -1
- package/dist/cjs/utils/utils.js.map +1 -1
- package/dist/esm/client/urlTokenBaseHTTPClient.js +0 -3
- package/dist/esm/client/urlTokenBaseHTTPClient.js.map +1 -1
- package/dist/esm/client/v2/algod/algod.js +17 -0
- package/dist/esm/client/v2/algod/algod.js.map +1 -1
- package/dist/esm/client/v2/algod/getBlockTxids.js +13 -0
- package/dist/esm/client/v2/algod/getBlockTxids.js.map +1 -0
- package/dist/esm/client/v2/algod/models/types.js +699 -16
- package/dist/esm/client/v2/algod/models/types.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountTransactions.js +2 -3
- package/dist/esm/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAssetBalances.js +2 -1
- package/dist/esm/client/v2/indexer/lookupAssetBalances.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAssetTransactions.js +2 -4
- package/dist/esm/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchAccounts.js +2 -1
- package/dist/esm/client/v2/indexer/searchAccounts.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchForTransactions.js +61 -62
- package/dist/esm/client/v2/indexer/searchForTransactions.js.map +1 -1
- package/dist/esm/nacl/naclWrappers.js +4 -0
- package/dist/esm/nacl/naclWrappers.js.map +1 -1
- package/dist/esm/signer.js +6 -1
- package/dist/esm/signer.js.map +1 -1
- package/dist/esm/utils/utils.js +11 -0
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/types/client/v2/algod/algod.d.ts +15 -0
- package/dist/types/client/v2/algod/getBlockTxids.d.ts +8 -0
- package/dist/types/client/v2/algod/models/types.d.ts +606 -10
- package/dist/types/client/v2/indexer/lookupAccountTransactions.d.ts +0 -2
- package/dist/types/client/v2/indexer/lookupAssetTransactions.d.ts +0 -3
- package/dist/types/client/v2/indexer/searchForTransactions.d.ts +54 -56
- package/dist/types/utils/utils.d.ts +5 -0
- package/package.json +5 -5
- package/src/client/urlTokenBaseHTTPClient.ts +0 -3
- package/src/client/v2/algod/algod.ts +18 -0
- package/src/client/v2/algod/getBlockTxids.ts +18 -0
- package/src/client/v2/algod/models/types.ts +1263 -13
- package/src/client/v2/indexer/lookupAccountTransactions.ts +2 -3
- package/src/client/v2/indexer/lookupAssetBalances.ts +2 -1
- package/src/client/v2/indexer/lookupAssetTransactions.ts +2 -4
- package/src/client/v2/indexer/searchAccounts.ts +2 -1
- package/src/client/v2/indexer/searchForTransactions.ts +63 -64
- package/src/nacl/naclWrappers.ts +6 -0
- package/src/signer.ts +5 -1
- package/src/utils/utils.ts +12 -0
|
@@ -6,8 +6,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
10
|
-
exports.Version = exports.TransactionProofResponse = void 0;
|
|
9
|
+
exports.SimulateRequestTransactionGroup = exports.SimulateRequest = exports.SimulateInitialStates = exports.ScratchChange = exports.PostTransactionsResponse = exports.PendingTransactionsResponse = exports.PendingTransactionResponse = exports.NodeStatusResponse = exports.LightBlockHeaderProof = exports.LedgerStateDeltaForTransactionGroup = exports.KvDelta = exports.GetSyncRoundResponse = exports.GetBlockTimeStampOffsetResponse = exports.EvalDeltaKeyValue = exports.EvalDelta = exports.ErrorResponse = exports.DryrunTxnResult = exports.DryrunState = exports.DryrunSource = exports.DryrunResponse = exports.DryrunRequest = exports.DisassembleResponse = exports.CompileResponse = exports.BuildVersion = exports.BoxesResponse = exports.BoxReference = exports.BoxDescriptor = exports.Box = exports.BlockTxidsResponse = exports.BlockResponse = exports.BlockHashResponse = exports.AvmValue = exports.AvmKeyValue = exports.AssetParams = exports.AssetHoldingReference = exports.AssetHolding = exports.Asset = exports.ApplicationStateSchema = exports.ApplicationStateOperation = exports.ApplicationParams = exports.ApplicationLocalState = exports.ApplicationLocalReference = exports.ApplicationKVStorage = exports.ApplicationInitialStates = exports.Application = exports.AccountStateDelta = exports.AccountParticipation = exports.AccountAssetResponse = exports.AccountApplicationResponse = exports.Account = void 0;
|
|
10
|
+
exports.Version = exports.TransactionProofResponse = exports.TransactionParametersResponse = exports.TransactionGroupLedgerStateDeltasForRoundResponse = exports.TealValue = exports.TealKeyValue = exports.SupplyResponse = exports.StateProofMessage = exports.StateProof = exports.SimulationTransactionExecTrace = exports.SimulationOpcodeTraceUnit = exports.SimulationEvalOverrides = exports.SimulateUnnamedResourcesAccessed = exports.SimulateTransactionResult = exports.SimulateTransactionGroupResult = exports.SimulateTraceConfig = exports.SimulateResponse = void 0;
|
|
11
11
|
/* eslint-disable no-use-before-define */
|
|
12
12
|
const buffer_1 = require("buffer");
|
|
13
13
|
const basemodel_1 = __importDefault(require("../../basemodel"));
|
|
@@ -410,6 +410,116 @@ class Application extends basemodel_1.default {
|
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
412
|
exports.Application = Application;
|
|
413
|
+
/**
|
|
414
|
+
* An application's initial global/local/box states that were accessed during
|
|
415
|
+
* simulation.
|
|
416
|
+
*/
|
|
417
|
+
class ApplicationInitialStates extends basemodel_1.default {
|
|
418
|
+
/**
|
|
419
|
+
* Creates a new `ApplicationInitialStates` object.
|
|
420
|
+
* @param id - Application index.
|
|
421
|
+
* @param appBoxes - An application's global/local/box state.
|
|
422
|
+
* @param appGlobals - An application's global/local/box state.
|
|
423
|
+
* @param appLocals - An application's initial local states tied to different accounts.
|
|
424
|
+
*/
|
|
425
|
+
constructor({ id, appBoxes, appGlobals, appLocals, }) {
|
|
426
|
+
super();
|
|
427
|
+
this.id = id;
|
|
428
|
+
this.appBoxes = appBoxes;
|
|
429
|
+
this.appGlobals = appGlobals;
|
|
430
|
+
this.appLocals = appLocals;
|
|
431
|
+
this.attribute_map = {
|
|
432
|
+
id: 'id',
|
|
433
|
+
appBoxes: 'app-boxes',
|
|
434
|
+
appGlobals: 'app-globals',
|
|
435
|
+
appLocals: 'app-locals',
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
// eslint-disable-next-line camelcase
|
|
439
|
+
static from_obj_for_encoding(data) {
|
|
440
|
+
/* eslint-disable dot-notation */
|
|
441
|
+
if (typeof data['id'] === 'undefined')
|
|
442
|
+
throw new Error(`Response is missing required field 'id': ${data}`);
|
|
443
|
+
return new ApplicationInitialStates({
|
|
444
|
+
id: data['id'],
|
|
445
|
+
appBoxes: typeof data['app-boxes'] !== 'undefined'
|
|
446
|
+
? ApplicationKVStorage.from_obj_for_encoding(data['app-boxes'])
|
|
447
|
+
: undefined,
|
|
448
|
+
appGlobals: typeof data['app-globals'] !== 'undefined'
|
|
449
|
+
? ApplicationKVStorage.from_obj_for_encoding(data['app-globals'])
|
|
450
|
+
: undefined,
|
|
451
|
+
appLocals: typeof data['app-locals'] !== 'undefined'
|
|
452
|
+
? data['app-locals'].map(ApplicationKVStorage.from_obj_for_encoding)
|
|
453
|
+
: undefined,
|
|
454
|
+
});
|
|
455
|
+
/* eslint-enable dot-notation */
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
exports.ApplicationInitialStates = ApplicationInitialStates;
|
|
459
|
+
/**
|
|
460
|
+
* An application's global/local/box state.
|
|
461
|
+
*/
|
|
462
|
+
class ApplicationKVStorage extends basemodel_1.default {
|
|
463
|
+
/**
|
|
464
|
+
* Creates a new `ApplicationKVStorage` object.
|
|
465
|
+
* @param kvs - Key-Value pairs representing application states.
|
|
466
|
+
* @param account - The address of the account associated with the local state.
|
|
467
|
+
*/
|
|
468
|
+
constructor({ kvs, account }) {
|
|
469
|
+
super();
|
|
470
|
+
this.kvs = kvs;
|
|
471
|
+
this.account = account;
|
|
472
|
+
this.attribute_map = {
|
|
473
|
+
kvs: 'kvs',
|
|
474
|
+
account: 'account',
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
// eslint-disable-next-line camelcase
|
|
478
|
+
static from_obj_for_encoding(data) {
|
|
479
|
+
/* eslint-disable dot-notation */
|
|
480
|
+
if (!Array.isArray(data['kvs']))
|
|
481
|
+
throw new Error(`Response is missing required array field 'kvs': ${data}`);
|
|
482
|
+
return new ApplicationKVStorage({
|
|
483
|
+
kvs: data['kvs'].map(AvmKeyValue.from_obj_for_encoding),
|
|
484
|
+
account: data['account'],
|
|
485
|
+
});
|
|
486
|
+
/* eslint-enable dot-notation */
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
exports.ApplicationKVStorage = ApplicationKVStorage;
|
|
490
|
+
/**
|
|
491
|
+
* References an account's local state for an application.
|
|
492
|
+
*/
|
|
493
|
+
class ApplicationLocalReference extends basemodel_1.default {
|
|
494
|
+
/**
|
|
495
|
+
* Creates a new `ApplicationLocalReference` object.
|
|
496
|
+
* @param account - Address of the account with the local state.
|
|
497
|
+
* @param app - Application ID of the local state application.
|
|
498
|
+
*/
|
|
499
|
+
constructor({ account, app }) {
|
|
500
|
+
super();
|
|
501
|
+
this.account = account;
|
|
502
|
+
this.app = app;
|
|
503
|
+
this.attribute_map = {
|
|
504
|
+
account: 'account',
|
|
505
|
+
app: 'app',
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
// eslint-disable-next-line camelcase
|
|
509
|
+
static from_obj_for_encoding(data) {
|
|
510
|
+
/* eslint-disable dot-notation */
|
|
511
|
+
if (typeof data['account'] === 'undefined')
|
|
512
|
+
throw new Error(`Response is missing required field 'account': ${data}`);
|
|
513
|
+
if (typeof data['app'] === 'undefined')
|
|
514
|
+
throw new Error(`Response is missing required field 'app': ${data}`);
|
|
515
|
+
return new ApplicationLocalReference({
|
|
516
|
+
account: data['account'],
|
|
517
|
+
app: data['app'],
|
|
518
|
+
});
|
|
519
|
+
/* eslint-enable dot-notation */
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
exports.ApplicationLocalReference = ApplicationLocalReference;
|
|
413
523
|
/**
|
|
414
524
|
* Stores local state associated with an application.
|
|
415
525
|
*/
|
|
@@ -517,6 +627,60 @@ class ApplicationParams extends basemodel_1.default {
|
|
|
517
627
|
}
|
|
518
628
|
}
|
|
519
629
|
exports.ApplicationParams = ApplicationParams;
|
|
630
|
+
/**
|
|
631
|
+
* An operation against an application's global/local/box state.
|
|
632
|
+
*/
|
|
633
|
+
class ApplicationStateOperation extends basemodel_1.default {
|
|
634
|
+
/**
|
|
635
|
+
* Creates a new `ApplicationStateOperation` object.
|
|
636
|
+
* @param appStateType - Type of application state. Value `g` is **global state**, `l` is **local
|
|
637
|
+
* state**, `b` is **boxes**.
|
|
638
|
+
* @param key - The key (name) of the global/local/box state.
|
|
639
|
+
* @param operation - Operation type. Value `w` is **write**, `d` is **delete**.
|
|
640
|
+
* @param account - For local state changes, the address of the account associated with the local
|
|
641
|
+
* state.
|
|
642
|
+
* @param newValue - Represents an AVM value.
|
|
643
|
+
*/
|
|
644
|
+
constructor({ appStateType, key, operation, account, newValue, }) {
|
|
645
|
+
super();
|
|
646
|
+
this.appStateType = appStateType;
|
|
647
|
+
this.key =
|
|
648
|
+
typeof key === 'string'
|
|
649
|
+
? new Uint8Array(buffer_1.Buffer.from(key, 'base64'))
|
|
650
|
+
: key;
|
|
651
|
+
this.operation = operation;
|
|
652
|
+
this.account = account;
|
|
653
|
+
this.newValue = newValue;
|
|
654
|
+
this.attribute_map = {
|
|
655
|
+
appStateType: 'app-state-type',
|
|
656
|
+
key: 'key',
|
|
657
|
+
operation: 'operation',
|
|
658
|
+
account: 'account',
|
|
659
|
+
newValue: 'new-value',
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
// eslint-disable-next-line camelcase
|
|
663
|
+
static from_obj_for_encoding(data) {
|
|
664
|
+
/* eslint-disable dot-notation */
|
|
665
|
+
if (typeof data['app-state-type'] === 'undefined')
|
|
666
|
+
throw new Error(`Response is missing required field 'app-state-type': ${data}`);
|
|
667
|
+
if (typeof data['key'] === 'undefined')
|
|
668
|
+
throw new Error(`Response is missing required field 'key': ${data}`);
|
|
669
|
+
if (typeof data['operation'] === 'undefined')
|
|
670
|
+
throw new Error(`Response is missing required field 'operation': ${data}`);
|
|
671
|
+
return new ApplicationStateOperation({
|
|
672
|
+
appStateType: data['app-state-type'],
|
|
673
|
+
key: data['key'],
|
|
674
|
+
operation: data['operation'],
|
|
675
|
+
account: data['account'],
|
|
676
|
+
newValue: typeof data['new-value'] !== 'undefined'
|
|
677
|
+
? AvmValue.from_obj_for_encoding(data['new-value'])
|
|
678
|
+
: undefined,
|
|
679
|
+
});
|
|
680
|
+
/* eslint-enable dot-notation */
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
exports.ApplicationStateOperation = ApplicationStateOperation;
|
|
520
684
|
/**
|
|
521
685
|
* Specifies maximums on the number of each type that may be stored.
|
|
522
686
|
*/
|
|
@@ -627,6 +791,39 @@ class AssetHolding extends basemodel_1.default {
|
|
|
627
791
|
}
|
|
628
792
|
}
|
|
629
793
|
exports.AssetHolding = AssetHolding;
|
|
794
|
+
/**
|
|
795
|
+
* References an asset held by an account.
|
|
796
|
+
*/
|
|
797
|
+
class AssetHoldingReference extends basemodel_1.default {
|
|
798
|
+
/**
|
|
799
|
+
* Creates a new `AssetHoldingReference` object.
|
|
800
|
+
* @param account - Address of the account holding the asset.
|
|
801
|
+
* @param asset - Asset ID of the holding.
|
|
802
|
+
*/
|
|
803
|
+
constructor({ account, asset }) {
|
|
804
|
+
super();
|
|
805
|
+
this.account = account;
|
|
806
|
+
this.asset = asset;
|
|
807
|
+
this.attribute_map = {
|
|
808
|
+
account: 'account',
|
|
809
|
+
asset: 'asset',
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
// eslint-disable-next-line camelcase
|
|
813
|
+
static from_obj_for_encoding(data) {
|
|
814
|
+
/* eslint-disable dot-notation */
|
|
815
|
+
if (typeof data['account'] === 'undefined')
|
|
816
|
+
throw new Error(`Response is missing required field 'account': ${data}`);
|
|
817
|
+
if (typeof data['asset'] === 'undefined')
|
|
818
|
+
throw new Error(`Response is missing required field 'asset': ${data}`);
|
|
819
|
+
return new AssetHoldingReference({
|
|
820
|
+
account: data['account'],
|
|
821
|
+
asset: data['asset'],
|
|
822
|
+
});
|
|
823
|
+
/* eslint-enable dot-notation */
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
exports.AssetHoldingReference = AssetHoldingReference;
|
|
630
827
|
/**
|
|
631
828
|
* AssetParams specifies the parameters for an asset.
|
|
632
829
|
* (apar) when part of an AssetConfig transaction.
|
|
@@ -740,6 +937,80 @@ class AssetParams extends basemodel_1.default {
|
|
|
740
937
|
}
|
|
741
938
|
}
|
|
742
939
|
exports.AssetParams = AssetParams;
|
|
940
|
+
/**
|
|
941
|
+
* Represents an AVM key-value pair in an application store.
|
|
942
|
+
*/
|
|
943
|
+
class AvmKeyValue extends basemodel_1.default {
|
|
944
|
+
/**
|
|
945
|
+
* Creates a new `AvmKeyValue` object.
|
|
946
|
+
* @param key -
|
|
947
|
+
* @param value - Represents an AVM value.
|
|
948
|
+
*/
|
|
949
|
+
constructor({ key, value }) {
|
|
950
|
+
super();
|
|
951
|
+
this.key =
|
|
952
|
+
typeof key === 'string'
|
|
953
|
+
? new Uint8Array(buffer_1.Buffer.from(key, 'base64'))
|
|
954
|
+
: key;
|
|
955
|
+
this.value = value;
|
|
956
|
+
this.attribute_map = {
|
|
957
|
+
key: 'key',
|
|
958
|
+
value: 'value',
|
|
959
|
+
};
|
|
960
|
+
}
|
|
961
|
+
// eslint-disable-next-line camelcase
|
|
962
|
+
static from_obj_for_encoding(data) {
|
|
963
|
+
/* eslint-disable dot-notation */
|
|
964
|
+
if (typeof data['key'] === 'undefined')
|
|
965
|
+
throw new Error(`Response is missing required field 'key': ${data}`);
|
|
966
|
+
if (typeof data['value'] === 'undefined')
|
|
967
|
+
throw new Error(`Response is missing required field 'value': ${data}`);
|
|
968
|
+
return new AvmKeyValue({
|
|
969
|
+
key: data['key'],
|
|
970
|
+
value: AvmValue.from_obj_for_encoding(data['value']),
|
|
971
|
+
});
|
|
972
|
+
/* eslint-enable dot-notation */
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
exports.AvmKeyValue = AvmKeyValue;
|
|
976
|
+
/**
|
|
977
|
+
* Represents an AVM value.
|
|
978
|
+
*/
|
|
979
|
+
class AvmValue extends basemodel_1.default {
|
|
980
|
+
/**
|
|
981
|
+
* Creates a new `AvmValue` object.
|
|
982
|
+
* @param type - value type. Value `1` refers to **bytes**, value `2` refers to **uint64**
|
|
983
|
+
* @param bytes - bytes value.
|
|
984
|
+
* @param uint - uint value.
|
|
985
|
+
*/
|
|
986
|
+
constructor({ type, bytes, uint, }) {
|
|
987
|
+
super();
|
|
988
|
+
this.type = type;
|
|
989
|
+
this.bytes =
|
|
990
|
+
typeof bytes === 'string'
|
|
991
|
+
? new Uint8Array(buffer_1.Buffer.from(bytes, 'base64'))
|
|
992
|
+
: bytes;
|
|
993
|
+
this.uint = uint;
|
|
994
|
+
this.attribute_map = {
|
|
995
|
+
type: 'type',
|
|
996
|
+
bytes: 'bytes',
|
|
997
|
+
uint: 'uint',
|
|
998
|
+
};
|
|
999
|
+
}
|
|
1000
|
+
// eslint-disable-next-line camelcase
|
|
1001
|
+
static from_obj_for_encoding(data) {
|
|
1002
|
+
/* eslint-disable dot-notation */
|
|
1003
|
+
if (typeof data['type'] === 'undefined')
|
|
1004
|
+
throw new Error(`Response is missing required field 'type': ${data}`);
|
|
1005
|
+
return new AvmValue({
|
|
1006
|
+
type: data['type'],
|
|
1007
|
+
bytes: data['bytes'],
|
|
1008
|
+
uint: data['uint'],
|
|
1009
|
+
});
|
|
1010
|
+
/* eslint-enable dot-notation */
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
exports.AvmValue = AvmValue;
|
|
743
1014
|
/**
|
|
744
1015
|
* Hash of a block header.
|
|
745
1016
|
*/
|
|
@@ -799,6 +1070,33 @@ class BlockResponse extends basemodel_1.default {
|
|
|
799
1070
|
}
|
|
800
1071
|
}
|
|
801
1072
|
exports.BlockResponse = BlockResponse;
|
|
1073
|
+
/**
|
|
1074
|
+
* Top level transaction IDs in a block.
|
|
1075
|
+
*/
|
|
1076
|
+
class BlockTxidsResponse extends basemodel_1.default {
|
|
1077
|
+
/**
|
|
1078
|
+
* Creates a new `BlockTxidsResponse` object.
|
|
1079
|
+
* @param blocktxids - Block transaction IDs.
|
|
1080
|
+
*/
|
|
1081
|
+
constructor({ blocktxids }) {
|
|
1082
|
+
super();
|
|
1083
|
+
this.blocktxids = blocktxids;
|
|
1084
|
+
this.attribute_map = {
|
|
1085
|
+
blocktxids: 'blockTxids',
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
// eslint-disable-next-line camelcase
|
|
1089
|
+
static from_obj_for_encoding(data) {
|
|
1090
|
+
/* eslint-disable dot-notation */
|
|
1091
|
+
if (!Array.isArray(data['blockTxids']))
|
|
1092
|
+
throw new Error(`Response is missing required array field 'blockTxids': ${data}`);
|
|
1093
|
+
return new BlockTxidsResponse({
|
|
1094
|
+
blocktxids: data['blockTxids'],
|
|
1095
|
+
});
|
|
1096
|
+
/* eslint-enable dot-notation */
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
exports.BlockTxidsResponse = BlockTxidsResponse;
|
|
802
1100
|
/**
|
|
803
1101
|
* Box name and its content.
|
|
804
1102
|
*/
|
|
@@ -806,20 +1104,23 @@ class Box extends basemodel_1.default {
|
|
|
806
1104
|
/**
|
|
807
1105
|
* Creates a new `Box` object.
|
|
808
1106
|
* @param name - (name) box name, base64 encoded
|
|
1107
|
+
* @param round - The round for which this information is relevant
|
|
809
1108
|
* @param value - (value) box value, base64 encoded.
|
|
810
1109
|
*/
|
|
811
|
-
constructor({ name, value, }) {
|
|
1110
|
+
constructor({ name, round, value, }) {
|
|
812
1111
|
super();
|
|
813
1112
|
this.name =
|
|
814
1113
|
typeof name === 'string'
|
|
815
1114
|
? new Uint8Array(buffer_1.Buffer.from(name, 'base64'))
|
|
816
1115
|
: name;
|
|
1116
|
+
this.round = round;
|
|
817
1117
|
this.value =
|
|
818
1118
|
typeof value === 'string'
|
|
819
1119
|
? new Uint8Array(buffer_1.Buffer.from(value, 'base64'))
|
|
820
1120
|
: value;
|
|
821
1121
|
this.attribute_map = {
|
|
822
1122
|
name: 'name',
|
|
1123
|
+
round: 'round',
|
|
823
1124
|
value: 'value',
|
|
824
1125
|
};
|
|
825
1126
|
}
|
|
@@ -828,10 +1129,13 @@ class Box extends basemodel_1.default {
|
|
|
828
1129
|
/* eslint-disable dot-notation */
|
|
829
1130
|
if (typeof data['name'] === 'undefined')
|
|
830
1131
|
throw new Error(`Response is missing required field 'name': ${data}`);
|
|
1132
|
+
if (typeof data['round'] === 'undefined')
|
|
1133
|
+
throw new Error(`Response is missing required field 'round': ${data}`);
|
|
831
1134
|
if (typeof data['value'] === 'undefined')
|
|
832
1135
|
throw new Error(`Response is missing required field 'value': ${data}`);
|
|
833
1136
|
return new Box({
|
|
834
1137
|
name: data['name'],
|
|
1138
|
+
round: data['round'],
|
|
835
1139
|
value: data['value'],
|
|
836
1140
|
});
|
|
837
1141
|
/* eslint-enable dot-notation */
|
|
@@ -868,6 +1172,42 @@ class BoxDescriptor extends basemodel_1.default {
|
|
|
868
1172
|
}
|
|
869
1173
|
}
|
|
870
1174
|
exports.BoxDescriptor = BoxDescriptor;
|
|
1175
|
+
/**
|
|
1176
|
+
* References a box of an application.
|
|
1177
|
+
*/
|
|
1178
|
+
class BoxReference extends basemodel_1.default {
|
|
1179
|
+
/**
|
|
1180
|
+
* Creates a new `BoxReference` object.
|
|
1181
|
+
* @param app - Application ID which this box belongs to
|
|
1182
|
+
* @param name - Base64 encoded box name
|
|
1183
|
+
*/
|
|
1184
|
+
constructor({ app, name, }) {
|
|
1185
|
+
super();
|
|
1186
|
+
this.app = app;
|
|
1187
|
+
this.name =
|
|
1188
|
+
typeof name === 'string'
|
|
1189
|
+
? new Uint8Array(buffer_1.Buffer.from(name, 'base64'))
|
|
1190
|
+
: name;
|
|
1191
|
+
this.attribute_map = {
|
|
1192
|
+
app: 'app',
|
|
1193
|
+
name: 'name',
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
// eslint-disable-next-line camelcase
|
|
1197
|
+
static from_obj_for_encoding(data) {
|
|
1198
|
+
/* eslint-disable dot-notation */
|
|
1199
|
+
if (typeof data['app'] === 'undefined')
|
|
1200
|
+
throw new Error(`Response is missing required field 'app': ${data}`);
|
|
1201
|
+
if (typeof data['name'] === 'undefined')
|
|
1202
|
+
throw new Error(`Response is missing required field 'name': ${data}`);
|
|
1203
|
+
return new BoxReference({
|
|
1204
|
+
app: data['app'],
|
|
1205
|
+
name: data['name'],
|
|
1206
|
+
});
|
|
1207
|
+
/* eslint-enable dot-notation */
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
exports.BoxReference = BoxReference;
|
|
871
1211
|
/**
|
|
872
1212
|
* Box names of an application
|
|
873
1213
|
*/
|
|
@@ -1495,20 +1835,20 @@ class LedgerStateDeltaForTransactionGroup extends basemodel_1.default {
|
|
|
1495
1835
|
this.delta = delta;
|
|
1496
1836
|
this.ids = ids;
|
|
1497
1837
|
this.attribute_map = {
|
|
1498
|
-
delta: '
|
|
1499
|
-
ids: '
|
|
1838
|
+
delta: 'Delta',
|
|
1839
|
+
ids: 'Ids',
|
|
1500
1840
|
};
|
|
1501
1841
|
}
|
|
1502
1842
|
// eslint-disable-next-line camelcase
|
|
1503
1843
|
static from_obj_for_encoding(data) {
|
|
1504
1844
|
/* eslint-disable dot-notation */
|
|
1505
|
-
if (typeof data['
|
|
1506
|
-
throw new Error(`Response is missing required field '
|
|
1507
|
-
if (!Array.isArray(data['
|
|
1508
|
-
throw new Error(`Response is missing required array field '
|
|
1845
|
+
if (typeof data['Delta'] === 'undefined')
|
|
1846
|
+
throw new Error(`Response is missing required field 'Delta': ${data}`);
|
|
1847
|
+
if (!Array.isArray(data['Ids']))
|
|
1848
|
+
throw new Error(`Response is missing required array field 'Ids': ${data}`);
|
|
1509
1849
|
return new LedgerStateDeltaForTransactionGroup({
|
|
1510
|
-
delta: data['
|
|
1511
|
-
ids: data['
|
|
1850
|
+
delta: data['Delta'],
|
|
1851
|
+
ids: data['Ids'],
|
|
1512
1852
|
});
|
|
1513
1853
|
/* eslint-enable dot-notation */
|
|
1514
1854
|
}
|
|
@@ -1861,6 +2201,67 @@ class PostTransactionsResponse extends basemodel_1.default {
|
|
|
1861
2201
|
}
|
|
1862
2202
|
}
|
|
1863
2203
|
exports.PostTransactionsResponse = PostTransactionsResponse;
|
|
2204
|
+
/**
|
|
2205
|
+
* A write operation into a scratch slot.
|
|
2206
|
+
*/
|
|
2207
|
+
class ScratchChange extends basemodel_1.default {
|
|
2208
|
+
/**
|
|
2209
|
+
* Creates a new `ScratchChange` object.
|
|
2210
|
+
* @param newValue - Represents an AVM value.
|
|
2211
|
+
* @param slot - The scratch slot written.
|
|
2212
|
+
*/
|
|
2213
|
+
constructor({ newValue, slot, }) {
|
|
2214
|
+
super();
|
|
2215
|
+
this.newValue = newValue;
|
|
2216
|
+
this.slot = slot;
|
|
2217
|
+
this.attribute_map = {
|
|
2218
|
+
newValue: 'new-value',
|
|
2219
|
+
slot: 'slot',
|
|
2220
|
+
};
|
|
2221
|
+
}
|
|
2222
|
+
// eslint-disable-next-line camelcase
|
|
2223
|
+
static from_obj_for_encoding(data) {
|
|
2224
|
+
/* eslint-disable dot-notation */
|
|
2225
|
+
if (typeof data['new-value'] === 'undefined')
|
|
2226
|
+
throw new Error(`Response is missing required field 'new-value': ${data}`);
|
|
2227
|
+
if (typeof data['slot'] === 'undefined')
|
|
2228
|
+
throw new Error(`Response is missing required field 'slot': ${data}`);
|
|
2229
|
+
return new ScratchChange({
|
|
2230
|
+
newValue: AvmValue.from_obj_for_encoding(data['new-value']),
|
|
2231
|
+
slot: data['slot'],
|
|
2232
|
+
});
|
|
2233
|
+
/* eslint-enable dot-notation */
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
2236
|
+
exports.ScratchChange = ScratchChange;
|
|
2237
|
+
/**
|
|
2238
|
+
* Initial states of resources that were accessed during simulation.
|
|
2239
|
+
*/
|
|
2240
|
+
class SimulateInitialStates extends basemodel_1.default {
|
|
2241
|
+
/**
|
|
2242
|
+
* Creates a new `SimulateInitialStates` object.
|
|
2243
|
+
* @param appInitialStates - The initial states of accessed application before simulation. The order of this
|
|
2244
|
+
* array is arbitrary.
|
|
2245
|
+
*/
|
|
2246
|
+
constructor({ appInitialStates, }) {
|
|
2247
|
+
super();
|
|
2248
|
+
this.appInitialStates = appInitialStates;
|
|
2249
|
+
this.attribute_map = {
|
|
2250
|
+
appInitialStates: 'app-initial-states',
|
|
2251
|
+
};
|
|
2252
|
+
}
|
|
2253
|
+
// eslint-disable-next-line camelcase
|
|
2254
|
+
static from_obj_for_encoding(data) {
|
|
2255
|
+
/* eslint-disable dot-notation */
|
|
2256
|
+
return new SimulateInitialStates({
|
|
2257
|
+
appInitialStates: typeof data['app-initial-states'] !== 'undefined'
|
|
2258
|
+
? data['app-initial-states'].map(ApplicationInitialStates.from_obj_for_encoding)
|
|
2259
|
+
: undefined,
|
|
2260
|
+
});
|
|
2261
|
+
/* eslint-enable dot-notation */
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
exports.SimulateInitialStates = SimulateInitialStates;
|
|
1864
2265
|
/**
|
|
1865
2266
|
* Request type for simulation endpoint.
|
|
1866
2267
|
*/
|
|
@@ -1868,22 +2269,34 @@ class SimulateRequest extends basemodel_1.default {
|
|
|
1868
2269
|
/**
|
|
1869
2270
|
* Creates a new `SimulateRequest` object.
|
|
1870
2271
|
* @param txnGroups - The transaction groups to simulate.
|
|
1871
|
-
* @param allowEmptySignatures -
|
|
2272
|
+
* @param allowEmptySignatures - Allows transactions without signatures to be simulated as if they had correct
|
|
1872
2273
|
* signatures.
|
|
1873
2274
|
* @param allowMoreLogging - Lifts limits on log opcode usage during simulation.
|
|
2275
|
+
* @param allowUnnamedResources - Allows access to unnamed resources during simulation.
|
|
2276
|
+
* @param execTraceConfig - An object that configures simulation execution trace.
|
|
1874
2277
|
* @param extraOpcodeBudget - Applies extra opcode budget during simulation for each transaction group.
|
|
2278
|
+
* @param round - If provided, specifies the round preceding the simulation. State changes through
|
|
2279
|
+
* this round will be used to run this simulation. Usually only the 4 most recent
|
|
2280
|
+
* rounds will be available (controlled by the node config value MaxAcctLookback).
|
|
2281
|
+
* If not specified, defaults to the latest available round.
|
|
1875
2282
|
*/
|
|
1876
|
-
constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, extraOpcodeBudget, }) {
|
|
2283
|
+
constructor({ txnGroups, allowEmptySignatures, allowMoreLogging, allowUnnamedResources, execTraceConfig, extraOpcodeBudget, round, }) {
|
|
1877
2284
|
super();
|
|
1878
2285
|
this.txnGroups = txnGroups;
|
|
1879
2286
|
this.allowEmptySignatures = allowEmptySignatures;
|
|
1880
2287
|
this.allowMoreLogging = allowMoreLogging;
|
|
2288
|
+
this.allowUnnamedResources = allowUnnamedResources;
|
|
2289
|
+
this.execTraceConfig = execTraceConfig;
|
|
1881
2290
|
this.extraOpcodeBudget = extraOpcodeBudget;
|
|
2291
|
+
this.round = round;
|
|
1882
2292
|
this.attribute_map = {
|
|
1883
2293
|
txnGroups: 'txn-groups',
|
|
1884
2294
|
allowEmptySignatures: 'allow-empty-signatures',
|
|
1885
2295
|
allowMoreLogging: 'allow-more-logging',
|
|
2296
|
+
allowUnnamedResources: 'allow-unnamed-resources',
|
|
2297
|
+
execTraceConfig: 'exec-trace-config',
|
|
1886
2298
|
extraOpcodeBudget: 'extra-opcode-budget',
|
|
2299
|
+
round: 'round',
|
|
1887
2300
|
};
|
|
1888
2301
|
}
|
|
1889
2302
|
// eslint-disable-next-line camelcase
|
|
@@ -1895,7 +2308,12 @@ class SimulateRequest extends basemodel_1.default {
|
|
|
1895
2308
|
txnGroups: data['txn-groups'].map(SimulateRequestTransactionGroup.from_obj_for_encoding),
|
|
1896
2309
|
allowEmptySignatures: data['allow-empty-signatures'],
|
|
1897
2310
|
allowMoreLogging: data['allow-more-logging'],
|
|
2311
|
+
allowUnnamedResources: data['allow-unnamed-resources'],
|
|
2312
|
+
execTraceConfig: typeof data['exec-trace-config'] !== 'undefined'
|
|
2313
|
+
? SimulateTraceConfig.from_obj_for_encoding(data['exec-trace-config'])
|
|
2314
|
+
: undefined,
|
|
1898
2315
|
extraOpcodeBudget: data['extra-opcode-budget'],
|
|
2316
|
+
round: data['round'],
|
|
1899
2317
|
});
|
|
1900
2318
|
/* eslint-enable dot-notation */
|
|
1901
2319
|
}
|
|
@@ -1941,18 +2359,24 @@ class SimulateResponse extends basemodel_1.default {
|
|
|
1941
2359
|
* @param evalOverrides - The set of parameters and limits override during simulation. If this set of
|
|
1942
2360
|
* parameters is present, then evaluation parameters may differ from standard
|
|
1943
2361
|
* evaluation in certain ways.
|
|
2362
|
+
* @param execTraceConfig - An object that configures simulation execution trace.
|
|
2363
|
+
* @param initialStates - Initial states of resources that were accessed during simulation.
|
|
1944
2364
|
*/
|
|
1945
|
-
constructor({ lastRound, txnGroups, version, evalOverrides, }) {
|
|
2365
|
+
constructor({ lastRound, txnGroups, version, evalOverrides, execTraceConfig, initialStates, }) {
|
|
1946
2366
|
super();
|
|
1947
2367
|
this.lastRound = lastRound;
|
|
1948
2368
|
this.txnGroups = txnGroups;
|
|
1949
2369
|
this.version = version;
|
|
1950
2370
|
this.evalOverrides = evalOverrides;
|
|
2371
|
+
this.execTraceConfig = execTraceConfig;
|
|
2372
|
+
this.initialStates = initialStates;
|
|
1951
2373
|
this.attribute_map = {
|
|
1952
2374
|
lastRound: 'last-round',
|
|
1953
2375
|
txnGroups: 'txn-groups',
|
|
1954
2376
|
version: 'version',
|
|
1955
2377
|
evalOverrides: 'eval-overrides',
|
|
2378
|
+
execTraceConfig: 'exec-trace-config',
|
|
2379
|
+
initialStates: 'initial-states',
|
|
1956
2380
|
};
|
|
1957
2381
|
}
|
|
1958
2382
|
// eslint-disable-next-line camelcase
|
|
@@ -1971,11 +2395,57 @@ class SimulateResponse extends basemodel_1.default {
|
|
|
1971
2395
|
evalOverrides: typeof data['eval-overrides'] !== 'undefined'
|
|
1972
2396
|
? SimulationEvalOverrides.from_obj_for_encoding(data['eval-overrides'])
|
|
1973
2397
|
: undefined,
|
|
2398
|
+
execTraceConfig: typeof data['exec-trace-config'] !== 'undefined'
|
|
2399
|
+
? SimulateTraceConfig.from_obj_for_encoding(data['exec-trace-config'])
|
|
2400
|
+
: undefined,
|
|
2401
|
+
initialStates: typeof data['initial-states'] !== 'undefined'
|
|
2402
|
+
? SimulateInitialStates.from_obj_for_encoding(data['initial-states'])
|
|
2403
|
+
: undefined,
|
|
1974
2404
|
});
|
|
1975
2405
|
/* eslint-enable dot-notation */
|
|
1976
2406
|
}
|
|
1977
2407
|
}
|
|
1978
2408
|
exports.SimulateResponse = SimulateResponse;
|
|
2409
|
+
/**
|
|
2410
|
+
* An object that configures simulation execution trace.
|
|
2411
|
+
*/
|
|
2412
|
+
class SimulateTraceConfig extends basemodel_1.default {
|
|
2413
|
+
/**
|
|
2414
|
+
* Creates a new `SimulateTraceConfig` object.
|
|
2415
|
+
* @param enable - A boolean option for opting in execution trace features simulation endpoint.
|
|
2416
|
+
* @param scratchChange - A boolean option enabling returning scratch slot changes together with execution
|
|
2417
|
+
* trace during simulation.
|
|
2418
|
+
* @param stackChange - A boolean option enabling returning stack changes together with execution trace
|
|
2419
|
+
* during simulation.
|
|
2420
|
+
* @param stateChange - A boolean option enabling returning application state changes (global, local,
|
|
2421
|
+
* and box changes) with the execution trace during simulation.
|
|
2422
|
+
*/
|
|
2423
|
+
constructor({ enable, scratchChange, stackChange, stateChange, }) {
|
|
2424
|
+
super();
|
|
2425
|
+
this.enable = enable;
|
|
2426
|
+
this.scratchChange = scratchChange;
|
|
2427
|
+
this.stackChange = stackChange;
|
|
2428
|
+
this.stateChange = stateChange;
|
|
2429
|
+
this.attribute_map = {
|
|
2430
|
+
enable: 'enable',
|
|
2431
|
+
scratchChange: 'scratch-change',
|
|
2432
|
+
stackChange: 'stack-change',
|
|
2433
|
+
stateChange: 'state-change',
|
|
2434
|
+
};
|
|
2435
|
+
}
|
|
2436
|
+
// eslint-disable-next-line camelcase
|
|
2437
|
+
static from_obj_for_encoding(data) {
|
|
2438
|
+
/* eslint-disable dot-notation */
|
|
2439
|
+
return new SimulateTraceConfig({
|
|
2440
|
+
enable: data['enable'],
|
|
2441
|
+
scratchChange: data['scratch-change'],
|
|
2442
|
+
stackChange: data['stack-change'],
|
|
2443
|
+
stateChange: data['state-change'],
|
|
2444
|
+
});
|
|
2445
|
+
/* eslint-enable dot-notation */
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
exports.SimulateTraceConfig = SimulateTraceConfig;
|
|
1979
2449
|
/**
|
|
1980
2450
|
* Simulation result for an atomic transaction group
|
|
1981
2451
|
*/
|
|
@@ -1991,20 +2461,31 @@ class SimulateTransactionGroupResult extends basemodel_1.default {
|
|
|
1991
2461
|
* indicate deeper inner transactions.
|
|
1992
2462
|
* @param failureMessage - If present, indicates that the transaction group failed and specifies why that
|
|
1993
2463
|
* happened
|
|
2464
|
+
* @param unnamedResourcesAccessed - These are resources that were accessed by this group that would normally have
|
|
2465
|
+
* caused failure, but were allowed in simulation. Depending on where this object
|
|
2466
|
+
* is in the response, the unnamed resources it contains may or may not qualify for
|
|
2467
|
+
* group resource sharing. If this is a field in SimulateTransactionGroupResult,
|
|
2468
|
+
* the resources do qualify, but if this is a field in SimulateTransactionResult,
|
|
2469
|
+
* they do not qualify. In order to make this group valid for actual submission,
|
|
2470
|
+
* resources that qualify for group sharing can be made available by any
|
|
2471
|
+
* transaction of the group; otherwise, resources must be placed in the same
|
|
2472
|
+
* transaction which accessed them.
|
|
1994
2473
|
*/
|
|
1995
|
-
constructor({ txnResults, appBudgetAdded, appBudgetConsumed, failedAt, failureMessage, }) {
|
|
2474
|
+
constructor({ txnResults, appBudgetAdded, appBudgetConsumed, failedAt, failureMessage, unnamedResourcesAccessed, }) {
|
|
1996
2475
|
super();
|
|
1997
2476
|
this.txnResults = txnResults;
|
|
1998
2477
|
this.appBudgetAdded = appBudgetAdded;
|
|
1999
2478
|
this.appBudgetConsumed = appBudgetConsumed;
|
|
2000
2479
|
this.failedAt = failedAt;
|
|
2001
2480
|
this.failureMessage = failureMessage;
|
|
2481
|
+
this.unnamedResourcesAccessed = unnamedResourcesAccessed;
|
|
2002
2482
|
this.attribute_map = {
|
|
2003
2483
|
txnResults: 'txn-results',
|
|
2004
2484
|
appBudgetAdded: 'app-budget-added',
|
|
2005
2485
|
appBudgetConsumed: 'app-budget-consumed',
|
|
2006
2486
|
failedAt: 'failed-at',
|
|
2007
2487
|
failureMessage: 'failure-message',
|
|
2488
|
+
unnamedResourcesAccessed: 'unnamed-resources-accessed',
|
|
2008
2489
|
};
|
|
2009
2490
|
}
|
|
2010
2491
|
// eslint-disable-next-line camelcase
|
|
@@ -2018,6 +2499,9 @@ class SimulateTransactionGroupResult extends basemodel_1.default {
|
|
|
2018
2499
|
appBudgetConsumed: data['app-budget-consumed'],
|
|
2019
2500
|
failedAt: data['failed-at'],
|
|
2020
2501
|
failureMessage: data['failure-message'],
|
|
2502
|
+
unnamedResourcesAccessed: typeof data['unnamed-resources-accessed'] !== 'undefined'
|
|
2503
|
+
? SimulateUnnamedResourcesAccessed.from_obj_for_encoding(data['unnamed-resources-accessed'])
|
|
2504
|
+
: undefined,
|
|
2021
2505
|
});
|
|
2022
2506
|
/* eslint-enable dot-notation */
|
|
2023
2507
|
}
|
|
@@ -2033,17 +2517,32 @@ class SimulateTransactionResult extends basemodel_1.default {
|
|
|
2033
2517
|
* includes confirmation details like the round and reward details.
|
|
2034
2518
|
* @param appBudgetConsumed - Budget used during execution of an app call transaction. This value includes
|
|
2035
2519
|
* budged used by inner app calls spawned by this transaction.
|
|
2520
|
+
* @param execTrace - The execution trace of calling an app or a logic sig, containing the inner app
|
|
2521
|
+
* call trace in a recursive way.
|
|
2036
2522
|
* @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
|
|
2523
|
+
* @param unnamedResourcesAccessed - These are resources that were accessed by this group that would normally have
|
|
2524
|
+
* caused failure, but were allowed in simulation. Depending on where this object
|
|
2525
|
+
* is in the response, the unnamed resources it contains may or may not qualify for
|
|
2526
|
+
* group resource sharing. If this is a field in SimulateTransactionGroupResult,
|
|
2527
|
+
* the resources do qualify, but if this is a field in SimulateTransactionResult,
|
|
2528
|
+
* they do not qualify. In order to make this group valid for actual submission,
|
|
2529
|
+
* resources that qualify for group sharing can be made available by any
|
|
2530
|
+
* transaction of the group; otherwise, resources must be placed in the same
|
|
2531
|
+
* transaction which accessed them.
|
|
2037
2532
|
*/
|
|
2038
|
-
constructor({ txnResult, appBudgetConsumed, logicSigBudgetConsumed, }) {
|
|
2533
|
+
constructor({ txnResult, appBudgetConsumed, execTrace, logicSigBudgetConsumed, unnamedResourcesAccessed, }) {
|
|
2039
2534
|
super();
|
|
2040
2535
|
this.txnResult = txnResult;
|
|
2041
2536
|
this.appBudgetConsumed = appBudgetConsumed;
|
|
2537
|
+
this.execTrace = execTrace;
|
|
2042
2538
|
this.logicSigBudgetConsumed = logicSigBudgetConsumed;
|
|
2539
|
+
this.unnamedResourcesAccessed = unnamedResourcesAccessed;
|
|
2043
2540
|
this.attribute_map = {
|
|
2044
2541
|
txnResult: 'txn-result',
|
|
2045
2542
|
appBudgetConsumed: 'app-budget-consumed',
|
|
2543
|
+
execTrace: 'exec-trace',
|
|
2046
2544
|
logicSigBudgetConsumed: 'logic-sig-budget-consumed',
|
|
2545
|
+
unnamedResourcesAccessed: 'unnamed-resources-accessed',
|
|
2047
2546
|
};
|
|
2048
2547
|
}
|
|
2049
2548
|
// eslint-disable-next-line camelcase
|
|
@@ -2054,12 +2553,86 @@ class SimulateTransactionResult extends basemodel_1.default {
|
|
|
2054
2553
|
return new SimulateTransactionResult({
|
|
2055
2554
|
txnResult: PendingTransactionResponse.from_obj_for_encoding(data['txn-result']),
|
|
2056
2555
|
appBudgetConsumed: data['app-budget-consumed'],
|
|
2556
|
+
execTrace: typeof data['exec-trace'] !== 'undefined'
|
|
2557
|
+
? SimulationTransactionExecTrace.from_obj_for_encoding(data['exec-trace'])
|
|
2558
|
+
: undefined,
|
|
2057
2559
|
logicSigBudgetConsumed: data['logic-sig-budget-consumed'],
|
|
2560
|
+
unnamedResourcesAccessed: typeof data['unnamed-resources-accessed'] !== 'undefined'
|
|
2561
|
+
? SimulateUnnamedResourcesAccessed.from_obj_for_encoding(data['unnamed-resources-accessed'])
|
|
2562
|
+
: undefined,
|
|
2058
2563
|
});
|
|
2059
2564
|
/* eslint-enable dot-notation */
|
|
2060
2565
|
}
|
|
2061
2566
|
}
|
|
2062
2567
|
exports.SimulateTransactionResult = SimulateTransactionResult;
|
|
2568
|
+
/**
|
|
2569
|
+
* These are resources that were accessed by this group that would normally have
|
|
2570
|
+
* caused failure, but were allowed in simulation. Depending on where this object
|
|
2571
|
+
* is in the response, the unnamed resources it contains may or may not qualify for
|
|
2572
|
+
* group resource sharing. If this is a field in SimulateTransactionGroupResult,
|
|
2573
|
+
* the resources do qualify, but if this is a field in SimulateTransactionResult,
|
|
2574
|
+
* they do not qualify. In order to make this group valid for actual submission,
|
|
2575
|
+
* resources that qualify for group sharing can be made available by any
|
|
2576
|
+
* transaction of the group; otherwise, resources must be placed in the same
|
|
2577
|
+
* transaction which accessed them.
|
|
2578
|
+
*/
|
|
2579
|
+
class SimulateUnnamedResourcesAccessed extends basemodel_1.default {
|
|
2580
|
+
/**
|
|
2581
|
+
* Creates a new `SimulateUnnamedResourcesAccessed` object.
|
|
2582
|
+
* @param accounts - The unnamed accounts that were referenced. The order of this array is arbitrary.
|
|
2583
|
+
* @param appLocals - The unnamed application local states that were referenced. The order of this
|
|
2584
|
+
* array is arbitrary.
|
|
2585
|
+
* @param apps - The unnamed applications that were referenced. The order of this array is
|
|
2586
|
+
* arbitrary.
|
|
2587
|
+
* @param assetHoldings - The unnamed asset holdings that were referenced. The order of this array is
|
|
2588
|
+
* arbitrary.
|
|
2589
|
+
* @param assets - The unnamed assets that were referenced. The order of this array is arbitrary.
|
|
2590
|
+
* @param boxes - The unnamed boxes that were referenced. The order of this array is arbitrary.
|
|
2591
|
+
* @param extraBoxRefs - The number of extra box references used to increase the IO budget. This is in
|
|
2592
|
+
* addition to the references defined in the input transaction group and any
|
|
2593
|
+
* referenced to unnamed boxes.
|
|
2594
|
+
*/
|
|
2595
|
+
constructor({ accounts, appLocals, apps, assetHoldings, assets, boxes, extraBoxRefs, }) {
|
|
2596
|
+
super();
|
|
2597
|
+
this.accounts = accounts;
|
|
2598
|
+
this.appLocals = appLocals;
|
|
2599
|
+
this.apps = apps;
|
|
2600
|
+
this.assetHoldings = assetHoldings;
|
|
2601
|
+
this.assets = assets;
|
|
2602
|
+
this.boxes = boxes;
|
|
2603
|
+
this.extraBoxRefs = extraBoxRefs;
|
|
2604
|
+
this.attribute_map = {
|
|
2605
|
+
accounts: 'accounts',
|
|
2606
|
+
appLocals: 'app-locals',
|
|
2607
|
+
apps: 'apps',
|
|
2608
|
+
assetHoldings: 'asset-holdings',
|
|
2609
|
+
assets: 'assets',
|
|
2610
|
+
boxes: 'boxes',
|
|
2611
|
+
extraBoxRefs: 'extra-box-refs',
|
|
2612
|
+
};
|
|
2613
|
+
}
|
|
2614
|
+
// eslint-disable-next-line camelcase
|
|
2615
|
+
static from_obj_for_encoding(data) {
|
|
2616
|
+
/* eslint-disable dot-notation */
|
|
2617
|
+
return new SimulateUnnamedResourcesAccessed({
|
|
2618
|
+
accounts: data['accounts'],
|
|
2619
|
+
appLocals: typeof data['app-locals'] !== 'undefined'
|
|
2620
|
+
? data['app-locals'].map(ApplicationLocalReference.from_obj_for_encoding)
|
|
2621
|
+
: undefined,
|
|
2622
|
+
apps: data['apps'],
|
|
2623
|
+
assetHoldings: typeof data['asset-holdings'] !== 'undefined'
|
|
2624
|
+
? data['asset-holdings'].map(AssetHoldingReference.from_obj_for_encoding)
|
|
2625
|
+
: undefined,
|
|
2626
|
+
assets: data['assets'],
|
|
2627
|
+
boxes: typeof data['boxes'] !== 'undefined'
|
|
2628
|
+
? data['boxes'].map(BoxReference.from_obj_for_encoding)
|
|
2629
|
+
: undefined,
|
|
2630
|
+
extraBoxRefs: data['extra-box-refs'],
|
|
2631
|
+
});
|
|
2632
|
+
/* eslint-enable dot-notation */
|
|
2633
|
+
}
|
|
2634
|
+
}
|
|
2635
|
+
exports.SimulateUnnamedResourcesAccessed = SimulateUnnamedResourcesAccessed;
|
|
2063
2636
|
/**
|
|
2064
2637
|
* The set of parameters and limits override during simulation. If this set of
|
|
2065
2638
|
* parameters is present, then evaluation parameters may differ from standard
|
|
@@ -2070,18 +2643,21 @@ class SimulationEvalOverrides extends basemodel_1.default {
|
|
|
2070
2643
|
* Creates a new `SimulationEvalOverrides` object.
|
|
2071
2644
|
* @param allowEmptySignatures - If true, transactions without signatures are allowed and simulated as if they
|
|
2072
2645
|
* were properly signed.
|
|
2646
|
+
* @param allowUnnamedResources - If true, allows access to unnamed resources during simulation.
|
|
2073
2647
|
* @param extraOpcodeBudget - The extra opcode budget added to each transaction group during simulation
|
|
2074
2648
|
* @param maxLogCalls - The maximum log calls one can make during simulation
|
|
2075
2649
|
* @param maxLogSize - The maximum byte number to log during simulation
|
|
2076
2650
|
*/
|
|
2077
|
-
constructor({ allowEmptySignatures, extraOpcodeBudget, maxLogCalls, maxLogSize, }) {
|
|
2651
|
+
constructor({ allowEmptySignatures, allowUnnamedResources, extraOpcodeBudget, maxLogCalls, maxLogSize, }) {
|
|
2078
2652
|
super();
|
|
2079
2653
|
this.allowEmptySignatures = allowEmptySignatures;
|
|
2654
|
+
this.allowUnnamedResources = allowUnnamedResources;
|
|
2080
2655
|
this.extraOpcodeBudget = extraOpcodeBudget;
|
|
2081
2656
|
this.maxLogCalls = maxLogCalls;
|
|
2082
2657
|
this.maxLogSize = maxLogSize;
|
|
2083
2658
|
this.attribute_map = {
|
|
2084
2659
|
allowEmptySignatures: 'allow-empty-signatures',
|
|
2660
|
+
allowUnnamedResources: 'allow-unnamed-resources',
|
|
2085
2661
|
extraOpcodeBudget: 'extra-opcode-budget',
|
|
2086
2662
|
maxLogCalls: 'max-log-calls',
|
|
2087
2663
|
maxLogSize: 'max-log-size',
|
|
@@ -2092,6 +2668,7 @@ class SimulationEvalOverrides extends basemodel_1.default {
|
|
|
2092
2668
|
/* eslint-disable dot-notation */
|
|
2093
2669
|
return new SimulationEvalOverrides({
|
|
2094
2670
|
allowEmptySignatures: data['allow-empty-signatures'],
|
|
2671
|
+
allowUnnamedResources: data['allow-unnamed-resources'],
|
|
2095
2672
|
extraOpcodeBudget: data['extra-opcode-budget'],
|
|
2096
2673
|
maxLogCalls: data['max-log-calls'],
|
|
2097
2674
|
maxLogSize: data['max-log-size'],
|
|
@@ -2100,6 +2677,127 @@ class SimulationEvalOverrides extends basemodel_1.default {
|
|
|
2100
2677
|
}
|
|
2101
2678
|
}
|
|
2102
2679
|
exports.SimulationEvalOverrides = SimulationEvalOverrides;
|
|
2680
|
+
/**
|
|
2681
|
+
* The set of trace information and effect from evaluating a single opcode.
|
|
2682
|
+
*/
|
|
2683
|
+
class SimulationOpcodeTraceUnit extends basemodel_1.default {
|
|
2684
|
+
/**
|
|
2685
|
+
* Creates a new `SimulationOpcodeTraceUnit` object.
|
|
2686
|
+
* @param pc - The program counter of the current opcode being evaluated.
|
|
2687
|
+
* @param scratchChanges - The writes into scratch slots.
|
|
2688
|
+
* @param spawnedInners - The indexes of the traces for inner transactions spawned by this opcode, if any.
|
|
2689
|
+
* @param stackAdditions - The values added by this opcode to the stack.
|
|
2690
|
+
* @param stackPopCount - The number of deleted stack values by this opcode.
|
|
2691
|
+
* @param stateChanges - The operations against the current application's states.
|
|
2692
|
+
*/
|
|
2693
|
+
constructor({ pc, scratchChanges, spawnedInners, stackAdditions, stackPopCount, stateChanges, }) {
|
|
2694
|
+
super();
|
|
2695
|
+
this.pc = pc;
|
|
2696
|
+
this.scratchChanges = scratchChanges;
|
|
2697
|
+
this.spawnedInners = spawnedInners;
|
|
2698
|
+
this.stackAdditions = stackAdditions;
|
|
2699
|
+
this.stackPopCount = stackPopCount;
|
|
2700
|
+
this.stateChanges = stateChanges;
|
|
2701
|
+
this.attribute_map = {
|
|
2702
|
+
pc: 'pc',
|
|
2703
|
+
scratchChanges: 'scratch-changes',
|
|
2704
|
+
spawnedInners: 'spawned-inners',
|
|
2705
|
+
stackAdditions: 'stack-additions',
|
|
2706
|
+
stackPopCount: 'stack-pop-count',
|
|
2707
|
+
stateChanges: 'state-changes',
|
|
2708
|
+
};
|
|
2709
|
+
}
|
|
2710
|
+
// eslint-disable-next-line camelcase
|
|
2711
|
+
static from_obj_for_encoding(data) {
|
|
2712
|
+
/* eslint-disable dot-notation */
|
|
2713
|
+
if (typeof data['pc'] === 'undefined')
|
|
2714
|
+
throw new Error(`Response is missing required field 'pc': ${data}`);
|
|
2715
|
+
return new SimulationOpcodeTraceUnit({
|
|
2716
|
+
pc: data['pc'],
|
|
2717
|
+
scratchChanges: typeof data['scratch-changes'] !== 'undefined'
|
|
2718
|
+
? data['scratch-changes'].map(ScratchChange.from_obj_for_encoding)
|
|
2719
|
+
: undefined,
|
|
2720
|
+
spawnedInners: data['spawned-inners'],
|
|
2721
|
+
stackAdditions: typeof data['stack-additions'] !== 'undefined'
|
|
2722
|
+
? data['stack-additions'].map(AvmValue.from_obj_for_encoding)
|
|
2723
|
+
: undefined,
|
|
2724
|
+
stackPopCount: data['stack-pop-count'],
|
|
2725
|
+
stateChanges: typeof data['state-changes'] !== 'undefined'
|
|
2726
|
+
? data['state-changes'].map(ApplicationStateOperation.from_obj_for_encoding)
|
|
2727
|
+
: undefined,
|
|
2728
|
+
});
|
|
2729
|
+
/* eslint-enable dot-notation */
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
2732
|
+
exports.SimulationOpcodeTraceUnit = SimulationOpcodeTraceUnit;
|
|
2733
|
+
/**
|
|
2734
|
+
* The execution trace of calling an app or a logic sig, containing the inner app
|
|
2735
|
+
* call trace in a recursive way.
|
|
2736
|
+
*/
|
|
2737
|
+
class SimulationTransactionExecTrace extends basemodel_1.default {
|
|
2738
|
+
/**
|
|
2739
|
+
* Creates a new `SimulationTransactionExecTrace` object.
|
|
2740
|
+
* @param approvalProgramHash - SHA512_256 hash digest of the approval program executed in transaction.
|
|
2741
|
+
* @param approvalProgramTrace - Program trace that contains a trace of opcode effects in an approval program.
|
|
2742
|
+
* @param clearStateProgramHash - SHA512_256 hash digest of the clear state program executed in transaction.
|
|
2743
|
+
* @param clearStateProgramTrace - Program trace that contains a trace of opcode effects in a clear state program.
|
|
2744
|
+
* @param innerTrace - An array of SimulationTransactionExecTrace representing the execution trace of
|
|
2745
|
+
* any inner transactions executed.
|
|
2746
|
+
* @param logicSigHash - SHA512_256 hash digest of the logic sig executed in transaction.
|
|
2747
|
+
* @param logicSigTrace - Program trace that contains a trace of opcode effects in a logic sig.
|
|
2748
|
+
*/
|
|
2749
|
+
constructor({ approvalProgramHash, approvalProgramTrace, clearStateProgramHash, clearStateProgramTrace, innerTrace, logicSigHash, logicSigTrace, }) {
|
|
2750
|
+
super();
|
|
2751
|
+
this.approvalProgramHash =
|
|
2752
|
+
typeof approvalProgramHash === 'string'
|
|
2753
|
+
? new Uint8Array(buffer_1.Buffer.from(approvalProgramHash, 'base64'))
|
|
2754
|
+
: approvalProgramHash;
|
|
2755
|
+
this.approvalProgramTrace = approvalProgramTrace;
|
|
2756
|
+
this.clearStateProgramHash =
|
|
2757
|
+
typeof clearStateProgramHash === 'string'
|
|
2758
|
+
? new Uint8Array(buffer_1.Buffer.from(clearStateProgramHash, 'base64'))
|
|
2759
|
+
: clearStateProgramHash;
|
|
2760
|
+
this.clearStateProgramTrace = clearStateProgramTrace;
|
|
2761
|
+
this.innerTrace = innerTrace;
|
|
2762
|
+
this.logicSigHash =
|
|
2763
|
+
typeof logicSigHash === 'string'
|
|
2764
|
+
? new Uint8Array(buffer_1.Buffer.from(logicSigHash, 'base64'))
|
|
2765
|
+
: logicSigHash;
|
|
2766
|
+
this.logicSigTrace = logicSigTrace;
|
|
2767
|
+
this.attribute_map = {
|
|
2768
|
+
approvalProgramHash: 'approval-program-hash',
|
|
2769
|
+
approvalProgramTrace: 'approval-program-trace',
|
|
2770
|
+
clearStateProgramHash: 'clear-state-program-hash',
|
|
2771
|
+
clearStateProgramTrace: 'clear-state-program-trace',
|
|
2772
|
+
innerTrace: 'inner-trace',
|
|
2773
|
+
logicSigHash: 'logic-sig-hash',
|
|
2774
|
+
logicSigTrace: 'logic-sig-trace',
|
|
2775
|
+
};
|
|
2776
|
+
}
|
|
2777
|
+
// eslint-disable-next-line camelcase
|
|
2778
|
+
static from_obj_for_encoding(data) {
|
|
2779
|
+
/* eslint-disable dot-notation */
|
|
2780
|
+
return new SimulationTransactionExecTrace({
|
|
2781
|
+
approvalProgramHash: data['approval-program-hash'],
|
|
2782
|
+
approvalProgramTrace: typeof data['approval-program-trace'] !== 'undefined'
|
|
2783
|
+
? data['approval-program-trace'].map(SimulationOpcodeTraceUnit.from_obj_for_encoding)
|
|
2784
|
+
: undefined,
|
|
2785
|
+
clearStateProgramHash: data['clear-state-program-hash'],
|
|
2786
|
+
clearStateProgramTrace: typeof data['clear-state-program-trace'] !== 'undefined'
|
|
2787
|
+
? data['clear-state-program-trace'].map(SimulationOpcodeTraceUnit.from_obj_for_encoding)
|
|
2788
|
+
: undefined,
|
|
2789
|
+
innerTrace: typeof data['inner-trace'] !== 'undefined'
|
|
2790
|
+
? data['inner-trace'].map(SimulationTransactionExecTrace.from_obj_for_encoding)
|
|
2791
|
+
: undefined,
|
|
2792
|
+
logicSigHash: data['logic-sig-hash'],
|
|
2793
|
+
logicSigTrace: typeof data['logic-sig-trace'] !== 'undefined'
|
|
2794
|
+
? data['logic-sig-trace'].map(SimulationOpcodeTraceUnit.from_obj_for_encoding)
|
|
2795
|
+
: undefined,
|
|
2796
|
+
});
|
|
2797
|
+
/* eslint-enable dot-notation */
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
exports.SimulationTransactionExecTrace = SimulationTransactionExecTrace;
|
|
2103
2801
|
/**
|
|
2104
2802
|
* Represents a state proof and its corresponding message
|
|
2105
2803
|
*/
|
|
@@ -2319,7 +3017,7 @@ class TransactionGroupLedgerStateDeltasForRoundResponse extends basemodel_1.defa
|
|
|
2319
3017
|
super();
|
|
2320
3018
|
this.deltas = deltas;
|
|
2321
3019
|
this.attribute_map = {
|
|
2322
|
-
deltas: '
|
|
3020
|
+
deltas: 'Deltas',
|
|
2323
3021
|
};
|
|
2324
3022
|
}
|
|
2325
3023
|
// eslint-disable-next-line camelcase
|