Skip to content

Commit f8ef9a2

Browse files
Merge pull request #559 from InjectiveLabs/feat/tx-cursor-pagination
Feat/tx cursor pagination
2 parents 4031bd7 + cb53979 commit f8ef9a2

File tree

5 files changed

+576
-74
lines changed

5 files changed

+576
-74
lines changed

.eslintrc.js

Lines changed: 0 additions & 73 deletions
This file was deleted.

packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcExplorerApi.spec.ts

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ExplorerValidator } from '../types/index.js'
66
import { IndexerGrpcExplorerApi } from './IndexerGrpcExplorerApi.js'
77

88
const injectiveAddress = mockFactory.injectiveAddress
9-
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
9+
const endpoints = getNetworkEndpoints(Network.Devnet1)
1010
const indexerGrpcExplorerApi = new IndexerGrpcExplorerApi(endpoints.indexer)
1111

1212
describe('IndexerGrpcExplorerApi', () => {
@@ -241,4 +241,66 @@ describe('IndexerGrpcExplorerApi', () => {
241241
)
242242
}
243243
})
244+
245+
test.only('fetchTxsV2', async () => {
246+
try {
247+
const response = await indexerGrpcExplorerApi.fetchTxsV2({
248+
perPage: 10,
249+
type: 'cosmos.gov.v1beta1.MsgVote,cosmos.gov.v1.MsgVote',
250+
})
251+
252+
const { data: txs } = response
253+
254+
expect(response).toBeDefined()
255+
256+
expect(txs).toBeDefined()
257+
expect(txs).toEqual(expect.objectContaining<typeof txs>(txs))
258+
} catch (e) {
259+
console.error('IndexerGrpcExplorerApi.fetchTxV2 => ' + (e as any).message)
260+
}
261+
})
262+
263+
test('fetchAccountTxsV2', async () => {
264+
try {
265+
const response = await indexerGrpcExplorerApi.fetchAccountTxsV2({
266+
address: 'inj17gkuet8f6pssxd8nycm3qr9d9y699rupv6397z',
267+
perPage: 10,
268+
})
269+
270+
expect(response).toBeDefined()
271+
} catch (e) {
272+
console.error(
273+
'IndexerGrpcExplorerApi.fetchAccountTxsV2 => ' + (e as any).message,
274+
)
275+
}
276+
})
277+
278+
test('fetchBlocksV2', async () => {
279+
try {
280+
const response = await indexerGrpcExplorerApi.fetchBlocksV2({
281+
perPage: 10,
282+
})
283+
284+
expect(response).toBeDefined()
285+
} catch (e) {
286+
console.error(
287+
'IndexerGrpcExplorerApi.fetchBlocksV2 => ' + (e as any).message,
288+
)
289+
}
290+
})
291+
292+
test('fetchContractTxsV2', async () => {
293+
try {
294+
const response = await indexerGrpcExplorerApi.fetchContractTxsV2({
295+
contractAddress: 'inj1qk00h5atutpsv900x202pxx42npjr9thrzhgxn',
296+
perPage: 10,
297+
})
298+
299+
expect(response).toBeDefined()
300+
} catch (e) {
301+
console.error(
302+
'IndexerGrpcExplorerApi.fetchContractTxsV2 => ' + (e as any).message,
303+
)
304+
}
305+
})
244306
})

0 commit comments

Comments
 (0)