Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApiKit Data Decoder Doesn't Accept "to" #1046

Closed
bh2smith opened this issue Nov 12, 2024 · 0 comments · Fixed by #1058
Closed

ApiKit Data Decoder Doesn't Accept "to" #1046

bh2smith opened this issue Nov 12, 2024 · 0 comments · Fixed by #1058
Assignees
Labels
bug Something isn't working

Comments

@bh2smith
Copy link

I am trying to understand how this SDK method is aligned with the input of the API endpoint:

/**
* Decodes the specified Safe transaction data.
*
* @param data - The Safe transaction data
* @returns The transaction data decoded
* @throws "Invalid data"
* @throws "Not Found"
* @throws "Ensure this field has at least 1 hexadecimal chars (not counting 0x)."
*/
async decodeData(data: string): Promise<any> {
if (data === '') {
throw new Error('Invalid data')
}
return sendRequest({
url: `${this.#txServiceBaseUrl}/v1/data-decoder/`,
method: HttpMethod.Post,
body: { data }
})
}

It only accepts "data"

While the endpoint accepts both to and data:

https://safe-transaction-sepolia.safe.global/#/data-decoder/data_decoder_create

Screenshot 2024-11-12 at 20 03 54
@dasanra dasanra added the bug Something isn't working label Nov 13, 2024
@yagopv yagopv self-assigned this Nov 22, 2024
@yagopv yagopv linked a pull request Nov 25, 2024 that will close this issue
@yagopv yagopv closed this as completed Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants