algosdk 3.6.0 → 3.7.0-beta.1
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/dist/browser/algosdk.min.js +1 -1
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/client/v2/algod/algod.js +0 -18
- package/dist/cjs/client/v2/algod/algod.js.map +1 -1
- package/dist/cjs/client/v2/algod/models/types.js +2 -434
- package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
- package/dist/cjs/ed25519-signer.js +76 -0
- package/dist/cjs/ed25519-signer.js.map +1 -0
- package/dist/cjs/encoding/address.js +61 -1
- package/dist/cjs/encoding/address.js.map +1 -1
- package/dist/cjs/falcon-signer.js +17 -0
- package/dist/cjs/falcon-signer.js.map +1 -0
- package/dist/cjs/logicsig.js +201 -16
- package/dist/cjs/logicsig.js.map +1 -1
- package/dist/cjs/main.js +32 -63
- package/dist/cjs/main.js.map +1 -1
- package/dist/cjs/mnemonic/mnemonic.js +26 -1
- package/dist/cjs/mnemonic/mnemonic.js.map +1 -1
- package/dist/cjs/multisigSigning.js +78 -1
- package/dist/cjs/multisigSigning.js.map +1 -1
- package/dist/cjs/pq-signer.js +54 -0
- package/dist/cjs/pq-signer.js.map +1 -0
- package/dist/cjs/signedTransaction.js +15 -1
- package/dist/cjs/signedTransaction.js.map +1 -1
- package/dist/cjs/signer.js.map +1 -1
- package/dist/cjs/signing.js +94 -7
- package/dist/cjs/signing.js.map +1 -1
- package/dist/cjs/transaction.js +9 -1
- package/dist/cjs/transaction.js.map +1 -1
- package/dist/cjs/types/transactions/encoded.js +51 -1
- package/dist/cjs/types/transactions/encoded.js.map +1 -1
- package/dist/cjs/utils/ed25519-check.js +69 -0
- package/dist/cjs/utils/ed25519-check.js.map +1 -0
- package/dist/esm/client/v2/algod/algod.js +0 -18
- package/dist/esm/client/v2/algod/algod.js.map +1 -1
- package/dist/esm/client/v2/algod/models/types.js +0 -427
- package/dist/esm/client/v2/algod/models/types.js.map +1 -1
- package/dist/esm/ed25519-signer.js +72 -0
- package/dist/esm/ed25519-signer.js.map +1 -0
- package/dist/esm/encoding/address.js +58 -0
- package/dist/esm/encoding/address.js.map +1 -1
- package/dist/esm/falcon-signer.js +13 -0
- package/dist/esm/falcon-signer.js.map +1 -0
- package/dist/esm/logicsig.js +200 -15
- package/dist/esm/logicsig.js.map +1 -1
- package/dist/esm/main.js +8 -56
- package/dist/esm/main.js.map +1 -1
- package/dist/esm/mnemonic/mnemonic.js +25 -1
- package/dist/esm/mnemonic/mnemonic.js.map +1 -1
- package/dist/esm/multisigSigning.js +75 -0
- package/dist/esm/multisigSigning.js.map +1 -1
- package/dist/esm/pq-signer.js +50 -0
- package/dist/esm/pq-signer.js.map +1 -0
- package/dist/esm/signedTransaction.js +16 -2
- package/dist/esm/signedTransaction.js.map +1 -1
- package/dist/esm/signer.js.map +1 -1
- package/dist/esm/signing.js +91 -8
- package/dist/esm/signing.js.map +1 -1
- package/dist/esm/transaction.js +9 -1
- package/dist/esm/transaction.js.map +1 -1
- package/dist/esm/types/transactions/encoded.js +49 -1
- package/dist/esm/types/transactions/encoded.js.map +1 -1
- package/dist/esm/utils/ed25519-check.js +65 -0
- package/dist/esm/utils/ed25519-check.js.map +1 -0
- package/dist/types/client/v2/algod/algod.d.ts +0 -16
- package/dist/types/client/v2/algod/models/types.d.ts +0 -217
- package/dist/types/ed25519-signer.d.ts +7 -0
- package/dist/types/encoding/address.d.ts +37 -0
- package/dist/types/falcon-signer.d.ts +11 -0
- package/dist/types/logicsig.d.ts +72 -1
- package/dist/types/main.d.ts +8 -44
- package/dist/types/mnemonic/mnemonic.d.ts +13 -0
- package/dist/types/multisigSigning.d.ts +49 -0
- package/dist/types/pq-signer.d.ts +8 -0
- package/dist/types/signedTransaction.d.ts +7 -2
- package/dist/types/signer.d.ts +38 -0
- package/dist/types/signing.d.ts +45 -0
- package/dist/types/transaction.d.ts +9 -0
- package/dist/types/types/transactions/encoded.d.ts +27 -0
- package/dist/types/utils/ed25519-check.d.ts +10 -0
- package/package.json +2 -1
- package/src/client/v2/algod/algod.ts +0 -19
- package/src/client/v2/algod/models/types.ts +0 -700
- package/src/ed25519-signer.ts +125 -0
- package/src/encoding/address.ts +80 -0
- package/src/falcon-signer.ts +30 -0
- package/src/logicsig.ts +258 -16
- package/src/main.ts +30 -60
- package/src/mnemonic/mnemonic.ts +34 -1
- package/src/multisigSigning.ts +111 -0
- package/src/pq-signer.ts +90 -0
- package/src/signedTransaction.ts +24 -0
- package/src/signer.ts +53 -0
- package/src/signing.ts +109 -8
- package/src/transaction.ts +9 -1
- package/src/types/transactions/encoded.ts +88 -0
- package/src/utils/ed25519-check.ts +67 -0
- package/dist/cjs/client/v2/algod/dryrun.js +0 -34
- package/dist/cjs/client/v2/algod/dryrun.js.map +0 -1
- package/dist/cjs/dryrun.js +0 -214
- package/dist/cjs/dryrun.js.map +0 -1
- package/dist/esm/client/v2/algod/dryrun.js +0 -28
- package/dist/esm/client/v2/algod/dryrun.js.map +0 -1
- package/dist/esm/dryrun.js +0 -208
- package/dist/esm/dryrun.js.map +0 -1
- package/dist/types/client/v2/algod/dryrun.d.ts +0 -11
- package/dist/types/dryrun.d.ts +0 -28
- package/src/client/v2/algod/dryrun.ts +0 -38
- package/src/dryrun.ts +0 -292
|
@@ -2409,433 +2409,6 @@ export class DisassembleResponse {
|
|
|
2409
2409
|
});
|
|
2410
2410
|
}
|
|
2411
2411
|
}
|
|
2412
|
-
/**
|
|
2413
|
-
* Request data type for dryrun endpoint. Given the Transactions and simulated
|
|
2414
|
-
* ledger state upload, run TEAL scripts and return debugging information.
|
|
2415
|
-
*/
|
|
2416
|
-
export class DryrunRequest {
|
|
2417
|
-
static get encodingSchema() {
|
|
2418
|
-
if (!this.encodingSchemaValue) {
|
|
2419
|
-
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
2420
|
-
this.encodingSchemaValue.pushEntries({
|
|
2421
|
-
key: 'accounts',
|
|
2422
|
-
valueSchema: new ArraySchema(Account.encodingSchema),
|
|
2423
|
-
omitEmpty: true,
|
|
2424
|
-
}, {
|
|
2425
|
-
key: 'apps',
|
|
2426
|
-
valueSchema: new ArraySchema(Application.encodingSchema),
|
|
2427
|
-
omitEmpty: true,
|
|
2428
|
-
}, {
|
|
2429
|
-
key: 'latest-timestamp',
|
|
2430
|
-
valueSchema: new Uint64Schema(),
|
|
2431
|
-
omitEmpty: true,
|
|
2432
|
-
}, {
|
|
2433
|
-
key: 'protocol-version',
|
|
2434
|
-
valueSchema: new StringSchema(),
|
|
2435
|
-
omitEmpty: true,
|
|
2436
|
-
}, { key: 'round', valueSchema: new Uint64Schema(), omitEmpty: true }, {
|
|
2437
|
-
key: 'sources',
|
|
2438
|
-
valueSchema: new ArraySchema(DryrunSource.encodingSchema),
|
|
2439
|
-
omitEmpty: true,
|
|
2440
|
-
}, {
|
|
2441
|
-
key: 'txns',
|
|
2442
|
-
valueSchema: new ArraySchema(SignedTransaction.encodingSchema),
|
|
2443
|
-
omitEmpty: true,
|
|
2444
|
-
});
|
|
2445
|
-
}
|
|
2446
|
-
return this.encodingSchemaValue;
|
|
2447
|
-
}
|
|
2448
|
-
/**
|
|
2449
|
-
* Creates a new `DryrunRequest` object.
|
|
2450
|
-
* @param accounts -
|
|
2451
|
-
* @param apps -
|
|
2452
|
-
* @param latestTimestamp - LatestTimestamp is available to some TEAL scripts. Defaults to the latest
|
|
2453
|
-
* confirmed timestamp this algod is attached to.
|
|
2454
|
-
* @param protocolVersion - ProtocolVersion specifies a specific version string to operate under, otherwise
|
|
2455
|
-
* whatever the current protocol of the network this algod is running in.
|
|
2456
|
-
* @param round - Round is available to some TEAL scripts. Defaults to the current round on the
|
|
2457
|
-
* network this algod is attached to.
|
|
2458
|
-
* @param sources -
|
|
2459
|
-
* @param txns -
|
|
2460
|
-
*/
|
|
2461
|
-
constructor({ accounts, apps, latestTimestamp, protocolVersion, round, sources, txns, }) {
|
|
2462
|
-
this.accounts = accounts;
|
|
2463
|
-
this.apps = apps;
|
|
2464
|
-
this.latestTimestamp = ensureSafeInteger(latestTimestamp);
|
|
2465
|
-
this.protocolVersion = protocolVersion;
|
|
2466
|
-
this.round = ensureBigInt(round);
|
|
2467
|
-
this.sources = sources;
|
|
2468
|
-
this.txns = txns;
|
|
2469
|
-
}
|
|
2470
|
-
// eslint-disable-next-line class-methods-use-this
|
|
2471
|
-
getEncodingSchema() {
|
|
2472
|
-
return DryrunRequest.encodingSchema;
|
|
2473
|
-
}
|
|
2474
|
-
toEncodingData() {
|
|
2475
|
-
return new Map([
|
|
2476
|
-
['accounts', this.accounts.map((v) => v.toEncodingData())],
|
|
2477
|
-
['apps', this.apps.map((v) => v.toEncodingData())],
|
|
2478
|
-
['latest-timestamp', this.latestTimestamp],
|
|
2479
|
-
['protocol-version', this.protocolVersion],
|
|
2480
|
-
['round', this.round],
|
|
2481
|
-
['sources', this.sources.map((v) => v.toEncodingData())],
|
|
2482
|
-
['txns', this.txns.map((v) => v.toEncodingData())],
|
|
2483
|
-
]);
|
|
2484
|
-
}
|
|
2485
|
-
static fromEncodingData(data) {
|
|
2486
|
-
if (!(data instanceof Map)) {
|
|
2487
|
-
throw new Error(`Invalid decoded DryrunRequest: ${data}`);
|
|
2488
|
-
}
|
|
2489
|
-
return new DryrunRequest({
|
|
2490
|
-
accounts: (data.get('accounts') ?? []).map((v) => Account.fromEncodingData(v)),
|
|
2491
|
-
apps: (data.get('apps') ?? []).map((v) => Application.fromEncodingData(v)),
|
|
2492
|
-
latestTimestamp: data.get('latest-timestamp'),
|
|
2493
|
-
protocolVersion: data.get('protocol-version'),
|
|
2494
|
-
round: data.get('round'),
|
|
2495
|
-
sources: (data.get('sources') ?? []).map((v) => DryrunSource.fromEncodingData(v)),
|
|
2496
|
-
txns: (data.get('txns') ?? []).map((v) => SignedTransaction.fromEncodingData(v)),
|
|
2497
|
-
});
|
|
2498
|
-
}
|
|
2499
|
-
}
|
|
2500
|
-
/**
|
|
2501
|
-
* DryrunResponse contains per-txn debug information from a dryrun.
|
|
2502
|
-
*/
|
|
2503
|
-
export class DryrunResponse {
|
|
2504
|
-
static get encodingSchema() {
|
|
2505
|
-
if (!this.encodingSchemaValue) {
|
|
2506
|
-
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
2507
|
-
this.encodingSchemaValue.pushEntries({ key: 'error', valueSchema: new StringSchema(), omitEmpty: true }, {
|
|
2508
|
-
key: 'protocol-version',
|
|
2509
|
-
valueSchema: new StringSchema(),
|
|
2510
|
-
omitEmpty: true,
|
|
2511
|
-
}, {
|
|
2512
|
-
key: 'txns',
|
|
2513
|
-
valueSchema: new ArraySchema(DryrunTxnResult.encodingSchema),
|
|
2514
|
-
omitEmpty: true,
|
|
2515
|
-
});
|
|
2516
|
-
}
|
|
2517
|
-
return this.encodingSchemaValue;
|
|
2518
|
-
}
|
|
2519
|
-
/**
|
|
2520
|
-
* Creates a new `DryrunResponse` object.
|
|
2521
|
-
* @param error -
|
|
2522
|
-
* @param protocolVersion - Protocol version is the protocol version Dryrun was operated under.
|
|
2523
|
-
* @param txns -
|
|
2524
|
-
*/
|
|
2525
|
-
constructor({ error, protocolVersion, txns, }) {
|
|
2526
|
-
this.error = error;
|
|
2527
|
-
this.protocolVersion = protocolVersion;
|
|
2528
|
-
this.txns = txns;
|
|
2529
|
-
}
|
|
2530
|
-
// eslint-disable-next-line class-methods-use-this
|
|
2531
|
-
getEncodingSchema() {
|
|
2532
|
-
return DryrunResponse.encodingSchema;
|
|
2533
|
-
}
|
|
2534
|
-
toEncodingData() {
|
|
2535
|
-
return new Map([
|
|
2536
|
-
['error', this.error],
|
|
2537
|
-
['protocol-version', this.protocolVersion],
|
|
2538
|
-
['txns', this.txns.map((v) => v.toEncodingData())],
|
|
2539
|
-
]);
|
|
2540
|
-
}
|
|
2541
|
-
static fromEncodingData(data) {
|
|
2542
|
-
if (!(data instanceof Map)) {
|
|
2543
|
-
throw new Error(`Invalid decoded DryrunResponse: ${data}`);
|
|
2544
|
-
}
|
|
2545
|
-
return new DryrunResponse({
|
|
2546
|
-
error: data.get('error'),
|
|
2547
|
-
protocolVersion: data.get('protocol-version'),
|
|
2548
|
-
txns: (data.get('txns') ?? []).map((v) => DryrunTxnResult.fromEncodingData(v)),
|
|
2549
|
-
});
|
|
2550
|
-
}
|
|
2551
|
-
}
|
|
2552
|
-
/**
|
|
2553
|
-
* DryrunSource is TEAL source text that gets uploaded, compiled, and inserted into
|
|
2554
|
-
* transactions or application state.
|
|
2555
|
-
*/
|
|
2556
|
-
export class DryrunSource {
|
|
2557
|
-
static get encodingSchema() {
|
|
2558
|
-
if (!this.encodingSchemaValue) {
|
|
2559
|
-
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
2560
|
-
this.encodingSchemaValue.pushEntries({ key: 'app-index', valueSchema: new Uint64Schema(), omitEmpty: true }, { key: 'field-name', valueSchema: new StringSchema(), omitEmpty: true }, { key: 'source', valueSchema: new StringSchema(), omitEmpty: true }, { key: 'txn-index', valueSchema: new Uint64Schema(), omitEmpty: true });
|
|
2561
|
-
}
|
|
2562
|
-
return this.encodingSchemaValue;
|
|
2563
|
-
}
|
|
2564
|
-
/**
|
|
2565
|
-
* Creates a new `DryrunSource` object.
|
|
2566
|
-
* @param appIndex -
|
|
2567
|
-
* @param fieldName - FieldName is what kind of sources this is. If lsig then it goes into the
|
|
2568
|
-
* transactions[this.TxnIndex].LogicSig. If approv or clearp it goes into the
|
|
2569
|
-
* Approval Program or Clear State Program of application[this.AppIndex].
|
|
2570
|
-
* @param source -
|
|
2571
|
-
* @param txnIndex -
|
|
2572
|
-
*/
|
|
2573
|
-
constructor({ appIndex, fieldName, source, txnIndex, }) {
|
|
2574
|
-
this.appIndex = ensureBigInt(appIndex);
|
|
2575
|
-
this.fieldName = fieldName;
|
|
2576
|
-
this.source = source;
|
|
2577
|
-
this.txnIndex = ensureSafeInteger(txnIndex);
|
|
2578
|
-
}
|
|
2579
|
-
// eslint-disable-next-line class-methods-use-this
|
|
2580
|
-
getEncodingSchema() {
|
|
2581
|
-
return DryrunSource.encodingSchema;
|
|
2582
|
-
}
|
|
2583
|
-
toEncodingData() {
|
|
2584
|
-
return new Map([
|
|
2585
|
-
['app-index', this.appIndex],
|
|
2586
|
-
['field-name', this.fieldName],
|
|
2587
|
-
['source', this.source],
|
|
2588
|
-
['txn-index', this.txnIndex],
|
|
2589
|
-
]);
|
|
2590
|
-
}
|
|
2591
|
-
static fromEncodingData(data) {
|
|
2592
|
-
if (!(data instanceof Map)) {
|
|
2593
|
-
throw new Error(`Invalid decoded DryrunSource: ${data}`);
|
|
2594
|
-
}
|
|
2595
|
-
return new DryrunSource({
|
|
2596
|
-
appIndex: data.get('app-index'),
|
|
2597
|
-
fieldName: data.get('field-name'),
|
|
2598
|
-
source: data.get('source'),
|
|
2599
|
-
txnIndex: data.get('txn-index'),
|
|
2600
|
-
});
|
|
2601
|
-
}
|
|
2602
|
-
}
|
|
2603
|
-
/**
|
|
2604
|
-
* Stores the TEAL eval step data
|
|
2605
|
-
*/
|
|
2606
|
-
export class DryrunState {
|
|
2607
|
-
static get encodingSchema() {
|
|
2608
|
-
if (!this.encodingSchemaValue) {
|
|
2609
|
-
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
2610
|
-
this.encodingSchemaValue.pushEntries({ key: 'line', valueSchema: new Uint64Schema(), omitEmpty: true }, { key: 'pc', valueSchema: new Uint64Schema(), omitEmpty: true }, {
|
|
2611
|
-
key: 'stack',
|
|
2612
|
-
valueSchema: new ArraySchema(TealValue.encodingSchema),
|
|
2613
|
-
omitEmpty: true,
|
|
2614
|
-
}, {
|
|
2615
|
-
key: 'error',
|
|
2616
|
-
valueSchema: new OptionalSchema(new StringSchema()),
|
|
2617
|
-
omitEmpty: true,
|
|
2618
|
-
}, {
|
|
2619
|
-
key: 'scratch',
|
|
2620
|
-
valueSchema: new OptionalSchema(new ArraySchema(TealValue.encodingSchema)),
|
|
2621
|
-
omitEmpty: true,
|
|
2622
|
-
});
|
|
2623
|
-
}
|
|
2624
|
-
return this.encodingSchemaValue;
|
|
2625
|
-
}
|
|
2626
|
-
/**
|
|
2627
|
-
* Creates a new `DryrunState` object.
|
|
2628
|
-
* @param line - Line number
|
|
2629
|
-
* @param pc - Program counter
|
|
2630
|
-
* @param stack -
|
|
2631
|
-
* @param error - Evaluation error if any
|
|
2632
|
-
* @param scratch -
|
|
2633
|
-
*/
|
|
2634
|
-
constructor({ line, pc, stack, error, scratch, }) {
|
|
2635
|
-
this.line = ensureSafeInteger(line);
|
|
2636
|
-
this.pc = ensureSafeInteger(pc);
|
|
2637
|
-
this.stack = stack;
|
|
2638
|
-
this.error = error;
|
|
2639
|
-
this.scratch = scratch;
|
|
2640
|
-
}
|
|
2641
|
-
// eslint-disable-next-line class-methods-use-this
|
|
2642
|
-
getEncodingSchema() {
|
|
2643
|
-
return DryrunState.encodingSchema;
|
|
2644
|
-
}
|
|
2645
|
-
toEncodingData() {
|
|
2646
|
-
return new Map([
|
|
2647
|
-
['line', this.line],
|
|
2648
|
-
['pc', this.pc],
|
|
2649
|
-
['stack', this.stack.map((v) => v.toEncodingData())],
|
|
2650
|
-
['error', this.error],
|
|
2651
|
-
[
|
|
2652
|
-
'scratch',
|
|
2653
|
-
typeof this.scratch !== 'undefined'
|
|
2654
|
-
? this.scratch.map((v) => v.toEncodingData())
|
|
2655
|
-
: undefined,
|
|
2656
|
-
],
|
|
2657
|
-
]);
|
|
2658
|
-
}
|
|
2659
|
-
static fromEncodingData(data) {
|
|
2660
|
-
if (!(data instanceof Map)) {
|
|
2661
|
-
throw new Error(`Invalid decoded DryrunState: ${data}`);
|
|
2662
|
-
}
|
|
2663
|
-
return new DryrunState({
|
|
2664
|
-
line: data.get('line'),
|
|
2665
|
-
pc: data.get('pc'),
|
|
2666
|
-
stack: (data.get('stack') ?? []).map((v) => TealValue.fromEncodingData(v)),
|
|
2667
|
-
error: data.get('error'),
|
|
2668
|
-
scratch: typeof data.get('scratch') !== 'undefined'
|
|
2669
|
-
? data
|
|
2670
|
-
.get('scratch')
|
|
2671
|
-
.map((v) => TealValue.fromEncodingData(v))
|
|
2672
|
-
: undefined,
|
|
2673
|
-
});
|
|
2674
|
-
}
|
|
2675
|
-
}
|
|
2676
|
-
/**
|
|
2677
|
-
* DryrunTxnResult contains any LogicSig or ApplicationCall program debug
|
|
2678
|
-
* information and state updates from a dryrun.
|
|
2679
|
-
*/
|
|
2680
|
-
export class DryrunTxnResult {
|
|
2681
|
-
static get encodingSchema() {
|
|
2682
|
-
if (!this.encodingSchemaValue) {
|
|
2683
|
-
this.encodingSchemaValue = new NamedMapSchema([]);
|
|
2684
|
-
this.encodingSchemaValue.pushEntries({
|
|
2685
|
-
key: 'disassembly',
|
|
2686
|
-
valueSchema: new ArraySchema(new StringSchema()),
|
|
2687
|
-
omitEmpty: true,
|
|
2688
|
-
}, {
|
|
2689
|
-
key: 'app-call-messages',
|
|
2690
|
-
valueSchema: new OptionalSchema(new ArraySchema(new StringSchema())),
|
|
2691
|
-
omitEmpty: true,
|
|
2692
|
-
}, {
|
|
2693
|
-
key: 'app-call-trace',
|
|
2694
|
-
valueSchema: new OptionalSchema(new ArraySchema(DryrunState.encodingSchema)),
|
|
2695
|
-
omitEmpty: true,
|
|
2696
|
-
}, {
|
|
2697
|
-
key: 'budget-added',
|
|
2698
|
-
valueSchema: new OptionalSchema(new Uint64Schema()),
|
|
2699
|
-
omitEmpty: true,
|
|
2700
|
-
}, {
|
|
2701
|
-
key: 'budget-consumed',
|
|
2702
|
-
valueSchema: new OptionalSchema(new Uint64Schema()),
|
|
2703
|
-
omitEmpty: true,
|
|
2704
|
-
}, {
|
|
2705
|
-
key: 'global-delta',
|
|
2706
|
-
valueSchema: new OptionalSchema(new ArraySchema(EvalDeltaKeyValue.encodingSchema)),
|
|
2707
|
-
omitEmpty: true,
|
|
2708
|
-
}, {
|
|
2709
|
-
key: 'local-deltas',
|
|
2710
|
-
valueSchema: new OptionalSchema(new ArraySchema(AccountStateDelta.encodingSchema)),
|
|
2711
|
-
omitEmpty: true,
|
|
2712
|
-
}, {
|
|
2713
|
-
key: 'logic-sig-disassembly',
|
|
2714
|
-
valueSchema: new OptionalSchema(new ArraySchema(new StringSchema())),
|
|
2715
|
-
omitEmpty: true,
|
|
2716
|
-
}, {
|
|
2717
|
-
key: 'logic-sig-messages',
|
|
2718
|
-
valueSchema: new OptionalSchema(new ArraySchema(new StringSchema())),
|
|
2719
|
-
omitEmpty: true,
|
|
2720
|
-
}, {
|
|
2721
|
-
key: 'logic-sig-trace',
|
|
2722
|
-
valueSchema: new OptionalSchema(new ArraySchema(DryrunState.encodingSchema)),
|
|
2723
|
-
omitEmpty: true,
|
|
2724
|
-
}, {
|
|
2725
|
-
key: 'logs',
|
|
2726
|
-
valueSchema: new OptionalSchema(new ArraySchema(new ByteArraySchema())),
|
|
2727
|
-
omitEmpty: true,
|
|
2728
|
-
});
|
|
2729
|
-
}
|
|
2730
|
-
return this.encodingSchemaValue;
|
|
2731
|
-
}
|
|
2732
|
-
/**
|
|
2733
|
-
* Creates a new `DryrunTxnResult` object.
|
|
2734
|
-
* @param disassembly - Disassembled program line by line.
|
|
2735
|
-
* @param appCallMessages -
|
|
2736
|
-
* @param appCallTrace -
|
|
2737
|
-
* @param budgetAdded - Budget added during execution of app call transaction.
|
|
2738
|
-
* @param budgetConsumed - Budget consumed during execution of app call transaction.
|
|
2739
|
-
* @param globalDelta - Application state delta.
|
|
2740
|
-
* @param localDeltas -
|
|
2741
|
-
* @param logicSigDisassembly - Disassembled lsig program line by line.
|
|
2742
|
-
* @param logicSigMessages -
|
|
2743
|
-
* @param logicSigTrace -
|
|
2744
|
-
* @param logs -
|
|
2745
|
-
*/
|
|
2746
|
-
constructor({ disassembly, appCallMessages, appCallTrace, budgetAdded, budgetConsumed, globalDelta, localDeltas, logicSigDisassembly, logicSigMessages, logicSigTrace, logs, }) {
|
|
2747
|
-
this.disassembly = disassembly;
|
|
2748
|
-
this.appCallMessages = appCallMessages;
|
|
2749
|
-
this.appCallTrace = appCallTrace;
|
|
2750
|
-
this.budgetAdded =
|
|
2751
|
-
typeof budgetAdded === 'undefined'
|
|
2752
|
-
? undefined
|
|
2753
|
-
: ensureSafeInteger(budgetAdded);
|
|
2754
|
-
this.budgetConsumed =
|
|
2755
|
-
typeof budgetConsumed === 'undefined'
|
|
2756
|
-
? undefined
|
|
2757
|
-
: ensureSafeInteger(budgetConsumed);
|
|
2758
|
-
this.globalDelta = globalDelta;
|
|
2759
|
-
this.localDeltas = localDeltas;
|
|
2760
|
-
this.logicSigDisassembly = logicSigDisassembly;
|
|
2761
|
-
this.logicSigMessages = logicSigMessages;
|
|
2762
|
-
this.logicSigTrace = logicSigTrace;
|
|
2763
|
-
this.logs = logs;
|
|
2764
|
-
}
|
|
2765
|
-
// eslint-disable-next-line class-methods-use-this
|
|
2766
|
-
getEncodingSchema() {
|
|
2767
|
-
return DryrunTxnResult.encodingSchema;
|
|
2768
|
-
}
|
|
2769
|
-
toEncodingData() {
|
|
2770
|
-
return new Map([
|
|
2771
|
-
['disassembly', this.disassembly],
|
|
2772
|
-
['app-call-messages', this.appCallMessages],
|
|
2773
|
-
[
|
|
2774
|
-
'app-call-trace',
|
|
2775
|
-
typeof this.appCallTrace !== 'undefined'
|
|
2776
|
-
? this.appCallTrace.map((v) => v.toEncodingData())
|
|
2777
|
-
: undefined,
|
|
2778
|
-
],
|
|
2779
|
-
['budget-added', this.budgetAdded],
|
|
2780
|
-
['budget-consumed', this.budgetConsumed],
|
|
2781
|
-
[
|
|
2782
|
-
'global-delta',
|
|
2783
|
-
typeof this.globalDelta !== 'undefined'
|
|
2784
|
-
? this.globalDelta.map((v) => v.toEncodingData())
|
|
2785
|
-
: undefined,
|
|
2786
|
-
],
|
|
2787
|
-
[
|
|
2788
|
-
'local-deltas',
|
|
2789
|
-
typeof this.localDeltas !== 'undefined'
|
|
2790
|
-
? this.localDeltas.map((v) => v.toEncodingData())
|
|
2791
|
-
: undefined,
|
|
2792
|
-
],
|
|
2793
|
-
['logic-sig-disassembly', this.logicSigDisassembly],
|
|
2794
|
-
['logic-sig-messages', this.logicSigMessages],
|
|
2795
|
-
[
|
|
2796
|
-
'logic-sig-trace',
|
|
2797
|
-
typeof this.logicSigTrace !== 'undefined'
|
|
2798
|
-
? this.logicSigTrace.map((v) => v.toEncodingData())
|
|
2799
|
-
: undefined,
|
|
2800
|
-
],
|
|
2801
|
-
['logs', this.logs],
|
|
2802
|
-
]);
|
|
2803
|
-
}
|
|
2804
|
-
static fromEncodingData(data) {
|
|
2805
|
-
if (!(data instanceof Map)) {
|
|
2806
|
-
throw new Error(`Invalid decoded DryrunTxnResult: ${data}`);
|
|
2807
|
-
}
|
|
2808
|
-
return new DryrunTxnResult({
|
|
2809
|
-
disassembly: data.get('disassembly'),
|
|
2810
|
-
appCallMessages: data.get('app-call-messages'),
|
|
2811
|
-
appCallTrace: typeof data.get('app-call-trace') !== 'undefined'
|
|
2812
|
-
? data
|
|
2813
|
-
.get('app-call-trace')
|
|
2814
|
-
.map((v) => DryrunState.fromEncodingData(v))
|
|
2815
|
-
: undefined,
|
|
2816
|
-
budgetAdded: data.get('budget-added'),
|
|
2817
|
-
budgetConsumed: data.get('budget-consumed'),
|
|
2818
|
-
globalDelta: typeof data.get('global-delta') !== 'undefined'
|
|
2819
|
-
? data
|
|
2820
|
-
.get('global-delta')
|
|
2821
|
-
.map((v) => EvalDeltaKeyValue.fromEncodingData(v))
|
|
2822
|
-
: undefined,
|
|
2823
|
-
localDeltas: typeof data.get('local-deltas') !== 'undefined'
|
|
2824
|
-
? data
|
|
2825
|
-
.get('local-deltas')
|
|
2826
|
-
.map((v) => AccountStateDelta.fromEncodingData(v))
|
|
2827
|
-
: undefined,
|
|
2828
|
-
logicSigDisassembly: data.get('logic-sig-disassembly'),
|
|
2829
|
-
logicSigMessages: data.get('logic-sig-messages'),
|
|
2830
|
-
logicSigTrace: typeof data.get('logic-sig-trace') !== 'undefined'
|
|
2831
|
-
? data
|
|
2832
|
-
.get('logic-sig-trace')
|
|
2833
|
-
.map((v) => DryrunState.fromEncodingData(v))
|
|
2834
|
-
: undefined,
|
|
2835
|
-
logs: data.get('logs'),
|
|
2836
|
-
});
|
|
2837
|
-
}
|
|
2838
|
-
}
|
|
2839
2412
|
/**
|
|
2840
2413
|
* An error response with optional data field.
|
|
2841
2414
|
*/
|