Fix API docs example for POST /tx endpoint (#707)

* Fix post transactions example.
* Fix post tx endpoint.
This commit is contained in:
Miguel Medeiros 2021-08-12 08:41:23 -03:00 committed by GitHub
parent 398a72c1a6
commit f3b470b63e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 10 deletions

View File

@ -618,19 +618,17 @@ responseSample: `{
postTransaction: { postTransaction: {
codeSample: { codeSample: {
esModule: `const { %{1}: { transactions } } = mempoolJS(); esModule: `const { %{1}: { transactions } } = mempoolJS();
const txid = const txHex = '0200000001fd5b5fcd1cb066c27cfc9fda5428b9be850b81ac440ea51f1ddba2f987189ac1010000008a4730440220686a40e9d2dbffeab4ca1ff66341d06a17806767f12a1fc4f55740a7af24c6b5022049dd3c9a85ac6c51fecd5f4baff7782a518781bbdd94453c8383755e24ba755c01410436d554adf4a3eb03a317c77aa4020a7bba62999df633bba0ea8f83f48b9e01b0861d3b3c796840f982ee6b14c3c4b7ad04fcfcc3774f81bff9aaf52a15751fedfdffffff02416c00000000000017a914bc791b2afdfe1e1b5650864a9297b20d74c61f4787d71d0000000000001976a9140a59837ccd4df25adc31cdad39be6a8d97557ed688ac00000000';
'15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521';
const postTx = await transactions.postTx({ txid }); const postTxid = await transactions.postTx({ txHex });
console.log(postTx); console.log(postTxid);
`, `,
commonJS: `const { %{1}: { transactions } } = mempoolJS(); commonJS: `const { %{1}: { transactions } } = mempoolJS();
const txid = const txHex = '0200000001fd5b5fcd1cb066c27cfc9fda5428b9be850b81ac440ea51f1ddba2f987189ac1010000008a4730440220686a40e9d2dbffeab4ca1ff66341d06a17806767f12a1fc4f55740a7af24c6b5022049dd3c9a85ac6c51fecd5f4baff7782a518781bbdd94453c8383755e24ba755c01410436d554adf4a3eb03a317c77aa4020a7bba62999df633bba0ea8f83f48b9e01b0861d3b3c796840f982ee6b14c3c4b7ad04fcfcc3774f81bff9aaf52a15751fedfdffffff02416c00000000000017a914bc791b2afdfe1e1b5650864a9297b20d74c61f4787d71d0000000000001976a9140a59837ccd4df25adc31cdad39be6a8d97557ed688ac00000000';
'15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521';
const postTx = await transactions.postTx({ txid }); const postTxid = await transactions.postTx({ txHex });
console.log(postTx);`, console.log(postTxid);`,
curl: `curl -X POST "https://mempool.space/api/tx"`, curl: `curl -X POST -d 0200000001fd5b5fcd1cb066c27cfc9fda5428b9be850b81ac440ea51f1ddba2f987189ac1010000008a4730440220686a40e9d2dbffeab4ca1ff66341d06a17806767f12a1fc4f55740a7af24c6b5022049dd3c9a85ac6c51fecd5f4baff7782a518781bbdd94453c8383755e24ba755c01410436d554adf4a3eb03a317c77aa4020a7bba62999df633bba0ea8f83f48b9e01b0861d3b3c796840f982ee6b14c3c4b7ad04fcfcc3774f81bff9aaf52a15751fedfdffffff02416c00000000000017a914bc791b2afdfe1e1b5650864a9297b20d74c61f4787d71d0000000000001976a9140a59837ccd4df25adc31cdad39be6a8d97557ed688ac00000000 "https://mempool.space/api/tx"`,
}, },
responseSample: ``, responseSample: ``,
}, },
@ -1162,7 +1160,6 @@ responseSample: `{
previousRetarget: -4.807005268478962 previousRetarget: -4.807005268478962
}`, }`,
}, },
}; };
constructor( constructor(

View File

@ -91,5 +91,7 @@ pre {
padding: 30px; padding: 30px;
code{ code{
background-color: transparent; background-color: transparent;
white-space: break-spaces;
word-break: break-all;
} }
} }