starknet_addDeclareTransaction RPC Method
参数
declare_transaction
对象
必填
正在加载...
类型
字符串
必填
正在加载...
sender_address
字符串
必填
正在加载...
compiled_class_hash
字符串
必填
正在加载...
版本
字符串
必填
正在加载...
签名
字符串
必填
正在加载...
非重复值
字符串
必填
正在加载...
contract_class
对象
必填
正在加载...
sierra_program
数组
必填
正在加载...
contract_class_version
字符串
必填
正在加载...
entry_points_by_type
对象
必填
正在加载...
CONSTRUCTOR
数组
必填
正在加载...
selector
字符串
必填
正在加载...
function_idx
整数
必填
正在加载...
EXTERNAL
数组
必填
正在加载...
selector
字符串
必填
正在加载...
function_idx
整数
必填
正在加载...
L1_HANDLER
数组
必填
正在加载...
selector
字符串
必填
正在加载...
function_idx
整数
必填
正在加载...
abi
字符串
正在加载...
resource_bounds
对象
必填
正在加载...
l1_gas
对象
必填
正在加载...
max_amount
字符串
必填
正在加载...
max_price_per_unit
字符串
必填
正在加载...
l1_data_gas
对象
必填
正在加载...
max_amount
字符串
必填
正在加载...
max_price_per_unit
字符串
必填
正在加载...
l2_gas
对象
必填
正在加载...
max_amount
字符串
必填
正在加载...
max_price_per_unit
字符串
必填
正在加载...
提示
字符串
必填
正在加载...
paymaster_data
数组
必填
正在加载...
account_deployment_data
数组
必填
正在加载...
nonce_data_availability_mode
字符串
必填
正在加载...
fee_data_availability_mode
字符串
必填
正在加载...
退货
结果
对象
正在加载...
交易哈希
字符串
正在加载...
class_hash
字符串
正在加载...
请求
1# Note: You can specify Starknet version in the URL path2# Example: /rpc/v0_9 for version 0.9. Versions 0.6, 0.7, and 0.8 are no longer supported3curl --location 'https://docs-demo.strk-mainnet.quiknode.pro/rpc/v0_9' \4--header 'accept: application/json' \5--header 'content-type: application/json' \6--data '{7"id": 1,8"jsonrpc": "2.0",9"method": "starknet_addDeclareTransaction",10"params": [11{12"type": "DECLARE",13"version": "0x3",14"sender_address": "0x4678eb497e96599c92b45f342c2bd284321fe219c60a9b6293d80f0fbfa61b5",15"signature": [16"0x7cfaae050d6db02b32ddbdb85989e10012504e74b680c9807386f9a1c8807c6",17"0x6e76b70ec1a32a3871516fc500c7478c02287783d075a0fdad6a659b4d2a8c4"18],19"nonce": "0x1",20"compiled_class_hash": "0x6ff9f7df06da94198ee535f9fee21f9b0dcd2e51a4b5bdfa5b4e5b6b3e78ecb",21"contract_class": {22"sierra_program": [23"0x1",24"0x5",25"0x0",26"0x0",27"0x0",28"0x0"29],30"contract_class_version": "0.1.0",31"entry_points_by_type": {32"CONSTRUCTOR": [33{34"selector": "0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194",35"function_idx": 036}37],38"EXTERNAL": [39{40"selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e",41"function_idx": 142}43],44"L1_HANDLER": []45},46"abi": "[{\"type\": \"function\", \"name\": \"transfer\", \"inputs\": [], \"outputs\": []}]"47},48"resource_bounds": {49"l1_gas": {50"max_amount": "0x0",51"max_price_per_unit": "0x38d7ea4c68000"52},53"l1_data_gas": {54"max_amount": "0x1388",55"max_price_per_unit": "0x9184e72a000"56},57"l2_gas": {58"max_amount": "0x7270e00",59"max_price_per_unit": "0x174876e800"60}61},62"tip": "0x0",63"paymaster_data": [],64"account_deployment_data": [],65"nonce_data_availability_mode": "L1",66"fee_data_availability_mode": "L1"67}68]69}'
1# Note: You can specify Starknet version in the URL path2# Example: /rpc/v0_9 for version 0.9. Versions 0.6, 0.7, and 0.8 are no longer supported3curl --location 'https://docs-demo.strk-mainnet.quiknode.pro/rpc/v0_9' \4--header 'accept: application/json' \5--header 'content-type: application/json' \6--data '{7"id": 1,8"jsonrpc": "2.0",9"method": "starknet_addDeclareTransaction",10"params": [11{12"type": "DECLARE",13"version": "0x3",14"sender_address": "0x4678eb497e96599c92b45f342c2bd284321fe219c60a9b6293d80f0fbfa61b5",15"signature": [16"0x7cfaae050d6db02b32ddbdb85989e10012504e74b680c9807386f9a1c8807c6",17"0x6e76b70ec1a32a3871516fc500c7478c02287783d075a0fdad6a659b4d2a8c4"18],19"nonce": "0x1",20"compiled_class_hash": "0x6ff9f7df06da94198ee535f9fee21f9b0dcd2e51a4b5bdfa5b4e5b6b3e78ecb",21"contract_class": {22"sierra_program": [23"0x1",24"0x5",25"0x0",26"0x0",27"0x0",28"0x0"29],30"contract_class_version": "0.1.0",31"entry_points_by_type": {32"CONSTRUCTOR": [33{34"selector": "0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194",35"function_idx": 036}37],38"EXTERNAL": [39{40"selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e",41"function_idx": 142}43],44"L1_HANDLER": []45},46"abi": "[{\"type\": \"function\", \"name\": \"transfer\", \"inputs\": [], \"outputs\": []}]"47},48"resource_bounds": {49"l1_gas": {50"max_amount": "0x0",51"max_price_per_unit": "0x38d7ea4c68000"52},53"l1_data_gas": {54"max_amount": "0x1388",55"max_price_per_unit": "0x9184e72a000"56},57"l2_gas": {58"max_amount": "0x7270e00",59"max_price_per_unit": "0x174876e800"60}61},62"tip": "0x0",63"paymaster_data": [],64"account_deployment_data": [],65"nonce_data_availability_mode": "L1",66"fee_data_availability_mode": "L1"67}68]69}'
1// Note: You can specify Starknet version in the URL path2// Example: /rpc/v0_9 for version 0.9. Versions 0.6, 0.7, and 0.8 are no longer supported3const myHeaders = new Headers();4myHeaders.追加("accept", "application/json");5myHeaders.append("content-type", "application/json");67const raw = JSON.stringify({8"id": 1,9"jsonrpc": "2.0",10"method": "starknet_addDeclareTransaction",11“params”: [12{13"type": "DECLARE",14"version": "0x3",15"sender_address": "0x4678eb497e96599c92b45f342c2bd284321fe219c60a9b6293d80f0fbfa61b5",16"signature": [17"0x7cfaae050d6db02b32ddbdb85989e10012504e74b680c9807386f9a1c8807c6",18"0x6e76b70ec1a32a3871516fc500c7478c02287783d075a0fdad6a659b4d2a8c4"19],20"nonce": "0x1",21"compiled_class_hash": "0x6ff9f7df06da94198ee535f9fee21f9b0dcd2e51a4b5bdfa5b4e5b6b3e78ecb",22"contract_class": {23"sierra_program": [24"0x1",25"0x5",26"0x0",27"0x0",28"0x0",29"0x0"30],31"contract_class_version": "0.1.0",32"entry_points_by_type": {33"CONSTRUCTOR": [34{35"selector": "0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194",36"function_idx": 037}38],39"EXTERNAL": [40{41"selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e",42"function_idx": 143}44],45"L1_HANDLER": []46},47"abi": "[{\"type\": \"function\", \"name\": \"transfer\", \"inputs\": [], \"outputs\": []}]"48},49"resource_bounds": {50"l1_gas": {51"max_amount": "0x0",52"max_price_per_unit": "0x38d7ea4c68000"53},54"l1_data_gas": {55"max_amount": "0x1388",56"max_price_per_unit": "0x9184e72a000"57},58"l2_gas": {59"max_amount": "0x7270e00",60"max_price_per_unit": "0x174876e800"61}62},63"tip": "0x0",64"paymaster_data": [],65"account_deployment_data": [],66"nonce_data_availability_mode": "L1",67"fee_data_availability_mode": "L1"68}69]70});7172const requestOptions = {73方法: "POST",74标题: myHeaders,75正文: raw,76重定向: "follow"77};7879fetch("https://docs-demo.strk-mainnet.quiknode.pro/rpc/v0_9", requestOptions)80.然后((响应) => 响应.文本())81.然后((结果) => 控制台.log(result))82.catch((error) => 控制台.错误(error));
1// Note: You can specify Starknet version in the URL path2// Example: /rpc/v0_9 for version 0.9. Versions 0.6, 0.7, and 0.8 are no longer supported3const myHeaders = new Headers();4myHeaders.追加("accept", "application/json");5myHeaders.append("content-type", "application/json");67const raw = JSON.stringify({8"id": 1,9"jsonrpc": "2.0",10"method": "starknet_addDeclareTransaction",11“params”: [12{13"type": "DECLARE",14"version": "0x3",15"sender_address": "0x4678eb497e96599c92b45f342c2bd284321fe219c60a9b6293d80f0fbfa61b5",16"signature": [17"0x7cfaae050d6db02b32ddbdb85989e10012504e74b680c9807386f9a1c8807c6",18"0x6e76b70ec1a32a3871516fc500c7478c02287783d075a0fdad6a659b4d2a8c4"19],20"nonce": "0x1",21"compiled_class_hash": "0x6ff9f7df06da94198ee535f9fee21f9b0dcd2e51a4b5bdfa5b4e5b6b3e78ecb",22"contract_class": {23"sierra_program": [24"0x1",25"0x5",26"0x0",27"0x0",28"0x0",29"0x0"30],31"contract_class_version": "0.1.0",32"entry_points_by_type": {33"CONSTRUCTOR": [34{35"selector": "0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194",36"function_idx": 037}38],39"EXTERNAL": [40{41"selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e",42"function_idx": 143}44],45"L1_HANDLER": []46},47"abi": "[{\"type\": \"function\", \"name\": \"transfer\", \"inputs\": [], \"outputs\": []}]"48},49"resource_bounds": {50"l1_gas": {51"max_amount": "0x0",52"max_price_per_unit": "0x38d7ea4c68000"53},54"l1_data_gas": {55"max_amount": "0x1388",56"max_price_per_unit": "0x9184e72a000"57},58"l2_gas": {59"max_amount": "0x7270e00",60"max_price_per_unit": "0x174876e800"61}62},63"tip": "0x0",64"paymaster_data": [],65"account_deployment_data": [],66"nonce_data_availability_mode": "L1",67"fee_data_availability_mode": "L1"68}69]70});7172const requestOptions = {73方法: "POST",74标题: myHeaders,75正文: raw,76重定向: "follow"77};7879fetch("https://docs-demo.strk-mainnet.quiknode.pro/rpc/v0_9", requestOptions)80.然后((响应) => 响应.文本())81.然后((结果) => 控制台.log(result))82.catch((error) => 控制台.错误(error));
1# Note: You can specify Starknet version in the URL path2# Example: /rpc/v0_9 for version 0.9. Versions 0.6, 0.7, and 0.8 are no longer supported3import requests4导入 json56url = "https://docs-demo.strk-mainnet.quiknode.pro/rpc/v0_9"78有效载荷 = json.dumps({9"id": 1,10"jsonrpc": "2.0",11"method": "starknet_addDeclareTransaction",12“params”: [13{14"type": "DECLARE",15"version": "0x3",16"sender_address": "0x4678eb497e96599c92b45f342c2bd284321fe219c60a9b6293d80f0fbfa61b5",17"signature": [18"0x7cfaae050d6db02b32ddbdb85989e10012504e74b680c9807386f9a1c8807c6",19"0x6e76b70ec1a32a3871516fc500c7478c02287783d075a0fdad6a659b4d2a8c4"20],21"nonce": "0x1",22"compiled_class_hash": "0x6ff9f7df06da94198ee535f9fee21f9b0dcd2e51a4b5bdfa5b4e5b6b3e78ecb",23"contract_class": {24"sierra_program": [25"0x1",26"0x5",27"0x0",28"0x0",29"0x0",30"0x0"31],32"contract_class_version": "0.1.0",33"entry_points_by_type": {34"CONSTRUCTOR": [35{36"selector": "0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194",37"function_idx": 038}39],40"EXTERNAL": [41{42"selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e",43"function_idx": 144}45],46"L1_HANDLER": []47},48"abi": "[{\"type\": \"function\", \"name\": \"transfer\", \"inputs\": [], \"outputs\": []}]"49},50"resource_bounds": {51"l1_gas": {52"max_amount": "0x0",53"max_price_per_unit": "0x38d7ea4c68000"54},55"l1_data_gas": {56"max_amount": "0x1388",57"max_price_per_unit": "0x9184e72a000"58},59"l2_gas": {60"max_amount": "0x7270e00",61"max_price_per_unit": "0x174876e800"62}63},64"tip": "0x0",65"paymaster_data": [],66"account_deployment_data": [],67"nonce_data_availability_mode": "L1",68"fee_data_availability_mode": "L1"69}70]71})72标题 = {73'accept': 'application/json',74'content-type': 'application/json'75}7677回复 = 请求.请求("POST", url, headers=headers, 数据=有效载荷)7879打印(响应.text)80
1# Note: You can specify Starknet version in the URL path2# Example: /rpc/v0_9 for version 0.9. Versions 0.6, 0.7, and 0.8 are no longer supported3import requests4导入 json56url = "https://docs-demo.strk-mainnet.quiknode.pro/rpc/v0_9"78有效载荷 = json.dumps({9"id": 1,10"jsonrpc": "2.0",11"method": "starknet_addDeclareTransaction",12“params”: [13{14"type": "DECLARE",15"version": "0x3",16"sender_address": "0x4678eb497e96599c92b45f342c2bd284321fe219c60a9b6293d80f0fbfa61b5",17"signature": [18"0x7cfaae050d6db02b32ddbdb85989e10012504e74b680c9807386f9a1c8807c6",19"0x6e76b70ec1a32a3871516fc500c7478c02287783d075a0fdad6a659b4d2a8c4"20],21"nonce": "0x1",22"compiled_class_hash": "0x6ff9f7df06da94198ee535f9fee21f9b0dcd2e51a4b5bdfa5b4e5b6b3e78ecb",23"contract_class": {24"sierra_program": [25"0x1",26"0x5",27"0x0",28"0x0",29"0x0",30"0x0"31],32"contract_class_version": "0.1.0",33"entry_points_by_type": {34"CONSTRUCTOR": [35{36"selector": "0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194",37"function_idx": 038}39],40"EXTERNAL": [41{42"selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e",43"function_idx": 144}45],46"L1_HANDLER": []47},48"abi": "[{\"type\": \"function\", \"name\": \"transfer\", \"inputs\": [], \"outputs\": []}]"49},50"resource_bounds": {51"l1_gas": {52"max_amount": "0x0",53"max_price_per_unit": "0x38d7ea4c68000"54},55"l1_data_gas": {56"max_amount": "0x1388",57"max_price_per_unit": "0x9184e72a000"58},59"l2_gas": {60"max_amount": "0x7270e00",61"max_price_per_unit": "0x174876e800"62}63},64"tip": "0x0",65"paymaster_data": [],66"account_deployment_data": [],67"nonce_data_availability_mode": "L1",68"fee_data_availability_mode": "L1"69}70]71})72标题 = {73'accept': 'application/json',74'content-type': 'application/json'75}7677回复 = 请求.请求("POST", url, headers=headers, 数据=有效载荷)7879打印(响应.text)80
1# Note: You can specify Starknet version in the URL path2# Example: /rpc/v0_9 for version 0.9. Versions 0.6, 0.7, and 0.8 are no longer supported3require "uri"4require "json"5require "net/http"67url = URI("https://docs-demo.strk-mainnet.quiknode.pro/rpc/v0_9")89http = Net::HTTP.new(url.主机, url.端口);10请求 = Net::HTTP::POST.new(网址)11请求["接受"] = "application/json"12request["content-type"] = "application/json"13请求.请求正文 = JSON.dump({14"id": 1,15"jsonrpc": "2.0",16"method": "starknet_addDeclareTransaction",17“params”: [18{19"type": "DECLARE",20"version": "0x3",21"sender_address": "0x4678eb497e96599c92b45f342c2bd284321fe219c60a9b6293d80f0fbfa61b5",22"signature": [23"0x7cfaae050d6db02b32ddbdb85989e10012504e74b680c9807386f9a1c8807c6",24"0x6e76b70ec1a32a3871516fc500c7478c02287783d075a0fdad6a659b4d2a8c4"25],26"nonce": "0x1",27"compiled_class_hash": "0x6ff9f7df06da94198ee535f9fee21f9b0dcd2e51a4b5bdfa5b4e5b6b3e78ecb",28"contract_class": {29"sierra_program": [30"0x1",31"0x5",32"0x0",33"0x0",34"0x0",35"0x0"36],37"contract_class_version": "0.1.0",38"entry_points_by_type": {39"CONSTRUCTOR": [40{41"selector": "0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194",42"function_idx": 043}44],45"EXTERNAL": [46{47"selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e",48"function_idx": 149}50],51"L1_HANDLER": []52},53"abi": "[{\"type\": \"function\", \"name\": \"transfer\", \"inputs\": [], \"outputs\": []}]"54},55"resource_bounds": {56"l1_gas": {57"max_amount": "0x0",58"max_price_per_unit": "0x38d7ea4c68000"59},60"l1_data_gas": {61"max_amount": "0x1388",62"max_price_per_unit": "0x9184e72a000"63},64"l2_gas": {65"max_amount": "0x7270e00",66"max_price_per_unit": "0x174876e800"67}68},69"tip": "0x0",70"paymaster_data": [],71"account_deployment_data": [],72"nonce_data_availability_mode": "L1",73"fee_data_availability_mode": "L1"74}75]76})7778回复 = http.请求(请求)79返回响应.read_body80
1# Note: You can specify Starknet version in the URL path2# Example: /rpc/v0_9 for version 0.9. Versions 0.6, 0.7, and 0.8 are no longer supported3require "uri"4require "json"5require "net/http"67url = URI("https://docs-demo.strk-mainnet.quiknode.pro/rpc/v0_9")89http = Net::HTTP.new(url.主机, url.端口);10请求 = Net::HTTP::POST.new(网址)11请求["接受"] = "application/json"12request["content-type"] = "application/json"13请求.请求正文 = JSON.dump({14"id": 1,15"jsonrpc": "2.0",16"method": "starknet_addDeclareTransaction",17“params”: [18{19"type": "DECLARE",20"version": "0x3",21"sender_address": "0x4678eb497e96599c92b45f342c2bd284321fe219c60a9b6293d80f0fbfa61b5",22"signature": [23"0x7cfaae050d6db02b32ddbdb85989e10012504e74b680c9807386f9a1c8807c6",24"0x6e76b70ec1a32a3871516fc500c7478c02287783d075a0fdad6a659b4d2a8c4"25],26"nonce": "0x1",27"compiled_class_hash": "0x6ff9f7df06da94198ee535f9fee21f9b0dcd2e51a4b5bdfa5b4e5b6b3e78ecb",28"contract_class": {29"sierra_program": [30"0x1",31"0x5",32"0x0",33"0x0",34"0x0",35"0x0"36],37"contract_class_version": "0.1.0",38"entry_points_by_type": {39"CONSTRUCTOR": [40{41"selector": "0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194",42"function_idx": 043}44],45"EXTERNAL": [46{47"selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e",48"function_idx": 149}50],51"L1_HANDLER": []52},53"abi": "[{\"type\": \"function\", \"name\": \"transfer\", \"inputs\": [], \"outputs\": []}]"54},55"resource_bounds": {56"l1_gas": {57"max_amount": "0x0",58"max_price_per_unit": "0x38d7ea4c68000"59},60"l1_data_gas": {61"max_amount": "0x1388",62"max_price_per_unit": "0x9184e72a000"63},64"l2_gas": {65"max_amount": "0x7270e00",66"max_price_per_unit": "0x174876e800"67}68},69"tip": "0x0",70"paymaster_data": [],71"account_deployment_data": [],72"nonce_data_availability_mode": "L1",73"fee_data_availability_mode": "L1"74}75]76})7778回复 = http.请求(请求)79返回响应.read_body80