Skip to content

Commit

Permalink
blank to makes endpoint fail
Browse files Browse the repository at this point in the history
  • Loading branch information
yagopv committed Nov 22, 2024
1 parent 9dfa2a8 commit b8dc3ca
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/api-kit/src/SafeApiKit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,21 @@ class SafeApiKit {
* @throws "Not Found"
* @throws "Ensure this field has at least 1 hexadecimal chars (not counting 0x)."
*/
async decodeData(data: string, to: string = ''): Promise<any> {
async decodeData(data: string, to?: string): Promise<any> {

Check warning on line 125 in packages/api-kit/src/SafeApiKit.ts

View workflow job for this annotation

GitHub Actions / eslint

Unexpected any. Specify a different type
if (data === '') {
throw new Error('Invalid data')
}

const dataDecoderRequest: { data: string; to?: string } = { data }

if (to) {
dataDecoderRequest.to = to
}

return sendRequest({
url: `${this.#txServiceBaseUrl}/v1/data-decoder/`,
method: HttpMethod.Post,
body: { data, to }
body: dataDecoderRequest
})
}

Expand Down

0 comments on commit b8dc3ca

Please sign in to comment.