概述
所有 DAS 列表方法(getAssetsByOwner、getAssetsByGroup、getAssetsByCreator、getAssetsByAuthority、searchAssets、getTokenAccounts、getNftEditions 和 getSignaturesForAsset)都按页返回结果。你可以通过三种方式分页:
每个请求只能使用一种方式。将
page 与 cursor、before 或 after 混用,或将 cursor 与 before 或 after 混用,都会返回 -32602。
限制
limit设置每页大小。最大值和默认值均为 1,000。page从 1 开始。page: 0会被拒绝。- 批量方法(
getAssetBatch、getAssetProofBatch)最多接受 1,000 个 ID。
页码
传入page 和 limit。响应会回传 page:
limit 时停止。
游标
当你不传page、before 或 after 时,API 按游标分页,并在每一页中返回一个 cursor 值。将它传回即可获取下一页:
id 排序时有效,这也是默认排序方式。
范围
before 和 after 接受资产 ID,并返回它们之间的资产。例如,单独使用 after 可以从某个已知资产 ID 之后继续:
id 排序。
排序
列出资产的方法接受sortBy:
string
id(默认)、created、updated、recent_action 或 none。string
asc(默认)或 desc。id 以外的字段排序只能配合页码使用。将其与 cursor、before 或 after 组合使用会返回 -32602。