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
|
@@ -784,6 +784,183 @@ export class Application extends BaseModel {
|
|
|
784
784
|
}
|
|
785
785
|
}
|
|
786
786
|
|
|
787
|
+
/**
|
|
788
|
+
* An application's initial global/local/box states that were accessed during
|
|
789
|
+
* simulation.
|
|
790
|
+
*/
|
|
791
|
+
export class ApplicationInitialStates extends BaseModel {
|
|
792
|
+
/**
|
|
793
|
+
* Application index.
|
|
794
|
+
*/
|
|
795
|
+
public id: number | bigint;
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* An application's global/local/box state.
|
|
799
|
+
*/
|
|
800
|
+
public appBoxes?: ApplicationKVStorage;
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* An application's global/local/box state.
|
|
804
|
+
*/
|
|
805
|
+
public appGlobals?: ApplicationKVStorage;
|
|
806
|
+
|
|
807
|
+
/**
|
|
808
|
+
* An application's initial local states tied to different accounts.
|
|
809
|
+
*/
|
|
810
|
+
public appLocals?: ApplicationKVStorage[];
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* Creates a new `ApplicationInitialStates` object.
|
|
814
|
+
* @param id - Application index.
|
|
815
|
+
* @param appBoxes - An application's global/local/box state.
|
|
816
|
+
* @param appGlobals - An application's global/local/box state.
|
|
817
|
+
* @param appLocals - An application's initial local states tied to different accounts.
|
|
818
|
+
*/
|
|
819
|
+
constructor({
|
|
820
|
+
id,
|
|
821
|
+
appBoxes,
|
|
822
|
+
appGlobals,
|
|
823
|
+
appLocals,
|
|
824
|
+
}: {
|
|
825
|
+
id: number | bigint;
|
|
826
|
+
appBoxes?: ApplicationKVStorage;
|
|
827
|
+
appGlobals?: ApplicationKVStorage;
|
|
828
|
+
appLocals?: ApplicationKVStorage[];
|
|
829
|
+
}) {
|
|
830
|
+
super();
|
|
831
|
+
this.id = id;
|
|
832
|
+
this.appBoxes = appBoxes;
|
|
833
|
+
this.appGlobals = appGlobals;
|
|
834
|
+
this.appLocals = appLocals;
|
|
835
|
+
|
|
836
|
+
this.attribute_map = {
|
|
837
|
+
id: 'id',
|
|
838
|
+
appBoxes: 'app-boxes',
|
|
839
|
+
appGlobals: 'app-globals',
|
|
840
|
+
appLocals: 'app-locals',
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
// eslint-disable-next-line camelcase
|
|
845
|
+
static from_obj_for_encoding(
|
|
846
|
+
data: Record<string, any>
|
|
847
|
+
): ApplicationInitialStates {
|
|
848
|
+
/* eslint-disable dot-notation */
|
|
849
|
+
if (typeof data['id'] === 'undefined')
|
|
850
|
+
throw new Error(`Response is missing required field 'id': ${data}`);
|
|
851
|
+
return new ApplicationInitialStates({
|
|
852
|
+
id: data['id'],
|
|
853
|
+
appBoxes:
|
|
854
|
+
typeof data['app-boxes'] !== 'undefined'
|
|
855
|
+
? ApplicationKVStorage.from_obj_for_encoding(data['app-boxes'])
|
|
856
|
+
: undefined,
|
|
857
|
+
appGlobals:
|
|
858
|
+
typeof data['app-globals'] !== 'undefined'
|
|
859
|
+
? ApplicationKVStorage.from_obj_for_encoding(data['app-globals'])
|
|
860
|
+
: undefined,
|
|
861
|
+
appLocals:
|
|
862
|
+
typeof data['app-locals'] !== 'undefined'
|
|
863
|
+
? data['app-locals'].map(ApplicationKVStorage.from_obj_for_encoding)
|
|
864
|
+
: undefined,
|
|
865
|
+
});
|
|
866
|
+
/* eslint-enable dot-notation */
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* An application's global/local/box state.
|
|
872
|
+
*/
|
|
873
|
+
export class ApplicationKVStorage extends BaseModel {
|
|
874
|
+
/**
|
|
875
|
+
* Key-Value pairs representing application states.
|
|
876
|
+
*/
|
|
877
|
+
public kvs: AvmKeyValue[];
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* The address of the account associated with the local state.
|
|
881
|
+
*/
|
|
882
|
+
public account?: string;
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Creates a new `ApplicationKVStorage` object.
|
|
886
|
+
* @param kvs - Key-Value pairs representing application states.
|
|
887
|
+
* @param account - The address of the account associated with the local state.
|
|
888
|
+
*/
|
|
889
|
+
constructor({ kvs, account }: { kvs: AvmKeyValue[]; account?: string }) {
|
|
890
|
+
super();
|
|
891
|
+
this.kvs = kvs;
|
|
892
|
+
this.account = account;
|
|
893
|
+
|
|
894
|
+
this.attribute_map = {
|
|
895
|
+
kvs: 'kvs',
|
|
896
|
+
account: 'account',
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
// eslint-disable-next-line camelcase
|
|
901
|
+
static from_obj_for_encoding(
|
|
902
|
+
data: Record<string, any>
|
|
903
|
+
): ApplicationKVStorage {
|
|
904
|
+
/* eslint-disable dot-notation */
|
|
905
|
+
if (!Array.isArray(data['kvs']))
|
|
906
|
+
throw new Error(
|
|
907
|
+
`Response is missing required array field 'kvs': ${data}`
|
|
908
|
+
);
|
|
909
|
+
return new ApplicationKVStorage({
|
|
910
|
+
kvs: data['kvs'].map(AvmKeyValue.from_obj_for_encoding),
|
|
911
|
+
account: data['account'],
|
|
912
|
+
});
|
|
913
|
+
/* eslint-enable dot-notation */
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* References an account's local state for an application.
|
|
919
|
+
*/
|
|
920
|
+
export class ApplicationLocalReference extends BaseModel {
|
|
921
|
+
/**
|
|
922
|
+
* Address of the account with the local state.
|
|
923
|
+
*/
|
|
924
|
+
public account: string;
|
|
925
|
+
|
|
926
|
+
/**
|
|
927
|
+
* Application ID of the local state application.
|
|
928
|
+
*/
|
|
929
|
+
public app: number | bigint;
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* Creates a new `ApplicationLocalReference` object.
|
|
933
|
+
* @param account - Address of the account with the local state.
|
|
934
|
+
* @param app - Application ID of the local state application.
|
|
935
|
+
*/
|
|
936
|
+
constructor({ account, app }: { account: string; app: number | bigint }) {
|
|
937
|
+
super();
|
|
938
|
+
this.account = account;
|
|
939
|
+
this.app = app;
|
|
940
|
+
|
|
941
|
+
this.attribute_map = {
|
|
942
|
+
account: 'account',
|
|
943
|
+
app: 'app',
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
// eslint-disable-next-line camelcase
|
|
948
|
+
static from_obj_for_encoding(
|
|
949
|
+
data: Record<string, any>
|
|
950
|
+
): ApplicationLocalReference {
|
|
951
|
+
/* eslint-disable dot-notation */
|
|
952
|
+
if (typeof data['account'] === 'undefined')
|
|
953
|
+
throw new Error(`Response is missing required field 'account': ${data}`);
|
|
954
|
+
if (typeof data['app'] === 'undefined')
|
|
955
|
+
throw new Error(`Response is missing required field 'app': ${data}`);
|
|
956
|
+
return new ApplicationLocalReference({
|
|
957
|
+
account: data['account'],
|
|
958
|
+
app: data['app'],
|
|
959
|
+
});
|
|
960
|
+
/* eslint-enable dot-notation */
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
|
|
787
964
|
/**
|
|
788
965
|
* Stores local state associated with an application.
|
|
789
966
|
*/
|
|
@@ -984,6 +1161,108 @@ export class ApplicationParams extends BaseModel {
|
|
|
984
1161
|
}
|
|
985
1162
|
}
|
|
986
1163
|
|
|
1164
|
+
/**
|
|
1165
|
+
* An operation against an application's global/local/box state.
|
|
1166
|
+
*/
|
|
1167
|
+
export class ApplicationStateOperation extends BaseModel {
|
|
1168
|
+
/**
|
|
1169
|
+
* Type of application state. Value `g` is **global state**, `l` is **local
|
|
1170
|
+
* state**, `b` is **boxes**.
|
|
1171
|
+
*/
|
|
1172
|
+
public appStateType: string;
|
|
1173
|
+
|
|
1174
|
+
/**
|
|
1175
|
+
* The key (name) of the global/local/box state.
|
|
1176
|
+
*/
|
|
1177
|
+
public key: Uint8Array;
|
|
1178
|
+
|
|
1179
|
+
/**
|
|
1180
|
+
* Operation type. Value `w` is **write**, `d` is **delete**.
|
|
1181
|
+
*/
|
|
1182
|
+
public operation: string;
|
|
1183
|
+
|
|
1184
|
+
/**
|
|
1185
|
+
* For local state changes, the address of the account associated with the local
|
|
1186
|
+
* state.
|
|
1187
|
+
*/
|
|
1188
|
+
public account?: string;
|
|
1189
|
+
|
|
1190
|
+
/**
|
|
1191
|
+
* Represents an AVM value.
|
|
1192
|
+
*/
|
|
1193
|
+
public newValue?: AvmValue;
|
|
1194
|
+
|
|
1195
|
+
/**
|
|
1196
|
+
* Creates a new `ApplicationStateOperation` object.
|
|
1197
|
+
* @param appStateType - Type of application state. Value `g` is **global state**, `l` is **local
|
|
1198
|
+
* state**, `b` is **boxes**.
|
|
1199
|
+
* @param key - The key (name) of the global/local/box state.
|
|
1200
|
+
* @param operation - Operation type. Value `w` is **write**, `d` is **delete**.
|
|
1201
|
+
* @param account - For local state changes, the address of the account associated with the local
|
|
1202
|
+
* state.
|
|
1203
|
+
* @param newValue - Represents an AVM value.
|
|
1204
|
+
*/
|
|
1205
|
+
constructor({
|
|
1206
|
+
appStateType,
|
|
1207
|
+
key,
|
|
1208
|
+
operation,
|
|
1209
|
+
account,
|
|
1210
|
+
newValue,
|
|
1211
|
+
}: {
|
|
1212
|
+
appStateType: string;
|
|
1213
|
+
key: string | Uint8Array;
|
|
1214
|
+
operation: string;
|
|
1215
|
+
account?: string;
|
|
1216
|
+
newValue?: AvmValue;
|
|
1217
|
+
}) {
|
|
1218
|
+
super();
|
|
1219
|
+
this.appStateType = appStateType;
|
|
1220
|
+
this.key =
|
|
1221
|
+
typeof key === 'string'
|
|
1222
|
+
? new Uint8Array(Buffer.from(key, 'base64'))
|
|
1223
|
+
: key;
|
|
1224
|
+
this.operation = operation;
|
|
1225
|
+
this.account = account;
|
|
1226
|
+
this.newValue = newValue;
|
|
1227
|
+
|
|
1228
|
+
this.attribute_map = {
|
|
1229
|
+
appStateType: 'app-state-type',
|
|
1230
|
+
key: 'key',
|
|
1231
|
+
operation: 'operation',
|
|
1232
|
+
account: 'account',
|
|
1233
|
+
newValue: 'new-value',
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
// eslint-disable-next-line camelcase
|
|
1238
|
+
static from_obj_for_encoding(
|
|
1239
|
+
data: Record<string, any>
|
|
1240
|
+
): ApplicationStateOperation {
|
|
1241
|
+
/* eslint-disable dot-notation */
|
|
1242
|
+
if (typeof data['app-state-type'] === 'undefined')
|
|
1243
|
+
throw new Error(
|
|
1244
|
+
`Response is missing required field 'app-state-type': ${data}`
|
|
1245
|
+
);
|
|
1246
|
+
if (typeof data['key'] === 'undefined')
|
|
1247
|
+
throw new Error(`Response is missing required field 'key': ${data}`);
|
|
1248
|
+
if (typeof data['operation'] === 'undefined')
|
|
1249
|
+
throw new Error(
|
|
1250
|
+
`Response is missing required field 'operation': ${data}`
|
|
1251
|
+
);
|
|
1252
|
+
return new ApplicationStateOperation({
|
|
1253
|
+
appStateType: data['app-state-type'],
|
|
1254
|
+
key: data['key'],
|
|
1255
|
+
operation: data['operation'],
|
|
1256
|
+
account: data['account'],
|
|
1257
|
+
newValue:
|
|
1258
|
+
typeof data['new-value'] !== 'undefined'
|
|
1259
|
+
? AvmValue.from_obj_for_encoding(data['new-value'])
|
|
1260
|
+
: undefined,
|
|
1261
|
+
});
|
|
1262
|
+
/* eslint-enable dot-notation */
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
|
|
987
1266
|
/**
|
|
988
1267
|
* Specifies maximums on the number of each type that may be stored.
|
|
989
1268
|
*/
|
|
@@ -1164,6 +1443,53 @@ export class AssetHolding extends BaseModel {
|
|
|
1164
1443
|
}
|
|
1165
1444
|
}
|
|
1166
1445
|
|
|
1446
|
+
/**
|
|
1447
|
+
* References an asset held by an account.
|
|
1448
|
+
*/
|
|
1449
|
+
export class AssetHoldingReference extends BaseModel {
|
|
1450
|
+
/**
|
|
1451
|
+
* Address of the account holding the asset.
|
|
1452
|
+
*/
|
|
1453
|
+
public account: string;
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* Asset ID of the holding.
|
|
1457
|
+
*/
|
|
1458
|
+
public asset: number | bigint;
|
|
1459
|
+
|
|
1460
|
+
/**
|
|
1461
|
+
* Creates a new `AssetHoldingReference` object.
|
|
1462
|
+
* @param account - Address of the account holding the asset.
|
|
1463
|
+
* @param asset - Asset ID of the holding.
|
|
1464
|
+
*/
|
|
1465
|
+
constructor({ account, asset }: { account: string; asset: number | bigint }) {
|
|
1466
|
+
super();
|
|
1467
|
+
this.account = account;
|
|
1468
|
+
this.asset = asset;
|
|
1469
|
+
|
|
1470
|
+
this.attribute_map = {
|
|
1471
|
+
account: 'account',
|
|
1472
|
+
asset: 'asset',
|
|
1473
|
+
};
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
// eslint-disable-next-line camelcase
|
|
1477
|
+
static from_obj_for_encoding(
|
|
1478
|
+
data: Record<string, any>
|
|
1479
|
+
): AssetHoldingReference {
|
|
1480
|
+
/* eslint-disable dot-notation */
|
|
1481
|
+
if (typeof data['account'] === 'undefined')
|
|
1482
|
+
throw new Error(`Response is missing required field 'account': ${data}`);
|
|
1483
|
+
if (typeof data['asset'] === 'undefined')
|
|
1484
|
+
throw new Error(`Response is missing required field 'asset': ${data}`);
|
|
1485
|
+
return new AssetHoldingReference({
|
|
1486
|
+
account: data['account'],
|
|
1487
|
+
asset: data['asset'],
|
|
1488
|
+
});
|
|
1489
|
+
/* eslint-enable dot-notation */
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1167
1493
|
/**
|
|
1168
1494
|
* AssetParams specifies the parameters for an asset.
|
|
1169
1495
|
* (apar) when part of an AssetConfig transaction.
|
|
@@ -1397,6 +1723,114 @@ export class AssetParams extends BaseModel {
|
|
|
1397
1723
|
}
|
|
1398
1724
|
}
|
|
1399
1725
|
|
|
1726
|
+
/**
|
|
1727
|
+
* Represents an AVM key-value pair in an application store.
|
|
1728
|
+
*/
|
|
1729
|
+
export class AvmKeyValue extends BaseModel {
|
|
1730
|
+
public key: Uint8Array;
|
|
1731
|
+
|
|
1732
|
+
/**
|
|
1733
|
+
* Represents an AVM value.
|
|
1734
|
+
*/
|
|
1735
|
+
public value: AvmValue;
|
|
1736
|
+
|
|
1737
|
+
/**
|
|
1738
|
+
* Creates a new `AvmKeyValue` object.
|
|
1739
|
+
* @param key -
|
|
1740
|
+
* @param value - Represents an AVM value.
|
|
1741
|
+
*/
|
|
1742
|
+
constructor({ key, value }: { key: string | Uint8Array; value: AvmValue }) {
|
|
1743
|
+
super();
|
|
1744
|
+
this.key =
|
|
1745
|
+
typeof key === 'string'
|
|
1746
|
+
? new Uint8Array(Buffer.from(key, 'base64'))
|
|
1747
|
+
: key;
|
|
1748
|
+
this.value = value;
|
|
1749
|
+
|
|
1750
|
+
this.attribute_map = {
|
|
1751
|
+
key: 'key',
|
|
1752
|
+
value: 'value',
|
|
1753
|
+
};
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
// eslint-disable-next-line camelcase
|
|
1757
|
+
static from_obj_for_encoding(data: Record<string, any>): AvmKeyValue {
|
|
1758
|
+
/* eslint-disable dot-notation */
|
|
1759
|
+
if (typeof data['key'] === 'undefined')
|
|
1760
|
+
throw new Error(`Response is missing required field 'key': ${data}`);
|
|
1761
|
+
if (typeof data['value'] === 'undefined')
|
|
1762
|
+
throw new Error(`Response is missing required field 'value': ${data}`);
|
|
1763
|
+
return new AvmKeyValue({
|
|
1764
|
+
key: data['key'],
|
|
1765
|
+
value: AvmValue.from_obj_for_encoding(data['value']),
|
|
1766
|
+
});
|
|
1767
|
+
/* eslint-enable dot-notation */
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
/**
|
|
1772
|
+
* Represents an AVM value.
|
|
1773
|
+
*/
|
|
1774
|
+
export class AvmValue extends BaseModel {
|
|
1775
|
+
/**
|
|
1776
|
+
* value type. Value `1` refers to **bytes**, value `2` refers to **uint64**
|
|
1777
|
+
*/
|
|
1778
|
+
public type: number | bigint;
|
|
1779
|
+
|
|
1780
|
+
/**
|
|
1781
|
+
* bytes value.
|
|
1782
|
+
*/
|
|
1783
|
+
public bytes?: Uint8Array;
|
|
1784
|
+
|
|
1785
|
+
/**
|
|
1786
|
+
* uint value.
|
|
1787
|
+
*/
|
|
1788
|
+
public uint?: number | bigint;
|
|
1789
|
+
|
|
1790
|
+
/**
|
|
1791
|
+
* Creates a new `AvmValue` object.
|
|
1792
|
+
* @param type - value type. Value `1` refers to **bytes**, value `2` refers to **uint64**
|
|
1793
|
+
* @param bytes - bytes value.
|
|
1794
|
+
* @param uint - uint value.
|
|
1795
|
+
*/
|
|
1796
|
+
constructor({
|
|
1797
|
+
type,
|
|
1798
|
+
bytes,
|
|
1799
|
+
uint,
|
|
1800
|
+
}: {
|
|
1801
|
+
type: number | bigint;
|
|
1802
|
+
bytes?: string | Uint8Array;
|
|
1803
|
+
uint?: number | bigint;
|
|
1804
|
+
}) {
|
|
1805
|
+
super();
|
|
1806
|
+
this.type = type;
|
|
1807
|
+
this.bytes =
|
|
1808
|
+
typeof bytes === 'string'
|
|
1809
|
+
? new Uint8Array(Buffer.from(bytes, 'base64'))
|
|
1810
|
+
: bytes;
|
|
1811
|
+
this.uint = uint;
|
|
1812
|
+
|
|
1813
|
+
this.attribute_map = {
|
|
1814
|
+
type: 'type',
|
|
1815
|
+
bytes: 'bytes',
|
|
1816
|
+
uint: 'uint',
|
|
1817
|
+
};
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
// eslint-disable-next-line camelcase
|
|
1821
|
+
static from_obj_for_encoding(data: Record<string, any>): AvmValue {
|
|
1822
|
+
/* eslint-disable dot-notation */
|
|
1823
|
+
if (typeof data['type'] === 'undefined')
|
|
1824
|
+
throw new Error(`Response is missing required field 'type': ${data}`);
|
|
1825
|
+
return new AvmValue({
|
|
1826
|
+
type: data['type'],
|
|
1827
|
+
bytes: data['bytes'],
|
|
1828
|
+
uint: data['uint'],
|
|
1829
|
+
});
|
|
1830
|
+
/* eslint-enable dot-notation */
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1400
1834
|
/**
|
|
1401
1835
|
* Hash of a block header.
|
|
1402
1836
|
*/
|
|
@@ -1485,14 +1919,55 @@ export class BlockResponse extends BaseModel {
|
|
|
1485
1919
|
}
|
|
1486
1920
|
|
|
1487
1921
|
/**
|
|
1488
|
-
*
|
|
1922
|
+
* Top level transaction IDs in a block.
|
|
1489
1923
|
*/
|
|
1490
|
-
export class
|
|
1924
|
+
export class BlockTxidsResponse extends BaseModel {
|
|
1925
|
+
/**
|
|
1926
|
+
* Block transaction IDs.
|
|
1927
|
+
*/
|
|
1928
|
+
public blocktxids: string[];
|
|
1929
|
+
|
|
1930
|
+
/**
|
|
1931
|
+
* Creates a new `BlockTxidsResponse` object.
|
|
1932
|
+
* @param blocktxids - Block transaction IDs.
|
|
1933
|
+
*/
|
|
1934
|
+
constructor({ blocktxids }: { blocktxids: string[] }) {
|
|
1935
|
+
super();
|
|
1936
|
+
this.blocktxids = blocktxids;
|
|
1937
|
+
|
|
1938
|
+
this.attribute_map = {
|
|
1939
|
+
blocktxids: 'blockTxids',
|
|
1940
|
+
};
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
// eslint-disable-next-line camelcase
|
|
1944
|
+
static from_obj_for_encoding(data: Record<string, any>): BlockTxidsResponse {
|
|
1945
|
+
/* eslint-disable dot-notation */
|
|
1946
|
+
if (!Array.isArray(data['blockTxids']))
|
|
1947
|
+
throw new Error(
|
|
1948
|
+
`Response is missing required array field 'blockTxids': ${data}`
|
|
1949
|
+
);
|
|
1950
|
+
return new BlockTxidsResponse({
|
|
1951
|
+
blocktxids: data['blockTxids'],
|
|
1952
|
+
});
|
|
1953
|
+
/* eslint-enable dot-notation */
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
/**
|
|
1958
|
+
* Box name and its content.
|
|
1959
|
+
*/
|
|
1960
|
+
export class Box extends BaseModel {
|
|
1491
1961
|
/**
|
|
1492
1962
|
* (name) box name, base64 encoded
|
|
1493
1963
|
*/
|
|
1494
1964
|
public name: Uint8Array;
|
|
1495
1965
|
|
|
1966
|
+
/**
|
|
1967
|
+
* The round for which this information is relevant
|
|
1968
|
+
*/
|
|
1969
|
+
public round: number | bigint;
|
|
1970
|
+
|
|
1496
1971
|
/**
|
|
1497
1972
|
* (value) box value, base64 encoded.
|
|
1498
1973
|
*/
|
|
@@ -1501,13 +1976,16 @@ export class Box extends BaseModel {
|
|
|
1501
1976
|
/**
|
|
1502
1977
|
* Creates a new `Box` object.
|
|
1503
1978
|
* @param name - (name) box name, base64 encoded
|
|
1979
|
+
* @param round - The round for which this information is relevant
|
|
1504
1980
|
* @param value - (value) box value, base64 encoded.
|
|
1505
1981
|
*/
|
|
1506
1982
|
constructor({
|
|
1507
1983
|
name,
|
|
1984
|
+
round,
|
|
1508
1985
|
value,
|
|
1509
1986
|
}: {
|
|
1510
1987
|
name: string | Uint8Array;
|
|
1988
|
+
round: number | bigint;
|
|
1511
1989
|
value: string | Uint8Array;
|
|
1512
1990
|
}) {
|
|
1513
1991
|
super();
|
|
@@ -1515,6 +1993,7 @@ export class Box extends BaseModel {
|
|
|
1515
1993
|
typeof name === 'string'
|
|
1516
1994
|
? new Uint8Array(Buffer.from(name, 'base64'))
|
|
1517
1995
|
: name;
|
|
1996
|
+
this.round = round;
|
|
1518
1997
|
this.value =
|
|
1519
1998
|
typeof value === 'string'
|
|
1520
1999
|
? new Uint8Array(Buffer.from(value, 'base64'))
|
|
@@ -1522,6 +2001,7 @@ export class Box extends BaseModel {
|
|
|
1522
2001
|
|
|
1523
2002
|
this.attribute_map = {
|
|
1524
2003
|
name: 'name',
|
|
2004
|
+
round: 'round',
|
|
1525
2005
|
value: 'value',
|
|
1526
2006
|
};
|
|
1527
2007
|
}
|
|
@@ -1531,10 +2011,13 @@ export class Box extends BaseModel {
|
|
|
1531
2011
|
/* eslint-disable dot-notation */
|
|
1532
2012
|
if (typeof data['name'] === 'undefined')
|
|
1533
2013
|
throw new Error(`Response is missing required field 'name': ${data}`);
|
|
2014
|
+
if (typeof data['round'] === 'undefined')
|
|
2015
|
+
throw new Error(`Response is missing required field 'round': ${data}`);
|
|
1534
2016
|
if (typeof data['value'] === 'undefined')
|
|
1535
2017
|
throw new Error(`Response is missing required field 'value': ${data}`);
|
|
1536
2018
|
return new Box({
|
|
1537
2019
|
name: data['name'],
|
|
2020
|
+
round: data['round'],
|
|
1538
2021
|
value: data['value'],
|
|
1539
2022
|
});
|
|
1540
2023
|
/* eslint-enable dot-notation */
|
|
@@ -1578,6 +2061,60 @@ export class BoxDescriptor extends BaseModel {
|
|
|
1578
2061
|
}
|
|
1579
2062
|
}
|
|
1580
2063
|
|
|
2064
|
+
/**
|
|
2065
|
+
* References a box of an application.
|
|
2066
|
+
*/
|
|
2067
|
+
export class BoxReference extends BaseModel {
|
|
2068
|
+
/**
|
|
2069
|
+
* Application ID which this box belongs to
|
|
2070
|
+
*/
|
|
2071
|
+
public app: number | bigint;
|
|
2072
|
+
|
|
2073
|
+
/**
|
|
2074
|
+
* Base64 encoded box name
|
|
2075
|
+
*/
|
|
2076
|
+
public name: Uint8Array;
|
|
2077
|
+
|
|
2078
|
+
/**
|
|
2079
|
+
* Creates a new `BoxReference` object.
|
|
2080
|
+
* @param app - Application ID which this box belongs to
|
|
2081
|
+
* @param name - Base64 encoded box name
|
|
2082
|
+
*/
|
|
2083
|
+
constructor({
|
|
2084
|
+
app,
|
|
2085
|
+
name,
|
|
2086
|
+
}: {
|
|
2087
|
+
app: number | bigint;
|
|
2088
|
+
name: string | Uint8Array;
|
|
2089
|
+
}) {
|
|
2090
|
+
super();
|
|
2091
|
+
this.app = app;
|
|
2092
|
+
this.name =
|
|
2093
|
+
typeof name === 'string'
|
|
2094
|
+
? new Uint8Array(Buffer.from(name, 'base64'))
|
|
2095
|
+
: name;
|
|
2096
|
+
|
|
2097
|
+
this.attribute_map = {
|
|
2098
|
+
app: 'app',
|
|
2099
|
+
name: 'name',
|
|
2100
|
+
};
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
// eslint-disable-next-line camelcase
|
|
2104
|
+
static from_obj_for_encoding(data: Record<string, any>): BoxReference {
|
|
2105
|
+
/* eslint-disable dot-notation */
|
|
2106
|
+
if (typeof data['app'] === 'undefined')
|
|
2107
|
+
throw new Error(`Response is missing required field 'app': ${data}`);
|
|
2108
|
+
if (typeof data['name'] === 'undefined')
|
|
2109
|
+
throw new Error(`Response is missing required field 'name': ${data}`);
|
|
2110
|
+
return new BoxReference({
|
|
2111
|
+
app: data['app'],
|
|
2112
|
+
name: data['name'],
|
|
2113
|
+
});
|
|
2114
|
+
/* eslint-enable dot-notation */
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
|
|
1581
2118
|
/**
|
|
1582
2119
|
* Box names of an application
|
|
1583
2120
|
*/
|
|
@@ -2580,8 +3117,8 @@ export class LedgerStateDeltaForTransactionGroup extends BaseModel {
|
|
|
2580
3117
|
this.ids = ids;
|
|
2581
3118
|
|
|
2582
3119
|
this.attribute_map = {
|
|
2583
|
-
delta: '
|
|
2584
|
-
ids: '
|
|
3120
|
+
delta: 'Delta',
|
|
3121
|
+
ids: 'Ids',
|
|
2585
3122
|
};
|
|
2586
3123
|
}
|
|
2587
3124
|
|
|
@@ -2590,15 +3127,15 @@ export class LedgerStateDeltaForTransactionGroup extends BaseModel {
|
|
|
2590
3127
|
data: Record<string, any>
|
|
2591
3128
|
): LedgerStateDeltaForTransactionGroup {
|
|
2592
3129
|
/* eslint-disable dot-notation */
|
|
2593
|
-
if (typeof data['
|
|
2594
|
-
throw new Error(`Response is missing required field '
|
|
2595
|
-
if (!Array.isArray(data['
|
|
3130
|
+
if (typeof data['Delta'] === 'undefined')
|
|
3131
|
+
throw new Error(`Response is missing required field 'Delta': ${data}`);
|
|
3132
|
+
if (!Array.isArray(data['Ids']))
|
|
2596
3133
|
throw new Error(
|
|
2597
|
-
`Response is missing required array field '
|
|
3134
|
+
`Response is missing required array field 'Ids': ${data}`
|
|
2598
3135
|
);
|
|
2599
3136
|
return new LedgerStateDeltaForTransactionGroup({
|
|
2600
|
-
delta: data['
|
|
2601
|
-
ids: data['
|
|
3137
|
+
delta: data['Delta'],
|
|
3138
|
+
ids: data['Ids'],
|
|
2602
3139
|
});
|
|
2603
3140
|
/* eslint-enable dot-notation */
|
|
2604
3141
|
}
|
|
@@ -3344,6 +3881,104 @@ export class PostTransactionsResponse extends BaseModel {
|
|
|
3344
3881
|
}
|
|
3345
3882
|
}
|
|
3346
3883
|
|
|
3884
|
+
/**
|
|
3885
|
+
* A write operation into a scratch slot.
|
|
3886
|
+
*/
|
|
3887
|
+
export class ScratchChange extends BaseModel {
|
|
3888
|
+
/**
|
|
3889
|
+
* Represents an AVM value.
|
|
3890
|
+
*/
|
|
3891
|
+
public newValue: AvmValue;
|
|
3892
|
+
|
|
3893
|
+
/**
|
|
3894
|
+
* The scratch slot written.
|
|
3895
|
+
*/
|
|
3896
|
+
public slot: number | bigint;
|
|
3897
|
+
|
|
3898
|
+
/**
|
|
3899
|
+
* Creates a new `ScratchChange` object.
|
|
3900
|
+
* @param newValue - Represents an AVM value.
|
|
3901
|
+
* @param slot - The scratch slot written.
|
|
3902
|
+
*/
|
|
3903
|
+
constructor({
|
|
3904
|
+
newValue,
|
|
3905
|
+
slot,
|
|
3906
|
+
}: {
|
|
3907
|
+
newValue: AvmValue;
|
|
3908
|
+
slot: number | bigint;
|
|
3909
|
+
}) {
|
|
3910
|
+
super();
|
|
3911
|
+
this.newValue = newValue;
|
|
3912
|
+
this.slot = slot;
|
|
3913
|
+
|
|
3914
|
+
this.attribute_map = {
|
|
3915
|
+
newValue: 'new-value',
|
|
3916
|
+
slot: 'slot',
|
|
3917
|
+
};
|
|
3918
|
+
}
|
|
3919
|
+
|
|
3920
|
+
// eslint-disable-next-line camelcase
|
|
3921
|
+
static from_obj_for_encoding(data: Record<string, any>): ScratchChange {
|
|
3922
|
+
/* eslint-disable dot-notation */
|
|
3923
|
+
if (typeof data['new-value'] === 'undefined')
|
|
3924
|
+
throw new Error(
|
|
3925
|
+
`Response is missing required field 'new-value': ${data}`
|
|
3926
|
+
);
|
|
3927
|
+
if (typeof data['slot'] === 'undefined')
|
|
3928
|
+
throw new Error(`Response is missing required field 'slot': ${data}`);
|
|
3929
|
+
return new ScratchChange({
|
|
3930
|
+
newValue: AvmValue.from_obj_for_encoding(data['new-value']),
|
|
3931
|
+
slot: data['slot'],
|
|
3932
|
+
});
|
|
3933
|
+
/* eslint-enable dot-notation */
|
|
3934
|
+
}
|
|
3935
|
+
}
|
|
3936
|
+
|
|
3937
|
+
/**
|
|
3938
|
+
* Initial states of resources that were accessed during simulation.
|
|
3939
|
+
*/
|
|
3940
|
+
export class SimulateInitialStates extends BaseModel {
|
|
3941
|
+
/**
|
|
3942
|
+
* The initial states of accessed application before simulation. The order of this
|
|
3943
|
+
* array is arbitrary.
|
|
3944
|
+
*/
|
|
3945
|
+
public appInitialStates?: ApplicationInitialStates[];
|
|
3946
|
+
|
|
3947
|
+
/**
|
|
3948
|
+
* Creates a new `SimulateInitialStates` object.
|
|
3949
|
+
* @param appInitialStates - The initial states of accessed application before simulation. The order of this
|
|
3950
|
+
* array is arbitrary.
|
|
3951
|
+
*/
|
|
3952
|
+
constructor({
|
|
3953
|
+
appInitialStates,
|
|
3954
|
+
}: {
|
|
3955
|
+
appInitialStates?: ApplicationInitialStates[];
|
|
3956
|
+
}) {
|
|
3957
|
+
super();
|
|
3958
|
+
this.appInitialStates = appInitialStates;
|
|
3959
|
+
|
|
3960
|
+
this.attribute_map = {
|
|
3961
|
+
appInitialStates: 'app-initial-states',
|
|
3962
|
+
};
|
|
3963
|
+
}
|
|
3964
|
+
|
|
3965
|
+
// eslint-disable-next-line camelcase
|
|
3966
|
+
static from_obj_for_encoding(
|
|
3967
|
+
data: Record<string, any>
|
|
3968
|
+
): SimulateInitialStates {
|
|
3969
|
+
/* eslint-disable dot-notation */
|
|
3970
|
+
return new SimulateInitialStates({
|
|
3971
|
+
appInitialStates:
|
|
3972
|
+
typeof data['app-initial-states'] !== 'undefined'
|
|
3973
|
+
? data['app-initial-states'].map(
|
|
3974
|
+
ApplicationInitialStates.from_obj_for_encoding
|
|
3975
|
+
)
|
|
3976
|
+
: undefined,
|
|
3977
|
+
});
|
|
3978
|
+
/* eslint-enable dot-notation */
|
|
3979
|
+
}
|
|
3980
|
+
}
|
|
3981
|
+
|
|
3347
3982
|
/**
|
|
3348
3983
|
* Request type for simulation endpoint.
|
|
3349
3984
|
*/
|
|
@@ -3354,7 +3989,7 @@ export class SimulateRequest extends BaseModel {
|
|
|
3354
3989
|
public txnGroups: SimulateRequestTransactionGroup[];
|
|
3355
3990
|
|
|
3356
3991
|
/**
|
|
3357
|
-
*
|
|
3992
|
+
* Allows transactions without signatures to be simulated as if they had correct
|
|
3358
3993
|
* signatures.
|
|
3359
3994
|
*/
|
|
3360
3995
|
public allowEmptySignatures?: boolean;
|
|
@@ -3364,41 +3999,77 @@ export class SimulateRequest extends BaseModel {
|
|
|
3364
3999
|
*/
|
|
3365
4000
|
public allowMoreLogging?: boolean;
|
|
3366
4001
|
|
|
4002
|
+
/**
|
|
4003
|
+
* Allows access to unnamed resources during simulation.
|
|
4004
|
+
*/
|
|
4005
|
+
public allowUnnamedResources?: boolean;
|
|
4006
|
+
|
|
4007
|
+
/**
|
|
4008
|
+
* An object that configures simulation execution trace.
|
|
4009
|
+
*/
|
|
4010
|
+
public execTraceConfig?: SimulateTraceConfig;
|
|
4011
|
+
|
|
3367
4012
|
/**
|
|
3368
4013
|
* Applies extra opcode budget during simulation for each transaction group.
|
|
3369
4014
|
*/
|
|
3370
4015
|
public extraOpcodeBudget?: number | bigint;
|
|
3371
4016
|
|
|
4017
|
+
/**
|
|
4018
|
+
* If provided, specifies the round preceding the simulation. State changes through
|
|
4019
|
+
* this round will be used to run this simulation. Usually only the 4 most recent
|
|
4020
|
+
* rounds will be available (controlled by the node config value MaxAcctLookback).
|
|
4021
|
+
* If not specified, defaults to the latest available round.
|
|
4022
|
+
*/
|
|
4023
|
+
public round?: number | bigint;
|
|
4024
|
+
|
|
3372
4025
|
/**
|
|
3373
4026
|
* Creates a new `SimulateRequest` object.
|
|
3374
4027
|
* @param txnGroups - The transaction groups to simulate.
|
|
3375
|
-
* @param allowEmptySignatures -
|
|
4028
|
+
* @param allowEmptySignatures - Allows transactions without signatures to be simulated as if they had correct
|
|
3376
4029
|
* signatures.
|
|
3377
4030
|
* @param allowMoreLogging - Lifts limits on log opcode usage during simulation.
|
|
4031
|
+
* @param allowUnnamedResources - Allows access to unnamed resources during simulation.
|
|
4032
|
+
* @param execTraceConfig - An object that configures simulation execution trace.
|
|
3378
4033
|
* @param extraOpcodeBudget - Applies extra opcode budget during simulation for each transaction group.
|
|
4034
|
+
* @param round - If provided, specifies the round preceding the simulation. State changes through
|
|
4035
|
+
* this round will be used to run this simulation. Usually only the 4 most recent
|
|
4036
|
+
* rounds will be available (controlled by the node config value MaxAcctLookback).
|
|
4037
|
+
* If not specified, defaults to the latest available round.
|
|
3379
4038
|
*/
|
|
3380
4039
|
constructor({
|
|
3381
4040
|
txnGroups,
|
|
3382
4041
|
allowEmptySignatures,
|
|
3383
4042
|
allowMoreLogging,
|
|
4043
|
+
allowUnnamedResources,
|
|
4044
|
+
execTraceConfig,
|
|
3384
4045
|
extraOpcodeBudget,
|
|
4046
|
+
round,
|
|
3385
4047
|
}: {
|
|
3386
4048
|
txnGroups: SimulateRequestTransactionGroup[];
|
|
3387
4049
|
allowEmptySignatures?: boolean;
|
|
3388
4050
|
allowMoreLogging?: boolean;
|
|
4051
|
+
allowUnnamedResources?: boolean;
|
|
4052
|
+
execTraceConfig?: SimulateTraceConfig;
|
|
3389
4053
|
extraOpcodeBudget?: number | bigint;
|
|
4054
|
+
round?: number | bigint;
|
|
3390
4055
|
}) {
|
|
3391
4056
|
super();
|
|
3392
4057
|
this.txnGroups = txnGroups;
|
|
3393
4058
|
this.allowEmptySignatures = allowEmptySignatures;
|
|
3394
4059
|
this.allowMoreLogging = allowMoreLogging;
|
|
4060
|
+
this.allowUnnamedResources = allowUnnamedResources;
|
|
4061
|
+
this.execTraceConfig = execTraceConfig;
|
|
3395
4062
|
this.extraOpcodeBudget = extraOpcodeBudget;
|
|
4063
|
+
this.round = round;
|
|
3396
4064
|
|
|
3397
4065
|
this.attribute_map = {
|
|
3398
4066
|
txnGroups: 'txn-groups',
|
|
3399
4067
|
allowEmptySignatures: 'allow-empty-signatures',
|
|
3400
4068
|
allowMoreLogging: 'allow-more-logging',
|
|
4069
|
+
allowUnnamedResources: 'allow-unnamed-resources',
|
|
4070
|
+
execTraceConfig: 'exec-trace-config',
|
|
3401
4071
|
extraOpcodeBudget: 'extra-opcode-budget',
|
|
4072
|
+
round: 'round',
|
|
3402
4073
|
};
|
|
3403
4074
|
}
|
|
3404
4075
|
|
|
@@ -3415,7 +4086,13 @@ export class SimulateRequest extends BaseModel {
|
|
|
3415
4086
|
),
|
|
3416
4087
|
allowEmptySignatures: data['allow-empty-signatures'],
|
|
3417
4088
|
allowMoreLogging: data['allow-more-logging'],
|
|
4089
|
+
allowUnnamedResources: data['allow-unnamed-resources'],
|
|
4090
|
+
execTraceConfig:
|
|
4091
|
+
typeof data['exec-trace-config'] !== 'undefined'
|
|
4092
|
+
? SimulateTraceConfig.from_obj_for_encoding(data['exec-trace-config'])
|
|
4093
|
+
: undefined,
|
|
3418
4094
|
extraOpcodeBudget: data['extra-opcode-budget'],
|
|
4095
|
+
round: data['round'],
|
|
3419
4096
|
});
|
|
3420
4097
|
/* eslint-enable dot-notation */
|
|
3421
4098
|
}
|
|
@@ -3486,6 +4163,16 @@ export class SimulateResponse extends BaseModel {
|
|
|
3486
4163
|
*/
|
|
3487
4164
|
public evalOverrides?: SimulationEvalOverrides;
|
|
3488
4165
|
|
|
4166
|
+
/**
|
|
4167
|
+
* An object that configures simulation execution trace.
|
|
4168
|
+
*/
|
|
4169
|
+
public execTraceConfig?: SimulateTraceConfig;
|
|
4170
|
+
|
|
4171
|
+
/**
|
|
4172
|
+
* Initial states of resources that were accessed during simulation.
|
|
4173
|
+
*/
|
|
4174
|
+
public initialStates?: SimulateInitialStates;
|
|
4175
|
+
|
|
3489
4176
|
/**
|
|
3490
4177
|
* Creates a new `SimulateResponse` object.
|
|
3491
4178
|
* @param lastRound - The round immediately preceding this simulation. State changes through this
|
|
@@ -3495,29 +4182,39 @@ export class SimulateResponse extends BaseModel {
|
|
|
3495
4182
|
* @param evalOverrides - The set of parameters and limits override during simulation. If this set of
|
|
3496
4183
|
* parameters is present, then evaluation parameters may differ from standard
|
|
3497
4184
|
* evaluation in certain ways.
|
|
4185
|
+
* @param execTraceConfig - An object that configures simulation execution trace.
|
|
4186
|
+
* @param initialStates - Initial states of resources that were accessed during simulation.
|
|
3498
4187
|
*/
|
|
3499
4188
|
constructor({
|
|
3500
4189
|
lastRound,
|
|
3501
4190
|
txnGroups,
|
|
3502
4191
|
version,
|
|
3503
4192
|
evalOverrides,
|
|
4193
|
+
execTraceConfig,
|
|
4194
|
+
initialStates,
|
|
3504
4195
|
}: {
|
|
3505
4196
|
lastRound: number | bigint;
|
|
3506
4197
|
txnGroups: SimulateTransactionGroupResult[];
|
|
3507
4198
|
version: number | bigint;
|
|
3508
4199
|
evalOverrides?: SimulationEvalOverrides;
|
|
4200
|
+
execTraceConfig?: SimulateTraceConfig;
|
|
4201
|
+
initialStates?: SimulateInitialStates;
|
|
3509
4202
|
}) {
|
|
3510
4203
|
super();
|
|
3511
4204
|
this.lastRound = lastRound;
|
|
3512
4205
|
this.txnGroups = txnGroups;
|
|
3513
4206
|
this.version = version;
|
|
3514
4207
|
this.evalOverrides = evalOverrides;
|
|
4208
|
+
this.execTraceConfig = execTraceConfig;
|
|
4209
|
+
this.initialStates = initialStates;
|
|
3515
4210
|
|
|
3516
4211
|
this.attribute_map = {
|
|
3517
4212
|
lastRound: 'last-round',
|
|
3518
4213
|
txnGroups: 'txn-groups',
|
|
3519
4214
|
version: 'version',
|
|
3520
4215
|
evalOverrides: 'eval-overrides',
|
|
4216
|
+
execTraceConfig: 'exec-trace-config',
|
|
4217
|
+
initialStates: 'initial-states',
|
|
3521
4218
|
};
|
|
3522
4219
|
}
|
|
3523
4220
|
|
|
@@ -3546,6 +4243,89 @@ export class SimulateResponse extends BaseModel {
|
|
|
3546
4243
|
data['eval-overrides']
|
|
3547
4244
|
)
|
|
3548
4245
|
: undefined,
|
|
4246
|
+
execTraceConfig:
|
|
4247
|
+
typeof data['exec-trace-config'] !== 'undefined'
|
|
4248
|
+
? SimulateTraceConfig.from_obj_for_encoding(data['exec-trace-config'])
|
|
4249
|
+
: undefined,
|
|
4250
|
+
initialStates:
|
|
4251
|
+
typeof data['initial-states'] !== 'undefined'
|
|
4252
|
+
? SimulateInitialStates.from_obj_for_encoding(data['initial-states'])
|
|
4253
|
+
: undefined,
|
|
4254
|
+
});
|
|
4255
|
+
/* eslint-enable dot-notation */
|
|
4256
|
+
}
|
|
4257
|
+
}
|
|
4258
|
+
|
|
4259
|
+
/**
|
|
4260
|
+
* An object that configures simulation execution trace.
|
|
4261
|
+
*/
|
|
4262
|
+
export class SimulateTraceConfig extends BaseModel {
|
|
4263
|
+
/**
|
|
4264
|
+
* A boolean option for opting in execution trace features simulation endpoint.
|
|
4265
|
+
*/
|
|
4266
|
+
public enable?: boolean;
|
|
4267
|
+
|
|
4268
|
+
/**
|
|
4269
|
+
* A boolean option enabling returning scratch slot changes together with execution
|
|
4270
|
+
* trace during simulation.
|
|
4271
|
+
*/
|
|
4272
|
+
public scratchChange?: boolean;
|
|
4273
|
+
|
|
4274
|
+
/**
|
|
4275
|
+
* A boolean option enabling returning stack changes together with execution trace
|
|
4276
|
+
* during simulation.
|
|
4277
|
+
*/
|
|
4278
|
+
public stackChange?: boolean;
|
|
4279
|
+
|
|
4280
|
+
/**
|
|
4281
|
+
* A boolean option enabling returning application state changes (global, local,
|
|
4282
|
+
* and box changes) with the execution trace during simulation.
|
|
4283
|
+
*/
|
|
4284
|
+
public stateChange?: boolean;
|
|
4285
|
+
|
|
4286
|
+
/**
|
|
4287
|
+
* Creates a new `SimulateTraceConfig` object.
|
|
4288
|
+
* @param enable - A boolean option for opting in execution trace features simulation endpoint.
|
|
4289
|
+
* @param scratchChange - A boolean option enabling returning scratch slot changes together with execution
|
|
4290
|
+
* trace during simulation.
|
|
4291
|
+
* @param stackChange - A boolean option enabling returning stack changes together with execution trace
|
|
4292
|
+
* during simulation.
|
|
4293
|
+
* @param stateChange - A boolean option enabling returning application state changes (global, local,
|
|
4294
|
+
* and box changes) with the execution trace during simulation.
|
|
4295
|
+
*/
|
|
4296
|
+
constructor({
|
|
4297
|
+
enable,
|
|
4298
|
+
scratchChange,
|
|
4299
|
+
stackChange,
|
|
4300
|
+
stateChange,
|
|
4301
|
+
}: {
|
|
4302
|
+
enable?: boolean;
|
|
4303
|
+
scratchChange?: boolean;
|
|
4304
|
+
stackChange?: boolean;
|
|
4305
|
+
stateChange?: boolean;
|
|
4306
|
+
}) {
|
|
4307
|
+
super();
|
|
4308
|
+
this.enable = enable;
|
|
4309
|
+
this.scratchChange = scratchChange;
|
|
4310
|
+
this.stackChange = stackChange;
|
|
4311
|
+
this.stateChange = stateChange;
|
|
4312
|
+
|
|
4313
|
+
this.attribute_map = {
|
|
4314
|
+
enable: 'enable',
|
|
4315
|
+
scratchChange: 'scratch-change',
|
|
4316
|
+
stackChange: 'stack-change',
|
|
4317
|
+
stateChange: 'state-change',
|
|
4318
|
+
};
|
|
4319
|
+
}
|
|
4320
|
+
|
|
4321
|
+
// eslint-disable-next-line camelcase
|
|
4322
|
+
static from_obj_for_encoding(data: Record<string, any>): SimulateTraceConfig {
|
|
4323
|
+
/* eslint-disable dot-notation */
|
|
4324
|
+
return new SimulateTraceConfig({
|
|
4325
|
+
enable: data['enable'],
|
|
4326
|
+
scratchChange: data['scratch-change'],
|
|
4327
|
+
stackChange: data['stack-change'],
|
|
4328
|
+
stateChange: data['state-change'],
|
|
3549
4329
|
});
|
|
3550
4330
|
/* eslint-enable dot-notation */
|
|
3551
4331
|
}
|
|
@@ -3584,6 +4364,19 @@ export class SimulateTransactionGroupResult extends BaseModel {
|
|
|
3584
4364
|
*/
|
|
3585
4365
|
public failureMessage?: string;
|
|
3586
4366
|
|
|
4367
|
+
/**
|
|
4368
|
+
* These are resources that were accessed by this group that would normally have
|
|
4369
|
+
* caused failure, but were allowed in simulation. Depending on where this object
|
|
4370
|
+
* is in the response, the unnamed resources it contains may or may not qualify for
|
|
4371
|
+
* group resource sharing. If this is a field in SimulateTransactionGroupResult,
|
|
4372
|
+
* the resources do qualify, but if this is a field in SimulateTransactionResult,
|
|
4373
|
+
* they do not qualify. In order to make this group valid for actual submission,
|
|
4374
|
+
* resources that qualify for group sharing can be made available by any
|
|
4375
|
+
* transaction of the group; otherwise, resources must be placed in the same
|
|
4376
|
+
* transaction which accessed them.
|
|
4377
|
+
*/
|
|
4378
|
+
public unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
|
|
4379
|
+
|
|
3587
4380
|
/**
|
|
3588
4381
|
* Creates a new `SimulateTransactionGroupResult` object.
|
|
3589
4382
|
* @param txnResults - Simulation result for individual transactions
|
|
@@ -3595,6 +4388,15 @@ export class SimulateTransactionGroupResult extends BaseModel {
|
|
|
3595
4388
|
* indicate deeper inner transactions.
|
|
3596
4389
|
* @param failureMessage - If present, indicates that the transaction group failed and specifies why that
|
|
3597
4390
|
* happened
|
|
4391
|
+
* @param unnamedResourcesAccessed - These are resources that were accessed by this group that would normally have
|
|
4392
|
+
* caused failure, but were allowed in simulation. Depending on where this object
|
|
4393
|
+
* is in the response, the unnamed resources it contains may or may not qualify for
|
|
4394
|
+
* group resource sharing. If this is a field in SimulateTransactionGroupResult,
|
|
4395
|
+
* the resources do qualify, but if this is a field in SimulateTransactionResult,
|
|
4396
|
+
* they do not qualify. In order to make this group valid for actual submission,
|
|
4397
|
+
* resources that qualify for group sharing can be made available by any
|
|
4398
|
+
* transaction of the group; otherwise, resources must be placed in the same
|
|
4399
|
+
* transaction which accessed them.
|
|
3598
4400
|
*/
|
|
3599
4401
|
constructor({
|
|
3600
4402
|
txnResults,
|
|
@@ -3602,12 +4404,14 @@ export class SimulateTransactionGroupResult extends BaseModel {
|
|
|
3602
4404
|
appBudgetConsumed,
|
|
3603
4405
|
failedAt,
|
|
3604
4406
|
failureMessage,
|
|
4407
|
+
unnamedResourcesAccessed,
|
|
3605
4408
|
}: {
|
|
3606
4409
|
txnResults: SimulateTransactionResult[];
|
|
3607
4410
|
appBudgetAdded?: number | bigint;
|
|
3608
4411
|
appBudgetConsumed?: number | bigint;
|
|
3609
4412
|
failedAt?: (number | bigint)[];
|
|
3610
4413
|
failureMessage?: string;
|
|
4414
|
+
unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
|
|
3611
4415
|
}) {
|
|
3612
4416
|
super();
|
|
3613
4417
|
this.txnResults = txnResults;
|
|
@@ -3615,6 +4419,7 @@ export class SimulateTransactionGroupResult extends BaseModel {
|
|
|
3615
4419
|
this.appBudgetConsumed = appBudgetConsumed;
|
|
3616
4420
|
this.failedAt = failedAt;
|
|
3617
4421
|
this.failureMessage = failureMessage;
|
|
4422
|
+
this.unnamedResourcesAccessed = unnamedResourcesAccessed;
|
|
3618
4423
|
|
|
3619
4424
|
this.attribute_map = {
|
|
3620
4425
|
txnResults: 'txn-results',
|
|
@@ -3622,6 +4427,7 @@ export class SimulateTransactionGroupResult extends BaseModel {
|
|
|
3622
4427
|
appBudgetConsumed: 'app-budget-consumed',
|
|
3623
4428
|
failedAt: 'failed-at',
|
|
3624
4429
|
failureMessage: 'failure-message',
|
|
4430
|
+
unnamedResourcesAccessed: 'unnamed-resources-accessed',
|
|
3625
4431
|
};
|
|
3626
4432
|
}
|
|
3627
4433
|
|
|
@@ -3642,6 +4448,12 @@ export class SimulateTransactionGroupResult extends BaseModel {
|
|
|
3642
4448
|
appBudgetConsumed: data['app-budget-consumed'],
|
|
3643
4449
|
failedAt: data['failed-at'],
|
|
3644
4450
|
failureMessage: data['failure-message'],
|
|
4451
|
+
unnamedResourcesAccessed:
|
|
4452
|
+
typeof data['unnamed-resources-accessed'] !== 'undefined'
|
|
4453
|
+
? SimulateUnnamedResourcesAccessed.from_obj_for_encoding(
|
|
4454
|
+
data['unnamed-resources-accessed']
|
|
4455
|
+
)
|
|
4456
|
+
: undefined,
|
|
3645
4457
|
});
|
|
3646
4458
|
/* eslint-enable dot-notation */
|
|
3647
4459
|
}
|
|
@@ -3663,37 +4475,75 @@ export class SimulateTransactionResult extends BaseModel {
|
|
|
3663
4475
|
*/
|
|
3664
4476
|
public appBudgetConsumed?: number | bigint;
|
|
3665
4477
|
|
|
4478
|
+
/**
|
|
4479
|
+
* The execution trace of calling an app or a logic sig, containing the inner app
|
|
4480
|
+
* call trace in a recursive way.
|
|
4481
|
+
*/
|
|
4482
|
+
public execTrace?: SimulationTransactionExecTrace;
|
|
4483
|
+
|
|
3666
4484
|
/**
|
|
3667
4485
|
* Budget used during execution of a logic sig transaction.
|
|
3668
4486
|
*/
|
|
3669
4487
|
public logicSigBudgetConsumed?: number | bigint;
|
|
3670
4488
|
|
|
4489
|
+
/**
|
|
4490
|
+
* These are resources that were accessed by this group that would normally have
|
|
4491
|
+
* caused failure, but were allowed in simulation. Depending on where this object
|
|
4492
|
+
* is in the response, the unnamed resources it contains may or may not qualify for
|
|
4493
|
+
* group resource sharing. If this is a field in SimulateTransactionGroupResult,
|
|
4494
|
+
* the resources do qualify, but if this is a field in SimulateTransactionResult,
|
|
4495
|
+
* they do not qualify. In order to make this group valid for actual submission,
|
|
4496
|
+
* resources that qualify for group sharing can be made available by any
|
|
4497
|
+
* transaction of the group; otherwise, resources must be placed in the same
|
|
4498
|
+
* transaction which accessed them.
|
|
4499
|
+
*/
|
|
4500
|
+
public unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
|
|
4501
|
+
|
|
3671
4502
|
/**
|
|
3672
4503
|
* Creates a new `SimulateTransactionResult` object.
|
|
3673
4504
|
* @param txnResult - Details about a pending transaction. If the transaction was recently confirmed,
|
|
3674
4505
|
* includes confirmation details like the round and reward details.
|
|
3675
4506
|
* @param appBudgetConsumed - Budget used during execution of an app call transaction. This value includes
|
|
3676
4507
|
* budged used by inner app calls spawned by this transaction.
|
|
4508
|
+
* @param execTrace - The execution trace of calling an app or a logic sig, containing the inner app
|
|
4509
|
+
* call trace in a recursive way.
|
|
3677
4510
|
* @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
|
|
4511
|
+
* @param unnamedResourcesAccessed - These are resources that were accessed by this group that would normally have
|
|
4512
|
+
* caused failure, but were allowed in simulation. Depending on where this object
|
|
4513
|
+
* is in the response, the unnamed resources it contains may or may not qualify for
|
|
4514
|
+
* group resource sharing. If this is a field in SimulateTransactionGroupResult,
|
|
4515
|
+
* the resources do qualify, but if this is a field in SimulateTransactionResult,
|
|
4516
|
+
* they do not qualify. In order to make this group valid for actual submission,
|
|
4517
|
+
* resources that qualify for group sharing can be made available by any
|
|
4518
|
+
* transaction of the group; otherwise, resources must be placed in the same
|
|
4519
|
+
* transaction which accessed them.
|
|
3678
4520
|
*/
|
|
3679
4521
|
constructor({
|
|
3680
4522
|
txnResult,
|
|
3681
4523
|
appBudgetConsumed,
|
|
4524
|
+
execTrace,
|
|
3682
4525
|
logicSigBudgetConsumed,
|
|
4526
|
+
unnamedResourcesAccessed,
|
|
3683
4527
|
}: {
|
|
3684
4528
|
txnResult: PendingTransactionResponse;
|
|
3685
4529
|
appBudgetConsumed?: number | bigint;
|
|
4530
|
+
execTrace?: SimulationTransactionExecTrace;
|
|
3686
4531
|
logicSigBudgetConsumed?: number | bigint;
|
|
4532
|
+
unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
|
|
3687
4533
|
}) {
|
|
3688
4534
|
super();
|
|
3689
4535
|
this.txnResult = txnResult;
|
|
3690
4536
|
this.appBudgetConsumed = appBudgetConsumed;
|
|
4537
|
+
this.execTrace = execTrace;
|
|
3691
4538
|
this.logicSigBudgetConsumed = logicSigBudgetConsumed;
|
|
4539
|
+
this.unnamedResourcesAccessed = unnamedResourcesAccessed;
|
|
3692
4540
|
|
|
3693
4541
|
this.attribute_map = {
|
|
3694
4542
|
txnResult: 'txn-result',
|
|
3695
4543
|
appBudgetConsumed: 'app-budget-consumed',
|
|
4544
|
+
execTrace: 'exec-trace',
|
|
3696
4545
|
logicSigBudgetConsumed: 'logic-sig-budget-consumed',
|
|
4546
|
+
unnamedResourcesAccessed: 'unnamed-resources-accessed',
|
|
3697
4547
|
};
|
|
3698
4548
|
}
|
|
3699
4549
|
|
|
@@ -3711,7 +4561,154 @@ export class SimulateTransactionResult extends BaseModel {
|
|
|
3711
4561
|
data['txn-result']
|
|
3712
4562
|
),
|
|
3713
4563
|
appBudgetConsumed: data['app-budget-consumed'],
|
|
4564
|
+
execTrace:
|
|
4565
|
+
typeof data['exec-trace'] !== 'undefined'
|
|
4566
|
+
? SimulationTransactionExecTrace.from_obj_for_encoding(
|
|
4567
|
+
data['exec-trace']
|
|
4568
|
+
)
|
|
4569
|
+
: undefined,
|
|
3714
4570
|
logicSigBudgetConsumed: data['logic-sig-budget-consumed'],
|
|
4571
|
+
unnamedResourcesAccessed:
|
|
4572
|
+
typeof data['unnamed-resources-accessed'] !== 'undefined'
|
|
4573
|
+
? SimulateUnnamedResourcesAccessed.from_obj_for_encoding(
|
|
4574
|
+
data['unnamed-resources-accessed']
|
|
4575
|
+
)
|
|
4576
|
+
: undefined,
|
|
4577
|
+
});
|
|
4578
|
+
/* eslint-enable dot-notation */
|
|
4579
|
+
}
|
|
4580
|
+
}
|
|
4581
|
+
|
|
4582
|
+
/**
|
|
4583
|
+
* These are resources that were accessed by this group that would normally have
|
|
4584
|
+
* caused failure, but were allowed in simulation. Depending on where this object
|
|
4585
|
+
* is in the response, the unnamed resources it contains may or may not qualify for
|
|
4586
|
+
* group resource sharing. If this is a field in SimulateTransactionGroupResult,
|
|
4587
|
+
* the resources do qualify, but if this is a field in SimulateTransactionResult,
|
|
4588
|
+
* they do not qualify. In order to make this group valid for actual submission,
|
|
4589
|
+
* resources that qualify for group sharing can be made available by any
|
|
4590
|
+
* transaction of the group; otherwise, resources must be placed in the same
|
|
4591
|
+
* transaction which accessed them.
|
|
4592
|
+
*/
|
|
4593
|
+
export class SimulateUnnamedResourcesAccessed extends BaseModel {
|
|
4594
|
+
/**
|
|
4595
|
+
* The unnamed accounts that were referenced. The order of this array is arbitrary.
|
|
4596
|
+
*/
|
|
4597
|
+
public accounts?: string[];
|
|
4598
|
+
|
|
4599
|
+
/**
|
|
4600
|
+
* The unnamed application local states that were referenced. The order of this
|
|
4601
|
+
* array is arbitrary.
|
|
4602
|
+
*/
|
|
4603
|
+
public appLocals?: ApplicationLocalReference[];
|
|
4604
|
+
|
|
4605
|
+
/**
|
|
4606
|
+
* The unnamed applications that were referenced. The order of this array is
|
|
4607
|
+
* arbitrary.
|
|
4608
|
+
*/
|
|
4609
|
+
public apps?: (number | bigint)[];
|
|
4610
|
+
|
|
4611
|
+
/**
|
|
4612
|
+
* The unnamed asset holdings that were referenced. The order of this array is
|
|
4613
|
+
* arbitrary.
|
|
4614
|
+
*/
|
|
4615
|
+
public assetHoldings?: AssetHoldingReference[];
|
|
4616
|
+
|
|
4617
|
+
/**
|
|
4618
|
+
* The unnamed assets that were referenced. The order of this array is arbitrary.
|
|
4619
|
+
*/
|
|
4620
|
+
public assets?: (number | bigint)[];
|
|
4621
|
+
|
|
4622
|
+
/**
|
|
4623
|
+
* The unnamed boxes that were referenced. The order of this array is arbitrary.
|
|
4624
|
+
*/
|
|
4625
|
+
public boxes?: BoxReference[];
|
|
4626
|
+
|
|
4627
|
+
/**
|
|
4628
|
+
* The number of extra box references used to increase the IO budget. This is in
|
|
4629
|
+
* addition to the references defined in the input transaction group and any
|
|
4630
|
+
* referenced to unnamed boxes.
|
|
4631
|
+
*/
|
|
4632
|
+
public extraBoxRefs?: number | bigint;
|
|
4633
|
+
|
|
4634
|
+
/**
|
|
4635
|
+
* Creates a new `SimulateUnnamedResourcesAccessed` object.
|
|
4636
|
+
* @param accounts - The unnamed accounts that were referenced. The order of this array is arbitrary.
|
|
4637
|
+
* @param appLocals - The unnamed application local states that were referenced. The order of this
|
|
4638
|
+
* array is arbitrary.
|
|
4639
|
+
* @param apps - The unnamed applications that were referenced. The order of this array is
|
|
4640
|
+
* arbitrary.
|
|
4641
|
+
* @param assetHoldings - The unnamed asset holdings that were referenced. The order of this array is
|
|
4642
|
+
* arbitrary.
|
|
4643
|
+
* @param assets - The unnamed assets that were referenced. The order of this array is arbitrary.
|
|
4644
|
+
* @param boxes - The unnamed boxes that were referenced. The order of this array is arbitrary.
|
|
4645
|
+
* @param extraBoxRefs - The number of extra box references used to increase the IO budget. This is in
|
|
4646
|
+
* addition to the references defined in the input transaction group and any
|
|
4647
|
+
* referenced to unnamed boxes.
|
|
4648
|
+
*/
|
|
4649
|
+
constructor({
|
|
4650
|
+
accounts,
|
|
4651
|
+
appLocals,
|
|
4652
|
+
apps,
|
|
4653
|
+
assetHoldings,
|
|
4654
|
+
assets,
|
|
4655
|
+
boxes,
|
|
4656
|
+
extraBoxRefs,
|
|
4657
|
+
}: {
|
|
4658
|
+
accounts?: string[];
|
|
4659
|
+
appLocals?: ApplicationLocalReference[];
|
|
4660
|
+
apps?: (number | bigint)[];
|
|
4661
|
+
assetHoldings?: AssetHoldingReference[];
|
|
4662
|
+
assets?: (number | bigint)[];
|
|
4663
|
+
boxes?: BoxReference[];
|
|
4664
|
+
extraBoxRefs?: number | bigint;
|
|
4665
|
+
}) {
|
|
4666
|
+
super();
|
|
4667
|
+
this.accounts = accounts;
|
|
4668
|
+
this.appLocals = appLocals;
|
|
4669
|
+
this.apps = apps;
|
|
4670
|
+
this.assetHoldings = assetHoldings;
|
|
4671
|
+
this.assets = assets;
|
|
4672
|
+
this.boxes = boxes;
|
|
4673
|
+
this.extraBoxRefs = extraBoxRefs;
|
|
4674
|
+
|
|
4675
|
+
this.attribute_map = {
|
|
4676
|
+
accounts: 'accounts',
|
|
4677
|
+
appLocals: 'app-locals',
|
|
4678
|
+
apps: 'apps',
|
|
4679
|
+
assetHoldings: 'asset-holdings',
|
|
4680
|
+
assets: 'assets',
|
|
4681
|
+
boxes: 'boxes',
|
|
4682
|
+
extraBoxRefs: 'extra-box-refs',
|
|
4683
|
+
};
|
|
4684
|
+
}
|
|
4685
|
+
|
|
4686
|
+
// eslint-disable-next-line camelcase
|
|
4687
|
+
static from_obj_for_encoding(
|
|
4688
|
+
data: Record<string, any>
|
|
4689
|
+
): SimulateUnnamedResourcesAccessed {
|
|
4690
|
+
/* eslint-disable dot-notation */
|
|
4691
|
+
return new SimulateUnnamedResourcesAccessed({
|
|
4692
|
+
accounts: data['accounts'],
|
|
4693
|
+
appLocals:
|
|
4694
|
+
typeof data['app-locals'] !== 'undefined'
|
|
4695
|
+
? data['app-locals'].map(
|
|
4696
|
+
ApplicationLocalReference.from_obj_for_encoding
|
|
4697
|
+
)
|
|
4698
|
+
: undefined,
|
|
4699
|
+
apps: data['apps'],
|
|
4700
|
+
assetHoldings:
|
|
4701
|
+
typeof data['asset-holdings'] !== 'undefined'
|
|
4702
|
+
? data['asset-holdings'].map(
|
|
4703
|
+
AssetHoldingReference.from_obj_for_encoding
|
|
4704
|
+
)
|
|
4705
|
+
: undefined,
|
|
4706
|
+
assets: data['assets'],
|
|
4707
|
+
boxes:
|
|
4708
|
+
typeof data['boxes'] !== 'undefined'
|
|
4709
|
+
? data['boxes'].map(BoxReference.from_obj_for_encoding)
|
|
4710
|
+
: undefined,
|
|
4711
|
+
extraBoxRefs: data['extra-box-refs'],
|
|
3715
4712
|
});
|
|
3716
4713
|
/* eslint-enable dot-notation */
|
|
3717
4714
|
}
|
|
@@ -3729,6 +4726,11 @@ export class SimulationEvalOverrides extends BaseModel {
|
|
|
3729
4726
|
*/
|
|
3730
4727
|
public allowEmptySignatures?: boolean;
|
|
3731
4728
|
|
|
4729
|
+
/**
|
|
4730
|
+
* If true, allows access to unnamed resources during simulation.
|
|
4731
|
+
*/
|
|
4732
|
+
public allowUnnamedResources?: boolean;
|
|
4733
|
+
|
|
3732
4734
|
/**
|
|
3733
4735
|
* The extra opcode budget added to each transaction group during simulation
|
|
3734
4736
|
*/
|
|
@@ -3748,29 +4750,34 @@ export class SimulationEvalOverrides extends BaseModel {
|
|
|
3748
4750
|
* Creates a new `SimulationEvalOverrides` object.
|
|
3749
4751
|
* @param allowEmptySignatures - If true, transactions without signatures are allowed and simulated as if they
|
|
3750
4752
|
* were properly signed.
|
|
4753
|
+
* @param allowUnnamedResources - If true, allows access to unnamed resources during simulation.
|
|
3751
4754
|
* @param extraOpcodeBudget - The extra opcode budget added to each transaction group during simulation
|
|
3752
4755
|
* @param maxLogCalls - The maximum log calls one can make during simulation
|
|
3753
4756
|
* @param maxLogSize - The maximum byte number to log during simulation
|
|
3754
4757
|
*/
|
|
3755
4758
|
constructor({
|
|
3756
4759
|
allowEmptySignatures,
|
|
4760
|
+
allowUnnamedResources,
|
|
3757
4761
|
extraOpcodeBudget,
|
|
3758
4762
|
maxLogCalls,
|
|
3759
4763
|
maxLogSize,
|
|
3760
4764
|
}: {
|
|
3761
4765
|
allowEmptySignatures?: boolean;
|
|
4766
|
+
allowUnnamedResources?: boolean;
|
|
3762
4767
|
extraOpcodeBudget?: number | bigint;
|
|
3763
4768
|
maxLogCalls?: number | bigint;
|
|
3764
4769
|
maxLogSize?: number | bigint;
|
|
3765
4770
|
}) {
|
|
3766
4771
|
super();
|
|
3767
4772
|
this.allowEmptySignatures = allowEmptySignatures;
|
|
4773
|
+
this.allowUnnamedResources = allowUnnamedResources;
|
|
3768
4774
|
this.extraOpcodeBudget = extraOpcodeBudget;
|
|
3769
4775
|
this.maxLogCalls = maxLogCalls;
|
|
3770
4776
|
this.maxLogSize = maxLogSize;
|
|
3771
4777
|
|
|
3772
4778
|
this.attribute_map = {
|
|
3773
4779
|
allowEmptySignatures: 'allow-empty-signatures',
|
|
4780
|
+
allowUnnamedResources: 'allow-unnamed-resources',
|
|
3774
4781
|
extraOpcodeBudget: 'extra-opcode-budget',
|
|
3775
4782
|
maxLogCalls: 'max-log-calls',
|
|
3776
4783
|
maxLogSize: 'max-log-size',
|
|
@@ -3784,6 +4791,7 @@ export class SimulationEvalOverrides extends BaseModel {
|
|
|
3784
4791
|
/* eslint-disable dot-notation */
|
|
3785
4792
|
return new SimulationEvalOverrides({
|
|
3786
4793
|
allowEmptySignatures: data['allow-empty-signatures'],
|
|
4794
|
+
allowUnnamedResources: data['allow-unnamed-resources'],
|
|
3787
4795
|
extraOpcodeBudget: data['extra-opcode-budget'],
|
|
3788
4796
|
maxLogCalls: data['max-log-calls'],
|
|
3789
4797
|
maxLogSize: data['max-log-size'],
|
|
@@ -3792,6 +4800,248 @@ export class SimulationEvalOverrides extends BaseModel {
|
|
|
3792
4800
|
}
|
|
3793
4801
|
}
|
|
3794
4802
|
|
|
4803
|
+
/**
|
|
4804
|
+
* The set of trace information and effect from evaluating a single opcode.
|
|
4805
|
+
*/
|
|
4806
|
+
export class SimulationOpcodeTraceUnit extends BaseModel {
|
|
4807
|
+
/**
|
|
4808
|
+
* The program counter of the current opcode being evaluated.
|
|
4809
|
+
*/
|
|
4810
|
+
public pc: number | bigint;
|
|
4811
|
+
|
|
4812
|
+
/**
|
|
4813
|
+
* The writes into scratch slots.
|
|
4814
|
+
*/
|
|
4815
|
+
public scratchChanges?: ScratchChange[];
|
|
4816
|
+
|
|
4817
|
+
/**
|
|
4818
|
+
* The indexes of the traces for inner transactions spawned by this opcode, if any.
|
|
4819
|
+
*/
|
|
4820
|
+
public spawnedInners?: (number | bigint)[];
|
|
4821
|
+
|
|
4822
|
+
/**
|
|
4823
|
+
* The values added by this opcode to the stack.
|
|
4824
|
+
*/
|
|
4825
|
+
public stackAdditions?: AvmValue[];
|
|
4826
|
+
|
|
4827
|
+
/**
|
|
4828
|
+
* The number of deleted stack values by this opcode.
|
|
4829
|
+
*/
|
|
4830
|
+
public stackPopCount?: number | bigint;
|
|
4831
|
+
|
|
4832
|
+
/**
|
|
4833
|
+
* The operations against the current application's states.
|
|
4834
|
+
*/
|
|
4835
|
+
public stateChanges?: ApplicationStateOperation[];
|
|
4836
|
+
|
|
4837
|
+
/**
|
|
4838
|
+
* Creates a new `SimulationOpcodeTraceUnit` object.
|
|
4839
|
+
* @param pc - The program counter of the current opcode being evaluated.
|
|
4840
|
+
* @param scratchChanges - The writes into scratch slots.
|
|
4841
|
+
* @param spawnedInners - The indexes of the traces for inner transactions spawned by this opcode, if any.
|
|
4842
|
+
* @param stackAdditions - The values added by this opcode to the stack.
|
|
4843
|
+
* @param stackPopCount - The number of deleted stack values by this opcode.
|
|
4844
|
+
* @param stateChanges - The operations against the current application's states.
|
|
4845
|
+
*/
|
|
4846
|
+
constructor({
|
|
4847
|
+
pc,
|
|
4848
|
+
scratchChanges,
|
|
4849
|
+
spawnedInners,
|
|
4850
|
+
stackAdditions,
|
|
4851
|
+
stackPopCount,
|
|
4852
|
+
stateChanges,
|
|
4853
|
+
}: {
|
|
4854
|
+
pc: number | bigint;
|
|
4855
|
+
scratchChanges?: ScratchChange[];
|
|
4856
|
+
spawnedInners?: (number | bigint)[];
|
|
4857
|
+
stackAdditions?: AvmValue[];
|
|
4858
|
+
stackPopCount?: number | bigint;
|
|
4859
|
+
stateChanges?: ApplicationStateOperation[];
|
|
4860
|
+
}) {
|
|
4861
|
+
super();
|
|
4862
|
+
this.pc = pc;
|
|
4863
|
+
this.scratchChanges = scratchChanges;
|
|
4864
|
+
this.spawnedInners = spawnedInners;
|
|
4865
|
+
this.stackAdditions = stackAdditions;
|
|
4866
|
+
this.stackPopCount = stackPopCount;
|
|
4867
|
+
this.stateChanges = stateChanges;
|
|
4868
|
+
|
|
4869
|
+
this.attribute_map = {
|
|
4870
|
+
pc: 'pc',
|
|
4871
|
+
scratchChanges: 'scratch-changes',
|
|
4872
|
+
spawnedInners: 'spawned-inners',
|
|
4873
|
+
stackAdditions: 'stack-additions',
|
|
4874
|
+
stackPopCount: 'stack-pop-count',
|
|
4875
|
+
stateChanges: 'state-changes',
|
|
4876
|
+
};
|
|
4877
|
+
}
|
|
4878
|
+
|
|
4879
|
+
// eslint-disable-next-line camelcase
|
|
4880
|
+
static from_obj_for_encoding(
|
|
4881
|
+
data: Record<string, any>
|
|
4882
|
+
): SimulationOpcodeTraceUnit {
|
|
4883
|
+
/* eslint-disable dot-notation */
|
|
4884
|
+
if (typeof data['pc'] === 'undefined')
|
|
4885
|
+
throw new Error(`Response is missing required field 'pc': ${data}`);
|
|
4886
|
+
return new SimulationOpcodeTraceUnit({
|
|
4887
|
+
pc: data['pc'],
|
|
4888
|
+
scratchChanges:
|
|
4889
|
+
typeof data['scratch-changes'] !== 'undefined'
|
|
4890
|
+
? data['scratch-changes'].map(ScratchChange.from_obj_for_encoding)
|
|
4891
|
+
: undefined,
|
|
4892
|
+
spawnedInners: data['spawned-inners'],
|
|
4893
|
+
stackAdditions:
|
|
4894
|
+
typeof data['stack-additions'] !== 'undefined'
|
|
4895
|
+
? data['stack-additions'].map(AvmValue.from_obj_for_encoding)
|
|
4896
|
+
: undefined,
|
|
4897
|
+
stackPopCount: data['stack-pop-count'],
|
|
4898
|
+
stateChanges:
|
|
4899
|
+
typeof data['state-changes'] !== 'undefined'
|
|
4900
|
+
? data['state-changes'].map(
|
|
4901
|
+
ApplicationStateOperation.from_obj_for_encoding
|
|
4902
|
+
)
|
|
4903
|
+
: undefined,
|
|
4904
|
+
});
|
|
4905
|
+
/* eslint-enable dot-notation */
|
|
4906
|
+
}
|
|
4907
|
+
}
|
|
4908
|
+
|
|
4909
|
+
/**
|
|
4910
|
+
* The execution trace of calling an app or a logic sig, containing the inner app
|
|
4911
|
+
* call trace in a recursive way.
|
|
4912
|
+
*/
|
|
4913
|
+
export class SimulationTransactionExecTrace extends BaseModel {
|
|
4914
|
+
/**
|
|
4915
|
+
* SHA512_256 hash digest of the approval program executed in transaction.
|
|
4916
|
+
*/
|
|
4917
|
+
public approvalProgramHash?: Uint8Array;
|
|
4918
|
+
|
|
4919
|
+
/**
|
|
4920
|
+
* Program trace that contains a trace of opcode effects in an approval program.
|
|
4921
|
+
*/
|
|
4922
|
+
public approvalProgramTrace?: SimulationOpcodeTraceUnit[];
|
|
4923
|
+
|
|
4924
|
+
/**
|
|
4925
|
+
* SHA512_256 hash digest of the clear state program executed in transaction.
|
|
4926
|
+
*/
|
|
4927
|
+
public clearStateProgramHash?: Uint8Array;
|
|
4928
|
+
|
|
4929
|
+
/**
|
|
4930
|
+
* Program trace that contains a trace of opcode effects in a clear state program.
|
|
4931
|
+
*/
|
|
4932
|
+
public clearStateProgramTrace?: SimulationOpcodeTraceUnit[];
|
|
4933
|
+
|
|
4934
|
+
/**
|
|
4935
|
+
* An array of SimulationTransactionExecTrace representing the execution trace of
|
|
4936
|
+
* any inner transactions executed.
|
|
4937
|
+
*/
|
|
4938
|
+
public innerTrace?: SimulationTransactionExecTrace[];
|
|
4939
|
+
|
|
4940
|
+
/**
|
|
4941
|
+
* SHA512_256 hash digest of the logic sig executed in transaction.
|
|
4942
|
+
*/
|
|
4943
|
+
public logicSigHash?: Uint8Array;
|
|
4944
|
+
|
|
4945
|
+
/**
|
|
4946
|
+
* Program trace that contains a trace of opcode effects in a logic sig.
|
|
4947
|
+
*/
|
|
4948
|
+
public logicSigTrace?: SimulationOpcodeTraceUnit[];
|
|
4949
|
+
|
|
4950
|
+
/**
|
|
4951
|
+
* Creates a new `SimulationTransactionExecTrace` object.
|
|
4952
|
+
* @param approvalProgramHash - SHA512_256 hash digest of the approval program executed in transaction.
|
|
4953
|
+
* @param approvalProgramTrace - Program trace that contains a trace of opcode effects in an approval program.
|
|
4954
|
+
* @param clearStateProgramHash - SHA512_256 hash digest of the clear state program executed in transaction.
|
|
4955
|
+
* @param clearStateProgramTrace - Program trace that contains a trace of opcode effects in a clear state program.
|
|
4956
|
+
* @param innerTrace - An array of SimulationTransactionExecTrace representing the execution trace of
|
|
4957
|
+
* any inner transactions executed.
|
|
4958
|
+
* @param logicSigHash - SHA512_256 hash digest of the logic sig executed in transaction.
|
|
4959
|
+
* @param logicSigTrace - Program trace that contains a trace of opcode effects in a logic sig.
|
|
4960
|
+
*/
|
|
4961
|
+
constructor({
|
|
4962
|
+
approvalProgramHash,
|
|
4963
|
+
approvalProgramTrace,
|
|
4964
|
+
clearStateProgramHash,
|
|
4965
|
+
clearStateProgramTrace,
|
|
4966
|
+
innerTrace,
|
|
4967
|
+
logicSigHash,
|
|
4968
|
+
logicSigTrace,
|
|
4969
|
+
}: {
|
|
4970
|
+
approvalProgramHash?: string | Uint8Array;
|
|
4971
|
+
approvalProgramTrace?: SimulationOpcodeTraceUnit[];
|
|
4972
|
+
clearStateProgramHash?: string | Uint8Array;
|
|
4973
|
+
clearStateProgramTrace?: SimulationOpcodeTraceUnit[];
|
|
4974
|
+
innerTrace?: SimulationTransactionExecTrace[];
|
|
4975
|
+
logicSigHash?: string | Uint8Array;
|
|
4976
|
+
logicSigTrace?: SimulationOpcodeTraceUnit[];
|
|
4977
|
+
}) {
|
|
4978
|
+
super();
|
|
4979
|
+
this.approvalProgramHash =
|
|
4980
|
+
typeof approvalProgramHash === 'string'
|
|
4981
|
+
? new Uint8Array(Buffer.from(approvalProgramHash, 'base64'))
|
|
4982
|
+
: approvalProgramHash;
|
|
4983
|
+
this.approvalProgramTrace = approvalProgramTrace;
|
|
4984
|
+
this.clearStateProgramHash =
|
|
4985
|
+
typeof clearStateProgramHash === 'string'
|
|
4986
|
+
? new Uint8Array(Buffer.from(clearStateProgramHash, 'base64'))
|
|
4987
|
+
: clearStateProgramHash;
|
|
4988
|
+
this.clearStateProgramTrace = clearStateProgramTrace;
|
|
4989
|
+
this.innerTrace = innerTrace;
|
|
4990
|
+
this.logicSigHash =
|
|
4991
|
+
typeof logicSigHash === 'string'
|
|
4992
|
+
? new Uint8Array(Buffer.from(logicSigHash, 'base64'))
|
|
4993
|
+
: logicSigHash;
|
|
4994
|
+
this.logicSigTrace = logicSigTrace;
|
|
4995
|
+
|
|
4996
|
+
this.attribute_map = {
|
|
4997
|
+
approvalProgramHash: 'approval-program-hash',
|
|
4998
|
+
approvalProgramTrace: 'approval-program-trace',
|
|
4999
|
+
clearStateProgramHash: 'clear-state-program-hash',
|
|
5000
|
+
clearStateProgramTrace: 'clear-state-program-trace',
|
|
5001
|
+
innerTrace: 'inner-trace',
|
|
5002
|
+
logicSigHash: 'logic-sig-hash',
|
|
5003
|
+
logicSigTrace: 'logic-sig-trace',
|
|
5004
|
+
};
|
|
5005
|
+
}
|
|
5006
|
+
|
|
5007
|
+
// eslint-disable-next-line camelcase
|
|
5008
|
+
static from_obj_for_encoding(
|
|
5009
|
+
data: Record<string, any>
|
|
5010
|
+
): SimulationTransactionExecTrace {
|
|
5011
|
+
/* eslint-disable dot-notation */
|
|
5012
|
+
return new SimulationTransactionExecTrace({
|
|
5013
|
+
approvalProgramHash: data['approval-program-hash'],
|
|
5014
|
+
approvalProgramTrace:
|
|
5015
|
+
typeof data['approval-program-trace'] !== 'undefined'
|
|
5016
|
+
? data['approval-program-trace'].map(
|
|
5017
|
+
SimulationOpcodeTraceUnit.from_obj_for_encoding
|
|
5018
|
+
)
|
|
5019
|
+
: undefined,
|
|
5020
|
+
clearStateProgramHash: data['clear-state-program-hash'],
|
|
5021
|
+
clearStateProgramTrace:
|
|
5022
|
+
typeof data['clear-state-program-trace'] !== 'undefined'
|
|
5023
|
+
? data['clear-state-program-trace'].map(
|
|
5024
|
+
SimulationOpcodeTraceUnit.from_obj_for_encoding
|
|
5025
|
+
)
|
|
5026
|
+
: undefined,
|
|
5027
|
+
innerTrace:
|
|
5028
|
+
typeof data['inner-trace'] !== 'undefined'
|
|
5029
|
+
? data['inner-trace'].map(
|
|
5030
|
+
SimulationTransactionExecTrace.from_obj_for_encoding
|
|
5031
|
+
)
|
|
5032
|
+
: undefined,
|
|
5033
|
+
logicSigHash: data['logic-sig-hash'],
|
|
5034
|
+
logicSigTrace:
|
|
5035
|
+
typeof data['logic-sig-trace'] !== 'undefined'
|
|
5036
|
+
? data['logic-sig-trace'].map(
|
|
5037
|
+
SimulationOpcodeTraceUnit.from_obj_for_encoding
|
|
5038
|
+
)
|
|
5039
|
+
: undefined,
|
|
5040
|
+
});
|
|
5041
|
+
/* eslint-enable dot-notation */
|
|
5042
|
+
}
|
|
5043
|
+
}
|
|
5044
|
+
|
|
3795
5045
|
/**
|
|
3796
5046
|
* Represents a state proof and its corresponding message
|
|
3797
5047
|
*/
|
|
@@ -4150,7 +5400,7 @@ export class TransactionGroupLedgerStateDeltasForRoundResponse extends BaseModel
|
|
|
4150
5400
|
this.deltas = deltas;
|
|
4151
5401
|
|
|
4152
5402
|
this.attribute_map = {
|
|
4153
|
-
deltas: '
|
|
5403
|
+
deltas: 'Deltas',
|
|
4154
5404
|
};
|
|
4155
5405
|
}
|
|
4156
5406
|
|