author_submitExtrinsic - JSON-RPC Method
Description
Broadcasts a signed extrinsic to the Enjin Matrix transaction pool. The node validates the payload and, if valid, gossips it to peers for eventual inclusion in a block. Combine this call with payment_queryInfo
to estimate fees and author_pendingExtrinsics
or author_submitAndWatchExtrinsic
to track status.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
extrinsic | string | Yes | SCALE-encoded, signed extrinsic in hex |
Returns
Field | Type | Description |
---|---|---|
result | string | Transaction hash of the submitted extrinsic |
Request Example
{
"jsonrpc": "2.0",
"method": "author_submitExtrinsic",
"params": [
"0x29028400..."
],
"id": 1
}
Response Example
{
"jsonrpc": "2.0",
"error": {
"code": 1010,
"message": "Invalid Transaction",
"data": "Transaction dispatch is mandatory; transactions must not be validated."
},
"id": 1
}
Code Examples
cURL
curl https://api-enjin-matrixchain.n.dwellir.com/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "author_submitExtrinsic",
"params": ["0x280403000b40c006a99901"],
"id": 1
}'
{
"jsonrpc": "2.0",
"error": {
"code": 1010,
"message": "Invalid Transaction",
"data": "Transaction dispatch is mandatory; transactions must not be validated."
},
"id": 1
}
The sample payload replays an already-finalized remark from block 0x1873093eade39aa409f64537dd972c27156e4691fc0fda227a06d50c52ad5fef
, so the node rejects it with error 1010
. Replace the payload with a freshly signed extrinsic (and correct nonce) to broadcast new transactions.
JavaScript (Polkadot.js)
import { ApiPromise, WsProvider } from '@polkadot/api';
import { Keyring } from '@polkadot/keyring';
const provider = new WsProvider('wss://api-enjin-matrixchain.n.dwellir.com/YOUR_API_KEY');
const api = await ApiPromise.create({ provider });
const keyring = new Keyring({ type: 'sr25519' });
const signer = keyring.addFromUri('//Alice');
const tx = api.tx.balances.transferKeepAlive('efS1ZdvCHHviX7qnTGZEZQX9Uz3qpibG9L5RpF9niM8ne5RBn', 1_000_000_000_000_000_000n);
const hash = await tx.signAndSend(signer);
console.log(`Submitted with hash ${hash.toHex()}`);
Python (py-substrate-interface)
from substrateinterface import Keypair, SubstrateInterface
substrate = SubstrateInterface(
url="wss://api-enjin-matrixchain.n.dwellir.com/YOUR_API_KEY"
)
keypair = Keypair.create_from_uri('//Alice')
call = substrate.compose_call(
call_module='Balances',
call_function='transfer_keep_alive',
call_params={
'dest': 'efS1ZdvCHHviX7qnTGZEZQX9Uz3qpibG9L5RpF9niM8ne5RBn',
'value': 10 ** 18
}
)
extrinsic = substrate.create_signed_extrinsic(call=call, keypair=keypair)
receipt = substrate.submit_extrinsic(extrinsic, wait_for_inclusion=True)
print(receipt.is_success)
Submission Checklist
- Fee estimation – call
payment_queryInfo
with the signed payload before submission. - Correct nonce – fetch via
system_accountNextIndex
orapi.rpc.system.accountNextIndex
. - Tip & priority – consider adding a tip for latency-sensitive mints or marketplace updates.
- Monitoring – watch inclusion via
author_submitAndWatchExtrinsic
or index the hash from block events.