diff --git a/storage/client/client.go b/storage/client/client.go index 92e86e60d..a920cb715 100644 --- a/storage/client/client.go +++ b/storage/client/client.go @@ -1535,7 +1535,7 @@ func (c *StorageClient) RuntimeTokenHolders(ctx context.Context, p apiTypes.GetR func (c *StorageClient) RuntimeEVMNFTs(ctx context.Context, p apiTypes.GetRuntimeEvmNftsAddressParams, address staking.Address) (*EvmNftList, error) { res, err := c.withTotalCount( ctx, - "SELECT 1 FROM FALSE", // todo: queries.EvmNfts + queries.EvmNfts, runtimeFromCtx(ctx), address, p.Limit, diff --git a/storage/client/queries/queries.go b/storage/client/queries/queries.go index bce571e96..3434baed2 100644 --- a/storage/client/queries/queries.go +++ b/storage/client/queries/queries.go @@ -501,6 +501,32 @@ const ( LIMIT $3::bigint OFFSET $4::bigint` + EvmNfts = ` + SELECT + chain.evm_nfts.token_address, + chain.address_preimages.context_identifier, + chain.address_preimages.context_version, + chain.address_preimages.address_data, + chain.evm_tokens.token_name, + chain.evm_tokens.symbol, + chain.evm_tokens.token_type, + chain.evm_tokens.total_supply, + chain.evm_nfts.nft_id, + chain.evm_nfts.metadata_uri, + chain.evm_nfts.metadata_accessed, + chain.evm_nfts.name, + chain.evm_nfts.description, + chain.evm_nfts.image + FROM chain.evm_nfts + LEFT JOIN chain.address_preimages ON + chain.address_preimages.address = chain.evm_nfts.token_address + LEFT JOIN chain.evm_tokens USING (runtime, token_address) + WHERE + runtime = $1::runtime AND + token_address = $2::oasis_addr + LIMIT $3::bigint + OFFSET $4::bigint` + AccountRuntimeSdkBalances = ` SELECT balance AS balance,