rebase to npm-packages, add README and LICENSE
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Copyright © `2022` `nitowa`
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person
|
||||||
|
obtaining a copy of this software and associated documentation
|
||||||
|
files (the “Software”), to deal in the Software without
|
||||||
|
restriction, including without limitation the rights to use,
|
||||||
|
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following
|
||||||
|
conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||||
|
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
OTHER DEALINGS IN THE SOFTWARE.
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# Overview
|
||||||
|
|
||||||
|
[](https://drone.nitowa.xyz/npm-packages/xrpio)
|
||||||
|
[](https://www.npmjs.com/package/xrpio)
|
||||||
|
[](https://www.npmjs.com/package/xrpio)
|
||||||
|
[](https://gitea.nitowa.xyz/docs/xrpio/src/branch/master/LICENSE.md)
|
||||||
|
|
||||||
|
xrpio is a library that allows you to write and read arbitrary data to the ripple blockchain.
|
||||||
|
|
||||||
|
# How to install
|
||||||
|
```
|
||||||
|
npm i xrpio
|
||||||
|
```
|
||||||
|
|
||||||
|
# Quickstart
|
||||||
|
```typescript
|
||||||
|
import {treeRead, treeWrite} from 'xrpio'
|
||||||
|
|
||||||
|
const api = new RippleAPI({ server: "..." })
|
||||||
|
await api.connect()
|
||||||
|
|
||||||
|
const dataRootHash = await treeWrite(api, "Arbitrary string data 123", {address: "Sender address", secret: "Sender private key"}, "Receiver address")
|
||||||
|
|
||||||
|
const data = await treeRead(api, [dataRootHash])
|
||||||
|
console.log(data) //"Arbitrary string data 123"
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
# [Full documentation](https://gitea.nitowa.xyz/docs/xrpio)
|
||||||
Generated
+29
-3540
File diff suppressed because it is too large
Load Diff
+12
-10
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "rjsvm",
|
"name": "xrpio",
|
||||||
"version": "1.0.0",
|
"version": "0.0.1",
|
||||||
"description": "",
|
"description": "XRP arbitrary data writer and reader",
|
||||||
"main": "lib/Launcher.js",
|
"main": "lib/src/xrpIO/ripple-bindings.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf gui/main.js gui/index.html gateway/main.js build lib",
|
"clean": "rm -rf gui/main.js gui/index.html gateway/main.js build lib",
|
||||||
"start": "npm run build && npm run launch",
|
"start": "npm run build && npm run launch",
|
||||||
@@ -15,17 +15,17 @@
|
|||||||
"test": "npm run build && mocha --bail=true ./lib/test/*.js",
|
"test": "npm run build && mocha --bail=true ./lib/test/*.js",
|
||||||
"deploy": "node ./lib/Deploy.js"
|
"deploy": "node ./lib/Deploy.js"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "nitowa",
|
||||||
"license": "ISC",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"ripple-lib": "^1.9.3"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
"@types/chai": "^4.2.21",
|
"@types/chai": "^4.2.21",
|
||||||
"@types/mocha": "^8.2.2",
|
"@types/mocha": "^8.2.2",
|
||||||
"@types/node": "^14.14.37",
|
"@types/node": "^14.14.37",
|
||||||
"chai": "^4.3.4",
|
"chai": "^4.3.4",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.1",
|
||||||
"ripple-lib": "^1.9.3"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"base-64": "^1.0.0",
|
"base-64": "^1.0.0",
|
||||||
"browserify-zlib": "^0.2.0",
|
"browserify-zlib": "^0.2.0",
|
||||||
"crypto-browserify": "^3.12.0",
|
"crypto-browserify": "^3.12.0",
|
||||||
@@ -36,6 +36,8 @@
|
|||||||
"utf8": "^3.0.0",
|
"utf8": "^3.0.0",
|
||||||
"webpack": "^5.30.0",
|
"webpack": "^5.30.0",
|
||||||
"webpack-bundle-analyzer": "^4.4.0",
|
"webpack-bundle-analyzer": "^4.4.0",
|
||||||
"webpack-cli": "^4.6.0"
|
"webpack-cli": "^4.6.0",
|
||||||
|
"typedoc": "^0.15.0",
|
||||||
|
"typedoc-plugin-markdown": "^2.2.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ const sendReliably = (api: RippleAPI, signed: any, preparedPayment,): Promise<an
|
|||||||
status = {
|
status = {
|
||||||
finalResult: 'Transaction was not, and never will be, included in a validated ledger'
|
finalResult: 'Transaction was not, and never will be, included in a validated ledger'
|
||||||
}
|
}
|
||||||
rej(status);
|
return rej(status);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Check again later:
|
// Check again later:
|
||||||
@@ -54,7 +54,7 @@ const sendReliably = (api: RippleAPI, signed: any, preparedPayment,): Promise<an
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
res(status)
|
return res(status)
|
||||||
}
|
}
|
||||||
api.connection.once('ledgerClosed', ledgerClosedCallback)
|
api.connection.once('ledgerClosed', ledgerClosedCallback)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user