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

Combining filter in method suix_queryTransactionBlocks returning error #20281

Open
nishit9457 opened this issue Nov 15, 2024 · 4 comments
Open
Labels

Comments

@nishit9457
Copy link

Combining filter in method suix_queryTransactionBlocks returning error. I want to get transactions for a address with certain function. so how can I apply multiple filters. Please guide. Thanks

Payload -
{
"jsonrpc": "2.0",
"id": 1,
"method": "suix_queryTransactionBlocks",
"params": [
{
"filter": {
"FromAddress": "0xfb1e639da7789fa78b5747840f3511f2a1335c8fd11199a0100b8264b85b6a64",
"MoveFunction": {
"function": "request_add_stake",
"module": "sui_system",
"package": "0x0000000000000000000000000000000000000000000000000000000000000003"
}
},
"options": {
"showBalanceChanges": false,
"showEffects": false,
"showEvents": false,
"showInput": false
}
}
]
}

Response -
{
"jsonrpc": "2.0",
"error": {
"code": -32602,
"message": "expected value at line 4 column 99"
},
"id": 1
}

@nishit9457
Copy link
Author

We have gone through live chat and they were suggesting to create metamask wallet then only I'd be able to use API 'suix_queryTransactionBlocks' with multiple filters. I am not sure how those keys would be passed while calling APIs.

Just to clarify, I am using suix_queryTransactionBlocks API to fetch transactions against any random SUI address.

Thanks

@chkdmin
Copy link

chkdmin commented Nov 27, 2024

Can you share more detail? I want to combine filter like your case

@nishit9457
Copy link
Author

hi @chkdmin , sure actually my requirement is to get transactions against any SUI address and a specific function using suix_queryTransactionBlocks API.

For example I need to query only staking transaction against an address so in filter, when I am passing FromAddress as '0xfb1e639da7789fa78b5747840f3511f2a1335c8fd11199a0100b8264b85b6a64' and function as 'request_add_stake'. It is returning below error-

{
"jsonrpc": "2.0",
"error": {
"code": -32602,
"message": "expected value at line 4 column 99"
},
"id": 1
}

@chkdmin
Copy link

chkdmin commented Dec 5, 2024

Oh Thank you for your response. I misunderstood that you had solved the problem.
I'm getting the error when combining filters like you.

I don't think there are any plans on the SUI side to support combined queries.
Following case is querying for events, not transactions, but events also throw errors when combine filters. and they told don't support it.
#16872

I guess I'll have to find another way to solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants
@chkdmin @nishit9457 @stefan-mysten and others