Skip to content

Commit

Permalink
Fix tx search query
Browse files Browse the repository at this point in the history
  • Loading branch information
joon9823 committed Jan 5, 2024
1 parent eb65ce0 commit 3fddb17
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@initia/initia.js",
"version": "0.1.23",
"version": "0.1.24",
"description": "The JavaScript SDK for Initia",
"license": "MIT",
"author": "InitiaLabs",
Expand Down
8 changes: 4 additions & 4 deletions src/client/lcd/api/TxAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export namespace SimulateResponse {
}

export interface TxSearchOptions extends PaginationOptions {
events: { key: string; value: string }[];
query: { key: string; value: string }[];
}

export class TxAPI extends BaseAPI {
Expand Down Expand Up @@ -542,14 +542,14 @@ export class TxAPI extends BaseAPI {
const params = new URLSearchParams();

// build search params
options.events?.forEach(v =>
options.query?.forEach(v =>
params.append(
'events',
'query',
v.key === 'tx.height' ? `${v.key}=${v.value}` : `${v.key}='${v.value}'`
)
);

delete options['events'];
delete options['query'];

Object.entries(options).forEach(v => {
params.append(v[0], v[1] as string);
Expand Down

0 comments on commit 3fddb17

Please sign in to comment.