POST /streams/rest/v1/streams REST API Endpoint
신체 매개변수
이름
문자열
필수
로딩 중...
네트워크
문자열
필수
로딩 중...
dataset
문자열
필수
로딩 중...
filter_function
문자열
로딩 중...
region
문자열
필수
로딩 중...
usa_eaststart_range
정수
로딩 중...
end_range
정수
로딩 중...
dataset_batch_size
정수
필수
로딩 중...
상태
문자열
필수
로딩 중...
activepausedelastic_batch_enabled
부울
필수
로딩 중...
fix_block_reorgs
정수
로딩 중...
keep_distance_from_tip
정수
로딩 중...
notification_email
문자열
로딩 중...
destination
문자열
필수
로딩 중...
webhooks3azurepostgresdestination_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
문자열
필수
로딩 중...
비밀번호
문자열
필수
로딩 중...
host
문자열
필수
로딩 중...
port
정수
필수
로딩 중...
sslmode
문자열
필수
로딩 중...
requiredisabletable_name
문자열
필수
로딩 중...
max_retry
정수
필수
로딩 중...
retry_interval_sec
정수
필수
로딩 중...
extra_destinations
배열
로딩 중...
destination
문자열
필수
로딩 중...
webhooks3azurepostgresdestination_attributes
객체
필수
로딩 중...
반품
id
문자열
로딩 중...
created_at
문자열
로딩 중...
updated_at
문자열
로딩 중...
이름
문자열
로딩 중...
네트워크
문자열
로딩 중...
dataset
문자열
로딩 중...
region
문자열
로딩 중...
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
문자열
로딩 중...
비밀번호
문자열
로딩 중...
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 = Net::HTTP.new(url.호스트, url.포트)9https.use_ssl = true1011요청 = 순::HTTP::POST.새(URL)12요청["수락"] = "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응답을 넣습니다.본문45
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 = Net::HTTP.new(url.호스트, url.포트)9https.use_ssl = true1011요청 = 순::HTTP::POST.새(URL)12요청["수락"] = "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응답을 넣습니다.본문45
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::빌더().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);46알겠습니다(())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::빌더().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);46알겠습니다(())47}48