POST /streams/rest/v1/streams REST API Endpoint
身体パラメータ
名前
文字列
必須
読み込み中...
ネットワーク
文字列
必須
読み込み中...
dataset
文字列
必須
読み込み中...
filter_function
文字列
読み込み中...
地域
文字列
必須
読み込み中...
usa_eaststart_range
整数
読み込み中...
end_range
整数
読み込み中...
dataset_batch_size
整数
必須
読み込み中...
ステータス
文字列
必須
読み込み中...
activepausedelastic_batch_enabled
ブール値
必須
読み込み中...
fix_block_reorgs
整数
読み込み中...
keep_distance_from_tip
整数
読み込み中...
notification_email
文字列
読み込み中...
destination
文字列
必須
読み込み中...
ウェブフックs3azurepostgresdestination_attributes
オブジェクト
必須
読み込み中...
読み込み中...
url
文字列
必須
読み込み中...
圧縮
文字列
必須
読み込み中...
なしgzipヘッダー
オブジェクト
読み込み中...
key-value
文字列
読み込み中...
max_retry
整数
必須
読み込み中...
retry_interval_sec
整数
必須
読み込み中...
post_timeout_sec
整数
必須
読み込み中...
読み込み中...
エンドポイント
文字列
必須
読み込み中...
access_key
文字列
読み込み中...
secret_key
文字列
必須
読み込み中...
bucket
文字列
必須
読み込み中...
object_prefix
文字列
読み込み中...
file_compression_type
文字列
必須
読み込み中...
なしgzipfile_type
文字列
必須
読み込み中...
.jsonmax_retry
整数
必須
読み込み中...
retry_interval_sec
整数
必須
読み込み中...
use_ssl
ブール値
必須
読み込み中...
読み込み中...
storage_account
文字列
必須
読み込み中...
container
文字列
必須
読み込み中...
sas_token
文字列
必須
読み込み中...
blob_prefix
文字列
読み込み中...
file_compression_type
文字列
必須
読み込み中...
なしgzipfile_type
文字列
必須
読み込み中...
.jsonmax_retry
整数
必須
読み込み中...
retry_interval_sec
整数
必須
読み込み中...
読み込み中...
username
文字列
必須
読み込み中...
password
文字列
必須
読み込み中...
host
文字列
必須
読み込み中...
port
整数
必須
読み込み中...
sslmode
文字列
必須
読み込み中...
requiredisabletable_name
文字列
必須
読み込み中...
max_retry
整数
必須
読み込み中...
retry_interval_sec
整数
必須
読み込み中...
extra_destinations
配列
読み込み中...
destination
文字列
必須
読み込み中...
ウェブフックs3azurepostgresdestination_attributes
オブジェクト
必須
読み込み中...
返品
id
文字列
読み込み中...
created_at
文字列
読み込み中...
updated_at
文字列
読み込み中...
名前
文字列
読み込み中...
ネットワーク
文字列
読み込み中...
dataset
文字列
読み込み中...
地域
文字列
読み込み中...
filter_function
文字列
読み込み中...
start_range
整数
読み込み中...
end_range
整数
読み込み中...
dataset_batch_size
整数
読み込み中...
destination
文字列
読み込み中...
fix_block_reorgs
整数
読み込み中...
keep_distance_from_tip
整数
読み込み中...
destination_attributes
オブジェクト
読み込み中...
読み込み中...
url
文字列
読み込み中...
圧縮
文字列
読み込み中...
ヘッダー
オブジェクト
読み込み中...
key-value
文字列
読み込み中...
max_retry
整数
読み込み中...
retry_interval_sec
整数
読み込み中...
post_timeout_sec
整数
読み込み中...
security_token
文字列
読み込み中...
読み込み中...
エンドポイント
文字列
読み込み中...
access_key
文字列
読み込み中...
secret_key
文字列
読み込み中...
bucket
文字列
読み込み中...
object_prefix
文字列
読み込み中...
file_compression_type
文字列
読み込み中...
file_type
文字列
読み込み中...
max_retry
整数
読み込み中...
retry_interval_sec
整数
読み込み中...
use_ssl
ブール値
読み込み中...
読み込み中...
storage_account
文字列
読み込み中...
container
文字列
読み込み中...
sas_token
文字列
読み込み中...
blob_prefix
文字列
読み込み中...
file_compression_type
文字列
読み込み中...
file_type
文字列
読み込み中...
max_retry
整数
読み込み中...
retry_interval_sec
整数
読み込み中...
読み込み中...
username
文字列
読み込み中...
password
文字列
読み込み中...
host
文字列
読み込み中...
port
整数
読み込み中...
sslmode
文字列
読み込み中...
table_name
文字列
読み込み中...
max_retry
整数
読み込み中...
retry_interval_sec
整数
読み込み中...
ステータス
文字列
読み込み中...
notification_email
文字列
読み込み中...
シーケンス
整数
読み込み中...
current_hash
文字列
読み込み中...
elastic_batch_enabled
ブール値
読み込み中...
extra_destinations
配列
読み込み中...
destination
文字列
読み込み中...
destination_attributes
オブジェクト
読み込み中...
リクエスト
1curl -X POST \2"https://api.quicknode.com/streams/rest/v1/streams" \3-H "accept: application/json" \4-H "Content-Type: application/json" \5-H "x-api-key: YOUR_API_KEY" \6-d $'{7"name": "My Stream",8"network": "ethereum-mainnet",9"dataset": "block",10"filter_function": "ZnVuY3Rpb24gbWFpbihkYXRhKSB7CiAgICB2YXIgbnVtYmVyRGVjaW1hbCA9IHBhcnNlSW50KGRhdGEuc3RyZWFtRGF0YS5udW1iZXIsIDE2KTsKICAgIHZhciBmaWx0ZXJlZERhdGEgPSB7CiAgICAgICAgaGFzaDogZGF0YS5zdHJlYW1EYXRhLmhhc2gsCiAgICAgICAgbnVtYmVyOiBudW1iZXJEZWNpbWFsCiAgICB9OwogICAgcmV0dXJuIGZpbHRlcmVkRGF0YTsKfQ==",11"region": "usa_east",12"start_range": 100,13"end_range": 200,14"dataset_batch_size": 1,15"destination": "webhook",16"fix_block_reorgs": 0,17"keep_distance_from_tip": 0,18"elastic_batch_enabled": true,19"destination_attributes": {20"url": "https://wehook.site",21"compression": "none",22"headers": {23"Content-Type": "Test",24"Authorization": "again"25},26"max_retry": 3,27"retry_interval_sec": 1,28"post_timeout_sec": 1029},30"status": "active"31}'32
1curl -X POST \2"https://api.quicknode.com/streams/rest/v1/streams" \3-H "accept: application/json" \4-H "Content-Type: application/json" \5-H "x-api-key: YOUR_API_KEY" \6-d $'{7"name": "My Stream",8"network": "ethereum-mainnet",9"dataset": "block",10"filter_function": "ZnVuY3Rpb24gbWFpbihkYXRhKSB7CiAgICB2YXIgbnVtYmVyRGVjaW1hbCA9IHBhcnNlSW50KGRhdGEuc3RyZWFtRGF0YS5udW1iZXIsIDE2KTsKICAgIHZhciBmaWx0ZXJlZERhdGEgPSB7CiAgICAgICAgaGFzaDogZGF0YS5zdHJlYW1EYXRhLmhhc2gsCiAgICAgICAgbnVtYmVyOiBudW1iZXJEZWNpbWFsCiAgICB9OwogICAgcmV0dXJuIGZpbHRlcmVkRGF0YTsKfQ==",11"region": "usa_east",12"start_range": 100,13"end_range": 200,14"dataset_batch_size": 1,15"destination": "webhook",16"fix_block_reorgs": 0,17"keep_distance_from_tip": 0,18"elastic_batch_enabled": true,19"destination_attributes": {20"url": "https://wehook.site",21"compression": "none",22"headers": {23"Content-Type": "Test",24"Authorization": "again"25},26"max_retry": 3,27"retry_interval_sec": 1,28"post_timeout_sec": 1029},30"status": "active"31}'32
1const myHeaders = new Headers()2myHeaders.append('accept', 'application/json')3myHeaders.append('Content-Type', 'application/json')4myHeaders.append('x-api-key', 'YOUR_API_KEY') // Replace with your actual API key56const requestOptions = {7method: 'POST',8headers: myHeaders,9redirect: 'follow',10body: JSON.stringify({11name: 'My Stream',12network: 'ethereum-mainnet',13dataset: 'block',14filter_function:15'ZnVuY3Rpb24gbWFpbihkYXRhKSB7CiAgICB2YXIgbnVtYmVyRGVjaW1hbCA9IHBhcnNlSW50KGRhdGEuc3RyZWFtRGF0YS5udW1iZXIsIDE2KTsKICAgIHZhciBmaWx0ZXJlZERhdGEgPSB7CiAgICAgICAgaGFzaDogZGF0YS5zdHJlYW1EYXRhLmhhc2gsCiAgICAgICAgbnVtYmVyOiBudW1iZXJEZWNpbWFsCiAgICB9OwogICAgcmV0dXJuIGZpbHRlcmVkRGF0YTsKfQ==',16region: 'usa_east',17start_range: 100,18end_range: 200,19dataset_batch_size: 1,20destination: 'webhook',21elastic_batch_enabled: true,22fix_block_reorgs: 0,23keep_distance_from_tip: 0,24destination_attributes: {25url: 'https://webhook.site',26compression: 'none',27headers: {28'Content-Type': 'Test',29Authorization: 'again',30},31max_retry: 3,32retry_interval_sec: 1,33post_timeout_sec: 10,34},35status: 'active',36}),37}3839fetch('https://api.quicknode.com/streams/rest/v1/streams', requestOptions)40.then(response => response.text())41.then(result => console.log(result))42.catch(error => console.log('error', error))43
1const myHeaders = new Headers()2myHeaders.append('accept', 'application/json')3myHeaders.append('Content-Type', 'application/json')4myHeaders.append('x-api-key', 'YOUR_API_KEY') // Replace with your actual API key56const requestOptions = {7method: 'POST',8headers: myHeaders,9redirect: 'follow',10body: JSON.stringify({11name: 'My Stream',12network: 'ethereum-mainnet',13dataset: 'block',14filter_function:15'ZnVuY3Rpb24gbWFpbihkYXRhKSB7CiAgICB2YXIgbnVtYmVyRGVjaW1hbCA9IHBhcnNlSW50KGRhdGEuc3RyZWFtRGF0YS5udW1iZXIsIDE2KTsKICAgIHZhciBmaWx0ZXJlZERhdGEgPSB7CiAgICAgICAgaGFzaDogZGF0YS5zdHJlYW1EYXRhLmhhc2gsCiAgICAgICAgbnVtYmVyOiBudW1iZXJEZWNpbWFsCiAgICB9OwogICAgcmV0dXJuIGZpbHRlcmVkRGF0YTsKfQ==',16region: 'usa_east',17start_range: 100,18end_range: 200,19dataset_batch_size: 1,20destination: 'webhook',21elastic_batch_enabled: true,22fix_block_reorgs: 0,23keep_distance_from_tip: 0,24destination_attributes: {25url: 'https://webhook.site',26compression: 'none',27headers: {28'Content-Type': 'Test',29Authorization: 'again',30},31max_retry: 3,32retry_interval_sec: 1,33post_timeout_sec: 10,34},35status: 'active',36}),37}3839fetch('https://api.quicknode.com/streams/rest/v1/streams', requestOptions)40.then(response => response.text())41.then(result => console.log(result))42.catch(error => console.log('error', error))43
1import リクエスト23url = "https://api.quicknode.com/streams/rest/v1/streams"45ペイロード = {6"name": "My Stream",7"network": "ethereum-mainnet",8"dataset": "block",9"filter_function": "ZnVuY3Rpb24gbWFpbihkYXRhKSB7CiAgICB2YXIgbnVtYmVyRGVjaW1hbCA9IHBhcnNlSW50KGRhdGEuc3RyZWFtRGF0YS5udW1iZXIsIDE2KTsKICAgIHZhciBmaWx0ZXJlZERhdGEgPSB7CiAgICAgICAgaGFzaDogZGF0YS5zdHJlYW1EYXRhLmhhc2gsCiAgICAgICAgbnVtYmVyOiBudW1iZXJEZWNpbWFsCiAgICB9OwogICAgcmV0dXJuIGZpbHRlcmVkRGF0YTsKfQ==",10"region": "usa_east",11"start_range": 100,12"end_range": 200,13"dataset_batch_size": 1,14"destination": "webhook",15"fix_block_reorgs": 0,16"keep_distance_from_tip": 0,17"elastic_batch_enabled": True,18"destination_attributes": {19"url": "https://webhook.site",20"compression": "none",21"headers": {22"Content-Type": "Test",23"Authorization": "again"24},25"max_retry": 3,26"retry_interval_sec": 1,27"post_timeout_sec": 1028},29"status": "active"30}3132ヘッダー = {33"accept": "application/json",34"Content-Type": "application/json",35"x-api-key": "YOUR_API_KEY" # Replace with your actual API key36}3738response = requests.post(url, headers=headers, json=payload)3940印刷(レスポンス.text)41
1import リクエスト23url = "https://api.quicknode.com/streams/rest/v1/streams"45ペイロード = {6"name": "My Stream",7"network": "ethereum-mainnet",8"dataset": "block",9"filter_function": "ZnVuY3Rpb24gbWFpbihkYXRhKSB7CiAgICB2YXIgbnVtYmVyRGVjaW1hbCA9IHBhcnNlSW50KGRhdGEuc3RyZWFtRGF0YS5udW1iZXIsIDE2KTsKICAgIHZhciBmaWx0ZXJlZERhdGEgPSB7CiAgICAgICAgaGFzaDogZGF0YS5zdHJlYW1EYXRhLmhhc2gsCiAgICAgICAgbnVtYmVyOiBudW1iZXJEZWNpbWFsCiAgICB9OwogICAgcmV0dXJuIGZpbHRlcmVkRGF0YTsKfQ==",10"region": "usa_east",11"start_range": 100,12"end_range": 200,13"dataset_batch_size": 1,14"destination": "webhook",15"fix_block_reorgs": 0,16"keep_distance_from_tip": 0,17"elastic_batch_enabled": True,18"destination_attributes": {19"url": "https://webhook.site",20"compression": "none",21"headers": {22"Content-Type": "Test",23"Authorization": "again"24},25"max_retry": 3,26"retry_interval_sec": 1,27"post_timeout_sec": 1028},29"status": "active"30}3132ヘッダー = {33"accept": "application/json",34"Content-Type": "application/json",35"x-api-key": "YOUR_API_KEY" # Replace with your actual API key36}3738response = requests.post(url, headers=headers, json=payload)3940印刷(レスポンス.text)41
1require "uri"2require "net/http"3require "json"45# Set up the URL for the request6url = URI("https://api.quicknode.com/streams/rest/v1/streams")78https = ネット::HTTP.new(url.ホスト, url.ポート)9https.use_ssl = true1011リクエスト = ネット::HTTP::POST.new(URL)12リクエスト["accept"] = "application/json"13リクエスト["Content-Type"] = "application/json"14request["x-api-key"] = "YOUR_API_KEY" # Replace with your actual API key1516request.body = {17"name" => "My Stream",18"network" => "ethereum-mainnet",19"dataset" => "block",20"filter_function" => "ZnVuY3Rpb24gbWFpbihkYXRhKSB7CiAgICB2YXIgbnVtYmVyRGVjaW1hbCA9IHBhcnNlSW50KGRhdGEuc3RyZWFtRGF0YS5udW1iZXIsIDE2KTsKICAgIHZhciBmaWx0ZXJlZERhdGEgPSB7CiAgICAgICAgaGFzaDogZGF0YS5zdHJlYW1EYXRhLmhhc2gsCiAgICAgICAgbnVtYmVyOiBudW1iZXJEZWNpbWFsCiAgICB9OwogICAgcmV0dXJuIGZpbHRlcmVkRGF0YTsKfQ==",21"region" => "usa_east",22"start_range" => 100,23"end_range" => 200,24"dataset_batch_size" => 1,25"destination" => "webhook",26"elastic_batch_enabled" => true,27"fix_block_reorgs" => 0,28"keep_distance_from_tip" => 0,29"destination_attributes" => {30"url" => "https://webhook.site",31"compression" => "none",32"headers" => {33"Content-Type" => "Test",34"Authorization" => "again"35},36"max_retry" => 3,37"retry_interval_sec" => 1,38"post_timeout_sec" => 1039},40"status" => "active"41}.to_json4243回答 = https.リクエスト(リクエスト)44レスポンスを格納する。body45
1require "uri"2require "net/http"3require "json"45# Set up the URL for the request6url = URI("https://api.quicknode.com/streams/rest/v1/streams")78https = ネット::HTTP.new(url.ホスト, url.ポート)9https.use_ssl = true1011リクエスト = ネット::HTTP::POST.new(URL)12リクエスト["accept"] = "application/json"13リクエスト["Content-Type"] = "application/json"14request["x-api-key"] = "YOUR_API_KEY" # Replace with your actual API key1516request.body = {17"name" => "My Stream",18"network" => "ethereum-mainnet",19"dataset" => "block",20"filter_function" => "ZnVuY3Rpb24gbWFpbihkYXRhKSB7CiAgICB2YXIgbnVtYmVyRGVjaW1hbCA9IHBhcnNlSW50KGRhdGEuc3RyZWFtRGF0YS5udW1iZXIsIDE2KTsKICAgIHZhciBmaWx0ZXJlZERhdGEgPSB7CiAgICAgICAgaGFzaDogZGF0YS5zdHJlYW1EYXRhLmhhc2gsCiAgICAgICAgbnVtYmVyOiBudW1iZXJEZWNpbWFsCiAgICB9OwogICAgcmV0dXJuIGZpbHRlcmVkRGF0YTsKfQ==",21"region" => "usa_east",22"start_range" => 100,23"end_range" => 200,24"dataset_batch_size" => 1,25"destination" => "webhook",26"elastic_batch_enabled" => true,27"fix_block_reorgs" => 0,28"keep_distance_from_tip" => 0,29"destination_attributes" => {30"url" => "https://webhook.site",31"compression" => "none",32"headers" => {33"Content-Type" => "Test",34"Authorization" => "again"35},36"max_retry" => 3,37"retry_interval_sec" => 1,38"post_timeout_sec" => 1039},40"status" => "active"41}.to_json4243回答 = https.リクエスト(リクエスト)44レスポンスを格納する。body45
1qn stream create --name my-stream \2--network ethereum-mainnet \3--dataset block \4--start 18000000 \5--end -1 \6--region usa-east \7--webhook https://example.com/hook \8--status active \9-o json
1qn stream create --name my-stream \2--network ethereum-mainnet \3--dataset block \4--start 18000000 \5--end -1 \6--region usa-east \7--webhook https://example.com/hook \8--status active \9-o json
1import { QuicknodeSdk, StreamDataset, StreamRegion, StreamStatus } from "@quicknode/sdk"23const qn = new QuicknodeSdk({ apiKey: "YOUR_API_KEY" })45const filterFunction = Buffer.from(`6function main(data) {7return {8hash: data.streamData.hash,9number: parseInt(data.streamData.number, 16),10}11}12`).toString("base64")1314const stream = await qn.streams.createStream({15name: "My Stream",16network: "ethereum-mainnet",17dataset: StreamDataset.Block,18region: StreamRegion.UsaEast,19startRange: 100,20endRange: 200,21datasetBatchSize: 1,22elasticBatchEnabled: true,23fixBlockReorgs: 0,24keepDistanceFromTip: 0,25filterFunction,26status: StreamStatus.Active,27plan: "growth_plan",28thresholdFetchBuffer: 1000,29destinationAttributes: {30destination: "webhook",31attributes: {32url: "https://webhook.site",33compression: "none",34maxRetry: 3,35retryIntervalSec: 1,36postTimeoutSec: 10,37},38},39})4041console.log(stream.id, stream.status)42
1import { QuicknodeSdk, StreamDataset, StreamRegion, StreamStatus } from "@quicknode/sdk"23const qn = new QuicknodeSdk({ apiKey: "YOUR_API_KEY" })45const filterFunction = Buffer.from(`6function main(data) {7return {8hash: data.streamData.hash,9number: parseInt(data.streamData.number, 16),10}11}12`).toString("base64")1314const stream = await qn.streams.createStream({15name: "My Stream",16network: "ethereum-mainnet",17dataset: StreamDataset.Block,18region: StreamRegion.UsaEast,19startRange: 100,20endRange: 200,21datasetBatchSize: 1,22elasticBatchEnabled: true,23fixBlockReorgs: 0,24keepDistanceFromTip: 0,25filterFunction,26status: StreamStatus.Active,27plan: "growth_plan",28thresholdFetchBuffer: 1000,29destinationAttributes: {30destination: "webhook",31attributes: {32url: "https://webhook.site",33compression: "none",34maxRetry: 3,35retryIntervalSec: 1,36postTimeoutSec: 10,37},38},39})4041console.log(stream.id, stream.status)42
1import asyncio2import base643from quicknode_sdk import QuicknodeSdk, SdkFullConfig, StreamWebhookDestination, WebhookAttributes456async def main():7qn = QuicknodeSdk(SdkFullConfig(api_key="YOUR_API_KEY"))89filter_function = base64.b64encode(b"""10function main(data) {11return {12hash: data.streamData.hash,13number: parseInt(data.streamData.number, 16)14};15}16""").decode()1718stream = await qn.streams.create_stream(19name="My Stream",20network="ethereum-mainnet",21dataset="block",22region="usa_east",23start_range=100,24end_range=200,25dataset_batch_size=1,26elastic_batch_enabled=True,27fix_block_reorgs=0,28keep_distance_from_tip=0,29filter_function=filter_function,30status="active",31plan="growth_plan",32threshold_fetch_buffer=1000,33destination_attributes=StreamWebhookDestination(34WebhookAttributes(35url="https://webhook.site",36max_retry=3,37retry_interval_sec=1,38post_timeout_sec=10,39compression="none",40)41),42)4344print(stream.id, stream.status)454647asyncio.run(main()))48
1import asyncio2import base643from quicknode_sdk import QuicknodeSdk, SdkFullConfig, StreamWebhookDestination, WebhookAttributes456async def main():7qn = QuicknodeSdk(SdkFullConfig(api_key="YOUR_API_KEY"))89filter_function = base64.b64encode(b"""10function main(data) {11return {12hash: data.streamData.hash,13number: parseInt(data.streamData.number, 16)14};15}16""").decode()1718stream = await qn.streams.create_stream(19name="My Stream",20network="ethereum-mainnet",21dataset="block",22region="usa_east",23start_range=100,24end_range=200,25dataset_batch_size=1,26elastic_batch_enabled=True,27fix_block_reorgs=0,28keep_distance_from_tip=0,29filter_function=filter_function,30status="active",31plan="growth_plan",32threshold_fetch_buffer=1000,33destination_attributes=StreamWebhookDestination(34WebhookAttributes(35url="https://webhook.site",36max_retry=3,37retry_interval_sec=1,38post_timeout_sec=10,39compression="none",40)41),42)4344print(stream.id, stream.status)454647asyncio.run(main()))48
1require "base64"2require "quicknode_sdk"34qn = QuicknodeSdk::SDK.from_config(api_key: "YOUR_API_KEY")56filter_function = Base64.strict_encode64(<<~JS)7function main(data) {8return {9hash: data.streamData.hash,10number: parseInt(data.streamData.number, 16)11};12}13JS1415destination = QuicknodeSdk::DestinationAttributes.webhook(16url: "https://webhook.site",17max_retry: 3,18retry_interval_sec: 1,19post_timeout_sec: 10,20compression: "none",21)2223stream = qn.streams.create_stream(24name: "My Stream",25network: "ethereum-mainnet",26dataset: "block",27region: "usa_east",28start_range: 100,29end_range: 200,30dataset_batch_size: 1,31elastic_batch_enabled: true,32fix_block_reorgs: 0,33keep_distance_from_tip: 0,34filter_function: filter_function,35status: "active",36plan: "growth_plan",37threshold_fetch_buffer: 1000,38destination_attributes: destination,39)4041puts "#{stream["id"]} #{stream["status"]}"42
1require "base64"2require "quicknode_sdk"34qn = QuicknodeSdk::SDK.from_config(api_key: "YOUR_API_KEY")56filter_function = Base64.strict_encode64(<<~JS)7function main(data) {8return {9hash: data.streamData.hash,10number: parseInt(data.streamData.number, 16)11};12}13JS1415destination = QuicknodeSdk::DestinationAttributes.webhook(16url: "https://webhook.site",17max_retry: 3,18retry_interval_sec: 1,19post_timeout_sec: 10,20compression: "none",21)2223stream = qn.streams.create_stream(24name: "My Stream",25network: "ethereum-mainnet",26dataset: "block",27region: "usa_east",28start_range: 100,29end_range: 200,30dataset_batch_size: 1,31elastic_batch_enabled: true,32fix_block_reorgs: 0,33keep_distance_from_tip: 0,34filter_function: filter_function,35status: "active",36plan: "growth_plan",37threshold_fetch_buffer: 1000,38destination_attributes: destination,39)4041puts "#{stream["id"]} #{stream["status"]}"42
1use quicknode_sdk::{2streams::{3CreateStreamParams, DestinationAttributes, StreamDataset, StreamRegion, StreamStatus,4WebhookAttributes,5},6QuicknodeSdk,7SdkFullConfig,8};910#[tokio::main]11async fn main() -> Result<(), Box<dyn std::error::Error>> {12let qn = QuicknodeSdk::new(&SdkFullConfig::builder().api_key("YOUR_API_KEY").build())?;1314// Base64-encoded:15// function main(data) { return { hash: data.streamData.hash, number: parseInt(data.streamData.number, 16) }; }16let filter_function = "ZnVuY3Rpb24gbWFpbihkYXRhKSB7IHJldHVybiB7IGhhc2g6IGRhdGEuc3RyZWFtRGF0YS5oYXNoLCBudW1iZXI6IHBhcnNlSW50KGRhdGEuc3RyZWFtRGF0YS5udW1iZXIsIDE2KSB9OyB9".to_string();1718let params = CreateStreamParams::builder()19.name("My Stream".to_string())20.network("ethereum-mainnet".to_string())21.dataset(StreamDataset::Block)22.region(StreamRegion::UsaEast)23.start_range(100)24.end_range(200)25.dataset_batch_size(1)26.elastic_batch_enabled(true)27.fix_block_reorgs(0)28.keep_distance_from_tip(0)29.filter_function(filter_function)30.status(StreamStatus::Active)31.plan("growth_plan".to_string())32.threshold_fetch_buffer(1000)33.destination_attributes(DestinationAttributes::Webhook(WebhookAttributes {34url: "https://webhook.site".to_string(),35compression: "none".to_string(),36max_retry: 3,37retry_interval_sec: 1,38post_timeout_sec: 10,39security_token: None,40}))41.build();4243let stream = qn.streams.create_stream(¶ms).await?;4445println!("{} {}", stream.id, stream.status);46OK(())47}48
1use quicknode_sdk::{2streams::{3CreateStreamParams, DestinationAttributes, StreamDataset, StreamRegion, StreamStatus,4WebhookAttributes,5},6QuicknodeSdk,7SdkFullConfig,8};910#[tokio::main]11async fn main() -> Result<(), Box<dyn std::error::Error>> {12let qn = QuicknodeSdk::new(&SdkFullConfig::builder().api_key("YOUR_API_KEY").build())?;1314// Base64-encoded:15// function main(data) { return { hash: data.streamData.hash, number: parseInt(data.streamData.number, 16) }; }16let filter_function = "ZnVuY3Rpb24gbWFpbihkYXRhKSB7IHJldHVybiB7IGhhc2g6IGRhdGEuc3RyZWFtRGF0YS5oYXNoLCBudW1iZXI6IHBhcnNlSW50KGRhdGEuc3RyZWFtRGF0YS5udW1iZXIsIDE2KSB9OyB9".to_string();1718let params = CreateStreamParams::builder()19.name("My Stream".to_string())20.network("ethereum-mainnet".to_string())21.dataset(StreamDataset::Block)22.region(StreamRegion::UsaEast)23.start_range(100)24.end_range(200)25.dataset_batch_size(1)26.elastic_batch_enabled(true)27.fix_block_reorgs(0)28.keep_distance_from_tip(0)29.filter_function(filter_function)30.status(StreamStatus::Active)31.plan("growth_plan".to_string())32.threshold_fetch_buffer(1000)33.destination_attributes(DestinationAttributes::Webhook(WebhookAttributes {34url: "https://webhook.site".to_string(),35compression: "none".to_string(),36max_retry: 3,37retry_interval_sec: 1,38post_timeout_sec: 10,39security_token: None,40}))41.build();4243let stream = qn.streams.create_stream(¶ms).await?;4445println!("{} {}", stream.id, stream.status);46OK(())47}48