algosdk 1.14.0-beta.1 → 1.14.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/src/client/client.js +16 -41
- package/dist/cjs/src/client/client.js.map +1 -1
- package/dist/cjs/src/client/v2/indexer/lookupAccountTransactions.js +280 -15
- package/dist/cjs/src/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
- package/dist/cjs/src/client/v2/indexer/lookupAssetByID.js +37 -1
- package/dist/cjs/src/client/v2/indexer/lookupAssetByID.js.map +1 -1
- package/dist/cjs/src/client/v2/jsonrequest.js +3 -0
- package/dist/cjs/src/client/v2/jsonrequest.js.map +1 -1
- package/dist/cjs/src/makeTxn.js.map +1 -1
- package/dist/esm/src/client/client.js +16 -41
- package/dist/esm/src/client/client.js.map +1 -1
- package/dist/esm/src/client/v2/indexer/lookupAccountTransactions.js +280 -15
- package/dist/esm/src/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
- package/dist/esm/src/client/v2/indexer/lookupAssetByID.js +37 -1
- package/dist/esm/src/client/v2/indexer/lookupAssetByID.js.map +1 -1
- package/dist/esm/src/client/v2/jsonrequest.js +3 -0
- package/dist/esm/src/client/v2/jsonrequest.js.map +1 -1
- package/dist/esm/src/makeTxn.js.map +1 -1
- package/dist/types/src/client/client.d.ts +7 -7
- package/dist/types/src/client/v2/indexer/lookupAccountTransactions.d.ts +280 -1
- package/dist/types/src/client/v2/indexer/lookupAssetByID.d.ts +37 -0
- package/dist/types/src/client/v2/jsonrequest.d.ts +4 -0
- package/dist/types/src/makeTxn.d.ts +31 -31
- package/dist/types/src/types/utils.d.ts +7 -0
- package/package.json +3 -3
|
@@ -62,30 +62,6 @@ function getAcceptFormat(query) {
|
|
|
62
62
|
else
|
|
63
63
|
return 'application/json';
|
|
64
64
|
}
|
|
65
|
-
/**
|
|
66
|
-
* Check is a response is JSON or not
|
|
67
|
-
* Inspired from superagent code
|
|
68
|
-
*/
|
|
69
|
-
function isResponseJSON(res) {
|
|
70
|
-
let contentType = tolowerCaseKeys(res.headers)['content-type'];
|
|
71
|
-
if (contentType) {
|
|
72
|
-
/* eslint-disable prefer-destructuring */
|
|
73
|
-
contentType = contentType.split(';')[0];
|
|
74
|
-
/* eslint-enable prefer-destructuring */
|
|
75
|
-
}
|
|
76
|
-
// regex should match /json or +json
|
|
77
|
-
// but not /json-seq
|
|
78
|
-
// from https://github.com/visionmedia/superagent/blob/048cf185d954028b1dccde0717d2488b2284c297/src/client.js#L276
|
|
79
|
-
return /[/+]json($|[^-\w])/i.test(contentType);
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Check is a response is text
|
|
83
|
-
* Inspired from superagent code
|
|
84
|
-
*/
|
|
85
|
-
function isResponseText(res) {
|
|
86
|
-
const contentType = tolowerCaseKeys(res.headers)['content-type'] || 'text/plain';
|
|
87
|
-
return /^\w*text\//i.test(contentType);
|
|
88
|
-
}
|
|
89
65
|
/**
|
|
90
66
|
* HTTPClient is a wrapper around a BaseHTTPClient
|
|
91
67
|
* It takes care of setting the proper "Accept" header and of
|
|
@@ -104,9 +80,9 @@ class HTTPClient {
|
|
|
104
80
|
* Parse JSON using either the built-in JSON.parse or utils.parseJSON
|
|
105
81
|
* depending on whether jsonOptions are provided or not
|
|
106
82
|
*
|
|
107
|
-
* @param text JSON data
|
|
108
|
-
* @param status Status of the response (used in case parseJSON fails)
|
|
109
|
-
* @param jsonOptions Options object to use to decode JSON responses. See
|
|
83
|
+
* @param text - JSON data
|
|
84
|
+
* @param status - Status of the response (used in case parseJSON fails)
|
|
85
|
+
* @param jsonOptions - Options object to use to decode JSON responses. See
|
|
110
86
|
* utils.parseJSON for the options available.
|
|
111
87
|
*/
|
|
112
88
|
static parseJSON(text, status, jsonOptions = {}) {
|
|
@@ -153,15 +129,14 @@ class HTTPClient {
|
|
|
153
129
|
* Parse the body in
|
|
154
130
|
* Modifies in place res and return the result
|
|
155
131
|
*/
|
|
156
|
-
static prepareResponse(res, jsonOptions = {}) {
|
|
132
|
+
static prepareResponse(res, format, jsonOptions = {}) {
|
|
157
133
|
let { body } = res;
|
|
158
134
|
let text;
|
|
159
|
-
if (
|
|
160
|
-
text = (body &&
|
|
161
|
-
body = HTTPClient.parseJSON(text, res.status, jsonOptions);
|
|
135
|
+
if (format !== 'application/msgpack') {
|
|
136
|
+
text = (body && Buffer.from(body).toString()) || '';
|
|
162
137
|
}
|
|
163
|
-
|
|
164
|
-
|
|
138
|
+
if (format === 'application/json') {
|
|
139
|
+
body = HTTPClient.parseJSON(text, res.status, jsonOptions);
|
|
165
140
|
}
|
|
166
141
|
return {
|
|
167
142
|
...res,
|
|
@@ -179,7 +154,7 @@ class HTTPClient {
|
|
|
179
154
|
static prepareResponseError(err) {
|
|
180
155
|
if (err.response) {
|
|
181
156
|
// eslint-disable-next-line no-param-reassign
|
|
182
|
-
err.response = HTTPClient.prepareResponse(err.response);
|
|
157
|
+
err.response = HTTPClient.prepareResponse(err.response, 'application/json');
|
|
183
158
|
// eslint-disable-next-line no-param-reassign
|
|
184
159
|
err.status = err.response.status;
|
|
185
160
|
}
|
|
@@ -187,10 +162,10 @@ class HTTPClient {
|
|
|
187
162
|
}
|
|
188
163
|
/**
|
|
189
164
|
* Send a GET request.
|
|
190
|
-
* @param
|
|
191
|
-
* @param
|
|
192
|
-
* @param
|
|
193
|
-
* @param
|
|
165
|
+
* @param relativePath - The path of the request.
|
|
166
|
+
* @param query - An object containing the query parameters of the request.
|
|
167
|
+
* @param requestHeaders - An object containing additional request headers to use.
|
|
168
|
+
* @param jsonOptions - Options object to use to decode JSON responses. See
|
|
194
169
|
* utils.parseJSON for the options available.
|
|
195
170
|
* @returns Response object.
|
|
196
171
|
*/
|
|
@@ -199,7 +174,7 @@ class HTTPClient {
|
|
|
199
174
|
const fullHeaders = { ...requestHeaders, accept: format };
|
|
200
175
|
try {
|
|
201
176
|
const res = await this.bc.get(relativePath, removeFalsyOrEmpty(query), fullHeaders);
|
|
202
|
-
return HTTPClient.prepareResponse(res, jsonOptions);
|
|
177
|
+
return HTTPClient.prepareResponse(res, format, jsonOptions);
|
|
203
178
|
}
|
|
204
179
|
catch (err) {
|
|
205
180
|
throw HTTPClient.prepareResponseError(err);
|
|
@@ -217,7 +192,7 @@ class HTTPClient {
|
|
|
217
192
|
};
|
|
218
193
|
try {
|
|
219
194
|
const res = await this.bc.post(relativePath, HTTPClient.serializeData(data, fullHeaders), undefined, fullHeaders);
|
|
220
|
-
return HTTPClient.prepareResponse(res);
|
|
195
|
+
return HTTPClient.prepareResponse(res, 'application/json');
|
|
221
196
|
}
|
|
222
197
|
catch (err) {
|
|
223
198
|
throw HTTPClient.prepareResponseError(err);
|
|
@@ -234,7 +209,7 @@ class HTTPClient {
|
|
|
234
209
|
...tolowerCaseKeys(requestHeaders),
|
|
235
210
|
};
|
|
236
211
|
const res = await this.bc.delete(relativePath, HTTPClient.serializeData(data, fullHeaders), undefined, fullHeaders);
|
|
237
|
-
return HTTPClient.prepareResponse(res);
|
|
212
|
+
return HTTPClient.prepareResponse(res, 'application/json');
|
|
238
213
|
}
|
|
239
214
|
}
|
|
240
215
|
exports.default = HTTPClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/client/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,sDAAwC;AAMxC,qEAA+E;AAe/E;;GAEG;AACH,SAAS,kBAAkB,CAAC,GAAwB;IAClD,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;QACrB,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;YAClD,6CAA6C;YAC7C,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAA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5C;IACH,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,IAAI,CACR,YAAoB,EACpB,IAAS,EACT,iBAAyC,EAAE;QAE3C,MAAM,WAAW,GAAG;YAClB,cAAc,EAAE,kBAAkB;YAClC,GAAG,eAAe,CAAC,cAAc,CAAC;SACnC,CAAC;QAEF,IAAI;YACF,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAC5B,YAAY,EACZ,UAAU,CAAC,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,SAAS,EACT,WAAW,CACZ,CAAC;YAEF,OAAO,UAAU,CAAC,eAAe,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;SAC5D;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,UAAU,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;SAC5C;IACH,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CACV,YAAoB,EACpB,IAAS,EACT,iBAAyC,EAAE;QAE3C,MAAM,WAAW,GAAG;YAClB,cAAc,EAAE,kBAAkB;YAClC,GAAG,eAAe,CAAC,cAAc,CAAC;SACnC,CAAC;QAEF,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,MAAM,CAC9B,YAAY,EACZ,UAAU,CAAC,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,SAAS,EACT,WAAW,CACZ,CAAC;QAEF,OAAO,UAAU,CAAC,eAAe,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;IAC7D,CAAC;CACF;AAlOD,6BAkOC"}
|
|
@@ -18,88 +18,353 @@ function base64StringFunnel(data) {
|
|
|
18
18
|
}
|
|
19
19
|
exports.base64StringFunnel = base64StringFunnel;
|
|
20
20
|
class LookupAccountTransactions extends jsonrequest_1.default {
|
|
21
|
+
/**
|
|
22
|
+
* Returns transactions relating to the given account.
|
|
23
|
+
*
|
|
24
|
+
* #### Example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
27
|
+
* const accountTxns = await indexerClient.lookupAccountTransactions(address).do();
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idtransactions)
|
|
31
|
+
* @param account - The address of the account.
|
|
32
|
+
*/
|
|
21
33
|
constructor(c, intDecoding, account) {
|
|
22
34
|
super(c, intDecoding);
|
|
23
35
|
this.account = account;
|
|
24
36
|
this.account = account;
|
|
25
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* @returns /v2/accounts/`${account}`/transactions
|
|
40
|
+
*/
|
|
26
41
|
path() {
|
|
27
42
|
return `/v2/accounts/${this.account}/transactions`;
|
|
28
43
|
}
|
|
29
44
|
/**
|
|
30
|
-
*
|
|
45
|
+
* Specifies a prefix which must be contained in the note field
|
|
46
|
+
*
|
|
47
|
+
* #### Example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const notePrefixBase64Encoded = "Y3JlYXRl";
|
|
50
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
51
|
+
* const accountTxns = await indexerClient
|
|
52
|
+
* .lookupAccountTransactions(address)
|
|
53
|
+
* .notePrefix(notePrefixBase64Encoded)
|
|
54
|
+
* .do();
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
31
57
|
* @param prefix - base64 string or uint8array
|
|
58
|
+
* @category query
|
|
32
59
|
*/
|
|
33
60
|
notePrefix(prefix) {
|
|
34
61
|
this.query['note-prefix'] = base64StringFunnel(prefix);
|
|
35
62
|
return this;
|
|
36
63
|
}
|
|
37
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Type of transaction to filter with
|
|
66
|
+
*
|
|
67
|
+
* #### Example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
70
|
+
* const accountTxns = await indexerClient
|
|
71
|
+
* .lookupAccountTransactions(address)
|
|
72
|
+
* .txType("appl")
|
|
73
|
+
* .do();
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @param type - one of “pay”, “keyreg”, “acfg”, “axfer”, “afrz”, "appl"
|
|
77
|
+
* @category query
|
|
78
|
+
*/
|
|
38
79
|
txType(type) {
|
|
39
80
|
this.query['tx-type'] = type;
|
|
40
81
|
return this;
|
|
41
82
|
}
|
|
42
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Type of signature to filter with
|
|
85
|
+
* - sig: Standard
|
|
86
|
+
* - msig: MultiSig
|
|
87
|
+
* - lsig: LogicSig
|
|
88
|
+
*
|
|
89
|
+
* #### Example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
92
|
+
* const accountTxns = await indexerClient
|
|
93
|
+
* .lookupAccountTransactions(address)
|
|
94
|
+
* .sigType("msig")
|
|
95
|
+
* .do();
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @param type - one of “sig”, “msig”, “lsig”
|
|
99
|
+
* @category query
|
|
100
|
+
*/
|
|
43
101
|
sigType(type) {
|
|
44
102
|
this.query['sig-type'] = type;
|
|
45
103
|
return this;
|
|
46
104
|
}
|
|
47
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Lookup the specific transaction by ID
|
|
107
|
+
*
|
|
108
|
+
* #### Example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* const txId = "MEUOC4RQJB23CQZRFRKYEI6WBO73VTTPST5A7B3S5OKBUY6LFUDA";
|
|
111
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
112
|
+
* const accountTxns = await indexerClient
|
|
113
|
+
* .lookupAccountTransactions(address)
|
|
114
|
+
* .txid(txId)
|
|
115
|
+
* .do();
|
|
116
|
+
* ```
|
|
117
|
+
*
|
|
118
|
+
* @param txid
|
|
119
|
+
* @category query
|
|
120
|
+
*/
|
|
48
121
|
txid(txid) {
|
|
49
122
|
this.query.txid = txid;
|
|
50
123
|
return this;
|
|
51
124
|
}
|
|
52
|
-
|
|
125
|
+
/**
|
|
126
|
+
* Include results for the specified round
|
|
127
|
+
*
|
|
128
|
+
* #### Example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* const targetBlock = 18309917;
|
|
131
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
132
|
+
* const accountTxns = await indexerClient
|
|
133
|
+
* .lookupAccountTransactions(address)
|
|
134
|
+
* .round(targetBlock)
|
|
135
|
+
* .do();
|
|
136
|
+
* ```
|
|
137
|
+
*
|
|
138
|
+
* @param round
|
|
139
|
+
* @category query
|
|
140
|
+
*/
|
|
53
141
|
round(round) {
|
|
54
142
|
this.query.round = round;
|
|
55
143
|
return this;
|
|
56
144
|
}
|
|
57
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Include results at or after the specified min-round
|
|
147
|
+
*
|
|
148
|
+
* #### Example
|
|
149
|
+
* ```typescript
|
|
150
|
+
* const minRound = 18309917;
|
|
151
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
152
|
+
* const accountTxns = await indexerClient
|
|
153
|
+
* .lookupAccountTransactions(address)
|
|
154
|
+
* .minRound(minRound)
|
|
155
|
+
* .do();
|
|
156
|
+
* ```
|
|
157
|
+
*
|
|
158
|
+
* @param round
|
|
159
|
+
* @category query
|
|
160
|
+
*/
|
|
58
161
|
minRound(round) {
|
|
59
162
|
this.query['min-round'] = round;
|
|
60
163
|
return this;
|
|
61
164
|
}
|
|
62
|
-
|
|
165
|
+
/**
|
|
166
|
+
* Include results at or before the specified max-round
|
|
167
|
+
*
|
|
168
|
+
* #### Example
|
|
169
|
+
* ```typescript
|
|
170
|
+
* const maxRound = 18309917;
|
|
171
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
172
|
+
* const accountTxns = await indexerClient
|
|
173
|
+
* .lookupAccountTransactions(address)
|
|
174
|
+
* .maxRound(maxRound)
|
|
175
|
+
* .do();
|
|
176
|
+
* ```
|
|
177
|
+
*
|
|
178
|
+
* @param round
|
|
179
|
+
* @category query
|
|
180
|
+
*/
|
|
63
181
|
maxRound(round) {
|
|
64
182
|
this.query['max-round'] = round;
|
|
65
183
|
return this;
|
|
66
184
|
}
|
|
67
|
-
|
|
185
|
+
/**
|
|
186
|
+
* Asset ID to filter with
|
|
187
|
+
*
|
|
188
|
+
* #### Example
|
|
189
|
+
* ```typescript
|
|
190
|
+
* const assetID = 163650;
|
|
191
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
192
|
+
* const accountTxns = await indexerClient
|
|
193
|
+
* .lookupAccountTransactions(address)
|
|
194
|
+
* .assetID(assetID)
|
|
195
|
+
* .do();
|
|
196
|
+
* ```
|
|
197
|
+
*
|
|
198
|
+
* @param id
|
|
199
|
+
* @category query
|
|
200
|
+
*/
|
|
68
201
|
assetID(id) {
|
|
69
202
|
this.query['asset-id'] = id;
|
|
70
203
|
return this;
|
|
71
204
|
}
|
|
72
|
-
|
|
205
|
+
/**
|
|
206
|
+
* Maximum number of results to return
|
|
207
|
+
*
|
|
208
|
+
* #### Example
|
|
209
|
+
* ```typescript
|
|
210
|
+
* const limit = 25;
|
|
211
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
212
|
+
* const accountTxns = await indexerClient
|
|
213
|
+
* .lookupAccountTransactions(address)
|
|
214
|
+
* .limit(limit)
|
|
215
|
+
* .do();
|
|
216
|
+
* ```
|
|
217
|
+
*
|
|
218
|
+
* @param limit
|
|
219
|
+
* @category query
|
|
220
|
+
*/
|
|
73
221
|
limit(limit) {
|
|
74
222
|
this.query.limit = limit;
|
|
75
223
|
return this;
|
|
76
224
|
}
|
|
77
|
-
|
|
225
|
+
/**
|
|
226
|
+
* Include results before the given time
|
|
227
|
+
*
|
|
228
|
+
* #### Example
|
|
229
|
+
* ```typescript
|
|
230
|
+
* const beforeTime = "2022-02-02T20:20:22.02Z";
|
|
231
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
232
|
+
* const accountTxns = await indexerClient
|
|
233
|
+
* .lookupAccountTransactions(address)
|
|
234
|
+
* .beforeTime(beforeTime)
|
|
235
|
+
* .do();
|
|
236
|
+
* ```
|
|
237
|
+
*
|
|
238
|
+
* @param before - rfc3339 string
|
|
239
|
+
* @category query
|
|
240
|
+
*/
|
|
78
241
|
beforeTime(before) {
|
|
79
242
|
this.query['before-time'] = before;
|
|
80
243
|
return this;
|
|
81
244
|
}
|
|
82
|
-
|
|
245
|
+
/**
|
|
246
|
+
* Include results after the given time
|
|
247
|
+
*
|
|
248
|
+
* #### Example
|
|
249
|
+
* ```typescript
|
|
250
|
+
* const afterTime = "2022-10-21T00:00:11.55Z";
|
|
251
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
252
|
+
* const accountTxns = await indexerClient
|
|
253
|
+
* .lookupAccountTransactions(address)
|
|
254
|
+
* .afterTime(afterTime)
|
|
255
|
+
* .do();
|
|
256
|
+
* ```
|
|
257
|
+
*
|
|
258
|
+
* @param after - rfc3339 string
|
|
259
|
+
* @category query
|
|
260
|
+
*/
|
|
83
261
|
afterTime(after) {
|
|
84
262
|
this.query['after-time'] = after;
|
|
85
263
|
return this;
|
|
86
264
|
}
|
|
87
|
-
|
|
265
|
+
/**
|
|
266
|
+
* Filtered results should have an amount greater than this value, as int, representing microAlgos, unless an asset-id is provided, in which case units are in the asset's units.
|
|
267
|
+
*
|
|
268
|
+
* #### Example 1
|
|
269
|
+
* ```typescript
|
|
270
|
+
* const minBalance = 300000;
|
|
271
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
272
|
+
* const accountTxns = await indexerClient
|
|
273
|
+
* .lookupAccountTransactions(address)
|
|
274
|
+
* .currencyGreaterThan(minBalance - 1)
|
|
275
|
+
* .do();
|
|
276
|
+
* ```
|
|
277
|
+
*
|
|
278
|
+
* #### Example 2
|
|
279
|
+
* ```typescript
|
|
280
|
+
* const assetID = 163650;
|
|
281
|
+
* const minBalance = 300000;
|
|
282
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
283
|
+
* const accountTxns = await indexerClient
|
|
284
|
+
* .lookupAccountTransactions(address)
|
|
285
|
+
* .assetID(assetID)
|
|
286
|
+
* .currencyGreaterThan(minBalance - 1)
|
|
287
|
+
* .do();
|
|
288
|
+
* ```
|
|
289
|
+
* @remarks
|
|
290
|
+
* If you are looking for transactions with the currency amount greater than 0, simply construct the query without `currencyGreaterThan` because it doesn't accept `-1`, and passing the `0` `currency-greater-than` value would exclude transactions with a 0 amount.
|
|
291
|
+
*
|
|
292
|
+
* @param greater
|
|
293
|
+
* @category query
|
|
294
|
+
*/
|
|
88
295
|
currencyGreaterThan(greater) {
|
|
89
296
|
this.query['currency-greater-than'] = greater;
|
|
90
297
|
return this;
|
|
91
298
|
}
|
|
92
|
-
|
|
299
|
+
/**
|
|
300
|
+
* Filtered results should have an amount less than this value, as int, representing microAlgos, unless an asset-id is provided, in which case units are in the asset's units
|
|
301
|
+
*
|
|
302
|
+
* #### Example 1
|
|
303
|
+
* ```typescript
|
|
304
|
+
* const maxBalance = 500000;
|
|
305
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
306
|
+
* const accountTxns = await indexerClient
|
|
307
|
+
* .lookupAccountTransactions(address)
|
|
308
|
+
* .currencyLessThan(maxBalance + 1)
|
|
309
|
+
* .do();
|
|
310
|
+
* ```
|
|
311
|
+
*
|
|
312
|
+
* #### Example 2
|
|
313
|
+
* ```typescript
|
|
314
|
+
* const assetID = 163650;
|
|
315
|
+
* const maxBalance = 500000;
|
|
316
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
317
|
+
* const accountTxns = await indexerClient
|
|
318
|
+
* .lookupAccountTransactions(address)
|
|
319
|
+
* .assetID(assetID)
|
|
320
|
+
* .currencyLessThan(maxBalance + 1)
|
|
321
|
+
* .do();
|
|
322
|
+
* ```
|
|
323
|
+
*
|
|
324
|
+
* @param lesser
|
|
325
|
+
* @category query
|
|
326
|
+
*/
|
|
93
327
|
currencyLessThan(lesser) {
|
|
94
328
|
this.query['currency-less-than'] = lesser;
|
|
95
329
|
return this;
|
|
96
330
|
}
|
|
97
|
-
|
|
331
|
+
/**
|
|
332
|
+
* The next page of results. Use the next token provided by the previous results.
|
|
333
|
+
*
|
|
334
|
+
* #### Example
|
|
335
|
+
* ```typescript
|
|
336
|
+
* const limit = 25;
|
|
337
|
+
* const nextToken = "the next token returned in the previous query response";
|
|
338
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
339
|
+
* const accountTxns = await indexerClient
|
|
340
|
+
* .lookupAccountTransactions(address)
|
|
341
|
+
* .limit(limit)
|
|
342
|
+
* .nextToken(nextToken)
|
|
343
|
+
* .do();
|
|
344
|
+
* ```
|
|
345
|
+
*
|
|
346
|
+
* @param nextToken
|
|
347
|
+
* @category query
|
|
348
|
+
*/
|
|
98
349
|
nextToken(nextToken) {
|
|
99
350
|
this.query.next = nextToken;
|
|
100
351
|
return this;
|
|
101
352
|
}
|
|
102
|
-
|
|
353
|
+
/**
|
|
354
|
+
* Include results which include the rekey-to field
|
|
355
|
+
*
|
|
356
|
+
* #### Example
|
|
357
|
+
* ```typescript
|
|
358
|
+
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
359
|
+
* const accountTxns = await indexerClient
|
|
360
|
+
* .lookupAccountTransactions(address)
|
|
361
|
+
* .rekeyTo(false)
|
|
362
|
+
* .do();
|
|
363
|
+
* ```
|
|
364
|
+
*
|
|
365
|
+
* @param rekeyTo
|
|
366
|
+
* @category query
|
|
367
|
+
*/
|
|
103
368
|
rekeyTo(rekeyTo) {
|
|
104
369
|
this.query['rekey-to'] = rekeyTo;
|
|
105
370
|
return this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookupAccountTransactions.js","sourceRoot":"","sources":["../../../../../../src/client/v2/indexer/lookupAccountTransactions.ts"],"names":[],"mappings":";;;;;;AAAA,iEAAyC;AAIzC;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,IAAyB;IAC1D,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,OAAO,IAAI,CAAC;KACb;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC9C,CAAC;AALD,gDAKC;AAED,MAAqB,yBAA0B,SAAQ,qBAAW;IAChE,YACE,CAAa,EACb,WAAwB,EAChB,OAAe;QAEvB,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;QAFd,YAAO,GAAP,OAAO,CAAQ;QAGvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAI;QACF,OAAO,gBAAgB,IAAI,CAAC,OAAO,eAAe,CAAC;IACrD,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"lookupAccountTransactions.js","sourceRoot":"","sources":["../../../../../../src/client/v2/indexer/lookupAccountTransactions.ts"],"names":[],"mappings":";;;;;;AAAA,iEAAyC;AAIzC;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,IAAyB;IAC1D,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,OAAO,IAAI,CAAC;KACb;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC9C,CAAC;AALD,gDAKC;AAED,MAAqB,yBAA0B,SAAQ,qBAAW;IAChE;;;;;;;;;;;OAWG;IACH,YACE,CAAa,EACb,WAAwB,EAChB,OAAe;QAEvB,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;QAFd,YAAO,GAAP,OAAO,CAAQ;QAGvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,IAAI;QACF,OAAO,gBAAgB,IAAI,CAAC,OAAO,eAAe,CAAC;IACrD,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,MAA2B;QACpC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAY;QACjB,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,IAAY;QAClB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC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,CAAC,KAAK,CAAC,uBAAuB,CAAC,GAAG,OAAO,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,gBAAgB,CAAC,MAAc;QAC7B,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,GAAG,MAAM,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAS,CAAC,SAAiB;QACzB,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,OAAgB;QACtB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAnXD,4CAmXC"}
|
|
@@ -5,15 +5,51 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsonrequest_1 = __importDefault(require("../jsonrequest"));
|
|
7
7
|
class LookupAssetByID extends jsonrequest_1.default {
|
|
8
|
+
/**
|
|
9
|
+
* Returns asset information of the queried asset.
|
|
10
|
+
*
|
|
11
|
+
* #### Example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const assetId = 163650;
|
|
14
|
+
* const assetInfo = await indexerClient.lookupAssetByID(assetId).do();
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-id)
|
|
18
|
+
* @param index - The asset ID to look up.
|
|
19
|
+
*/
|
|
8
20
|
constructor(c, intDecoding, index) {
|
|
9
21
|
super(c, intDecoding);
|
|
10
22
|
this.index = index;
|
|
11
23
|
this.index = index;
|
|
12
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* @returns `/v2/assets/${index}`
|
|
27
|
+
*/
|
|
13
28
|
path() {
|
|
14
29
|
return `/v2/assets/${this.index}`;
|
|
15
30
|
}
|
|
16
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Includes all items including closed accounts, deleted applications, destroyed assets, opted-out asset holdings, and closed-out application localstates
|
|
33
|
+
*
|
|
34
|
+
* #### Example 1
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const assetInfo = await indexerClient
|
|
37
|
+
* .lookupAssetByID(assetId)
|
|
38
|
+
* .includeAll(false)
|
|
39
|
+
* .do();
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* #### Example 2
|
|
43
|
+
* ```typescript
|
|
44
|
+
* const assetInfo = await indexerClient
|
|
45
|
+
* .lookupAssetByID(assetId)
|
|
46
|
+
* .includeAll()
|
|
47
|
+
* .do();
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @param value - default true when called without passing a value
|
|
51
|
+
* @category query
|
|
52
|
+
*/
|
|
17
53
|
includeAll(value = true) {
|
|
18
54
|
this.query['include-all'] = value;
|
|
19
55
|
return this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookupAssetByID.js","sourceRoot":"","sources":["../../../../../../src/client/v2/indexer/lookupAssetByID.ts"],"names":[],"mappings":";;;;;AAAA,iEAAyC;AAIzC,MAAqB,eAAgB,SAAQ,qBAAW;IACtD,YAAY,CAAa,EAAE,WAAwB,EAAU,KAAa;QACxE,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;QADqC,UAAK,GAAL,KAAK,CAAQ;QAExE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,IAAI;QACF,OAAO,cAAc,IAAI,CAAC,KAAK,EAAE,CAAC;IACpC,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"lookupAssetByID.js","sourceRoot":"","sources":["../../../../../../src/client/v2/indexer/lookupAssetByID.ts"],"names":[],"mappings":";;;;;AAAA,iEAAyC;AAIzC,MAAqB,eAAgB,SAAQ,qBAAW;IACtD;;;;;;;;;;;OAWG;IACH,YAAY,CAAa,EAAE,WAAwB,EAAU,KAAa;QACxE,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;QADqC,UAAK,GAAL,KAAK,CAAQ;QAExE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,IAAI;QACF,OAAO,cAAc,IAAI,CAAC,KAAK,EAAE,CAAC;IACpC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,UAAU,CAAC,KAAK,GAAG,IAAI;QACrB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAnDD,kCAmDC"}
|
|
@@ -29,6 +29,7 @@ class JSONRequest {
|
|
|
29
29
|
* Use this method to change and restructure response
|
|
30
30
|
* data as needed after receiving it from the `do()` method.
|
|
31
31
|
* @param body - Response body received
|
|
32
|
+
* @category JSONRequest
|
|
32
33
|
*/
|
|
33
34
|
// eslint-disable-next-line class-methods-use-this
|
|
34
35
|
prepare(body) {
|
|
@@ -38,6 +39,7 @@ class JSONRequest {
|
|
|
38
39
|
* Execute the request.
|
|
39
40
|
* @param headers - Additional headers to send in the request. Optional.
|
|
40
41
|
* @returns A promise which resolves to the response data.
|
|
42
|
+
* @category JSONRequest
|
|
41
43
|
*/
|
|
42
44
|
async do(headers = {}) {
|
|
43
45
|
const jsonOptions = {};
|
|
@@ -61,6 +63,7 @@ class JSONRequest {
|
|
|
61
63
|
*
|
|
62
64
|
* @param method - The method to use when parsing the
|
|
63
65
|
* response for this request. Must be one of "default", "safe", "mixed", or "bigint".
|
|
66
|
+
* @category JSONRequest
|
|
64
67
|
*/
|
|
65
68
|
setIntDecoding(method) {
|
|
66
69
|
if (method !== 'default' &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonrequest.js","sourceRoot":"","sources":["../../../../../src/client/v2/jsonrequest.ts"],"names":[],"mappings":";;;;;AACA,0EAAkD;AAElD;;;;;;GAMG;AACH,MAA8B,WAAW;IAQvC;;;;;OAKG;IACH,YAAY,MAAkB,EAAE,WAAyB;QACvD,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,WAAW,GAAG,WAAW,IAAI,qBAAW,CAAC,OAAO,CAAC;IACxD,CAAC;
|
|
1
|
+
{"version":3,"file":"jsonrequest.js","sourceRoot":"","sources":["../../../../../src/client/v2/jsonrequest.ts"],"names":[],"mappings":";;;;;AACA,0EAAkD;AAElD;;;;;;GAMG;AACH,MAA8B,WAAW;IAQvC;;;;;OAKG;IACH,YAAY,MAAkB,EAAE,WAAyB;QACvD,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,WAAW,GAAG,WAAW,IAAI,qBAAW,CAAC,OAAO,CAAC;IACxD,CAAC;IAQD;;;;;;;OAOG;IACH,kDAAkD;IAClD,OAAO,CAAC,IAAU;QAChB,OAAQ,IAAwB,CAAC;IACnC,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,EAAE,CAAC,UAA+B,EAAE;QACxC,MAAM,WAAW,GAAwB,EAAE,CAAC;QAC5C,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE;YAClC,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;SAC5C;QACD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED;;;;;;;;;;;;;;;OAeG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