curl --request POST \
--url 'https://rpc-mainnet.solanatracker.io/?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getAssetsByOwner",
"params": {
"ownerAddress": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW",
"limit": 100
}
}
'
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"total": 1,
"limit": 100,
"cursor": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w",
"items": [
{
"interface": "ProgrammableNFT",
"id": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://madlads-collection.s3.us-west-2.amazonaws.com/_collection.json",
"files": [
{
"uri": "https://madlads-collection.s3.us-west-2.amazonaws.com/_collection.png",
"mime": "image/png",
"cdn_uri": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fmadlads-collection.s3.us-west-2.amazonaws.com%2F_collection.png"
}
],
"metadata": {
"name": "Mad Lads",
"symbol": "MAD",
"json_name": "Mad Lads",
"description": "Fock it.",
"attributes": [],
"token_standard": "ProgrammableNonFungible"
},
"links": {
"image": "https://madlads-collection.s3.us-west-2.amazonaws.com/_collection.png",
"external_url": "https://madlads.com"
},
"category": "image"
},
"authorities": [
{
"address": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW",
"scopes": [
"full"
]
}
],
"compression": {
"eligible": false,
"compressed": false,
"data_hash": "",
"creator_hash": "",
"asset_hash": "",
"tree": "",
"seq": 0,
"leaf_id": 0
},
"grouping": [],
"royalty": {
"royalty_model": "creators",
"target": null,
"percent": 0.05,
"basis_points": 500,
"primary_sale_happened": false,
"locked": false
},
"creators": [
{
"address": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW",
"share": 100,
"verified": true
}
],
"ownership": {
"frozen": true,
"delegated": false,
"delegate": null,
"ownership_model": "single",
"owner": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW"
},
"supply": {
"print_max_supply": 0,
"print_current_supply": 0,
"edition_nonce": 253
},
"mutable": true,
"burnt": false,
"token_info": {
"supply": 1,
"decimals": 0,
"token_program": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"mint_authority": "2G5CotQ6Q87yhZxKUWkwLY6Foi12Q3VFQ6KN4nTLbPSz",
"freeze_authority": "2G5CotQ6Q87yhZxKUWkwLY6Foi12Q3VFQ6KN4nTLbPSz"
}
}
],
"last_indexed_slot": 386264187
}
}
DAS API
getAssetsByOwner DAS 方法
列出 Solana 钱包拥有的 NFT、Core 资产、压缩 NFT,以及可选的同质化代币。查看 getAssetsByOwner 的参数和代码示例。
POST
/
curl --request POST \
--url 'https://rpc-mainnet.solanatracker.io/?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getAssetsByOwner",
"params": {
"ownerAddress": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW",
"limit": 100
}
}
'
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"total": 1,
"limit": 100,
"cursor": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w",
"items": [
{
"interface": "ProgrammableNFT",
"id": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://madlads-collection.s3.us-west-2.amazonaws.com/_collection.json",
"files": [
{
"uri": "https://madlads-collection.s3.us-west-2.amazonaws.com/_collection.png",
"mime": "image/png",
"cdn_uri": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fmadlads-collection.s3.us-west-2.amazonaws.com%2F_collection.png"
}
],
"metadata": {
"name": "Mad Lads",
"symbol": "MAD",
"json_name": "Mad Lads",
"description": "Fock it.",
"attributes": [],
"token_standard": "ProgrammableNonFungible"
},
"links": {
"image": "https://madlads-collection.s3.us-west-2.amazonaws.com/_collection.png",
"external_url": "https://madlads.com"
},
"category": "image"
},
"authorities": [
{
"address": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW",
"scopes": [
"full"
]
}
],
"compression": {
"eligible": false,
"compressed": false,
"data_hash": "",
"creator_hash": "",
"asset_hash": "",
"tree": "",
"seq": 0,
"leaf_id": 0
},
"grouping": [],
"royalty": {
"royalty_model": "creators",
"target": null,
"percent": 0.05,
"basis_points": 500,
"primary_sale_happened": false,
"locked": false
},
"creators": [
{
"address": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW",
"share": 100,
"verified": true
}
],
"ownership": {
"frozen": true,
"delegated": false,
"delegate": null,
"ownership_model": "single",
"owner": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW"
},
"supply": {
"print_max_supply": 0,
"print_current_supply": 0,
"edition_nonce": 253
},
"mutable": true,
"burnt": false,
"token_info": {
"supply": 1,
"decimals": 0,
"token_program": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"mint_authority": "2G5CotQ6Q87yhZxKUWkwLY6Foi12Q3VFQ6KN4nTLbPSz",
"freeze_authority": "2G5CotQ6Q87yhZxKUWkwLY6Foi12Q3VFQ6KN4nTLbPSz"
}
}
],
"last_indexed_slot": 386264187
}
}
以
ownerAddress 传入钱包地址。结果包括 SPL Token 和 Token-2022 账户中持有的 NFT、Metaplex Core 资产和压缩 NFT,合并为一个列表。
- 可用的方法名:
getAssetsByOwner和get_assets_by_owner。 - 设置
options.showFungible可同时列出余额不为零的同质化代币。每个代币会带有token_info.balance、token_accounts、associated_token_address,已知价格时还包括price_info.total_price。 - 没有 Token Metadata 或 Token-2022 元数据扩展的代币不会列出。供应量为零的资产会被跳过。
limit默认为 1000,且不能超过 1000。未传入page、before或after时,响应会带有cursor;将其作为cursor传回以获取下一页。page适用于所有排序;cursor、before和after需要默认的id排序。- 默认按资产 id 降序排列。持有超过 200,000 个代币账户的钱包会返回错误。
- 一次请求最多检查 200,000 个候选资产。翻到很深的页时,请使用
cursor分页,而不是很大的page页码。 - 费用:每页 1 积分,计入套餐的 DAS RPS 限制。
请求体
application/json
此页面对您有帮助吗?