author_submitExtrinsic - JSON-RPC Method
Description#
Submits a fully formatted and signed extrinsic (transaction) to the Polkadot Asset Hub transaction pool for inclusion in a block. This method is essential for broadcasting transactions to the network.
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
extrinsic | string | Yes | Hex-encoded signed extrinsic to submit to the network |
Returns#
| Field | Type | Description |
|---|---|---|
result | string | Transaction hash of the submitted extrinsic |
Request Example#
{
"jsonrpc": "2.0",
"method": "author_submitExtrinsic",
"params": [
"SIGNED_EXTRINSIC_HEX"
],
"id": 1
}
The placeholder SIGNED_EXTRINSIC_HEX must be replaced with a fresh, signed extrinsic that includes a valid nonce for your account before submission.
Response Example#
{
"jsonrpc": "2.0",
"result": "0x0a3620274b55e0bae28b2e55f28ad0af0a49350d1305b6fff211bad2979751b0",
"id": 1
}
Code Examples#
- cURL
- Python
- JavaScript
curl https://api-asset-hub-polkadot.n.dwellir.com/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "author_submitExtrinsic",
"params": ["SIGNED_EXTRINSIC_HEX"],
"id": 1
}'
import requests
import json
def submit_extrinsic(signed_extrinsic: str) -> str:
url = "https://api-asset-hub-polkadot.n.dwellir.com/YOUR_API_KEY"
headers = {"Content-Type": "application/json"}
payload = {
"jsonrpc": "2.0",
"method": "author_submitExtrinsic",
"params": [signed_extrinsic],
"id": 1,
}
response = requests.post(url, headers=headers, data=json.dumps(payload), timeout=30)
data = response.json()
if "error" in data:
raise RuntimeError(f"RPC Error: {data['error']}")
return data["result"]
# Example usage
signed_hex = "SIGNED_EXTRINSIC_HEX"
tx_hash = submit_extrinsic(signed_hex)
print(f"Transaction hash: {tx_hash}")
const submitExtrinsic = async (signedExtrinsic) => {
const response = await fetch('https://api-asset-hub-polkadot.n.dwellir.com/YOUR_API_KEY', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'author_submitExtrinsic',
params: [signedExtrinsic],
id: 1,
}),
});
const data = await response.json();
return data.result; // Transaction hash
};
// Example usage
const txHash = await submitExtrinsic('SIGNED_EXTRINSIC_HEX');
console.log('Transaction submitted:', txHash);
How to obtain a signed extrinsic#
- Choose a tool — Use Polkadot.js Apps,
@polkadot/api,subxt, or an offline signer that supports the Asset Hub runtime. - Build and sign your call — In Polkadot.js Apps open Developer → Extrinsics, craft the transaction, sign it with an account that has funds, and copy the
Hex-encoded call. With@polkadot/api, callapi.tx.<pallet>.<method>(...).signAsync(account)and then.toHex()on the signed extrinsic. - Submit promptly — Broadcast the freshly signed payload immediately. If you need to retry, increment the nonce and re-sign; replaying the same hex will fail.
- (Optional) Verify in a block — After submission, fetch the containing block via
chain_getBlockto confirm the extrinsic landed as expected.
Need help? Contact our support team or check the Asset Hub documentation.