This repository was archived by the owner on Feb 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " developer.bitcoin.com" ,
33 "description" : " Bitcoin.com developer resources and documentation" ,
4- "version" : " 3.2.6 " ,
4+ "version" : " 3.2.7 " ,
55 "author" : " Peter <peter@bitcoin.com> and Gabriel Cardona <gabriel@bitcoin.com>" ,
66 "dependencies" : {
77 "badger-components-react" : " ^0.1.3" ,
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ Send a specified amount of BCH to a destination address
1212 - to ` String ` cashaddr address of BCH destination
1313 - from ` String ` cashaddr address of user's address
1414 - value ` String ` BCH amount to send in satoshis
15+ - opReturn ` Object ` (optional)
16+ - Properties
17+ - data ` Array ` data to be encoded in ` nulldata ` output
1518- ` Callback ` with error and response parameters
1619
1720#### Result
@@ -39,6 +42,29 @@ Send a specified amount of BCH to a destination address
3942 })
4043 }
4144
45+ #### ` OP_RETURN ` Example
46+
47+ // write a memo post to the blockchain
48+ if (typeof web4bch !== 'undefined') {
49+ web4bch = new Web4Bch(web4bch.currentProvider)
50+
51+ var txParams = {
52+ to: "bitcoincash:pp8skudq3x5hzw8ew7vzsw8tn4k8wxsqsv0lt0mf3g",
53+ from: web4bch.bch.defaultAccount,
54+ value: "1000",
55+ opReturn: {
56+ data: ["0x4811", "Hello BITBOX"]
57+ }
58+ }
59+ web4bch.bch.sendTransaction(txParams, (err, txid) => {
60+ if (err) {
61+ console.log('send err', err)
62+ } else {
63+ console.log('send success, transaction id:', txid)
64+ }
65+ })
66+ }
67+
4268#### Demo
4369
4470[ Demo Page] ( https://bitcoin-com.github.io/badger-samples/send-bch.html )
You can’t perform that action at this time.
0 commit comments