algosdk 3.3.0 → 3.3.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/README.md +4 -4
- package/dist/browser/algosdk.min.js +1 -1
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/client/v2/algod/getApplicationBoxes.js +1 -58
- package/dist/cjs/client/v2/algod/getApplicationBoxes.js.map +1 -1
- package/dist/cjs/client/v2/algod/models/types.js +47 -29
- package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
- package/dist/esm/client/v2/algod/getApplicationBoxes.js +1 -58
- package/dist/esm/client/v2/algod/getApplicationBoxes.js.map +1 -1
- package/dist/esm/client/v2/algod/models/types.js +44 -27
- package/dist/esm/client/v2/algod/models/types.js.map +1 -1
- package/dist/types/client/v2/algod/getApplicationBoxes.d.ts +1 -49
- package/dist/types/client/v2/algod/models/types.d.ts +29 -22
- package/package.json +1 -1
- package/src/client/v2/algod/getApplicationBoxes.ts +1 -61
- package/src/client/v2/algod/models/types.ts +66 -60
|
@@ -12,7 +12,7 @@ const types_js_1 = require("./models/types.js");
|
|
|
12
12
|
* #### Example
|
|
13
13
|
* ```typescript
|
|
14
14
|
* const index = 60553466;
|
|
15
|
-
* const boxesResponse = await algodClient.getApplicationBoxes(index).
|
|
15
|
+
* const boxesResponse = await algodClient.getApplicationBoxes(index).max(3).do();
|
|
16
16
|
* const boxNames = boxesResponse.boxes.map(box => box.name);
|
|
17
17
|
* ```
|
|
18
18
|
*
|
|
@@ -51,63 +51,6 @@ class GetApplicationBoxes extends jsonrequest_js_1.default {
|
|
|
51
51
|
this.query.max = max;
|
|
52
52
|
return this;
|
|
53
53
|
}
|
|
54
|
-
/**
|
|
55
|
-
* A box name prefix, in the goal app call arg form 'encoding:value'. For ints, use the form 'int:1234'. For raw bytes, use the form 'b64:A=='. For printable strings, use the form 'str:hello'. For addresses, use the form 'addr:XYZ...'.
|
|
56
|
-
*
|
|
57
|
-
* #### Example
|
|
58
|
-
* ```typescript
|
|
59
|
-
* const prefix = 'int:1234';
|
|
60
|
-
* const boxesResult = await algodClient
|
|
61
|
-
* .GetApplicationBoxes(1234)
|
|
62
|
-
* .prefix(prefix)
|
|
63
|
-
* .do();
|
|
64
|
-
* ```
|
|
65
|
-
*
|
|
66
|
-
* @param prefix - the box name prefix in the form 'encoding:value'
|
|
67
|
-
* @category query
|
|
68
|
-
*/
|
|
69
|
-
prefix(prefix) {
|
|
70
|
-
this.query.prefix = prefix;
|
|
71
|
-
return this;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* A box name, in the goal app call arg form 'encoding:value'. When provided, the returned boxes begin (lexographically) with the supplied name. Callers may implement pagination by reinvoking the endpoint with the token from a previous call's next-token.
|
|
75
|
-
*
|
|
76
|
-
* #### Example
|
|
77
|
-
* ```typescript
|
|
78
|
-
* const next = 'int:1234';
|
|
79
|
-
* const boxesResult = await algodClient
|
|
80
|
-
* .GetApplicationBoxes(1234)
|
|
81
|
-
* .next(next)
|
|
82
|
-
* .do();
|
|
83
|
-
* ```
|
|
84
|
-
*
|
|
85
|
-
* @param next - the next box name for pagination, in the goal app call arg form 'encoding:value'
|
|
86
|
-
* @category query
|
|
87
|
-
*/
|
|
88
|
-
next(next) {
|
|
89
|
-
this.query.next = next;
|
|
90
|
-
return this;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* If true, box values will be returned.
|
|
94
|
-
*
|
|
95
|
-
* #### Example
|
|
96
|
-
* ```typescript
|
|
97
|
-
* const values = true;
|
|
98
|
-
* const boxesResult = await algodClient
|
|
99
|
-
* .GetApplicationBoxes(1234)
|
|
100
|
-
* .values(values)
|
|
101
|
-
* .do();
|
|
102
|
-
* ```
|
|
103
|
-
*
|
|
104
|
-
* @param values - if true, box values will be returned
|
|
105
|
-
* @category query
|
|
106
|
-
*/
|
|
107
|
-
values(values) {
|
|
108
|
-
this.query.values = values;
|
|
109
|
-
return this;
|
|
110
|
-
}
|
|
111
54
|
// eslint-disable-next-line class-methods-use-this
|
|
112
55
|
prepare(response) {
|
|
113
56
|
return (0, encoding_js_1.decodeJSON)(response.getJSONText(), types_js_1.BoxesResponse);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getApplicationBoxes.js","sourceRoot":"","sources":["../../../../../src/client/v2/algod/getApplicationBoxes.ts"],"names":[],"mappings":";;;;;AAAA,uEAA4C;AAE5C,+DAA2D;AAC3D,gDAAkD;AAElD;;;;;;;;;;;;;GAaG;AACH,MAAqB,mBAAoB,SAAQ,wBAA0B;IAGzE,YAAY,CAAa,EAAE,KAAsB;QAC/C,KAAK,CAAC,CAAC,CAAC,CAAC;QACT,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,IAAI;QACF,OAAO,oBAAoB,IAAI,CAAC,KAAK,QAAQ,CAAC;IAChD,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,GAAG,CAAC,GAAW;QACb,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"getApplicationBoxes.js","sourceRoot":"","sources":["../../../../../src/client/v2/algod/getApplicationBoxes.ts"],"names":[],"mappings":";;;;;AAAA,uEAA4C;AAE5C,+DAA2D;AAC3D,gDAAkD;AAElD;;;;;;;;;;;;;GAaG;AACH,MAAqB,mBAAoB,SAAQ,wBAA0B;IAGzE,YAAY,CAAa,EAAE,KAAsB;QAC/C,KAAK,CAAC,CAAC,CAAC,CAAC;QACT,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,IAAI;QACF,OAAO,oBAAoB,IAAI,CAAC,KAAK,QAAQ,CAAC;IAChD,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,GAAG,CAAC,GAAW;QACb,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,kDAAkD;IAClD,OAAO,CAAC,QAA4B;QAClC,OAAO,IAAA,wBAAU,EAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,wBAAa,CAAC,CAAC;IAC3D,CAAC;CACF;AAxCD,sCAwCC"}
|
|
@@ -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.Version = exports.TransactionProofResponse = exports.TransactionParametersResponse = exports.TransactionGroupLedgerStateDeltasForRoundResponse = exports.TealValue = exports.TealKeyValue = exports.SupplyResponse = exports.StateProofMessage = exports.StateProof = exports.SimulationTransactionExecTrace = exports.SimulationOpcodeTraceUnit = exports.SimulationEvalOverrides = exports.SimulateUnnamedResourcesAccessed = exports.SimulateTransactionResult = exports.SimulateTransactionGroupResult = exports.SimulateTraceConfig = exports.SimulateResponse = exports.SimulateRequestTransactionGroup = exports.SimulateRequest = exports.SimulateInitialStates = exports.ScratchChange = void 0;
|
|
6
|
+
exports.PendingTransactionsResponse = exports.PendingTransactionResponse = exports.NodeStatusResponse = exports.LightBlockHeaderProof = exports.LedgerStateDeltaForTransactionGroup = exports.GetSyncRoundResponse = exports.GetBlockTimeStampOffsetResponse = exports.GenesisAllocation = exports.Genesis = exports.EvalDeltaKeyValue = exports.EvalDelta = exports.ErrorResponse = exports.DryrunTxnResult = exports.DryrunState = exports.DryrunSource = exports.DryrunResponse = exports.DryrunRequest = exports.DisassembleResponse = exports.CompileResponse = exports.BuildVersion = exports.BoxesResponse = exports.BoxReference = exports.BoxDescriptor = exports.Box = exports.BlockTxidsResponse = exports.BlockResponse = exports.BlockLogsResponse = exports.BlockHashResponse = exports.AvmValue = exports.AvmKeyValue = exports.AssetParams = exports.AssetHoldingReference = exports.AssetHolding = exports.Asset = exports.ApplicationStateSchema = exports.ApplicationStateOperation = exports.ApplicationParams = exports.ApplicationLocalState = exports.ApplicationLocalReference = exports.ApplicationKVStorage = exports.ApplicationInitialStates = exports.Application = exports.AppCallLogs = exports.AccountStateDelta = exports.AccountParticipation = exports.AccountAssetsInformationResponse = exports.AccountAssetResponse = exports.AccountAssetHolding = exports.AccountApplicationResponse = exports.Account = void 0;
|
|
7
|
+
exports.Version = exports.TransactionProofResponse = exports.TransactionParametersResponse = exports.TransactionGroupLedgerStateDeltasForRoundResponse = exports.TealValue = exports.TealKeyValue = exports.SupplyResponse = exports.StateProofMessage = exports.StateProof = exports.SimulationTransactionExecTrace = exports.SimulationOpcodeTraceUnit = exports.SimulationEvalOverrides = exports.SimulateUnnamedResourcesAccessed = exports.SimulateTransactionResult = exports.SimulateTransactionGroupResult = exports.SimulateTraceConfig = exports.SimulateResponse = exports.SimulateRequestTransactionGroup = exports.SimulateRequest = exports.SimulateInitialStates = exports.ScratchChange = exports.PostTransactionsResponse = 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");
|
|
@@ -1920,15 +1920,7 @@ class Box {
|
|
|
1920
1920
|
static get encodingSchema() {
|
|
1921
1921
|
if (!this.encodingSchemaValue) {
|
|
1922
1922
|
this.encodingSchemaValue = new index_js_1.NamedMapSchema([]);
|
|
1923
|
-
this.encodingSchemaValue.pushEntries({ key: 'name', valueSchema: new index_js_1.ByteArraySchema(), omitEmpty: true }, {
|
|
1924
|
-
key: 'round',
|
|
1925
|
-
valueSchema: new index_js_1.OptionalSchema(new index_js_1.Uint64Schema()),
|
|
1926
|
-
omitEmpty: true,
|
|
1927
|
-
}, {
|
|
1928
|
-
key: 'value',
|
|
1929
|
-
valueSchema: new index_js_1.OptionalSchema(new index_js_1.ByteArraySchema()),
|
|
1930
|
-
omitEmpty: true,
|
|
1931
|
-
});
|
|
1923
|
+
this.encodingSchemaValue.pushEntries({ key: 'name', valueSchema: new index_js_1.ByteArraySchema(), omitEmpty: true }, { key: 'round', valueSchema: new index_js_1.Uint64Schema(), omitEmpty: true }, { key: 'value', valueSchema: new index_js_1.ByteArraySchema(), omitEmpty: true });
|
|
1932
1924
|
}
|
|
1933
1925
|
return this.encodingSchemaValue;
|
|
1934
1926
|
}
|
|
@@ -1940,7 +1932,7 @@ class Box {
|
|
|
1940
1932
|
*/
|
|
1941
1933
|
constructor({ name, round, value, }) {
|
|
1942
1934
|
this.name = typeof name === 'string' ? (0, binarydata_js_1.base64ToBytes)(name) : name;
|
|
1943
|
-
this.round =
|
|
1935
|
+
this.round = (0, utils_js_1.ensureBigInt)(round);
|
|
1944
1936
|
this.value = typeof value === 'string' ? (0, binarydata_js_1.base64ToBytes)(value) : value;
|
|
1945
1937
|
}
|
|
1946
1938
|
// eslint-disable-next-line class-methods-use-this
|
|
@@ -1966,6 +1958,45 @@ class Box {
|
|
|
1966
1958
|
}
|
|
1967
1959
|
}
|
|
1968
1960
|
exports.Box = Box;
|
|
1961
|
+
/**
|
|
1962
|
+
* Box descriptor describes a Box.
|
|
1963
|
+
*/
|
|
1964
|
+
class BoxDescriptor {
|
|
1965
|
+
static get encodingSchema() {
|
|
1966
|
+
if (!this.encodingSchemaValue) {
|
|
1967
|
+
this.encodingSchemaValue = new index_js_1.NamedMapSchema([]);
|
|
1968
|
+
this.encodingSchemaValue.pushEntries({
|
|
1969
|
+
key: 'name',
|
|
1970
|
+
valueSchema: new index_js_1.ByteArraySchema(),
|
|
1971
|
+
omitEmpty: true,
|
|
1972
|
+
});
|
|
1973
|
+
}
|
|
1974
|
+
return this.encodingSchemaValue;
|
|
1975
|
+
}
|
|
1976
|
+
/**
|
|
1977
|
+
* Creates a new `BoxDescriptor` object.
|
|
1978
|
+
* @param name - Base64 encoded box name
|
|
1979
|
+
*/
|
|
1980
|
+
constructor({ name }) {
|
|
1981
|
+
this.name = typeof name === 'string' ? (0, binarydata_js_1.base64ToBytes)(name) : name;
|
|
1982
|
+
}
|
|
1983
|
+
// eslint-disable-next-line class-methods-use-this
|
|
1984
|
+
getEncodingSchema() {
|
|
1985
|
+
return BoxDescriptor.encodingSchema;
|
|
1986
|
+
}
|
|
1987
|
+
toEncodingData() {
|
|
1988
|
+
return new Map([['name', this.name]]);
|
|
1989
|
+
}
|
|
1990
|
+
static fromEncodingData(data) {
|
|
1991
|
+
if (!(data instanceof Map)) {
|
|
1992
|
+
throw new Error(`Invalid decoded BoxDescriptor: ${data}`);
|
|
1993
|
+
}
|
|
1994
|
+
return new BoxDescriptor({
|
|
1995
|
+
name: data.get('name'),
|
|
1996
|
+
});
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
exports.BoxDescriptor = BoxDescriptor;
|
|
1969
2000
|
/**
|
|
1970
2001
|
* References a box of an application.
|
|
1971
2002
|
*/
|
|
@@ -2008,7 +2039,7 @@ class BoxReference {
|
|
|
2008
2039
|
}
|
|
2009
2040
|
exports.BoxReference = BoxReference;
|
|
2010
2041
|
/**
|
|
2011
|
-
*
|
|
2042
|
+
* * Box names of an application
|
|
2012
2043
|
*/
|
|
2013
2044
|
class BoxesResponse {
|
|
2014
2045
|
static get encodingSchema() {
|
|
@@ -2016,11 +2047,7 @@ class BoxesResponse {
|
|
|
2016
2047
|
this.encodingSchemaValue = new index_js_1.NamedMapSchema([]);
|
|
2017
2048
|
this.encodingSchemaValue.pushEntries({
|
|
2018
2049
|
key: 'boxes',
|
|
2019
|
-
valueSchema: new index_js_1.ArraySchema(
|
|
2020
|
-
omitEmpty: true,
|
|
2021
|
-
}, { key: 'round', valueSchema: new index_js_1.Uint64Schema(), omitEmpty: true }, {
|
|
2022
|
-
key: 'next-token',
|
|
2023
|
-
valueSchema: new index_js_1.OptionalSchema(new index_js_1.StringSchema()),
|
|
2050
|
+
valueSchema: new index_js_1.ArraySchema(BoxDescriptor.encodingSchema),
|
|
2024
2051
|
omitEmpty: true,
|
|
2025
2052
|
});
|
|
2026
2053
|
}
|
|
@@ -2029,14 +2056,9 @@ class BoxesResponse {
|
|
|
2029
2056
|
/**
|
|
2030
2057
|
* Creates a new `BoxesResponse` object.
|
|
2031
2058
|
* @param boxes -
|
|
2032
|
-
* @param round - The round for which this information is relevant.
|
|
2033
|
-
* @param nextToken - Used for pagination, when making another request provide this token with the
|
|
2034
|
-
* next parameter.
|
|
2035
2059
|
*/
|
|
2036
|
-
constructor({ boxes
|
|
2060
|
+
constructor({ boxes }) {
|
|
2037
2061
|
this.boxes = boxes;
|
|
2038
|
-
this.round = (0, utils_js_1.ensureSafeInteger)(round);
|
|
2039
|
-
this.nextToken = nextToken;
|
|
2040
2062
|
}
|
|
2041
2063
|
// eslint-disable-next-line class-methods-use-this
|
|
2042
2064
|
getEncodingSchema() {
|
|
@@ -2045,8 +2067,6 @@ class BoxesResponse {
|
|
|
2045
2067
|
toEncodingData() {
|
|
2046
2068
|
return new Map([
|
|
2047
2069
|
['boxes', this.boxes.map((v) => v.toEncodingData())],
|
|
2048
|
-
['round', this.round],
|
|
2049
|
-
['next-token', this.nextToken],
|
|
2050
2070
|
]);
|
|
2051
2071
|
}
|
|
2052
2072
|
static fromEncodingData(data) {
|
|
@@ -2054,9 +2074,7 @@ class BoxesResponse {
|
|
|
2054
2074
|
throw new Error(`Invalid decoded BoxesResponse: ${data}`);
|
|
2055
2075
|
}
|
|
2056
2076
|
return new BoxesResponse({
|
|
2057
|
-
boxes: (data.get('boxes') ?? []).map((v) =>
|
|
2058
|
-
round: data.get('round'),
|
|
2059
|
-
nextToken: data.get('next-token'),
|
|
2077
|
+
boxes: (data.get('boxes') ?? []).map((v) => BoxDescriptor.fromEncodingData(v)),
|
|
2060
2078
|
});
|
|
2061
2079
|
}
|
|
2062
2080
|
}
|