qan_newFilter
https://rpc-testnet.qanplatform.com/newFilter/
API details
Creates a filter object, based on filter options, to notify when the state changes (logs).
Request body for "qan_newFilter"
The contract address or a list of addresses from which logs should originate
undefined
undefined
undefined
HTTP response status codes for "qan_newFilter"
Status Code | Description |
---|---|
200 | OK |
400 | Bad Request |
404 | Not Found |
422 | Unprocessable Entity |
500 | Internal Server Error |
Code samples for "qan_newFilter"
Request examples
https://rpc-testnet.qanplatform.com/newFilter/
curl --request POST \
--url https://rpc-testnet.qanplatform.com/newFilter/ \
--header 'Accept: application/json, application/problem+json' \
--header 'Content-Type: application/json' \
--data '
{
"FilterObject": {
"Address": "string",
"FromBlock": "string",
"ToBlock": "string",
"Topics": []
}
}
'
const options = {
method: 'POST',
headers: {
Accept: 'application/json, application/problem+json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
FilterObject: {Address: 'string', FromBlock: 'string', ToBlock: 'string', Topics: []}
})
};
fetch('https://rpc-testnet.qanplatform.com/newFilter/', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://rpc-testnet.qanplatform.com/newFilter/"
payload := strings.NewReader("{\"FilterObject\":{\"Address\":\"string\",\"FromBlock\":\"string\",\"ToBlock\":\"string\",\"Topics\":[]}}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "application/json, application/problem+json")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
import requests
url = "https://rpc-testnet.qanplatform.com/newFilter/"
payload = { "FilterObject": {
"Address": "string",
"FromBlock": "string",
"ToBlock": "string",
"Topics": []
} }
headers = {
"Accept": "application/json, application/problem+json",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
HttpResponse<String> response = Unirest.post("https://rpc-testnet.qanplatform.com/newFilter/")
.header("Accept", "application/json, application/problem+json")
.header("Content-Type", "application/json")
.body("{\"FilterObject\":{\"Address\":\"string\",\"FromBlock\":\"string\",\"ToBlock\":\"string\",\"Topics\":[]}}")
.asString();
Responses
Description: OK
Content type: application/json
Example
{
"$schema": "https://rpc-testnet.qanplatform.com/schemas/Output_newFilter.json",
"FilterId": "string"
}
Body
A URL to the JSON Schema for this object.
Example:https://rpc-testnet.qanplatform.com/schemas/Output_newFilter.json
A filter id to be used when calling getFilterChanges
Description: Bad Request
Content type: application/problem+json
Example
{
"$schema": "https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}
Body
A URL to the JSON Schema for this object.
Example:https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json
A human-readable explanation specific to this occurrence of the problem.
Example:Property foo is required but is missing.
Optional list of individual error details
Where the error occurred, e.g. 'body.items3.tags' or 'path.thing-id'
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
Example:https://example.com/error-log/abc123
HTTP status code
Example:400
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
Example:Bad Request
A URI reference to human-readable documentation for the error.
Example:https://example.com/errors/example
Description: Not Found
Content type: application/problem+json
Example
{
"$schema": "https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}
Body
A URL to the JSON Schema for this object.
Example:https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json
A human-readable explanation specific to this occurrence of the problem.
Example:Property foo is required but is missing.
Optional list of individual error details
Where the error occurred, e.g. 'body.items3.tags' or 'path.thing-id'
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
Example:https://example.com/error-log/abc123
HTTP status code
Example:400
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
Example:Bad Request
A URI reference to human-readable documentation for the error.
Example:https://example.com/errors/example
Description: Unprocessable Entity
Content type: application/problem+json
Example
{
"$schema": "https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}
Body
A URL to the JSON Schema for this object.
Example:https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json
A human-readable explanation specific to this occurrence of the problem.
Example:Property foo is required but is missing.
Optional list of individual error details
Where the error occurred, e.g. 'body.items3.tags' or 'path.thing-id'
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
Example:https://example.com/error-log/abc123
HTTP status code
Example:400
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
Example:Bad Request
A URI reference to human-readable documentation for the error.
Example:https://example.com/errors/example
Description: Internal Server Error
Content type: application/problem+json
Example
{
"$schema": "https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}
Body
A URL to the JSON Schema for this object.
Example:https://rpc-testnet.qanplatform.com/schemas/ErrorModel.json
A human-readable explanation specific to this occurrence of the problem.
Example:Property foo is required but is missing.
Optional list of individual error details
Where the error occurred, e.g. 'body.items3.tags' or 'path.thing-id'
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
Example:https://example.com/error-log/abc123
HTTP status code
Example:400
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
Example:Bad Request
A URI reference to human-readable documentation for the error.
Example:https://example.com/errors/example