@stacks/blockchain-api-client 7.11.1 → 7.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stacks/blockchain-api-client",
3
- "version": "7.11.1",
3
+ "version": "7.12.0",
4
4
  "access": "public",
5
5
  "description": "Client for the Stacks Blockchain API",
6
6
  "homepage": "https://github.com/hirosystems/stacks-blockchain-api/tree/master/client#readme",
@@ -100,6 +100,15 @@ export interface GetTransactionListRequest {
100
100
  limit?: number;
101
101
  offset?: number;
102
102
  type?: Array<GetTransactionListTypeEnum>;
103
+ fromAddress?: string;
104
+ toAddress?: string;
105
+ sortBy?: GetTransactionListSortByEnum;
106
+ startTime?: number;
107
+ endTime?: number;
108
+ contractId?: string;
109
+ functionName?: string;
110
+ nonce?: number;
111
+ order?: GetTransactionListOrderEnum;
103
112
  unanchored?: boolean;
104
113
  }
105
114
 
@@ -310,6 +319,15 @@ export interface TransactionsApiInterface {
310
319
  * @param {number} [limit] max number of transactions to fetch
311
320
  * @param {number} [offset] index of first transaction to fetch
312
321
  * @param {Array<'coinbase' | 'token_transfer' | 'smart_contract' | 'contract_call' | 'poison_microblock' | 'tenure_change'>} [type] Filter by transaction type
322
+ * @param {string} [fromAddress] Option to filter results by sender address
323
+ * @param {string} [toAddress] Option to filter results by recipient address
324
+ * @param {'block_height' | 'burn_block_time' | 'fee'} [sortBy] Option to sort results by block height, timestamp, or fee
325
+ * @param {number} [startTime] Filter by transactions after this timestamp (unix timestamp in seconds)
326
+ * @param {number} [endTime] Filter by transactions before this timestamp (unix timestamp in seconds)
327
+ * @param {string} [contractId] Filter by contract call transactions involving this contract ID
328
+ * @param {string} [functionName] Filter by contract call transactions involving this function name
329
+ * @param {number} [nonce] Filter by transactions with this nonce
330
+ * @param {'asc' | 'desc'} [order] Option to sort results in ascending or descending order
313
331
  * @param {boolean} [unanchored] Include transaction data from unanchored (i.e. unconfirmed) microblocks
314
332
  * @param {*} [options] Override http request option.
315
333
  * @throws {RequiredError}
@@ -813,6 +831,42 @@ export class TransactionsApi extends runtime.BaseAPI implements TransactionsApiI
813
831
  queryParameters['type'] = requestParameters.type;
814
832
  }
815
833
 
834
+ if (requestParameters.fromAddress !== undefined) {
835
+ queryParameters['from_address'] = requestParameters.fromAddress;
836
+ }
837
+
838
+ if (requestParameters.toAddress !== undefined) {
839
+ queryParameters['to_address'] = requestParameters.toAddress;
840
+ }
841
+
842
+ if (requestParameters.sortBy !== undefined) {
843
+ queryParameters['sort_by'] = requestParameters.sortBy;
844
+ }
845
+
846
+ if (requestParameters.startTime !== undefined) {
847
+ queryParameters['start_time'] = requestParameters.startTime;
848
+ }
849
+
850
+ if (requestParameters.endTime !== undefined) {
851
+ queryParameters['end_time'] = requestParameters.endTime;
852
+ }
853
+
854
+ if (requestParameters.contractId !== undefined) {
855
+ queryParameters['contract_id'] = requestParameters.contractId;
856
+ }
857
+
858
+ if (requestParameters.functionName !== undefined) {
859
+ queryParameters['function_name'] = requestParameters.functionName;
860
+ }
861
+
862
+ if (requestParameters.nonce !== undefined) {
863
+ queryParameters['nonce'] = requestParameters.nonce;
864
+ }
865
+
866
+ if (requestParameters.order !== undefined) {
867
+ queryParameters['order'] = requestParameters.order;
868
+ }
869
+
816
870
  if (requestParameters.unanchored !== undefined) {
817
871
  queryParameters['unanchored'] = requestParameters.unanchored;
818
872
  }
@@ -1075,3 +1129,20 @@ export enum GetTransactionListTypeEnum {
1075
1129
  poison_microblock = 'poison_microblock',
1076
1130
  tenure_change = 'tenure_change'
1077
1131
  }
1132
+ /**
1133
+ * @export
1134
+ * @enum {string}
1135
+ */
1136
+ export enum GetTransactionListSortByEnum {
1137
+ block_height = 'block_height',
1138
+ burn_block_time = 'burn_block_time',
1139
+ fee = 'fee'
1140
+ }
1141
+ /**
1142
+ * @export
1143
+ * @enum {string}
1144
+ */
1145
+ export enum GetTransactionListOrderEnum {
1146
+ asc = 'asc',
1147
+ desc = 'desc'
1148
+ }