algosdk 3.4.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/browser/algosdk.min.js +1 -1
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/appAccess.js +261 -0
- package/dist/cjs/appAccess.js.map +1 -0
- package/dist/cjs/client/v2/indexer/models/types.js +266 -8
- package/dist/cjs/client/v2/indexer/models/types.js.map +1 -1
- package/dist/cjs/logicsig.js +54 -17
- package/dist/cjs/logicsig.js.map +1 -1
- package/dist/cjs/makeTxn.js +66 -12
- package/dist/cjs/makeTxn.js.map +1 -1
- package/dist/cjs/signing.js +4 -4
- package/dist/cjs/signing.js.map +1 -1
- package/dist/cjs/transaction.js +107 -0
- package/dist/cjs/transaction.js.map +1 -1
- package/dist/esm/appAccess.js +255 -0
- package/dist/esm/appAccess.js.map +1 -0
- package/dist/esm/client/v2/indexer/models/types.js +261 -6
- package/dist/esm/client/v2/indexer/models/types.js.map +1 -1
- package/dist/esm/logicsig.js +54 -17
- package/dist/esm/logicsig.js.map +1 -1
- package/dist/esm/makeTxn.js +66 -12
- package/dist/esm/makeTxn.js.map +1 -1
- package/dist/esm/signing.js +4 -4
- package/dist/esm/signing.js.map +1 -1
- package/dist/esm/transaction.js +107 -0
- package/dist/esm/transaction.js.map +1 -1
- package/dist/types/appAccess.d.ts +28 -0
- package/dist/types/client/v2/indexer/models/types.d.ts +157 -8
- package/dist/types/logicsig.d.ts +2 -0
- package/dist/types/makeTxn.d.ts +9 -9
- package/dist/types/transaction.d.ts +17 -0
- package/dist/types/types/transactions/base.d.ts +71 -0
- package/package.json +1 -1
- package/src/appAccess.ts +298 -0
- package/src/client/v2/indexer/models/types.ts +423 -5
- package/src/logicsig.ts +68 -17
- package/src/makeTxn.ts +110 -12
- package/src/signing.ts +4 -4
- package/src/transaction.ts +162 -0
- package/src/types/transactions/base.ts +85 -0
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* NOTICE: This file was generated. Editing this file manually is not recommended.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.TransactionsResponse = exports.TransactionStateProof = exports.TransactionSignatureMultisigSubsignature = exports.TransactionSignatureMultisig = exports.TransactionSignatureLogicsig = exports.TransactionSignature = exports.TransactionResponse = exports.TransactionPayment = exports.TransactionKeyreg = exports.TransactionHeartbeat = exports.TransactionAssetTransfer = exports.TransactionAssetFreeze = exports.TransactionAssetConfig = exports.TransactionApplication = exports.Transaction = void 0;
|
|
6
|
+
exports.StateProofVerifier = exports.StateProofTracking = exports.StateProofSignature = exports.StateProofSigSlot = exports.StateProofReveal = exports.StateProofParticipant = exports.StateProofFields = exports.ResourceRef = exports.ParticipationUpdates = exports.MiniAssetHolding = exports.MerkleArrayProof = exports.LocalsRef = exports.IndexerStateProofMessage = exports.HoldingRef = exports.HealthCheck = exports.HbProofFields = exports.HashFactory = exports.EvalDeltaKeyValue = exports.EvalDelta = exports.ErrorResponse = exports.BoxesResponse = exports.BoxReference = exports.BoxDescriptor = exports.Box = exports.BlockUpgradeVote = exports.BlockUpgradeState = exports.BlockRewards = exports.BlockHeadersResponse = exports.Block = exports.AssetsResponse = exports.AssetResponse = exports.AssetParams = exports.AssetHoldingsResponse = exports.AssetHolding = exports.AssetBalancesResponse = exports.Asset = exports.ApplicationsResponse = exports.ApplicationStateSchema = exports.ApplicationResponse = exports.ApplicationParams = exports.ApplicationLogsResponse = exports.ApplicationLogData = exports.ApplicationLocalStatesResponse = exports.ApplicationLocalState = exports.Application = exports.AccountsResponse = exports.AccountStateDelta = exports.AccountResponse = exports.AccountParticipation = exports.Account = void 0;
|
|
7
|
+
exports.TransactionsResponse = exports.TransactionStateProof = exports.TransactionSignatureMultisigSubsignature = exports.TransactionSignatureMultisig = exports.TransactionSignatureLogicsig = exports.TransactionSignature = exports.TransactionResponse = exports.TransactionPayment = exports.TransactionKeyreg = exports.TransactionHeartbeat = exports.TransactionAssetTransfer = exports.TransactionAssetFreeze = exports.TransactionAssetConfig = exports.TransactionApplication = exports.Transaction = exports.TealValue = exports.TealKeyValue = exports.StateSchema = void 0;
|
|
8
8
|
/* eslint-disable no-use-before-define */
|
|
9
9
|
const utils_js_1 = require("../../../../utils/utils.js");
|
|
10
10
|
const index_js_1 = require("../../../../encoding/schema/index.js");
|
|
@@ -1826,6 +1826,10 @@ class Block {
|
|
|
1826
1826
|
key: 'participation-updates',
|
|
1827
1827
|
valueSchema: new index_js_1.OptionalSchema(ParticipationUpdates.encodingSchema),
|
|
1828
1828
|
omitEmpty: true,
|
|
1829
|
+
}, {
|
|
1830
|
+
key: 'previous-block-hash-512',
|
|
1831
|
+
valueSchema: new index_js_1.OptionalSchema(new index_js_1.ByteArraySchema()),
|
|
1832
|
+
omitEmpty: true,
|
|
1829
1833
|
}, {
|
|
1830
1834
|
key: 'proposer',
|
|
1831
1835
|
valueSchema: new index_js_1.OptionalSchema(new index_js_1.StringSchema()),
|
|
@@ -1846,6 +1850,10 @@ class Block {
|
|
|
1846
1850
|
key: 'transactions',
|
|
1847
1851
|
valueSchema: new index_js_1.OptionalSchema(new index_js_1.ArraySchema(Transaction.encodingSchema)),
|
|
1848
1852
|
omitEmpty: true,
|
|
1853
|
+
}, {
|
|
1854
|
+
key: 'transactions-root-sha512',
|
|
1855
|
+
valueSchema: new index_js_1.OptionalSchema(new index_js_1.ByteArraySchema()),
|
|
1856
|
+
omitEmpty: true,
|
|
1849
1857
|
}, {
|
|
1850
1858
|
key: 'txn-counter',
|
|
1851
1859
|
valueSchema: new index_js_1.OptionalSchema(new index_js_1.Uint64Schema()),
|
|
@@ -1883,11 +1891,15 @@ class Block {
|
|
|
1883
1891
|
* @param bonus - the potential bonus payout for this block.
|
|
1884
1892
|
* @param feesCollected - the sum of all fees paid by transactions in this block.
|
|
1885
1893
|
* @param participationUpdates - Participation account data that needs to be checked/acted on by the network.
|
|
1894
|
+
* @param previousBlockHash512 - (prev512) Previous block hash, using SHA-512.
|
|
1886
1895
|
* @param proposer - the proposer of this block.
|
|
1887
1896
|
* @param proposerPayout - the actual amount transferred to the proposer from the fee sink.
|
|
1888
1897
|
* @param rewards - Fields relating to rewards,
|
|
1889
1898
|
* @param stateProofTracking - Tracks the status of state proofs.
|
|
1890
1899
|
* @param transactions - (txns) list of transactions corresponding to a given round.
|
|
1900
|
+
* @param transactionsRootSha512 - (txn512) TransactionsRootSHA512 is an auxiliary TransactionRoot, built using a
|
|
1901
|
+
* vector commitment instead of a merkle tree, and SHA512 hash function instead of
|
|
1902
|
+
* the default SHA512_256.
|
|
1891
1903
|
* @param txnCounter - (tc) TxnCounter counts the number of transactions committed in the ledger, from
|
|
1892
1904
|
* the time at which support for this feature was introduced.
|
|
1893
1905
|
* Specifically, TxnCounter is the number of the next transaction that will be
|
|
@@ -1896,7 +1908,7 @@ class Block {
|
|
|
1896
1908
|
* @param upgradeState - Fields relating to a protocol upgrade.
|
|
1897
1909
|
* @param upgradeVote - Fields relating to voting for a protocol upgrade.
|
|
1898
1910
|
*/
|
|
1899
|
-
constructor({ genesisHash, genesisId, previousBlockHash, round, seed, timestamp, transactionsRoot, transactionsRootSha256, bonus, feesCollected, participationUpdates, proposer, proposerPayout, rewards, stateProofTracking, transactions, txnCounter, upgradeState, upgradeVote, }) {
|
|
1911
|
+
constructor({ genesisHash, genesisId, previousBlockHash, round, seed, timestamp, transactionsRoot, transactionsRootSha256, bonus, feesCollected, participationUpdates, previousBlockHash512, proposer, proposerPayout, rewards, stateProofTracking, transactions, transactionsRootSha512, txnCounter, upgradeState, upgradeVote, }) {
|
|
1900
1912
|
this.genesisHash =
|
|
1901
1913
|
typeof genesisHash === 'string'
|
|
1902
1914
|
? (0, binarydata_js_1.base64ToBytes)(genesisHash)
|
|
@@ -1924,6 +1936,10 @@ class Block {
|
|
|
1924
1936
|
? undefined
|
|
1925
1937
|
: (0, utils_js_1.ensureSafeInteger)(feesCollected);
|
|
1926
1938
|
this.participationUpdates = participationUpdates;
|
|
1939
|
+
this.previousBlockHash512 =
|
|
1940
|
+
typeof previousBlockHash512 === 'string'
|
|
1941
|
+
? (0, binarydata_js_1.base64ToBytes)(previousBlockHash512)
|
|
1942
|
+
: previousBlockHash512;
|
|
1927
1943
|
this.proposer =
|
|
1928
1944
|
typeof proposer === 'string' ? address_js_1.Address.fromString(proposer) : proposer;
|
|
1929
1945
|
this.proposerPayout =
|
|
@@ -1933,6 +1949,10 @@ class Block {
|
|
|
1933
1949
|
this.rewards = rewards;
|
|
1934
1950
|
this.stateProofTracking = stateProofTracking;
|
|
1935
1951
|
this.transactions = transactions;
|
|
1952
|
+
this.transactionsRootSha512 =
|
|
1953
|
+
typeof transactionsRootSha512 === 'string'
|
|
1954
|
+
? (0, binarydata_js_1.base64ToBytes)(transactionsRootSha512)
|
|
1955
|
+
: transactionsRootSha512;
|
|
1936
1956
|
this.txnCounter =
|
|
1937
1957
|
typeof txnCounter === 'undefined'
|
|
1938
1958
|
? undefined
|
|
@@ -1962,6 +1982,7 @@ class Block {
|
|
|
1962
1982
|
? this.participationUpdates.toEncodingData()
|
|
1963
1983
|
: undefined,
|
|
1964
1984
|
],
|
|
1985
|
+
['previous-block-hash-512', this.previousBlockHash512],
|
|
1965
1986
|
[
|
|
1966
1987
|
'proposer',
|
|
1967
1988
|
typeof this.proposer !== 'undefined'
|
|
@@ -1987,6 +2008,7 @@ class Block {
|
|
|
1987
2008
|
? this.transactions.map((v) => v.toEncodingData())
|
|
1988
2009
|
: undefined,
|
|
1989
2010
|
],
|
|
2011
|
+
['transactions-root-sha512', this.transactionsRootSha512],
|
|
1990
2012
|
['txn-counter', this.txnCounter],
|
|
1991
2013
|
[
|
|
1992
2014
|
'upgrade-state',
|
|
@@ -2020,6 +2042,7 @@ class Block {
|
|
|
2020
2042
|
participationUpdates: typeof data.get('participation-updates') !== 'undefined'
|
|
2021
2043
|
? ParticipationUpdates.fromEncodingData(data.get('participation-updates'))
|
|
2022
2044
|
: undefined,
|
|
2045
|
+
previousBlockHash512: data.get('previous-block-hash-512'),
|
|
2023
2046
|
proposer: data.get('proposer'),
|
|
2024
2047
|
proposerPayout: data.get('proposer-payout'),
|
|
2025
2048
|
rewards: typeof data.get('rewards') !== 'undefined'
|
|
@@ -2035,6 +2058,7 @@ class Block {
|
|
|
2035
2058
|
.get('transactions')
|
|
2036
2059
|
.map((v) => Transaction.fromEncodingData(v))
|
|
2037
2060
|
: undefined,
|
|
2061
|
+
transactionsRootSha512: data.get('transactions-root-sha512'),
|
|
2038
2062
|
txnCounter: data.get('txn-counter'),
|
|
2039
2063
|
upgradeState: typeof data.get('upgrade-state') !== 'undefined'
|
|
2040
2064
|
? BlockUpgradeState.fromEncodingData(data.get('upgrade-state'))
|
|
@@ -2858,6 +2882,48 @@ class HealthCheck {
|
|
|
2858
2882
|
}
|
|
2859
2883
|
}
|
|
2860
2884
|
exports.HealthCheck = HealthCheck;
|
|
2885
|
+
/**
|
|
2886
|
+
* HoldingRef names a holding by referring to an Address and Asset it belongs to.
|
|
2887
|
+
*/
|
|
2888
|
+
class HoldingRef {
|
|
2889
|
+
static get encodingSchema() {
|
|
2890
|
+
if (!this.encodingSchemaValue) {
|
|
2891
|
+
this.encodingSchemaValue = new index_js_1.NamedMapSchema([]);
|
|
2892
|
+
this.encodingSchemaValue.pushEntries({ key: 'address', valueSchema: new index_js_1.StringSchema(), omitEmpty: true }, { key: 'asset', valueSchema: new index_js_1.Uint64Schema(), omitEmpty: true });
|
|
2893
|
+
}
|
|
2894
|
+
return this.encodingSchemaValue;
|
|
2895
|
+
}
|
|
2896
|
+
/**
|
|
2897
|
+
* Creates a new `HoldingRef` object.
|
|
2898
|
+
* @param address - (d) Address in access list, or the sender of the transaction.
|
|
2899
|
+
* @param asset - (s) Asset ID for asset in access list.
|
|
2900
|
+
*/
|
|
2901
|
+
constructor({ address, asset, }) {
|
|
2902
|
+
this.address =
|
|
2903
|
+
typeof address === 'string' ? address_js_1.Address.fromString(address) : address;
|
|
2904
|
+
this.asset = (0, utils_js_1.ensureSafeInteger)(asset);
|
|
2905
|
+
}
|
|
2906
|
+
// eslint-disable-next-line class-methods-use-this
|
|
2907
|
+
getEncodingSchema() {
|
|
2908
|
+
return HoldingRef.encodingSchema;
|
|
2909
|
+
}
|
|
2910
|
+
toEncodingData() {
|
|
2911
|
+
return new Map([
|
|
2912
|
+
['address', this.address.toString()],
|
|
2913
|
+
['asset', this.asset],
|
|
2914
|
+
]);
|
|
2915
|
+
}
|
|
2916
|
+
static fromEncodingData(data) {
|
|
2917
|
+
if (!(data instanceof Map)) {
|
|
2918
|
+
throw new Error(`Invalid decoded HoldingRef: ${data}`);
|
|
2919
|
+
}
|
|
2920
|
+
return new HoldingRef({
|
|
2921
|
+
address: data.get('address'),
|
|
2922
|
+
asset: data.get('asset'),
|
|
2923
|
+
});
|
|
2924
|
+
}
|
|
2925
|
+
}
|
|
2926
|
+
exports.HoldingRef = HoldingRef;
|
|
2861
2927
|
class IndexerStateProofMessage {
|
|
2862
2928
|
static get encodingSchema() {
|
|
2863
2929
|
if (!this.encodingSchemaValue) {
|
|
@@ -2943,6 +3009,49 @@ class IndexerStateProofMessage {
|
|
|
2943
3009
|
}
|
|
2944
3010
|
}
|
|
2945
3011
|
exports.IndexerStateProofMessage = IndexerStateProofMessage;
|
|
3012
|
+
/**
|
|
3013
|
+
* LocalsRef names a local state by referring to an Address and App it belongs to.
|
|
3014
|
+
*/
|
|
3015
|
+
class LocalsRef {
|
|
3016
|
+
static get encodingSchema() {
|
|
3017
|
+
if (!this.encodingSchemaValue) {
|
|
3018
|
+
this.encodingSchemaValue = new index_js_1.NamedMapSchema([]);
|
|
3019
|
+
this.encodingSchemaValue.pushEntries({ key: 'address', valueSchema: new index_js_1.StringSchema(), omitEmpty: true }, { key: 'app', valueSchema: new index_js_1.Uint64Schema(), omitEmpty: true });
|
|
3020
|
+
}
|
|
3021
|
+
return this.encodingSchemaValue;
|
|
3022
|
+
}
|
|
3023
|
+
/**
|
|
3024
|
+
* Creates a new `LocalsRef` object.
|
|
3025
|
+
* @param address - (d) Address in access list, or the sender of the transaction.
|
|
3026
|
+
* @param app - (p) Application ID for app in access list, or zero if referring to the called
|
|
3027
|
+
* application.
|
|
3028
|
+
*/
|
|
3029
|
+
constructor({ address, app, }) {
|
|
3030
|
+
this.address =
|
|
3031
|
+
typeof address === 'string' ? address_js_1.Address.fromString(address) : address;
|
|
3032
|
+
this.app = (0, utils_js_1.ensureSafeInteger)(app);
|
|
3033
|
+
}
|
|
3034
|
+
// eslint-disable-next-line class-methods-use-this
|
|
3035
|
+
getEncodingSchema() {
|
|
3036
|
+
return LocalsRef.encodingSchema;
|
|
3037
|
+
}
|
|
3038
|
+
toEncodingData() {
|
|
3039
|
+
return new Map([
|
|
3040
|
+
['address', this.address.toString()],
|
|
3041
|
+
['app', this.app],
|
|
3042
|
+
]);
|
|
3043
|
+
}
|
|
3044
|
+
static fromEncodingData(data) {
|
|
3045
|
+
if (!(data instanceof Map)) {
|
|
3046
|
+
throw new Error(`Invalid decoded LocalsRef: ${data}`);
|
|
3047
|
+
}
|
|
3048
|
+
return new LocalsRef({
|
|
3049
|
+
address: data.get('address'),
|
|
3050
|
+
app: data.get('app'),
|
|
3051
|
+
});
|
|
3052
|
+
}
|
|
3053
|
+
}
|
|
3054
|
+
exports.LocalsRef = LocalsRef;
|
|
2946
3055
|
class MerkleArrayProof {
|
|
2947
3056
|
static get encodingSchema() {
|
|
2948
3057
|
if (!this.encodingSchemaValue) {
|
|
@@ -3132,6 +3241,119 @@ class ParticipationUpdates {
|
|
|
3132
3241
|
}
|
|
3133
3242
|
}
|
|
3134
3243
|
exports.ParticipationUpdates = ParticipationUpdates;
|
|
3244
|
+
/**
|
|
3245
|
+
* ResourceRef names a single resource. Only one of the fields should be set.
|
|
3246
|
+
*/
|
|
3247
|
+
class ResourceRef {
|
|
3248
|
+
static get encodingSchema() {
|
|
3249
|
+
if (!this.encodingSchemaValue) {
|
|
3250
|
+
this.encodingSchemaValue = new index_js_1.NamedMapSchema([]);
|
|
3251
|
+
this.encodingSchemaValue.pushEntries({
|
|
3252
|
+
key: 'address',
|
|
3253
|
+
valueSchema: new index_js_1.OptionalSchema(new index_js_1.StringSchema()),
|
|
3254
|
+
omitEmpty: true,
|
|
3255
|
+
}, {
|
|
3256
|
+
key: 'application-id',
|
|
3257
|
+
valueSchema: new index_js_1.OptionalSchema(new index_js_1.Uint64Schema()),
|
|
3258
|
+
omitEmpty: true,
|
|
3259
|
+
}, {
|
|
3260
|
+
key: 'asset-id',
|
|
3261
|
+
valueSchema: new index_js_1.OptionalSchema(new index_js_1.Uint64Schema()),
|
|
3262
|
+
omitEmpty: true,
|
|
3263
|
+
}, {
|
|
3264
|
+
key: 'box',
|
|
3265
|
+
valueSchema: new index_js_1.OptionalSchema(BoxReference.encodingSchema),
|
|
3266
|
+
omitEmpty: true,
|
|
3267
|
+
}, {
|
|
3268
|
+
key: 'holding',
|
|
3269
|
+
valueSchema: new index_js_1.OptionalSchema(HoldingRef.encodingSchema),
|
|
3270
|
+
omitEmpty: true,
|
|
3271
|
+
}, {
|
|
3272
|
+
key: 'local',
|
|
3273
|
+
valueSchema: new index_js_1.OptionalSchema(LocalsRef.encodingSchema),
|
|
3274
|
+
omitEmpty: true,
|
|
3275
|
+
});
|
|
3276
|
+
}
|
|
3277
|
+
return this.encodingSchemaValue;
|
|
3278
|
+
}
|
|
3279
|
+
/**
|
|
3280
|
+
* Creates a new `ResourceRef` object.
|
|
3281
|
+
* @param address - (d) Account whose balance record is accessible by the executing ApprovalProgram
|
|
3282
|
+
* or ClearStateProgram.
|
|
3283
|
+
* @param applicationId - (p) Application id whose GlobalState may be read by the executing
|
|
3284
|
+
* ApprovalProgram or ClearStateProgram.
|
|
3285
|
+
* @param assetId - (s) Asset whose AssetParams may be read by the executing
|
|
3286
|
+
* ApprovalProgram or ClearStateProgram.
|
|
3287
|
+
* @param box - BoxReference names a box by its name and the application ID it belongs to.
|
|
3288
|
+
* @param holding - HoldingRef names a holding by referring to an Address and Asset it belongs to.
|
|
3289
|
+
* @param local - LocalsRef names a local state by referring to an Address and App it belongs to.
|
|
3290
|
+
*/
|
|
3291
|
+
constructor({ address, applicationId, assetId, box, holding, local, }) {
|
|
3292
|
+
this.address =
|
|
3293
|
+
typeof address === 'string' ? address_js_1.Address.fromString(address) : address;
|
|
3294
|
+
this.applicationId =
|
|
3295
|
+
typeof applicationId === 'undefined'
|
|
3296
|
+
? undefined
|
|
3297
|
+
: (0, utils_js_1.ensureSafeInteger)(applicationId);
|
|
3298
|
+
this.assetId =
|
|
3299
|
+
typeof assetId === 'undefined' ? undefined : (0, utils_js_1.ensureSafeInteger)(assetId);
|
|
3300
|
+
this.box = box;
|
|
3301
|
+
this.holding = holding;
|
|
3302
|
+
this.local = local;
|
|
3303
|
+
}
|
|
3304
|
+
// eslint-disable-next-line class-methods-use-this
|
|
3305
|
+
getEncodingSchema() {
|
|
3306
|
+
return ResourceRef.encodingSchema;
|
|
3307
|
+
}
|
|
3308
|
+
toEncodingData() {
|
|
3309
|
+
return new Map([
|
|
3310
|
+
[
|
|
3311
|
+
'address',
|
|
3312
|
+
typeof this.address !== 'undefined'
|
|
3313
|
+
? this.address.toString()
|
|
3314
|
+
: undefined,
|
|
3315
|
+
],
|
|
3316
|
+
['application-id', this.applicationId],
|
|
3317
|
+
['asset-id', this.assetId],
|
|
3318
|
+
[
|
|
3319
|
+
'box',
|
|
3320
|
+
typeof this.box !== 'undefined' ? this.box.toEncodingData() : undefined,
|
|
3321
|
+
],
|
|
3322
|
+
[
|
|
3323
|
+
'holding',
|
|
3324
|
+
typeof this.holding !== 'undefined'
|
|
3325
|
+
? this.holding.toEncodingData()
|
|
3326
|
+
: undefined,
|
|
3327
|
+
],
|
|
3328
|
+
[
|
|
3329
|
+
'local',
|
|
3330
|
+
typeof this.local !== 'undefined'
|
|
3331
|
+
? this.local.toEncodingData()
|
|
3332
|
+
: undefined,
|
|
3333
|
+
],
|
|
3334
|
+
]);
|
|
3335
|
+
}
|
|
3336
|
+
static fromEncodingData(data) {
|
|
3337
|
+
if (!(data instanceof Map)) {
|
|
3338
|
+
throw new Error(`Invalid decoded ResourceRef: ${data}`);
|
|
3339
|
+
}
|
|
3340
|
+
return new ResourceRef({
|
|
3341
|
+
address: data.get('address'),
|
|
3342
|
+
applicationId: data.get('application-id'),
|
|
3343
|
+
assetId: data.get('asset-id'),
|
|
3344
|
+
box: typeof data.get('box') !== 'undefined'
|
|
3345
|
+
? BoxReference.fromEncodingData(data.get('box'))
|
|
3346
|
+
: undefined,
|
|
3347
|
+
holding: typeof data.get('holding') !== 'undefined'
|
|
3348
|
+
? HoldingRef.fromEncodingData(data.get('holding'))
|
|
3349
|
+
: undefined,
|
|
3350
|
+
local: typeof data.get('local') !== 'undefined'
|
|
3351
|
+
? LocalsRef.fromEncodingData(data.get('local'))
|
|
3352
|
+
: undefined,
|
|
3353
|
+
});
|
|
3354
|
+
}
|
|
3355
|
+
}
|
|
3356
|
+
exports.ResourceRef = ResourceRef;
|
|
3135
3357
|
/**
|
|
3136
3358
|
* (sp) represents a state proof.
|
|
3137
3359
|
* Definition:
|
|
@@ -4263,6 +4485,10 @@ class TransactionApplication {
|
|
|
4263
4485
|
key: 'application-id',
|
|
4264
4486
|
valueSchema: new index_js_1.Uint64Schema(),
|
|
4265
4487
|
omitEmpty: true,
|
|
4488
|
+
}, {
|
|
4489
|
+
key: 'access',
|
|
4490
|
+
valueSchema: new index_js_1.OptionalSchema(new index_js_1.ArraySchema(ResourceRef.encodingSchema)),
|
|
4491
|
+
omitEmpty: true,
|
|
4266
4492
|
}, {
|
|
4267
4493
|
key: 'accounts',
|
|
4268
4494
|
valueSchema: new index_js_1.OptionalSchema(new index_js_1.ArraySchema(new index_js_1.StringSchema())),
|
|
@@ -4318,6 +4544,9 @@ class TransactionApplication {
|
|
|
4318
4544
|
/**
|
|
4319
4545
|
* Creates a new `TransactionApplication` object.
|
|
4320
4546
|
* @param applicationId - (apid) ID of the application being configured or empty if creating.
|
|
4547
|
+
* @param access - (al) Access unifies `accounts`, `foreign-apps`, `foreign-assets`, and
|
|
4548
|
+
* `box-references` under a single list. If access is non-empty, these lists must
|
|
4549
|
+
* be empty. If access is empty, those lists may be non-empty.
|
|
4321
4550
|
* @param accounts - (apat) List of accounts in addition to the sender that may be accessed from the
|
|
4322
4551
|
* application's approval-program and clear-state-program.
|
|
4323
4552
|
* @param applicationArgs - (apaa) transaction specific arguments accessed from the application's
|
|
@@ -4358,8 +4587,9 @@ class TransactionApplication {
|
|
|
4358
4587
|
* @param rejectVersion - (aprv) the lowest application version for which this transaction should
|
|
4359
4588
|
* immediately fail. 0 indicates that no version check should be performed.
|
|
4360
4589
|
*/
|
|
4361
|
-
constructor({ applicationId, accounts, applicationArgs, approvalProgram, boxReferences, clearStateProgram, extraProgramPages, foreignApps, foreignAssets, globalStateSchema, localStateSchema, onCompletion, rejectVersion, }) {
|
|
4590
|
+
constructor({ applicationId, access, accounts, applicationArgs, approvalProgram, boxReferences, clearStateProgram, extraProgramPages, foreignApps, foreignAssets, globalStateSchema, localStateSchema, onCompletion, rejectVersion, }) {
|
|
4362
4591
|
this.applicationId = (0, utils_js_1.ensureBigInt)(applicationId);
|
|
4592
|
+
this.access = access;
|
|
4363
4593
|
this.accounts =
|
|
4364
4594
|
typeof accounts !== 'undefined'
|
|
4365
4595
|
? accounts.map((addr) => typeof addr === 'string' ? address_js_1.Address.fromString(addr) : addr)
|
|
@@ -4401,6 +4631,12 @@ class TransactionApplication {
|
|
|
4401
4631
|
toEncodingData() {
|
|
4402
4632
|
return new Map([
|
|
4403
4633
|
['application-id', this.applicationId],
|
|
4634
|
+
[
|
|
4635
|
+
'access',
|
|
4636
|
+
typeof this.access !== 'undefined'
|
|
4637
|
+
? this.access.map((v) => v.toEncodingData())
|
|
4638
|
+
: undefined,
|
|
4639
|
+
],
|
|
4404
4640
|
[
|
|
4405
4641
|
'accounts',
|
|
4406
4642
|
typeof this.accounts !== 'undefined'
|
|
@@ -4441,6 +4677,11 @@ class TransactionApplication {
|
|
|
4441
4677
|
}
|
|
4442
4678
|
return new TransactionApplication({
|
|
4443
4679
|
applicationId: data.get('application-id'),
|
|
4680
|
+
access: typeof data.get('access') !== 'undefined'
|
|
4681
|
+
? data
|
|
4682
|
+
.get('access')
|
|
4683
|
+
.map((v) => ResourceRef.fromEncodingData(v))
|
|
4684
|
+
: undefined,
|
|
4444
4685
|
accounts: data.get('accounts'),
|
|
4445
4686
|
applicationArgs: data.get('application-args'),
|
|
4446
4687
|
approvalProgram: data.get('approval-program'),
|
|
@@ -4985,7 +5226,7 @@ class TransactionSignature {
|
|
|
4985
5226
|
* @param logicsig - (lsig) Programatic transaction signature.
|
|
4986
5227
|
* Definition:
|
|
4987
5228
|
* data/transactions/logicsig.go
|
|
4988
|
-
* @param multisig -
|
|
5229
|
+
* @param multisig - structure holding multiple subsignatures.
|
|
4989
5230
|
* Definition:
|
|
4990
5231
|
* crypto/multisig.go : MultisigSig
|
|
4991
5232
|
* @param sig - (sig) Standard ed25519 signature.
|
|
@@ -5045,6 +5286,10 @@ class TransactionSignatureLogicsig {
|
|
|
5045
5286
|
key: 'args',
|
|
5046
5287
|
valueSchema: new index_js_1.OptionalSchema(new index_js_1.ArraySchema(new index_js_1.ByteArraySchema())),
|
|
5047
5288
|
omitEmpty: true,
|
|
5289
|
+
}, {
|
|
5290
|
+
key: 'logic-multisig-signature',
|
|
5291
|
+
valueSchema: new index_js_1.OptionalSchema(TransactionSignatureMultisig.encodingSchema),
|
|
5292
|
+
omitEmpty: true,
|
|
5048
5293
|
}, {
|
|
5049
5294
|
key: 'multisig-signature',
|
|
5050
5295
|
valueSchema: new index_js_1.OptionalSchema(TransactionSignatureMultisig.encodingSchema),
|
|
@@ -5062,14 +5307,18 @@ class TransactionSignatureLogicsig {
|
|
|
5062
5307
|
* @param logic - (l) Program signed by a signature or multi signature, or hashed to be the
|
|
5063
5308
|
* address of ana ccount. Base64 encoded TEAL program.
|
|
5064
5309
|
* @param args - (arg) Logic arguments, base64 encoded.
|
|
5065
|
-
* @param
|
|
5310
|
+
* @param logicMultisigSignature - structure holding multiple subsignatures.
|
|
5311
|
+
* Definition:
|
|
5312
|
+
* crypto/multisig.go : MultisigSig
|
|
5313
|
+
* @param multisigSignature - structure holding multiple subsignatures.
|
|
5066
5314
|
* Definition:
|
|
5067
5315
|
* crypto/multisig.go : MultisigSig
|
|
5068
5316
|
* @param signature - (sig) ed25519 signature.
|
|
5069
5317
|
*/
|
|
5070
|
-
constructor({ logic, args, multisigSignature, signature, }) {
|
|
5318
|
+
constructor({ logic, args, logicMultisigSignature, multisigSignature, signature, }) {
|
|
5071
5319
|
this.logic = typeof logic === 'string' ? (0, binarydata_js_1.base64ToBytes)(logic) : logic;
|
|
5072
5320
|
this.args = args;
|
|
5321
|
+
this.logicMultisigSignature = logicMultisigSignature;
|
|
5073
5322
|
this.multisigSignature = multisigSignature;
|
|
5074
5323
|
this.signature =
|
|
5075
5324
|
typeof signature === 'string' ? (0, binarydata_js_1.base64ToBytes)(signature) : signature;
|
|
@@ -5082,6 +5331,12 @@ class TransactionSignatureLogicsig {
|
|
|
5082
5331
|
return new Map([
|
|
5083
5332
|
['logic', this.logic],
|
|
5084
5333
|
['args', this.args],
|
|
5334
|
+
[
|
|
5335
|
+
'logic-multisig-signature',
|
|
5336
|
+
typeof this.logicMultisigSignature !== 'undefined'
|
|
5337
|
+
? this.logicMultisigSignature.toEncodingData()
|
|
5338
|
+
: undefined,
|
|
5339
|
+
],
|
|
5085
5340
|
[
|
|
5086
5341
|
'multisig-signature',
|
|
5087
5342
|
typeof this.multisigSignature !== 'undefined'
|
|
@@ -5098,6 +5353,9 @@ class TransactionSignatureLogicsig {
|
|
|
5098
5353
|
return new TransactionSignatureLogicsig({
|
|
5099
5354
|
logic: data.get('logic'),
|
|
5100
5355
|
args: data.get('args'),
|
|
5356
|
+
logicMultisigSignature: typeof data.get('logic-multisig-signature') !== 'undefined'
|
|
5357
|
+
? TransactionSignatureMultisig.fromEncodingData(data.get('logic-multisig-signature'))
|
|
5358
|
+
: undefined,
|
|
5101
5359
|
multisigSignature: typeof data.get('multisig-signature') !== 'undefined'
|
|
5102
5360
|
? TransactionSignatureMultisig.fromEncodingData(data.get('multisig-signature'))
|
|
5103
5361
|
: undefined,
|
|
@@ -5107,7 +5365,7 @@ class TransactionSignatureLogicsig {
|
|
|
5107
5365
|
}
|
|
5108
5366
|
exports.TransactionSignatureLogicsig = TransactionSignatureLogicsig;
|
|
5109
5367
|
/**
|
|
5110
|
-
*
|
|
5368
|
+
* structure holding multiple subsignatures.
|
|
5111
5369
|
* Definition:
|
|
5112
5370
|
* crypto/multisig.go : MultisigSig
|
|
5113
5371
|
*/
|