GET /v0/state/permission_links

Fetches snapshots of any account’s linked authorizations on the blockchain, at any block height.

Usage

Sample request:


curl -H "Authorization: Bearer eyJhbGciOiJLTVNFUzI1Ni..." \
  "https://mainnet.eos.dfuse.io/v0/state/permission_links?account=eoscanadacom&block_num=10000000"

fetch('https://mainnet.eos.dfuse.io/v0/state/permission_links?account=eoscanadacom&block_num=10000000', {
  headers: {
    'Authorization': 'Bearer eyJhbGciOiJLTVNFUzI1Ni...'
  }
}).then(console.log)

headers = { 'Authorization' : 'Bearer eyJhbGciOiJLTVNFUzI1Ni...' }
r = requests.get('https://mainnet.eos.dfuse.io/v0/state/permission_links?account=eoscanadacom&block_num=10000000', headers=headers, verify=False)
j = json.loads(r.text)
print(json.dumps(j, indent=4))

req, err := http.NewRequest("GET", "https://mainnet.eos.dfuse.io/v0/state/permission_links?account=eoscanadacom&block_num=10000000", 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()

Fetches snapshots of any account’s linked authorizations on the blockchain, at any block height.

Requesting past blocks

The block_num parameter determines for which block you want a linked authorizations snapshot. This can be anywhere in the chain’s history.

If the requested block_num is irreversible, you will get an immutable snapshot. If the block_num is still in a reversible chain, you will get a full consistent snapshot, but it is not guaranteed to be the view that will pass irreversibility. Inspect the returned up_to_block_id parameter to understand from which longest chain the returned value is a snapshot of.

Input parameters

account
required
AccountName .  Account to query linked permissions from.
block_num
Optional
Number (uint32) .  Defaults to head block num. The block number for which you want to retrieve the consistent linked permissions snapshot.

Response

up_to_block_id
Optional
String .  Block ID at which the snapshot was taken when querying the reversible chain segment. This will not be present if querying blocks older than the last irreversible block.
up_to_block_num
Optional
Number (uint32) .  Block number extracted from up_to_block_id if present, provided as a convenience so you don’t need to extract it yourself.
last_irreversible_block_id
Optional
String .  Last irreversible block considered for this request. The returned snapshot is still for the requested block_num, even though the irreversible block shown here is more recent.
last_irreversible_block_num
Optional
Number (uint32) .  Block number extracted from last_irreversible_block_num, provided as a convenience so you don’t need to extract it yourself.
linked_permissions
required
Array<LinkedPermission> .  An array of linked permissions for the account, sorted by the contract field and on action when there is a tie at the contract level.

Here is a sample response, for a request at block_num: 8:


{
  "up_to_block_id": "0000001000000000000000000000000000000000000000000000000000000000",
  "up_to_block_num": 8,
  "last_irreversible_block_id": "0000000400000000000000000000000000000000000000000000000000000000",
  "last_irreversible_block_num": 4,
  "linked_permissions": [
    {
      "contract": "eosio",
      "action": "claimrewards",
      "permission_name": "claimer"
    }
  ]
}