Fix API docs example for POST /tx endpoint (#707)
				
					
				
			* Fix post transactions example. * Fix post tx endpoint.
This commit is contained in:
		
							parent
							
								
									398a72c1a6
								
							
						
					
					
						commit
						f3b470b63e
					
				@ -618,19 +618,17 @@ responseSample: `{
 | 
			
		||||
    postTransaction: {
 | 
			
		||||
      codeSample: {
 | 
			
		||||
        esModule: `const { %{1}: { transactions } } = mempoolJS();
 | 
			
		||||
  const txid =
 | 
			
		||||
  '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521';
 | 
			
		||||
  const txHex = '0200000001fd5b5fcd1cb066c27cfc9fda5428b9be850b81ac440ea51f1ddba2f987189ac1010000008a4730440220686a40e9d2dbffeab4ca1ff66341d06a17806767f12a1fc4f55740a7af24c6b5022049dd3c9a85ac6c51fecd5f4baff7782a518781bbdd94453c8383755e24ba755c01410436d554adf4a3eb03a317c77aa4020a7bba62999df633bba0ea8f83f48b9e01b0861d3b3c796840f982ee6b14c3c4b7ad04fcfcc3774f81bff9aaf52a15751fedfdffffff02416c00000000000017a914bc791b2afdfe1e1b5650864a9297b20d74c61f4787d71d0000000000001976a9140a59837ccd4df25adc31cdad39be6a8d97557ed688ac00000000';
 | 
			
		||||
 | 
			
		||||
  const postTx = await transactions.postTx({ txid });
 | 
			
		||||
  console.log(postTx);
 | 
			
		||||
  const postTxid = await transactions.postTx({ txHex });
 | 
			
		||||
  console.log(postTxid);
 | 
			
		||||
`,
 | 
			
		||||
        commonJS: `const { %{1}: { transactions } } = mempoolJS();
 | 
			
		||||
        const txid =
 | 
			
		||||
        '15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521';
 | 
			
		||||
        const txHex = '0200000001fd5b5fcd1cb066c27cfc9fda5428b9be850b81ac440ea51f1ddba2f987189ac1010000008a4730440220686a40e9d2dbffeab4ca1ff66341d06a17806767f12a1fc4f55740a7af24c6b5022049dd3c9a85ac6c51fecd5f4baff7782a518781bbdd94453c8383755e24ba755c01410436d554adf4a3eb03a317c77aa4020a7bba62999df633bba0ea8f83f48b9e01b0861d3b3c796840f982ee6b14c3c4b7ad04fcfcc3774f81bff9aaf52a15751fedfdffffff02416c00000000000017a914bc791b2afdfe1e1b5650864a9297b20d74c61f4787d71d0000000000001976a9140a59837ccd4df25adc31cdad39be6a8d97557ed688ac00000000';
 | 
			
		||||
 | 
			
		||||
        const postTx = await transactions.postTx({ txid });
 | 
			
		||||
        console.log(postTx);`,
 | 
			
		||||
        curl: `curl -X POST "https://mempool.space/api/tx"`,
 | 
			
		||||
        const postTxid = await transactions.postTx({ txHex });
 | 
			
		||||
        console.log(postTxid);`,
 | 
			
		||||
        curl: `curl -X POST -d 0200000001fd5b5fcd1cb066c27cfc9fda5428b9be850b81ac440ea51f1ddba2f987189ac1010000008a4730440220686a40e9d2dbffeab4ca1ff66341d06a17806767f12a1fc4f55740a7af24c6b5022049dd3c9a85ac6c51fecd5f4baff7782a518781bbdd94453c8383755e24ba755c01410436d554adf4a3eb03a317c77aa4020a7bba62999df633bba0ea8f83f48b9e01b0861d3b3c796840f982ee6b14c3c4b7ad04fcfcc3774f81bff9aaf52a15751fedfdffffff02416c00000000000017a914bc791b2afdfe1e1b5650864a9297b20d74c61f4787d71d0000000000001976a9140a59837ccd4df25adc31cdad39be6a8d97557ed688ac00000000 "https://mempool.space/api/tx"`,
 | 
			
		||||
      },
 | 
			
		||||
      responseSample: ``,
 | 
			
		||||
    },
 | 
			
		||||
@ -1162,7 +1160,6 @@ responseSample: `{
 | 
			
		||||
  previousRetarget: -4.807005268478962
 | 
			
		||||
}`,
 | 
			
		||||
    },
 | 
			
		||||
    
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  constructor(
 | 
			
		||||
 | 
			
		||||
@ -91,5 +91,7 @@ pre {
 | 
			
		||||
  padding: 30px;
 | 
			
		||||
  code{
 | 
			
		||||
    background-color: transparent;
 | 
			
		||||
    white-space: break-spaces;
 | 
			
		||||
    word-break: break-all;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user