author_submitExtrinsic
Description
Submits a fully signed extrinsic to the transaction pool. The node validates the payload against current runtime metadata and, if valid, propagates it to peers.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
extrinsic | string | Yes | SCALE-encoded signed extrinsic (0x -prefixed) |
Returns
Field | Type | Description |
---|---|---|
result | string | Hex-encoded extrinsic hash |
Request Example
{
"jsonrpc": "2.0",
"method": "author_submitExtrinsic",
"params": [
"0x280402000b60e2739f9901d4b3a0e3b88b7c25215926bbf7c733f5c31e69c0c8c4b4a86d6ec3f3f086e95d00"
],
"id": 1
}
Response Example
{
"jsonrpc": "2.0",
"result": "0x6dd1dd2b7a1f84c6c44c2ec924a0dd2af429d9d4235ec14debd2994d4c63c9f1",
"id": 1
}
Code Examples
JavaScript (polkadot.js)
import { ApiPromise, WsProvider, Keyring } from '@polkadot/api';
const api = await ApiPromise.create({ provider: new WsProvider('wss://api-bifrost-polkadot.n.dwellir.com/YOUR_API_KEY') });
const keyring = new Keyring({ type: 'sr25519' });
const alice = keyring.addFromUri('//Alice');
const tx = api.tx.balances.transferKeepAlive(
'15mYsj6DpBno58jRoV5HCTiVPFBuWhDLdsWtq3LxwZrfaTEZ',
1_000_000_000_000n
);
const hash = await tx.signAndSend(alice);
console.log('Extrinsic hash', hash.toHex());
Python (py-substrate-interface)
substrate = SubstrateInterface(
url='wss://api-bifrost-polkadot.n.dwellir.com/YOUR_API_KEY'
)
call = substrate.compose_call(
call_module='Balances',
call_function='transfer_keep_alive',
call_params={
'dest': '15mYsj6DpBno58jRoV5HCTiVPFBuWhDLdsWtq3LxwZrfaTEZ',
'value': 1_000_000_000_000
}
)
extrinsic = substrate.create_signed_extrinsic(call=call, keypair=alice)
receipt = substrate.submit_extrinsic(extrinsic, wait_for_inclusion=True)
print('Hash:', receipt.extrinsic_hash)
Tips
- Always use the latest metadata (
state_getMetadata
) to construct calls; outdated metadata leads to1010: Invalid Transaction
. - Monitor the hash via
author_pendingExtrinsics
or block inclusion events to confirm broadcast success.