starknet_addDeclareTransaction RPC Method
Parameters
declare_transaction
object
REQUIRED
Loading...
type
string
REQUIRED
Loading...
sender_address
string
REQUIRED
Loading...
compiled_class_hash
string
REQUIRED
Loading...
version
string
REQUIRED
Loading...
signature
string
REQUIRED
Loading...
nonce
string
REQUIRED
Loading...
contract_class
object
REQUIRED
Loading...
sierra_program
array
REQUIRED
Loading...
contract_class_version
string
REQUIRED
Loading...
entry_points_by_type
object
REQUIRED
Loading...
CONSTRUCTOR
array
REQUIRED
Loading...
selector
string
REQUIRED
Loading...
function_idx
integer
REQUIRED
Loading...
EXTERNAL
array
REQUIRED
Loading...
selector
string
REQUIRED
Loading...
function_idx
integer
REQUIRED
Loading...
L1_HANDLER
array
REQUIRED
Loading...
selector
string
REQUIRED
Loading...
function_idx
integer
REQUIRED
Loading...
abi
string
Loading...
resource_bounds
object
REQUIRED
Loading...
l1_gas
object
REQUIRED
Loading...
max_amount
string
REQUIRED
Loading...
max_price_per_unit
string
REQUIRED
Loading...
l1_data_gas
object
REQUIRED
Loading...
max_amount
string
REQUIRED
Loading...
max_price_per_unit
string
REQUIRED
Loading...
l2_gas
object
REQUIRED
Loading...
max_amount
string
REQUIRED
Loading...
max_price_per_unit
string
REQUIRED
Loading...
tip
string
REQUIRED
Loading...
paymaster_data
array
REQUIRED
Loading...
account_deployment_data
array
REQUIRED
Loading...
nonce_data_availability_mode
string
REQUIRED
Loading...
fee_data_availability_mode
string
REQUIRED
Loading...
Returns
result
object
Loading...
transaction_hash
string
Loading...
class_hash
string
Loading...
Request
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.append("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 = {73method: "POST",74headers: myHeaders,75body: raw,76redirect: "follow"77};7879fetch("https://docs-demo.strk-mainnet.quiknode.pro/rpc/v0_9", requestOptions)80.then((response) => response.text())81.then((result) => console.log(result))82.catch((error) => console.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.append("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 = {73method: "POST",74headers: myHeaders,75body: raw,76redirect: "follow"77};7879fetch("https://docs-demo.strk-mainnet.quiknode.pro/rpc/v0_9", requestOptions)80.then((response) => response.text())81.then((result) => console.log(result))82.catch((error) => console.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 requests4import json56url = "https://docs-demo.strk-mainnet.quiknode.pro/rpc/v0_9"78payload = 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})72headers = {73'accept': 'application/json',74'content-type': 'application/json'75}7677response = requests.request("POST", url, headers=headers, data=payload)7879print(response.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 requests4import json56url = "https://docs-demo.strk-mainnet.quiknode.pro/rpc/v0_9"78payload = 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})72headers = {73'accept': 'application/json',74'content-type': 'application/json'75}7677response = requests.request("POST", url, headers=headers, data=payload)7879print(response.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.host, url.port);10request = Net::HTTP::Post.new(url)11request["accept"] = "application/json"12request["content-type"] = "application/json"13request.body = 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})7778response = http.request(request)79puts response.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.host, url.port);10request = Net::HTTP::Post.new(url)11request["accept"] = "application/json"12request["content-type"] = "application/json"13request.body = 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})7778response = http.request(request)79puts response.read_body80
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free