GET /v0/state/table_scopes
stable
Fetches a list of scopes, for a given table on a contract account, at any block height.
Note
Not to be confused with /v0/state/tables/scopes which retrieves the actual tables. Paired with this endpoint, you can get a consistent view of all tables in a contract.Usage
Sample request:
curl -H "Authorization: Bearer eyJhbGciOiJLTVNFUzI1Ni..." \
"https://eos.dfuse.eosnation.io/v0/state/table_scopes?account=eosforumdapp&table=proposal"
fetch('https://eos.dfuse.eosnation.io/v0/state/table_scopes?account=eosforumdapp&table=proposal', {
headers: {
'Authorization': 'Bearer eyJhbGciOiJLTVNFUzI1Ni...'
}
}).then(console.log)
headers = { 'Authorization' : 'Bearer eyJhbGciOiJLTVNFUzI1Ni...' }
r = requests.get('https://eos.dfuse.eosnation.io/v0/state/table_scopes?account=eosforumdapp&table=proposal', headers=headers, verify=False)
j = json.loads(r.text)
print(json.dumps(j, indent=4))
req, err := http.NewRequest("GET", "https://eos.dfuse.eosnation.io/v0/state/table_scopes?account=eosforumdapp&table=proposal", nil)
if err != nil {
// handle err
}
req.Header.Set("Authorization", "Bearer eyJhbGciOiJLTVNFUzI1Ni...")
resp, err := http.DefaultClient.Do(req)
if err != nil {
// handle err
}
defer resp.Body.Close()
Requesting past blocks
The block_num
parameter determines for which block you want the list
of scopes for the given contract account’s table. This can be anywhere
in the chain’s history.
If the requested block_num
is irreversible, you will get an
immutable list of accounts. Otherwise, there are chances that the
returned value moves as the chain reorganizes.
Input parameters
account
required
AccountName
Contract account holding the requested table.
table
required
TableName
The name-encoded table name you want to retrieve scopes from. Refer to the contract’s ABI for a list of available tables. This is contract dependent.
block_num
Optional
Number
Defaults to head block num. The block number for which you want to retrieve the consistent table scopes snapshot.
Response
block_num
Optional
Number
Block number used to serve your request. Will be the head
block_num
if it was not provided or 0
was passed as block_num
, otherwise, will be the block_num
you’ve passed in the request.
scopes
Optional
Array<Name>
The name-encoded scope of the table you are requesting. For example, user balances for tokens live in their account name’s scope. This is contract dependent, so inspect the ABI for the contract you are interested in.
Here is a sample response, for a request at block_num: 9000000
:
{
"block_num": 9000000,
"scopes": [
"aus1genereos",
"eoscanadacom"
]
}