From 3fddb17b2f153b9f46621a60d5d09384f101b9a3 Mon Sep 17 00:00:00 2001 From: joon9823 Date: Fri, 5 Jan 2024 17:01:36 +0900 Subject: [PATCH] Fix tx search query --- package-lock.json | 4 ++-- package.json | 2 +- src/client/lcd/api/TxAPI.ts | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4465c06..60af31f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@initia/initia.js", - "version": "0.1.23", + "version": "0.1.24", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@initia/initia.js", - "version": "0.1.23", + "version": "0.1.24", "license": "MIT", "dependencies": { "@initia/initia.proto": "^0.1.21", diff --git a/package.json b/package.json index aed2a0d..9a854cd 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/client/lcd/api/TxAPI.ts b/src/client/lcd/api/TxAPI.ts index ad614c6..e92e1a0 100644 --- a/src/client/lcd/api/TxAPI.ts +++ b/src/client/lcd/api/TxAPI.ts @@ -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 { @@ -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);