const endpoint = "https://starknet.nownodes.io/";
const apiKey = "YOUR_API_KEY";
async function nownodesRequest(payload) {
const response = await fetch(endpoint, {
method: "POST",
headers: {
"Content-Type": "application/json",
"api-key": apiKey,
},
body: JSON.stringify(payload),
});
return response.json();
}
const result = await nownodesRequest({ jsonrpc: "2.0", method: "starknet_addDeployAccountTransaction", params: [
{
"type": "DEPLOY_ACCOUNT",
"version": "0x3",
"signature": [
"0x4850b6d7c79f24cf36777a8adaa78974897f6b13eb8b8ede63f71671e297aff",
"0x308ce97058625362b84affcf9aaf88cdf090a7b24ca1a5f4f5dc85bd7cbc0cd"
],
"nonce": "0x0",
"contract_address_salt": "0x4f74c6a0d14ac896720dbba50616ab91dd059578f73c12353356c56da6df1d8",
"constructor_calldata": [
"0x0",
"0x4f74c6a0d14ac896720dbba50616ab91dd059578f73c12353356c56da6df1d8",
"0x1"
],
"class_hash": "0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f",
"resource_bounds": {
"l1_data_gas": {
"max_amount": "0x5dc",
"max_price_per_unit": "0x5f6eb0b3f"
},
"l1_gas": {
"max_amount": "0x0",
"max_price_per_unit": "0xc6f3b40b6c000"
},
"l2_gas": {
"max_amount": "0x16e360",
"max_price_per_unit": "0x1dcd65000"
}
},
"tip": "0x0",
"paymaster_data": [],
"nonce_data_availability_mode": "L1",
"fee_data_availability_mode": "L1"
}
], id: 1 });
console.log(result);