@stacks/blockchain-api-client 1.0.4 → 2.0.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.
Files changed (43) hide show
  1. package/README.md +4 -0
  2. package/lib/generated/apis/AccountsApi.d.ts +8 -4
  3. package/lib/generated/apis/AccountsApi.js +8 -2
  4. package/lib/generated/apis/AccountsApi.js.map +1 -1
  5. package/lib/generated/apis/FaucetsApi.d.ts +24 -20
  6. package/lib/generated/apis/FaucetsApi.js +12 -8
  7. package/lib/generated/apis/FaucetsApi.js.map +1 -1
  8. package/lib/generated/apis/NonFungibleTokensApi.d.ts +110 -1
  9. package/lib/generated/apis/NonFungibleTokensApi.js +132 -0
  10. package/lib/generated/apis/NonFungibleTokensApi.js.map +1 -1
  11. package/lib/generated/models/InlineObject.d.ts +33 -0
  12. package/lib/generated/models/InlineObject.js +45 -0
  13. package/lib/generated/models/InlineObject.js.map +1 -0
  14. package/lib/generated/models/InlineObject1.d.ts +27 -0
  15. package/lib/generated/models/InlineObject1.js +43 -0
  16. package/lib/generated/models/InlineObject1.js.map +1 -0
  17. package/lib/generated/models/NonFungibleTokenHistoryEventList.d.ts +45 -0
  18. package/lib/generated/models/NonFungibleTokenHistoryEventList.js +48 -0
  19. package/lib/generated/models/NonFungibleTokenHistoryEventList.js.map +1 -0
  20. package/lib/generated/models/NonFungibleTokenHoldingsList.d.ts +45 -0
  21. package/lib/generated/models/NonFungibleTokenHoldingsList.js +48 -0
  22. package/lib/generated/models/NonFungibleTokenHoldingsList.js.map +1 -0
  23. package/lib/generated/models/NonFungibleTokenMintList.d.ts +45 -0
  24. package/lib/generated/models/NonFungibleTokenMintList.js +48 -0
  25. package/lib/generated/models/NonFungibleTokenMintList.js.map +1 -0
  26. package/lib/generated/models/RunFaucetResponse.d.ts +1 -1
  27. package/lib/generated/models/index.d.ts +5 -0
  28. package/lib/generated/models/index.js +5 -0
  29. package/lib/generated/models/index.js.map +1 -1
  30. package/lib/index.umd.js +2212 -3316
  31. package/lib/index.umd.js.map +1 -1
  32. package/package.json +2 -2
  33. package/src/generated/.openapi-generator/FILES +5 -0
  34. package/src/generated/apis/AccountsApi.ts +16 -4
  35. package/src/generated/apis/FaucetsApi.ts +35 -19
  36. package/src/generated/apis/NonFungibleTokensApi.ts +265 -0
  37. package/src/generated/models/InlineObject.ts +64 -0
  38. package/src/generated/models/InlineObject1.ts +56 -0
  39. package/src/generated/models/NonFungibleTokenHistoryEventList.ts +80 -0
  40. package/src/generated/models/NonFungibleTokenHoldingsList.ts +80 -0
  41. package/src/generated/models/NonFungibleTokenMintList.ts +80 -0
  42. package/src/generated/models/RunFaucetResponse.ts +1 -1
  43. package/src/generated/models/index.ts +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stacks/blockchain-api-client",
3
- "version": "1.0.4",
3
+ "version": "2.0.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",
@@ -57,7 +57,7 @@
57
57
  "eslint": "^7.25.0",
58
58
  "eslint-config-prettier": "^8.3.0",
59
59
  "eslint-plugin-prettier": "^3.4.0",
60
- "http-server": "^0.12.3",
60
+ "http-server": "^14.0.0",
61
61
  "microbundle": "^0.13.0",
62
62
  "prettier": "^2.2.1",
63
63
  "rimraf": "^3.0.2",
@@ -58,6 +58,8 @@ models/GetRawTransactionResult.ts
58
58
  models/GetStxSupplyLegacyFormatResponse.ts
59
59
  models/GetStxSupplyResponse.ts
60
60
  models/InboundStxTransfer.ts
61
+ models/InlineObject.ts
62
+ models/InlineObject1.ts
61
63
  models/InlineResponse200.ts
62
64
  models/MapEntryResponse.ts
63
65
  models/MempoolTransactionListResponse.ts
@@ -68,7 +70,10 @@ models/NetworkBlockTimesResponse.ts
68
70
  models/NetworkBlockTimesResponseMainnet.ts
69
71
  models/NetworkIdentifier.ts
70
72
  models/NftEvent.ts
