Bladeren bron

rebase to npm-packages, add README and LICENSE

master
nitowa 2 jaren geleden
bovenliggende
commit
b4169b1bbd
5 gewijzigde bestanden met toevoegingen van 97 en 3552 verwijderingen
  1. 25
    0
      LICENSE.md
  2. 29
    0
      README.md
  3. 29
    3540
      package-lock.json
  4. 12
    10
      package.json
  5. 2
    2
      src/xrpIO/ripple-binding.ts

+ 25
- 0
LICENSE.md Bestand weergeven

@@ -0,0 +1,25 @@
1
+The MIT License (MIT)
2
+=====================
3
+
4
+Copyright © `2022` `nitowa`
5
+
6
+Permission is hereby granted, free of charge, to any person
7
+obtaining a copy of this software and associated documentation
8
+files (the “Software”), to deal in the Software without
9
+restriction, including without limitation the rights to use,
10
+copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+copies of the Software, and to permit persons to whom the
12
+Software is furnished to do so, subject to the following
13
+conditions:
14
+
15
+The above copyright notice and this permission notice shall be
16
+included in all copies or substantial portions of the Software.
17
+
18
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
19
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25
+OTHER DEALINGS IN THE SOFTWARE.

+ 29
- 0
README.md Bestand weergeven

@@ -0,0 +1,29 @@
1
+# Overview 
2
+
3
+[![Build Status](https://drone.nitowa.xyz/api/badges/npm-packages/xrpio/status.svg)](https://drone.nitowa.xyz/npm-packages/xrpio) 
4
+[![Current Version](https://img.shields.io/npm/v/xrpio.svg)](https://www.npmjs.com/package/xrpio)
5
+[![Weekly Downloads](https://img.shields.io/npm/dw/xrpio?color=important)](https://www.npmjs.com/package/xrpio)
6
+[![License Type](https://img.shields.io/npm/l/xrpio?color=blueviolet)](https://gitea.nitowa.xyz/docs/xrpio/src/branch/master/LICENSE.md)
7
+
8
+xrpio is a library that allows you to write and read arbitrary data to the ripple blockchain.
9
+
10
+# How to install
11
+```
12
+npm i xrpio
13
+```
14
+
15
+# Quickstart
16
+```typescript
17
+import {treeRead, treeWrite} from 'xrpio'
18
+
19
+const api = new RippleAPI({ server: "..." }) 
20
+await api.connect()
21
+
22
+const dataRootHash = await treeWrite(api, "Arbitrary string data 123", {address: "Sender address", secret: "Sender private key"}, "Receiver address")
23
+
24
+const data = await treeRead(api, [dataRootHash])
25
+console.log(data) //"Arbitrary string data 123"
26
+
27
+```
28
+
29
+# [Full documentation](https://gitea.nitowa.xyz/docs/xrpio)

+ 29
- 3540
package-lock.json
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 12
- 10
package.json Bestand weergeven

@@ -1,8 +1,8 @@
1 1
 {
2
-  "name": "rjsvm",
3
-  "version": "1.0.0",
4
-  "description": "",
5
-  "main": "lib/Launcher.js",
2
+  "name": "xrpio",
3
+  "version": "0.0.1",
4
+  "description": "XRP arbitrary data writer and reader",
5
+  "main": "lib/src/xrpIO/ripple-bindings.js",
6 6
   "scripts": {
7 7
     "clean": "rm -rf gui/main.js gui/index.html gateway/main.js build lib",
8 8
     "start": "npm run build && npm run launch",
@@ -15,17 +15,17 @@
15 15
     "test": "npm run build && mocha --bail=true ./lib/test/*.js",
16 16
     "deploy": "node ./lib/Deploy.js"
17 17
   },
18
-  "author": "",
19
-  "license": "ISC",
18
+  "author": "nitowa",
19
+  "license": "MIT",
20 20
   "dependencies": {
21
+    "ripple-lib": "^1.9.3"
22
+  },
23
+  "devDependencies": {
21 24
     "@types/chai": "^4.2.21",
22 25
     "@types/mocha": "^8.2.2",
23 26
     "@types/node": "^14.14.37",
24 27
     "chai": "^4.3.4",
25 28
     "node-fetch": "^2.6.1",
26
-    "ripple-lib": "^1.9.3"
27
-  },
28
-  "devDependencies": {
29 29
     "base-64": "^1.0.0",
30 30
     "browserify-zlib": "^0.2.0",
31 31
     "crypto-browserify": "^3.12.0",
@@ -36,6 +36,8 @@
36 36
     "utf8": "^3.0.0",
37 37
     "webpack": "^5.30.0",
38 38
     "webpack-bundle-analyzer": "^4.4.0",
39
-    "webpack-cli": "^4.6.0"
39
+    "webpack-cli": "^4.6.0",
40
+    "typedoc": "^0.15.0",
41
+    "typedoc-plugin-markdown": "^2.2.6"
40 42
   }
41 43
 }

+ 2
- 2
src/xrpIO/ripple-binding.ts Bestand weergeven

@@ -46,7 +46,7 @@ const sendReliably = (api: RippleAPI, signed: any, preparedPayment,): Promise<an
46 46
         status = {
47 47
           finalResult: 'Transaction was not, and never will be, included in a validated ledger'
48 48
         }
49
-        rej(status);
49
+        return rej(status);
50 50
 
51 51
       } else {
52 52
         // Check again later:
@@ -54,7 +54,7 @@ const sendReliably = (api: RippleAPI, signed: any, preparedPayment,): Promise<an
54 54
         return
55 55
       }
56 56
     }
57
-    res(status)
57
+    return res(status)
58 58
   }
59 59
   api.connection.once('ledgerClosed', ledgerClosedCallback)
60 60
 })

Laden…
Annuleren
Opslaan