List state changes
Retrieve a paginated list of state changes for a specific smart object. This endpoint provides access to the complete history of state modifications including action types, wallet interactions, nonce values, and state root transitions. State changes can be filtered by various criteria including wallet ID, action ID, change type, and temporal ranges.
GET
Parameters
Path Parameters
ObjectId
REQUIRED
Query Parameters
Id
Filter resources by their unique identifier
Org_id
Filter resources by the organization they belong to
Autocomplete
Search term for autocomplete functionality
Limit
How many items to return at one time (max 100)
Next
Pagination token for retrieving the next page of results
Order
Sort order for the results (ascending or descending)
SortBy
Field name to sort the results by
Wallet_id
Action_id
Change_type
Action_type
Nonce[$gt]
Nonce[$lt]
Prev_state_root
Next_state_root
When_created[$gt]
When_created[$lt]
When_created[$gte]
When_created[$lte]
| Status code | Description |
|---|---|
| 200 | List of state changes |
| 400 | Bad request error - the request contains invalid parameters or malformed data |
| 500 | Internal server error - an unexpected error occurred on the server |
cURL
curl -L \"https://blockv-labs.io/objects/{objectId}/state-changes?id={id}&org_id={org_id}&autocomplete={autocomplete}&limit={limit}&next={next}&order={order}&sortBy={sortBy}&wallet_id={wallet_id}&action_id={action_id}&change_type={change_type}&action_type={action_type}&nonce[$gt]={nonce[$gt]}&nonce[$lt]={nonce[$lt]}&prev_state_root={prev_state_root}&next_state_root={next_state_root}&when_created[$gt]={when_created[$gt]}&when_created[$lt]={when_created[$lt]}&when_created[$gte]={when_created[$gte]}&when_created[$lte]={when_created[$lte]}" \-H 'Accept: application/json'
Response
{"state_changes": [{"id": "string","wallet_id": "string","object_id": "string","action_id": "string","action_name": "string","change_type": "create","state_hash": "string","prev_state_root": "string","next_state_root": "string","prev_nonce": 0,"next_nonce": 0,"when_created": "2024-01-01T00:00:00Z"}],"next": "string"}
json
{"type": "object","required": ["state_changes"],"properties": {"state_changes": {"type": "array","description": "Array of state changes.","items": {"type": "object","required": ["id","action_id","action_name","object_id","change_type","state_hash","prev_state_root","next_state_root","prev_nonce","next_nonce","when_created"],"properties": {"id": {"type": "string","x-oapi-codegen-extra-tags": {"bson": "_id"},"x-go-type": "id.ID","x-go-type-import": {"path": "github.com/vlabsio/smarttoken/pkg/types/id"},"x-go-type-skip-optional-pointer": true},"wallet_id": {"type": "string","x-oapi-codegen-extra-tags": {"bson": "wallet_id"},"x-go-type": "id.ID","x-go-type-import": {"path": "github.com/vlabsio/smarttoken/pkg/types/id"},"x-go-type-skip-optional-pointer": true},"object_id": {"type": "string","x-oapi-codegen-extra-tags": {"bson": "object_id"},"x-go-type": "id.ID","x-go-type-import": {"path": "github.com/vlabsio/smarttoken/pkg/types/id"}},"action_id": {"type": "string","x-oapi-codegen-extra-tags": {"bson": "action_id"},"x-go-type": "id.ID","x-go-type-import": {"path": "github.com/vlabsio/smarttoken/pkg/types/id"}},"action_name": {"type": "string","description": "The name of the action","x-oapi-codegen-extra-tags": {"bson": "action_name"}},"change_type": {"type": "string","enum": ["create","update","delete"],"x-oapi-codegen-extra-tags": {"bson": "change_type"}},"state_hash": {"type": "string","description": "The hash of the state","x-oapi-codegen-extra-tags": {"bson": "state_hash"}},"prev_state_root": {"type": "string","description": "The previous state","x-oapi-codegen-extra-tags": {"bson": "prev_state_root"}},"next_state_root": {"type": "string","description": "The new state","x-oapi-codegen-extra-tags": {"bson": "next_state_root"}},"prev_nonce": {"type": "integer","description": "The previous version","x-oapi-codegen-extra-tags": {"bson": "prev_version"}},"next_nonce": {"type": "integer","description": "The new version","x-oapi-codegen-extra-tags": {"bson": "next_version"}},"when_created": {"type": "string","format": "date-time","description": "The time the change was created","x-oapi-codegen-extra-tags": {"bson": "when_created"}}}}},"next": {"type": "string","description": "Pagination token for the next set of results, if any.","x-go-type-skip-optional-pointer": true}}}