@stacks/blockchain-api-client 7.12.0 → 7.13.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.12.0",
3
+ "version": "7.13.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",
@@ -4,6 +4,7 @@ apis/BlocksApi.ts
4
4
  apis/BurnBlocksApi.ts
5
5
  apis/FaucetsApi.ts
6
6
  apis/FeesApi.ts
7
+ apis/FungibleTokensApi.ts
7
8
  apis/InfoApi.ts
8
9
  apis/MempoolApi.ts
9
10
  apis/MicroblocksApi.ts
@@ -61,6 +62,8 @@ models/CoreNodeInfoResponse.ts
61
62
  models/CoreNodePoxResponse.ts
62
63
  models/FeeRate.ts
63
64
  models/FeeRateRequest.ts
65
+ models/FtHolderEntry.ts
66
+ models/FungibleTokenHolderList.ts
64
67
  models/GetRawTransactionResult.ts
65
68
  models/GetStxSupplyLegacyFormatResponse.ts
66
69
  models/GetStxSupplyResponse.ts
@@ -226,7 +226,7 @@ export interface AccountsApiInterface {
226
226
  getAccountStxBalance(requestParameters: GetAccountStxBalanceRequest, initOverrides?: RequestInit): Promise<object>;
227
227
 
228
228
  /**
229
- * Retrieves a list of all Transactions for a given Address or Contract Identifier. More information on Transaction types can be found [here](https://docs.stacks.co/understand-stacks/transactions#types). If you need to actively monitor new transactions for an address or contract id, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
229
+ * **NOTE:** This endpoint is deprecated in favor of [Get address transactions](/api/get-address-transactions). Retrieves a list of all Transactions for a given Address or Contract Identifier. More information on Transaction types can be found [here](https://docs.stacks.co/understand-stacks/transactions#types). If you need to actively monitor new transactions for an address or contract id, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
230
230
  * @summary Get account transactions
231
231
  * @param {string} principal Stacks address or a Contract identifier
232
232
  * @param {number} [limit] max number of account transactions to fetch
@@ -241,7 +241,7 @@ export interface AccountsApiInterface {
241
241
  getAccountTransactionsRaw(requestParameters: GetAccountTransactionsRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<AddressTransactionsListResponse>>;
242
242
 
243
243
  /**
244
- * Retrieves a list of all Transactions for a given Address or Contract Identifier. More information on Transaction types can be found [here](https://docs.stacks.co/understand-stacks/transactions#types). If you need to actively monitor new transactions for an address or contract id, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
244
+ * **NOTE:** This endpoint is deprecated in favor of [Get address transactions](/api/get-address-transactions). Retrieves a list of all Transactions for a given Address or Contract Identifier. More information on Transaction types can be found [here](https://docs.stacks.co/understand-stacks/transactions#types). If you need to actively monitor new transactions for an address or contract id, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
245
245
  * Get account transactions
246
246
  */
247
247
  getAccountTransactions(requestParameters: GetAccountTransactionsRequest, initOverrides?: RequestInit): Promise<AddressTransactionsListResponse>;
@@ -268,7 +268,7 @@ export interface AccountsApiInterface {
268
268
  getAccountTransactionsWithTransfers(requestParameters: GetAccountTransactionsWithTransfersRequest, initOverrides?: RequestInit): Promise<AddressTransactionsWithTransfersListResponse>;
269
269
 
270
270
  /**
271
- * Retrieves transaction details for a given Transaction Id `tx_id`, for a given account or contract Identifier.
271
+ * **NOTE:** This endpoint is deprecated in favor of [Get events for an address transaction](/api/get-address-transaction-events). Retrieves transaction details for a given Transaction Id `tx_id`, for a given account or contract Identifier.
272
272
  * @summary Get account transaction information for specific transaction
273
273
  * @param {string} principal Stacks address or a contract identifier
274
274
  * @param {string} txId Transaction id
@@ -279,7 +279,7 @@ export interface AccountsApiInterface {
279
279
  getSingleTransactionWithTransfersRaw(requestParameters: GetSingleTransactionWithTransfersRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<AddressTransactionWithTransfers>>;
280
280
 
281
281
  /**
282
- * Retrieves transaction details for a given Transaction Id `tx_id`, for a given account or contract Identifier.
282
+ * **NOTE:** This endpoint is deprecated in favor of [Get events for an address transaction](/api/get-address-transaction-events). Retrieves transaction details for a given Transaction Id `tx_id`, for a given account or contract Identifier.
283
283
  * Get account transaction information for specific transaction
284
284
  */
285
285
  getSingleTransactionWithTransfers(requestParameters: GetSingleTransactionWithTransfersRequest, initOverrides?: RequestInit): Promise<AddressTransactionWithTransfers>;
@@ -552,7 +552,7 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface
552
552
  }
553
553
 
554
554
  /**
555
- * Retrieves a list of all Transactions for a given Address or Contract Identifier. More information on Transaction types can be found [here](https://docs.stacks.co/understand-stacks/transactions#types). If you need to actively monitor new transactions for an address or contract id, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
555
+ * **NOTE:** This endpoint is deprecated in favor of [Get address transactions](/api/get-address-transactions). Retrieves a list of all Transactions for a given Address or Contract Identifier. More information on Transaction types can be found [here](https://docs.stacks.co/understand-stacks/transactions#types). If you need to actively monitor new transactions for an address or contract id, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
556
556
  * Get account transactions
557
557
  */
558
558
  async getAccountTransactionsRaw(requestParameters: GetAccountTransactionsRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<AddressTransactionsListResponse>> {
@@ -595,7 +595,7 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface
595
595
  }
596
596
 
597
597
  /**
598
- * Retrieves a list of all Transactions for a given Address or Contract Identifier. More information on Transaction types can be found [here](https://docs.stacks.co/understand-stacks/transactions#types). If you need to actively monitor new transactions for an address or contract id, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
598
+ * **NOTE:** This endpoint is deprecated in favor of [Get address transactions](/api/get-address-transactions). Retrieves a list of all Transactions for a given Address or Contract Identifier. More information on Transaction types can be found [here](https://docs.stacks.co/understand-stacks/transactions#types). If you need to actively monitor new transactions for an address or contract id, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.
599
599
  * Get account transactions
600
600
  */
601
601
  async getAccountTransactions(requestParameters: GetAccountTransactionsRequest, initOverrides?: RequestInit): Promise<AddressTransactionsListResponse> {
@@ -656,7 +656,7 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface
656
656
  }
657
657
 
658
658
  /**
659
- * Retrieves transaction details for a given Transaction Id `tx_id`, for a given account or contract Identifier.
659
+ * **NOTE:** This endpoint is deprecated in favor of [Get events for an address transaction](/api/get-address-transaction-events). Retrieves transaction details for a given Transaction Id `tx_id`, for a given account or contract Identifier.
660
660
  * Get account transaction information for specific transaction
661
661
  */
662
662
  async getSingleTransactionWithTransfersRaw(requestParameters: GetSingleTransactionWithTransfersRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<AddressTransactionWithTransfers>> {
@@ -683,7 +683,7 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface
683
683
  }
684
684
 
685
685
  /**
686
- * Retrieves transaction details for a given Transaction Id `tx_id`, for a given account or contract Identifier.
686
+ * **NOTE:** This endpoint is deprecated in favor of [Get events for an address transaction](/api/get-address-transaction-events). Retrieves transaction details for a given Transaction Id `tx_id`, for a given account or contract Identifier.
687
687
  * Get account transaction information for specific transaction
688
688
  */
689
689
  async getSingleTransactionWithTransfers(requestParameters: GetSingleTransactionWithTransfersRequest, initOverrides?: RequestInit): Promise<AddressTransactionWithTransfers> {
@@ -0,0 +1,89 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Stacks Blockchain API
5
+ * Welcome to the API reference overview for the [Stacks Blockchain API](https://docs.hiro.so/stacks-blockchain-api). [Download Postman collection](https://hirosystems.github.io/stacks-blockchain-api/collection.json)
6
+ *
7
+ * The version of the OpenAPI document: STACKS_API_VERSION
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import {
18
+ FungibleTokenHolderList,
19
+ FungibleTokenHolderListFromJSON,
20
+ FungibleTokenHolderListToJSON,
21
+ } from '../models';
22
+
23
+ export interface GetFtHoldersRequest {
24
+ token: string;
25
+ }
26
+
27
+ /**
28
+ * FungibleTokensApi - interface
29
+ *
30
+ * @export
31
+ * @interface FungibleTokensApiInterface
32
+ */
33
+ export interface FungibleTokensApiInterface {
34
+ /**
35
+ * Retrieves the list of Fungible Token holders for a given token ID. Specify `stx` for the `token` parameter to get the list of STX holders.
36
+ * @summary Fungible token holders
37
+ * @param {string} token fungible token identifier
38
+ * @param {*} [options] Override http request option.
39
+ * @throws {RequiredError}
40
+ * @memberof FungibleTokensApiInterface
41
+ */
42
+ getFtHoldersRaw(requestParameters: GetFtHoldersRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<FungibleTokenHolderList>>;
43
+
44
+ /**
45
+ * Retrieves the list of Fungible Token holders for a given token ID. Specify `stx` for the `token` parameter to get the list of STX holders.
46
+ * Fungible token holders
47
+ */
48
+ getFtHolders(requestParameters: GetFtHoldersRequest, initOverrides?: RequestInit): Promise<FungibleTokenHolderList>;
49
+
50
+ }
51
+
52
+ /**
53
+ *
54
+ */
55
+ export class FungibleTokensApi extends runtime.BaseAPI implements FungibleTokensApiInterface {
56
+
57
+ /**
58
+ * Retrieves the list of Fungible Token holders for a given token ID. Specify `stx` for the `token` parameter to get the list of STX holders.
59
+ * Fungible token holders
60
+ */
61
+ async getFtHoldersRaw(requestParameters: GetFtHoldersRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<FungibleTokenHolderList>> {
62
+ if (requestParameters.token === null || requestParameters.token === undefined) {
63
+ throw new runtime.RequiredError('token','Required parameter requestParameters.token was null or undefined when calling getFtHolders.');
64
+ }
65
+
66
+ const queryParameters: any = {};
67
+
68
+ const headerParameters: runtime.HTTPHeaders = {};
69
+
70
+ const response = await this.request({
71
+ path: `/extended/v1/tokens/ft/{token}/holders`.replace(`{${"token"}}`, encodeURIComponent(String(requestParameters.token))),
72
+ method: 'GET',
73
+ headers: headerParameters,
74
+ query: queryParameters,
75
+ }, initOverrides);
76
+
77
+ return new runtime.JSONApiResponse(response, (jsonValue) => FungibleTokenHolderListFromJSON(jsonValue));
78
+ }
79
+
80
+ /**
81
+ * Retrieves the list of Fungible Token holders for a given token ID. Specify `stx` for the `token` parameter to get the list of STX holders.
82
+ * Fungible token holders
83
+ */
84
+ async getFtHolders(requestParameters: GetFtHoldersRequest, initOverrides?: RequestInit): Promise<FungibleTokenHolderList> {
85
+ const response = await this.getFtHoldersRaw(requestParameters, initOverrides);
86
+ return await response.value();
87
+ }
88
+
89
+ }
@@ -5,6 +5,7 @@ export * from './BlocksApi';
5
5
  export * from './BurnBlocksApi';
6
6
  export * from './FaucetsApi';
7
7
  export * from './FeesApi';
8
+ export * from './FungibleTokensApi';
8
9
  export * from './InfoApi';
9
10
  export * from './MempoolApi';
10
11
  export * from './MicroblocksApi';
@@ -0,0 +1,64 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Stacks Blockchain API
5
+ * Welcome to the API reference overview for the [Stacks Blockchain API](https://docs.hiro.so/stacks-blockchain-api). [Download Postman collection](https://hirosystems.github.io/stacks-blockchain-api/collection.json)
6
+ *
7
+ * The version of the OpenAPI document: STACKS_API_VERSION
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { exists, mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface FtHolderEntry
20
+ */
21
+ export interface FtHolderEntry {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof FtHolderEntry
26
+ */
27
+ address: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof FtHolderEntry
32
+ */
33
+ balance: string;
34
+ }
35
+
36
+ export function FtHolderEntryFromJSON(json: any): FtHolderEntry {
37
+ return FtHolderEntryFromJSONTyped(json, false);
38
+ }
39
+
40
+ export function FtHolderEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): FtHolderEntry {
41
+ if ((json === undefined) || (json === null)) {
42
+ return json;
43
+ }
44
+ return {
45
+
46
+ 'address': json['address'],
47
+ 'balance': json['balance'],
48
+ };
49
+ }
50
+
51
+ export function FtHolderEntryToJSON(value?: FtHolderEntry | null): any {
52
+ if (value === undefined) {
53
+ return undefined;
54
+ }
55
+ if (value === null) {
56
+ return null;
57
+ }
58
+ return {
59
+
60
+ 'address': value.address,
61
+ 'balance': value.balance,
62
+ };
63
+ }
64
+
@@ -0,0 +1,95 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Stacks Blockchain API
5
+ * Welcome to the API reference overview for the [Stacks Blockchain API](https://docs.hiro.so/stacks-blockchain-api). [Download Postman collection](https://hirosystems.github.io/stacks-blockchain-api/collection.json)
6
+ *
7
+ * The version of the OpenAPI document: STACKS_API_VERSION
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { exists, mapValues } from '../runtime';
16
+ import {
17
+ FtHolderEntry,
18
+ FtHolderEntryFromJSON,
19
+ FtHolderEntryFromJSONTyped,
20
+ FtHolderEntryToJSON,
21
+ } from './';
22
+
23
+ /**
24
+ * List of Fungible Token holders
25
+ * @export
26
+ * @interface FungibleTokenHolderList
27
+ */
28
+ export interface FungibleTokenHolderList {
29
+ /**
30
+ * The number of holders to return
31
+ * @type {number}
32
+ * @memberof FungibleTokenHolderList
33
+ */
34
+ limit: number;
35
+ /**
36
+ * The number to holders to skip (starting at `0`)
37
+ * @type {number}
38
+ * @memberof FungibleTokenHolderList
39
+ */
40
+ offset: number;
41
+ /**
42
+ * The number of holders available
43
+ * @type {number}
44
+ * @memberof FungibleTokenHolderList
45
+ */
46
+ total: number;
47
+ /**
48
+ * The total supply of the token (the sum of all balances)
49
+ * @type {string}
50
+ * @memberof FungibleTokenHolderList
51
+ */
52
+ total_supply: string;
53
+ /**
54
+ *
55
+ * @type {Array<FtHolderEntry>}
56
+ * @memberof FungibleTokenHolderList
57
+ */
58
+ results: Array<FtHolderEntry>;
59
+ }
60
+
61
+ export function FungibleTokenHolderListFromJSON(json: any): FungibleTokenHolderList {
62
+ return FungibleTokenHolderListFromJSONTyped(json, false);
63
+ }
64
+
65
+ export function FungibleTokenHolderListFromJSONTyped(json: any, ignoreDiscriminator: boolean): FungibleTokenHolderList {
66
+ if ((json === undefined) || (json === null)) {
67
+ return json;
68
+ }
69
+ return {
70
+
71
+ 'limit': json['limit'],
72
+ 'offset': json['offset'],
73
+ 'total': json['total'],
74
+ 'total_supply': json['total_supply'],
75
+ 'results': ((json['results'] as Array<any>).map(FtHolderEntryFromJSON)),
76
+ };
77
+ }
78
+
79
+ export function FungibleTokenHolderListToJSON(value?: FungibleTokenHolderList | null): any {
80
+ if (value === undefined) {
81
+ return undefined;
82
+ }
83
+ if (value === null) {
84
+ return null;
85
+ }
86
+ return {
87
+
88
+ 'limit': value.limit,
89
+ 'offset': value.offset,
90
+ 'total': value.total,
91
+ 'total_supply': value.total_supply,
92
+ 'results': ((value.results as Array<any>).map(FtHolderEntryToJSON)),
93
+ };
94
+ }
95
+
@@ -43,6 +43,8 @@ export * from './CoreNodeInfoResponse';
43
43
  export * from './CoreNodePoxResponse';
44
44
  export * from './FeeRate';
45
45
  export * from './FeeRateRequest';
46
+ export * from './FtHolderEntry';
47
+ export * from './FungibleTokenHolderList';
46
48
  export * from './GetRawTransactionResult';
47
49
  export * from './GetStxSupplyLegacyFormatResponse';
48
50
  export * from './GetStxSupplyResponse';