73
+ models/NonFungibleTokenHistoryEventList.ts
74
+ models/NonFungibleTokenHoldingsList.ts
71
75
  models/NonFungibleTokenMetadata.ts
76
+ models/NonFungibleTokenMintList.ts
72
77
  models/NonFungibleTokensMetadataList.ts
73
78
  models/OtherTransactionIdentifier.ts
74
79
  models/PostCoreNodeTransactionsError.ts
@@ -83,6 +83,8 @@ export interface GetAccountNftRequest {
83
83
 
84
84
  export interface GetAccountNoncesRequest {
85
85
  principal: string;
86
+ blockHeight?: number;
87
+ blockHash?: string;
86
88
  }
87
89
 
88
90
  export interface GetAccountStxBalanceRequest {
@@ -199,7 +201,7 @@ export interface AccountsApiInterface {
199
201
  getAccountInfo(requestParameters: GetAccountInfoRequest, initOverrides?: RequestInit): Promise<AccountDataResponse>;
200
202
 
201
203
  /**
202
- * Retrieves a list of all nfts owned by an address, contains the clarity value of the identifier of the nft
204
+ * **NOTE:** This endpoint is deprecated in favor of [Non-Fungible Token holdings](#operation/get_nft_holdings). Retrieves a list of all nfts owned by an address, contains the clarity value of the identifier of the nft.
203
205
  * @summary Get nft events
204
206
  * @param {string} principal Stacks address or a Contract identifier (e.g. &#x60;SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0.get-info&#x60;)
205
207
  * @param {number} [limit] number of items to return
@@ -213,7 +215,7 @@ export interface AccountsApiInterface {
213
215
  getAccountNftRaw(requestParameters: GetAccountNftRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<AddressNftListResponse>>;
214
216
 
215
217
  /**
216
- * Retrieves a list of all nfts owned by an address, contains the clarity value of the identifier of the nft
218
+ * **NOTE:** This endpoint is deprecated in favor of [Non-Fungible Token holdings](#operation/get_nft_holdings). Retrieves a list of all nfts owned by an address, contains the clarity value of the identifier of the nft.
217
219
  * Get nft events
218
220
  */
219
221
  getAccountNft(requestParameters: GetAccountNftRequest, initOverrides?: RequestInit): Promise<AddressNftListResponse>;
@@ -222,6 +224,8 @@ export interface AccountsApiInterface {
222
224
  * Retrieves the latest nonce values used by an account by inspecting the mempool, microblock transactions, and anchored transactions.
223
225
  * @summary Get the latest nonce used by an account
224
226
  * @param {string} principal Stacks address (e.g. &#x60;SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0&#x60;)
227
+ * @param {number} [blockHeight] Optionally get the nonce at a given block height
228
+ * @param {string} [blockHash] Optionally get the nonce at a given block hash
225
229
  * @param {*} [options] Override http request option.
226
230
  * @throws {RequiredError}
227
231
  * @memberof AccountsApiInterface
@@ -499,7 +503,7 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface
499
503
  }
500
504
 
501
505
  /**
502
- * Retrieves a list of all nfts owned by an address, contains the clarity value of the identifier of the nft
506
+ * **NOTE:** This endpoint is deprecated in favor of [Non-Fungible Token holdings](#operation/get_nft_holdings). Retrieves a list of all nfts owned by an address, contains the clarity value of the identifier of the nft.
503
507
  * Get nft events
504
508
  */
505
509
  async getAccountNftRaw(requestParameters: GetAccountNftRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<AddressNftListResponse>> {
@@ -538,7 +542,7 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface
538
542
  }
539
543
 
540
544
  /**
541
- * Retrieves a list of all nfts owned by an address, contains the clarity value of the identifier of the nft
545
+ * **NOTE:** This endpoint is deprecated in favor of [Non-Fungible Token holdings](#operation/get_nft_holdings). Retrieves a list of all nfts owned by an address, contains the clarity value of the identifier of the nft.
542
546
  * Get nft events
543
547
  */
544
548
  async getAccountNft(requestParameters: GetAccountNftRequest, initOverrides?: RequestInit): Promise<AddressNftListResponse> {
@@ -557,6 +561,14 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface
557
561
 
558
562
  const queryParameters: any = {};
559
563
 
564
+ if (requestParameters.blockHeight !== undefined) {
565
+ queryParameters['block_height'] = requestParameters.blockHeight;
566
+ }
567
+
568
+ if (requestParameters.blockHash !== undefined) {
569
+ queryParameters['block_hash'] = requestParameters.blockHash;
570
+ }
571
+
560
572
  const headerParameters: runtime.HTTPHeaders = {};
561
573
 
562
574
  const response = await this.request({
@@ -15,6 +15,12 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import {
18
+ InlineObject,
19
+ InlineObjectFromJSON,
20
+ InlineObjectToJSON,
21
+ InlineObject1,
22
+ InlineObject1FromJSON,
23
+ InlineObject1ToJSON,
18
24
  RunFaucetResponse,
19
25
  RunFaucetResponseFromJSON,
20
26
  RunFaucetResponseToJSON,
@@ -22,11 +28,13 @@ import {
22
28
 
23
29
  export interface RunFaucetBtcRequest {
24
30
  address: string;
31
+ inlineObject1?: InlineObject1;
25
32
  }
26
33
 
27
34
  export interface RunFaucetStxRequest {
28
35
  address: string;
29
36
  stacking?: boolean;
37
+ inlineObject?: InlineObject;
30
38
  }
31
39
 
32
40
  /**
@@ -37,9 +45,10 @@ export interface RunFaucetStxRequest {
37
45
  */
38
46
  export interface FaucetsApiInterface {
39
47
  /**
40
- * Retrieves BTC tokens into your TestNet BTC address.
41
- * @summary Get BTC tokens
42
- * @param {string} address BTC address
48
+ * Add 1 BTC token to the specified testnet BTC address. The endpoint returns the transaction ID, which you can use to view the transaction in a testnet Bitcoin block explorer. The tokens are delivered once the transaction has been included in a block. **Note:** This is a testnet only endpoint. This endpoint will not work on the mainnet.
49
+ * @summary Add testnet BTC tokens to address
50
+ * @param {string} address A valid testnet BTC address
51
+ * @param {InlineObject1} [inlineObject1]
43
52
  * @param {*} [options] Override http request option.
44
53
  * @throws {RequiredError}
45
54
  * @memberof FaucetsApiInterface
@@ -47,16 +56,17 @@ export interface FaucetsApiInterface {
47
56
  runFaucetBtcRaw(requestParameters: RunFaucetBtcRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RunFaucetResponse>>;
48
57
 
49
58
  /**
50
- * Retrieves BTC tokens into your TestNet BTC address.
51
- * Get BTC tokens
59
+ * Add 1 BTC token to the specified testnet BTC address. The endpoint returns the transaction ID, which you can use to view the transaction in a testnet Bitcoin block explorer. The tokens are delivered once the transaction has been included in a block. **Note:** This is a testnet only endpoint. This endpoint will not work on the mainnet.
60
+ * Add testnet BTC tokens to address
52
61
  */
53
62
  runFaucetBtc(requestParameters: RunFaucetBtcRequest, initOverrides?: RequestInit): Promise<RunFaucetResponse>;
54
63
 
55
64
  /**
56
- * Retrieves STX tokens into you TestNet STX address.
57
- * @summary Get STX tokens
58
- * @param {string} address STX address
59
- * @param {boolean} [stacking] Request the amount of STX needed for stacking
65
+ * Add 500 STX tokens to the specified testnet address. Testnet STX addresses begin with `ST`. If the `stacking` parameter is set to `true`, the faucet will add the required number of tokens for individual stacking to the specified testnet address. The endpoint returns the transaction ID, which you can use to view the transaction in the [Stacks Explorer](https://explorer.stacks.co/?chain=testnet). The tokens are delivered once the transaction has been included in an anchor block. A common reason for failed faucet transactions is that the faucet has run out of tokens. If you are experiencing failed faucet transactions to a testnet address, you can get help in [Discord](https://stacks.chat). **Note:** This is a testnet only endpoint. This endpoint will not work on the mainnet.
66
+ * @summary Get STX testnet tokens
67
+ * @param {string} address A valid testnet STX address
68
+ * @param {boolean} [stacking] Request the amount of STX tokens needed for individual address stacking
69
+ * @param {InlineObject} [inlineObject]
60
70
  * @param {*} [options] Override http request option.
61
71
  * @throws {RequiredError}
62
72
  * @memberof FaucetsApiInterface
@@ -64,8 +74,8 @@ export interface FaucetsApiInterface {
64
74
  runFaucetStxRaw(requestParameters: RunFaucetStxRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RunFaucetResponse>>;
65
75
 
66
76
  /**
67
- * Retrieves STX tokens into you TestNet STX address.
68
- * Get STX tokens
77
+ * Add 500 STX tokens to the specified testnet address. Testnet STX addresses begin with `ST`. If the `stacking` parameter is set to `true`, the faucet will add the required number of tokens for individual stacking to the specified testnet address. The endpoint returns the transaction ID, which you can use to view the transaction in the [Stacks Explorer](https://explorer.stacks.co/?chain=testnet). The tokens are delivered once the transaction has been included in an anchor block. A common reason for failed faucet transactions is that the faucet has run out of tokens. If you are experiencing failed faucet transactions to a testnet address, you can get help in [Discord](https://stacks.chat). **Note:** This is a testnet only endpoint. This endpoint will not work on the mainnet.
78
+ * Get STX testnet tokens
69
79
  */
70
80
  runFaucetStx(requestParameters: RunFaucetStxRequest, initOverrides?: RequestInit): Promise<RunFaucetResponse>;
71
81
 
@@ -77,8 +87,8 @@ export interface FaucetsApiInterface {
77
87
  export class FaucetsApi extends runtime.BaseAPI implements FaucetsApiInterface {
78
88
 
79
89
  /**
80
- * Retrieves BTC tokens into your TestNet BTC address.
81
- * Get BTC tokens
90
+ * Add 1 BTC token to the specified testnet BTC address. The endpoint returns the transaction ID, which you can use to view the transaction in a testnet Bitcoin block explorer. The tokens are delivered once the transaction has been included in a block. **Note:** This is a testnet only endpoint. This endpoint will not work on the mainnet.
91
+ * Add testnet BTC tokens to address
82
92
  */
83
93
  async runFaucetBtcRaw(requestParameters: RunFaucetBtcRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RunFaucetResponse>> {
84
94
  if (requestParameters.address === null || requestParameters.address === undefined) {
@@ -93,19 +103,22 @@ export class FaucetsApi extends runtime.BaseAPI implements FaucetsApiInterface {
93
103
 
94
104
  const headerParameters: runtime.HTTPHeaders = {};
95
105
 
106
+ headerParameters['Content-Type'] = 'application/json';
107
+
96
108
  const response = await this.request({
97
109
  path: `/extended/v1/faucets/btc`,
98
110
  method: 'POST',
99
111
  headers: headerParameters,
100
112
  query: queryParameters,
113
+ body: InlineObject1ToJSON(requestParameters.inlineObject1),
101
114
  }, initOverrides);
102
115
 
103
116
  return new runtime.JSONApiResponse(response, (jsonValue) => RunFaucetResponseFromJSON(jsonValue));
104
117
  }
105
118
 
106
119
  /**
107
- * Retrieves BTC tokens into your TestNet BTC address.
108
- * Get BTC tokens
120
+ * Add 1 BTC token to the specified testnet BTC address. The endpoint returns the transaction ID, which you can use to view the transaction in a testnet Bitcoin block explorer. The tokens are delivered once the transaction has been included in a block. **Note:** This is a testnet only endpoint. This endpoint will not work on the mainnet.
121
+ * Add testnet BTC tokens to address
109
122
  */
110
123
  async runFaucetBtc(requestParameters: RunFaucetBtcRequest, initOverrides?: RequestInit): Promise<RunFaucetResponse> {
111
124
  const response = await this.runFaucetBtcRaw(requestParameters, initOverrides);
@@ -113,8 +126,8 @@ export class FaucetsApi extends runtime.BaseAPI implements FaucetsApiInterface {
113
126
  }
114
127
 
115
128
  /**
116
- * Retrieves STX tokens into you TestNet STX address.
117
- * Get STX tokens
129
+ * Add 500 STX tokens to the specified testnet address. Testnet STX addresses begin with `ST`. If the `stacking` parameter is set to `true`, the faucet will add the required number of tokens for individual stacking to the specified testnet address. The endpoint returns the transaction ID, which you can use to view the transaction in the [Stacks Explorer](https://explorer.stacks.co/?chain=testnet). The tokens are delivered once the transaction has been included in an anchor block. A common reason for failed faucet transactions is that the faucet has run out of tokens. If you are experiencing failed faucet transactions to a testnet address, you can get help in [Discord](https://stacks.chat). **Note:** This is a testnet only endpoint. This endpoint will not work on the mainnet.
130
+ * Get STX testnet tokens
118
131
  */
119
132
  async runFaucetStxRaw(requestParameters: RunFaucetStxRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<RunFaucetResponse>> {
120
133
  if (requestParameters.address === null || requestParameters.address === undefined) {
@@ -133,19 +146,22 @@ export class FaucetsApi extends runtime.BaseAPI implements FaucetsApiInterface {
133
146
 
134
147
  const headerParameters: runtime.HTTPHeaders = {};
135
148
 
149
+ headerParameters['Content-Type'] = 'application/json';
150
+
136
151
  const response = await this.request({
137
152
  path: `/extended/v1/faucets/stx`,
138
153
  method: 'POST',
139
154
  headers: headerParameters,
140
155
  query: queryParameters,
156
+ body: InlineObjectToJSON(requestParameters.inlineObject),
141
157
  }, initOverrides);
142
158
 
143
159
  return new runtime.JSONApiResponse(response, (jsonValue) => RunFaucetResponseFromJSON(jsonValue));
144
160
  }
145
161
 
146
162
  /**
147
- * Retrieves STX tokens into you TestNet STX address.
148
- * Get STX tokens
163
+ * Add 500 STX tokens to the specified testnet address. Testnet STX addresses begin with `ST`. If the `stacking` parameter is set to `true`, the faucet will add the required number of tokens for individual stacking to the specified testnet address. The endpoint returns the transaction ID, which you can use to view the transaction in the [Stacks Explorer](https://explorer.stacks.co/?chain=testnet). The tokens are delivered once the transaction has been included in an anchor block. A common reason for failed faucet transactions is that the faucet has run out of tokens. If you are experiencing failed faucet transactions to a testnet address, you can get help in [Discord](https://stacks.chat). **Note:** This is a testnet only endpoint. This endpoint will not work on the mainnet.
164
+ * Get STX testnet tokens
149
165
  */
150
166
  async runFaucetStx(requestParameters: RunFaucetStxRequest, initOverrides?: RequestInit): Promise<RunFaucetResponse> {
151
167
  const response = await this.runFaucetStxRaw(requestParameters, initOverrides);
@@ -15,9 +15,18 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import {
18
+ NonFungibleTokenHistoryEventList,
19
+ NonFungibleTokenHistoryEventListFromJSON,
20
+ NonFungibleTokenHistoryEventListToJSON,
21
+ NonFungibleTokenHoldingsList,
22
+ NonFungibleTokenHoldingsListFromJSON,
23
+ NonFungibleTokenHoldingsListToJSON,
18
24
  NonFungibleTokenMetadata,
19
25
  NonFungibleTokenMetadataFromJSON,
20
26
  NonFungibleTokenMetadataToJSON,
27
+ NonFungibleTokenMintList,
28
+ NonFungibleTokenMintListFromJSON,
29
+ NonFungibleTokenMintListToJSON,
21
30
  NonFungibleTokensMetadataList,
22
31
  NonFungibleTokensMetadataListFromJSON,
23
32
  NonFungibleTokensMetadataListToJSON,
@@ -27,11 +36,37 @@ export interface GetContractNftMetadataRequest {
27
36
  contractId: string;
28
37
  }
29
38
 
39
+ export interface GetNftHistoryRequest {
40
+ assetIdentifier: string;
41
+ value: string;
42
+ limit?: number;
43
+ offset?: number;
44
+ unanchored?: boolean;
45
+ txMetadata?: boolean;
46
+ }
47
+
48
+ export interface GetNftHoldingsRequest {
49
+ principal: string;
50
+ assetIdentifiers?: Array<string>;
51
+ limit?: number;
52
+ offset?: number;
53
+ unanchored?: boolean;
54
+ txMetadata?: boolean;
55
+ }
56
+
30
57
  export interface GetNftMetadataListRequest {
31
58
  limit?: number;
32
59
  offset?: number;
33
60
  }
34
61
 
62
+ export interface GetNftMintsRequest {
63
+ assetIdentifier: string;
64
+ limit?: number;
65
+ offset?: number;
66
+ unanchored?: boolean;
67
+ txMetadata?: boolean;
68
+ }
69
+
35
70
  /**
36
71
  * NonFungibleTokensApi - interface
37
72
  *
@@ -55,6 +90,48 @@ export interface NonFungibleTokensApiInterface {
55
90
  */
56
91
  getContractNftMetadata(requestParameters: GetContractNftMetadataRequest, initOverrides?: RequestInit): Promise<NonFungibleTokenMetadata>;
57
92
 
93
+ /**
94
+ * Retrieves all events relevant to a Non-Fungible Token. Useful to determine the ownership history of a particular asset. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
95
+ * @summary Non-Fungible Token history
96
+ * @param {string} assetIdentifier token asset class identifier
97
+ * @param {string} value hex representation of the token\&#39;s unique value
98
+ * @param {number} [limit] max number of events to fetch
99
+ * @param {number} [offset] index of first event to fetch
100
+ * @param {boolean} [unanchored] whether or not to include events from unconfirmed transactions
101
+ * @param {boolean} [txMetadata] whether or not to include the complete transaction metadata instead of just &#x60;tx_id&#x60;. Enabling this option can affect performance and response times.
102
+ * @param {*} [options] Override http request option.
103
+ * @throws {RequiredError}
104
+ * @memberof NonFungibleTokensApiInterface
105
+ */
106
+ getNftHistoryRaw(requestParameters: GetNftHistoryRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NonFungibleTokenHistoryEventList>>;
107
+
108
+ /**
109
+ * Retrieves all events relevant to a Non-Fungible Token. Useful to determine the ownership history of a particular asset. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
110
+ * Non-Fungible Token history
111
+ */
112
+ getNftHistory(requestParameters: GetNftHistoryRequest, initOverrides?: RequestInit): Promise<NonFungibleTokenHistoryEventList>;
113
+
114
+ /**
115
+ * Retrieves the list of Non-Fungible Tokens owned by the given principal (STX address or Smart Contract ID). Results can be filtered by one or more asset identifiers and can include metadata about the transaction that made the principal own each token. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
116
+ * @summary Non-Fungible Token holdings
117
+ * @param {string} principal token owner\&#39;s STX address or Smart Contract ID
118
+ * @param {Array<string>} [assetIdentifiers] identifiers of the token asset classes to filter for
119
+ * @param {number} [limit] max number of tokens to fetch
120
+ * @param {number} [offset] index of first tokens to fetch
121
+ * @param {boolean} [unanchored] whether or not to include tokens from unconfirmed transactions
122
+ * @param {boolean} [txMetadata] whether or not to include the complete transaction metadata instead of just &#x60;tx_id&#x60;. Enabling this option can affect performance and response times.
123
+ * @param {*} [options] Override http request option.
124
+ * @throws {RequiredError}
125
+ * @memberof NonFungibleTokensApiInterface
126
+ */
127
+ getNftHoldingsRaw(requestParameters: GetNftHoldingsRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NonFungibleTokenHoldingsList>>;
128
+
129
+ /**
130
+ * Retrieves the list of Non-Fungible Tokens owned by the given principal (STX address or Smart Contract ID). Results can be filtered by one or more asset identifiers and can include metadata about the transaction that made the principal own each token. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
131
+ * Non-Fungible Token holdings
132
+ */
133
+ getNftHoldings(requestParameters: GetNftHoldingsRequest, initOverrides?: RequestInit): Promise<NonFungibleTokenHoldingsList>;
134
+
58
135
  /**
59
136
  * Retrieves a list of non fungible tokens with their metadata. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
60
137
  * @summary Non fungible tokens metadata list
@@ -72,6 +149,26 @@ export interface NonFungibleTokensApiInterface {
72
149
  */
73
150
  getNftMetadataList(requestParameters: GetNftMetadataListRequest, initOverrides?: RequestInit): Promise<NonFungibleTokensMetadataList>;
74
151
 
152
+ /**
153
+ * Retrieves all mint events for a Non-Fungible Token asset class. Useful to determine which NFTs of a particular collection have been claimed. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
154
+ * @summary Non-Fungible Token mints
155
+ * @param {string} assetIdentifier token asset class identifier
156
+ * @param {number} [limit] max number of events to fetch
157
+ * @param {number} [offset] index of first event to fetch
158
+ * @param {boolean} [unanchored] whether or not to include events from unconfirmed transactions
159
+ * @param {boolean} [txMetadata] whether or not to include the complete transaction metadata instead of just &#x60;tx_id&#x60;. Enabling this option can affect performance and response times.
160
+ * @param {*} [options] Override http request option.
161
+ * @throws {RequiredError}
162
+ * @memberof NonFungibleTokensApiInterface
163
+ */
164
+ getNftMintsRaw(requestParameters: GetNftMintsRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NonFungibleTokenMintList>>;
165
+
166
+ /**
167
+ * Retrieves all mint events for a Non-Fungible Token asset class. Useful to determine which NFTs of a particular collection have been claimed. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
168
+ * Non-Fungible Token mints
169
+ */
170
+ getNftMints(requestParameters: GetNftMintsRequest, initOverrides?: RequestInit): Promise<NonFungibleTokenMintList>;
171
+
75
172
  }
76
173
 
77
174
  /**
@@ -111,6 +208,122 @@ export class NonFungibleTokensApi extends runtime.BaseAPI implements NonFungible
111
208
  return await response.value();
112
209
  }
113
210
 
211
+ /**
212
+ * Retrieves all events relevant to a Non-Fungible Token. Useful to determine the ownership history of a particular asset. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
213
+ * Non-Fungible Token history
214
+ */
215
+ async getNftHistoryRaw(requestParameters: GetNftHistoryRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NonFungibleTokenHistoryEventList>> {
216
+ if (requestParameters.assetIdentifier === null || requestParameters.assetIdentifier === undefined) {
217
+ throw new runtime.RequiredError('assetIdentifier','Required parameter requestParameters.assetIdentifier was null or undefined when calling getNftHistory.');
218
+ }
219
+
220
+ if (requestParameters.value === null || requestParameters.value === undefined) {
221
+ throw new runtime.RequiredError('value','Required parameter requestParameters.value was null or undefined when calling getNftHistory.');
222
+ }
223
+
224
+ const queryParameters: any = {};
225
+
226
+ if (requestParameters.assetIdentifier !== undefined) {
227
+ queryParameters['asset_identifier'] = requestParameters.assetIdentifier;
228
+ }
229
+
230
+ if (requestParameters.value !== undefined) {
231
+ queryParameters['value'] = requestParameters.value;
232
+ }
233
+
234
+ if (requestParameters.limit !== undefined) {
235
+ queryParameters['limit'] = requestParameters.limit;
236
+ }
237
+
238
+ if (requestParameters.offset !== undefined) {
239
+ queryParameters['offset'] = requestParameters.offset;
240
+ }
241
+
242
+ if (requestParameters.unanchored !== undefined) {
243
+ queryParameters['unanchored'] = requestParameters.unanchored;
244
+ }
245
+
246
+ if (requestParameters.txMetadata !== undefined) {
247
+ queryParameters['tx_metadata'] = requestParameters.txMetadata;
248
+ }
249
+
250
+ const headerParameters: runtime.HTTPHeaders = {};
251
+
252
+ const response = await this.request({
253
+ path: `/extended/v1/tokens/nft/history`,
254
+ method: 'GET',
255
+ headers: headerParameters,
256
+ query: queryParameters,
257
+ }, initOverrides);
258
+
259
+ return new runtime.JSONApiResponse(response, (jsonValue) => NonFungibleTokenHistoryEventListFromJSON(jsonValue));
260
+ }
261
+
262
+ /**
263
+ * Retrieves all events relevant to a Non-Fungible Token. Useful to determine the ownership history of a particular asset. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
264
+ * Non-Fungible Token history
265
+ */
266
+ async getNftHistory(requestParameters: GetNftHistoryRequest, initOverrides?: RequestInit): Promise<NonFungibleTokenHistoryEventList> {
267
+ const response = await this.getNftHistoryRaw(requestParameters, initOverrides);
268
+ return await response.value();
269
+ }
270
+
271
+ /**
272
+ * Retrieves the list of Non-Fungible Tokens owned by the given principal (STX address or Smart Contract ID). Results can be filtered by one or more asset identifiers and can include metadata about the transaction that made the principal own each token. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
273
+ * Non-Fungible Token holdings
274
+ */
275
+ async getNftHoldingsRaw(requestParameters: GetNftHoldingsRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NonFungibleTokenHoldingsList>> {
276
+ if (requestParameters.principal === null || requestParameters.principal === undefined) {
277
+ throw new runtime.RequiredError('principal','Required parameter requestParameters.principal was null or undefined when calling getNftHoldings.');
278
+ }
279
+
280
+ const queryParameters: any = {};
281
+
282
+ if (requestParameters.principal !== undefined) {
283
+ queryParameters['principal'] = requestParameters.principal;
284
+ }
285
+
286
+ if (requestParameters.assetIdentifiers) {
287
+ queryParameters['asset_identifiers'] = requestParameters.assetIdentifiers;
288
+ }
289
+
290
+ if (requestParameters.limit !== undefined) {
291
+ queryParameters['limit'] = requestParameters.limit;
292
+ }
293
+
294
+ if (requestParameters.offset !== undefined) {
295
+ queryParameters['offset'] = requestParameters.offset;
296
+ }
297
+
298
+ if (requestParameters.unanchored !== undefined) {
299
+ queryParameters['unanchored'] = requestParameters.unanchored;
300
+ }
301
+
302
+ if (requestParameters.txMetadata !== undefined) {
303
+ queryParameters['tx_metadata'] = requestParameters.txMetadata;
304
+ }
305
+
306
+ const headerParameters: runtime.HTTPHeaders = {};
307
+
308
+ const response = await this.request({
309
+ path: `/extended/v1/tokens/nft/holdings`,
310
+ method: 'GET',
311
+ headers: headerParameters,
312
+ query: queryParameters,
313
+ }, initOverrides);
314
+
315
+ return new runtime.JSONApiResponse(response, (jsonValue) => NonFungibleTokenHoldingsListFromJSON(jsonValue));
316
+ }
317
+
318
+ /**
319
+ * Retrieves the list of Non-Fungible Tokens owned by the given principal (STX address or Smart Contract ID). Results can be filtered by one or more asset identifiers and can include metadata about the transaction that made the principal own each token. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
320
+ * Non-Fungible Token holdings
321
+ */
322
+ async getNftHoldings(requestParameters: GetNftHoldingsRequest, initOverrides?: RequestInit): Promise<NonFungibleTokenHoldingsList> {
323
+ const response = await this.getNftHoldingsRaw(requestParameters, initOverrides);
324
+ return await response.value();
325
+ }
326
+
114
327
  /**
115
328
  * Retrieves a list of non fungible tokens with their metadata. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
116
329
  * Non fungible tokens metadata list
@@ -147,4 +360,56 @@ export class NonFungibleTokensApi extends runtime.BaseAPI implements NonFungible
147
360
  return await response.value();
148
361
  }
149
362
 
363
+ /**
364
+ * Retrieves all mint events for a Non-Fungible Token asset class. Useful to determine which NFTs of a particular collection have been claimed. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
365
+ * Non-Fungible Token mints
366
+ */
367
+ async getNftMintsRaw(requestParameters: GetNftMintsRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<NonFungibleTokenMintList>> {
368
+ if (requestParameters.assetIdentifier === null || requestParameters.assetIdentifier === undefined) {
369
+ throw new runtime.RequiredError('assetIdentifier','Required parameter requestParameters.assetIdentifier was null or undefined when calling getNftMints.');
370
+ }
371
+
372
+ const queryParameters: any = {};
373
+
374
+ if (requestParameters.assetIdentifier !== undefined) {
375
+ queryParameters['asset_identifier'] = requestParameters.assetIdentifier;
376
+ }
377
+
378
+ if (requestParameters.limit !== undefined) {
379
+ queryParameters['limit'] = requestParameters.limit;
380
+ }
381
+
382
+ if (requestParameters.offset !== undefined) {
383
+ queryParameters['offset'] = requestParameters.offset;
384
+ }
385
+
386
+ if (requestParameters.unanchored !== undefined) {
387
+ queryParameters['unanchored'] = requestParameters.unanchored;
388
+ }
389
+
390
+ if (requestParameters.txMetadata !== undefined) {
391
+ queryParameters['tx_metadata'] = requestParameters.txMetadata;
392
+ }
393
+
394
+ const headerParameters: runtime.HTTPHeaders = {};
395
+
396
+ const response = await this.request({
397
+ path: `/extended/v1/tokens/nft/mints`,
398
+ method: 'GET',
399
+ headers: headerParameters,
400
+ query: queryParameters,
401
+ }, initOverrides);
402
+
403
+ return new runtime.JSONApiResponse(response, (jsonValue) => NonFungibleTokenMintListFromJSON(jsonValue));
404
+ }
405
+
406
+ /**
407
+ * Retrieves all mint events for a Non-Fungible Token asset class. Useful to determine which NFTs of a particular collection have been claimed. More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).
408
+ * Non-Fungible Token mints
409
+ */
410
+ async getNftMints(requestParameters: GetNftMintsRequest, initOverrides?: RequestInit): Promise<NonFungibleTokenMintList> {
411
+ const response = await this.getNftMintsRaw(requestParameters, initOverrides);
412
+ return await response.value();
413
+ }
414
+
150
415
  }
@@ -0,0 +1,64 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Stacks Blockchain API
5
+ * Welcome to the API reference overview for the <a href=\"https://docs.hiro.so/get-started/stacks-blockchain-api\">Stacks Blockchain API</a>. <a href=\"/collection.json\" download=\"stacks-api-collection.json\">Download Postman collection</a>
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 InlineObject
20
+ */
21
+ export interface InlineObject {
22
+ /**
23
+ * STX testnet address
24
+ * @type {string}
25
+ * @memberof InlineObject
26
+ */
27
+ address?: string;
28
+ /**
29
+ * Use required number of tokens for stacking
30
+ * @type {boolean}
31
+ * @memberof InlineObject
32
+ */
33
+ stacking?: boolean;
34
+ }
35
+
36
+ export function InlineObjectFromJSON(json: any): InlineObject {
37
+ return InlineObjectFromJSONTyped(json, false);
38
+ }
39
+
40
+ export function InlineObjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): InlineObject {
41
+ if ((json === undefined) || (json === null)) {
42
+ return json;
43
+ }
44
+ return {
45
+
46
+ 'address': !exists(json, 'address') ? undefined : json['address'],
47
+ 'stacking': !exists(json, 'stacking') ? undefined : json['stacking'],
48
+ };
49
+ }
50
+
51
+ export function InlineObjectToJSON(value?: InlineObject | 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
+ 'stacking': value.stacking,
62
+ };
63
+ }
64
+