Skip to content

Commit

Permalink
chore: added params to grpc query
Browse files Browse the repository at this point in the history
  • Loading branch information
bangjelkoski committed Aug 22, 2024
1 parent ccd99f1 commit b38e9bf
Showing 1 changed file with 48 additions and 4 deletions.
52 changes: 48 additions & 4 deletions packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcExplorerApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,18 @@ export class IndexerGrpcExplorerApi extends BaseGrpcConsumer {
address,
limit,
type,
before,
after,
startTime,
endTime,
}: {
address: string
limit?: number
type?: string
before?: number
after?: number
startTime?: number
endTime?: number
}) {
const request = InjectiveExplorerRpc.GetAccountTxsRequest.create()

Expand All @@ -66,6 +74,26 @@ export class IndexerGrpcExplorerApi extends BaseGrpcConsumer {
request.limit = limit
}

if (before) {
request.before = before.toString()
}

if (after) {
request.after = after.toString()
}

if (before) {
request.before = before.toString()
}

if (startTime) {
request.startTime = startTime.toString()
}

if (endTime) {
request.endTime = endTime.toString()
}

if (type) {
request.type = type
}
Expand Down Expand Up @@ -360,14 +388,18 @@ export class IndexerGrpcExplorerApi extends BaseGrpcConsumer {
limit,
skip,
type,
module,
chainModule,
startTime,
endTime,
}: {
before?: number
after?: number
limit?: number
skip?: number
type?: string
module?: string
startTime?: number
endTime?: number
chainModule?: string
}) {
const request = InjectiveExplorerRpc.GetTxsRequest.create()

Expand All @@ -391,8 +423,20 @@ export class IndexerGrpcExplorerApi extends BaseGrpcConsumer {
request.type = type
}

if (module) {
request.module = module
if (chainModule) {
request.module = chainModule
}

if (before) {
request.before = before.toString()
}

if (startTime) {
request.startTime = startTime.toString()
}

if (endTime) {
request.endTime = endTime.toString()
}

try {
Expand Down

0 comments on commit b38e9bf

Please sign in to comment.