/transaction/fee-estimate REST API Endpoint
身体参数
tx
字符串
必填
正在加载...
退货
weight
对象
正在加载...
refTime
字符串
正在加载...
proofSize
字符串
正在加载...
class
字符串
正在加载...
partialFee
字符串
正在加载...
请求
1# AssetHub (default) - for transaction fee estimation on AssetHub parachain2curl --location 'https://docs-demo.dot-mainnet.quiknode.pro/transaction/fee-estimate' \3--header 'Content-Type: application/json' \4--header 'Accept: application/json' \5--data '{6"tx": "YOUR_TRANSACTION"7}'89# Polkadot Relaychain - for transaction fee estimation on Relaychain (requires /rc prefix)10curl --location 'https://docs-demo.dot-mainnet.quiknode.pro/rc/transaction/fee-estimate' \11--header 'Content-Type: application/json' \12--header 'Accept: application/json' \13--data '{14"tx": "YOUR_TRANSACTION"15}'
1# AssetHub (default) - for transaction fee estimation on AssetHub parachain2curl --location 'https://docs-demo.dot-mainnet.quiknode.pro/transaction/fee-estimate' \3--header 'Content-Type: application/json' \4--header 'Accept: application/json' \5--data '{6"tx": "YOUR_TRANSACTION"7}'89# Polkadot Relaychain - for transaction fee estimation on Relaychain (requires /rc prefix)10curl --location 'https://docs-demo.dot-mainnet.quiknode.pro/rc/transaction/fee-estimate' \11--header 'Content-Type: application/json' \12--header 'Accept: application/json' \13--data '{14"tx": "YOUR_TRANSACTION"15}'
1// For Polkadot Relaychain access, add '/rc' after https://docs-demo.dot-mainnet.quiknode.pro/ (e.g., https://docs-demo.dot-mainnet.quiknode.pro/rc/accounts/...)23const myHeaders = new Headers();4myHeaders.追加("Content-Type", "application/json");5myHeaders.append("Accept", "application/json");67const raw = JSON.stringify({8"tx": "YOUR_TRANSACTION"9});1011const requestOptions = {12方法: "POST",13标题: myHeaders,14正文: raw,15重定向: "follow"16};1718fetch("{(url}}transaction/fee-estimate", requestOptions)19.然后((响应) => 响应.文本())20.然后((结果) => 控制台.log(result))21.catch((error) => 控制台.错误(error));
1// For Polkadot Relaychain access, add '/rc' after https://docs-demo.dot-mainnet.quiknode.pro/ (e.g., https://docs-demo.dot-mainnet.quiknode.pro/rc/accounts/...)23const myHeaders = new Headers();4myHeaders.追加("Content-Type", "application/json");5myHeaders.append("Accept", "application/json");67const raw = JSON.stringify({8"tx": "YOUR_TRANSACTION"9});1011const requestOptions = {12方法: "POST",13标题: myHeaders,14正文: raw,15重定向: "follow"16};1718fetch("{(url}}transaction/fee-estimate", requestOptions)19.然后((响应) => 响应.文本())20.然后((结果) => 控制台.log(result))21.catch((error) => 控制台.错误(error));
1导入 请求2# For Polkadot Relaychain access, add '/rc' after https://docs-demo.dot-mainnet.quiknode.pro/ (e.g., https://docs-demo.dot-mainnet.quiknode.pro/rc/accounts/...)34import json56url = "{(url}}transaction/fee-estimate"78有效载荷 = json.dumps({9"tx": "YOUR_TRANSACTION"10})11标题 = {12“Content-Type”: 'application/json',13'Accept': 'application/json'14}1516回复 = 请求.请求("POST", url, headers=headers, data=有效载荷)1718打印(响应.text)19
1导入 请求2# For Polkadot Relaychain access, add '/rc' after https://docs-demo.dot-mainnet.quiknode.pro/ (e.g., https://docs-demo.dot-mainnet.quiknode.pro/rc/accounts/...)34import json56url = "{(url}}transaction/fee-estimate"78有效载荷 = json.dumps({9"tx": "YOUR_TRANSACTION"10})11标题 = {12“Content-Type”: 'application/json',13'Accept': 'application/json'14}1516回复 = 请求.请求("POST", url, headers=headers, data=有效载荷)1718打印(响应.text)19
1require "uri"2require "json"3# For Polkadot Relaychain access, add '/rc' after https://docs-demo.dot-mainnet.quiknode.pro/ (e.g., https://docs-demo.dot-mainnet.quiknode.pro/rc/accounts/...)45require "net/http"67url = URI("{(url}}transaction/fee-estimate")89http = Net::HTTP.new(url.主机, url.端口);10请求 = Net::HTTP::POST.new(url)11请求["Content-Type"] = "application/json"12请求[“接受”] = "application/json"13请求.请求体 = JSON.dump({14"tx": "YOUR_TRANSACTION"15})1617回复 = http.请求(请求)18返回响应.read_body19
1require "uri"2require "json"3# For Polkadot Relaychain access, add '/rc' after https://docs-demo.dot-mainnet.quiknode.pro/ (e.g., https://docs-demo.dot-mainnet.quiknode.pro/rc/accounts/...)45require "net/http"67url = URI("{(url}}transaction/fee-estimate")89http = Net::HTTP.new(url.主机, url.端口);10请求 = Net::HTTP::POST.new(url)11请求["Content-Type"] = "application/json"12请求[“接受”] = "application/json"13请求.请求体 = JSON.dump({14"tx": "YOUR_TRANSACTION"15})1617回复 = http.请求(请求)18返回响应.read_body19