Fix erc721 assets query

pull/99/head
artemkolodko 2 years ago
parent 8a9782d1a4
commit f0ba6269e2
  1. 4
      src/api/controllers/ERC1155.ts
  2. 4
      src/api/controllers/ERC721.ts
  3. 4
      src/store/postgres/ERC721.ts

@ -52,13 +52,13 @@ export async function getTokenERC1155Assets(
shardID: ShardID,
address: Address,
offset = 0,
limit = 1000
limit = 10000
): Promise<IERC20Balance[] | null> {
validator({
shardID: isShard(shardID),
address: isAddress(address),
offset: isOffset(offset),
limit: isLimit(limit, 1000),
limit: isLimit(limit, 10000),
})
return await withCache(

@ -36,13 +36,13 @@ export async function getTokenERC721Assets(
shardID: ShardID,
address: Address,
offset = 0,
limit = 1000
limit = 10000
): Promise<IERC20Balance[] | null> {
validator({
shardID: isShard(shardID),
address: isAddress(address),
offset: isOffset(offset),
limit: isLimit(limit),
limit: isLimit(limit, 10000),
})
return await withCache(

@ -116,10 +116,10 @@ export class PostgresStorageERC721 implements IStorageERC721 {
): Promise<IERC721Asset[]> => {
const res = await this.query(
`select * from erc721_asset where token_address=$1
order by created_at desc
order by block_number desc
offset $2
limit $3`,
[address]
[address, offset, limit]
)
return res.map(fromSnakeToCamelResponse)

Loading…
Cancel
Save