algosdk 3.6.0 → 3.7.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.
Files changed (153) hide show
  1. package/README.md +4 -4
  2. package/dist/browser/algosdk.min.js +1 -1
  3. package/dist/browser/algosdk.min.js.map +1 -1
  4. package/dist/cjs/appAccess.js +4 -0
  5. package/dist/cjs/appAccess.js.map +1 -1
  6. package/dist/cjs/client/v2/algod/algod.js +0 -18
  7. package/dist/cjs/client/v2/algod/algod.js.map +1 -1
  8. package/dist/cjs/client/v2/algod/models/types.js +153 -437
  9. package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
  10. package/dist/cjs/client/v2/indexer/models/types.js +163 -12
  11. package/dist/cjs/client/v2/indexer/models/types.js.map +1 -1
  12. package/dist/cjs/composer.js +4 -6
  13. package/dist/cjs/composer.js.map +1 -1
  14. package/dist/cjs/ed25519-signer.js +76 -0
  15. package/dist/cjs/ed25519-signer.js.map +1 -0
  16. package/dist/cjs/encoding/address.js +61 -1
  17. package/dist/cjs/encoding/address.js.map +1 -1
  18. package/dist/cjs/falcon-signer.js +17 -0
  19. package/dist/cjs/falcon-signer.js.map +1 -0
  20. package/dist/cjs/heartbeat.js +7 -0
  21. package/dist/cjs/heartbeat.js.map +1 -1
  22. package/dist/cjs/logicsig.js +201 -16
  23. package/dist/cjs/logicsig.js.map +1 -1
  24. package/dist/cjs/main.js +32 -63
  25. package/dist/cjs/main.js.map +1 -1
  26. package/dist/cjs/makeTxn.js +11 -2
  27. package/dist/cjs/makeTxn.js.map +1 -1
  28. package/dist/cjs/mnemonic/mnemonic.js +26 -1
  29. package/dist/cjs/mnemonic/mnemonic.js.map +1 -1
  30. package/dist/cjs/multisigSigning.js +78 -1
  31. package/dist/cjs/multisigSigning.js.map +1 -1
  32. package/dist/cjs/pq-signer.js +80 -0
  33. package/dist/cjs/pq-signer.js.map +1 -0
  34. package/dist/cjs/signedTransaction.js +15 -1
  35. package/dist/cjs/signedTransaction.js.map +1 -1
  36. package/dist/cjs/signer.js.map +1 -1
  37. package/dist/cjs/signing.js +94 -7
  38. package/dist/cjs/signing.js.map +1 -1
  39. package/dist/cjs/transaction.js +17 -1
  40. package/dist/cjs/transaction.js.map +1 -1
  41. package/dist/cjs/types/statedelta.js +17 -0
  42. package/dist/cjs/types/statedelta.js.map +1 -1
  43. package/dist/cjs/types/transactions/encoded.js +51 -1
  44. package/dist/cjs/types/transactions/encoded.js.map +1 -1
  45. package/dist/cjs/utils/ed25519-check.js +69 -0
  46. package/dist/cjs/utils/ed25519-check.js.map +1 -0
  47. package/dist/cjs/utils/utils.js +14 -1
  48. package/dist/cjs/utils/utils.js.map +1 -1
  49. package/dist/esm/appAccess.js +4 -0
  50. package/dist/esm/appAccess.js.map +1 -1
  51. package/dist/esm/client/v2/algod/algod.js +0 -18
  52. package/dist/esm/client/v2/algod/algod.js.map +1 -1
  53. package/dist/esm/client/v2/algod/models/types.js +149 -430
  54. package/dist/esm/client/v2/algod/models/types.js.map +1 -1
  55. package/dist/esm/client/v2/indexer/models/types.js +161 -11
  56. package/dist/esm/client/v2/indexer/models/types.js.map +1 -1
  57. package/dist/esm/composer.js +4 -6
  58. package/dist/esm/composer.js.map +1 -1
  59. package/dist/esm/ed25519-signer.js +72 -0
  60. package/dist/esm/ed25519-signer.js.map +1 -0
  61. package/dist/esm/encoding/address.js +58 -0
  62. package/dist/esm/encoding/address.js.map +1 -1
  63. package/dist/esm/falcon-signer.js +13 -0
  64. package/dist/esm/falcon-signer.js.map +1 -0
  65. package/dist/esm/heartbeat.js +8 -1
  66. package/dist/esm/heartbeat.js.map +1 -1
  67. package/dist/esm/logicsig.js +200 -15
  68. package/dist/esm/logicsig.js.map +1 -1
  69. package/dist/esm/main.js +8 -56
  70. package/dist/esm/main.js.map +1 -1
  71. package/dist/esm/makeTxn.js +11 -2
  72. package/dist/esm/makeTxn.js.map +1 -1
  73. package/dist/esm/mnemonic/mnemonic.js +25 -1
  74. package/dist/esm/mnemonic/mnemonic.js.map +1 -1
  75. package/dist/esm/multisigSigning.js +75 -0
  76. package/dist/esm/multisigSigning.js.map +1 -1
  77. package/dist/esm/pq-signer.js +76 -0
  78. package/dist/esm/pq-signer.js.map +1 -0
  79. package/dist/esm/signedTransaction.js +16 -2
  80. package/dist/esm/signedTransaction.js.map +1 -1
  81. package/dist/esm/signer.js.map +1 -1
  82. package/dist/esm/signing.js +91 -8
  83. package/dist/esm/signing.js.map +1 -1
  84. package/dist/esm/transaction.js +17 -1
  85. package/dist/esm/transaction.js.map +1 -1
  86. package/dist/esm/types/statedelta.js +17 -0
  87. package/dist/esm/types/statedelta.js.map +1 -1
  88. package/dist/esm/types/transactions/encoded.js +49 -1
  89. package/dist/esm/types/transactions/encoded.js.map +1 -1
  90. package/dist/esm/utils/ed25519-check.js +65 -0
  91. package/dist/esm/utils/ed25519-check.js.map +1 -0
  92. package/dist/esm/utils/utils.js +12 -0
  93. package/dist/esm/utils/utils.js.map +1 -1
  94. package/dist/types/client/v2/algod/algod.d.ts +0 -16
  95. package/dist/types/client/v2/algod/models/types.d.ts +90 -220
  96. package/dist/types/client/v2/indexer/models/types.d.ts +114 -7
  97. package/dist/types/composer.d.ts +3 -3
  98. package/dist/types/ed25519-signer.d.ts +7 -0
  99. package/dist/types/encoding/address.d.ts +37 -0
  100. package/dist/types/falcon-signer.d.ts +11 -0
  101. package/dist/types/heartbeat.d.ts +2 -0
  102. package/dist/types/logicsig.d.ts +72 -1
  103. package/dist/types/main.d.ts +8 -44
  104. package/dist/types/makeTxn.d.ts +8 -2
  105. package/dist/types/mnemonic/mnemonic.d.ts +13 -0
  106. package/dist/types/multisigSigning.d.ts +49 -0
  107. package/dist/types/pq-signer.d.ts +8 -0
  108. package/dist/types/signedTransaction.d.ts +7 -2
  109. package/dist/types/signer.d.ts +46 -0
  110. package/dist/types/signing.d.ts +45 -0
  111. package/dist/types/transaction.d.ts +10 -0
  112. package/dist/types/types/statedelta.d.ts +18 -0
  113. package/dist/types/types/transactions/base.d.ts +10 -0
  114. package/dist/types/types/transactions/encoded.d.ts +27 -0
  115. package/dist/types/utils/ed25519-check.d.ts +10 -0
  116. package/dist/types/utils/utils.d.ts +1 -0
  117. package/package.json +2 -1
  118. package/src/appAccess.ts +5 -0
  119. package/src/client/v2/algod/algod.ts +0 -19
  120. package/src/client/v2/algod/models/types.ts +324 -790
  121. package/src/client/v2/indexer/models/types.ts +280 -8
  122. package/src/composer.ts +7 -11
  123. package/src/ed25519-signer.ts +125 -0
  124. package/src/encoding/address.ts +80 -0
  125. package/src/falcon-signer.ts +33 -0
  126. package/src/heartbeat.ts +11 -0
  127. package/src/logicsig.ts +258 -16
  128. package/src/main.ts +30 -60
  129. package/src/makeTxn.ts +13 -4
  130. package/src/mnemonic/mnemonic.ts +34 -1
  131. package/src/multisigSigning.ts +111 -0
  132. package/src/pq-signer.ts +123 -0
  133. package/src/signedTransaction.ts +24 -0
  134. package/src/signer.ts +62 -0
  135. package/src/signing.ts +109 -8
  136. package/src/transaction.ts +19 -1
  137. package/src/types/statedelta.ts +34 -0
  138. package/src/types/transactions/base.ts +11 -0
  139. package/src/types/transactions/encoded.ts +88 -0
  140. package/src/utils/ed25519-check.ts +67 -0
  141. package/src/utils/utils.ts +13 -0
  142. package/dist/cjs/client/v2/algod/dryrun.js +0 -34
  143. package/dist/cjs/client/v2/algod/dryrun.js.map +0 -1
  144. package/dist/cjs/dryrun.js +0 -214
  145. package/dist/cjs/dryrun.js.map +0 -1
  146. package/dist/esm/client/v2/algod/dryrun.js +0 -28
  147. package/dist/esm/client/v2/algod/dryrun.js.map +0 -1
  148. package/dist/esm/dryrun.js +0 -208
  149. package/dist/esm/dryrun.js.map +0 -1
  150. package/dist/types/client/v2/algod/dryrun.d.ts +0 -11
  151. package/dist/types/dryrun.d.ts +0 -28
  152. package/src/client/v2/algod/dryrun.ts +0 -38
  153. package/src/dryrun.ts +0 -292
@@ -2070,6 +2070,16 @@ export class ApplicationParams implements Encodable {
2070
2070
  valueSchema: new OptionalSchema(new Uint64Schema()),
2071
2071
  omitEmpty: true,
2072
2072
  },
2073
+ {
2074
+ key: 'family-box-access',
2075
+ valueSchema: new OptionalSchema(new BooleanSchema()),
2076
+ omitEmpty: true,
2077
+ },
2078
+ {
2079
+ key: 'foreign-box-reads',
2080
+ valueSchema: new OptionalSchema(new BooleanSchema()),
2081
+ omitEmpty: true,
2082
+ },
2073
2083
  {
2074
2084
  key: 'global-state',
2075
2085
  valueSchema: new OptionalSchema(
@@ -2127,6 +2137,16 @@ export class ApplicationParams implements Encodable {
2127
2137
  */
2128
2138
  public extraProgramPages?: number;
2129
2139
 
2140
+ /**
2141
+ * (fba) if true, apps with the same creator may read and write this app's boxes
2142
+ */
2143
+ public familyBoxAccess?: boolean;
2144
+
2145
+ /**
2146
+ * (fbr) if true, any app may read this app's boxes
2147
+ */
2148
+ public foreignBoxReads?: boolean;
2149
+
2130
2150
  /**
2131
2151
  * (gs) global state
2132
2152
  */
@@ -2159,6 +2179,8 @@ export class ApplicationParams implements Encodable {
2159
2179
  * @param creator - The address that created this application. This is the address where the
2160
2180
  * parameters and global state for this application can be found.
2161
2181
  * @param extraProgramPages - (epp) the amount of extra program pages available to this app.
2182
+ * @param familyBoxAccess - (fba) if true, apps with the same creator may read and write this app's boxes
2183
+ * @param foreignBoxReads - (fbr) if true, any app may read this app's boxes
2162
2184
  * @param globalState - (gs) global state
2163
2185
  * @param globalStateSchema - (gsch) global schema
2164
2186
  * @param localStateSchema - (lsch) local schema
@@ -2170,6 +2192,8 @@ export class ApplicationParams implements Encodable {
2170
2192
  clearStateProgram,
2171
2193
  creator,
2172
2194
  extraProgramPages,
2195
+ familyBoxAccess,
2196
+ foreignBoxReads,
2173
2197
  globalState,
2174
2198
  globalStateSchema,
2175
2199
  localStateSchema,
@@ -2180,6 +2204,8 @@ export class ApplicationParams implements Encodable {
2180
2204
  clearStateProgram: string | Uint8Array;
2181
2205
  creator: Address | string;
2182
2206
  extraProgramPages?: number | bigint;
2207
+ familyBoxAccess?: boolean;
2208
+ foreignBoxReads?: boolean;
2183
2209
  globalState?: TealKeyValue[];
2184
2210
  globalStateSchema?: ApplicationStateSchema;
2185
2211
  localStateSchema?: ApplicationStateSchema;
@@ -2200,6 +2226,8 @@ export class ApplicationParams implements Encodable {
2200
2226
  typeof extraProgramPages === 'undefined'
2201
2227
  ? undefined
2202
2228
  : ensureSafeInteger(extraProgramPages);
2229
+ this.familyBoxAccess = familyBoxAccess;
2230
+ this.foreignBoxReads = foreignBoxReads;
2203
2231
  this.globalState = globalState;
2204
2232
  this.globalStateSchema = globalStateSchema;
2205
2233
  this.localStateSchema = localStateSchema;
@@ -2222,6 +2250,8 @@ export class ApplicationParams implements Encodable {
2222
2250
  ['clear-state-program', this.clearStateProgram],
2223
2251
  ['creator', this.creator.toString()],
2224
2252
  ['extra-program-pages', this.extraProgramPages],
2253
+ ['family-box-access', this.familyBoxAccess],
2254
+ ['foreign-box-reads', this.foreignBoxReads],
2225
2255
  [
2226
2256
  'global-state',
2227
2257
  typeof this.globalState !== 'undefined'
@@ -2259,6 +2289,8 @@ export class ApplicationParams implements Encodable {
2259
2289
  clearStateProgram: data.get('clear-state-program'),
2260
2290
  creator: data.get('creator'),
2261
2291
  extraProgramPages: data.get('extra-program-pages'),
2292
+ familyBoxAccess: data.get('family-box-access'),
2293
+ foreignBoxReads: data.get('foreign-box-reads'),
2262
2294
  globalState:
2263
2295
  typeof data.get('global-state') !== 'undefined'
2264
2296
  ? data
@@ -3810,656 +3842,14 @@ export class CompileResponse implements Encodable {
3810
3842
  private static encodingSchemaValue: Schema | undefined;
3811
3843
 
3812
3844
  static get encodingSchema(): Schema {
3813
- if (!this.encodingSchemaValue) {
3814
- this.encodingSchemaValue = new NamedMapSchema([]);
3815
- (this.encodingSchemaValue as NamedMapSchema).pushEntries(
3816
- { key: 'hash', valueSchema: new StringSchema(), omitEmpty: true },
3817
- { key: 'result', valueSchema: new StringSchema(), omitEmpty: true },
3818
- {
3819
- key: 'sourcemap',
3820
- valueSchema: new OptionalSchema(UntypedValue.encodingSchema),
3821
- omitEmpty: true,
3822
- }
3823
- );
3824
- }
3825
- return this.encodingSchemaValue;
3826
- }
3827
-
3828
- /**
3829
- * base32 SHA512_256 of program bytes (Address style)
3830
- */
3831
- public hash: string;
3832
-
3833
- /**
3834
- * base64 encoded program bytes
3835
- */
3836
- public result: string;
3837
-
3838
- /**
3839
- * JSON of the source map
3840
- */
3841
- public sourcemap?: UntypedValue;
3842
-
3843
- /**
3844
- * Creates a new `CompileResponse` object.
3845
- * @param hash - base32 SHA512_256 of program bytes (Address style)
3846
- * @param result - base64 encoded program bytes
3847
- * @param sourcemap - JSON of the source map
3848
- */
3849
- constructor({
3850
- hash,
3851
- result,
3852
- sourcemap,
3853
- }: {
3854
- hash: string;
3855
- result: string;
3856
- sourcemap?: UntypedValue;
3857
- }) {
3858
- this.hash = hash;
3859
- this.result = result;
3860
- this.sourcemap = sourcemap;
3861
- }
3862
-
3863
- // eslint-disable-next-line class-methods-use-this
3864
- getEncodingSchema(): Schema {
3865
- return CompileResponse.encodingSchema;
3866
- }
3867
-
3868
- toEncodingData(): Map<string, unknown> {
3869
- return new Map<string, unknown>([
3870
- ['hash', this.hash],
3871
- ['result', this.result],
3872
- [
3873
- 'sourcemap',
3874
- typeof this.sourcemap !== 'undefined'
3875
- ? this.sourcemap.toEncodingData()
3876
- : undefined,
3877
- ],
3878
- ]);
3879
- }
3880
-
3881
- static fromEncodingData(data: unknown): CompileResponse {
3882
- if (!(data instanceof Map)) {
3883
- throw new Error(`Invalid decoded CompileResponse: ${data}`);
3884
- }
3885
- return new CompileResponse({
3886
- hash: data.get('hash'),
3887
- result: data.get('result'),
3888
- sourcemap:
3889
- typeof data.get('sourcemap') !== 'undefined'
3890
- ? UntypedValue.fromEncodingData(data.get('sourcemap'))
3891
- : undefined,
3892
- });
3893
- }
3894
- }
3895
-
3896
- /**
3897
- * Teal disassembly Result
3898
- */
3899
- export class DisassembleResponse implements Encodable {
3900
- private static encodingSchemaValue: Schema | undefined;
3901
-
3902
- static get encodingSchema(): Schema {
3903
- if (!this.encodingSchemaValue) {
3904
- this.encodingSchemaValue = new NamedMapSchema([]);
3905
- (this.encodingSchemaValue as NamedMapSchema).pushEntries({
3906
- key: 'result',
3907
- valueSchema: new StringSchema(),
3908
- omitEmpty: true,
3909
- });
3910
- }
3911
- return this.encodingSchemaValue;
3912
- }
3913
-
3914
- /**
3915
- * disassembled Teal code
3916
- */
3917
- public result: string;
3918
-
3919
- /**
3920
- * Creates a new `DisassembleResponse` object.
3921
- * @param result - disassembled Teal code
3922
- */
3923
- constructor({ result }: { result: string }) {
3924
- this.result = result;
3925
- }
3926
-
3927
- // eslint-disable-next-line class-methods-use-this
3928
- getEncodingSchema(): Schema {
3929
- return DisassembleResponse.encodingSchema;
3930
- }
3931
-
3932
- toEncodingData(): Map<string, unknown> {
3933
- return new Map<string, unknown>([['result', this.result]]);
3934
- }
3935
-
3936
- static fromEncodingData(data: unknown): DisassembleResponse {
3937
- if (!(data instanceof Map)) {
3938
- throw new Error(`Invalid decoded DisassembleResponse: ${data}`);
3939
- }
3940
- return new DisassembleResponse({
3941
- result: data.get('result'),
3942
- });
3943
- }
3944
- }
3945
-
3946
- /**
3947
- * Request data type for dryrun endpoint. Given the Transactions and simulated
3948
- * ledger state upload, run TEAL scripts and return debugging information.
3949
- */
3950
- export class DryrunRequest implements Encodable {
3951
- private static encodingSchemaValue: Schema | undefined;
3952
-
3953
- static get encodingSchema(): Schema {
3954
- if (!this.encodingSchemaValue) {
3955
- this.encodingSchemaValue = new NamedMapSchema([]);
3956
- (this.encodingSchemaValue as NamedMapSchema).pushEntries(
3957
- {
3958
- key: 'accounts',
3959
- valueSchema: new ArraySchema(Account.encodingSchema),
3960
- omitEmpty: true,
3961
- },
3962
- {
3963
- key: 'apps',
3964
- valueSchema: new ArraySchema(Application.encodingSchema),
3965
- omitEmpty: true,
3966
- },
3967
- {
3968
- key: 'latest-timestamp',
3969
- valueSchema: new Uint64Schema(),
3970
- omitEmpty: true,
3971
- },
3972
- {
3973
- key: 'protocol-version',
3974
- valueSchema: new StringSchema(),
3975
- omitEmpty: true,
3976
- },
3977
- { key: 'round', valueSchema: new Uint64Schema(), omitEmpty: true },
3978
- {
3979
- key: 'sources',
3980
- valueSchema: new ArraySchema(DryrunSource.encodingSchema),
3981
- omitEmpty: true,
3982
- },
3983
- {
3984
- key: 'txns',
3985
- valueSchema: new ArraySchema(SignedTransaction.encodingSchema),
3986
- omitEmpty: true,
3987
- }
3988
- );
3989
- }
3990
- return this.encodingSchemaValue;
3991
- }
3992
-
3993
- public accounts: Account[];
3994
-
3995
- public apps: Application[];
3996
-
3997
- /**
3998
- * LatestTimestamp is available to some TEAL scripts. Defaults to the latest
3999
- * confirmed timestamp this algod is attached to.
4000
- */
4001
- public latestTimestamp: number;
4002
-
4003
- /**
4004
- * ProtocolVersion specifies a specific version string to operate under, otherwise
4005
- * whatever the current protocol of the network this algod is running in.
4006
- */
4007
- public protocolVersion: string;
4008
-
4009
- /**
4010
- * Round is available to some TEAL scripts. Defaults to the current round on the
4011
- * network this algod is attached to.
4012
- */
4013
- public round: bigint;
4014
-
4015
- public sources: DryrunSource[];
4016
-
4017
- public txns: SignedTransaction[];
4018
-
4019
- /**
4020
- * Creates a new `DryrunRequest` object.
4021
- * @param accounts -
4022
- * @param apps -
4023
- * @param latestTimestamp - LatestTimestamp is available to some TEAL scripts. Defaults to the latest
4024
- * confirmed timestamp this algod is attached to.
4025
- * @param protocolVersion - ProtocolVersion specifies a specific version string to operate under, otherwise
4026
- * whatever the current protocol of the network this algod is running in.
4027
- * @param round - Round is available to some TEAL scripts. Defaults to the current round on the
4028
- * network this algod is attached to.
4029
- * @param sources -
4030
- * @param txns -
4031
- */
4032
- constructor({
4033
- accounts,
4034
- apps,
4035
- latestTimestamp,
4036
- protocolVersion,
4037
- round,
4038
- sources,
4039
- txns,
4040
- }: {
4041
- accounts: Account[];
4042
- apps: Application[];
4043
- latestTimestamp: number | bigint;
4044
- protocolVersion: string;
4045
- round: number | bigint;
4046
- sources: DryrunSource[];
4047
- txns: SignedTransaction[];
4048
- }) {
4049
- this.accounts = accounts;
4050
- this.apps = apps;
4051
- this.latestTimestamp = ensureSafeInteger(latestTimestamp);
4052
- this.protocolVersion = protocolVersion;
4053
- this.round = ensureBigInt(round);
4054
- this.sources = sources;
4055
- this.txns = txns;
4056
- }
4057
-
4058
- // eslint-disable-next-line class-methods-use-this
4059
- getEncodingSchema(): Schema {
4060
- return DryrunRequest.encodingSchema;
4061
- }
4062
-
4063
- toEncodingData(): Map<string, unknown> {
4064
- return new Map<string, unknown>([
4065
- ['accounts', this.accounts.map((v) => v.toEncodingData())],
4066
- ['apps', this.apps.map((v) => v.toEncodingData())],
4067
- ['latest-timestamp', this.latestTimestamp],
4068
- ['protocol-version', this.protocolVersion],
4069
- ['round', this.round],
4070
- ['sources', this.sources.map((v) => v.toEncodingData())],
4071
- ['txns', this.txns.map((v) => v.toEncodingData())],
4072
- ]);
4073
- }
4074
-
4075
- static fromEncodingData(data: unknown): DryrunRequest {
4076
- if (!(data instanceof Map)) {
4077
- throw new Error(`Invalid decoded DryrunRequest: ${data}`);
4078
- }
4079
- return new DryrunRequest({
4080
- accounts: (data.get('accounts') ?? []).map((v: unknown) =>
4081
- Account.fromEncodingData(v)
4082
- ),
4083
- apps: (data.get('apps') ?? []).map((v: unknown) =>
4084
- Application.fromEncodingData(v)
4085
- ),
4086
- latestTimestamp: data.get('latest-timestamp'),
4087
- protocolVersion: data.get('protocol-version'),
4088
- round: data.get('round'),
4089
- sources: (data.get('sources') ?? []).map((v: unknown) =>
4090
- DryrunSource.fromEncodingData(v)
4091
- ),
4092
- txns: (data.get('txns') ?? []).map((v: unknown) =>
4093
- SignedTransaction.fromEncodingData(v)
4094
- ),
4095
- });
4096
- }
4097
- }
4098
-
4099
- /**
4100
- * DryrunResponse contains per-txn debug information from a dryrun.
4101
- */
4102
- export class DryrunResponse implements Encodable {
4103
- private static encodingSchemaValue: Schema | undefined;
4104
-
4105
- static get encodingSchema(): Schema {
4106
- if (!this.encodingSchemaValue) {
4107
- this.encodingSchemaValue = new NamedMapSchema([]);
4108
- (this.encodingSchemaValue as NamedMapSchema).pushEntries(
4109
- { key: 'error', valueSchema: new StringSchema(), omitEmpty: true },
4110
- {
4111
- key: 'protocol-version',
4112
- valueSchema: new StringSchema(),
4113
- omitEmpty: true,
4114
- },
4115
- {
4116
- key: 'txns',
4117
- valueSchema: new ArraySchema(DryrunTxnResult.encodingSchema),
4118
- omitEmpty: true,
4119
- }
4120
- );
4121
- }
4122
- return this.encodingSchemaValue;
4123
- }
4124
-
4125
- public error: string;
4126
-
4127
- /**
4128
- * Protocol version is the protocol version Dryrun was operated under.
4129
- */
4130
- public protocolVersion: string;
4131
-
4132
- public txns: DryrunTxnResult[];
4133
-
4134
- /**
4135
- * Creates a new `DryrunResponse` object.
4136
- * @param error -
4137
- * @param protocolVersion - Protocol version is the protocol version Dryrun was operated under.
4138
- * @param txns -
4139
- */
4140
- constructor({
4141
- error,
4142
- protocolVersion,
4143
- txns,
4144
- }: {
4145
- error: string;
4146
- protocolVersion: string;
4147
- txns: DryrunTxnResult[];
4148
- }) {
4149
- this.error = error;
4150
- this.protocolVersion = protocolVersion;
4151
- this.txns = txns;
4152
- }
4153
-
4154
- // eslint-disable-next-line class-methods-use-this
4155
- getEncodingSchema(): Schema {
4156
- return DryrunResponse.encodingSchema;
4157
- }
4158
-
4159
- toEncodingData(): Map<string, unknown> {
4160
- return new Map<string, unknown>([
4161
- ['error', this.error],
4162
- ['protocol-version', this.protocolVersion],
4163
- ['txns', this.txns.map((v) => v.toEncodingData())],
4164
- ]);
4165
- }
4166
-
4167
- static fromEncodingData(data: unknown): DryrunResponse {
4168
- if (!(data instanceof Map)) {
4169
- throw new Error(`Invalid decoded DryrunResponse: ${data}`);
4170
- }
4171
- return new DryrunResponse({
4172
- error: data.get('error'),
4173
- protocolVersion: data.get('protocol-version'),
4174
- txns: (data.get('txns') ?? []).map((v: unknown) =>
4175
- DryrunTxnResult.fromEncodingData(v)
4176
- ),
4177
- });
4178
- }
4179
- }
4180
-
4181
- /**
4182
- * DryrunSource is TEAL source text that gets uploaded, compiled, and inserted into
4183
- * transactions or application state.
4184
- */
4185
- export class DryrunSource implements Encodable {
4186
- private static encodingSchemaValue: Schema | undefined;
4187
-
4188
- static get encodingSchema(): Schema {
4189
- if (!this.encodingSchemaValue) {
4190
- this.encodingSchemaValue = new NamedMapSchema([]);
4191
- (this.encodingSchemaValue as NamedMapSchema).pushEntries(
4192
- { key: 'app-index', valueSchema: new Uint64Schema(), omitEmpty: true },
4193
- { key: 'field-name', valueSchema: new StringSchema(), omitEmpty: true },
4194
- { key: 'source', valueSchema: new StringSchema(), omitEmpty: true },
4195
- { key: 'txn-index', valueSchema: new Uint64Schema(), omitEmpty: true }
4196
- );
4197
- }
4198
- return this.encodingSchemaValue;
4199
- }
4200
-
4201
- public appIndex: bigint;
4202
-
4203
- /**
4204
- * FieldName is what kind of sources this is. If lsig then it goes into the
4205
- * transactions[this.TxnIndex].LogicSig. If approv or clearp it goes into the
4206
- * Approval Program or Clear State Program of application[this.AppIndex].
4207
- */
4208
- public fieldName: string;
4209
-
4210
- public source: string;
4211
-
4212
- public txnIndex: number;
4213
-
4214
- /**
4215
- * Creates a new `DryrunSource` object.
4216
- * @param appIndex -
4217
- * @param fieldName - FieldName is what kind of sources this is. If lsig then it goes into the
4218
- * transactions[this.TxnIndex].LogicSig. If approv or clearp it goes into the
4219
- * Approval Program or Clear State Program of application[this.AppIndex].
4220
- * @param source -
4221
- * @param txnIndex -
4222
- */
4223
- constructor({
4224
- appIndex,
4225
- fieldName,
4226
- source,
4227
- txnIndex,
4228
- }: {
4229
- appIndex: number | bigint;
4230
- fieldName: string;
4231
- source: string;
4232
- txnIndex: number | bigint;
4233
- }) {
4234
- this.appIndex = ensureBigInt(appIndex);
4235
- this.fieldName = fieldName;
4236
- this.source = source;
4237
- this.txnIndex = ensureSafeInteger(txnIndex);
4238
- }
4239
-
4240
- // eslint-disable-next-line class-methods-use-this
4241
- getEncodingSchema(): Schema {
4242
- return DryrunSource.encodingSchema;
4243
- }
4244
-
4245
- toEncodingData(): Map<string, unknown> {
4246
- return new Map<string, unknown>([
4247
- ['app-index', this.appIndex],
4248
- ['field-name', this.fieldName],
4249
- ['source', this.source],
4250
- ['txn-index', this.txnIndex],
4251
- ]);
4252
- }
4253
-
4254
- static fromEncodingData(data: unknown): DryrunSource {
4255
- if (!(data instanceof Map)) {
4256
- throw new Error(`Invalid decoded DryrunSource: ${data}`);
4257
- }
4258
- return new DryrunSource({
4259
- appIndex: data.get('app-index'),
4260
- fieldName: data.get('field-name'),
4261
- source: data.get('source'),
4262
- txnIndex: data.get('txn-index'),
4263
- });
4264
- }
4265
- }
4266
-
4267
- /**
4268
- * Stores the TEAL eval step data
4269
- */
4270
- export class DryrunState implements Encodable {
4271
- private static encodingSchemaValue: Schema | undefined;
4272
-
4273
- static get encodingSchema(): Schema {
4274
- if (!this.encodingSchemaValue) {
4275
- this.encodingSchemaValue = new NamedMapSchema([]);
4276
- (this.encodingSchemaValue as NamedMapSchema).pushEntries(
4277
- { key: 'line', valueSchema: new Uint64Schema(), omitEmpty: true },
4278
- { key: 'pc', valueSchema: new Uint64Schema(), omitEmpty: true },
4279
- {
4280
- key: 'stack',
4281
- valueSchema: new ArraySchema(TealValue.encodingSchema),
4282
- omitEmpty: true,
4283
- },
4284
- {
4285
- key: 'error',
4286
- valueSchema: new OptionalSchema(new StringSchema()),
4287
- omitEmpty: true,
4288
- },
4289
- {
4290
- key: 'scratch',
4291
- valueSchema: new OptionalSchema(
4292
- new ArraySchema(TealValue.encodingSchema)
4293
- ),
4294
- omitEmpty: true,
4295
- }
4296
- );
4297
- }
4298
- return this.encodingSchemaValue;
4299
- }
4300
-
4301
- /**
4302
- * Line number
4303
- */
4304
- public line: number;
4305
-
4306
- /**
4307
- * Program counter
4308
- */
4309
- public pc: number;
4310
-
4311
- public stack: TealValue[];
4312
-
4313
- /**
4314
- * Evaluation error if any
4315
- */
4316
- public error?: string;
4317
-
4318
- public scratch?: TealValue[];
4319
-
4320
- /**
4321
- * Creates a new `DryrunState` object.
4322
- * @param line - Line number
4323
- * @param pc - Program counter
4324
- * @param stack -
4325
- * @param error - Evaluation error if any
4326
- * @param scratch -
4327
- */
4328
- constructor({
4329
- line,
4330
- pc,
4331
- stack,
4332
- error,
4333
- scratch,
4334
- }: {
4335
- line: number | bigint;
4336
- pc: number | bigint;
4337
- stack: TealValue[];
4338
- error?: string;
4339
- scratch?: TealValue[];
4340
- }) {
4341
- this.line = ensureSafeInteger(line);
4342
- this.pc = ensureSafeInteger(pc);
4343
- this.stack = stack;
4344
- this.error = error;
4345
- this.scratch = scratch;
4346
- }
4347
-
4348
- // eslint-disable-next-line class-methods-use-this
4349
- getEncodingSchema(): Schema {
4350
- return DryrunState.encodingSchema;
4351
- }
4352
-
4353
- toEncodingData(): Map<string, unknown> {
4354
- return new Map<string, unknown>([
4355
- ['line', this.line],
4356
- ['pc', this.pc],
4357
- ['stack', this.stack.map((v) => v.toEncodingData())],
4358
- ['error', this.error],
4359
- [
4360
- 'scratch',
4361
- typeof this.scratch !== 'undefined'
4362
- ? this.scratch.map((v) => v.toEncodingData())
4363
- : undefined,
4364
- ],
4365
- ]);
4366
- }
4367
-
4368
- static fromEncodingData(data: unknown): DryrunState {
4369
- if (!(data instanceof Map)) {
4370
- throw new Error(`Invalid decoded DryrunState: ${data}`);
4371
- }
4372
- return new DryrunState({
4373
- line: data.get('line'),
4374
- pc: data.get('pc'),
4375
- stack: (data.get('stack') ?? []).map((v: unknown) =>
4376
- TealValue.fromEncodingData(v)
4377
- ),
4378
- error: data.get('error'),
4379
- scratch:
4380
- typeof data.get('scratch') !== 'undefined'
4381
- ? data
4382
- .get('scratch')
4383
- .map((v: unknown) => TealValue.fromEncodingData(v))
4384
- : undefined,
4385
- });
4386
- }
4387
- }
4388
-
4389
- /**
4390
- * DryrunTxnResult contains any LogicSig or ApplicationCall program debug
4391
- * information and state updates from a dryrun.
4392
- */
4393
- export class DryrunTxnResult implements Encodable {
4394
- private static encodingSchemaValue: Schema | undefined;
4395
-
4396
- static get encodingSchema(): Schema {
4397
- if (!this.encodingSchemaValue) {
4398
- this.encodingSchemaValue = new NamedMapSchema([]);
4399
- (this.encodingSchemaValue as NamedMapSchema).pushEntries(
4400
- {
4401
- key: 'disassembly',
4402
- valueSchema: new ArraySchema(new StringSchema()),
4403
- omitEmpty: true,
4404
- },
4405
- {
4406
- key: 'app-call-messages',
4407
- valueSchema: new OptionalSchema(new ArraySchema(new StringSchema())),
4408
- omitEmpty: true,
4409
- },
4410
- {
4411
- key: 'app-call-trace',
4412
- valueSchema: new OptionalSchema(
4413
- new ArraySchema(DryrunState.encodingSchema)
4414
- ),
4415
- omitEmpty: true,
4416
- },
4417
- {
4418
- key: 'budget-added',
4419
- valueSchema: new OptionalSchema(new Uint64Schema()),
4420
- omitEmpty: true,
4421
- },
4422
- {
4423
- key: 'budget-consumed',
4424
- valueSchema: new OptionalSchema(new Uint64Schema()),
4425
- omitEmpty: true,
4426
- },
4427
- {
4428
- key: 'global-delta',
4429
- valueSchema: new OptionalSchema(
4430
- new ArraySchema(EvalDeltaKeyValue.encodingSchema)
4431
- ),
4432
- omitEmpty: true,
4433
- },
4434
- {
4435
- key: 'local-deltas',
4436
- valueSchema: new OptionalSchema(
4437
- new ArraySchema(AccountStateDelta.encodingSchema)
4438
- ),
4439
- omitEmpty: true,
4440
- },
4441
- {
4442
- key: 'logic-sig-disassembly',
4443
- valueSchema: new OptionalSchema(new ArraySchema(new StringSchema())),
4444
- omitEmpty: true,
4445
- },
4446
- {
4447
- key: 'logic-sig-messages',
4448
- valueSchema: new OptionalSchema(new ArraySchema(new StringSchema())),
4449
- omitEmpty: true,
4450
- },
4451
- {
4452
- key: 'logic-sig-trace',
4453
- valueSchema: new OptionalSchema(
4454
- new ArraySchema(DryrunState.encodingSchema)
4455
- ),
4456
- omitEmpty: true,
4457
- },
3845
+ if (!this.encodingSchemaValue) {
3846
+ this.encodingSchemaValue = new NamedMapSchema([]);
3847
+ (this.encodingSchemaValue as NamedMapSchema).pushEntries(
3848
+ { key: 'hash', valueSchema: new StringSchema(), omitEmpty: true },
3849
+ { key: 'result', valueSchema: new StringSchema(), omitEmpty: true },
4458
3850
  {
4459
- key: 'logs',
4460
- valueSchema: new OptionalSchema(
4461
- new ArraySchema(new ByteArraySchema())
4462
- ),
3851
+ key: 'sourcemap',
3852
+ valueSchema: new OptionalSchema(UntypedValue.encodingSchema),
4463
3853
  omitEmpty: true,
4464
3854
  }
4465
3855
  );
@@ -4468,177 +3858,119 @@ export class DryrunTxnResult implements Encodable {
4468
3858
  }
4469
3859
 
4470
3860
  /**
4471
- * Disassembled program line by line.
4472
- */
4473
- public disassembly: string[];
4474
-
4475
- public appCallMessages?: string[];
4476
-
4477
- public appCallTrace?: DryrunState[];
4478
-
4479
- /**
4480
- * Budget added during execution of app call transaction.
4481
- */
4482
- public budgetAdded?: number;
4483
-
4484
- /**
4485
- * Budget consumed during execution of app call transaction.
3861
+ * base32 SHA512_256 of program bytes (Address style)
4486
3862
  */
4487
- public budgetConsumed?: number;
3863
+ public hash: string;
4488
3864
 
4489
3865
  /**
4490
- * Application state delta.
3866
+ * base64 encoded program bytes
4491
3867
  */
4492
- public globalDelta?: EvalDeltaKeyValue[];
4493
-
4494
- public localDeltas?: AccountStateDelta[];
3868
+ public result: string;
4495
3869
 
4496
3870
  /**
4497
- * Disassembled lsig program line by line.
3871
+ * JSON of the source map
4498
3872
  */
4499
- public logicSigDisassembly?: string[];
4500
-
4501
- public logicSigMessages?: string[];
4502
-
4503
- public logicSigTrace?: DryrunState[];
4504
-
4505
- public logs?: Uint8Array[];
3873
+ public sourcemap?: UntypedValue;
4506
3874
 
4507
3875
  /**
4508
- * Creates a new `DryrunTxnResult` object.
4509
- * @param disassembly - Disassembled program line by line.
4510
- * @param appCallMessages -
4511
- * @param appCallTrace -
4512
- * @param budgetAdded - Budget added during execution of app call transaction.
4513
- * @param budgetConsumed - Budget consumed during execution of app call transaction.
4514
- * @param globalDelta - Application state delta.
4515
- * @param localDeltas -
4516
- * @param logicSigDisassembly - Disassembled lsig program line by line.
4517
- * @param logicSigMessages -
4518
- * @param logicSigTrace -
4519
- * @param logs -
3876
+ * Creates a new `CompileResponse` object.
3877
+ * @param hash - base32 SHA512_256 of program bytes (Address style)
3878
+ * @param result - base64 encoded program bytes
3879
+ * @param sourcemap - JSON of the source map
4520
3880
  */
4521
3881
  constructor({
4522
- disassembly,
4523
- appCallMessages,
4524
- appCallTrace,
4525
- budgetAdded,
4526
- budgetConsumed,
4527
- globalDelta,
4528
- localDeltas,
4529
- logicSigDisassembly,
4530
- logicSigMessages,
4531
- logicSigTrace,
4532
- logs,
3882
+ hash,
3883
+ result,
3884
+ sourcemap,
4533
3885
  }: {
4534
- disassembly: string[];
4535
- appCallMessages?: string[];
4536
- appCallTrace?: DryrunState[];
4537
- budgetAdded?: number | bigint;
4538
- budgetConsumed?: number | bigint;
4539
- globalDelta?: EvalDeltaKeyValue[];
4540
- localDeltas?: AccountStateDelta[];
4541
- logicSigDisassembly?: string[];
4542
- logicSigMessages?: string[];
4543
- logicSigTrace?: DryrunState[];
4544
- logs?: Uint8Array[];
3886
+ hash: string;
3887
+ result: string;
3888
+ sourcemap?: UntypedValue;
4545
3889
  }) {
4546
- this.disassembly = disassembly;
4547
- this.appCallMessages = appCallMessages;
4548
- this.appCallTrace = appCallTrace;
4549
- this.budgetAdded =
4550
- typeof budgetAdded === 'undefined'
4551
- ? undefined
4552
- : ensureSafeInteger(budgetAdded);
4553
- this.budgetConsumed =
4554
- typeof budgetConsumed === 'undefined'
4555
- ? undefined
4556
- : ensureSafeInteger(budgetConsumed);
4557
- this.globalDelta = globalDelta;
4558
- this.localDeltas = localDeltas;
4559
- this.logicSigDisassembly = logicSigDisassembly;
4560
- this.logicSigMessages = logicSigMessages;
4561
- this.logicSigTrace = logicSigTrace;
4562
- this.logs = logs;
3890
+ this.hash = hash;
3891
+ this.result = result;
3892
+ this.sourcemap = sourcemap;
4563
3893
  }
4564
3894
 
4565
3895
  // eslint-disable-next-line class-methods-use-this
4566
3896
  getEncodingSchema(): Schema {
4567
- return DryrunTxnResult.encodingSchema;
3897
+ return CompileResponse.encodingSchema;
4568
3898
  }
4569
3899
 
4570
3900
  toEncodingData(): Map<string, unknown> {
4571
3901
  return new Map<string, unknown>([
4572
- ['disassembly', this.disassembly],
4573
- ['app-call-messages', this.appCallMessages],
4574
- [
4575
- 'app-call-trace',
4576
- typeof this.appCallTrace !== 'undefined'
4577
- ? this.appCallTrace.map((v) => v.toEncodingData())
4578
- : undefined,
4579
- ],
4580
- ['budget-added', this.budgetAdded],
4581
- ['budget-consumed', this.budgetConsumed],
4582
- [
4583
- 'global-delta',
4584
- typeof this.globalDelta !== 'undefined'
4585
- ? this.globalDelta.map((v) => v.toEncodingData())
4586
- : undefined,
4587
- ],
4588
- [
4589
- 'local-deltas',
4590
- typeof this.localDeltas !== 'undefined'
4591
- ? this.localDeltas.map((v) => v.toEncodingData())
4592
- : undefined,
4593
- ],
4594
- ['logic-sig-disassembly', this.logicSigDisassembly],
4595
- ['logic-sig-messages', this.logicSigMessages],
3902
+ ['hash', this.hash],
3903
+ ['result', this.result],
4596
3904
  [
4597
- 'logic-sig-trace',
4598
- typeof this.logicSigTrace !== 'undefined'
4599
- ? this.logicSigTrace.map((v) => v.toEncodingData())
3905
+ 'sourcemap',
3906
+ typeof this.sourcemap !== 'undefined'
3907
+ ? this.sourcemap.toEncodingData()
4600
3908
  : undefined,
4601
3909
  ],
4602
- ['logs', this.logs],
4603
3910
  ]);
4604
3911
  }
4605
3912
 
4606
- static fromEncodingData(data: unknown): DryrunTxnResult {
3913
+ static fromEncodingData(data: unknown): CompileResponse {
4607
3914
  if (!(data instanceof Map)) {
4608
- throw new Error(`Invalid decoded DryrunTxnResult: ${data}`);
3915
+ throw new Error(`Invalid decoded CompileResponse: ${data}`);
4609
3916
  }
4610
- return new DryrunTxnResult({
4611
- disassembly: data.get('disassembly'),
4612
- appCallMessages: data.get('app-call-messages'),
4613
- appCallTrace:
4614
- typeof data.get('app-call-trace') !== 'undefined'
4615
- ? data
4616
- .get('app-call-trace')
4617
- .map((v: unknown) => DryrunState.fromEncodingData(v))
4618
- : undefined,
4619
- budgetAdded: data.get('budget-added'),
4620
- budgetConsumed: data.get('budget-consumed'),
4621
- globalDelta:
4622
- typeof data.get('global-delta') !== 'undefined'
4623
- ? data
4624
- .get('global-delta')
4625
- .map((v: unknown) => EvalDeltaKeyValue.fromEncodingData(v))
4626
- : undefined,
4627
- localDeltas:
4628
- typeof data.get('local-deltas') !== 'undefined'
4629
- ? data
4630
- .get('local-deltas')
4631
- .map((v: unknown) => AccountStateDelta.fromEncodingData(v))
4632
- : undefined,
4633
- logicSigDisassembly: data.get('logic-sig-disassembly'),
4634
- logicSigMessages: data.get('logic-sig-messages'),
4635
- logicSigTrace:
4636
- typeof data.get('logic-sig-trace') !== 'undefined'
4637
- ? data
4638
- .get('logic-sig-trace')
4639
- .map((v: unknown) => DryrunState.fromEncodingData(v))
3917
+ return new CompileResponse({
3918
+ hash: data.get('hash'),
3919
+ result: data.get('result'),
3920
+ sourcemap:
3921
+ typeof data.get('sourcemap') !== 'undefined'
3922
+ ? UntypedValue.fromEncodingData(data.get('sourcemap'))
4640
3923
  : undefined,
4641
- logs: data.get('logs'),
3924
+ });
3925
+ }
3926
+ }
3927
+
3928
+ /**
3929
+ * Teal disassembly Result
3930
+ */
3931
+ export class DisassembleResponse implements Encodable {
3932
+ private static encodingSchemaValue: Schema | undefined;
3933
+
3934
+ static get encodingSchema(): Schema {
3935
+ if (!this.encodingSchemaValue) {
3936
+ this.encodingSchemaValue = new NamedMapSchema([]);
3937
+ (this.encodingSchemaValue as NamedMapSchema).pushEntries({
3938
+ key: 'result',
3939
+ valueSchema: new StringSchema(),
3940
+ omitEmpty: true,
3941
+ });
3942
+ }
3943
+ return this.encodingSchemaValue;
3944
+ }
3945
+
3946
+ /**
3947
+ * disassembled Teal code
3948
+ */
3949
+ public result: string;
3950
+
3951
+ /**
3952
+ * Creates a new `DisassembleResponse` object.
3953
+ * @param result - disassembled Teal code
3954
+ */
3955
+ constructor({ result }: { result: string }) {
3956
+ this.result = result;
3957
+ }
3958
+
3959
+ // eslint-disable-next-line class-methods-use-this
3960
+ getEncodingSchema(): Schema {
3961
+ return DisassembleResponse.encodingSchema;
3962
+ }
3963
+
3964
+ toEncodingData(): Map<string, unknown> {
3965
+ return new Map<string, unknown>([['result', this.result]]);
3966
+ }
3967
+
3968
+ static fromEncodingData(data: unknown): DisassembleResponse {
3969
+ if (!(data instanceof Map)) {
3970
+ throw new Error(`Invalid decoded DisassembleResponse: ${data}`);
3971
+ }
3972
+ return new DisassembleResponse({
3973
+ result: data.get('result'),
4642
3974
  });
4643
3975
  }
4644
3976
  }
@@ -5108,6 +4440,57 @@ export class GetBlockTimeStampOffsetResponse implements Encodable {
5108
4440
  }
5109
4441
  }
5110
4442
 
4443
+ /**
4444
+ * Response containing the network peers of the node
4445
+ */
4446
+ export class GetPeersResponse implements Encodable {
4447
+ private static encodingSchemaValue: Schema | undefined;
4448
+
4449
+ static get encodingSchema(): Schema {
4450
+ if (!this.encodingSchemaValue) {
4451
+ this.encodingSchemaValue = new NamedMapSchema([]);
4452
+ (this.encodingSchemaValue as NamedMapSchema).pushEntries({
4453
+ key: 'Peers',
4454
+ valueSchema: new ArraySchema(PeerStatus.encodingSchema),
4455
+ omitEmpty: true,
4456
+ });
4457
+ }
4458
+ return this.encodingSchemaValue;
4459
+ }
4460
+
4461
+ public peers: PeerStatus[];
4462
+
4463
+ /**
4464
+ * Creates a new `GetPeersResponse` object.
4465
+ * @param peers -
4466
+ */
4467
+ constructor({ peers }: { peers: PeerStatus[] }) {
4468
+ this.peers = peers;
4469
+ }
4470
+
4471
+ // eslint-disable-next-line class-methods-use-this
4472
+ getEncodingSchema(): Schema {
4473
+ return GetPeersResponse.encodingSchema;
4474
+ }
4475
+
4476
+ toEncodingData(): Map<string, unknown> {
4477
+ return new Map<string, unknown>([
4478
+ ['Peers', this.peers.map((v) => v.toEncodingData())],
4479
+ ]);
4480
+ }
4481
+
4482
+ static fromEncodingData(data: unknown): GetPeersResponse {
4483
+ if (!(data instanceof Map)) {
4484
+ throw new Error(`Invalid decoded GetPeersResponse: ${data}`);
4485
+ }
4486
+ return new GetPeersResponse({
4487
+ peers: (data.get('Peers') ?? []).map((v: unknown) =>
4488
+ PeerStatus.fromEncodingData(v)
4489
+ ),
4490
+ });
4491
+ }
4492
+ }
4493
+
5111
4494
  /**
5112
4495
  * Response containing the ledger's minimum sync round
5113
4496
  */
@@ -5822,6 +5205,96 @@ export class NodeStatusResponse implements Encodable {
5822
5205
  }
5823
5206
  }
5824
5207
 
5208
+ /**
5209
+ * The status of a connected peer in the P2P network
5210
+ */
5211
+ export class PeerStatus implements Encodable {
5212
+ private static encodingSchemaValue: Schema | undefined;
5213
+
5214
+ static get encodingSchema(): Schema {
5215
+ if (!this.encodingSchemaValue) {
5216
+ this.encodingSchemaValue = new NamedMapSchema([]);
5217
+ (this.encodingSchemaValue as NamedMapSchema).pushEntries(
5218
+ {
5219
+ key: 'network-address',
5220
+ valueSchema: new StringSchema(),
5221
+ omitEmpty: true,
5222
+ },
5223
+ {
5224
+ key: 'connection-type',
5225
+ valueSchema: new OptionalSchema(new StringSchema()),
5226
+ omitEmpty: true,
5227
+ },
5228
+ {
5229
+ key: 'network-type',
5230
+ valueSchema: new OptionalSchema(new StringSchema()),
5231
+ omitEmpty: true,
5232
+ }
5233
+ );
5234
+ }
5235
+ return this.encodingSchemaValue;
5236
+ }
5237
+
5238
+ /**
5239
+ * Network address of the peer
5240
+ */
5241
+ public networkAddress: string;
5242
+
5243
+ /**
5244
+ * Connection type
5245
+ */
5246
+ public connectionType?: string;
5247
+
5248
+ /**
5249
+ * Network type
5250
+ */
5251
+ public networkType?: string;
5252
+
5253
+ /**
5254
+ * Creates a new `PeerStatus` object.
5255
+ * @param networkAddress - Network address of the peer
5256
+ * @param connectionType - Connection type
5257
+ * @param networkType - Network type
5258
+ */
5259
+ constructor({
5260
+ networkAddress,
5261
+ connectionType,
5262
+ networkType,
5263
+ }: {
5264
+ networkAddress: string;
5265
+ connectionType?: string;
5266
+ networkType?: string;
5267
+ }) {
5268
+ this.networkAddress = networkAddress;
5269
+ this.connectionType = connectionType;
5270
+ this.networkType = networkType;
5271
+ }
5272
+
5273
+ // eslint-disable-next-line class-methods-use-this
5274
+ getEncodingSchema(): Schema {
5275
+ return PeerStatus.encodingSchema;
5276
+ }
5277
+
5278
+ toEncodingData(): Map<string, unknown> {
5279
+ return new Map<string, unknown>([
5280
+ ['network-address', this.networkAddress],
5281
+ ['connection-type', this.connectionType],
5282
+ ['network-type', this.networkType],
5283
+ ]);
5284
+ }
5285
+
5286
+ static fromEncodingData(data: unknown): PeerStatus {
5287
+ if (!(data instanceof Map)) {
5288
+ throw new Error(`Invalid decoded PeerStatus: ${data}`);
5289
+ }
5290
+ return new PeerStatus({
5291
+ networkAddress: data.get('network-address'),
5292
+ connectionType: data.get('connection-type'),
5293
+ networkType: data.get('network-type'),
5294
+ });
5295
+ }
5296
+ }
5297
+
5825
5298
  /**
5826
5299
  * Details about a pending transaction. If the transaction was recently confirmed,
5827
5300
  * includes confirmation details like the round and reward details.
@@ -6991,6 +6464,16 @@ export class SimulateTransactionGroupResult implements Encodable {
6991
6464
  valueSchema: new OptionalSchema(new StringSchema()),
6992
6465
  omitEmpty: true,
6993
6466
  },
6467
+ {
6468
+ key: 'group-fees-paid',
6469
+ valueSchema: new OptionalSchema(new Uint64Schema()),
6470
+ omitEmpty: true,
6471
+ },
6472
+ {
6473
+ key: 'group-usage',
6474
+ valueSchema: new OptionalSchema(new Uint64Schema()),
6475
+ omitEmpty: true,
6476
+ },
6994
6477
  {
6995
6478
  key: 'unnamed-resources-accessed',
6996
6479
  valueSchema: new OptionalSchema(
@@ -7032,6 +6515,18 @@ export class SimulateTransactionGroupResult implements Encodable {
7032
6515
  */
7033
6516
  public failureMessage?: string;
7034
6517
 
6518
+ /**
6519
+ * Total fees paid by the transaction group and all of its descendant inner
6520
+ * transaction groups.
6521
+ */
6522
+ public groupFeesPaid?: number;
6523
+
6524
+ /**
6525
+ * Fee usage for the transaction group, including all descendant inner
6526
+ * transactions, in millionths of a basic transaction fee unit.
6527
+ */
6528
+ public groupUsage?: number;
6529
+
7035
6530
  /**
7036
6531
  * These are resources that were accessed by this group that would normally have
7037
6532
  * caused failure, but were allowed in simulation. Depending on where this object
@@ -7056,6 +6551,10 @@ export class SimulateTransactionGroupResult implements Encodable {
7056
6551
  * indicate deeper inner transactions.
7057
6552
  * @param failureMessage - If present, indicates that the transaction group failed and specifies why that
7058
6553
  * happened
6554
+ * @param groupFeesPaid - Total fees paid by the transaction group and all of its descendant inner
6555
+ * transaction groups.
6556
+ * @param groupUsage - Fee usage for the transaction group, including all descendant inner
6557
+ * transactions, in millionths of a basic transaction fee unit.
7059
6558
  * @param unnamedResourcesAccessed - These are resources that were accessed by this group that would normally have
7060
6559
  * caused failure, but were allowed in simulation. Depending on where this object
7061
6560
  * is in the response, the unnamed resources it contains may or may not qualify for
@@ -7072,6 +6571,8 @@ export class SimulateTransactionGroupResult implements Encodable {
7072
6571
  appBudgetConsumed,
7073
6572
  failedAt,
7074
6573
  failureMessage,
6574
+ groupFeesPaid,
6575
+ groupUsage,
7075
6576
  unnamedResourcesAccessed,
7076
6577
  }: {
7077
6578
  txnResults: SimulateTransactionResult[];
@@ -7079,6 +6580,8 @@ export class SimulateTransactionGroupResult implements Encodable {
7079
6580
  appBudgetConsumed?: number | bigint;
7080
6581
  failedAt?: (number | bigint)[];
7081
6582
  failureMessage?: string;
6583
+ groupFeesPaid?: number | bigint;
6584
+ groupUsage?: number | bigint;
7082
6585
  unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
7083
6586
  }) {
7084
6587
  this.txnResults = txnResults;
@@ -7095,6 +6598,14 @@ export class SimulateTransactionGroupResult implements Encodable {
7095
6598
  ? undefined
7096
6599
  : failedAt.map(ensureSafeInteger);
7097
6600
  this.failureMessage = failureMessage;
6601
+ this.groupFeesPaid =
6602
+ typeof groupFeesPaid === 'undefined'
6603
+ ? undefined
6604
+ : ensureSafeInteger(groupFeesPaid);
6605
+ this.groupUsage =
6606
+ typeof groupUsage === 'undefined'
6607
+ ? undefined
6608
+ : ensureSafeInteger(groupUsage);
7098
6609
  this.unnamedResourcesAccessed = unnamedResourcesAccessed;
7099
6610
  }
7100
6611
 
@@ -7110,6 +6621,8 @@ export class SimulateTransactionGroupResult implements Encodable {
7110
6621
  ['app-budget-consumed', this.appBudgetConsumed],
7111
6622
  ['failed-at', this.failedAt],
7112
6623
  ['failure-message', this.failureMessage],
6624
+ ['group-fees-paid', this.groupFeesPaid],
6625
+ ['group-usage', this.groupUsage],
7113
6626
  [
7114
6627
  'unnamed-resources-accessed',
7115
6628
  typeof this.unnamedResourcesAccessed !== 'undefined'
@@ -7133,6 +6646,8 @@ export class SimulateTransactionGroupResult implements Encodable {
7133
6646
  appBudgetConsumed: data.get('app-budget-consumed'),
7134
6647
  failedAt: data.get('failed-at'),
7135
6648
  failureMessage: data.get('failure-message'),
6649
+ groupFeesPaid: data.get('group-fees-paid'),
6650
+ groupUsage: data.get('group-usage'),
7136
6651
  unnamedResourcesAccessed:
7137
6652
  typeof data.get('unnamed-resources-accessed') !== 'undefined'
7138
6653
  ? SimulateUnnamedResourcesAccessed.fromEncodingData(
@@ -7170,6 +6685,11 @@ export class SimulateTransactionResult implements Encodable {
7170
6685
  ),
7171
6686
  omitEmpty: true,
7172
6687
  },
6688
+ {
6689
+ key: 'fees-paid',
6690
+ valueSchema: new OptionalSchema(new Uint64Schema()),
6691
+ omitEmpty: true,
6692
+ },
7173
6693
  {
7174
6694
  key: 'fixed-signer',
7175
6695
  valueSchema: new OptionalSchema(new StringSchema()),
@@ -7210,6 +6730,12 @@ export class SimulateTransactionResult implements Encodable {
7210
6730
  */
7211
6731
  public execTrace?: SimulationTransactionExecTrace;
7212
6732
 
6733
+ /**
6734
+ * Total fees paid by this transaction and all of its descendant inner
6735
+ * transactions.
6736
+ */
6737
+ public feesPaid?: number;
6738
+
7213
6739
  /**
7214
6740
  * The account that needed to sign this transaction when no signature was provided
7215
6741
  * and the provided signer was incorrect.
@@ -7242,6 +6768,8 @@ export class SimulateTransactionResult implements Encodable {
7242
6768
  * budged used by inner app calls spawned by this transaction.
7243
6769
  * @param execTrace - The execution trace of calling an app or a logic sig, containing the inner app
7244
6770
  * call trace in a recursive way.
6771
+ * @param feesPaid - Total fees paid by this transaction and all of its descendant inner
6772
+ * transactions.
7245
6773
  * @param fixedSigner - The account that needed to sign this transaction when no signature was provided
7246
6774
  * and the provided signer was incorrect.
7247
6775
  * @param logicSigBudgetConsumed - Budget used during execution of a logic sig transaction.
@@ -7259,6 +6787,7 @@ export class SimulateTransactionResult implements Encodable {
7259
6787
  txnResult,
7260
6788
  appBudgetConsumed,
7261
6789
  execTrace,
6790
+ feesPaid,
7262
6791
  fixedSigner,
7263
6792
  logicSigBudgetConsumed,
7264
6793
  unnamedResourcesAccessed,
@@ -7266,6 +6795,7 @@ export class SimulateTransactionResult implements Encodable {
7266
6795
  txnResult: PendingTransactionResponse;
7267
6796
  appBudgetConsumed?: number | bigint;
7268
6797
  execTrace?: SimulationTransactionExecTrace;
6798
+ feesPaid?: number | bigint;
7269
6799
  fixedSigner?: Address | string;
7270
6800
  logicSigBudgetConsumed?: number | bigint;
7271
6801
  unnamedResourcesAccessed?: SimulateUnnamedResourcesAccessed;
@@ -7276,6 +6806,8 @@ export class SimulateTransactionResult implements Encodable {
7276
6806
  ? undefined
7277
6807
  : ensureSafeInteger(appBudgetConsumed);
7278
6808
  this.execTrace = execTrace;
6809
+ this.feesPaid =
6810
+ typeof feesPaid === 'undefined' ? undefined : ensureSafeInteger(feesPaid);
7279
6811
  this.fixedSigner =
7280
6812
  typeof fixedSigner === 'string'
7281
6813
  ? Address.fromString(fixedSigner)
@@ -7302,6 +6834,7 @@ export class SimulateTransactionResult implements Encodable {
7302
6834
  ? this.execTrace.toEncodingData()
7303
6835
  : undefined,
7304
6836
  ],
6837
+ ['fees-paid', this.feesPaid],
7305
6838
  [
7306
6839
  'fixed-signer',
7307
6840
  typeof this.fixedSigner !== 'undefined'
@@ -7333,6 +6866,7 @@ export class SimulateTransactionResult implements Encodable {
7333
6866
  data.get('exec-trace')
7334
6867
  )
7335
6868
  : undefined,
6869
+ feesPaid: data.get('fees-paid'),
7336
6870
  fixedSigner: data.get('fixed-signer'),
7337
6871
  logicSigBudgetConsumed: data.get('logic-sig-budget-consumed'),
7338
6872
  unnamedResourcesAccessed: