Transaction

f9fd98d6ba1071a9be296f5d1d71f2627a602631ca06a36702eaa1e8de5f044d
( - )
129,710
2021-11-03 20:07:39
1
5,430 B

2 Outputs

Total Output:
  • jMg<title>Save File In BSV Blockchain</title> <h1>You have to edit source code and insert your BSV private key and address</h1> <script src=filepay.js></script> <!-- https://unpkg.com/[email protected]/dist/filepay.js --> <script src=FileSaver.js></script> <!-- https://github.com/eligrey/FileSaver.js --> <script> var my_key = '???' var my_address = '???' var my_pubscript = '???' // see https://whatsonchain.com/address/??? or https://api.whatsonchain.com/v1/bsv/main/address/???/info function do_action(action) { // mostly taken from examples from https://github.com/mattercloud/filepay var reader = new FileReader() reader.addEventListener('load', function(event) { var ab = event.target.result if (! confirm('file: ' + f.value + '\nsize: ' + f.files[0].size + ', ' + ab.byteLength + ' bytes\ncontinue to filepay.build?')) { return } var pay_options = { key: my_key, feeb: 0.5 } var data = [ab] if (save_as_memo.checked) { pay_options['feeb'] = 1 if (memo_topic.value == '') {data.unshift('0x6d02')} else {data.unshift('0x6d0c', memo_topic.value)} } if (use_manual_utxos.checked) { pay_options['inputs'] = eval('[\n' + manual_utxos.value + '\n]') } filepay.build({ data: data, pay: pay_options }, function(err, tx) { if (err) { alert('filepay.build error: ' + err) return } if (! confirm('transaction has been created\ntx size: ' + tx.toString().length/2 + ' bytes\nstart the action (' + action + ')?')) { return } if (action == 1) { saveAs(new Blob([tx.toString()]), 'filepay-tx-hex.txt') return } var fetch_url, fetch_options = {method: 'POST'} if (action == 2) { fetch_url = 'https://api.mattercloud.net/api/v3/main/merchants/tx/broadcast' fetch_options['headers'] = {'Content-Type': 'application/json', 'api_key': 'abc'} // see sourse code filepay.js fetch_options['body'] = '{"rawtx": "' + tx.toString() + '"}' } else if (action == 3) { fetch_url = 'https://api.whatsonchain.com/v1/bsv/main/tx/raw' fetch_options['headers'] = {'Content-Type': 'application/json'} fetch_options['body'] = '{"txhex": "' + tx.toString() + '"}' } else if (action == 4) { fetch_url = 'https://api.blockchair.com/bitcoin-sv/push/transaction' fetch_options['headers'] = {'Content-Type': 'application/x-www-form-urlencoded'} fetch_options['body'] = 'data=' + tx.toString() } else if (action == 5) { fetch_url = 'https://merchantapi.mattercloud.io/mapi/tx' fetch_options['headers'] = {'Content-Type': 'application/json'} fetch_options['body'] = '{"rawtx": "' + tx.toString() + '"}' } // https://duckduckgo.com/?q=fetch+api+post fetch(fetch_url, fetch_options) .then(function(response) { console.log('response:', response) return response.json() }) .then(function(response_json) { console.log('response_json:', response_json) }) .catch(error => { console.error('error:', error) }) }) }) reader.readAsArrayBuffer(f.files[0]); } </script> <body> Save File In BSV Blockchain <p> This is a minimal working script, and it doesn't display operation progress and errors.<br> You can see technical information in Developer Tools (in Firefox press Ctrl+Shift+K for console messages, or Ctrl+Shift+E for network connections). <p> <input id=f type=file> <p> <input type=checkbox id=save_as_memo> <label for=save_as_memo>This file is a text post for memo.sv,</label> in the topic: <input id=memo_topic> (optional) <p> <!-- fuck!, mattercloud API broken, it doesn't give unspent outputs https://api.mattercloud.io/api/v3/main/address/...xxx.../utxo --> <input type=checkbox id=use_manual_utxos> <label for=use_manual_utxos>Specify UTXO-s manually (in case when filepay can't get them automatically)</label><br> <script>document.write('You can see UTXO-s here: https://api.whatsonchain.com/v1/bsv/main/address/' + my_address + '/unspent<br>')</script> <textarea style='width: 600px; height: 90px' id=manual_utxos> {script: my_pubscript, // do not change txid: "???", outputIndex: ???, value: ???} // satoshi // ,{...},{...}...</textarea> <p> <select id=action_select> <option value=1>(1) Create transaction and save it as local file for broadcasting later</option> <option value=2>(2) Create and send transaction via original filepay api (mattercloud)</option> <option value=3 selected>(3) Create and send transaction via whatsonchain.com</option> <option value=4>(4) Create and send transaction via blockchair.com</option> <option value=5>(5) Create and send transaction via new mattercloud api (https://developers.mattercloud.io/#merchant-api-mapi)</option> </select> <button onclick=do_action(action_select.value)>Go</button><br> <script>document.write('You can see transactions here: https://whatsonchain.com/address/' + my_address)</script> <p> Texts, pictures, and audio files shouldn't cause problems, but video files will cause problems. All above free sites refused to send files of 10Mb only, although BSV specification allows transactions of 1Gb.<br> TODO: try paid sites:<br> - https://nownodes.io<br> - https://www.taal.com/transaction-processing<br> - https://getblock.io<br> - local node (but system requirements are quite high) </body>
    https://whatsonchain.com/tx/f9fd98d6ba1071a9be296f5d1d71f2627a602631ca06a36702eaa1e8de5f044d