@@ -29,56 +29,57 @@ import {
29
29
## Get account assets
30
30
31
31
Retrieves a list of all assets events associated with an account or a Contract Identifier. This includes Transfers, Mints.
32
- ### Path Parameters
33
32
34
- < Property name = { " principal " } type = { " string " } required = { true } deprecated = { false } >
33
+ ### Query Parameters
35
34
36
- Stacks address or a Contract identifier
35
+ < Property name = { " limit " } type = { " Limit " } required = { false } deprecated = { false } >
37
36
38
- < span >Example: ` "SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0" ` </ span >
37
+ Results per page
39
38
40
- </Property >
41
- ### Query Parameters
39
+ <span >Default: ` 20 ` </span >
42
40
43
- <Property name = { " limit " } type = { " integer " } required = { false } deprecated = { false } >
41
+ <span >Minimum: ` 0 ` </ span >
44
42
45
- max number of account assets to fetch
46
-
47
- <span >Example: ` 20 ` </span >
43
+ <span >Maximum: ` 100 ` </span >
48
44
49
45
</Property >
50
46
51
- <Property name = { " offset" } type = { " integer" } required = { false } deprecated = { false } >
47
+ <Property name = { " offset" } type = { " Offset" } required = { false } deprecated = { false } >
48
+
49
+ Result offset
52
50
53
- index of first account assets to fetch
51
+ < span >Default: ` 0 ` </ span >
54
52
55
- <span >Example : ` 42000 ` </span >
53
+ <span >Minimum : ` 0 ` </span >
56
54
57
55
</Property >
58
56
59
57
<Property name = { " unanchored" } type = { " boolean" } required = { false } deprecated = { false } >
60
58
61
- Include transaction data from unanchored (i.e. unconfirmed) microblocks
62
-
63
- <span >Example: ` true ` </span >
59
+ Include data from unanchored (i.e. unconfirmed) microblocks
64
60
65
61
<span >Default: ` false ` </span >
66
62
67
63
</Property >
68
64
69
65
<Property name = { " until_block" } type = { " string" } required = { false } deprecated = { false } >
70
66
71
- returned data representing the state at that point in time, rather than the current block. Note - Use either of the query parameters but not both at a time.
67
+ Block hash or block height. Return data representing the state up until that point in time, rather than the current block. Note - Use either of the query parameters but not both at a time.
72
68
73
- <span >Example: ` 60000 ` </span >
69
+ </Property >
70
+
71
+ ### Path Parameters
72
+
73
+ <Property name = { " principal" } type = { " Any properties in STX Address, Smart Contract ID" } required = { true } deprecated = { false } >
74
74
75
75
</Property >
76
76
77
77
| Status code | Description |
78
- | :------ | :------ |
79
- | ` 200 ` | Success |
78
+ | ----------- | ----------- |
79
+ | ` 200 ` | Default Response |
80
+ | ` 4XX ` | Default Response |
80
81
81
- <APIPlayground authorization = { undefined } method = { " GET" } route = { " /extended/v1/address/{principal}/assets" } path = { [{" name" :" principal" ," type" :" string " ," defaultValue " : " SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0 " ," isRequired" :true } ]} query = { [{" name" :" limit" ," type" :" number" ," defaultValue" :20 ," isRequired" :false },{" name" :" offset" ," type" :" number" ," defaultValue" :42000 ," isRequired" :false },{" name" :" unanchored" ," type" :" boolean" ," defaultValue" :true ," isRequired" :false },{" name" :" until_block" ," type" :" string" ," defaultValue" :60000 ," isRequired" :false }]} header = { []} body = { undefined } schemas = { {}} >
82
+ <APIPlayground authorization = { undefined } method = { " GET" } route = { " /extended/v1/address/{principal}/assets" } path = { [{" name" :" principal" ," type" :" switcher " ," items " :{ " STX Address " :{ " type " : " ref " ," isRequired" :true , " schema " : " 0 " }, " Smart Contract ID " :{ " type " : " ref " , " isRequired " : true , " schema " : " 1 " }}, " isRequired " : true } ]} query = { [{" name" :" limit" ," type" :" number" ," defaultValue" :" " ," isRequired" :false , " description " : " Limit " },{" name" :" offset" ," type" :" number" ," defaultValue" :" " ," isRequired" :false , " description " : " Offset " },{" name" :" unanchored" ," type" :" boolean" ," defaultValue" :" " ," isRequired" :false },{" name" :" until_block" ," type" :" string" ," defaultValue" :" " ," isRequired" :false }]} header = { []} body = { undefined } schemas = { {" 0 " :{ " type " : " string " , " defaultValue " : " " , " isRequired " : false , " description " : " STX Address " }, " 1 " :{ " type " : " string " , " defaultValue " : " " , " isRequired " : false , " description " : " Smart Contract ID " } }} >
82
83
83
84
</APIPlayground >
84
85
@@ -90,16 +91,16 @@ returned data representing the state at that point in time, rather than the curr
90
91
91
92
<Request value = { " cURL" } >
92
93
93
- ``` terminal
94
- $ curl -X GET "https://api.hiro.so/extended/v1/address/SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0 /assets?limit=20&offset=42000 &unanchored=true &until_block=60000 "
94
+ ``` bash
95
+ curl -X GET " https://api.hiro.so/extended/v1/address/SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP /assets?limit=20&offset=0 &unanchored=false &until_block=string "
95
96
```
96
97
97
98
</Request >
98
99
99
100
<Request value = { " JavaScript" } >
100
101
101
102
``` js
102
- fetch (" https://api.hiro.so/extended/v1/address/SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0 /assets?limit=20&offset=42000 &unanchored=true &until_block=60000 " , {
103
+ fetch (" https://api.hiro.so/extended/v1/address/SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP /assets?limit=20&offset=0 &unanchored=false &until_block=string " , {
103
104
method: " GET"
104
105
});
105
106
```
@@ -108,21 +109,19 @@ fetch("https://api.hiro.so/extended/v1/address/SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0
108
109
109
110
</Requests >
110
111
111
- <Responses items = { [" 200" ]} >
112
+ <Responses items = { [" 200" , " 4XX " ]} >
112
113
113
114
<Response value = { " 200" } >
114
115
115
- GET request that returns address assets
116
-
117
116
<ResponseTypes >
118
117
119
118
<ExampleResponse >
120
119
121
120
``` json
122
121
{
123
- "limit" : 30 ,
122
+ "limit" : 20 ,
124
123
"offset" : 0 ,
125
- "total" : 0 ,
124
+ "total" : 1 ,
126
125
"results" : [
127
126
{
128
127
"event_index" : 0 ,
@@ -146,16 +145,10 @@ GET request that returns address assets
146
145
<TypeScriptResponse >
147
146
148
147
``` ts
149
- export type TransactionEvent =
150
- | TransactionEventSmartContractLog
151
- | TransactionEventStxLock
152
- | TransactionEventStxAsset
153
- | TransactionEventFungibleAsset
154
- | TransactionEventNonFungibleAsset ;
155
148
/**
156
149
* Only present in `smart_contract` and `contract_call` tx types.
157
150
*/
158
- export type TransactionEventSmartContractLog = AbstractTransactionEvent & {
151
+ export type SmartContractLogTransactionEvent = AbstractTransactionEvent & {
159
152
event_type: " smart_contract_log" ;
160
153
tx_id: string ;
161
154
contract_log: {
@@ -170,7 +163,7 @@ export type TransactionEventSmartContractLog = AbstractTransactionEvent & {
170
163
/**
171
164
* Only present in `smart_contract` and `contract_call` tx types.
172
165
*/
173
- export type TransactionEventStxLock = AbstractTransactionEvent & {
166
+ export type StxLockTransactionEvent = AbstractTransactionEvent1 & {
174
167
event_type: " stx_lock" ;
175
168
tx_id: string ;
176
169
stx_lock_event: {
@@ -182,28 +175,33 @@ export type TransactionEventStxLock = AbstractTransactionEvent & {
182
175
/**
183
176
* Only present in `smart_contract` and `contract_call` tx types.
184
177
*/
185
- export type TransactionEventStxAsset = AbstractTransactionEvent & {
178
+ export type StxAssetTransactionEvent = AbstractTransactionEvent2 & {
186
179
event_type: " stx_asset" ;
187
180
tx_id: string ;
188
- asset: TransactionEventAsset ;
181
+ asset: {
182
+ asset_event_type: " transfer" | " mint" | " burn" ;
183
+ sender: string ;
184
+ recipient: string ;
185
+ amount: string ;
186
+ memo? : string ;
187
+ };
189
188
};
190
- export type TransactionEventAssetType = " transfer" | " mint" | " burn" ;
191
- export type TransactionEventFungibleAsset = AbstractTransactionEvent & {
189
+ export type FungibleTokenAssetTransactionEvent = AbstractTransactionEvent3 & {
192
190
event_type: " fungible_token_asset" ;
193
191
tx_id: string ;
194
192
asset: {
195
- asset_event_type: string ;
193
+ asset_event_type: " transfer " | " mint " | " burn " ;
196
194
asset_id: string ;
197
195
sender: string ;
198
196
recipient: string ;
199
197
amount: string ;
200
198
};
201
199
};
202
- export type TransactionEventNonFungibleAsset = AbstractTransactionEvent & {
200
+ export type NonFungibleTokenAssetTransactionEvent = AbstractTransactionEvent4 & {
203
201
event_type: " non_fungible_token_asset" ;
204
202
tx_id: string ;
205
203
asset: {
206
- asset_event_type: string ;
204
+ asset_event_type: " transfer " | " mint " | " burn " ;
207
205
asset_id: string ;
208
206
sender: string ;
209
207
recipient: string ;
@@ -214,26 +212,63 @@ export type TransactionEventNonFungibleAsset = AbstractTransactionEvent & {
214
212
};
215
213
};
216
214
217
- /**
218
- * GET request that returns address assets
219
- */
220
215
export interface AddressAssetsListResponse {
221
216
limit: number ;
222
217
offset: number ;
223
218
total: number ;
224
- results: TransactionEvent [];
219
+ results: (
220
+ | SmartContractLogTransactionEvent
221
+ | StxLockTransactionEvent
222
+ | StxAssetTransactionEvent
223
+ | FungibleTokenAssetTransactionEvent
224
+ | NonFungibleTokenAssetTransactionEvent
225
+ )[];
225
226
}
226
227
export interface AbstractTransactionEvent {
227
228
event_index: number ;
228
229
}
229
- export interface TransactionEventAsset {
230
- asset_event_type? : TransactionEventAssetType ;
231
- asset_id? : string ;
232
- sender? : string ;
233
- recipient? : string ;
234
- amount? : string ;
235
- value? : string ;
236
- memo? : string ;
230
+ export interface AbstractTransactionEvent1 {
231
+ event_index: number ;
232
+ }
233
+ export interface AbstractTransactionEvent2 {
234
+ event_index: number ;
235
+ }
236
+ export interface AbstractTransactionEvent3 {
237
+ event_index: number ;
238
+ }
239
+ export interface AbstractTransactionEvent4 {
240
+ event_index: number ;
241
+ }
242
+ ```
243
+
244
+ </TypeScriptResponse >
245
+
246
+ </ResponseTypes >
247
+
248
+ </Response >
249
+
250
+ <Response value = { " 4XX" } >
251
+
252
+ <ResponseTypes >
253
+
254
+ <ExampleResponse >
255
+
256
+ ``` json
257
+ {
258
+ "error" : " string" ,
259
+ "message" : " string"
260
+ }
261
+ ```
262
+
263
+ </ExampleResponse >
264
+
265
+ <TypeScriptResponse >
266
+
267
+ ``` ts
268
+ export interface ErrorResponse {
269
+ error: string ;
270
+ message? : string ;
271
+ [k : string ]: unknown ;
237
272
}
238
273
```
239
274
0 commit comments