Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

地址详情页面 resources 全部渲染 卡爆 #154

Open
uvd opened this issue Jun 2, 2022 · 2 comments
Open

地址详情页面 resources 全部渲染 卡爆 #154

uvd opened this issue Jun 2, 2022 · 2 comments

Comments

@uvd
Copy link
Collaborator

uvd commented Jun 2, 2022

@uvd
Copy link
Collaborator Author

uvd commented Jun 14, 2022

需要RPC 更新接口 starcoinorg/starcoin#3447

@nangongamo
Copy link

starcoin-explorer/src/util/sdk.ts 下可以新增如下 rpc 接口,进行分页查询 resource。

export async function listResourcesByPage(hash: string, startIndex: number,  maxSize: number ) {
  try {
    const provider = providerMap[getNetwork()];
    const result = await provider.send('state.list_resource', [hash, { decode: true, start_index: startIndex, max_size :maxSize }]);
    return result;
  } catch (error: any) {
    console.info(error);
    return false;
  }

}

例如:页面默认查询25条,鼠标往下滑,进入下一页。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants