From 73e61b964f5eeb7b99ddfb93e51d24fdd5b4c3dd Mon Sep 17 00:00:00 2001 From: sibelly Date: Tue, 9 May 2023 19:33:20 -0400 Subject: [PATCH 1/3] fixes wrong statement print, changes to console.log one --- content/_code-samples/send-a-memo/js/send-a-memo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/_code-samples/send-a-memo/js/send-a-memo.js b/content/_code-samples/send-a-memo/js/send-a-memo.js index 597287e32a..4f0a477f73 100644 --- a/content/_code-samples/send-a-memo/js/send-a-memo.js +++ b/content/_code-samples/send-a-memo/js/send-a-memo.js @@ -42,7 +42,7 @@ if (typeof module !== "undefined") { }) const signed = wallet.sign(prepared) - print("Submitting a payment transaction with our memo field...") + console.log("Submitting a payment transaction with our memo field...") const submit_result = await client.submitAndWait(signed.tx_blob) xrpl.convertHexToString const tx_MemoData = xrpl.convertHexToString(string=submit_result.result.Memos[0].Memo.MemoData); From b0c03a8a3368c635e47d057bea91eb2bec0d8c0a Mon Sep 17 00:00:00 2001 From: sibelly Date: Tue, 9 May 2023 19:33:51 -0400 Subject: [PATCH 2/3] adds a readme and the package.json to execute the js file --- content/_code-samples/send-a-memo/js/README.md | 7 +++++++ content/_code-samples/send-a-memo/js/package.json | 14 ++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 content/_code-samples/send-a-memo/js/README.md create mode 100644 content/_code-samples/send-a-memo/js/package.json diff --git a/content/_code-samples/send-a-memo/js/README.md b/content/_code-samples/send-a-memo/js/README.md new file mode 100644 index 0000000000..e15d160099 --- /dev/null +++ b/content/_code-samples/send-a-memo/js/README.md @@ -0,0 +1,7 @@ +# JavaScript send Memo examples + +Generates a random account and creates a payment transaction with Memo field. + +### Random seed + + npm start \ No newline at end of file diff --git a/content/_code-samples/send-a-memo/js/package.json b/content/_code-samples/send-a-memo/js/package.json new file mode 100644 index 0000000000..07ff278b02 --- /dev/null +++ b/content/_code-samples/send-a-memo/js/package.json @@ -0,0 +1,14 @@ +{ + "name": "js", + "version": "1.0.0", + "description": "", + "main": "send-a-memo.js", + "scripts": { + "start": "node send-a-memo.js" + }, + "author": "", + "license": "ISC", + "dependencies": { + "xrpl": "^2.0.0" + } +} From bbaf22d650eef22f60c89e9de68ba373b129c672 Mon Sep 17 00:00:00 2001 From: sibelly Date: Thu, 11 May 2023 15:32:07 -0400 Subject: [PATCH 3/3] fixes --- content/_code-samples/send-a-memo/js/package.json | 10 +++++----- content/_code-samples/send-a-memo/js/send-a-memo.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/content/_code-samples/send-a-memo/js/package.json b/content/_code-samples/send-a-memo/js/package.json index 07ff278b02..22d3b185e6 100644 --- a/content/_code-samples/send-a-memo/js/package.json +++ b/content/_code-samples/send-a-memo/js/package.json @@ -1,5 +1,5 @@ { - "name": "js", + "name": "send-a-memo", "version": "1.0.0", "description": "", "main": "send-a-memo.js", @@ -7,8 +7,8 @@ "start": "node send-a-memo.js" }, "author": "", - "license": "ISC", - "dependencies": { - "xrpl": "^2.0.0" - } + "license": "CC0-1.0", + "dependencies": { + "xrpl": "^2.0.0" + } } diff --git a/content/_code-samples/send-a-memo/js/send-a-memo.js b/content/_code-samples/send-a-memo/js/send-a-memo.js index 4f0a477f73..677fd37588 100644 --- a/content/_code-samples/send-a-memo/js/send-a-memo.js +++ b/content/_code-samples/send-a-memo/js/send-a-memo.js @@ -23,7 +23,7 @@ if (typeof module !== "undefined") { // Enter memo data to insert into a transaction const MemoData = xrpl.convertStringToHex(string="Example Memo - 123 -=+"); const MemoType = xrpl.convertStringToHex(string="Text"); - // MemoFormat values: # MemoFormat values: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types + // MemoFormat values: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types const MemoFormat = xrpl.convertStringToHex(string="text/plain"); // Send AccountSet transaction