sui_tryGetPastObject
Note there is no software-level guarantee/SLA that objects with past versions can be retrieved by this API, even if the object and version exists/existed. The result may vary across nodes depending on their pruning policies. Return the object information for a specified version
Parameters
object_id·ObjectID· requiredthe ID of the queried objectversion·SequenceNumber2· requiredthe version of the queried object. If None, default to the latest known versionoptions·ObjectDataOptions· optionaloptions for specifying the content to be returnedshowBcs·boolean· optionalWhether to show the content in BCS format. Default to be FalseshowContent·boolean· optionalWhether to show the content(i.e., package content or Move struct content) of the object. Default to be FalseshowDisplay·boolean· optionalWhether to show the Display metadata of the object for frontend rendering. Default to be FalseshowOwner·boolean· optionalWhether to show the owner of the object. Default to be FalseshowPreviousTransaction·boolean· optionalWhether to show the previous transaction digest of the object. Default to be FalseshowStorageRebate·boolean· optionalWhether to show the storage rebate of the object. Default to be FalseshowType·boolean· optionalWhether to show the type of the object. Default to be False
Result
SuiPastObjectResponse·ObjectReadobject- The object exists and is found with this versiondetails·ObjectData· requiredstatus·"VersionFound"· required
object- The object does not existdetails·ObjectID· requiredstatus·"ObjectNotExists"· required
object- The object is found to be deleted with this versiondetails·ObjectRef· requiredstatus·"ObjectDeleted"· required
object- The object exists but not found with this versiondetails· [ObjectID,SequenceNumber2] · requiredstatus·"VersionNotFound"· required
object- The asked object version is higher than the latestdetails·object· requiredstatus·"VersionTooHigh"· required
Example
Request
curl https://mainnet-api.inodra.com/v1/jsonrpc \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "sui_tryGetPastObject",
"params": [
"0x11af4b844ff94b3fbef6e36b518da3ad4c5856fa686464524a876b463d129760",
4,
{
"showType": true,
"showOwner": true,
"showPreviousTransaction": true,
"showDisplay": false,
"showContent": true,
"showBcs": false,
"showStorageRebate": true
}
]
}'Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"status": "VersionFound",
"details": {
"objectId": "0x11af4b844ff94b3fbef6e36b518da3ad4c5856fa686464524a876b463d129760",
"version": "4",
"digest": "5VPAwDXy3BL72ehFc7gSJoz27ahMd6spUg5YwYc4ibcv",
"type": "0x2::coin::Coin<0x2::sui::SUI>",
"owner": {
"AddressOwner": "0x3568c40e814d9d5396d23087a0fd641e91e0e00df6c012cded9ef9ba5e5bf042"
},
"previousTransaction": "5jQByoouHBwaico5pQB73GdbzerC2StjTiHh5garBjiV",
"storageRebate": "100",
"content": {
"dataType": "moveObject",
"type": "0x2::coin::Coin<0x2::sui::SUI>",
"hasPublicTransfer": true,
"fields": {
"balance": "10000",
"id": {
"id": "0x11af4b844ff94b3fbef6e36b518da3ad4c5856fa686464524a876b463d129760"
}
}
}
}
}
}