accounts_resource
Overview#
Fetch a specific resource under an account by its full type string.
Endpoint#
GET /v1/accounts/{address}/resource/{resource_type}
Aptos-Specific Notes#
- Encode generic types using fully qualified type strings.
Request#
Path Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| address | string | Yes | Account address |
| resource_type | string | Yes | Type tag, e.g. 0x1::dkg::DKGState |
Query Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
| ledger_version | string | No | Historical version read |
Request Body#
None.
Response#
{
"type": "0x1::dkg::DKGState",
"data": { "coin": { "value": "123" } }
}
Code Examples#
- cURL
- Python
- TypeScript
- Rust
curl -X GET https://api-aptos-mainnet.n.dwellir.com/YOUR_API_KEY/v1/accounts/0x1/resource/0x1::dkg::DKGState \
-H "Accept: application/json"
resource = client.account_resource(
"0x1",
"0x1::dkg::DKGState"
)
const r = await aptos.getAccountResource({
accountAddress: "0x1",
resourceType: "0x1::dkg::DKGState",
});
let r = client.get_account_resource("0x1", "0x1::dkg::DKGState").await?;