algosdk 1.24.1 → 2.1.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.LICENSE.txt +0 -18
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/abi/abi_type.js +6 -5
- package/dist/cjs/abi/abi_type.js.map +1 -1
- package/dist/cjs/bid.js +6 -5
- package/dist/cjs/bid.js.map +1 -1
- package/dist/cjs/client/client.js +4 -3
- package/dist/cjs/client/client.js.map +1 -1
- package/dist/cjs/client/kmd.js +12 -11
- package/dist/cjs/client/kmd.js.map +1 -1
- package/dist/cjs/client/urlTokenBaseHTTPClient.js +2 -1
- package/dist/cjs/client/urlTokenBaseHTTPClient.js.map +1 -1
- package/dist/cjs/client/v2/algod/algod.js +17 -1
- package/dist/cjs/client/v2/algod/algod.js.map +1 -1
- package/dist/cjs/client/v2/algod/compile.js +2 -1
- package/dist/cjs/client/v2/algod/compile.js.map +1 -1
- package/dist/cjs/client/v2/algod/disassemble.js +46 -0
- package/dist/cjs/client/v2/algod/disassemble.js.map +1 -0
- package/dist/cjs/client/v2/algod/dryrun.js +2 -1
- package/dist/cjs/client/v2/algod/dryrun.js.map +1 -1
- package/dist/cjs/client/v2/algod/getApplicationBoxByName.js +2 -1
- package/dist/cjs/client/v2/algod/getApplicationBoxByName.js.map +1 -1
- package/dist/cjs/client/v2/algod/models/types.js +182 -143
- package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
- package/dist/cjs/client/v2/algod/sendRawTransaction.js +2 -1
- package/dist/cjs/client/v2/algod/sendRawTransaction.js.map +1 -1
- package/dist/cjs/client/v2/basemodel.js +3 -2
- package/dist/cjs/client/v2/basemodel.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js +2 -1
- package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupApplicationBoxByIDandName.js +2 -1
- package/dist/cjs/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js +0 -7
- package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
- package/dist/cjs/client/v2/indexer/models/types.js +39 -38
- package/dist/cjs/client/v2/indexer/models/types.js.map +1 -1
- package/dist/cjs/composer.js +7 -6
- package/dist/cjs/composer.js.map +1 -1
- package/dist/cjs/dryrun.js +22 -12
- package/dist/cjs/dryrun.js.map +1 -1
- package/dist/cjs/encoding/address.js +2 -1
- package/dist/cjs/encoding/address.js.map +1 -1
- package/dist/cjs/encoding/bigint.js +2 -1
- package/dist/cjs/encoding/bigint.js.map +1 -1
- package/dist/cjs/encoding/uint64.js +14 -8
- package/dist/cjs/encoding/uint64.js.map +1 -1
- package/dist/cjs/group.js +6 -5
- package/dist/cjs/group.js.map +1 -1
- package/dist/cjs/logicsig.js +24 -21
- package/dist/cjs/logicsig.js.map +1 -1
- package/dist/cjs/main.js +8 -9
- package/dist/cjs/main.js.map +1 -1
- package/dist/cjs/makeTxn.js +1 -193
- package/dist/cjs/makeTxn.js.map +1 -1
- package/dist/cjs/multisig.js +6 -5
- package/dist/cjs/multisig.js.map +1 -1
- package/dist/cjs/transaction.js +64 -63
- package/dist/cjs/transaction.js.map +1 -1
- package/dist/cjs/types/transactions/encoded.js +0 -3
- package/dist/cjs/types/transactions/encoded.js.map +1 -1
- package/dist/cjs/utils/utils.js +5 -1
- package/dist/cjs/utils/utils.js.map +1 -1
- package/dist/esm/abi/abi_type.js +1 -0
- package/dist/esm/abi/abi_type.js.map +1 -1
- package/dist/esm/bid.js +1 -0
- package/dist/esm/bid.js.map +1 -1
- package/dist/esm/client/client.js +1 -0
- package/dist/esm/client/client.js.map +1 -1
- package/dist/esm/client/kmd.js +1 -0
- package/dist/esm/client/kmd.js.map +1 -1
- package/dist/esm/client/urlTokenBaseHTTPClient.js +1 -0
- package/dist/esm/client/urlTokenBaseHTTPClient.js.map +1 -1
- package/dist/esm/client/v2/algod/algod.js +17 -1
- package/dist/esm/client/v2/algod/algod.js.map +1 -1
- package/dist/esm/client/v2/algod/compile.js +1 -0
- package/dist/esm/client/v2/algod/compile.js.map +1 -1
- package/dist/esm/client/v2/algod/disassemble.js +38 -0
- package/dist/esm/client/v2/algod/disassemble.js.map +1 -0
- package/dist/esm/client/v2/algod/dryrun.js +1 -0
- package/dist/esm/client/v2/algod/dryrun.js.map +1 -1
- package/dist/esm/client/v2/algod/getApplicationBoxByName.js +1 -0
- package/dist/esm/client/v2/algod/getApplicationBoxByName.js.map +1 -1
- package/dist/esm/client/v2/algod/models/types.js +161 -120
- package/dist/esm/client/v2/algod/models/types.js.map +1 -1
- package/dist/esm/client/v2/algod/sendRawTransaction.js +1 -0
- package/dist/esm/client/v2/algod/sendRawTransaction.js.map +1 -1
- package/dist/esm/client/v2/basemodel.js +1 -0
- package/dist/esm/client/v2/basemodel.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountTransactions.js +1 -0
- package/dist/esm/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupApplicationBoxByIDandName.js +1 -0
- package/dist/esm/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAssetTransactions.js +0 -7
- package/dist/esm/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
- package/dist/esm/client/v2/indexer/models/types.js +1 -0
- package/dist/esm/client/v2/indexer/models/types.js.map +1 -1
- package/dist/esm/composer.js +5 -4
- package/dist/esm/composer.js.map +1 -1
- package/dist/esm/dryrun.js +17 -7
- package/dist/esm/dryrun.js.map +1 -1
- package/dist/esm/encoding/address.js +1 -0
- package/dist/esm/encoding/address.js.map +1 -1
- package/dist/esm/encoding/bigint.js +1 -0
- package/dist/esm/encoding/bigint.js.map +1 -1
- package/dist/esm/encoding/uint64.js +14 -8
- package/dist/esm/encoding/uint64.js.map +1 -1
- package/dist/esm/group.js +1 -0
- package/dist/esm/group.js.map +1 -1
- package/dist/esm/logicsig.js +15 -12
- package/dist/esm/logicsig.js.map +1 -1
- package/dist/esm/main.js +2 -4
- package/dist/esm/main.js.map +1 -1
- package/dist/esm/makeTxn.js +0 -185
- package/dist/esm/makeTxn.js.map +1 -1
- package/dist/esm/multisig.js +1 -0
- package/dist/esm/multisig.js.map +1 -1
- package/dist/esm/transaction.js +1 -0
- package/dist/esm/transaction.js.map +1 -1
- package/dist/esm/types/transactions/encoded.js +0 -3
- package/dist/esm/types/transactions/encoded.js.map +1 -1
- package/dist/esm/utils/utils.js +5 -1
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/types/client/v2/algod/algod.d.ts +15 -1
- package/dist/types/client/v2/algod/disassemble.d.ts +20 -0
- package/dist/types/client/v2/algod/models/types.d.ts +122 -67
- package/dist/types/client/v2/basemodel.d.ts +0 -3
- package/dist/types/client/v2/indexer/lookupAssetTransactions.d.ts +0 -4
- package/dist/types/composer.d.ts +7 -1
- package/dist/types/logicsig.d.ts +10 -10
- package/dist/types/main.d.ts +1 -3
- package/dist/types/makeTxn.d.ts +1 -147
- package/dist/types/types/transactions/encoded.d.ts +1 -16
- package/package.json +2 -3
- package/src/abi/abi_type.ts +1 -0
- package/src/bid.ts +1 -0
- package/src/client/client.ts +1 -0
- package/src/client/kmd.ts +1 -0
- package/src/client/urlTokenBaseHTTPClient.ts +1 -0
- package/src/client/v2/algod/algod.ts +19 -2
- package/src/client/v2/algod/compile.ts +1 -0
- package/src/client/v2/algod/disassemble.ts +46 -0
- package/src/client/v2/algod/dryrun.ts +1 -0
- package/src/client/v2/algod/getApplicationBoxByName.ts +1 -0
- package/src/client/v2/algod/models/types.ts +319 -249
- package/src/client/v2/algod/sendRawTransaction.ts +1 -0
- package/src/client/v2/basemodel.ts +2 -0
- package/src/client/v2/indexer/lookupAccountTransactions.ts +1 -0
- package/src/client/v2/indexer/lookupApplicationBoxByIDandName.ts +1 -0
- package/src/client/v2/indexer/lookupAssetTransactions.ts +0 -8
- package/src/client/v2/indexer/models/types.ts +1 -0
- package/src/composer.ts +16 -3
- package/src/dryrun.ts +14 -13
- package/src/encoding/address.ts +1 -0
- package/src/encoding/bigint.ts +2 -0
- package/src/encoding/uint64.ts +16 -10
- package/src/group.ts +1 -0
- package/src/logicsig.ts +26 -13
- package/src/main.ts +3 -5
- package/src/makeTxn.ts +0 -421
- package/src/multisig.ts +1 -0
- package/src/transaction.ts +1 -0
- package/src/types/transactions/encoded.ts +2 -17
- package/src/utils/utils.ts +3 -0
- package/dist/cjs/client/algod.js +0 -295
- package/dist/cjs/client/algod.js.map +0 -1
- package/dist/cjs/logic/langspec.json +0 -2014
- package/dist/cjs/logic/logic.js +0 -262
- package/dist/cjs/logic/logic.js.map +0 -1
- package/dist/cjs/logicTemplates/dynamicfee.js +0 -192
- package/dist/cjs/logicTemplates/dynamicfee.js.map +0 -1
- package/dist/cjs/logicTemplates/htlc.js +0 -145
- package/dist/cjs/logicTemplates/htlc.js.map +0 -1
- package/dist/cjs/logicTemplates/index.js +0 -19
- package/dist/cjs/logicTemplates/index.js.map +0 -1
- package/dist/cjs/logicTemplates/limitorder.js +0 -167
- package/dist/cjs/logicTemplates/limitorder.js.map +0 -1
- package/dist/cjs/logicTemplates/periodicpayment.js +0 -163
- package/dist/cjs/logicTemplates/periodicpayment.js.map +0 -1
- package/dist/cjs/logicTemplates/split.js +0 -154
- package/dist/cjs/logicTemplates/split.js.map +0 -1
- package/dist/cjs/logicTemplates/templates.js +0 -67
- package/dist/cjs/logicTemplates/templates.js.map +0 -1
- package/dist/esm/client/algod.js +0 -295
- package/dist/esm/client/algod.js.map +0 -1
- package/dist/esm/logic/langspec.json +0 -2014
- package/dist/esm/logic/logic.js +0 -249
- package/dist/esm/logic/logic.js.map +0 -1
- package/dist/esm/logicTemplates/dynamicfee.js +0 -192
- package/dist/esm/logicTemplates/dynamicfee.js.map +0 -1
- package/dist/esm/logicTemplates/htlc.js +0 -145
- package/dist/esm/logicTemplates/htlc.js.map +0 -1
- package/dist/esm/logicTemplates/index.js +0 -19
- package/dist/esm/logicTemplates/index.js.map +0 -1
- package/dist/esm/logicTemplates/limitorder.js +0 -167
- package/dist/esm/logicTemplates/limitorder.js.map +0 -1
- package/dist/esm/logicTemplates/periodicpayment.js +0 -163
- package/dist/esm/logicTemplates/periodicpayment.js.map +0 -1
- package/dist/esm/logicTemplates/split.js +0 -154
- package/dist/esm/logicTemplates/split.js.map +0 -1
- package/dist/esm/logicTemplates/templates.js +0 -67
- package/dist/esm/logicTemplates/templates.js.map +0 -1
- package/dist/types/client/algod.d.ts +0 -162
- package/dist/types/logic/logic.d.ts +0 -45
- package/dist/types/logicTemplates/dynamicfee.d.ts +0 -59
- package/dist/types/logicTemplates/htlc.d.ts +0 -51
- package/dist/types/logicTemplates/index.d.ts +0 -16
- package/dist/types/logicTemplates/limitorder.d.ts +0 -70
- package/dist/types/logicTemplates/periodicpayment.d.ts +0 -58
- package/dist/types/logicTemplates/split.d.ts +0 -57
- package/dist/types/logicTemplates/templates.d.ts +0 -6
- package/src/client/algod.js +0 -365
- package/src/logic/langspec.json +0 -2014
- package/src/logic/logic.ts +0 -316
- package/src/logicTemplates/dynamicfee.js +0 -219
- package/src/logicTemplates/htlc.js +0 -165
- package/src/logicTemplates/index.js +0 -20
- package/src/logicTemplates/limitorder.js +0 -227
- package/src/logicTemplates/periodicpayment.js +0 -208
- package/src/logicTemplates/split.js +0 -208
- package/src/logicTemplates/templates.js +0 -78
|
@@ -6,8 +6,9 @@ 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.Version = exports.TransactionProofResponse = exports.TransactionParametersResponse = exports.TealValue = exports.TealKeyValue = exports.SupplyResponse = exports.StateProofMessage = exports.StateProof = exports.PostTransactionsResponse = exports.PendingTransactionsResponse = exports.PendingTransactionResponse = exports.NodeStatusResponse = exports.LightBlockHeaderProof = exports.EvalDeltaKeyValue = exports.EvalDelta = exports.ErrorResponse = exports.DryrunTxnResult = exports.DryrunState = exports.DryrunSource = exports.DryrunResponse = exports.DryrunRequest = exports.DisassembleResponse = exports.CompileResponse = exports.
|
|
9
|
+
exports.Version = exports.TransactionProofResponse = exports.TransactionParametersResponse = exports.TealValue = exports.TealKeyValue = exports.SupplyResponse = exports.StateProofMessage = exports.StateProof = exports.PostTransactionsResponse = exports.PendingTransactionsResponse = exports.PendingTransactionResponse = exports.NodeStatusResponse = exports.LightBlockHeaderProof = 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.BoxDescriptor = exports.Box = exports.BlockResponse = exports.BlockHashResponse = exports.AssetParams = exports.AssetHolding = exports.Asset = exports.ApplicationStateSchema = exports.ApplicationParams = exports.ApplicationLocalState = exports.Application = exports.AccountStateDelta = exports.AccountParticipation = exports.AccountAssetResponse = exports.AccountApplicationResponse = exports.Account = void 0;
|
|
10
10
|
/* eslint-disable no-use-before-define */
|
|
11
|
+
const buffer_1 = require("buffer");
|
|
11
12
|
const basemodel_1 = __importDefault(require("../../basemodel"));
|
|
12
13
|
/**
|
|
13
14
|
* Account information at a given round.
|
|
@@ -204,7 +205,7 @@ class AccountApplicationResponse extends basemodel_1.default {
|
|
|
204
205
|
* global data.
|
|
205
206
|
* The raw account uses `AppParams` for this type.
|
|
206
207
|
*/
|
|
207
|
-
constructor(round, appLocalState, createdApp) {
|
|
208
|
+
constructor({ round, appLocalState, createdApp, }) {
|
|
208
209
|
super();
|
|
209
210
|
this.round = round;
|
|
210
211
|
this.appLocalState = appLocalState;
|
|
@@ -220,11 +221,15 @@ class AccountApplicationResponse extends basemodel_1.default {
|
|
|
220
221
|
/* eslint-disable dot-notation */
|
|
221
222
|
if (typeof data['round'] === 'undefined')
|
|
222
223
|
throw new Error(`Response is missing required field 'round': ${data}`);
|
|
223
|
-
return new AccountApplicationResponse(
|
|
224
|
-
|
|
225
|
-
:
|
|
226
|
-
|
|
227
|
-
|
|
224
|
+
return new AccountApplicationResponse({
|
|
225
|
+
round: data['round'],
|
|
226
|
+
appLocalState: typeof data['app-local-state'] !== 'undefined'
|
|
227
|
+
? ApplicationLocalState.from_obj_for_encoding(data['app-local-state'])
|
|
228
|
+
: undefined,
|
|
229
|
+
createdApp: typeof data['created-app'] !== 'undefined'
|
|
230
|
+
? ApplicationParams.from_obj_for_encoding(data['created-app'])
|
|
231
|
+
: undefined,
|
|
232
|
+
});
|
|
228
233
|
/* eslint-enable dot-notation */
|
|
229
234
|
}
|
|
230
235
|
}
|
|
@@ -243,7 +248,7 @@ class AccountAssetResponse extends basemodel_1.default {
|
|
|
243
248
|
* @param createdAsset - (apar) parameters of the asset created by this account.
|
|
244
249
|
* The raw account uses `AssetParams` for this type.
|
|
245
250
|
*/
|
|
246
|
-
constructor(round, assetHolding, createdAsset) {
|
|
251
|
+
constructor({ round, assetHolding, createdAsset, }) {
|
|
247
252
|
super();
|
|
248
253
|
this.round = round;
|
|
249
254
|
this.assetHolding = assetHolding;
|
|
@@ -259,11 +264,15 @@ class AccountAssetResponse extends basemodel_1.default {
|
|
|
259
264
|
/* eslint-disable dot-notation */
|
|
260
265
|
if (typeof data['round'] === 'undefined')
|
|
261
266
|
throw new Error(`Response is missing required field 'round': ${data}`);
|
|
262
|
-
return new AccountAssetResponse(
|
|
263
|
-
|
|
264
|
-
:
|
|
265
|
-
|
|
266
|
-
|
|
267
|
+
return new AccountAssetResponse({
|
|
268
|
+
round: data['round'],
|
|
269
|
+
assetHolding: typeof data['asset-holding'] !== 'undefined'
|
|
270
|
+
? AssetHolding.from_obj_for_encoding(data['asset-holding'])
|
|
271
|
+
: undefined,
|
|
272
|
+
createdAsset: typeof data['created-asset'] !== 'undefined'
|
|
273
|
+
? AssetParams.from_obj_for_encoding(data['created-asset'])
|
|
274
|
+
: undefined,
|
|
275
|
+
});
|
|
267
276
|
/* eslint-enable dot-notation */
|
|
268
277
|
}
|
|
269
278
|
}
|
|
@@ -287,18 +296,18 @@ class AccountParticipation extends basemodel_1.default {
|
|
|
287
296
|
super();
|
|
288
297
|
this.selectionParticipationKey =
|
|
289
298
|
typeof selectionParticipationKey === 'string'
|
|
290
|
-
? new Uint8Array(Buffer.from(selectionParticipationKey, 'base64'))
|
|
299
|
+
? new Uint8Array(buffer_1.Buffer.from(selectionParticipationKey, 'base64'))
|
|
291
300
|
: selectionParticipationKey;
|
|
292
301
|
this.voteFirstValid = voteFirstValid;
|
|
293
302
|
this.voteKeyDilution = voteKeyDilution;
|
|
294
303
|
this.voteLastValid = voteLastValid;
|
|
295
304
|
this.voteParticipationKey =
|
|
296
305
|
typeof voteParticipationKey === 'string'
|
|
297
|
-
? new Uint8Array(Buffer.from(voteParticipationKey, 'base64'))
|
|
306
|
+
? new Uint8Array(buffer_1.Buffer.from(voteParticipationKey, 'base64'))
|
|
298
307
|
: voteParticipationKey;
|
|
299
308
|
this.stateProofKey =
|
|
300
309
|
typeof stateProofKey === 'string'
|
|
301
|
-
? new Uint8Array(Buffer.from(stateProofKey, 'base64'))
|
|
310
|
+
? new Uint8Array(buffer_1.Buffer.from(stateProofKey, 'base64'))
|
|
302
311
|
: stateProofKey;
|
|
303
312
|
this.attribute_map = {
|
|
304
313
|
selectionParticipationKey: 'selection-participation-key',
|
|
@@ -343,7 +352,7 @@ class AccountStateDelta extends basemodel_1.default {
|
|
|
343
352
|
* @param address -
|
|
344
353
|
* @param delta - Application state delta.
|
|
345
354
|
*/
|
|
346
|
-
constructor(address, delta) {
|
|
355
|
+
constructor({ address, delta, }) {
|
|
347
356
|
super();
|
|
348
357
|
this.address = address;
|
|
349
358
|
this.delta = delta;
|
|
@@ -359,7 +368,10 @@ class AccountStateDelta extends basemodel_1.default {
|
|
|
359
368
|
throw new Error(`Response is missing required field 'address': ${data}`);
|
|
360
369
|
if (!Array.isArray(data['delta']))
|
|
361
370
|
throw new Error(`Response is missing required array field 'delta': ${data}`);
|
|
362
|
-
return new AccountStateDelta(
|
|
371
|
+
return new AccountStateDelta({
|
|
372
|
+
address: data['address'],
|
|
373
|
+
delta: data['delta'].map(EvalDeltaKeyValue.from_obj_for_encoding),
|
|
374
|
+
});
|
|
363
375
|
/* eslint-enable dot-notation */
|
|
364
376
|
}
|
|
365
377
|
}
|
|
@@ -373,7 +385,7 @@ class Application extends basemodel_1.default {
|
|
|
373
385
|
* @param id - (appidx) application index.
|
|
374
386
|
* @param params - (appparams) application parameters.
|
|
375
387
|
*/
|
|
376
|
-
constructor(id, params) {
|
|
388
|
+
constructor({ id, params, }) {
|
|
377
389
|
super();
|
|
378
390
|
this.id = id;
|
|
379
391
|
this.params = params;
|
|
@@ -389,7 +401,10 @@ class Application extends basemodel_1.default {
|
|
|
389
401
|
throw new Error(`Response is missing required field 'id': ${data}`);
|
|
390
402
|
if (typeof data['params'] === 'undefined')
|
|
391
403
|
throw new Error(`Response is missing required field 'params': ${data}`);
|
|
392
|
-
return new Application(
|
|
404
|
+
return new Application({
|
|
405
|
+
id: data['id'],
|
|
406
|
+
params: ApplicationParams.from_obj_for_encoding(data['params']),
|
|
407
|
+
});
|
|
393
408
|
/* eslint-enable dot-notation */
|
|
394
409
|
}
|
|
395
410
|
}
|
|
@@ -404,7 +419,7 @@ class ApplicationLocalState extends basemodel_1.default {
|
|
|
404
419
|
* @param schema - (hsch) schema.
|
|
405
420
|
* @param keyValue - (tkv) storage.
|
|
406
421
|
*/
|
|
407
|
-
constructor(id, schema, keyValue) {
|
|
422
|
+
constructor({ id, schema, keyValue, }) {
|
|
408
423
|
super();
|
|
409
424
|
this.id = id;
|
|
410
425
|
this.schema = schema;
|
|
@@ -422,9 +437,13 @@ class ApplicationLocalState extends basemodel_1.default {
|
|
|
422
437
|
throw new Error(`Response is missing required field 'id': ${data}`);
|
|
423
438
|
if (typeof data['schema'] === 'undefined')
|
|
424
439
|
throw new Error(`Response is missing required field 'schema': ${data}`);
|
|
425
|
-
return new ApplicationLocalState(
|
|
426
|
-
|
|
427
|
-
:
|
|
440
|
+
return new ApplicationLocalState({
|
|
441
|
+
id: data['id'],
|
|
442
|
+
schema: ApplicationStateSchema.from_obj_for_encoding(data['schema']),
|
|
443
|
+
keyValue: typeof data['key-value'] !== 'undefined'
|
|
444
|
+
? data['key-value'].map(TealKeyValue.from_obj_for_encoding)
|
|
445
|
+
: undefined,
|
|
446
|
+
});
|
|
428
447
|
/* eslint-enable dot-notation */
|
|
429
448
|
}
|
|
430
449
|
}
|
|
@@ -448,11 +467,11 @@ class ApplicationParams extends basemodel_1.default {
|
|
|
448
467
|
super();
|
|
449
468
|
this.approvalProgram =
|
|
450
469
|
typeof approvalProgram === 'string'
|
|
451
|
-
? new Uint8Array(Buffer.from(approvalProgram, 'base64'))
|
|
470
|
+
? new Uint8Array(buffer_1.Buffer.from(approvalProgram, 'base64'))
|
|
452
471
|
: approvalProgram;
|
|
453
472
|
this.clearStateProgram =
|
|
454
473
|
typeof clearStateProgram === 'string'
|
|
455
|
-
? new Uint8Array(Buffer.from(clearStateProgram, 'base64'))
|
|
474
|
+
? new Uint8Array(buffer_1.Buffer.from(clearStateProgram, 'base64'))
|
|
456
475
|
: clearStateProgram;
|
|
457
476
|
this.creator = creator;
|
|
458
477
|
this.extraProgramPages = extraProgramPages;
|
|
@@ -506,7 +525,7 @@ class ApplicationStateSchema extends basemodel_1.default {
|
|
|
506
525
|
* @param numUint - (nui) num of uints.
|
|
507
526
|
* @param numByteSlice - (nbs) num of byte slices.
|
|
508
527
|
*/
|
|
509
|
-
constructor(numUint, numByteSlice) {
|
|
528
|
+
constructor({ numUint, numByteSlice, }) {
|
|
510
529
|
super();
|
|
511
530
|
this.numUint = numUint;
|
|
512
531
|
this.numByteSlice = numByteSlice;
|
|
@@ -522,7 +541,10 @@ class ApplicationStateSchema extends basemodel_1.default {
|
|
|
522
541
|
throw new Error(`Response is missing required field 'num-uint': ${data}`);
|
|
523
542
|
if (typeof data['num-byte-slice'] === 'undefined')
|
|
524
543
|
throw new Error(`Response is missing required field 'num-byte-slice': ${data}`);
|
|
525
|
-
return new ApplicationStateSchema(
|
|
544
|
+
return new ApplicationStateSchema({
|
|
545
|
+
numUint: data['num-uint'],
|
|
546
|
+
numByteSlice: data['num-byte-slice'],
|
|
547
|
+
});
|
|
526
548
|
/* eslint-enable dot-notation */
|
|
527
549
|
}
|
|
528
550
|
}
|
|
@@ -539,7 +561,7 @@ class Asset extends basemodel_1.default {
|
|
|
539
561
|
* Definition:
|
|
540
562
|
* data/transactions/asset.go : AssetParams
|
|
541
563
|
*/
|
|
542
|
-
constructor(index, params) {
|
|
564
|
+
constructor({ index, params, }) {
|
|
543
565
|
super();
|
|
544
566
|
this.index = index;
|
|
545
567
|
this.params = params;
|
|
@@ -555,7 +577,10 @@ class Asset extends basemodel_1.default {
|
|
|
555
577
|
throw new Error(`Response is missing required field 'index': ${data}`);
|
|
556
578
|
if (typeof data['params'] === 'undefined')
|
|
557
579
|
throw new Error(`Response is missing required field 'params': ${data}`);
|
|
558
|
-
return new Asset(
|
|
580
|
+
return new Asset({
|
|
581
|
+
index: data['index'],
|
|
582
|
+
params: AssetParams.from_obj_for_encoding(data['params']),
|
|
583
|
+
});
|
|
559
584
|
/* eslint-enable dot-notation */
|
|
560
585
|
}
|
|
561
586
|
}
|
|
@@ -572,7 +597,7 @@ class AssetHolding extends basemodel_1.default {
|
|
|
572
597
|
* @param assetId - Asset ID of the holding.
|
|
573
598
|
* @param isFrozen - (f) whether or not the holding is frozen.
|
|
574
599
|
*/
|
|
575
|
-
constructor(amount, assetId, isFrozen) {
|
|
600
|
+
constructor({ amount, assetId, isFrozen, }) {
|
|
576
601
|
super();
|
|
577
602
|
this.amount = amount;
|
|
578
603
|
this.assetId = assetId;
|
|
@@ -592,7 +617,11 @@ class AssetHolding extends basemodel_1.default {
|
|
|
592
617
|
throw new Error(`Response is missing required field 'asset-id': ${data}`);
|
|
593
618
|
if (typeof data['is-frozen'] === 'undefined')
|
|
594
619
|
throw new Error(`Response is missing required field 'is-frozen': ${data}`);
|
|
595
|
-
return new AssetHolding(
|
|
620
|
+
return new AssetHolding({
|
|
621
|
+
amount: data['amount'],
|
|
622
|
+
assetId: data['asset-id'],
|
|
623
|
+
isFrozen: data['is-frozen'],
|
|
624
|
+
});
|
|
596
625
|
/* eslint-enable dot-notation */
|
|
597
626
|
}
|
|
598
627
|
}
|
|
@@ -644,23 +673,23 @@ class AssetParams extends basemodel_1.default {
|
|
|
644
673
|
this.manager = manager;
|
|
645
674
|
this.metadataHash =
|
|
646
675
|
typeof metadataHash === 'string'
|
|
647
|
-
? new Uint8Array(Buffer.from(metadataHash, 'base64'))
|
|
676
|
+
? new Uint8Array(buffer_1.Buffer.from(metadataHash, 'base64'))
|
|
648
677
|
: metadataHash;
|
|
649
678
|
this.name = name;
|
|
650
679
|
this.nameB64 =
|
|
651
680
|
typeof nameB64 === 'string'
|
|
652
|
-
? new Uint8Array(Buffer.from(nameB64, 'base64'))
|
|
681
|
+
? new Uint8Array(buffer_1.Buffer.from(nameB64, 'base64'))
|
|
653
682
|
: nameB64;
|
|
654
683
|
this.reserve = reserve;
|
|
655
684
|
this.unitName = unitName;
|
|
656
685
|
this.unitNameB64 =
|
|
657
686
|
typeof unitNameB64 === 'string'
|
|
658
|
-
? new Uint8Array(Buffer.from(unitNameB64, 'base64'))
|
|
687
|
+
? new Uint8Array(buffer_1.Buffer.from(unitNameB64, 'base64'))
|
|
659
688
|
: unitNameB64;
|
|
660
689
|
this.url = url;
|
|
661
690
|
this.urlB64 =
|
|
662
691
|
typeof urlB64 === 'string'
|
|
663
|
-
? new Uint8Array(Buffer.from(urlB64, 'base64'))
|
|
692
|
+
? new Uint8Array(buffer_1.Buffer.from(urlB64, 'base64'))
|
|
664
693
|
: urlB64;
|
|
665
694
|
this.attribute_map = {
|
|
666
695
|
creator: 'creator',
|
|
@@ -718,7 +747,7 @@ class BlockHashResponse extends basemodel_1.default {
|
|
|
718
747
|
* Creates a new `BlockHashResponse` object.
|
|
719
748
|
* @param blockhash - Block header hash.
|
|
720
749
|
*/
|
|
721
|
-
constructor(blockhash) {
|
|
750
|
+
constructor({ blockhash }) {
|
|
722
751
|
super();
|
|
723
752
|
this.blockhash = blockhash;
|
|
724
753
|
this.attribute_map = {
|
|
@@ -730,7 +759,9 @@ class BlockHashResponse extends basemodel_1.default {
|
|
|
730
759
|
/* eslint-disable dot-notation */
|
|
731
760
|
if (typeof data['blockHash'] === 'undefined')
|
|
732
761
|
throw new Error(`Response is missing required field 'blockHash': ${data}`);
|
|
733
|
-
return new BlockHashResponse(
|
|
762
|
+
return new BlockHashResponse({
|
|
763
|
+
blockhash: data['blockHash'],
|
|
764
|
+
});
|
|
734
765
|
/* eslint-enable dot-notation */
|
|
735
766
|
}
|
|
736
767
|
}
|
|
@@ -745,7 +776,7 @@ class BlockResponse extends basemodel_1.default {
|
|
|
745
776
|
* @param cert - Optional certificate object. This is only included when the format is set to
|
|
746
777
|
* message pack.
|
|
747
778
|
*/
|
|
748
|
-
constructor(block, cert) {
|
|
779
|
+
constructor({ block, cert, }) {
|
|
749
780
|
super();
|
|
750
781
|
this.block = block;
|
|
751
782
|
this.cert = cert;
|
|
@@ -759,7 +790,10 @@ class BlockResponse extends basemodel_1.default {
|
|
|
759
790
|
/* eslint-disable dot-notation */
|
|
760
791
|
if (typeof data['block'] === 'undefined')
|
|
761
792
|
throw new Error(`Response is missing required field 'block': ${data}`);
|
|
762
|
-
return new BlockResponse(
|
|
793
|
+
return new BlockResponse({
|
|
794
|
+
block: data['block'],
|
|
795
|
+
cert: data['cert'],
|
|
796
|
+
});
|
|
763
797
|
/* eslint-enable dot-notation */
|
|
764
798
|
}
|
|
765
799
|
}
|
|
@@ -773,15 +807,15 @@ class Box extends basemodel_1.default {
|
|
|
773
807
|
* @param name - (name) box name, base64 encoded
|
|
774
808
|
* @param value - (value) box value, base64 encoded.
|
|
775
809
|
*/
|
|
776
|
-
constructor(name, value) {
|
|
810
|
+
constructor({ name, value, }) {
|
|
777
811
|
super();
|
|
778
812
|
this.name =
|
|
779
813
|
typeof name === 'string'
|
|
780
|
-
? new Uint8Array(Buffer.from(name, 'base64'))
|
|
814
|
+
? new Uint8Array(buffer_1.Buffer.from(name, 'base64'))
|
|
781
815
|
: name;
|
|
782
816
|
this.value =
|
|
783
817
|
typeof value === 'string'
|
|
784
|
-
? new Uint8Array(Buffer.from(value, 'base64'))
|
|
818
|
+
? new Uint8Array(buffer_1.Buffer.from(value, 'base64'))
|
|
785
819
|
: value;
|
|
786
820
|
this.attribute_map = {
|
|
787
821
|
name: 'name',
|
|
@@ -795,7 +829,10 @@ class Box extends basemodel_1.default {
|
|
|
795
829
|
throw new Error(`Response is missing required field 'name': ${data}`);
|
|
796
830
|
if (typeof data['value'] === 'undefined')
|
|
797
831
|
throw new Error(`Response is missing required field 'value': ${data}`);
|
|
798
|
-
return new Box(
|
|
832
|
+
return new Box({
|
|
833
|
+
name: data['name'],
|
|
834
|
+
value: data['value'],
|
|
835
|
+
});
|
|
799
836
|
/* eslint-enable dot-notation */
|
|
800
837
|
}
|
|
801
838
|
}
|
|
@@ -808,11 +845,11 @@ class BoxDescriptor extends basemodel_1.default {
|
|
|
808
845
|
* Creates a new `BoxDescriptor` object.
|
|
809
846
|
* @param name - Base64 encoded box name
|
|
810
847
|
*/
|
|
811
|
-
constructor(name) {
|
|
848
|
+
constructor({ name }) {
|
|
812
849
|
super();
|
|
813
850
|
this.name =
|
|
814
851
|
typeof name === 'string'
|
|
815
|
-
? new Uint8Array(Buffer.from(name, 'base64'))
|
|
852
|
+
? new Uint8Array(buffer_1.Buffer.from(name, 'base64'))
|
|
816
853
|
: name;
|
|
817
854
|
this.attribute_map = {
|
|
818
855
|
name: 'name',
|
|
@@ -823,7 +860,9 @@ class BoxDescriptor extends basemodel_1.default {
|
|
|
823
860
|
/* eslint-disable dot-notation */
|
|
824
861
|
if (typeof data['name'] === 'undefined')
|
|
825
862
|
throw new Error(`Response is missing required field 'name': ${data}`);
|
|
826
|
-
return new BoxDescriptor(
|
|
863
|
+
return new BoxDescriptor({
|
|
864
|
+
name: data['name'],
|
|
865
|
+
});
|
|
827
866
|
/* eslint-enable dot-notation */
|
|
828
867
|
}
|
|
829
868
|
}
|
|
@@ -836,7 +875,7 @@ class BoxesResponse extends basemodel_1.default {
|
|
|
836
875
|
* Creates a new `BoxesResponse` object.
|
|
837
876
|
* @param boxes -
|
|
838
877
|
*/
|
|
839
|
-
constructor(boxes) {
|
|
878
|
+
constructor({ boxes }) {
|
|
840
879
|
super();
|
|
841
880
|
this.boxes = boxes;
|
|
842
881
|
this.attribute_map = {
|
|
@@ -848,7 +887,9 @@ class BoxesResponse extends basemodel_1.default {
|
|
|
848
887
|
/* eslint-disable dot-notation */
|
|
849
888
|
if (!Array.isArray(data['boxes']))
|
|
850
889
|
throw new Error(`Response is missing required array field 'boxes': ${data}`);
|
|
851
|
-
return new BoxesResponse(
|
|
890
|
+
return new BoxesResponse({
|
|
891
|
+
boxes: data['boxes'].map(BoxDescriptor.from_obj_for_encoding),
|
|
892
|
+
});
|
|
852
893
|
/* eslint-enable dot-notation */
|
|
853
894
|
}
|
|
854
895
|
}
|
|
@@ -907,56 +948,6 @@ class BuildVersion extends basemodel_1.default {
|
|
|
907
948
|
}
|
|
908
949
|
}
|
|
909
950
|
exports.BuildVersion = BuildVersion;
|
|
910
|
-
/**
|
|
911
|
-
*
|
|
912
|
-
*/
|
|
913
|
-
class CatchpointAbortResponse extends basemodel_1.default {
|
|
914
|
-
/**
|
|
915
|
-
* Creates a new `CatchpointAbortResponse` object.
|
|
916
|
-
* @param catchupMessage - Catchup abort response string
|
|
917
|
-
*/
|
|
918
|
-
constructor(catchupMessage) {
|
|
919
|
-
super();
|
|
920
|
-
this.catchupMessage = catchupMessage;
|
|
921
|
-
this.attribute_map = {
|
|
922
|
-
catchupMessage: 'catchup-message',
|
|
923
|
-
};
|
|
924
|
-
}
|
|
925
|
-
// eslint-disable-next-line camelcase
|
|
926
|
-
static from_obj_for_encoding(data) {
|
|
927
|
-
/* eslint-disable dot-notation */
|
|
928
|
-
if (typeof data['catchup-message'] === 'undefined')
|
|
929
|
-
throw new Error(`Response is missing required field 'catchup-message': ${data}`);
|
|
930
|
-
return new CatchpointAbortResponse(data['catchup-message']);
|
|
931
|
-
/* eslint-enable dot-notation */
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
exports.CatchpointAbortResponse = CatchpointAbortResponse;
|
|
935
|
-
/**
|
|
936
|
-
*
|
|
937
|
-
*/
|
|
938
|
-
class CatchpointStartResponse extends basemodel_1.default {
|
|
939
|
-
/**
|
|
940
|
-
* Creates a new `CatchpointStartResponse` object.
|
|
941
|
-
* @param catchupMessage - Catchup start response string
|
|
942
|
-
*/
|
|
943
|
-
constructor(catchupMessage) {
|
|
944
|
-
super();
|
|
945
|
-
this.catchupMessage = catchupMessage;
|
|
946
|
-
this.attribute_map = {
|
|
947
|
-
catchupMessage: 'catchup-message',
|
|
948
|
-
};
|
|
949
|
-
}
|
|
950
|
-
// eslint-disable-next-line camelcase
|
|
951
|
-
static from_obj_for_encoding(data) {
|
|
952
|
-
/* eslint-disable dot-notation */
|
|
953
|
-
if (typeof data['catchup-message'] === 'undefined')
|
|
954
|
-
throw new Error(`Response is missing required field 'catchup-message': ${data}`);
|
|
955
|
-
return new CatchpointStartResponse(data['catchup-message']);
|
|
956
|
-
/* eslint-enable dot-notation */
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
exports.CatchpointStartResponse = CatchpointStartResponse;
|
|
960
951
|
/**
|
|
961
952
|
* Teal compile Result
|
|
962
953
|
*/
|
|
@@ -967,7 +958,7 @@ class CompileResponse extends basemodel_1.default {
|
|
|
967
958
|
* @param result - base64 encoded program bytes
|
|
968
959
|
* @param sourcemap - JSON of the source map
|
|
969
960
|
*/
|
|
970
|
-
constructor(hash, result, sourcemap) {
|
|
961
|
+
constructor({ hash, result, sourcemap, }) {
|
|
971
962
|
super();
|
|
972
963
|
this.hash = hash;
|
|
973
964
|
this.result = result;
|
|
@@ -985,7 +976,11 @@ class CompileResponse extends basemodel_1.default {
|
|
|
985
976
|
throw new Error(`Response is missing required field 'hash': ${data}`);
|
|
986
977
|
if (typeof data['result'] === 'undefined')
|
|
987
978
|
throw new Error(`Response is missing required field 'result': ${data}`);
|
|
988
|
-
return new CompileResponse(
|
|
979
|
+
return new CompileResponse({
|
|
980
|
+
hash: data['hash'],
|
|
981
|
+
result: data['result'],
|
|
982
|
+
sourcemap: data['sourcemap'],
|
|
983
|
+
});
|
|
989
984
|
/* eslint-enable dot-notation */
|
|
990
985
|
}
|
|
991
986
|
}
|
|
@@ -998,7 +993,7 @@ class DisassembleResponse extends basemodel_1.default {
|
|
|
998
993
|
* Creates a new `DisassembleResponse` object.
|
|
999
994
|
* @param result - disassembled Teal code
|
|
1000
995
|
*/
|
|
1001
|
-
constructor(result) {
|
|
996
|
+
constructor({ result }) {
|
|
1002
997
|
super();
|
|
1003
998
|
this.result = result;
|
|
1004
999
|
this.attribute_map = {
|
|
@@ -1010,7 +1005,9 @@ class DisassembleResponse extends basemodel_1.default {
|
|
|
1010
1005
|
/* eslint-disable dot-notation */
|
|
1011
1006
|
if (typeof data['result'] === 'undefined')
|
|
1012
1007
|
throw new Error(`Response is missing required field 'result': ${data}`);
|
|
1013
|
-
return new DisassembleResponse(
|
|
1008
|
+
return new DisassembleResponse({
|
|
1009
|
+
result: data['result'],
|
|
1010
|
+
});
|
|
1014
1011
|
/* eslint-enable dot-notation */
|
|
1015
1012
|
}
|
|
1016
1013
|
}
|
|
@@ -1092,7 +1089,7 @@ class DryrunResponse extends basemodel_1.default {
|
|
|
1092
1089
|
* @param protocolVersion - Protocol version is the protocol version Dryrun was operated under.
|
|
1093
1090
|
* @param txns -
|
|
1094
1091
|
*/
|
|
1095
|
-
constructor(error, protocolVersion, txns) {
|
|
1092
|
+
constructor({ error, protocolVersion, txns, }) {
|
|
1096
1093
|
super();
|
|
1097
1094
|
this.error = error;
|
|
1098
1095
|
this.protocolVersion = protocolVersion;
|
|
@@ -1112,7 +1109,11 @@ class DryrunResponse extends basemodel_1.default {
|
|
|
1112
1109
|
throw new Error(`Response is missing required field 'protocol-version': ${data}`);
|
|
1113
1110
|
if (!Array.isArray(data['txns']))
|
|
1114
1111
|
throw new Error(`Response is missing required array field 'txns': ${data}`);
|
|
1115
|
-
return new DryrunResponse(
|
|
1112
|
+
return new DryrunResponse({
|
|
1113
|
+
error: data['error'],
|
|
1114
|
+
protocolVersion: data['protocol-version'],
|
|
1115
|
+
txns: data['txns'].map(DryrunTxnResult.from_obj_for_encoding),
|
|
1116
|
+
});
|
|
1116
1117
|
/* eslint-enable dot-notation */
|
|
1117
1118
|
}
|
|
1118
1119
|
}
|
|
@@ -1131,7 +1132,7 @@ class DryrunSource extends basemodel_1.default {
|
|
|
1131
1132
|
* @param txnIndex -
|
|
1132
1133
|
* @param appIndex -
|
|
1133
1134
|
*/
|
|
1134
|
-
constructor(fieldName, source, txnIndex, appIndex) {
|
|
1135
|
+
constructor({ fieldName, source, txnIndex, appIndex, }) {
|
|
1135
1136
|
super();
|
|
1136
1137
|
this.fieldName = fieldName;
|
|
1137
1138
|
this.source = source;
|
|
@@ -1155,7 +1156,12 @@ class DryrunSource extends basemodel_1.default {
|
|
|
1155
1156
|
throw new Error(`Response is missing required field 'txn-index': ${data}`);
|
|
1156
1157
|
if (typeof data['app-index'] === 'undefined')
|
|
1157
1158
|
throw new Error(`Response is missing required field 'app-index': ${data}`);
|
|
1158
|
-
return new DryrunSource(
|
|
1159
|
+
return new DryrunSource({
|
|
1160
|
+
fieldName: data['field-name'],
|
|
1161
|
+
source: data['source'],
|
|
1162
|
+
txnIndex: data['txn-index'],
|
|
1163
|
+
appIndex: data['app-index'],
|
|
1164
|
+
});
|
|
1159
1165
|
/* eslint-enable dot-notation */
|
|
1160
1166
|
}
|
|
1161
1167
|
}
|
|
@@ -1221,8 +1227,6 @@ class DryrunTxnResult extends basemodel_1.default {
|
|
|
1221
1227
|
* @param appCallTrace -
|
|
1222
1228
|
* @param budgetAdded - Budget added during execution of app call transaction.
|
|
1223
1229
|
* @param budgetConsumed - Budget consumed during execution of app call transaction.
|
|
1224
|
-
* @param cost - Net cost of app execution. Field is DEPRECATED and is subject for removal.
|
|
1225
|
-
* Instead, use `budget-added` and `budget-consumed.
|
|
1226
1230
|
* @param globalDelta - Application state delta.
|
|
1227
1231
|
* @param localDeltas -
|
|
1228
1232
|
* @param logicSigDisassembly - Disassembled lsig program line by line.
|
|
@@ -1230,14 +1234,13 @@ class DryrunTxnResult extends basemodel_1.default {
|
|
|
1230
1234
|
* @param logicSigTrace -
|
|
1231
1235
|
* @param logs -
|
|
1232
1236
|
*/
|
|
1233
|
-
constructor({ disassembly, appCallMessages, appCallTrace, budgetAdded, budgetConsumed,
|
|
1237
|
+
constructor({ disassembly, appCallMessages, appCallTrace, budgetAdded, budgetConsumed, globalDelta, localDeltas, logicSigDisassembly, logicSigMessages, logicSigTrace, logs, }) {
|
|
1234
1238
|
super();
|
|
1235
1239
|
this.disassembly = disassembly;
|
|
1236
1240
|
this.appCallMessages = appCallMessages;
|
|
1237
1241
|
this.appCallTrace = appCallTrace;
|
|
1238
1242
|
this.budgetAdded = budgetAdded;
|
|
1239
1243
|
this.budgetConsumed = budgetConsumed;
|
|
1240
|
-
this.cost = cost;
|
|
1241
1244
|
this.globalDelta = globalDelta;
|
|
1242
1245
|
this.localDeltas = localDeltas;
|
|
1243
1246
|
this.logicSigDisassembly = logicSigDisassembly;
|
|
@@ -1250,7 +1253,6 @@ class DryrunTxnResult extends basemodel_1.default {
|
|
|
1250
1253
|
appCallTrace: 'app-call-trace',
|
|
1251
1254
|
budgetAdded: 'budget-added',
|
|
1252
1255
|
budgetConsumed: 'budget-consumed',
|
|
1253
|
-
cost: 'cost',
|
|
1254
1256
|
globalDelta: 'global-delta',
|
|
1255
1257
|
localDeltas: 'local-deltas',
|
|
1256
1258
|
logicSigDisassembly: 'logic-sig-disassembly',
|
|
@@ -1272,7 +1274,6 @@ class DryrunTxnResult extends basemodel_1.default {
|
|
|
1272
1274
|
: undefined,
|
|
1273
1275
|
budgetAdded: data['budget-added'],
|
|
1274
1276
|
budgetConsumed: data['budget-consumed'],
|
|
1275
|
-
cost: data['cost'],
|
|
1276
1277
|
globalDelta: typeof data['global-delta'] !== 'undefined'
|
|
1277
1278
|
? data['global-delta'].map(EvalDeltaKeyValue.from_obj_for_encoding)
|
|
1278
1279
|
: undefined,
|
|
@@ -1299,7 +1300,7 @@ class ErrorResponse extends basemodel_1.default {
|
|
|
1299
1300
|
* @param message -
|
|
1300
1301
|
* @param data -
|
|
1301
1302
|
*/
|
|
1302
|
-
constructor(message, data) {
|
|
1303
|
+
constructor({ message, data, }) {
|
|
1303
1304
|
super();
|
|
1304
1305
|
this.message = message;
|
|
1305
1306
|
this.data = data;
|
|
@@ -1313,7 +1314,10 @@ class ErrorResponse extends basemodel_1.default {
|
|
|
1313
1314
|
/* eslint-disable dot-notation */
|
|
1314
1315
|
if (typeof data['message'] === 'undefined')
|
|
1315
1316
|
throw new Error(`Response is missing required field 'message': ${data}`);
|
|
1316
|
-
return new ErrorResponse(
|
|
1317
|
+
return new ErrorResponse({
|
|
1318
|
+
message: data['message'],
|
|
1319
|
+
data: data['data'],
|
|
1320
|
+
});
|
|
1317
1321
|
/* eslint-enable dot-notation */
|
|
1318
1322
|
}
|
|
1319
1323
|
}
|
|
@@ -1328,7 +1332,7 @@ class EvalDelta extends basemodel_1.default {
|
|
|
1328
1332
|
* @param bytes - (bs) bytes value.
|
|
1329
1333
|
* @param uint - (ui) uint value.
|
|
1330
1334
|
*/
|
|
1331
|
-
constructor(action, bytes, uint) {
|
|
1335
|
+
constructor({ action, bytes, uint, }) {
|
|
1332
1336
|
super();
|
|
1333
1337
|
this.action = action;
|
|
1334
1338
|
this.bytes = bytes;
|
|
@@ -1344,7 +1348,11 @@ class EvalDelta extends basemodel_1.default {
|
|
|
1344
1348
|
/* eslint-disable dot-notation */
|
|
1345
1349
|
if (typeof data['action'] === 'undefined')
|
|
1346
1350
|
throw new Error(`Response is missing required field 'action': ${data}`);
|
|
1347
|
-
return new EvalDelta(
|
|
1351
|
+
return new EvalDelta({
|
|
1352
|
+
action: data['action'],
|
|
1353
|
+
bytes: data['bytes'],
|
|
1354
|
+
uint: data['uint'],
|
|
1355
|
+
});
|
|
1348
1356
|
/* eslint-enable dot-notation */
|
|
1349
1357
|
}
|
|
1350
1358
|
}
|
|
@@ -1358,7 +1366,7 @@ class EvalDeltaKeyValue extends basemodel_1.default {
|
|
|
1358
1366
|
* @param key -
|
|
1359
1367
|
* @param value - Represents a TEAL value delta.
|
|
1360
1368
|
*/
|
|
1361
|
-
constructor(key, value) {
|
|
1369
|
+
constructor({ key, value }) {
|
|
1362
1370
|
super();
|
|
1363
1371
|
this.key = key;
|
|
1364
1372
|
this.value = value;
|
|
@@ -1374,7 +1382,10 @@ class EvalDeltaKeyValue extends basemodel_1.default {
|
|
|
1374
1382
|
throw new Error(`Response is missing required field 'key': ${data}`);
|
|
1375
1383
|
if (typeof data['value'] === 'undefined')
|
|
1376
1384
|
throw new Error(`Response is missing required field 'value': ${data}`);
|
|
1377
|
-
return new EvalDeltaKeyValue(
|
|
1385
|
+
return new EvalDeltaKeyValue({
|
|
1386
|
+
key: data['key'],
|
|
1387
|
+
value: EvalDelta.from_obj_for_encoding(data['value']),
|
|
1388
|
+
});
|
|
1378
1389
|
/* eslint-enable dot-notation */
|
|
1379
1390
|
}
|
|
1380
1391
|
}
|
|
@@ -1390,12 +1401,12 @@ class LightBlockHeaderProof extends basemodel_1.default {
|
|
|
1390
1401
|
* @param treedepth - Represents the depth of the tree that is being proven, i.e. the number of edges
|
|
1391
1402
|
* from a leaf to the root.
|
|
1392
1403
|
*/
|
|
1393
|
-
constructor(index, proof, treedepth) {
|
|
1404
|
+
constructor({ index, proof, treedepth, }) {
|
|
1394
1405
|
super();
|
|
1395
1406
|
this.index = index;
|
|
1396
1407
|
this.proof =
|
|
1397
1408
|
typeof proof === 'string'
|
|
1398
|
-
? new Uint8Array(Buffer.from(proof, 'base64'))
|
|
1409
|
+
? new Uint8Array(buffer_1.Buffer.from(proof, 'base64'))
|
|
1399
1410
|
: proof;
|
|
1400
1411
|
this.treedepth = treedepth;
|
|
1401
1412
|
this.attribute_map = {
|
|
@@ -1413,7 +1424,11 @@ class LightBlockHeaderProof extends basemodel_1.default {
|
|
|
1413
1424
|
throw new Error(`Response is missing required field 'proof': ${data}`);
|
|
1414
1425
|
if (typeof data['treedepth'] === 'undefined')
|
|
1415
1426
|
throw new Error(`Response is missing required field 'treedepth': ${data}`);
|
|
1416
|
-
return new LightBlockHeaderProof(
|
|
1427
|
+
return new LightBlockHeaderProof({
|
|
1428
|
+
index: data['index'],
|
|
1429
|
+
proof: data['proof'],
|
|
1430
|
+
treedepth: data['treedepth'],
|
|
1431
|
+
});
|
|
1417
1432
|
/* eslint-enable dot-notation */
|
|
1418
1433
|
}
|
|
1419
1434
|
}
|
|
@@ -1639,7 +1654,7 @@ class PendingTransactionsResponse extends basemodel_1.default {
|
|
|
1639
1654
|
* @param topTransactions - An array of signed transaction objects.
|
|
1640
1655
|
* @param totalTransactions - Total number of transactions in the pool.
|
|
1641
1656
|
*/
|
|
1642
|
-
constructor(topTransactions, totalTransactions) {
|
|
1657
|
+
constructor({ topTransactions, totalTransactions, }) {
|
|
1643
1658
|
super();
|
|
1644
1659
|
this.topTransactions = topTransactions;
|
|
1645
1660
|
this.totalTransactions = totalTransactions;
|
|
@@ -1655,7 +1670,10 @@ class PendingTransactionsResponse extends basemodel_1.default {
|
|
|
1655
1670
|
throw new Error(`Response is missing required array field 'top-transactions': ${data}`);
|
|
1656
1671
|
if (typeof data['total-transactions'] === 'undefined')
|
|
1657
1672
|
throw new Error(`Response is missing required field 'total-transactions': ${data}`);
|
|
1658
|
-
return new PendingTransactionsResponse(
|
|
1673
|
+
return new PendingTransactionsResponse({
|
|
1674
|
+
topTransactions: data['top-transactions'],
|
|
1675
|
+
totalTransactions: data['total-transactions'],
|
|
1676
|
+
});
|
|
1659
1677
|
/* eslint-enable dot-notation */
|
|
1660
1678
|
}
|
|
1661
1679
|
}
|
|
@@ -1668,7 +1686,7 @@ class PostTransactionsResponse extends basemodel_1.default {
|
|
|
1668
1686
|
* Creates a new `PostTransactionsResponse` object.
|
|
1669
1687
|
* @param txid - encoding of the transaction hash.
|
|
1670
1688
|
*/
|
|
1671
|
-
constructor(txid) {
|
|
1689
|
+
constructor({ txid }) {
|
|
1672
1690
|
super();
|
|
1673
1691
|
this.txid = txid;
|
|
1674
1692
|
this.attribute_map = {
|
|
@@ -1680,7 +1698,9 @@ class PostTransactionsResponse extends basemodel_1.default {
|
|
|
1680
1698
|
/* eslint-disable dot-notation */
|
|
1681
1699
|
if (typeof data['txId'] === 'undefined')
|
|
1682
1700
|
throw new Error(`Response is missing required field 'txId': ${data}`);
|
|
1683
|
-
return new PostTransactionsResponse(
|
|
1701
|
+
return new PostTransactionsResponse({
|
|
1702
|
+
txid: data['txId'],
|
|
1703
|
+
});
|
|
1684
1704
|
/* eslint-enable dot-notation */
|
|
1685
1705
|
}
|
|
1686
1706
|
}
|
|
@@ -1694,12 +1714,12 @@ class StateProof extends basemodel_1.default {
|
|
|
1694
1714
|
* @param message - Represents the message that the state proofs are attesting to.
|
|
1695
1715
|
* @param stateproof - The encoded StateProof for the message.
|
|
1696
1716
|
*/
|
|
1697
|
-
constructor(message, stateproof) {
|
|
1717
|
+
constructor({ message, stateproof, }) {
|
|
1698
1718
|
super();
|
|
1699
1719
|
this.message = message;
|
|
1700
1720
|
this.stateproof =
|
|
1701
1721
|
typeof stateproof === 'string'
|
|
1702
|
-
? new Uint8Array(Buffer.from(stateproof, 'base64'))
|
|
1722
|
+
? new Uint8Array(buffer_1.Buffer.from(stateproof, 'base64'))
|
|
1703
1723
|
: stateproof;
|
|
1704
1724
|
this.attribute_map = {
|
|
1705
1725
|
message: 'Message',
|
|
@@ -1713,7 +1733,10 @@ class StateProof extends basemodel_1.default {
|
|
|
1713
1733
|
throw new Error(`Response is missing required field 'Message': ${data}`);
|
|
1714
1734
|
if (typeof data['StateProof'] === 'undefined')
|
|
1715
1735
|
throw new Error(`Response is missing required field 'StateProof': ${data}`);
|
|
1716
|
-
return new StateProof(
|
|
1736
|
+
return new StateProof({
|
|
1737
|
+
message: StateProofMessage.from_obj_for_encoding(data['Message']),
|
|
1738
|
+
stateproof: data['StateProof'],
|
|
1739
|
+
});
|
|
1717
1740
|
/* eslint-enable dot-notation */
|
|
1718
1741
|
}
|
|
1719
1742
|
}
|
|
@@ -1736,14 +1759,14 @@ class StateProofMessage extends basemodel_1.default {
|
|
|
1736
1759
|
super();
|
|
1737
1760
|
this.blockheaderscommitment =
|
|
1738
1761
|
typeof blockheaderscommitment === 'string'
|
|
1739
|
-
? new Uint8Array(Buffer.from(blockheaderscommitment, 'base64'))
|
|
1762
|
+
? new Uint8Array(buffer_1.Buffer.from(blockheaderscommitment, 'base64'))
|
|
1740
1763
|
: blockheaderscommitment;
|
|
1741
1764
|
this.firstattestedround = firstattestedround;
|
|
1742
1765
|
this.lastattestedround = lastattestedround;
|
|
1743
1766
|
this.lnprovenweight = lnprovenweight;
|
|
1744
1767
|
this.voterscommitment =
|
|
1745
1768
|
typeof voterscommitment === 'string'
|
|
1746
|
-
? new Uint8Array(Buffer.from(voterscommitment, 'base64'))
|
|
1769
|
+
? new Uint8Array(buffer_1.Buffer.from(voterscommitment, 'base64'))
|
|
1747
1770
|
: voterscommitment;
|
|
1748
1771
|
this.attribute_map = {
|
|
1749
1772
|
blockheaderscommitment: 'BlockHeadersCommitment',
|
|
@@ -1787,7 +1810,7 @@ class SupplyResponse extends basemodel_1.default {
|
|
|
1787
1810
|
* @param onlineMoney - OnlineMoney
|
|
1788
1811
|
* @param totalMoney - TotalMoney
|
|
1789
1812
|
*/
|
|
1790
|
-
constructor(currentRound, onlineMoney, totalMoney) {
|
|
1813
|
+
constructor({ currentRound, onlineMoney, totalMoney, }) {
|
|
1791
1814
|
super();
|
|
1792
1815
|
this.currentRound = currentRound;
|
|
1793
1816
|
this.onlineMoney = onlineMoney;
|
|
@@ -1807,7 +1830,11 @@ class SupplyResponse extends basemodel_1.default {
|
|
|
1807
1830
|
throw new Error(`Response is missing required field 'online-money': ${data}`);
|
|
1808
1831
|
if (typeof data['total-money'] === 'undefined')
|
|
1809
1832
|
throw new Error(`Response is missing required field 'total-money': ${data}`);
|
|
1810
|
-
return new SupplyResponse(
|
|
1833
|
+
return new SupplyResponse({
|
|
1834
|
+
currentRound: data['current_round'],
|
|
1835
|
+
onlineMoney: data['online-money'],
|
|
1836
|
+
totalMoney: data['total-money'],
|
|
1837
|
+
});
|
|
1811
1838
|
/* eslint-enable dot-notation */
|
|
1812
1839
|
}
|
|
1813
1840
|
}
|
|
@@ -1821,7 +1848,7 @@ class TealKeyValue extends basemodel_1.default {
|
|
|
1821
1848
|
* @param key -
|
|
1822
1849
|
* @param value - Represents a TEAL value.
|
|
1823
1850
|
*/
|
|
1824
|
-
constructor(key, value) {
|
|
1851
|
+
constructor({ key, value }) {
|
|
1825
1852
|
super();
|
|
1826
1853
|
this.key = key;
|
|
1827
1854
|
this.value = value;
|
|
@@ -1837,7 +1864,10 @@ class TealKeyValue extends basemodel_1.default {
|
|
|
1837
1864
|
throw new Error(`Response is missing required field 'key': ${data}`);
|
|
1838
1865
|
if (typeof data['value'] === 'undefined')
|
|
1839
1866
|
throw new Error(`Response is missing required field 'value': ${data}`);
|
|
1840
|
-
return new TealKeyValue(
|
|
1867
|
+
return new TealKeyValue({
|
|
1868
|
+
key: data['key'],
|
|
1869
|
+
value: TealValue.from_obj_for_encoding(data['value']),
|
|
1870
|
+
});
|
|
1841
1871
|
/* eslint-enable dot-notation */
|
|
1842
1872
|
}
|
|
1843
1873
|
}
|
|
@@ -1852,7 +1882,7 @@ class TealValue extends basemodel_1.default {
|
|
|
1852
1882
|
* @param bytes - (tb) bytes value.
|
|
1853
1883
|
* @param uint - (ui) uint value.
|
|
1854
1884
|
*/
|
|
1855
|
-
constructor(type, bytes, uint) {
|
|
1885
|
+
constructor({ type, bytes, uint, }) {
|
|
1856
1886
|
super();
|
|
1857
1887
|
this.type = type;
|
|
1858
1888
|
this.bytes = bytes;
|
|
@@ -1872,7 +1902,11 @@ class TealValue extends basemodel_1.default {
|
|
|
1872
1902
|
throw new Error(`Response is missing required field 'bytes': ${data}`);
|
|
1873
1903
|
if (typeof data['uint'] === 'undefined')
|
|
1874
1904
|
throw new Error(`Response is missing required field 'uint': ${data}`);
|
|
1875
|
-
return new TealValue(
|
|
1905
|
+
return new TealValue({
|
|
1906
|
+
type: data['type'],
|
|
1907
|
+
bytes: data['bytes'],
|
|
1908
|
+
uint: data['uint'],
|
|
1909
|
+
});
|
|
1876
1910
|
/* eslint-enable dot-notation */
|
|
1877
1911
|
}
|
|
1878
1912
|
}
|
|
@@ -1902,7 +1936,7 @@ class TransactionParametersResponse extends basemodel_1.default {
|
|
|
1902
1936
|
this.fee = fee;
|
|
1903
1937
|
this.genesisHash =
|
|
1904
1938
|
typeof genesisHash === 'string'
|
|
1905
|
-
? new Uint8Array(Buffer.from(genesisHash, 'base64'))
|
|
1939
|
+
? new Uint8Array(buffer_1.Buffer.from(genesisHash, 'base64'))
|
|
1906
1940
|
: genesisHash;
|
|
1907
1941
|
this.genesisId = genesisId;
|
|
1908
1942
|
this.lastRound = lastRound;
|
|
@@ -1963,11 +1997,11 @@ class TransactionProofResponse extends basemodel_1.default {
|
|
|
1963
1997
|
this.idx = idx;
|
|
1964
1998
|
this.proof =
|
|
1965
1999
|
typeof proof === 'string'
|
|
1966
|
-
? new Uint8Array(Buffer.from(proof, 'base64'))
|
|
2000
|
+
? new Uint8Array(buffer_1.Buffer.from(proof, 'base64'))
|
|
1967
2001
|
: proof;
|
|
1968
2002
|
this.stibhash =
|
|
1969
2003
|
typeof stibhash === 'string'
|
|
1970
|
-
? new Uint8Array(Buffer.from(stibhash, 'base64'))
|
|
2004
|
+
? new Uint8Array(buffer_1.Buffer.from(stibhash, 'base64'))
|
|
1971
2005
|
: stibhash;
|
|
1972
2006
|
this.treedepth = treedepth;
|
|
1973
2007
|
this.hashtype = hashtype;
|
|
@@ -2012,12 +2046,12 @@ class Version extends basemodel_1.default {
|
|
|
2012
2046
|
* @param genesisId -
|
|
2013
2047
|
* @param versions -
|
|
2014
2048
|
*/
|
|
2015
|
-
constructor(build, genesisHashB64, genesisId, versions) {
|
|
2049
|
+
constructor({ build, genesisHashB64, genesisId, versions, }) {
|
|
2016
2050
|
super();
|
|
2017
2051
|
this.build = build;
|
|
2018
2052
|
this.genesisHashB64 =
|
|
2019
2053
|
typeof genesisHashB64 === 'string'
|
|
2020
|
-
? new Uint8Array(Buffer.from(genesisHashB64, 'base64'))
|
|
2054
|
+
? new Uint8Array(buffer_1.Buffer.from(genesisHashB64, 'base64'))
|
|
2021
2055
|
: genesisHashB64;
|
|
2022
2056
|
this.genesisId = genesisId;
|
|
2023
2057
|
this.versions = versions;
|
|
@@ -2039,7 +2073,12 @@ class Version extends basemodel_1.default {
|
|
|
2039
2073
|
throw new Error(`Response is missing required field 'genesis_id': ${data}`);
|
|
2040
2074
|
if (!Array.isArray(data['versions']))
|
|
2041
2075
|
throw new Error(`Response is missing required array field 'versions': ${data}`);
|
|
2042
|
-
return new Version(
|
|
2076
|
+
return new Version({
|
|
2077
|
+
build: BuildVersion.from_obj_for_encoding(data['build']),
|
|
2078
|
+
genesisHashB64: data['genesis_hash_b64'],
|
|
2079
|
+
genesisId: data['genesis_id'],
|
|
2080
|
+
versions: data['versions'],
|
|
2081
|
+
});
|
|
2043
2082
|
/* eslint-enable dot-notation */
|
|
2044
2083
|
}
|
|
2045
2084
|
}
|