Get account assets

Retrieves a list of all asset events associated with an account or a contract identifier.

GET
/extended/v1/address/{principal}/assets

Path Parameters

principalSTX Address & Smart Contract ID

Query Parameters

limit?Limit

Results per page

Default20
Rangevalue <= 100
offset?Offset

Result offset

Default0
unanchored?boolean

Include data from unanchored (i.e. unconfirmed) microblocks

Defaultfalse
until_block?string

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.

Response Body

Default Response

TypeScript Definitions

Use the response body type in TypeScript.

limitinteger
offsetinteger
totalinteger
resultsarray<SmartContractLogTransactionEvent & StxLockTransactionEvent & StxAssetTransactionEvent & FungibleTokenAssetTransactionEvent & NonFungibleTokenAssetTransactionEvent>

Default Response

TypeScript Definitions

Use the response body type in TypeScript.

errorstring
message?string
[key: string]any
curl -X GET "https://api.hiro.so//extended/v1/address/SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP/assets?limit=20&offset=0&unanchored=true&until_block=string"
fetch("https://api.hiro.so//extended/v1/address/SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP/assets?limit=20&offset=0&unanchored=true&until_block=string")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://api.hiro.so//extended/v1/address/SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP/assets?limit=20&offset=0&unanchored=true&until_block=string"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.hiro.so//extended/v1/address/SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP/assets?limit=20&offset=0&unanchored=true&until_block=string"

response = requests.request("GET", url)

print(response.text)
{
  "limit": 20,
  "offset": 0,
  "total": 1,
  "results": [
    {
      "event_index": 0,
      "event_type": "smart_contract_log",
      "tx_id": "string",
      "contract_log": {
        "contract_id": "string",
        "topic": "string",
        "value": {
          "hex": "string",
          "repr": "string"
        }
      }
    }
  ]
}
{
  "error": "string",
  "message": "string"
}